API reference
ChartView
What engine.charts.mount returns, its options and its events.
MountOptions
| Name | Type | Description |
|---|---|---|
theme | 'dark' | 'light'Default: inherited data-color-scheme, else dark | Colour scheme of this chart. |
style | ChartStyle | { background?, muted?, grid?, accent? }: sets --chart-bg, --chart-muted, --chart-grid and --accent on the chart. background also overrides the model’s background. |
className | string | Added to the chart element (which always has kymo-chart). |
Methods
| Name | Type | Description |
|---|---|---|
chartId | string | The mounted chart. |
status() | () => 'no-data' | 'empty' | 'ready' | null | null before the first render. |
on(event, listener) | (event, listener) => () => void | status, contextmenu, viewchange. |
data() | () => unknown | The prepared data being drawn (X-Y points, histogram values, multi-band series and points…); null when nothing is drawn. |
exportPng() | () => Promise<Blob> | PNG of the plot at device resolution. Rejects with export_failed when nothing is drawn. |
autoscale() | () => void | X-Y-Z mesh charts: re-fit the 3-D view. |
setShiftMode(datasetId) | (datasetId: string | null) => void | Multi-band charts: while set, left-dragging shifts that dataset (or lap) along X via datasets.setOffset. |
setOptions(options) | (options: MountOptions) => void | Replace the mount options without remounting. |
destroy() | () => void | Unmount. The model stays in the engine. |
Events
interface ChartViewEvents {
status: ChartStatus // 'no-data' | 'empty' | 'ready'
contextmenu: ContextMenuEvent // { clientX, clientY, zoomXRange?: [number, number] | null }
viewchange: [number, number] | null // multi-band zoom or pan by the user
}