Skip to main content
100%

practice17-interactive filtering on a map

✓ Published0🌍 Public
DDi Cui
Last edited May 29, 2023
Created on May 29, 2023

This interactive map displays global economic classifications as a choropleth, with each country colored by its economy type. A legend of color swatches allows users to click a category and instantly filter the map, highlighting matching countries while dimming others, and clicking again clears the filter. Built with D3.js v5, the visualization uses `d3.geoNaturalEarth1` and `d3.geoPath` to render SVG paths from TopoJSON data, while `d3.scaleOrdinal` and `d3.schemeSpectral` define the color scale. Zooming via `d3.zoom` enables closer inspection of regions.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.

MIT Licensed

Similar vizzes