Skip to content

Charts: map shark moves between nurseries (#173) - #178

Merged
Luen merged 6 commits into
feat/172-season-sliderfrom
feat/173-shark-moves-map
Nov 12, 2026
Merged

Luen merged 6 commits into
feat/172-season-sliderfrom
feat/173-shark-moves-map

Conversation

@Luen

@Luen Luen commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #173. Stacked on #177 (base feat/172-season-slider); GitHub retargets it to main once #177 merges.

What

  • /recaptures → "Moves between nurseries on the map". One line per nursery pair and species (blacktip, sicklefin lemon), both directions pooled, width = number of moves. The popup gives each direction's count and the distance. Circles show recaptures at the same nursery. Moves by sharks with identity conflicts are left out, and the note says how many.
  • /sharks/[id]: the existing "Where it was caught" map now joins consecutive captures at different nurseries, and each circle lists its capture numbers.
  • The copy says the lines join capture sites, not the route swum (gillnet data has no direction or path).
  • InteractiveMap: new lineLayers (one toggle per layer, colours through CSS vars) and lineLabel. Layer visibility is now tracked by key, so toggles survive redraws. MooreaMap: new lines prop for the SSR fallback and the shark page. Both register the lines for CSV.

Checks

pnpm lint, pnpm check, pnpm test, pnpm build, pnpm test:e2e (38 passed). Checked against the real data: 4 blacktip and 2 lemon lines on /recaptures, and a moved shark's page shows its line.

Update: Play on each shark's page

  • A shark that moved between nurseries gets an interactive map with Play and a capture slider. Lines appear as it moves, a dot glides from one capture site to the next, and the caption gives capture number, date, site and length (with "moved from …"). Sharks that stayed at one nursery keep the static map.
  • /recaptures: same-nursery circles are now smaller and grey so the move lines stand out.
  • InteractiveMap: maxRadius, fixed lineMax, and an animated traveller (placed without motion under reduced motion).
  • Re-ran lint, check, test, build and e2e (38 passed). Charts: density map of adult blacktip capture locations (#174) #179's branch has this merged in.

🤖 Generated with Claude Code

/recaptures gets a map with one line per nursery pair and species
(width = moves, both directions pooled) over circles sized by
same-nursery recaptures; sharks with identity conflicts are left out.
Each shark's page joins consecutive captures at different nurseries
and lists capture numbers per site. Copy says the lines join capture
sites, not the route swum.

InteractiveMap gains toggleable line layers and MooreaMap draws lines
in the server-rendered fallback; both offer them as CSV.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A shark that moved between nurseries now gets an interactive map with
Play and a capture slider: lines appear as it moves and a dot glides
from one capture site to the next, with the date, site and length of
each capture. Sharks that stayed put keep the static map.

On /recaptures the same-nursery circles are smaller and grey so the
move lines stand out. InteractiveMap gains maxRadius, a fixed lineMax
and an animated traveller (placed without motion under reduced motion).

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

Luen commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed all six changed files and pushed fixes.

  • [P2] Keep move tooltip labels literal. The new bindTooltip(l.label) also parsed site labels as HTML. Reused the text-only DOM helper from Charts: season slider on the nurseries map (#172) #177 for move labels.
  • [P2] Do not animate across unknown capture locations. track omits unlocated captures, so selecting a known capture after a gap could glide directly from the preceding known location and claim a move from it, although moves correctly draws no line across that gap. Playback now uses a previous location only when the original capture numbers are consecutive; otherwise the dot is placed at the current location.

Both fixes are in d542257. The parent tooltip fix and its browser regression are merged into this branch. Reviewed aggregation, identity-conflict exclusions, playback indexing, SSR fallback and CSV registration; no other actionable defect found.

Validation of the final combined stack: lint, type checks, production build, 126 unit tests and 41 browser tests passed (2 opt-in real-data tests skipped). The tooltip regression explicitly checks that markup remains text. The playback gap guard was checked by code inspection; it has no dedicated browser regression. Changes propagated to #179 and #184, preserving PR bases and merge order. No spreadsheets changed.

@Luen

Luen commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed the current #178 diff and fixed one additional accessibility defect: the new move lines exposed details only to pointer users. Leaflet polylines are not focusable by default, and the SVG fallback's new lines had pointer handlers only.

The fix makes interactive move lines keyboard controls with focus tooltips, visible focus, Enter/Space popups and Escape dismissal. The SVG map uses the repository's shared markKeys/markAt contract for lines and points, including arrow keys, Home/End, Enter on nursery links, and Escape. Two synthetic-data browser regressions cover interactive lines after overlay toggles and the hydrated SVG fallback. Added the Leaflet keyboard caveat to AGENTS.md.

Also checked aggregation, identity-conflict exclusions, the earlier unknown-location playback guard, CSV registration and animation cleanup. No importer or workbook changes.

Fixed in bbb7442. Validation: pnpm lint; pnpm check (0 errors/warnings); pnpm test (118 passed, 2 opt-in tests skipped); opt-in real-data import test (1 passed); pnpm build; pnpm test:e2e (41 passed, including both new keyboard regressions and light/dark axe checks). Review complete. I will carry this parent fix forward while reviewing the dependent map PRs.

@Luen
Luen merged commit 3b6f912 into main Nov 12, 2026
6 checks passed
@Luen
Luen deleted the feat/173-shark-moves-map branch November 12, 2026 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Charts: map shark moves between nurseries and each shark's capture sites

1 participant