Cheap Tricks for Interaction
✓ Published0🌍 Public
An orthographic world map demonstrates interaction with drag and zoom. The drag handler rotates the globe by adjusting the D3 projection’s rotation, while the zoom handler scales it using `projection.scale`. Rendered with `d3.geoPath`, the land features come from TopoJSON’s `world-110m.json`. Both `d3.drag` and `d3.zoom` trigger redraws, keeping the single landmass path updated. The example uses D3 v5 with SVG output, showing a blue sphere background and green countries that turn red on hover.
AI-generated descriptionMIT Licensed