Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Drop the workbook in `data/` named like `Physioshark_Shark Log 2026-2027.xlsx` (
- Follow the dataviz method: categorical slots in fixed order (`--series-1…8`, validated light and dark), sequential = one hue (`--seq-*`), diverging = blue ↔ red with a neutral midpoint, one y-axis only (never dual axes), legends for ≥ 2 series, text in ink tokens (never the series colour), 4 px rounded bar ends, 2 px lines, hover tooltips, data tables via `ChartCard table`.
- Every chart registers its data with the enclosing `ChartCard` (`registerCsv` in `charts/csv.ts`), which shows **Download CSV**. A new chart component must call `registerCsv` too. An explicit `ChartCard table` takes precedence.
- Back every trend, relationship or group difference with a test (#119): compute it in the load function with `analytics/tests.ts` and pass the sentence to `ChartCard stats`. Catch rates: `rateTest`/`rateText` (negative-binomial LRT with log net-hours offset, raw and adjusted for nursery, season and day of the season; pass `skip` for the factor under test). Values across groups: `groupsText` (Kruskal–Wallis). Shares: `tableText` (χ²). One value per season: `trendText`. Scatters: `fitText` (R², p, Spearman) or `rankText`. Copy and findings that name a "best" or "highest" group must check the test first (the moon finding picked the best of eight phases, #118).
- The lab's conventions for chart statistics (Jodie Rummer, #132): p < 0.05 is the threshold. Nursery and season are **fixed effects** in catch-rate tests ("they don't change"). p-values and R² are fine, as are effect sizes with intervals: the site is mainly for Dr Rummer and her lab, so it can stay technical. Each chart is tested on its own; Bonferroni applies only inside the correlation grids on /drivers and /pressure. Whether to also control the false discovery rate across a page is an open question on #132 (on the real data, 2 of the 73 results below 0.05 outside the grids would not survive it).
- Cite the study behind a chart with `<ChartCard papers={['debaere2024lunar']}>` (ids in `src/lib/publications.ts`). Link only papers that analysed the same question with this dataset; check the abstract first. PDFs are served at `rummerlab.com/papers/<file>` (metadata in the rummerlab-website repo, `data/papers.json`).
- Species colours come from `src/lib/species.ts` (blacktip = slot 1, sicklefin lemon = slot 2).
- Charts measure their width (`bind:clientWidth`) and carry a `viewBox` so pre-hydration renders scale down instead of overflowing.
Expand Down
3 changes: 3 additions & 0 deletions src/lib/server/analytics/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* with log(net-hours) as the offset, so long and short sets weigh correctly; "adjusted" adds
* nursery, season and a smooth for the day of the season, the calendar that confounds most
* comparisons (#54). Each helper returns null when there is too little data to test.
*
* The lab's conventions (#132): p < 0.05, nursery and season as fixed effects, p-values and R²
* shown as they are (the site is mainly for the lab). Each chart is tested on its own.
*/
import { num, pValue } from '#lib/format';
import {
Expand Down
8 changes: 8 additions & 0 deletions src/routes/morphometrics/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@
{/if}
{/each}
</p>
{#if data.sexModel.some((m) => m.fit?.nurseryP != null && m.fit.nurseryP < 0.05)}
<p>
Sex was recorded the same way in every season, with claspers checked at each capture, so a
difference between nurseries isn't down to how sex was recorded. The lab knows of no reason
to expect one: nest temperature sets the sex of sea turtles, but nobody has tested whether
anything similar happens in sharks.
</p>
{/if}
<div class="grid-2">
{#each ['Cm', 'Na'] as const as sp (sp)}
{#if nurseryRows(sp).length}
Expand Down
Loading