Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Let's make a map with D3.js!

Public visualization

Viewing a saved revision (read-only)

52956de39c464d6faa84c9732db4658d

Let's make a map with D3.js!

0 stars1🌍 Public
Cchaimmaeee
Last edited Nov 26, 2020
Created on Nov 26, 2020

This example demonstrates how to build a world map using D3.js, rendering geographic features as SVG paths with a natural Earth projection. The visualization loads geographic data from an external JSON file and uses the TopoJSON library to parse it before drawing each country or region. D3’s `geoNaturalEarth1` projection defines the map’s perspective, while `geoPath` projects the coordinates onto the screen. The code relies on D3 v5’s `json` method to fetch the data and uses `.enter()` to append the paths, offering a straightforward template for creating choropleth or point-based maps.

AI-generated description