Skip to content

Charts: direction arrows on shark move lines (#182) - #184

Merged
Luen merged 5 commits into
feat/174-adult-densityfrom
feat/182-move-arrows
Nov 12, 2026
Merged

Luen merged 5 commits into
feat/174-adult-densityfrom
feat/182-move-arrows

Conversation

@Luen

@Luen Luen commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Closes #182. Stacked on #179 → #178 → #177; merge those first (GitHub retargets this to main as they land).

What

  • Arrowheads on every move line, in the line's colour with a thin white edge, placed 60% of the way along so they stay clear of the circles at both ends.
  • Both directions: when A → B and B → A are both drawn, the two lines shift to either side of their direction of travel. Because the arrows sit at 60%, the two arrows also land at different points. On a shark's page, a there-and-back shark (e.g. 955000004999522: Apaura → Vaiane → Apaura) now shows two parallel lines with opposite arrows.
  • /recaptures: one line per direction instead of pooling both. Width = moves that way; the popup reads "A → B · n moves · km".
  • Leaflet: an SVG <marker> per line layer, set as marker-mid on each path. Offsets are in screen pixels and recomputed on zoom. smoothFactor: 0 stops Leaflet simplifying away the arrow's vertex. SSR MooreaMap: the same thing with <polyline> and marker-mid.
  • Shared geometry in src/lib/components/lineGeometry.ts, with unit tests.
  • No new dependencies and no CSP change.

Not covered

Checks

pnpm lint, pnpm check, pnpm test, pnpm build, pnpm test:e2e (38 passed). Checked against the real data: the shark page (two directions, zoomed in) and /recaptures (6 directed lines, all with arrows, no console errors).

🤖 Generated with Claude Code

Move lines now carry an arrowhead 60% of the way along, clear of the
circles at either end, in the line's colour. When a move is drawn in
both directions the two lines split to either side, so there-and-back
moves (Apaura -> Vaiane -> Apaura) show both arrows instead of one on
top of the other. Leaflet offsets are in pixels and redrawn on zoom;
line simplification is off so the arrow point survives.

/recaptures draws one line per direction (width = moves that way)
instead of pooling both. Shared geometry lives in lineGeometry.ts,
with unit tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Luen
Luen added this pull request to stack #181 November 11, 2026 00:05
@Luen

Luen commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed all seven changed files, including reversed-pair geometry, direction offsets, SVG marker setup, directed move aggregation and SSR rendering. No additional actionable defect found in this PR's own changes. The unshifted playback dot is an already documented limitation.

Merged the reviewed fixes from #177–#179 into this branch: literal-text point/move tooltips, no playback animation across unknown capture locations, and visible GPS exclusion notices when the adult map has no usable points. Current head: aa03b4b. The branch's arrow implementation is preserved.

Validation: lint, type checks (0 errors/warnings), production build, 126 unit tests and all 41 browser tests passed. Browser regressions cover tooltip HTML injection and the two empty-GPS cases. Two opt-in real-data tests were skipped; private workbook results were not independently reproduced. All updates were fast-forward pushes to the existing branches; PR bases and merge order are unchanged. No merge or deployment performed.

@Luen

Luen commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed #184's directed aggregation, reverse-pair detection, screen-pixel offsets, marker definitions/IDs, midpoint preservation, zoom redraw and SVG fallback. No additional defect found in the arrow implementation itself. The documented playback dot still follows the center line.

Merged the reviewed parent changes from #179 and resolved conflicts in both map components: directed geometry/marker-mid arrows are preserved alongside #178's keyboard access, text-only tooltips and SVG markKeys controls. Added a synthetic browser regression that zooms the map, checks that each move path references an existing arrow marker, and opens move details from the keyboard after redraw. The initial path must contain the interior vertex needed for marker-mid.

Final head d3592f0. Validation: pnpm lint; pnpm check (0 errors/warnings); pnpm test (126 passed, 2 opt-in tests skipped); opt-in real-data import test (1 passed); pnpm build; pnpm test:e2e (44 passed, including the new zoom regression, inherited keyboard/tooltip/GPS regressions, and light/dark axe checks). Merge resolution and test pushed. Review complete; no spreadsheets changed.

@Luen
Luen merged commit 5610eb3 into main Nov 12, 2026
6 checks passed
@Luen
Luen deleted the feat/182-move-arrows 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: direction arrows on shark move lines

1 participant