Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

choroplethMap.js

Public visualization

Viewing a saved revision (read-only)

c56c5387d5644c9197f36c464ed184dd

choroplethMap.js

0 stars0🌍 Public
NNkwachi Abel
Last edited Jun 3, 2022
Created on Jun 3, 2022

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