@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
package/dist/react.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! @kymoscope/sdk (c) 2026 Kymoscope. Proprietary software: use requires a license. See LICENSE.md. */
2
+ import{createContext as e,useContext as t,useEffect as n,useRef as r,useSyncExternalStore as i}from"react";import{jsx as a}from"react/jsx-runtime";var o=e(null);function s({engine:e,children:t}){return a(o.Provider,{value:e,children:t})}function c(){let e=t(o);if(!e)throw Error(`useEngine() needs a <KymoscopeProvider engine={...}> above it`);return e}function l(e,t=Object.is){let n=c(),a=r(null),o=()=>{let r=n.getState(),i=a.current;if(i&&i.state===r)return i.value;let o=e(r);return i&&t(i.value,o)?(a.current={state:r,value:i.value},i.value):(a.current={state:r,value:o},o)};return i(e=>n.subscribe(e),o,o)}function u({id:e,className:t,style:i,options:o,onStatus:s,onContextMenu:l,onViewChange:u,viewRef:d}){let f=c(),p=r(null),m=r(null),h=r({onStatus:s,onContextMenu:l,onViewChange:u,viewRef:d});return h.current={onStatus:s,onContextMenu:l,onViewChange:u,viewRef:d},n(()=>{if(!p.current)return;let t=f.charts.mount(e,p.current,o);m.current=t;let n=[t.on(`status`,e=>h.current.onStatus?.(e)),t.on(`contextmenu`,e=>h.current.onContextMenu?.(e)),t.on(`viewchange`,e=>h.current.onViewChange?.(e))];return h.current.viewRef?.(t),()=>{for(let e of n)e();h.current.viewRef?.(null),t.destroy(),m.current=null}},[f,e]),n(()=>{m.current?.setOptions(o??{})},[JSON.stringify(o??{})]),a(`div`,{ref:p,className:t,style:i})}export{u as Chart,s as KymoscopeProvider,c as useEngine,l as useEngineState};
@@ -0,0 +1,207 @@
1
+ /*
2
+ * @kymoscope/sdk chart styles. Import once: `import '@kymoscope/sdk/styles/charts.css'`.
3
+ *
4
+ * Colours are CSS custom properties; override them on any ancestor of a chart
5
+ * (or per chart with the `style` mount option):
6
+ * --chart-bg plot background
7
+ * --chart-muted axis labels, ticks, legend text
8
+ * --chart-grid grid and frame lines
9
+ * --accent cursor and highlights
10
+ * Dark is the default; `data-color-scheme="light"` on an ancestor (or the
11
+ * `theme` mount option) switches to light.
12
+ */
13
+ :where(:root) {
14
+ --chart-bg: oklch(0.13 0.022 255);
15
+ --chart-muted: oklch(0.52 0.02 255);
16
+ --chart-grid: oklch(0.29 0.022 255);
17
+ --accent: oklch(0.76 0.14 58);
18
+ }
19
+
20
+ :where([data-color-scheme='light']) {
21
+ --chart-bg: oklch(0.995 0 0);
22
+ --chart-muted: oklch(0.46 0.02 255);
23
+ --chart-grid: oklch(0.87 0.018 255);
24
+ --accent: oklch(0.52 0.19 58);
25
+ }
26
+
27
+ :where([data-color-scheme='dark']) {
28
+ --chart-bg: oklch(0.13 0.022 255);
29
+ --chart-muted: oklch(0.52 0.02 255);
30
+ --chart-grid: oklch(0.29 0.022 255);
31
+ --accent: oklch(0.76 0.14 58);
32
+ }
33
+
34
+ .kymo-chart {
35
+ position: relative;
36
+ display: flex;
37
+ flex-direction: column;
38
+ width: 100%;
39
+ height: 100%;
40
+ min-height: 0;
41
+ background: var(--chart-bg);
42
+ }
43
+
44
+ .kymo-chart > * {
45
+ flex: 1;
46
+ min-height: 0;
47
+ }
48
+
49
+ .kymo-chart .chart-canvas-wrap {
50
+ position: relative;
51
+ width: 100%;
52
+ }
53
+
54
+ .kymo-chart .chart-canvas {
55
+ display: block;
56
+ width: 100%;
57
+ vertical-align: top;
58
+ }
59
+
60
+ .kymo-chart .chart-overlay {
61
+ position: absolute;
62
+ top: 0;
63
+ left: 0;
64
+ }
65
+
66
+ .kymo-chart .kymoscope-attribution {
67
+ flex: none;
68
+ }
69
+
70
+ /* Alarm line drawn over the plot (kinds whose chart does not draw its own). */
71
+ .kymo-chart > .kymo-alarm {
72
+ position: absolute;
73
+ inset: 0;
74
+ flex: none;
75
+ width: 100%;
76
+ height: 100%;
77
+ z-index: 2;
78
+ pointer-events: none;
79
+ overflow: hidden;
80
+ }
81
+
82
+ /* ── Annotations ───────────────────────────────────────────────────────────
83
+ An overlay over the plot. It lets the pointer through to the chart except
84
+ on the annotations; while a tool is set it takes the pointer to draw. */
85
+ .kymo-chart > .kymo-annotations {
86
+ position: absolute;
87
+ inset: 0;
88
+ flex: none;
89
+ z-index: 3;
90
+ pointer-events: none;
91
+ overflow: hidden;
92
+ }
93
+
94
+ .kymo-annotations.is-drawing {
95
+ pointer-events: auto;
96
+ cursor: crosshair;
97
+ box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--accent) 55%, transparent);
98
+ }
99
+
100
+ .kymo-annotations.is-tool-text { cursor: text; }
101
+
102
+ .kymo-ann-svg {
103
+ position: absolute;
104
+ inset: 0;
105
+ overflow: visible;
106
+ }
107
+
108
+ .kymo-ann-clip {
109
+ position: absolute;
110
+ inset: 0;
111
+ pointer-events: none;
112
+ }
113
+
114
+ .kymo-ann { cursor: move; }
115
+ .kymo-ann-hit {
116
+ fill: none;
117
+ stroke: transparent;
118
+ pointer-events: stroke;
119
+ }
120
+
121
+ .kymo-annotations.is-drawing .kymo-ann,
122
+ .kymo-annotations.is-drawing .kymo-ann-hit,
123
+ .kymo-annotations.is-drawing .kymo-ann-text {
124
+ pointer-events: none;
125
+ }
126
+
127
+ .kymo-ann-selection {
128
+ fill: none;
129
+ stroke: var(--accent);
130
+ stroke-width: 1;
131
+ stroke-dasharray: 3 3;
132
+ pointer-events: none;
133
+ }
134
+
135
+ .kymo-ann-text {
136
+ position: absolute;
137
+ pointer-events: auto;
138
+ cursor: move;
139
+ max-width: 60%;
140
+ padding: 0.15em 0.45em;
141
+ border-radius: 4px;
142
+ font-family: var(--font-sans, inherit);
143
+ font-weight: 600;
144
+ line-height: 1.25;
145
+ white-space: pre-wrap;
146
+ overflow-wrap: anywhere;
147
+ font-variant-numeric: tabular-nums;
148
+ background: color-mix(in oklch, var(--chart-bg) 82%, transparent);
149
+ user-select: none;
150
+ }
151
+
152
+ .kymo-ann-text--box {
153
+ max-width: 40%;
154
+ font-size: 12px;
155
+ }
156
+
157
+ .kymo-ann-handle {
158
+ fill: var(--chart-bg);
159
+ stroke: var(--accent);
160
+ stroke-width: 1.5;
161
+ pointer-events: all;
162
+ }
163
+ .kymo-ann-handle--nwse { cursor: nwse-resize; }
164
+ .kymo-ann-handle--nesw { cursor: nesw-resize; }
165
+ .kymo-ann-handle--end { cursor: crosshair; }
166
+ .kymo-ann-handle:hover { fill: var(--accent); }
167
+
168
+ .kymo-ann-text.is-selected {
169
+ box-shadow: 0 0 0 1px var(--accent);
170
+ }
171
+
172
+ .kymo-ann-editor {
173
+ min-width: 2ch;
174
+ outline: none;
175
+ cursor: text;
176
+ user-select: text;
177
+ pointer-events: auto;
178
+ caret-color: currentColor;
179
+ }
180
+
181
+ .kymo-ann-text:has(.kymo-ann-editor) {
182
+ box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px color-mix(in oklch, var(--accent) 22%, transparent);
183
+ }
184
+
185
+ .kymo-ann-delete {
186
+ position: absolute;
187
+ z-index: 1;
188
+ display: grid;
189
+ place-items: center;
190
+ width: 20px;
191
+ height: 20px;
192
+ padding: 0;
193
+ border-radius: 50%;
194
+ border: 1px solid color-mix(in oklch, var(--accent) 60%, var(--chart-grid));
195
+ background: var(--chart-bg);
196
+ color: var(--chart-muted);
197
+ cursor: pointer;
198
+ pointer-events: auto;
199
+ }
200
+
201
+ .kymo-ann-delete svg { stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
202
+ .kymo-ann-delete:hover { color: oklch(0.7 0.19 25); border-color: currentColor; }
203
+ .kymo-ann-delete:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
204
+
205
+ @media (prefers-reduced-motion: no-preference) {
206
+ .kymo-ann-delete { transition: color 0.14s ease, border-color 0.14s ease; }
207
+ }
@@ -0,0 +1,93 @@
1
+ Copyright 2020 The Plus Jakarta Sans Project Authors (https://github.com/tokotype/PlusJakartaSans)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,218 @@
1
+ /* Plus Jakarta Sans (SIL OFL 1.1, see fonts/OFL.txt), self-hosted: no request leaves the page's origin.
2
+ Same faces Google Fonts served (latin + latin-ext): one variable file per subset declared at 400/500/600/700,
3
+ so a weight in between (650, 750) still resolves to the same face as before. Italic: 500 only. */
4
+ @font-face { font-family: 'Plus Jakarta Sans'; font-style: italic; font-weight: 500; font-display: swap; src: url('./fonts/plus-jakarta-sans-italic-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
5
+ @font-face { font-family: 'Plus Jakarta Sans'; font-style: italic; font-weight: 500; font-display: swap; src: url('./fonts/plus-jakarta-sans-italic-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
6
+ @font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('./fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
7
+ @font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('./fonts/plus-jakarta-sans-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
8
+ @font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('./fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
9
+ @font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('./fonts/plus-jakarta-sans-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
10
+ @font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('./fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
11
+ @font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('./fonts/plus-jakarta-sans-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
12
+ @font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('./fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
13
+ @font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('./fonts/plus-jakarta-sans-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
14
+
15
+ /* Shared tokens (no surface color here: avoids flash before data-color-scheme) */
16
+ :root {
17
+ --font-sans: 'Plus Jakarta Sans', system-ui, 'Segoe UI', sans-serif;
18
+ --font-mono: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
19
+
20
+ --space-1: 0.25rem;
21
+ --space-2: 0.5rem;
22
+ --space-3: 0.75rem;
23
+ --space-4: 1rem;
24
+ --space-5: 1.5rem;
25
+ --space-6: 2.25rem;
26
+ --space-7: 3.5rem;
27
+
28
+ --radius-sm: 8px;
29
+ --radius-md: 12px;
30
+ --radius-lg: 16px;
31
+ --radius-xl: 22px;
32
+ }
33
+
34
+ /* Dark mode: cool-tinted neutrals, amber accent */
35
+ :root[data-color-scheme='dark'] {
36
+ --bg: oklch(0.16 0.024 252);
37
+ --bg-elevated: oklch(0.195 0.022 252);
38
+ --surface: oklch(0.22 0.02 252);
39
+ --surface-hover: oklch(0.255 0.018 252);
40
+ --border: oklch(0.33 0.026 255);
41
+ --border-strong: oklch(0.41 0.032 255);
42
+
43
+ --text: oklch(0.72 0.03 255);
44
+ --text-muted: oklch(0.54 0.022 255);
45
+ --text-strong: oklch(0.97 0.008 255);
46
+
47
+ --accent: oklch(0.76 0.14 58);
48
+ --accent-foreground: oklch(0.17 0.045 58);
49
+ --accent-soft: color-mix(in oklch, var(--accent) 18%, transparent);
50
+ --accent-ring: color-mix(in oklch, var(--accent) 48%, transparent);
51
+
52
+ --danger: oklch(0.66 0.2 25);
53
+ --danger-bg: color-mix(in oklch, var(--danger) 16%, transparent);
54
+ --warn: oklch(0.82 0.14 85);
55
+
56
+ --chart-bg: oklch(0.13 0.022 255);
57
+ --chart-fg: oklch(0.93 0.01 255);
58
+ --chart-muted: oklch(0.52 0.02 255);
59
+ --chart-grid: oklch(0.29 0.022 255);
60
+ --chart-band: color-mix(in oklch, var(--text-strong) 4.5%, transparent);
61
+
62
+ --shadow-sm: 0 1px 2px color-mix(in oklch, black 38%, transparent);
63
+ --shadow-md: 0 14px 44px color-mix(in oklch, black 48%, transparent);
64
+
65
+ --ambient-accent: color-mix(in oklch, var(--accent) 9%, transparent);
66
+
67
+ /* ── Elevation primitives (additive polish layer) ──────────────────
68
+ Theme-aware depth: a lighter top for surface gradients, a 1px top
69
+ light line, and a rest → hover → featured shadow scale. */
70
+ --surface-hi: oklch(0.247 0.02 252);
71
+ --edge-light: color-mix(in oklch, white 7%, transparent);
72
+ --accent-glow: color-mix(in oklch, var(--accent) 42%, transparent);
73
+ --elevation-rest:
74
+ 0 1px 0 color-mix(in oklch, white 4%, transparent) inset,
75
+ 0 10px 26px -20px color-mix(in oklch, black 72%, transparent);
76
+ --elevation-hover:
77
+ 0 1px 0 color-mix(in oklch, white 6%, transparent) inset,
78
+ 0 22px 46px -26px color-mix(in oklch, black 84%, transparent);
79
+ --elevation-featured:
80
+ 0 0 0 1px var(--accent-ring),
81
+ 0 0 56px -14px var(--accent-glow),
82
+ 0 26px 54px -30px color-mix(in oklch, black 88%, transparent);
83
+
84
+ color-scheme: dark;
85
+ }
86
+
87
+ /* Light mode: pure neutral whites, same accent with stronger contrast on background */
88
+ :root[data-color-scheme='light'] {
89
+ --bg: oklch(0.985 0 0);
90
+ --bg-elevated: oklch(0.97 0 0);
91
+ --surface: oklch(1 0 0);
92
+ --surface-hover: oklch(0.955 0 0);
93
+ --border: oklch(0.87 0.022 250);
94
+ --border-strong: oklch(0.76 0.028 250);
95
+
96
+ --text: oklch(0.36 0.032 255);
97
+ --text-muted: oklch(0.48 0.024 255);
98
+ --text-strong: oklch(0.19 0.04 255);
99
+
100
+ --accent: oklch(0.52 0.19 58);
101
+ --accent-foreground: oklch(0.99 0 0);
102
+ --accent-soft: color-mix(in oklch, var(--accent) 12%, transparent);
103
+ --accent-ring: color-mix(in oklch, var(--accent) 38%, transparent);
104
+
105
+ --danger: oklch(0.5 0.2 25);
106
+ --danger-bg: color-mix(in oklch, var(--danger) 11%, transparent);
107
+ --warn: oklch(0.42 0.12 75);
108
+
109
+ --chart-bg: oklch(0.995 0 0);
110
+ --chart-fg: oklch(0.2 0.035 255);
111
+ --chart-muted: oklch(0.46 0.02 255);
112
+ --chart-grid: oklch(0.87 0.018 255);
113
+ --chart-band: color-mix(in oklch, var(--text-strong) 4%, transparent);
114
+
115
+ --shadow-sm: 0 1px 2px color-mix(in oklch, black 7%, transparent);
116
+ --shadow-md: 0 18px 50px color-mix(in oklch, black 11%, transparent);
117
+
118
+ /* Same orange strength as dark; fades to transparent over the pure-white
119
+ surface, giving an orange → white fade that mirrors dark's orange → black. */
120
+ --ambient-accent: color-mix(in oklch, var(--accent) 9%, transparent);
121
+
122
+ /* ── Elevation primitives (additive polish layer) ──────────────────
123
+ Surfaces are already near-white, so depth comes from a faint
124
+ gradient plus soft, low-opacity drop shadows rather than glow. */
125
+ --surface-hi: oklch(1 0 0);
126
+ --edge-light: color-mix(in oklch, white 85%, transparent);
127
+ --accent-glow: color-mix(in oklch, var(--accent) 24%, transparent);
128
+ --elevation-rest:
129
+ 0 1px 0 color-mix(in oklch, white 70%, transparent) inset,
130
+ 0 8px 20px -16px color-mix(in oklch, black 16%, transparent);
131
+ --elevation-hover:
132
+ 0 1px 0 color-mix(in oklch, white 80%, transparent) inset,
133
+ 0 18px 40px -22px color-mix(in oklch, black 22%, transparent);
134
+ --elevation-featured:
135
+ 0 0 0 1px var(--accent-ring),
136
+ 0 0 48px -16px var(--accent-glow),
137
+ 0 22px 46px -26px color-mix(in oklch, black 20%, transparent);
138
+
139
+ color-scheme: light;
140
+ }
141
+
142
+ :root[data-color-scheme='dark'],
143
+ :root[data-color-scheme='light'] {
144
+ font-family: var(--font-sans);
145
+ font-size: 15px;
146
+ line-height: 1.55;
147
+ letter-spacing: 0.01em;
148
+ color: var(--text);
149
+ background-color: var(--bg);
150
+ font-synthesis: none;
151
+ text-rendering: optimizeLegibility;
152
+ -webkit-font-smoothing: antialiased;
153
+ -moz-osx-font-smoothing: grayscale;
154
+ }
155
+
156
+ @media (prefers-reduced-motion: reduce) {
157
+ *,
158
+ *::before,
159
+ *::after {
160
+ animation-duration: 0.01ms !important;
161
+ animation-iteration-count: 1 !important;
162
+ transition-duration: 0.01ms !important;
163
+ scroll-behavior: auto !important;
164
+ }
165
+ }
166
+
167
+ #root {
168
+ width: 100%;
169
+ min-height: 100svh;
170
+ margin: 0;
171
+ text-align: left;
172
+ box-sizing: border-box;
173
+ }
174
+
175
+ *,
176
+ *::before,
177
+ *::after {
178
+ box-sizing: border-box;
179
+ }
180
+
181
+ body {
182
+ margin: 0;
183
+ }
184
+
185
+ :focus-visible {
186
+ outline: 2px solid var(--accent);
187
+ outline-offset: 2px;
188
+ }
189
+
190
+ :focus:not(:focus-visible) {
191
+ outline: none;
192
+ }
193
+
194
+ h1,
195
+ h2,
196
+ h3 {
197
+ font-family: var(--font-sans);
198
+ font-weight: 600;
199
+ color: var(--text-strong);
200
+ letter-spacing: -0.03em;
201
+ margin: 0;
202
+ }
203
+
204
+ h1 {
205
+ font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2rem);
206
+ font-weight: 700;
207
+ line-height: 1.15;
208
+ }
209
+
210
+ h2 {
211
+ font-size: 0.95rem;
212
+ font-weight: 600;
213
+ letter-spacing: -0.02em;
214
+ }
215
+
216
+ p {
217
+ margin: 0;
218
+ }
@@ -0,0 +1,11 @@
1
+ import type { AlarmLine } from '../types/plotSeries';
2
+ import { type PlotFrame, type PlotFrameStore } from '../lib/render/plotFrame';
3
+ /** Ends of the alarm line in px, or null when the axis is missing or the value is off the plot. */
4
+ export declare function alarmSegment(f: PlotFrame | null, alarm: AlarmLine, axis: 'x' | 'y'): [number, number, number, number] | null;
5
+ export declare const AlarmOverlay: import("react").MemoExoticComponent<({ frame, alarm, axis }: {
6
+ frame: PlotFrameStore;
7
+ alarm: AlarmLine;
8
+ axis: "x" | "y";
9
+ }) => import("react/jsx-runtime").JSX.Element | null>;
10
+ /** Paint the alarm line onto a 2-D canvas of the chart's size × `scale` (PNG export). */
11
+ export declare function paintAlarm(ctx: CanvasRenderingContext2D, f: PlotFrame | null, alarm: AlarmLine, axis: 'x' | 'y', scale: number): void;
@@ -0,0 +1,29 @@
1
+ import type { AnnotationTool, ChartAnnotation } from '../lib/annotations';
2
+ import { type PlotFrame, type PlotFrameStore } from '../lib/render/plotFrame';
3
+ interface Props {
4
+ annotations: ChartAnnotation[];
5
+ tool: AnnotationTool | null;
6
+ plotFrame: PlotFrameStore;
7
+ onChange: (next: ChartAnnotation[]) => void;
8
+ /** Escape pressed with a tool set. */
9
+ onToolEnd: () => void;
10
+ onSelect: (id: string | null) => void;
11
+ }
12
+ type Pt = [number, number];
13
+ /** Elements outside the chart marked with this attribute keep the selection when pressed (a host's style controls). */
14
+ export declare const ANNOTATION_CONTROLS_ATTR = "data-kymo-annotation-controls";
15
+ /** Pixel positions of an annotation's points (null: pinned to X on a chart without an X frame now). */
16
+ export declare function annotationPx(a: ChartAnnotation, W: number, H: number, frame: PlotFrame | null): Pt[] | null;
17
+ export declare const AnnotationLayer: import("react").MemoExoticComponent<({ annotations, tool, plotFrame, onChange, onToolEnd, onSelect }: Props) => import("react/jsx-runtime").JSX.Element>;
18
+ /** A smooth path through the stroke's points (quadratic curves through the midpoints). */
19
+ export declare function brushPath(px: Pt[]): string;
20
+ /** Head of an arrow ending at (x1, y1): its outline and where the shaft should stop. */
21
+ export declare function arrowHead(x0: number, y0: number, x1: number, y1: number, width: number): {
22
+ d: string;
23
+ base: Pt;
24
+ l: Pt;
25
+ r: Pt;
26
+ };
27
+ /** Paint annotations onto a 2-D canvas of the chart's size × `scale` (PNG export). */
28
+ export declare function paintAnnotations(ctx: CanvasRenderingContext2D, list: ChartAnnotation[], W: number, H: number, scale: number, font: string, frame: PlotFrame | null): void;
29
+ export {};
@@ -0,0 +1,52 @@
1
+ /**
2
+ * The bare plotting surface for one chart: picks the renderer for its kind and
3
+ * feeds it the prepared data. No toolbar, menu or placeholder copy — the host
4
+ * learns the chart's status ('no-data' | 'empty' | 'ready') through events.
5
+ */
6
+ import type { ReactNode, Ref } from 'react';
7
+ import type { DashboardPanel } from '../components/dashboardGridLayout';
8
+ import { type PanelChartSettings } from '../lib/panelChartSettings';
9
+ import { type XYZMeshChartHandle } from '../components/XYZMeshChart';
10
+ import type { LiveZoomBus } from '../lib/render/liveZoomBus';
11
+ import { type WorksheetData } from './useWorksheetData';
12
+ import type { LiveConnection } from '../lib/live/types';
13
+ import type { LoadedDataset } from '../types/loadedDataset';
14
+ export type ChartStatus = 'no-data' | 'empty' | 'ready';
15
+ export interface ContextMenuEvent {
16
+ clientX: number;
17
+ clientY: number;
18
+ /** Multiband only: X span of a right-drag, for "zoom to selection". */
19
+ zoomXRange?: [number, number] | null;
20
+ }
21
+ export interface ChartBodyProps {
22
+ panel: DashboardPanel;
23
+ settings: PanelChartSettings | undefined;
24
+ background: string | null;
25
+ /** Changes whenever host styling changes, so charts re-read their CSS colours. */
26
+ styleToken: string;
27
+ data: WorksheetData;
28
+ xKey: string;
29
+ height: number;
30
+ viewXRange: [number, number] | null;
31
+ onViewXRangeChange: (r: [number, number] | null) => void;
32
+ liveZoom: LiveZoomBus;
33
+ liveWindowSeconds: number | null;
34
+ onLiveWindowChange: (seconds: number | null) => void;
35
+ /** The selected live stream a beacon chart follows (even with datasets selected). */
36
+ beaconLive: LiveConnection | null;
37
+ /** A loaded dataset or lap by id (beacon reference data). */
38
+ findDataset: (id: string) => LoadedDataset | undefined;
39
+ shiftMode?: {
40
+ label: string;
41
+ onDragStart: () => void;
42
+ onDragOffset: (delta: number) => void;
43
+ };
44
+ onContextMenu: (e: ContextMenuEvent) => void;
45
+ xyzRef?: Ref<XYZMeshChartHandle>;
46
+ }
47
+ /** Renders the chart and reports whether it had anything to draw. */
48
+ export declare function renderChart(p: ChartBodyProps): {
49
+ status: ChartStatus;
50
+ node: ReactNode;
51
+ data: unknown;
52
+ };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Debug overlay (mount option `debug`): live performance numbers in the chart's
3
+ * top-right corner. It samples on its own animation-frame loop and re-renders
4
+ * only itself, so watching a chart never makes the chart render more.
5
+ */
6
+ import { type RefObject } from 'react';
7
+ /** Written by ChartFrame on every commit; read by the HUD twice a second. */
8
+ export interface PerfStats {
9
+ renderStart: number;
10
+ /** React render + commit of the chart subtree (incl. layout-effect draws), ms. */
11
+ lastRenderMs: number;
12
+ renders: number;
13
+ data: unknown;
14
+ }
15
+ /** Rows the chart is drawing, read off its prepared data. */
16
+ export declare function countPoints(data: unknown): number | null;
17
+ export declare function PerfHud({ stats, host }: {
18
+ stats: PerfStats;
19
+ host: RefObject<HTMLElement | null>;
20
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Beacon view of a live multiband chart: only the current cycle (X starting
3
+ * over — a lap, a battery cycle…) is drawn, with reference data behind it — a
4
+ * loaded dataset, the previous cycle, or nothing (the chart restarts every cycle).
5
+ */
6
+ import type { LiveChartSource } from '../components/MultiBandCanvasChart';
7
+ import { type PointColumns } from '../lib/data/pointColumns';
8
+ import type { LiveConnection } from '../lib/live/types';
9
+ import type { LoadedDataset } from '../types/loadedDataset';
10
+ import type { BeaconSettings } from '../lib/panelChartSettings';
11
+ import type { PlotSeries } from '../types/plotSeries';
12
+ /** Column suffix of the reference copy of a series (grouped with it in the legend). */
13
+ export declare const REF_SUFFIX = "__ref";
14
+ /** Reference series drawn under the live ones (same bands and scales, own colour). */
15
+ export declare function referenceSeries(series: PlotSeries[], color: string): PlotSeries[];
16
+ /** A dataset as reference points (columns suffixed with REF_SUFFIX), sorted by X. */
17
+ export declare function datasetReference(ds: LoadedDataset, xKey: string, cols: string[]): {
18
+ points: PointColumns;
19
+ span: [number, number] | null;
20
+ };
21
+ /**
22
+ * The live source of a beacon chart: the current cycle of `conn` on `xKey`, plus
23
+ * the chosen reference. The X axis spans every cycle seen and the reference.
24
+ */
25
+ export declare function beaconLiveSource(conn: LiveConnection, xKey: string, cols: string[], beacon: BeaconSettings, refDataset: LoadedDataset | undefined): LiveChartSource;
26
+ /** Colour of the active reference, or null when nothing is drawn behind. */
27
+ export declare function referenceColor(beacon: BeaconSettings, hasDataset: boolean): string | null;