diff --git a/AGENTS.md b/AGENTS.md index 0e6fb14..469dfcd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -235,5 +235,6 @@ Questions for the lab go to Dr Jodie Rummer (`@JodieRummer`) on GitHub: label th | 2026-11 | v0.2.10: pressure scores from the Bouyoucos et al. (2024) dataset (#131); year-off recaptures take their set's date (#133); lab statistics conventions (#132) and sex-ratio wording (#130); capture numbers that disagree with the tags go on the Data quality page (#168). | - Security scans (#144): use Snyk CLI >=1.1308.3 with `test --all-projects --dev` for the pnpm 12 multi-document lockfile. Remaining upstream advisories and mitigations are tracked in docs/dev/SNYK-144.md. +- Seasonal comparisons must report dates from their eligible sets, not an assumed October–February window (2020–21 starts in September). ISPF's Moorea hotel-room sales are a visitor proxy, not a count of people on the water. - Leaflet treats string tooltips as HTML. Pass a DOM element populated with `textContent` for workbook-derived point and move labels, including when rebuilding overlays. - Leaflet polylines are pointer-only by default. Keep move paths keyboard-focusable, with focus tooltips and Enter/Space popup handlers; the SVG fallback uses the shared chart `markKeys` contract. diff --git a/src/routes/pressure/+page.server.ts b/src/routes/pressure/+page.server.ts index 44939ed..cf32819 100644 --- a/src/routes/pressure/+page.server.ts +++ b/src/routes/pressure/+page.server.ts @@ -14,6 +14,9 @@ import { mean, median, pairs, se, spearman, welch } from '#lib/stats'; import { rankText, rateTest, rateText } from '#lib/server/analytics/tests'; import type { PageServerLoad } from './$types'; +/** Season sampled while tourism on Moorea was far below normal (ISPF). */ +const LOW_TOURISM_SEASON = '2020-2021'; + export const load: PageServerLoad = () => memo('pressure', (d) => { const eff = effortSets(d); @@ -133,6 +136,25 @@ export const load: PageServerLoad = () => breakDays.map((s) => s.cpue), quiet.map((s) => s.cpue) ); + // The first COVID-19 season (#175). Report its actual eligible dates: sampling does not + // always start in October. One season is confounded with everything else about that year. + const lowTourism = dated.filter((s) => s.season === LOW_TOURISM_SEASON); + const otherSeasons = dated.filter((s) => s.season !== LOW_TOURISM_SEASON); + const lowDates = lowTourism.map((s) => s.date!).sort(); + const covid = lowTourism.length + ? { + season: LOW_TOURISM_SEASON, + first: lowDates[0], + last: lowDates.at(-1)!, + groups: [group(lowTourism, 'low'), group(otherSeasons, 'other')], + test: rateTest( + dated, + { groupOf: (s) => (s.season === LOW_TOURISM_SEASON ? 'low' : 'other') }, + 'cpue', + ['season'] + ) + } + : null; const holidaySets = new Map(); const breakSets = new Map(); for (const s of dated) { @@ -153,7 +175,8 @@ export const load: PageServerLoad = () => human: scatter('human', 'growth'), composite: scatter('composite', 'cpueCm'), dayType: rateText(rateTest(dated, { groupOf: (s) => type(s) }), 'types of day'), - weekday: rateText(rateTest(dated, { groupOf: (s) => s.weekday }), 'days of the week') + weekday: rateText(rateTest(dated, { groupOf: (s) => s.weekday }), 'days of the week'), + covid: covid ? rateText(covid.test, 'the 2020–21 season and the others') : null }; return { stats, @@ -161,6 +184,18 @@ export const load: PageServerLoad = () => metrics, outcomes: outcomes.map((o) => o[1]), corr, + covid: covid + ? { + season: covid.season, + first: covid.first, + last: covid.last, + groups: covid.groups, + ratio: + covid.groups[0].mean != null && covid.groups[1].mean + ? round(covid.groups[0].mean / covid.groups[1].mean, 2) + : null + } + : null, busyDays: { byType, byWeekday, diff --git a/src/routes/pressure/+page.svelte b/src/routes/pressure/+page.svelte index c12c782..e8a1845 100644 --- a/src/routes/pressure/+page.svelte +++ b/src/routes/pressure/+page.svelte @@ -4,7 +4,7 @@ import BarChart from '#lib/components/charts/BarChart.svelte'; import Heatmap from '#lib/components/charts/Heatmap.svelte'; import Scatter from '#lib/components/charts/Scatter.svelte'; - import { num } from '#lib/format'; + import { date, num, season } from '#lib/format'; import { SPECIES } from '#lib/species'; import type { PageProps } from './$types'; @@ -170,6 +170,49 @@ + {#if data.covid} + {@const c = data.covid} +
+

A season with few visitors

+

+ Hotel room sales on Moorea fell by more than half in 2020 (ISPF), a proxy for fewer visitors + rather than a count of people on the water. The {season(c.season)} comparison uses timed sets + from {date(c.first)} to {date(c.last)}, after borders first reopened in July 2020, while + visitor numbers were still far below normal. Its catch rate was {num(c.groups[0].mean, 2)} sharks + per net-hour against {num(c.groups[1].mean, 2)} in the other seasons{c.ratio != null + ? ` (${num(c.ratio, 2)} times)` + : ''}. +

+ + `${g.label === 'low' ? season(c.season) : 'Other seasons'} (${g.n})` + )} + series={[ + { + name: 'Sharks / net-hour', + color: 'var(--series-1)', + values: c.groups.map((g) => g.mean) + } + ]} + errors={c.groups.map((g) => (g.lo != null && g.hi != null ? [g.lo, g.hi] : null))} + valueFormat={(v) => num(v, 2)} + /> + +

+ Tourism figure: Institut de la statistique de la Polynésie française, + Bilan du tourisme 2020. An island-level tourism time series is not yet included on this site. +

+
+ {/if} +

Busy days