Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

d3: Topojson Basemap

Public visualization

d3: Topojson Basemap

0 stars0🌍 Public
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