API reference
React API
Exports of @kymoscope/sdk/react.
Components and hooks
| Name | Type | Description |
|---|---|---|
<KymoscopeProvider engine> | { engine: KymoscopeEngine; children } | Makes the engine available below it. |
useEngine() | () => KymoscopeEngine | The provided engine. Throws outside a provider. |
useEngineState(selector, isEqual?) | <T>(selector: (s: EngineState) => T, isEqual?: (a: T, b: T) => boolean) => T | A slice of the state; re-renders only when it changes. |
<Chart> props
| Name | Type | Description |
|---|---|---|
idrequired | string | Chart id from engine.charts.add. Changing it remounts. |
className, style | string, CSSProperties | On the wrapper element; size the chart with them. |
options | MountOptions | Applied with setOptions when they change (compared by value). |
onStatus | (status: ChartStatus) => void | Status changes. |
onContextMenu | (e: ContextMenuEvent) => void | Right-click on the plot. |
onViewChange | (range: [number, number] | null) => void | User zoom or pan (multi-band). |
viewRef | (view: ChartView | null) => void | The ChartView after mount; null on unmount. |