Dotted Globe
A rotating sphere of evenly spaced dots, with optional markers and arcs.
Overview
Dotted Globe draws a sphere covered in a lattice of evenly spaced dots. Each row of dots holds as many as fit its circumference, so the spacing stays even from the equator to the poles. Dots dim toward the edge and away from the light, and the far side shows faintly through.
The background is transparent and the dots use currentColor by default, so the globe follows the text color in light and dark themes. Use it beside copy about regions, a global network, or where people use your product.
Installation
Usage
import { DottedGlobe } from "honestui/shaders"
<DottedGlobe className="aspect-square w-full max-w-md" />The globe fills the shorter side of its container, so give the container a square aspect ratio or a fixed size.
Markers and arcs
Pass places as markers to draw them as accent dots with a soft pulse, and pairs of places as arcs to connect them with a raised great-circle arc. A short light travels along each arc from from to to. Up to 16 markers and 8 arcs are drawn; extra entries are ignored.
const london = { lat: 51.51, lng: -0.13 }
const newYork = { lat: 40.71, lng: -74.0 }
<DottedGlobe
className="aspect-square w-full max-w-md"
markers={[london, newYork]}
arcs={[{ from: newYork, to: london }]}
rotation={-30}
/>The globe has no map data: the dots cover the whole sphere, and markers are placed by latitude and longitude only. If the places matter to a decision, list them in text as well, as the example does.
Accessibility
Dotted Globe is decorative and its canvas is hidden from assistive technology. Put anything people need to know, such as the names of the regions, in normal HTML.
Dragging to turn the globe is a pointer-only enhancement; set interactive={false} to turn it off. Vertical touch scrolling still works over the globe. Rotation, pulses, and traveling lights stop while the globe is offscreen or the tab is hidden, and a still frame shows when the user prefers reduced motion. Without WebGL2 the container shows only its own background.