Cheap Tricks for Interaction
✓ Published0🌍 Public
This example displays a world map colored by each country’s economy category, using a natural Earth projection and D3’s `geoPath`. A hover effect highlights individual countries in red, while `d3.zoom` enables pan and zoom interactions that transform the entire map group. The map is rendered as SVG, with data loaded from the World Atlas TopoJSON and TSV files, and country names appear via native `<title>` tooltips. The code uses `scaleOrdinal` with `schemeCategory10` for the color scale and topojson’s `feature` method for geometry.
AI-generated descriptionMIT Licensed