Fork of Cheap Tricks for Interaction
✓ Published0🌍 Public
This example shows a world map with interactive pan and zoom capabilities, using a natural Earth projection rendered as SVG paths. The map displays country boundaries with light green fill, which turns red on hover, and includes tooltips showing country names from the world-atlas TSV data. The code uses d3.geoNaturalEarth1, d3.geoPath, and d3.zoom to handle the projection and view transforms, while d3.json and d3.tsv load the TopoJSON geometry and name mappings. The sphere background is styled blue, and the map supports fluid zooming through the d3.zoom event handler.
AI-generated descriptionMIT Licensed