🌍 Public
Viewing a saved revision (read-only)
08b601d70b8b46d799f13d6c127d97b2
choroplethMap.js
A choropleth map of world countries colored by economy type, rendered with SVG paths projected using D3's `geoNaturalEarth1` and `geoPath`. The legend, built with a reusable `colorLegend` function, displays ordinal color swatches from `schemeSpectral`, and clicking a legend item dims other categories. Data is loaded from the World Atlas TopoJSON and TSV files via `loadAndProcessData`, with country names and economy values appended to each feature. Pan and zoom are enabled through `d3.zoom`, applying transforms to the map group.
AI-generated description