Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Country Map by using JavaScript

Public visualization

Country Map by using JavaScript

0 stars0🌍 Public
DDanthalakirankumar
Last edited Apr 3, 2022
Created on Apr 3, 2022

This example shows a single country, the United States of America, rendered as a green SVG path on a blue background. It uses D3 v5’s `d3.geoAlbersUsa` projection and `d3.geoPath` to generate the map geometry. The code fetches world country boundaries from the world-atlas TopoJSON dataset, filters for the USA by name, and draws the path onto the SVG canvas. The `topojson` library’s `feature` method converts the TopoJSON data into GeoJSON for path generation.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed