Skip to content

Fix: spread connections map dots across each country - #28

Merged
SandObserver merged 1 commit into
mainfrom
fix/connections-map-dot-spread
Aug 10, 2026
Merged

SandObserver merged 1 commit into
mainfrom
fix/connections-map-dot-spread

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Replace the closest-to-centroid dot selection in paintRegions with stratified sampling: one dot per occupied cell of a grid over the country's dot footprint, at a resolution that grows until it can supply the number of dots needed.
  • Draw a share of each country's dots from its capital's neighbourhood, with the share scaling down as the dot count rises, so one user reads as a point on the capital and a busy country as nationwide coverage.
  • Add a CAP table of capital coordinates for the countries in the embedded dot set, at a tenth of a degree; countries with no entry fall back to their dot-cloud centroid as the anchor.
  • Keep the existing dot-count formula, the active/activeInfo keying, and the poll and redraw lifecycle unchanged.

Testing
All green: backend and frontend suites, coverage gate, lint, format, both typechecks, path map and cache-busting checks. Verified the new selection against the embedded dot data for all 123 countries across connection counts from 1 to 500: exact dot counts, no duplicates, every dot inside its own country, and a full-world repaint in under a millisecond.

Checklist

  • Stays within the project constraints: one container, no runtime dependencies, no build step (see CONTRIBUTING.md).
  • Tests added or updated for new logic, and the full suite, lint, and typechecks pass.
  • Docs updated if behavior or configuration changed.
  • CHANGELOG.md updated under Unreleased if the change is user-visible.

Highlighted dots per country were the n nearest the dot-cloud centroid, so a
rising connection count thickened one clump at the country's centre instead of
reading as wider coverage.

Select dots from a grid over the country's dot footprint, one per occupied
cell, at a resolution that grows with the number needed. A share of the dots is
drawn from the capital's neighbourhood, shrinking as the count rises, so a
country with one user reads as a point on its capital and a busy one as
nationwide coverage.

Add capital coordinates for the countries in the embedded dot set, at a tenth
of a degree, which is finer than a dot cell resolves.
@SandObserver SandObserver added bug Something isn't working ui/ux UI, UX, and accessibility only fix labels Aug 10, 2026
@SandObserver
SandObserver merged commit e36f51a into main Aug 10, 2026
4 checks passed
@SandObserver
SandObserver deleted the fix/connections-map-dot-spread branch August 10, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ui/ux UI, UX, and accessibility only fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant