Skip to content

Show similarity comparison maps on /routes page - #117

Merged
vbhjckfd merged 1 commit into
masterfrom
route-similarity-comparison-maps
Aug 23, 2026
Merged

Show similarity comparison maps on /routes page#117
vbhjckfd merged 1 commit into
masterfrom
route-similarity-comparison-maps

Conversation

@vbhjckfd

Copy link
Copy Markdown
Owner

Summary

  • Each similar-route entry (top-5 by shared-stop Jaccard similarity) now expands into a Leaflet map comparing both routes: straight stop-to-stop lines per route colour, shared stops drawn as split blue/red dots, non-shared stops grey, plus a legend.
  • Moved the shared-stop <ul> list from server-rendered HTML to client-side JS (built on first expand), cutting /routes payload from ~1.57MB to ~1.03MB — that markup was 43% of the page.
  • Both the new comparison maps and the existing per-route detail maps (last column) now have a fullscreen button.

Test plan

  • npx vitest run tests/actions/getAllRoutesAction.test.js (6 passed)
  • npx vitest run full suite (212 passed)
  • Rendered /routes against the real DB, verified emitted <script> blocks parse and execute cleanly against a stubbed Leaflet
  • Manual browser check: expand a similar-route entry, confirm map sizes correctly, fullscreen toggles, shared stops render as split dots

Each similar-route entry now expands into a small Leaflet map showing
both routes' stops (straight-line connections, shared stops highlighted
as split blue/red dots, non-shared stops grey) plus a legend. Moving the
shared-stop list to the client cuts /routes payload from ~1.57MB to
~1.03MB. Both the comparison maps and the existing per-route detail maps
get a fullscreen button.
@vbhjckfd
vbhjckfd merged commit 42ae47c into master Aug 23, 2026
4 checks passed
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.

1 participant