Skip to main content
Public

Share visualization

Loading preview…

Let's make a 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

Let's make a map with D3.js!

0
KKarkG
Last edited Aug 5, 2020
Created on Aug 5, 2020

This example shows a world map rendered as a colored sphere with light-green countries outlined in black, using an SVG canvas. The code builds the visualization with D3 v5 and TopoJSON, fetching geographic data from the world-atlas package. It applies a natural Earth projection via `d3.geoNaturalEarth1`, generates paths with `d3.geoPath`, and converts TopoJSON topology to GeoJSON features using the `feature` function. The sphere itself is drawn as a single path with a blue fill, while country boundaries use a thin stroke.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed