GeoTrajectoryChart
Plot positions and routes on a plane whose bounds and coordinate meaning you declare.
@luc/ui/chartsWhat it shows
Show one or more routes on a map, including a path that crosses the antimeridian.
Live preview
Two supplied routes; the second crosses the antimeridian and is unwrapped for drawing only.
<GeoTrajectoryChart
trajectories={routes}
xLabel="Longitude"
yLabel="Latitude"
format={{ kind: "number", decimals: 1 }}
ariaLabel="Two routes"
/>Usage
The values are prepared by the caller: this component draws the points it is given and computes no statistic of its own, so units, scaling and any summary have to be settled before the data reaches it.
It is drawn by the ECharts engine.
Worked examples with real data are on the family overview: Geographic
import { GeoTrajectoryChart } from "@luc/ui/charts";<GeoTrajectoryChart
trajectories={routes}
xLabel="Longitude"
yLabel="Latitude"
format={{ kind: "number", decimals: 1 }}
ariaLabel="Two routes"
/>Data contract
`trajectories` supply ordered route points in the map's coordinate system; `xLabel` and `yLabel` name the plane. The chart unwraps crossing paths for drawing only.
Important configuration
State the coordinate system and map registration, format both axes, and keep route point order as the travelled sequence.
Guidelines
When not to use
Do not read the drawn crossing as a straight-line distance or use an unregistered coordinate system without declaring its bounds.
Configuration
| Export | Kind | Signature |
|---|---|---|
GeoTrajectoryChart | 15 documented props | ({ trajectories, unwrap, xLabel, yLabel, format, title, description, state, height, className, ariaLabel, ariaDescription, onReady, onEvent, eager, }: GeoTrajectoryChartProps) => import("@types/react… |
GeoTrajectoryChart props
Type: GeoTrajectoryChartProps
Values the compiler reads from the declaration.
| Prop | Type | Default | Notes |
|---|---|---|---|
ariaDescription? | string | undefined | — | |
ariaLabel? | string | undefined | — | |
className? | string | undefined | — | |
description? | string | undefined | — | |
eager? | boolean | undefined | — | Create the engine on mount rather than when the surface is approached. |
format? | ChartFormat | undefined | — | |
height? | string | number | undefined | — | |
onEvent? | ((event: EChartEvent) => void) | undefined | — | |
onReady? | ((chart: EChartsInstance) => void) | undefined | — | |
state? | ChartState | undefined | — | |
title? | string | undefined | — | |
trajectories | readonly GeoTrajectory[] | — | |
unwrap? | boolean | undefined | — | Unwrap paths that cross the ±180° meridian by shifting a segment by a full turn, so a route from 179°E to 179°W is drawn as a short hop instead of a line across the whole chart. A… |
xLabel? | string | undefined | — | |
yLabel? | string | undefined | — |
Accessibility
A chart is a picture of data, so it needs a name that states what it shows, and the numbers must exist as text somewhere on the page — in a table or a written summary — because a drawing is not readable by a screen reader and cannot be copied.
What happens on the server, and when hydration changes it.
Family
Geographic
Maps are the caller's: LUC ships no boundary data and no political set.
Related