🌍 Public
Viewing a saved revision (read-only)
335985e5dfd64e6fad2d83b9be49c3ad
Cheap Tricks for Interaction(Even cheaper with CSS)
This example demonstrates a zoomable world map with interactive country selection, where clicking toggles a filled highlight state. It uses d3.geoNaturalEarth1 and d3.geoPath to render TopoJSON country boundaries from the world-atlas dataset, combined with d3.zoom for panning and scaling. The effect relies on CSS :hover and a .selected class triggered via d3’s event handler, supplemented by SVG <title> elements for tooltips. The render loop binds the country features and appends path elements to the SVG canvas.
AI-generated description