Skip to main content
100%

Map of Spain

✓ Published0🌍 Public
OOluoch Odhiambo
Last edited Apr 12, 2023
Created on Apr 11, 2023
Forked from D3 Starter

This example displays a map of Spain, projected using a Mercator projection and rendered as a single SVG path element. It loads world country boundaries from a TopoJSON file hosted on jsDelivr, then extracts Spain’s geometry using `topojson.feature`. The code uses `d3.geoMercator()` with `fitSize` to scale and center the map, and `d3.geoPath()` to generate the SVG path data. It demonstrates loading external GeoJSON/TopoJSON data asynchronously with `d3.json` and appending the result to an SVG canvas.

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes