Choropleth Map with Interactive Filtering
This choropleth map uses color-encoded economy classifications to visualize world countries from the World Atlas TopoJSON dataset. A spectral color scale is mapped to each country using D3’s `geoNaturalEarth1` projection and `geoPath`. Viewers can hover a legend item to filter the map, which dims non-matching countries with reduced opacity while highlighting the selected category. The example uses `d3.zoom` for panning and zooming, and the legend’s click handlers toggle the selection, updating both the map and legend transparency.