Skip to main content
Public

Share visualization

Loading preview…

d3: Topojson Basemap

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

d3: Topojson Basemap

0
BBryanA999
Last edited Mar 31, 2022
Created on Mar 31, 2022
Forked from HTML Starter

This example displays a static map of the world’s countries, rendered as gray SVG paths with white borders. The visualization uses d3.v3 to load a TopoJSON file from the world-atlas package and transforms it with the `d3.geo.albersUsa()` projection. The code employs `d3.geo.path()` to convert geographic features into SVG path data, and appends each country as a path element with the class "name". The basemap is positioned within a 900 by 480 pixel SVG canvas, set via `d3.select` and attributes on the root element.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed