Choropleth Map with Interactive Filtering
This choropleth map shows global economic data by country, with an interactive color legend that filters countries by economy category. Users click legend items to highlight matching countries and fade others, and they can hover over countries to see their name and value in a tooltip. The map uses a natural Earth projection via `d3.geoNaturalEarth1` and `d3.geoPath`, with a spectral ordinal color scale, while the legend and map both respond to clicks through D3's event handling. World country boundaries and metadata come from the world-atlas package, loaded via `d3.tsv` and `d3.json`.