Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Map with Selectable Countries

Public visualization

Viewing a saved revision (read-only)

fe7585cf3f9c4a1ca98da3c9c5113f70

Map with Selectable Countries

0 stars0🌍 Public
LLiuyang Qin
Last edited Mar 26, 2019
Created on Mar 26, 2019

This example presents a world map colored by each country’s economy group using an ordinal color scale. Clicking a country highlights it while dimming all others, and clicking again deselects it; the accompanying color legend also supports filtering by clicking its swatches. Built with D3 v5, it uses `d3.geoNaturalEarth1` for projection, `d3.geoPath` for rendering SVG paths, `d3.zoom` for pan and zoom, and `d3.scaleOrdinal` with `schemeSpectral`. Country boundaries and metadata come from TopoJSON and TSV files loaded from the world-atlas package.

AI-generated description