Skip to main content
100%

Let's make a map with D3.js

✓ Published0🌍 Public
BbeauMarko
Last edited Aug 15, 2020
Created on Aug 15, 2020

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
MIT Licensed

Similar vizzes