@kymoscope/sdk 0.2.0 → 0.3.0
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.
- package/dist/{importers-N1JOOVEg.js → importers-DHeUdZcP.js} +1 -1
- package/dist/{krc-D_CI7AI8.js → krc-BIfw0rX1.js} +1 -1
- package/dist/kymoscope-embed.js +11 -11
- package/dist/kymoscope-sdk.js +12 -12
- package/dist/types/components/GaugeChart.d.ts +11 -1
- package/dist/types/lib/data/liveDataSource.d.ts +1 -1
- package/dist/types/lib/live/buffer.d.ts +2 -1
- package/dist/types/lib/panelChartSettings.d.ts +3 -0
- package/package.json +1 -1
|
@@ -12,16 +12,26 @@ export interface GaugeReading {
|
|
|
12
12
|
alarm?: AlarmLine | null;
|
|
13
13
|
color: string;
|
|
14
14
|
style: 'arc' | 'linear';
|
|
15
|
+
/** The filled part starts at 0 (marked on the scale) instead of at `min`. */
|
|
16
|
+
fromZero?: boolean;
|
|
15
17
|
/** Colours by value (see GaugeItem.colorMode). */
|
|
16
18
|
colorMode?: GaugeColorMode;
|
|
17
19
|
stops?: GaugeColorStop[];
|
|
20
|
+
/** 'last' follows `live` every frame (when given). */
|
|
21
|
+
stat?: 'last' | 'mean' | 'min' | 'max';
|
|
18
22
|
}
|
|
19
23
|
export interface GaugeChartProps {
|
|
20
24
|
gauges: GaugeReading[];
|
|
25
|
+
/** A live stream read every frame (no React at data rate): its newest sample's
|
|
26
|
+
* time, and a column's value at a time (the sample at or before it). */
|
|
27
|
+
live?: {
|
|
28
|
+
latestT: () => number;
|
|
29
|
+
valueAt: (column: string, t: number) => number;
|
|
30
|
+
};
|
|
21
31
|
backgroundToken?: string;
|
|
22
32
|
onPlotContextMenu?: (e: {
|
|
23
33
|
clientX: number;
|
|
24
34
|
clientY: number;
|
|
25
35
|
}) => void;
|
|
26
36
|
}
|
|
27
|
-
export declare function GaugeChart({ gauges, backgroundToken, onPlotContextMenu }: GaugeChartProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function GaugeChart({ gauges, live, backgroundToken, onPlotContextMenu }: GaugeChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -54,7 +54,7 @@ export declare class LiveDataSource implements DataSource {
|
|
|
54
54
|
/** Time of the newest sample (NaN if empty). */
|
|
55
55
|
latestTimeSync(): number;
|
|
56
56
|
/** Value of `column` at time `t` (see LiveBuffer.xAtTime). */
|
|
57
|
-
xAtTimeSync(column: string, t: number): number;
|
|
57
|
+
xAtTimeSync(column: string, t: number, hold?: boolean): number;
|
|
58
58
|
/** The newest sample's value of `column` (NaN if none): the live position on X. */
|
|
59
59
|
latestSync(column: string): number;
|
|
60
60
|
/** Newest received value of each column it has (finite values only). */
|
|
@@ -247,8 +247,9 @@ export declare class LiveBuffer {
|
|
|
247
247
|
* Value of `key` at time `t`: interpolated between the samples around it, but
|
|
248
248
|
* never across a drop (a lap-distance wrap), where it holds the earlier sample.
|
|
249
249
|
* Clamped to the buffered range; NaN if empty or the time column steps back.
|
|
250
|
+
* `hold`: the sample at or before `t`, never interpolated (a gauge's reading).
|
|
250
251
|
*/
|
|
251
|
-
xAtTime(key: string, t: number): number;
|
|
252
|
+
xAtTime(key: string, t: number, hold?: boolean): number;
|
|
252
253
|
private boundsCache;
|
|
253
254
|
/** Min/max of a column over the ring (the chart asks every frame): the ends of
|
|
254
255
|
* an ascending time axis, else a scan once per data change. */
|
|
@@ -325,6 +325,9 @@ export interface GaugeItem {
|
|
|
325
325
|
/** What it shows of its column: the latest value (follows a live stream), or the mean, minimum or maximum. */
|
|
326
326
|
value: 'last' | 'mean' | 'min' | 'max';
|
|
327
327
|
style: 'arc' | 'linear';
|
|
328
|
+
/** Where the filled part starts: the scale's minimum (missing), or zero (a value
|
|
329
|
+
* of -300…300 fills left or right of 0). */
|
|
330
|
+
fill?: 'min' | 'zero';
|
|
328
331
|
/** Scale ends ('' = from the column's data, rounded). */
|
|
329
332
|
min: string;
|
|
330
333
|
max: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kymoscope/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "The Kymoscope data engine and charts for the browser: import large measurement files, plot them, stream live data end-to-end encrypted.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://kymoscope.com/docs/introduction",
|