feat(map): Important Links overlay (rebase of #1771 onto master) - #1928
Merged
Conversation
…wbot#672 / D) Add a public, toggleable map overlay that draws the most IMPORTANT affinity links between nodes, weighted by the Kpa-clawbot#672 repeater-usefulness axes — so terrain-level chokepoints (the sole link across a valley) stand out geographically. Distinct from the API-key-gated Affinity Debug overlay, which it is modeled on but leaves untouched. Frontend-only, no server change. It joins the already-loaded `nodes` array (coords + usefulness/bridge/redundancy/traffic scores from /api/nodes) with the public /api/analytics/neighbor-graph edges: importance(edge, axis) = edge.affinity × mean(endpoint axis scores) (axis = "affinity" → the raw edge affinity) Ranks edges descending, draws the top-N (slider, default 50) as polylines whose width/opacity scale with importance; endpoints without GPS or zero importance are dropped. Controls (in the map controls panel): a toggle, a "Rank by" select (Usefulness composite / Bridge / Redundancy / Traffic / Affinity), and a Top-N slider; axis + N persist to localStorage. The B weighting "lights up" once the Kpa-clawbot#672 scores are deployed; before that the Affinity axis still shows links. test-top-routes-overlay.js executes the pure ranking core (computeTopRouteEdges) against fixtures — importance math, axis-dependent reordering, top-N, GPS/zero-score skips — plus grep pins for the DOM wiring. Wired into test-all.sh.
…desktop count (Kpa-clawbot#1771 overlay)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continues #1771 by @ArcanConsulting. Both commits are theirs, authorship unchanged; I only rebased them onto current master. Opening it here rather than force-pushing to someone else's branch.
Why the rebase was needed
#1771 went CONFLICTING through no fault of its author: #1760 landed first and both PRs append a line to
test-all.shat the same spot. That was the entire conflict.What I changed
One line, and it is the conflict resolution:
test-all.shnow runs both test files rather than either.Nothing else was touched.
public/map.jsandtest-issue-1329-map-controls-accordion-e2e.jsare byte-for-byte as the author wrote them.Verification on the rebased tree
test-top-routes-overlay.js(this PR's own)test-repeater-metric-scatter.js(#1760's, must still pass)test-frontend-helpers.jsThe one review point that still stands
From my review on #1771, unchanged by the rebase and not something I fixed on the author's behalf:
test-top-routes-overlay.jsextracts the ranking core byindexOf-slicingpublic/map.jsbetween the literalsconst TOP_ROUTES_AXESandfunction clearTopRoutes, thennew Functions the result. There is a guard assertion for the rename case, which is thoughtful, but it still breaks on any reordering of map.js and it tests a string rather than the module.Two PRs in this same queue do it properly and are worth copying: #1821 exports
applyObserverFilterthrough_packetsTestAPI, and #1912 putshashPrefixInfoonwindow.Happy to take that as a follow-up rather than block the overlay on it.
@ArcanConsulting — this is your work and the credit is yours. Say the word and I will close this and hand the rebase back, or push it to your branch instead if you would rather #1771 stayed the vehicle.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Wzwr3eXseyNM7Xj598djjE