crucıble

Mercator

A dotted world map as a live data surface: connection arcs launch with bright comet heads, land with a two-ring radar ripple, and dock event chips by hairline leader lines. Deterministic seeded dot grid (self-contained land bitmask), static events or live callback, chart-room palette. Canvas 2D, capped arc pool, offscreen-paused, reduced-motion-safe.

canvaspro

Installation

CLI

npx shadcn@latest add @crucible/mercator

Props

PropTypeDefaultDescription
eventsMercatorEvent[]Static event roster — arcs launch from it cyclically, seeded jitter on timing. Omit to use the built-in seeded demo-event generator.
getEvent() => MercatorEvent | null | undefinedLive event source, polled once per launch slot; return null/undefined to skip that slot. Takes precedence over events. (Under reduced motion the static roster / generator is used instead — this is never polled.)
arcFrequencynumber0.45Mean arc launches per second (seeded jitter applied).
arcSpeednumber1Arc travel-speed multiplier. 2 = twice as fast.
arcCurvaturenumber1How high arcs bow off the great line, 0–2.
cometIntensitynumber1Comet head/tail brightness, 0–2.
rippleIntensitynumber1Landing radar-ripple strength, 0–2.
renderChip(event: MercatorEvent) => React.ReactNodeReplace the default event chip (leader line + anchor dot are kept).
chipDwellnumber4Seconds a chip stays docked before retiring.
maxChipsnumber3Max chips shown at once — oldest retires when a new one lands. 0 disables chips.
dotDensitynumber160Dot columns across the full 360° of longitude. Clamped 40–320.
dotSizenumber1Dot radius multiplier relative to grid spacing.
center{ lat: number; lng: number }{ lat: 14, lng: 10 }Projection center.
zoomnumber1Projection zoom — 1 fits 360° across the container width.
maskFalloffnumber0.65Radial edge-fade strength for the dot grid, 0 (none) – 1.
colorsMercatorColorsPalette: dots, arc paths, and the single accent.
seednumber7Seed for the dot jitter, launch jitter and demo-event generator.
announceEventsbooleanfalseMirror landed events to a visually-hidden polite live region.
dprnumber2devicePixelRatio ceiling. Clamped 1–2.
pausedbooleanfalseFreeze at the static chart frame (dots + plotted routes + chips).
Also accepts all props of Omit<React.ComponentPropsWithoutRef<"div">, "children">they pass through to the underlying element.

Honors prefers-reduced-motion with a designed static fallback, pauses offscreen and on hidden tabs, and passes className through.