API reference

ChartView

What engine.charts.mount returns, its options and its events.

MountOptions

NameTypeDescription
theme'dark' | 'light'
Default: inherited data-color-scheme, else dark
Colour scheme of this chart.
styleChartStyle{ background?, muted?, grid?, accent? }: sets --chart-bg, --chart-muted, --chart-grid and --accent on the chart. background also overrides the model’s background.
classNamestringAdded to the chart element (which always has kymo-chart).

Methods

NameTypeDescription
chartIdstringThe mounted chart.
status()() => 'no-data' | 'empty' | 'ready' | nullnull before the first render.
on(event, listener)(event, listener) => () => voidstatus, contextmenu, viewchange.
data()() => unknownThe 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()() => voidX-Y-Z mesh charts: re-fit the 3-D view.
setShiftMode(datasetId)(datasetId: string | null) => voidMulti-band charts: while set, left-dragging shifts that dataset (or lap) along X via datasets.setOffset.
setOptions(options)(options: MountOptions) => voidReplace the mount options without remounting.
destroy()() => voidUnmount. The model stays in the engine.

Events

TypeScript
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
}