Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Let's make a map with D3.js!

Public visualization

Fork of Let's make a map with D3.js!

0 stars0🌍 Public
YYeeleng Scott Vang
Last edited Jul 7, 2023
Created on Jul 7, 2023

This example shows a world map rendered with a natural Earth projection, displaying countries as light green polygons on a blue sphere. It uses D3 v5 with `d3.geoNaturalEarth1` for the projection and `d3.geoPath` to generate SVG paths from TopoJSON data loaded from the world-atlas package. The code appends a sphere outline and then iterates over country features, styling them with CSS classes that define fill and stroke properties. The map relies on the `topojson.feature` API to convert TopoJSON topology into GeoJSON features for rendering.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed