Skip to main content
100%

World Map Rotation

✓ Published2🌍 Public
MMarco Costa
Last edited Aug 23, 2022
Created on Apr 1, 2022
Forked from React Starter

This example presents an orthographic world map that users can rotate by dragging with the mouse. The map renders country boundaries from TopoJSON data using D3’s `geoOrthographic` projection and `geoPath`, with a graticule overlay and interactive hover highlighting on countries. Rotation is implemented through React state updates triggered by D3 drag events, using the `versor` library to compute quaternion-based rotations for smooth, intuitive globe manipulation. The visualization demonstrates a React component integrating D3’s drag behavior, projection system, and geographic data loading via hooks.

AI-generated description

Drag rotate a D3 world map with React

MIT Licensed

Similar vizzes