🌍 Public
Viewing a saved revision (read-only)
a8cfed463c7b4be9acb976441ef721cc
Let's make a map with D3.js
This example shows how to create a world map with D3.js, rendering a blue sphere and green country shapes in SVG. The code uses `d3.geoNaturalEarth1` for the map projection and `d3.geoPath` to generate the country outlines from TopoJSON data. It loads the world-atlas dataset from unpkg, converts the TopoJSON to GeoJSON with `topojson.feature`, and appends paths for each country. The visualization is built with D3 v5, using promise-based `d3.json` to asynchronously fetch the geographic data.
AI-generated description