Skip to main content
100%

D3 World Map

✓ Published1🌍 Public
YYoung Song
Last edited Jun 23, 2022
Created on Jun 19, 2022
Forked from Fork of D3 Face2

This example renders a world map using D3.js and TopoJSON, displaying country boundaries as light green polygons on a light blue sphere outline. The code demonstrates multiple geographic projections—Mercator, Orthographic, Stereographic, and Natural Earth—by sequentially assigning them to a single `d3.geoPath` generator, though only the final Natural Earth projection is visualized. Country features are loaded from the `world-atlas` dataset via `d3.json` and converted with TopoJSON’s `feature` method. The map is drawn as SVG paths with light styling for stroke and opacity.

AI-generated description
  • Loading and parsing TOPOJSON
  • Rendering geographic features
  • Using different map projections
  • Rendering the projected sphere outline
  • Tweaking map styles
  • npm world-atlas
MIT Licensed

Similar vizzes