🌍 Public
Viewing a saved revision (read-only)
67c7d3ffe7f846cba9920dd61b4dd380
Let's make a map with D3.js
This example displays a world map rendered as an SVG, with countries filled in green against a dark blue spherical backdrop. It fetches country boundaries from a TopoJSON file via the world-atlas dataset, then projects them using the Hufnagel projection from `d3-geo-projection`. The code builds paths with `d3.geoPath` and `d3.json`, styling the sphere and landmasses through CSS classes. It relies on D3 v5, TopoJSON’s `feature` method, and demonstrates a compact, data-driven mapping workflow.
AI-generated descriptionA basic D3.js map of the world using:
- d3-geo
- topoJSON
- CSS