Skip to content
Design System
GitHub

Streaming chart

v0.64.0, changelogBeta

A live canvas line chart for robot telemetry at 20 to 50 Hz, fed by push() without a React render per reading, with a scrolling window, pause, limit lines, crosshair, legend and table view.

API reference

Generated from the types. Every part also takes className.

StreamingChart

configrequired
StreamingChartConfigThe series, in order of emphasis: the first is the accent and solid, then dashed, then dotted.
labelrequired
stringWhat the chart shows, for screen readers: "Drive motor currents, Patrol dog 7F3A".
ref
((instance: StreamingChartHandle | null) => void | (() => VoidOrUndefinedOnly) | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | RefObject<StreamingChartHandle | null>push, clear, pause and resume, called from anywhere without rendering.
subscribe
(push: StreamingChartPush) => (() => void) | voidConnects a source once: called with the chart's push when it mounts (and again if this function changes); return the function that disconnects. Keep it stable (a module-level function, or one the React Compiler memoises), or every render reconnects. (push) => ros.subscribe("/battery", "sensor_msgs/BatteryState", (m) => push({ voltage: m.voltage })).
windows
number[] = DEFAULT_WINDOWSThe windows to choose from, in ms. One window hides the switch.
window
numberThe window shown, in ms (controlled).
defaultWindow
number
onWindowChange
(ms: number) => void
paused
booleanFrozen (controlled). Readings keep arriving into the buffer while paused.
defaultPaused
boolean = false
onPausedChange
(paused: boolean) => void
domain
readonly [number, number]A fixed value range. Without it the range follows what is in view, in round steps; fix it for a value with known bounds.
limits
readonly StreamingChartLimit[] = NO_LIMITS
band
{ from: number; to: number; label?: string }
capacity
number = DEFAULT_CAPACITYReadings kept per series. The default, 36 000, holds 10 minutes at 60 Hz; longer windows at high rates need more.
staleAfterMs
number | null = 2000With no reading for this long the chart says so, and a gap this long breaks the line instead of joining across it. 2000 ms by default: telemetry charted live comes at 1 Hz or faster, so two missed readings at the slowest. null never says so and joins every gap.
announceEveryMs
number = 5000How often screen readers hear the current values while focus is on the chart. A crossed limit is said at once.
controls
boolean = trueThe window switch, the Chart / Table switch and Pause. Off for small multiples driven by one set of controls.
locale
stringBCP 47 tag for numbers and times ("zh-TW", "de"): pass the app's locale. Left out, English on the server and in every browser alike; a tag Intl cannot read falls back to English.
labels
Partial<StreamingChartLabels>
plotClassName
stringThe plot's height. Defaults to h-64.