Skip to content

Charts: nursery month-hour temperature calendars - #136

Merged
Luen merged 3 commits into
mainfrom
codex/127-temperature-heatmaps
Nov 4, 2026
Merged

Luen merged 3 commits into
mainfrom
codex/127-temperature-heatmaps

Conversation

@Luen

@Luen Luen commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Adds a nursery selector and month-by-hour historical temperature heatmap to /water-quality. Cells require ten observed days, use the same 15–40 °C scale across nurseries, and export contributing-day counts alongside temperatures. Copy explains unequal coverage and the limits of pooled means.

Closes #127.

Validation: pnpm lint; pnpm check; pnpm test (81 passed); opt-in real-data import test; production build; Playwright (32 passed, including mobile, keyboard and both-theme axe checks). Real-data support checked in aggregate. No source spreadsheets changed or included.

@Luen Luen added analytics Charts, statistics and analyses design Visual design, theme and charts environment Weather, ocean, tide, climate and astronomy data enhancement New feature or request labels Nov 3, 2026
Luen and others added 2 commits November 4, 2026 12:13
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Colour scale: one domain for every nursery, taken from the supported
  cells in whole degrees (24–33 °C now). On 15–40 °C the lagoon's month-hour
  means (24.7–32.2 °C) used two or three of the seven colour steps, so the
  daily and seasonal pattern barely showed. The legend shows the domain.
- Heatmap: empty cells are dashed outlines, not a pale fill. In dark mode the
  old fill (--surface-2) matched the coolest colour (--seq-1).
- Each nursery's logged days and period under its chart, since coverage
  ranges from 199 days to about 2,500.
- Section moved below the logger overview; MONTH_NAMES reused; no aria-label
  on the legend (the swatches are decorative, the end labels are text).
- AGENTS.md note moved from "Cloud cover" to "Temperature loggers".
- Merged main, which drops the IMPORTER_VERSION bump (no import change here).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Luen Luen left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against the real logger data (aggregates only) and current main. The data handling is right:

  • logger_diel.n really is contributing days. import/insitu.ts adds one nursery-wide hourly mean per day that meets MIN_DAY_HOURS, so the ten-day mask and the "Contributing days" column mean what they say.
  • Month and hour order, local time, the CSV and table, and keyboard access all work.

I pushed fixes in 0ba67bf, after merging main in 42e582e.

1. The 15–40 °C scale hid the pattern. Across the 12 nurseries, the supported month-hour means run from 24.7 to 32.2 °C. The heatmap has seven colour steps, about 3.6 °C each on 15–40, so every nursery used only steps 3–5, and most used just two. The daily cycle and the seasons barely showed. The scale is still the same for every nursery, as #127 asks, but now comes from the supported cells in whole degrees: 24–33 °C on the current data, about 1.3 °C a step. The legend shows that range.

2. Empty cells looked like cool cells in dark mode. An empty cell was --surface-2 (#16243a) at 60%, against --seq-1 (#132a49) for the coolest values. With the narrower scale, the coolest cells use --seq-1. Empty cells are now dashed outlines with no fill, in Heatmap.svelte, which covers #127's "missing cells are visually different from cool cells". The same change helps the other heatmaps: the empty cells on /effort are now clear in dark mode.

3. Coverage per nursery. Nurseries were logged for very different spans, from 199 days (Intercontinental, Nov 2015 to Jun 2016) to about 2,500. Each chart's subtitle now gives its logged days and period, for #127's "disclose differing observation periods".

4. Smaller fixes

  • IMPORTER_VERSION: the bump isn't needed, because there's no import change here. Merging main (already at 9 for #138) drops it from the diff.
  • AGENTS.md: the note was in the middle of "Cloud cover (#104)", splitting its list. It now sits under "Temperature loggers (#10)" and describes the new scale.
  • Placement: the section moves below the logger overview, so the page opens with the overview and then this nursery-by-nursery view.
  • Legend: aria-label is off the legend div. The swatches are hidden from screen readers and the end labels are text. AGENTS.md keeps aria-label for links.
  • Months: the component reuses MONTH_NAMES.
  • Copy: the caveats are in plainer words, with the same content.

Not done. The optional anomaly mode from #127 (deviation from each nursery-month mean). It's fine to leave it for a follow-up.

Checks after the fixes: pnpm lint, pnpm check and pnpm test (92 passed). pnpm build and pnpm test:e2e (32 passed, including the calendar test). I checked /water-quality on the real data in light and dark, plus the other heatmap pages (/drivers, /effort, /nurseries, /pressure, /recaptures, /tides). There were no console errors.

@Luen
Luen merged commit 7bad9e8 into main Nov 4, 2026
5 checks passed
@Luen
Luen deleted the codex/127-temperature-heatmaps branch November 4, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

analytics Charts, statistics and analyses design Visual design, theme and charts enhancement New feature or request environment Weather, ocean, tide, climate and astronomy data

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Environment: add month-by-hour nursery temperature heatmaps

1 participant