GeoScatterChart
Plot positions and routes on a plane whose bounds and coordinate meaning you declare.
@luc/ui/chartsWhat it shows
Place point observations on a registered map and size them by a supplied value.
Live preview
Point locations on the same registered map, sized by the value the caller supplied.
<GeoScatterChart
mapName="luc-showcase-grid"
points={[
{ name: "R2C3", coordinates: [-30, 45], value: 42 },
{ name: "R2C5", coordinates: [90, 45], value: 28 },
]}
valueFormat={{ kind: "integer" }}
ariaLabel="Readings on a grid map"
/>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 { GeoScatterChart } from "@luc/ui/charts";<GeoScatterChart
mapName="luc-showcase-grid"
points={[
{ name: "R2C3", coordinates: [-30, 45], value: 42 },
{ name: "R2C5", coordinates: [90, 45], value: 28 },
]}
valueFormat={{ kind: "integer" }}
ariaLabel="Readings on a grid map"
/>Data contract
`mapName` must reference a registered map; each `point` supplies `name`, map `coordinates` and a numeric `value`. Coordinates use the map's declared coordinate system.
Important configuration
Use `valueFormat` for the point measure, state the map registration and coordinate convention, and keep point size tied to a meaningful domain.
Guidelines
When not to use
Do not treat screen distances as geographic distances without accounting for the map's projection and bounds.
Configuration
| Export | Kind | Signature |
|---|---|---|
GeoScatterChart | 17 documented props | ({ mapName, points, valueFormat, maxSymbolSize, showRegions, boundingCoords, variant, title, description, state, height, className, ariaLabel, ariaDescription, onReady, onEvent, eager, }: GeoScatterC… |
GeoScatterChart props
Type: GeoScatterChartProps
Values the compiler reads from the declaration.
| Prop | Type | Default | Notes |
|---|---|---|---|
ariaDescription? | string | undefined | — | |
ariaLabel? | string | undefined | — | |
boundingCoords? | readonly [readonly [number, number], readonly [number, number]] | undefined | — | Geographic bounds of the registered map, `[[west, north], [east, south]]`. ECharts normally derives the view rectangle from the registered regions. A map whose GeoJSON carries no … |
className? | string | undefined | — | |
description? | string | undefined | — | |
eager? | boolean | undefined | — | Create the engine on mount rather than when the surface is approached. |
height? | string | number | undefined | — | |
mapName | string | — | A map name registered with `registerEChartsMap`. LUC ships **no map data**: a world or country boundary file is tens to hundreds of kilobytes, it has a licence, and bundling one w… |
maxSymbolSize? | number | undefined | — | Symbol size in px for the largest value. Default 22. |
onEvent? | ((event: EChartEvent) => void) | undefined | — | |
onReady? | ((chart: EChartsInstance) => void) | undefined | — | |
points | readonly GeoPoint[] | — | |
showRegions? | boolean | undefined | — | Draw the map's own region fills under the points. Default `true`. |
state? | ChartState | undefined | — | |
title? | string | undefined | — | |
valueFormat? | ChartFormat | undefined | — | |
variant? | "scatter" | "effect" | undefined | — | `scatter` over a map, or `effectScatter` for a live feed. |
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