Skip to main content
100%

Cheap tricks with interaction with a map with D3.js!

✓ Published1🌍 Public
Fforcox43
Last edited Jul 15, 2020
Created on Jul 15, 2020

This example displays a natural Earth projection of the world map, rendered as SVG paths filled with light green and hover effects that turn countries red. It loads country boundaries from the world-atlas TopoJSON and TSV data on unpkg, joining IDs to names. The visualization implements zooming and panning through the `d3.zoom` API, applying the interaction transform to all country paths. Code uses `d3.geoPath` with the `geoNaturalEarth1` projection, the `topojson` feature extraction library, and React-style imports from `d3` and `topojson`.

AI-generated description

//deo-geo-projection on github: // need to include as src on index.html: <script src ='https://d3js.org/d3-geo-projection.v2.min.js"></script>

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes