API reference

React API

Exports of @kymoscope/sdk/react.

Components and hooks

NameTypeDescription
<KymoscopeProvider engine>{ engine: KymoscopeEngine; children }Makes the engine available below it.
useEngine()() => KymoscopeEngineThe provided engine. Throws outside a provider.
useEngineState(selector, isEqual?)<T>(selector: (s: EngineState) => T, isEqual?: (a: T, b: T) => boolean) => TA slice of the state; re-renders only when it changes.

<Chart> props

NameTypeDescription
idrequiredstringChart id from engine.charts.add. Changing it remounts.
className, stylestring, CSSPropertiesOn the wrapper element; size the chart with them.
optionsMountOptionsApplied with setOptions when they change (compared by value).
onStatus(status: ChartStatus) => voidStatus changes.
onContextMenu(e: ContextMenuEvent) => voidRight-click on the plot.
onViewChange(range: [number, number] | null) => voidUser zoom or pan (multi-band).
viewRef(view: ChartView | null) => voidThe ChartView after mount; null on unmount.