You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
client/src/analytics/WorldMap/index.jsx (157 lines) is entirely hand-rolled
and has zero map dependencies:
geo/worldLandPath.js — 22.6 KB of hand-authored SVG path data for the
coastlines
geo/countryCentroids.js — 66 lines of hard-coded lat/lon centroids
geo/regionBounds.js — viewBox maths for zooming to a continent or country
proportional bubbles, sqrt-scaled so area tracks node count (the correct
cartographic convention), Blueprint Tooltip2 on each
That is a genuinely decent piece of work, and it has one property no library
listed below keeps for free: it makes no network request at runtime and has no
third-party dependency. For an app whose whole point is running on somebody
else's Flux node, that is worth more than it looks.
What any replacement must not lose
Listing these because most "prettier map" options quietly drop one:
Click-to-select a country, driving the scope selector and the three
region cards (onSelectCountry).
Zoom-to-scope — selecting Europe reframes the map (regionBounds.js).
The unmapped disclosure — "+N countries not shown (no map coordinates)".
Countries without a centroid are deliberately omitted rather than stacked on
a fallback point, because several unrelated countries on one dot reads as a
real cluster. A library with a complete atlas removes this problem entirely,
which is a genuine win.
D3-geo under a React API. Real country polygons from TopoJSON instead of a
hand-drawn outline, real projections (Natural Earth, Robinson, Mercator), ZoomableGroup for pan/zoom, and Geography gives per-country onClick and
hover for free — so choropsleth shading by node count becomes possible,
which the current bubbles-only map cannot do.
Atlas can be bundled, so the no-runtime-fetch property survives.
Deletes worldLandPath.js and most of countryCentroids.js.
Closest fit to the existing model: still SVG, still our styling, still our
interaction — just accurate geography and a better projection.
2. @visx/geo4.0.0 (MIT)
Airbnb's visx — a thin, modular React wrapper over d3-geo. Same idea as (1)
but less framework and more assembly: you compose Mercator/AlbersUsa and
render the paths yourself. Smaller and more controllable; more code to write.
Good if we want to keep owning the rendering.
3. d3-geo3.1.1 (ISC) alone — smallest change
Keep WorldMap/index.jsx exactly as it is structurally and swap only the
geometry: replace the hand-drawn WORLD_LAND_PATH with a real projection over a
bundled TopoJSON. Every interaction, style and test survives untouched. The
least visual upgrade of the five, but by far the lowest risk, and it alone fixes
the "hand-drawn coastline" problem.
The biggest visual leap — real vector tiles, WebGL, smooth zoom, the
Mapbox-grade look, without Mapbox's licence.
But it needs a tile source. Either a third party (MapTiler and friends, which
means an API key and a runtime call to someone else's server from every
operator's node) or self-hosted tiles in the image. It is also the heaviest
option by a wide margin and brings a WebGL dependency. For a decentralised-
hosting dashboard I think the external-tile dependency is the wrong trade, but
it is the honest answer to "can it look much prettier" — yes, and this is how.
5. cobe2.0.1 (MIT) or react-globe.gl2.38.0 (MIT) — a 3D globe
cobe is a tiny WebGL globe; react-globe.gl is richer (arcs, rings,
per-point interaction) and heavier. A rotating globe with glowing points is
thematically apt for a decentralised network and would be the most striking
thing on the site.
Weaker as a control, though: picking a specific country off a rotating sphere
is worse than clicking a flat map. Best considered as a hero element on
/home alongside the flat map on /analytics, rather than as a replacement for
the tab's selector.
Also considered
echarts 6.1.0 (Apache-2.0) has a strong geo/effectScatter story and would
look good, but it is a large dependency to add for one panel when we use no
charting library of that scale elsewhere. amCharts 5 is excellent and was
ruled out on licensing for a project of this shape.
Suggested approach
Take (1). If it lands well, revisit (5) as a separate Home hero — the two are
complementary, not competing.
Worth prototyping (1) and (3) side by side before committing, since (3) is
nearly free and may already be enough.
Where the map is today
client/src/analytics/WorldMap/index.jsx(157 lines) is entirely hand-rolledand has zero map dependencies:
geo/worldLandPath.js— 22.6 KB of hand-authored SVG path data for thecoastlines
geo/countryCentroids.js— 66 lines of hard-coded lat/lon centroidsgeo/regionBounds.js—viewBoxmaths for zooming to a continent or countrysqrt-scaled so area tracks node count (the correctcartographic convention), Blueprint
Tooltip2on eachThat is a genuinely decent piece of work, and it has one property no library
listed below keeps for free: it makes no network request at runtime and has no
third-party dependency. For an app whose whole point is running on somebody
else's Flux node, that is worth more than it looks.
What any replacement must not lose
Listing these because most "prettier map" options quietly drop one:
region cards (
onSelectCountry).regionBounds.js).Countries without a centroid are deliberately omitted rather than stacked on
a fallback point, because several unrelated countries on one dot reads as a
real cluster. A library with a complete atlas removes this problem entirely,
which is a genuine win.
Five options
Versions and licences checked against npm at time of writing.
1.
react-simple-maps5.0.3 (MIT) +world-atlas2.0.2 (ISC) — recommendedD3-geo under a React API. Real country polygons from TopoJSON instead of a
hand-drawn outline, real projections (Natural Earth, Robinson, Mercator),
ZoomableGroupfor pan/zoom, andGeographygives per-countryonClickandhover for free — so choropsleth shading by node count becomes possible,
which the current bubbles-only map cannot do.
^16.8.0 || 17.x || 18.x || 19.x) — compatible.d3-geo,d3-zoom,d3-selection,d3-interpolate,d3-color,topojson-client.worldLandPath.jsand most ofcountryCentroids.js.Closest fit to the existing model: still SVG, still our styling, still our
interaction — just accurate geography and a better projection.
2.
@visx/geo4.0.0 (MIT)Airbnb's visx — a thin, modular React wrapper over
d3-geo. Same idea as (1)but less framework and more assembly: you compose
Mercator/AlbersUsaandrender the paths yourself. Smaller and more controllable; more code to write.
Good if we want to keep owning the rendering.
3.
d3-geo3.1.1 (ISC) alone — smallest changeKeep
WorldMap/index.jsxexactly as it is structurally and swap only thegeometry: replace the hand-drawn
WORLD_LAND_PATHwith a real projection over abundled TopoJSON. Every interaction, style and test survives untouched. The
least visual upgrade of the five, but by far the lowest risk, and it alone fixes
the "hand-drawn coastline" problem.
4.
maplibre-gl6.9.0 (BSD-3-Clause) (+react-map-gl)The biggest visual leap — real vector tiles, WebGL, smooth zoom, the
Mapbox-grade look, without Mapbox's licence.
But it needs a tile source. Either a third party (MapTiler and friends, which
means an API key and a runtime call to someone else's server from every
operator's node) or self-hosted tiles in the image. It is also the heaviest
option by a wide margin and brings a WebGL dependency. For a decentralised-
hosting dashboard I think the external-tile dependency is the wrong trade, but
it is the honest answer to "can it look much prettier" — yes, and this is how.
5.
cobe2.0.1 (MIT) orreact-globe.gl2.38.0 (MIT) — a 3D globecobeis a tiny WebGL globe;react-globe.glis richer (arcs, rings,per-point interaction) and heavier. A rotating globe with glowing points is
thematically apt for a decentralised network and would be the most striking
thing on the site.
Weaker as a control, though: picking a specific country off a rotating sphere
is worse than clicking a flat map. Best considered as a hero element on
/home alongside the flat map on /analytics, rather than as a replacement for
the tab's selector.
Also considered
echarts6.1.0 (Apache-2.0) has a strong geo/effectScatterstory and wouldlook good, but it is a large dependency to add for one panel when we use no
charting library of that scale elsewhere.
amCharts 5is excellent and wasruled out on licensing for a project of this shape.
Suggested approach
Take (1). If it lands well, revisit (5) as a separate Home hero — the two are
complementary, not competing.
Worth prototyping (1) and (3) side by side before committing, since (3) is
nearly free and may already be enough.