Make a Map: Adding Cheap Tricks
✓ Published1🌍 Public
This example displays a world map using the Natural Earth projection, with countries rendered as green SVG paths with black borders that turn red on hover. It loads geographic data from the world-atlas package—a TopoJSON file for country boundaries and a TSV file for country names, which are merged into a lookup object. The visualization uses D3’s `geoPath` and `geoNaturalEarth1` to generate the map’s geometry, complemented by a dark blue background sphere. Pan and zoom interactions are enabled through D3’s `zoom` event, which transforms the map group accordingly.
AI-generated descriptionD3 course follow along.
MIT Licensed