🌍 Public
Viewing a saved revision (read-only)
58b838509518429bbc352a43537f9ecb
Let's make a map with D3.js
This example visualizes world countries as an interactive SVG map using a natural Earth projection. It draws a dark blue sphere background and fills each country with light green polygons outlined in black, based on TopoJSON data from the world-atlas package. The code uses d3.geoNaturalEarth1 for projection, d3.geoPath to generate SVG paths, and topojson.feature to convert TopoJSON topology into GeoJSON features. Countries are appended as SVG path elements via D3’s data join.
AI-generated description