@kymoscope/sdk 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/LICENSE.md +69 -0
  2. package/README.md +138 -2
  3. package/dist/assets/duckdb-browser-eh.worker--3HUwN9R.js +14 -0
  4. package/dist/assets/duckdb-eh-D-nnNw7L.wasm.gz +0 -0
  5. package/dist/assets/h5wasmModule-BCQWU2Gw.js +24295 -0
  6. package/dist/assets/importer.worker-D4is7BLf.js +6 -0
  7. package/dist/assets/offscreenLineWorker-mShhnyXX.js +79 -0
  8. package/dist/assets/parseDataset.worker-PynRsPD8.js +5 -0
  9. package/dist/importers-DivmF3tx.js +5 -0
  10. package/dist/krc-CbE28CjD.js +9 -0
  11. package/dist/kymoscope-embed.js +633 -0
  12. package/dist/kymoscope-sdk.js +616 -0
  13. package/dist/react.js +2 -0
  14. package/dist/styles/charts.css +207 -0
  15. package/dist/styles/fonts/OFL.txt +93 -0
  16. package/dist/styles/fonts/plus-jakarta-sans-italic-latin-ext.woff2 +0 -0
  17. package/dist/styles/fonts/plus-jakarta-sans-italic-latin.woff2 +0 -0
  18. package/dist/styles/fonts/plus-jakarta-sans-latin-ext.woff2 +0 -0
  19. package/dist/styles/fonts/plus-jakarta-sans-latin.woff2 +0 -0
  20. package/dist/styles/tokens.css +218 -0
  21. package/dist/types/charts/AlarmOverlay.d.ts +11 -0
  22. package/dist/types/charts/AnnotationLayer.d.ts +29 -0
  23. package/dist/types/charts/ChartBody.d.ts +52 -0
  24. package/dist/types/charts/PerfHud.d.ts +20 -0
  25. package/dist/types/charts/beacon.d.ts +27 -0
  26. package/dist/types/charts/chartWindow.d.ts +31 -0
  27. package/dist/types/charts/liveOverlay.d.ts +16 -0
  28. package/dist/types/charts/runtime.d.ts +63 -0
  29. package/dist/types/charts/useWorksheetData.d.ts +159 -0
  30. package/dist/types/components/AreaChart.d.ts +21 -0
  31. package/dist/types/components/BarChart.d.ts +30 -0
  32. package/dist/types/components/BoxPlotChart.d.ts +16 -0
  33. package/dist/types/components/BubbleChart.d.ts +24 -0
  34. package/dist/types/components/CalibrationChart.d.ts +15 -0
  35. package/dist/types/components/CdfChart.d.ts +15 -0
  36. package/dist/types/components/ConfusionChart.d.ts +11 -0
  37. package/dist/types/components/ControlChart.d.ts +17 -0
  38. package/dist/types/components/DuckDbMultiBandPanel.d.ts +35 -0
  39. package/dist/types/components/EmbeddingChart.d.ts +25 -0
  40. package/dist/types/components/FlameGraphChart.d.ts +15 -0
  41. package/dist/types/components/GanttChart.d.ts +15 -0
  42. package/dist/types/components/GaugeChart.d.ts +27 -0
  43. package/dist/types/components/HeatmapChart.d.ts +41 -0
  44. package/dist/types/components/HistogramChart.d.ts +15 -0
  45. package/dist/types/components/LossCurveChart.d.ts +17 -0
  46. package/dist/types/components/MultiBandCanvasChart.d.ts +156 -0
  47. package/dist/types/components/ParallelCoordsChart.d.ts +21 -0
  48. package/dist/types/components/PolarChart.d.ts +17 -0
  49. package/dist/types/components/QQPlotChart.d.ts +16 -0
  50. package/dist/types/components/RadarChart.d.ts +17 -0
  51. package/dist/types/components/RocChart.d.ts +12 -0
  52. package/dist/types/components/SankeyChart.d.ts +15 -0
  53. package/dist/types/components/SpectrogramChart.d.ts +16 -0
  54. package/dist/types/components/SpectrogramWaterfall.d.ts +14 -0
  55. package/dist/types/components/SpectrumChart.d.ts +17 -0
  56. package/dist/types/components/TreemapChart.d.ts +14 -0
  57. package/dist/types/components/ViolinChart.d.ts +17 -0
  58. package/dist/types/components/XYScatterChart.d.ts +47 -0
  59. package/dist/types/components/XYZMeshChart.d.ts +68 -0
  60. package/dist/types/components/dashboardGridLayout.d.ts +50 -0
  61. package/dist/types/components/liveFollowEase.d.ts +10 -0
  62. package/dist/types/components/liveWindow.d.ts +63 -0
  63. package/dist/types/components/multiBandHover.d.ts +44 -0
  64. package/dist/types/embed/Attribution.d.ts +5 -0
  65. package/dist/types/embed/license.d.ts +29 -0
  66. package/dist/types/embed/standalone.d.ts +5 -0
  67. package/dist/types/engine/columns.d.ts +44 -0
  68. package/dist/types/engine/createEngine.d.ts +394 -0
  69. package/dist/types/engine/derive.d.ts +27 -0
  70. package/dist/types/engine/emitter.d.ts +6 -0
  71. package/dist/types/engine/errors.d.ts +7 -0
  72. package/dist/types/engine/history.d.ts +29 -0
  73. package/dist/types/engine/kinds.d.ts +9 -0
  74. package/dist/types/engine/liveController.d.ts +27 -0
  75. package/dist/types/engine/store.d.ts +8 -0
  76. package/dist/types/engine/types.d.ts +194 -0
  77. package/dist/types/index.d.ts +69 -0
  78. package/dist/types/lib/annotations.d.ts +37 -0
  79. package/dist/types/lib/beacon.d.ts +62 -0
  80. package/dist/types/lib/colorScheme.d.ts +5 -0
  81. package/dist/types/lib/colormap.d.ts +9 -0
  82. package/dist/types/lib/columnTable.d.ts +37 -0
  83. package/dist/types/lib/data/arrowDecimation.d.ts +11 -0
  84. package/dist/types/lib/data/binnedHeatmap.d.ts +27 -0
  85. package/dist/types/lib/data/columnCaches.d.ts +6 -0
  86. package/dist/types/lib/data/columnarDataSource.d.ts +34 -0
  87. package/dist/types/lib/data/createDataSource.d.ts +23 -0
  88. package/dist/types/lib/data/dataSource.d.ts +75 -0
  89. package/dist/types/lib/data/decimate.d.ts +25 -0
  90. package/dist/types/lib/data/duckDbDataSource.d.ts +42 -0
  91. package/dist/types/lib/data/envelope.d.ts +16 -0
  92. package/dist/types/lib/data/inMemoryDataSource.d.ts +25 -0
  93. package/dist/types/lib/data/liveDataSource.d.ts +77 -0
  94. package/dist/types/lib/data/lruCache.d.ts +11 -0
  95. package/dist/types/lib/data/openDataset.d.ts +24 -0
  96. package/dist/types/lib/data/opfsParquet.d.ts +4 -0
  97. package/dist/types/lib/data/pointColumns.d.ts +59 -0
  98. package/dist/types/lib/data/schemaColumns.d.ts +5 -0
  99. package/dist/types/lib/data/useSeriesPoints.d.ts +48 -0
  100. package/dist/types/lib/data/xyColumns.d.ts +77 -0
  101. package/dist/types/lib/dataBounds.d.ts +10 -0
  102. package/dist/types/lib/datasetColors.d.ts +19 -0
  103. package/dist/types/lib/datasetColumns.d.ts +3 -0
  104. package/dist/types/lib/datasetMerge.d.ts +8 -0
  105. package/dist/types/lib/duckdb/duckdbInstance.d.ts +7 -0
  106. package/dist/types/lib/duckdb/fileIdentity.d.ts +9 -0
  107. package/dist/types/lib/duckdb/sql.d.ts +124 -0
  108. package/dist/types/lib/fft.d.ts +15 -0
  109. package/dist/types/lib/folderTree.d.ts +29 -0
  110. package/dist/types/lib/gaugeColors.d.ts +32 -0
  111. package/dist/types/lib/importers/arrowSink.d.ts +35 -0
  112. package/dist/types/lib/importers/blobReader.d.ts +22 -0
  113. package/dist/types/lib/importers/bytes.d.ts +11 -0
  114. package/dist/types/lib/importers/combine.d.ts +30 -0
  115. package/dist/types/lib/importers/comtrade/format.d.ts +2 -0
  116. package/dist/types/lib/importers/comtrade/importer.d.ts +25 -0
  117. package/dist/types/lib/importers/dbc.d.ts +45 -0
  118. package/dist/types/lib/importers/edf/format.d.ts +2 -0
  119. package/dist/types/lib/importers/edf/importer.d.ts +7 -0
  120. package/dist/types/lib/importers/expr.d.ts +10 -0
  121. package/dist/types/lib/importers/formats.d.ts +23 -0
  122. package/dist/types/lib/importers/hdf5/format.d.ts +4 -0
  123. package/dist/types/lib/importers/hdf5/h5.d.ts +76 -0
  124. package/dist/types/lib/importers/hdf5/h5wasmModule.d.ts +1 -0
  125. package/dist/types/lib/importers/hdf5/importer.d.ts +2 -0
  126. package/dist/types/lib/importers/importer.worker.d.ts +5 -0
  127. package/dist/types/lib/importers/importers.d.ts +4 -0
  128. package/dist/types/lib/importers/limits.d.ts +28 -0
  129. package/dist/types/lib/importers/mat/format.d.ts +2 -0
  130. package/dist/types/lib/importers/mat/group.d.ts +19 -0
  131. package/dist/types/lib/importers/mat/importer.d.ts +2 -0
  132. package/dist/types/lib/importers/mat/v5.d.ts +24 -0
  133. package/dist/types/lib/importers/mat/v73.d.ts +13 -0
  134. package/dist/types/lib/importers/mdf/blocks3.d.ts +3 -0
  135. package/dist/types/lib/importers/mdf/blocks4.d.ts +7 -0
  136. package/dist/types/lib/importers/mdf/bus.d.ts +59 -0
  137. package/dist/types/lib/importers/mdf/conversion.d.ts +48 -0
  138. package/dist/types/lib/importers/mdf/decode.d.ts +15 -0
  139. package/dist/types/lib/importers/mdf/format.d.ts +2 -0
  140. package/dist/types/lib/importers/mdf/importer.d.ts +19 -0
  141. package/dist/types/lib/importers/mdf/model.d.ts +75 -0
  142. package/dist/types/lib/importers/mdf/records.d.ts +31 -0
  143. package/dist/types/lib/importers/mdf/stream.d.ts +42 -0
  144. package/dist/types/lib/importers/memorySink.d.ts +11 -0
  145. package/dist/types/lib/importers/names.d.ts +2 -0
  146. package/dist/types/lib/importers/openImport.d.ts +33 -0
  147. package/dist/types/lib/importers/registry.d.ts +24 -0
  148. package/dist/types/lib/importers/run.d.ts +35 -0
  149. package/dist/types/lib/importers/session.d.ts +28 -0
  150. package/dist/types/lib/importers/tdms/format.d.ts +2 -0
  151. package/dist/types/lib/importers/tdms/importer.d.ts +10 -0
  152. package/dist/types/lib/importers/types.d.ts +172 -0
  153. package/dist/types/lib/importers/workerCore.d.ts +44 -0
  154. package/dist/types/lib/importers/xdf/format.d.ts +2 -0
  155. package/dist/types/lib/importers/xdf/importer.d.ts +2 -0
  156. package/dist/types/lib/importers/zlib.d.ts +13 -0
  157. package/dist/types/lib/kde.d.ts +2 -0
  158. package/dist/types/lib/live/buffer.d.ts +265 -0
  159. package/dist/types/lib/live/columnsWire.d.ts +24 -0
  160. package/dist/types/lib/live/crypto.d.ts +157 -0
  161. package/dist/types/lib/live/liveMathChannels.d.ts +11 -0
  162. package/dist/types/lib/live/recorder.d.ts +32 -0
  163. package/dist/types/lib/live/stream.d.ts +33 -0
  164. package/dist/types/lib/live/timeBuckets.d.ts +71 -0
  165. package/dist/types/lib/live/types.d.ts +72 -0
  166. package/dist/types/lib/live/wire.d.ts +25 -0
  167. package/dist/types/lib/mathChannels/compile.d.ts +22 -0
  168. package/dist/types/lib/mathChannels/evaluator.d.ts +40 -0
  169. package/dist/types/lib/mathChannels/functions/conditional.d.ts +2 -0
  170. package/dist/types/lib/mathChannels/functions/filters.d.ts +7 -0
  171. package/dist/types/lib/mathChannels/functions/index.d.ts +3 -0
  172. package/dist/types/lib/mathChannels/functions/reference.d.ts +7 -0
  173. package/dist/types/lib/mathChannels/functions/windowOps.d.ts +11 -0
  174. package/dist/types/lib/mathChannels/index.d.ts +13 -0
  175. package/dist/types/lib/mathChannels/io.d.ts +18 -0
  176. package/dist/types/lib/mathChannels/mathjsSetup.d.ts +7 -0
  177. package/dist/types/lib/mathChannels/parseMath.d.ts +12 -0
  178. package/dist/types/lib/mathChannels/parser.d.ts +22 -0
  179. package/dist/types/lib/mathChannels/types.d.ts +34 -0
  180. package/dist/types/lib/mathChannels/usedChannels.d.ts +14 -0
  181. package/dist/types/lib/moduleWorker.d.ts +7 -0
  182. package/dist/types/lib/panelChartSettings.d.ts +438 -0
  183. package/dist/types/lib/parseDataset.d.ts +74 -0
  184. package/dist/types/lib/parseDataset.worker.d.ts +1 -0
  185. package/dist/types/lib/parseDatasetWorkerClient.d.ts +32 -0
  186. package/dist/types/lib/perfLog.d.ts +4 -0
  187. package/dist/types/lib/quantiles.d.ts +10 -0
  188. package/dist/types/lib/recordings/csvWriter.d.ts +10 -0
  189. package/dist/types/lib/recordings/export.d.ts +26 -0
  190. package/dist/types/lib/recordings/importer.d.ts +2 -0
  191. package/dist/types/lib/recordings/keys.d.ts +23 -0
  192. package/dist/types/lib/recordings/krc.d.ts +38 -0
  193. package/dist/types/lib/recordings/mf4Writer.d.ts +20 -0
  194. package/dist/types/lib/render/chartFonts.d.ts +10 -0
  195. package/dist/types/lib/render/colorBucket.d.ts +6 -0
  196. package/dist/types/lib/render/contours.d.ts +16 -0
  197. package/dist/types/lib/render/cssColor.d.ts +2 -0
  198. package/dist/types/lib/render/frames.d.ts +46 -0
  199. package/dist/types/lib/render/gl3d.d.ts +63 -0
  200. package/dist/types/lib/render/glLines.d.ts +62 -0
  201. package/dist/types/lib/render/glPlot.d.ts +36 -0
  202. package/dist/types/lib/render/glPoints.d.ts +37 -0
  203. package/dist/types/lib/render/glSeries.d.ts +67 -0
  204. package/dist/types/lib/render/heatGrid.d.ts +9 -0
  205. package/dist/types/lib/render/hitGrid.d.ts +16 -0
  206. package/dist/types/lib/render/liveZoomBus.d.ts +18 -0
  207. package/dist/types/lib/render/margins.d.ts +14 -0
  208. package/dist/types/lib/render/offscreenLineRenderer.d.ts +53 -0
  209. package/dist/types/lib/render/offscreenLineWorker.d.ts +1 -0
  210. package/dist/types/lib/render/plotFrame.d.ts +36 -0
  211. package/dist/types/lib/render/resample.d.ts +18 -0
  212. package/dist/types/lib/render/sharedGl.d.ts +38 -0
  213. package/dist/types/lib/render/useGlPlot.d.ts +7 -0
  214. package/dist/types/lib/savedLayout.d.ts +45 -0
  215. package/dist/types/lib/stft.d.ts +37 -0
  216. package/dist/types/lib/workspaces/encrypted.d.ts +50 -0
  217. package/dist/types/lib/workspaces/io.d.ts +120 -0
  218. package/dist/types/lib/xyFit.d.ts +14 -0
  219. package/dist/types/lib/yAxisTicks.d.ts +28 -0
  220. package/dist/types/react/index.d.ts +32 -0
  221. package/dist/types/types/loadedDataset.d.ts +42 -0
  222. package/dist/types/types/plotSeries.d.ts +27 -0
  223. package/package.json +63 -4
@@ -0,0 +1,31 @@
1
+ /**
2
+ * A chart in its own browser window (e.g. dragged to a second screen). The
3
+ * window is a same-origin popup: the page's styles and theme are copied in and
4
+ * the chart renders into it through the engine's normal mount, so it keeps
5
+ * streaming, zoom links and settings. Closing the window destroys the view;
6
+ * the host decides where the chart goes next (usually back into its grid).
7
+ */
8
+ import type { KymoscopeEngine } from '../engine/createEngine';
9
+ import type { ChartView, MountOptions } from './runtime';
10
+ export interface ChartWindowOptions {
11
+ /** Window title; defaults to the chart's title. */
12
+ title?: string;
13
+ /** Initial size in CSS px (the browser may adjust it). */
14
+ width?: number;
15
+ height?: number;
16
+ mount?: MountOptions;
17
+ }
18
+ export interface ChartWindow {
19
+ readonly chartId: string;
20
+ readonly window: Window;
21
+ /** Put your own controls here (e.g. a "return" button); it sits above the chart. */
22
+ readonly controls: HTMLElement;
23
+ readonly view: ChartView;
24
+ /** Close the window (also fires `close`). */
25
+ close(): void;
26
+ /** Fires once when the window closes, whoever closed it. */
27
+ on(event: 'close', cb: () => void): () => void;
28
+ }
29
+ export declare function openChartWindow(engine: KymoscopeEngine, chartId: string, mount: (element: HTMLElement, options?: MountOptions) => ChartView, o?: ChartWindowOptions): ChartWindow;
30
+ /** Close every chart window of an engine (on dispose). */
31
+ export declare function closeChartWindows(engine: KymoscopeEngine): void;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * A live stream drawn over imported datasets on a multiband chart: the stream
3
+ * is pulled every frame (decimated once per data change, trimmed to the
4
+ * playout edge) and drawn as one more layer over the datasets' layers, which
5
+ * don't change.
6
+ */
7
+ import type { LiveChartSource } from '../components/MultiBandCanvasChart';
8
+ import { type PointColumns } from '../lib/data/pointColumns';
9
+ import type { LiveConnection } from '../lib/live/types';
10
+ export declare function liveOverlaySource(conn: LiveConnection, xKey: string, cols: string[],
11
+ /** Series key suffix of the stream (`__N`, its overlay index). */
12
+ keySuffix: string,
13
+ /** X offset of the stream. */
14
+ offset: number, staticLayers: PointColumns[],
15
+ /** The datasets' X range (the axis), widened by the stream's own range. */
16
+ staticRange: [number, number] | null): LiveChartSource;
@@ -0,0 +1,63 @@
1
+ import { type KymoscopeEngine } from '../engine/createEngine';
2
+ import { type ChartStatus, type ContextMenuEvent } from './ChartBody';
3
+ import type { AnnotationTool } from '../lib/annotations';
4
+ export interface ChartStyle {
5
+ /** Plot background (overrides the chart's own background setting). */
6
+ background?: string;
7
+ /** Axis labels and ticks. */
8
+ muted?: string;
9
+ grid?: string;
10
+ /** Highlight colour (cursor, selection). */
11
+ accent?: string;
12
+ }
13
+ export interface MountOptions {
14
+ /** Colour scheme of this chart; default: inherited `data-color-scheme` (dark when none). */
15
+ theme?: 'dark' | 'light';
16
+ style?: ChartStyle;
17
+ className?: string;
18
+ /** Show live performance numbers (FPS, render time, points…) in the chart's top-right corner. */
19
+ debug?: boolean;
20
+ }
21
+ export interface ChartViewEvents extends Record<string, unknown> {
22
+ status: ChartStatus;
23
+ contextmenu: ContextMenuEvent;
24
+ viewchange: [number, number] | null;
25
+ /** The annotation tool changed from inside the chart (Escape drops it: null). */
26
+ annotationtool: AnnotationTool | null;
27
+ /** An annotation was selected in the chart (its id), or the selection ended (null). */
28
+ annotationselect: string | null;
29
+ }
30
+ export interface ChartView {
31
+ readonly chartId: string;
32
+ /** Current status: 'no-data' (nothing plotted), 'empty' (chart has nothing to draw), 'ready'. */
33
+ status(): ChartStatus | null;
34
+ on<K extends keyof ChartViewEvents>(event: K, cb: (payload: ChartViewEvents[K]) => void): () => void;
35
+ /**
36
+ * The prepared data the chart is drawing (e.g. X-Y points, histogram values,
37
+ * multiband series + points); null while it has nothing to draw.
38
+ */
39
+ data(): unknown;
40
+ /** PNG of the plot (all its canvas layers), at device resolution. */
41
+ exportPng(): Promise<Blob>;
42
+ /** Re-fit the 3-D mesh view (X-Y-Z mesh charts). */
43
+ autoscale(): void;
44
+ /** While set, dragging on a multiband chart shifts this dataset along X. */
45
+ setShiftMode(datasetId: string | null): void;
46
+ /**
47
+ * While set, pointer gestures on the chart draw annotations of this kind
48
+ * (Escape in the chart drops it; null gives the pointer back to the chart).
49
+ * Annotations stay selectable, draggable and deletable either way.
50
+ */
51
+ setAnnotationTool(tool: AnnotationTool | null): void;
52
+ annotationTool(): AnnotationTool | null;
53
+ /** Id of the annotation selected in this chart, or null. */
54
+ selectedAnnotation(): string | null;
55
+ setOptions(options: MountOptions): void;
56
+ destroy(): void;
57
+ }
58
+ /** Render chart `chartId` into `element`. The chart fills the element. */
59
+ export declare function mountChart(engine: KymoscopeEngine, chartId: string, element: HTMLElement, options?: MountOptions): ChartView;
60
+ /** Redraw every mounted chart (e.g. after a font change). */
61
+ export declare function refreshCharts(engine: KymoscopeEngine): void;
62
+ /** Tear down every chart of an engine (called by engine.dispose()). */
63
+ export declare function disposeCharts(engine: KymoscopeEngine): void;
@@ -0,0 +1,159 @@
1
+ import type { MultibandEnvelope } from '../components/MultiBandCanvasChart';
2
+ import type { GaugeReading } from '../components/GaugeChart';
3
+ import type { Worksheet } from '../lib/savedLayout';
4
+ import type { LoadedDataset } from '../types/loadedDataset';
5
+ import type { LiveConnection } from '../lib/live/types';
6
+ import type { MathChannel } from '../lib/mathChannels/types';
7
+ import type { PlotSeries } from '../types/plotSeries';
8
+ import { type PointColumns } from '../lib/data/pointColumns';
9
+ import type { XYZColumns, XYZSurface } from '../components/XYZMeshChart';
10
+ import type { BoxPlotGroup } from '../components/BoxPlotChart';
11
+ import type { HeatmapCell, HeatGrid } from '../components/HeatmapChart';
12
+ import type { ViolinGroup } from '../components/ViolinChart';
13
+ import type { LossSeries } from '../components/LossCurveChart';
14
+ import type { ControlColumns } from '../components/ControlChart';
15
+ import type { ParallelColumns } from '../components/ParallelCoordsChart';
16
+ import type { EmbeddingColumns } from '../components/EmbeddingChart';
17
+ import type { FlameNode } from '../components/FlameGraphChart';
18
+ import type { BarGroup, BarColumns } from '../components/BarChart';
19
+ import type { RadarSeries } from '../components/RadarChart';
20
+ import type { AreaSeries } from '../components/AreaChart';
21
+ import type { CdfSeries } from '../components/CdfChart';
22
+ import type { BubbleColumns } from '../components/BubbleChart';
23
+ import type { TreemapNode } from '../components/TreemapChart';
24
+ import type { SankeyLink } from '../components/SankeyChart';
25
+ import type { CalibrationBin } from '../components/CalibrationChart';
26
+ import type { QQColumns } from '../components/QQPlotChart';
27
+ import type { GanttTask } from '../components/GanttChart';
28
+ import { type XYColumns } from '../lib/data/xyColumns';
29
+ import { type Dataset, type DatasetRow } from '../lib/parseDataset';
30
+ import type { DuckDbLayerSpec } from '../components/DuckDbMultiBandPanel';
31
+ export interface WorksheetDataInput {
32
+ worksheet: Worksheet;
33
+ viewXRange: [number, number] | null;
34
+ selectedIds: string[];
35
+ selectedDatasets: LoadedDataset[];
36
+ liveConnections: LiveConnection[];
37
+ mathChannels: MathChannel[];
38
+ datasetOffsets: Record<string, number>;
39
+ datasetColors: Record<string, string>;
40
+ /** Colors by plotted position when not overridden (EngineOptions.palette). */
41
+ datasetPalette?: string[];
42
+ }
43
+ /**
44
+ * X range covered by imported datasets (each shifted by its offset): the fixed X
45
+ * axis while a live stream is shown alongside them, so the stream draws inside
46
+ * the datasets' range instead of stretching the axis. Null if none has the key.
47
+ */
48
+ /** Parallel layout: distribute series into equal bands top-to-bottom. */
49
+ export declare function withLayoutBands(srs: PlotSeries[], layout: 'overlay' | 'parallel'): PlotSeries[];
50
+ export declare function staticXExtent(parts: {
51
+ rows: Record<string, unknown>[];
52
+ offset: number;
53
+ }[], xKey: string): [number, number] | null;
54
+ /**
55
+ * Rows of the current lap on a wrapping X: from the last sample where X drops by
56
+ * more than half its range (lap distance at the finish line). A channel that
57
+ * never wraps returns the rows unchanged.
58
+ */
59
+ export declare function currentLapRows(rows: DatasetRow[], xKey: string): DatasetRow[];
60
+ export declare function useWorksheetData(input: WorksheetDataInput): {
61
+ dataset: Dataset | null;
62
+ datasetWithChannels: Dataset | null;
63
+ multiDatasetMode: boolean;
64
+ numericCols: string[];
65
+ anyDuckDb: boolean;
66
+ duckDbLayers: DuckDbLayerSpec[];
67
+ liveConn: LiveConnection | null;
68
+ liveOverlay: {
69
+ conn: LiveConnection;
70
+ keySuffix: string;
71
+ offset: number;
72
+ } | null;
73
+ hasLiveSelected: boolean;
74
+ staticXRange: [number, number] | null;
75
+ xUnit: string;
76
+ columnUnits: Record<string, string>;
77
+ multibandDataByPanel: Record<string, {
78
+ effectiveSeries: PlotSeries[];
79
+ points: PointColumns[];
80
+ /** Min–max envelopes of the series across the plotted datasets (envelope on). */
81
+ envelopes?: MultibandEnvelope[];
82
+ }>;
83
+ xyPointsByPanel: {
84
+ pts: Record<string, XYColumns>;
85
+ colorMeta: Record<string, {
86
+ label: string;
87
+ min: number;
88
+ max: number;
89
+ }>;
90
+ datasetColors: Record<string, string[]>;
91
+ };
92
+ xyzPointsByPanel: Record<string, {
93
+ points: XYZColumns;
94
+ surface?: XYZSurface;
95
+ }>;
96
+ histogramDataByPanel: Record<string, Float64Array<ArrayBufferLike>>;
97
+ polarDataByPanel: Record<string, {
98
+ angles: ArrayLike<number>;
99
+ radii: ArrayLike<number>;
100
+ }>;
101
+ spectrumDataByPanel: Record<string, {
102
+ signal: Float64Array;
103
+ rate: number;
104
+ }>;
105
+ boxplotDataByPanel: Record<string, BoxPlotGroup[]>;
106
+ spectrogramDataByPanel: Record<string, {
107
+ signal: Float64Array;
108
+ rate: number;
109
+ }>;
110
+ heatmapDataByPanel: Record<string, {
111
+ cells: HeatmapCell[];
112
+ xLabels: string[];
113
+ yLabels: string[];
114
+ grid?: HeatGrid;
115
+ xCentres?: Float64Array;
116
+ yCentres?: Float64Array;
117
+ }>;
118
+ violinDataByPanel: Record<string, ViolinGroup[]>;
119
+ confusionDataByPanel: Record<string, {
120
+ actual: ArrayLike<string | number>;
121
+ predicted: ArrayLike<string | number>;
122
+ }>;
123
+ rocDataByPanel: Record<string, {
124
+ scores: ArrayLike<number>;
125
+ labels: ArrayLike<number>;
126
+ }>;
127
+ lossCurveDataByPanel: Record<string, {
128
+ xValues: ArrayLike<number>;
129
+ series: LossSeries[];
130
+ }>;
131
+ controlChartDataByPanel: Record<string, ControlColumns>;
132
+ parallelCoordsDataByPanel: Record<string, ParallelColumns>;
133
+ embeddingDataByPanel: Record<string, EmbeddingColumns>;
134
+ flameGraphDataByPanel: Record<string, FlameNode[]>;
135
+ barChartDataByPanel: Record<string, {
136
+ groups: BarGroup[];
137
+ columns?: BarColumns;
138
+ seriesNames: string[];
139
+ }>;
140
+ radarDataByPanel: Record<string, {
141
+ axes: string[];
142
+ series: RadarSeries[];
143
+ }>;
144
+ areaChartDataByPanel: Record<string, AreaSeries[]>;
145
+ cdfChartDataByPanel: Record<string, CdfSeries[]>;
146
+ bubbleChartDataByPanel: Record<string, BubbleColumns>;
147
+ treemapDataByPanel: Record<string, TreemapNode[]>;
148
+ sankeyDataByPanel: Record<string, {
149
+ nodeNames: string[];
150
+ links: SankeyLink[];
151
+ }>;
152
+ calibrationDataByPanel: Record<string, CalibrationBin[]>;
153
+ qqPlotDataByPanel: Record<string, QQColumns>;
154
+ ganttDataByPanel: Record<string, GanttTask[]>;
155
+ gaugeDataByPanel: Record<string, GaugeReading[]>;
156
+ };
157
+ export type WorksheetData = ReturnType<typeof useWorksheetData>;
158
+ /** A gauge's scale: the given ends, else the data's range widened to round steps. */
159
+ export declare function gaugeScale(lo: number, hi: number, min?: number, max?: number): [number, number];
@@ -0,0 +1,21 @@
1
+ /** One area: its X and Y as arrays (typed arrays straight from the dataset, or plain). */
2
+ export interface AreaSeries {
3
+ name: string;
4
+ x: ArrayLike<number>;
5
+ y: ArrayLike<number>;
6
+ }
7
+ export interface AreaChartProps {
8
+ series: AreaSeries[];
9
+ stacked?: boolean;
10
+ /** Fixed Y range (either end absent: from the data). */
11
+ yRange?: {
12
+ min?: number;
13
+ max?: number;
14
+ };
15
+ backgroundToken?: string;
16
+ onPlotContextMenu?: (e: {
17
+ clientX: number;
18
+ clientY: number;
19
+ }) => void;
20
+ }
21
+ export declare function AreaChart({ series, stacked, yRange, backgroundToken, onPlotContextMenu, }: AreaChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ export interface BarGroup {
2
+ label: string;
3
+ values: number[];
4
+ }
5
+ /** One bar group per row: each series' values as an array (typed arrays straight from the dataset). */
6
+ export interface BarColumns {
7
+ length: number;
8
+ values: ArrayLike<number>[];
9
+ }
10
+ export interface BarChartProps {
11
+ /** Labelled groups (categories)… */
12
+ groups?: BarGroup[];
13
+ /** …or one group per row, labelled by its number. */
14
+ columns?: BarColumns;
15
+ seriesNames: string[];
16
+ colors?: string[];
17
+ mode?: 'grouped' | 'stacked';
18
+ horizontal?: boolean;
19
+ /** Fixed value range (either end absent: from the data). */
20
+ valueRange?: {
21
+ min?: number;
22
+ max?: number;
23
+ };
24
+ backgroundToken?: string;
25
+ onPlotContextMenu?: (e: {
26
+ clientX: number;
27
+ clientY: number;
28
+ }) => void;
29
+ }
30
+ export declare function BarChart({ groups, columns, seriesNames, colors, mode, horizontal, valueRange, backgroundToken, onPlotContextMenu, }: BarChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ export interface BoxPlotGroup {
2
+ label: string;
3
+ values: ArrayLike<number>;
4
+ }
5
+ export interface BoxPlotChartProps {
6
+ groups: BoxPlotGroup[];
7
+ color?: string;
8
+ whiskers?: '1.5iqr' | 'minmax';
9
+ height?: number;
10
+ backgroundToken?: string;
11
+ onPlotContextMenu?: (e: {
12
+ clientX: number;
13
+ clientY: number;
14
+ }) => void;
15
+ }
16
+ export declare function BoxPlotChart({ groups, color, whiskers, height, backgroundToken, onPlotContextMenu, }: BoxPlotChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ /** Bubbles as columns: position, size, an optional colour (a value or a category) and a label. */
2
+ export interface BubbleColumns {
3
+ length: number;
4
+ x: ArrayLike<number>;
5
+ y: ArrayLike<number>;
6
+ size: ArrayLike<number>;
7
+ colorValue?: ArrayLike<number>;
8
+ /** A category per bubble: an index into `colorLabels`. */
9
+ colorIndex?: ArrayLike<number>;
10
+ colorLabels?: string[];
11
+ label?: (i: number) => string;
12
+ }
13
+ export interface BubbleChartProps {
14
+ points: BubbleColumns;
15
+ color?: string;
16
+ colorByNumeric?: boolean;
17
+ maxRadius?: number;
18
+ backgroundToken?: string;
19
+ onPlotContextMenu?: (e: {
20
+ clientX: number;
21
+ clientY: number;
22
+ }) => void;
23
+ }
24
+ export declare function BubbleChart({ points, color, colorByNumeric, maxRadius, backgroundToken, onPlotContextMenu, }: BubbleChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ export interface CalibrationBin {
2
+ center: number;
3
+ actual: number;
4
+ count: number;
5
+ }
6
+ export interface CalibrationChartProps {
7
+ bins: CalibrationBin[];
8
+ color?: string;
9
+ backgroundToken?: string;
10
+ onPlotContextMenu?: (e: {
11
+ clientX: number;
12
+ clientY: number;
13
+ }) => void;
14
+ }
15
+ export declare function CalibrationChart({ bins, color, backgroundToken, onPlotContextMenu, }: CalibrationChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ export interface CdfSeries {
2
+ name: string;
3
+ values: ArrayLike<number>;
4
+ }
5
+ export interface CdfChartProps {
6
+ series: CdfSeries[];
7
+ complement?: boolean;
8
+ logX?: boolean;
9
+ backgroundToken?: string;
10
+ onPlotContextMenu?: (e: {
11
+ clientX: number;
12
+ clientY: number;
13
+ }) => void;
14
+ }
15
+ export declare function CdfChart({ series, complement, logX, backgroundToken, onPlotContextMenu, }: CdfChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ export interface ConfusionChartProps {
2
+ actual: ArrayLike<string | number>;
3
+ predicted: ArrayLike<string | number>;
4
+ normalize?: boolean;
5
+ backgroundToken?: string;
6
+ onPlotContextMenu?: (e: {
7
+ clientX: number;
8
+ clientY: number;
9
+ }) => void;
10
+ }
11
+ export declare function ConfusionChart({ actual, predicted, normalize, backgroundToken, onPlotContextMenu, }: ConfusionChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ /** The measured values in order (the X axis is their index), with an optional subgroup name each. */
2
+ export interface ControlColumns {
3
+ length: number;
4
+ value: ArrayLike<number>;
5
+ subgroup?: (i: number) => string;
6
+ }
7
+ export interface ControlChartProps {
8
+ points: ControlColumns;
9
+ sigmaLevel?: number;
10
+ color?: string;
11
+ backgroundToken?: string;
12
+ onPlotContextMenu?: (e: {
13
+ clientX: number;
14
+ clientY: number;
15
+ }) => void;
16
+ }
17
+ export declare function ControlChart({ points, sigmaLevel, color, backgroundToken, onPlotContextMenu, }: ControlChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { type MultiBandCanvasChartProps } from './MultiBandCanvasChart';
2
+ import type { DataSource } from '../lib/data/dataSource';
3
+ /** One dataset to overlay (any source kind): its `DataSource`, the set of columns
4
+ * it actually has (so absent columns/xKey are skipped), and the column-key
5
+ * suffix + X shift to apply (so several datasets coexist with `col__di` keys). */
6
+ export interface DuckDbLayerSpec {
7
+ source: DataSource;
8
+ columnSet: Set<string>;
9
+ keySuffix: string;
10
+ xOffset: number;
11
+ /** A live stream: its points and extent refresh while it streams. */
12
+ live?: boolean;
13
+ /**
14
+ * Who this layer is (its dataset, and whether it carries that dataset's math
15
+ * channels). New data for the same dataset keeps the layer and its points on
16
+ * screen until the new ones are in; without it a layer is its source.
17
+ */
18
+ key?: string;
19
+ }
20
+ type Props = Omit<MultiBandCanvasChartProps, 'points' | 'fullXRange'> & {
21
+ layers: DuckDbLayerSpec[];
22
+ xKey: string;
23
+ /** Base column names to plot (without per-dataset suffix). */
24
+ columns: string[];
25
+ /** Target bucket count (≈ chart pixel width). */
26
+ maxPoints: number;
27
+ };
28
+ /**
29
+ * MultiBand chart over datasets read through their sources (out-of-core, and
30
+ * in-memory ones too large to plot row by row). Each layer is decimated per
31
+ * viewport (two-tier overview+detail) and the results are composited, so N
32
+ * datasets (laps, math-channel layers) overlay at flat cost (~2k buckets each).
33
+ */
34
+ export declare function DuckDbMultiBandPanel({ layers, xKey, columns, maxPoints, ...chartProps }: Props): import("react/jsx-runtime").JSX.Element;
35
+ export {};
@@ -0,0 +1,25 @@
1
+ /** Embedding points as columns, with an optional colour per point (a value, or a category) and a label. */
2
+ export interface EmbeddingColumns {
3
+ length: number;
4
+ x: ArrayLike<number>;
5
+ y: ArrayLike<number>;
6
+ /** A numeric colour value per point. */
7
+ colorValue?: ArrayLike<number>;
8
+ /** A category per point: an index into `colorLabels` (-1: none). */
9
+ colorIndex?: ArrayLike<number>;
10
+ colorLabels?: string[];
11
+ /** A point's label for the tooltip. */
12
+ label?: (i: number) => string;
13
+ }
14
+ export interface EmbeddingChartProps {
15
+ points: EmbeddingColumns;
16
+ color?: string;
17
+ colorByNumeric?: boolean;
18
+ pointSize?: number;
19
+ backgroundToken?: string;
20
+ onPlotContextMenu?: (e: {
21
+ clientX: number;
22
+ clientY: number;
23
+ }) => void;
24
+ }
25
+ export declare function EmbeddingChart({ points, color, colorByNumeric, pointSize, backgroundToken, onPlotContextMenu, }: EmbeddingChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ export interface FlameNode {
2
+ name: string;
3
+ parent: string;
4
+ value: number;
5
+ }
6
+ export interface FlameGraphChartProps {
7
+ nodes: FlameNode[];
8
+ direction?: 'topdown' | 'bottomup';
9
+ backgroundToken?: string;
10
+ onPlotContextMenu?: (e: {
11
+ clientX: number;
12
+ clientY: number;
13
+ }) => void;
14
+ }
15
+ export declare function FlameGraphChart({ nodes, direction, backgroundToken, onPlotContextMenu, }: FlameGraphChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ export interface GanttTask {
2
+ label: string;
3
+ start: number;
4
+ end: number;
5
+ group?: string;
6
+ }
7
+ export interface GanttChartProps {
8
+ tasks: GanttTask[];
9
+ backgroundToken?: string;
10
+ onPlotContextMenu?: (e: {
11
+ clientX: number;
12
+ clientY: number;
13
+ }) => void;
14
+ }
15
+ export declare function GanttChart({ tasks, backgroundToken, onPlotContextMenu, }: GanttChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import type { AlarmLine } from '../types/plotSeries';
2
+ import { type GaugeColorMode, type GaugeColorStop } from '../lib/gaugeColors';
3
+ export interface GaugeReading {
4
+ name: string;
5
+ unit: string;
6
+ /** NaN: no value yet. */
7
+ value: number;
8
+ /** The scale. */
9
+ min: number;
10
+ max: number;
11
+ /** Marked on the scale; past it the gauge takes its colour. */
12
+ alarm?: AlarmLine | null;
13
+ color: string;
14
+ style: 'arc' | 'linear';
15
+ /** Colours by value (see GaugeItem.colorMode). */
16
+ colorMode?: GaugeColorMode;
17
+ stops?: GaugeColorStop[];
18
+ }
19
+ export interface GaugeChartProps {
20
+ gauges: GaugeReading[];
21
+ backgroundToken?: string;
22
+ onPlotContextMenu?: (e: {
23
+ clientX: number;
24
+ clientY: number;
25
+ }) => void;
26
+ }
27
+ export declare function GaugeChart({ gauges, backgroundToken, onPlotContextMenu }: GaugeChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,41 @@
1
+ export interface HeatmapCell {
2
+ x: string;
3
+ y: string;
4
+ value: number;
5
+ }
6
+ /**
7
+ * Values on a uniform grid: `w` columns × `h` rows, row-major (row 0 the first
8
+ * Y label, at the top); NaN = an empty cell.
9
+ */
10
+ export interface HeatGrid {
11
+ w: number;
12
+ h: number;
13
+ values: Float32Array;
14
+ /** Column labels, or a label per column index (numbered columns: many). */
15
+ xLabels: string[] | ((i: number) => string);
16
+ yLabels: string[];
17
+ }
18
+ export interface HeatmapChartProps {
19
+ /** Labelled cells (correlation, binned, count, raw)… */
20
+ cells?: HeatmapCell[];
21
+ xLabels?: string[];
22
+ yLabels?: string[];
23
+ /** …or a grid of values (matrix). */
24
+ grid?: HeatGrid;
25
+ showValues?: boolean;
26
+ colorScheme?: 'diverging' | 'plasma' | 'viridis';
27
+ vMin?: number;
28
+ vMax?: number;
29
+ /** Where each column sits on X (ascending), for cells sized by value. */
30
+ xCentres?: Float64Array;
31
+ /** Where each row sits on Y, top row first (descending), for cells sized by value. */
32
+ yCentres?: Float64Array;
33
+ /** Isolines at this many levels across the colour range (0: none). */
34
+ contours?: number;
35
+ backgroundToken?: string;
36
+ onPlotContextMenu?: (e: {
37
+ clientX: number;
38
+ clientY: number;
39
+ }) => void;
40
+ }
41
+ export declare function HeatmapChart({ cells, xLabels, yLabels, grid, showValues, colorScheme, vMin, vMax, xCentres, yCentres, contours, backgroundToken, onPlotContextMenu, }: HeatmapChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ export interface HistogramChartProps {
2
+ values: ArrayLike<number>;
3
+ label: string;
4
+ bins?: number;
5
+ color?: string;
6
+ showNormal?: boolean;
7
+ logY?: boolean;
8
+ height?: number;
9
+ backgroundToken?: string;
10
+ onPlotContextMenu?: (e: {
11
+ clientX: number;
12
+ clientY: number;
13
+ }) => void;
14
+ }
15
+ export declare function HistogramChart({ values, label, bins: binsProp, color, showNormal, logY, height, backgroundToken, onPlotContextMenu, }: HistogramChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ export interface LossSeries {
2
+ label: string;
3
+ color: string;
4
+ values: ArrayLike<number>;
5
+ axis: 'left' | 'right';
6
+ }
7
+ export interface LossCurveChartProps {
8
+ xValues: ArrayLike<number>;
9
+ series: LossSeries[];
10
+ xLabel?: string;
11
+ backgroundToken?: string;
12
+ onPlotContextMenu?: (e: {
13
+ clientX: number;
14
+ clientY: number;
15
+ }) => void;
16
+ }
17
+ export declare function LossCurveChart({ xValues, series, xLabel, backgroundToken, onPlotContextMenu, }: LossCurveChartProps): import("react/jsx-runtime").JSX.Element;