This library is not production-ready yet. Developers should use it with caution and expect breaking changes.

Animated Arc

Visualize point-to-point connections with animated parabolic arcs.

Installation

First, make sure you have the base map component installed:

npx shadcn@latest add https://www.terrae.dev/map.json

Then install the animated arc component:

npx shadcn@latest add https://www.terrae.dev/arc-animated.json

Curve Height

The height prop controls how much the arc curves away from a straight line. It's a multiplier relative to the distance between origin and destination. Use 0 for a straight line, or values like 0.3-0.5 for visible curves.

Custom Styling

Customize the arc appearance with color and width. The head marker follows the arc tip during animation and uses the same color as the arc.

Dashed Lines

Use dashArray to create dashed line patterns. The array specifies [dash length, gap length] in pixels.

Head Types

Use headType to change the shape of the traveling marker. Options are "circle" (default), "arrow", "square", or "none". Control the size with headSize.

Origin & Destination Markers

Enable showOriginMarker and showDestinationMarker to display dots at the start and end points. Customize their colors with originMarkerColor and destinationMarkerColor.

Properties

PropertyTypeDefaultDescription
idstringrequiredUnique identifier for the arc
origin[number, number]requiredStarting point [longitude, latitude]
destination[number, number]requiredEnding point [longitude, latitude]
colorstring"#3b82f6"Arc line color
widthnumber4Line width in pixels
opacitynumber1Line opacity (0-1)
dashArray[number, number]-Dash pattern [dash, gap]
heightnumber0.3Curve height multiplier (0 = straight)
segmentsnumber50Curve smoothness (more = smoother)
durationnumber2000Animation duration in ms
autoStartbooleantrueStart animation on mount
loopbooleanfalseLoop the animation
loopDelaynumber500Delay between loops in ms
headType"none" | "circle" | "square" | "arrow""circle"Shape of the traveling marker
headSizenumber16Size of the head marker in pixels
showOriginMarkerbooleanfalseShow marker at origin point
originMarkerColorstring-Origin marker color (defaults to line color)
showDestinationMarkerbooleanfalseShow marker at destination when animation completes
destinationMarkerColorstring-Destination marker color (defaults to line color)
onComplete() => void-Callback when animation completes

Use Cases

Flight Tracking

Display aircraft trajectories between airports on a globe.

Trade & Logistics

Visualize import/export flows and supply chain connections.