Skip to main content
Public

Share visualization

Loading preview…

Lets make a world map with D3.js

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Lets make a world map with D3.js

1
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

Comments

Sign in to join the discussion.

MIT Licensed