Skip to main content
100%

Lets make a world map with D3.js

✓ Published1🌍 Public
NNeepaB
Last edited Dec 21, 2020
Created on Dec 21, 2020

This example shows a natural Earth projection world map, with countries filled in light green against a dark blue sphere, rendered as SVG paths. The code uses D3 v5’s `d3.geoNaturalEarth1` projection and `d3.geoPath` to generate the country outlines, while the TopoJSON library’s `feature` method extracts country geometries from the world-atlas dataset hosted at unpkg. The map is displayed on a 960x500 SVG canvas, with strokes added to differentiate country borders.

AI-generated description
MIT Licensed

Similar vizzes