uplot-plus 0.1.1 → 0.1.3
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/annotations.d.ts +22 -0
- package/dist/annotations.d.ts.map +1 -0
- package/dist/axes/layout.d.ts +30 -0
- package/dist/axes/layout.d.ts.map +1 -0
- package/dist/axes/ticks.d.ts +47 -0
- package/dist/axes/ticks.d.ts.map +1 -0
- package/dist/colors.d.ts +32 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/components/Axis.d.ts +14 -0
- package/dist/components/Axis.d.ts.map +1 -0
- package/dist/components/Band.d.ts +10 -0
- package/dist/components/Band.d.ts.map +1 -0
- package/dist/components/Chart.d.ts +8 -0
- package/dist/components/Chart.d.ts.map +1 -0
- package/dist/components/Legend.d.ts +12 -0
- package/dist/components/Legend.d.ts.map +1 -0
- package/dist/components/Scale.d.ts +11 -0
- package/dist/components/Scale.d.ts.map +1 -0
- package/dist/components/Series.d.ts +11 -0
- package/dist/components/Series.d.ts.map +1 -0
- package/dist/components/Sparkline.d.ts +28 -0
- package/dist/components/Sparkline.d.ts.map +1 -0
- package/dist/components/Timeline.d.ts +8 -0
- package/dist/components/Timeline.d.ts.map +1 -0
- package/dist/components/Tooltip.d.ts +9 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/components/ZoomRanger.d.ts +26 -0
- package/dist/components/ZoomRanger.d.ts.map +1 -0
- package/dist/components/annotations/AnnotationLabel.d.ts +26 -0
- package/dist/components/annotations/AnnotationLabel.d.ts.map +1 -0
- package/dist/components/annotations/HLine.d.ts +22 -0
- package/dist/components/annotations/HLine.d.ts.map +1 -0
- package/dist/components/annotations/Region.d.ts +22 -0
- package/dist/components/annotations/Region.d.ts.map +1 -0
- package/dist/components/annotations/VLine.d.ts +22 -0
- package/dist/components/annotations/VLine.d.ts.map +1 -0
- package/dist/components/annotations/index.d.ts +9 -0
- package/dist/components/annotations/index.d.ts.map +1 -0
- package/dist/core/BlockMinMax.d.ts +42 -0
- package/dist/core/BlockMinMax.d.ts.map +1 -0
- package/dist/core/CursorManager.d.ts +43 -0
- package/dist/core/CursorManager.d.ts.map +1 -0
- package/dist/core/DataStore.d.ts +51 -0
- package/dist/core/DataStore.d.ts.map +1 -0
- package/dist/core/RenderScheduler.d.ts +28 -0
- package/dist/core/RenderScheduler.d.ts.map +1 -0
- package/dist/core/Scale.d.ts +23 -0
- package/dist/core/Scale.d.ts.map +1 -0
- package/dist/core/ScaleManager.d.ts +45 -0
- package/dist/core/ScaleManager.d.ts.map +1 -0
- package/dist/formatters.d.ts +39 -0
- package/dist/formatters.d.ts.map +1 -0
- package/dist/hooks/useChart.d.ts +5 -0
- package/dist/hooks/useChart.d.ts.map +1 -0
- package/dist/hooks/useChartStore.d.ts +69 -0
- package/dist/hooks/useChartStore.d.ts.map +1 -0
- package/dist/hooks/useDrawHook.d.ts +26 -0
- package/dist/hooks/useDrawHook.d.ts.map +1 -0
- package/dist/hooks/useInteraction.d.ts +14 -0
- package/dist/hooks/useInteraction.d.ts.map +1 -0
- package/dist/hooks/useStreamingData.d.ts +48 -0
- package/dist/hooks/useStreamingData.d.ts.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3245 -0
- package/dist/math/align.d.ts +10 -0
- package/dist/math/align.d.ts.map +1 -0
- package/dist/math/increments.d.ts +9 -0
- package/dist/math/increments.d.ts.map +1 -0
- package/dist/math/stack.d.ts +16 -0
- package/dist/math/stack.d.ts.map +1 -0
- package/dist/math/utils.d.ts +74 -0
- package/dist/math/utils.d.ts.map +1 -0
- package/dist/paths/bars.d.ts +9 -0
- package/dist/paths/bars.d.ts.map +1 -0
- package/dist/paths/candlestick.d.ts +35 -0
- package/dist/paths/candlestick.d.ts.map +1 -0
- package/dist/paths/catmullRom.d.ts +9 -0
- package/dist/paths/catmullRom.d.ts.map +1 -0
- package/dist/paths/linear.d.ts +10 -0
- package/dist/paths/linear.d.ts.map +1 -0
- package/dist/paths/monotoneCubic.d.ts +10 -0
- package/dist/paths/monotoneCubic.d.ts.map +1 -0
- package/dist/paths/points.d.ts +10 -0
- package/dist/paths/points.d.ts.map +1 -0
- package/dist/paths/spline.d.ts +9 -0
- package/dist/paths/spline.d.ts.map +1 -0
- package/dist/paths/stepped.d.ts +9 -0
- package/dist/paths/stepped.d.ts.map +1 -0
- package/dist/paths/types.d.ts +32 -0
- package/dist/paths/types.d.ts.map +1 -0
- package/dist/paths/utils.d.ts +19 -0
- package/dist/paths/utils.d.ts.map +1 -0
- package/dist/rendering/CanvasRenderer.d.ts +86 -0
- package/dist/rendering/CanvasRenderer.d.ts.map +1 -0
- package/dist/rendering/drawAxes.d.ts +8 -0
- package/dist/rendering/drawAxes.d.ts.map +1 -0
- package/dist/rendering/drawBands.d.ts +12 -0
- package/dist/rendering/drawBands.d.ts.map +1 -0
- package/dist/rendering/drawCursor.d.ts +22 -0
- package/dist/rendering/drawCursor.d.ts.map +1 -0
- package/dist/rendering/drawPoints.d.ts +13 -0
- package/dist/rendering/drawPoints.d.ts.map +1 -0
- package/dist/rendering/drawSelect.d.ts +14 -0
- package/dist/rendering/drawSelect.d.ts.map +1 -0
- package/dist/rendering/drawSeries.d.ts +7 -0
- package/dist/rendering/drawSeries.d.ts.map +1 -0
- package/dist/sync/SyncGroup.d.ts +33 -0
- package/dist/sync/SyncGroup.d.ts.map +1 -0
- package/dist/sync/useSyncGroup.d.ts +8 -0
- package/dist/sync/useSyncGroup.d.ts.map +1 -0
- package/dist/time/fmtDate.d.ts +15 -0
- package/dist/time/fmtDate.d.ts.map +1 -0
- package/dist/time/timeIncrs.d.ts +17 -0
- package/dist/time/timeIncrs.d.ts.map +1 -0
- package/dist/time/timeSplits.d.ts +6 -0
- package/dist/time/timeSplits.d.ts.map +1 -0
- package/dist/time/timeVals.d.ts +16 -0
- package/dist/time/timeVals.d.ts.map +1 -0
- package/dist/types/axes.d.ts +84 -0
- package/dist/types/axes.d.ts.map +1 -0
- package/dist/types/bands.d.ts +12 -0
- package/dist/types/bands.d.ts.map +1 -0
- package/dist/types/chart.d.ts +53 -0
- package/dist/types/chart.d.ts.map +1 -0
- package/dist/types/common.d.ts +62 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/cursor.d.ts +22 -0
- package/dist/types/cursor.d.ts.map +1 -0
- package/dist/types/data.d.ts +32 -0
- package/dist/types/data.d.ts.map +1 -0
- package/dist/types/events.d.ts +57 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/hooks.d.ts +28 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/legend.d.ts +8 -0
- package/dist/types/legend.d.ts.map +1 -0
- package/dist/types/scales.d.ts +60 -0
- package/dist/types/scales.d.ts.map +1 -0
- package/dist/types/series.d.ts +76 -0
- package/dist/types/series.d.ts.map +1 -0
- package/dist/types/timeline.d.ts +30 -0
- package/dist/types/timeline.d.ts.map +1 -0
- package/dist/types/tooltip.d.ts +33 -0
- package/dist/types/tooltip.d.ts.map +1 -0
- package/dist/utils/shallowEqual.d.ts +10 -0
- package/dist/utils/shallowEqual.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fmtDate.d.ts","sourceRoot":"","sources":["../../src/time/fmtDate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,uFAAuF;AACvF,wBAAgB,OAAO,CACrB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,IAAI,CAAC,qBAAqB,EAChC,EAAE,CAAC,EAAE,MAAM,GACV,MAAM,CAGR;AAED,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE5D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time increment constants (in seconds) for time-scale axes.
|
|
3
|
+
* Covers sub-second to multi-year intervals.
|
|
4
|
+
*/
|
|
5
|
+
export declare const SEC = 1;
|
|
6
|
+
export declare const MIN = 60;
|
|
7
|
+
export declare const HOUR = 3600;
|
|
8
|
+
export declare const DAY = 86400;
|
|
9
|
+
export declare const WEEK = 604800;
|
|
10
|
+
export declare const MONTH = 2592000;
|
|
11
|
+
export declare const YEAR = 31536000;
|
|
12
|
+
/**
|
|
13
|
+
* Standard time increments from 1 second to 1 year.
|
|
14
|
+
* Each entry is in seconds.
|
|
15
|
+
*/
|
|
16
|
+
export declare const timeIncrs: readonly number[];
|
|
17
|
+
//# sourceMappingURL=timeIncrs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeIncrs.d.ts","sourceRoot":"","sources":["../../src/time/timeIncrs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,GAAG,IAAI,CAAC;AACrB,eAAO,MAAM,GAAG,KAAK,CAAC;AACtB,eAAO,MAAM,IAAI,OAAO,CAAC;AACzB,eAAO,MAAM,GAAG,QAAQ,CAAC;AACzB,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,KAAK,UAAU,CAAC;AAC7B,eAAO,MAAM,IAAI,WAAW,CAAC;AAE7B;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,MAAM,EAiCtC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate tick split positions for a time axis.
|
|
3
|
+
* Aligns splits to round time boundaries (midnight, hour starts, etc.).
|
|
4
|
+
*/
|
|
5
|
+
export declare function timeAxisSplits(minSec: number, maxSec: number, incr: number, _tz?: string): number[];
|
|
6
|
+
//# sourceMappingURL=timeSplits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeSplits.d.ts","sourceRoot":"","sources":["../../src/time/timeSplits.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,GACX,MAAM,EAAE,CAsEV"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format time axis tick values as strings.
|
|
3
|
+
* Adaptively selects format based on the increment:
|
|
4
|
+
* - Sub-minute: HH:MM:SS
|
|
5
|
+
* - Minutes/hours: HH:MM
|
|
6
|
+
* - Days: "Mon DD"
|
|
7
|
+
* - Months: "Mon YYYY"
|
|
8
|
+
* - Years: "YYYY"
|
|
9
|
+
*/
|
|
10
|
+
export declare function timeAxisVals(splits: number[], incr: number, tz?: string): string[];
|
|
11
|
+
/**
|
|
12
|
+
* Find the best time increment for a given time range and pixel dimension.
|
|
13
|
+
* Returns [increment, spacing] where increment is in seconds.
|
|
14
|
+
*/
|
|
15
|
+
export declare function findTimeIncr(minSec: number, maxSec: number, timeIncrs: readonly number[], dim: number, minSpace: number): [number, number];
|
|
16
|
+
//# sourceMappingURL=timeVals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeVals.d.ts","sourceRoot":"","sources":["../../src/time/timeVals.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EAAE,EAChB,IAAI,EAAE,MAAM,EACZ,EAAE,CAAC,EAAE,MAAM,GACV,MAAM,EAAE,CAiBV;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACf,CAAC,MAAM,EAAE,MAAM,CAAC,CAclB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { Side } from './common';
|
|
2
|
+
/** Configuration for an axis */
|
|
3
|
+
export interface AxisConfig {
|
|
4
|
+
/** Which scale this axis displays */
|
|
5
|
+
scale: string;
|
|
6
|
+
/** Which side of the chart (default: Bottom for "x" scale, Left for others) */
|
|
7
|
+
side: Side;
|
|
8
|
+
/** Whether to show this axis */
|
|
9
|
+
show?: boolean;
|
|
10
|
+
/** Axis label text */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Label font */
|
|
13
|
+
labelFont?: string;
|
|
14
|
+
/** Label size in CSS pixels */
|
|
15
|
+
labelSize?: number;
|
|
16
|
+
/** Label gap from axis edge */
|
|
17
|
+
labelGap?: number;
|
|
18
|
+
/** Tick/label font */
|
|
19
|
+
font?: string;
|
|
20
|
+
/** Stroke color for labels */
|
|
21
|
+
stroke?: string;
|
|
22
|
+
/** Minimum space between ticks in CSS pixels */
|
|
23
|
+
space?: number;
|
|
24
|
+
/** Gap between ticks and labels */
|
|
25
|
+
gap?: number;
|
|
26
|
+
/** Axis size (height for horizontal, width for vertical) */
|
|
27
|
+
size?: number;
|
|
28
|
+
/** Tick label rotation in degrees */
|
|
29
|
+
rotate?: number;
|
|
30
|
+
/** Custom tick increment array */
|
|
31
|
+
incrs?: number[];
|
|
32
|
+
/** Custom tick value formatter */
|
|
33
|
+
values?: (splits: number[], space: number, incr: number) => string[];
|
|
34
|
+
/** Custom tick split generator */
|
|
35
|
+
splits?: (min: number, max: number, incr: number, space: number) => number[];
|
|
36
|
+
/** Grid line config */
|
|
37
|
+
grid?: GridConfig;
|
|
38
|
+
/** Tick mark config */
|
|
39
|
+
ticks?: TickConfig;
|
|
40
|
+
/** Border config */
|
|
41
|
+
border?: BorderConfig;
|
|
42
|
+
}
|
|
43
|
+
export interface GridConfig {
|
|
44
|
+
show?: boolean;
|
|
45
|
+
stroke?: string;
|
|
46
|
+
width?: number;
|
|
47
|
+
dash?: number[];
|
|
48
|
+
}
|
|
49
|
+
export interface TickConfig {
|
|
50
|
+
show?: boolean;
|
|
51
|
+
stroke?: string;
|
|
52
|
+
width?: number;
|
|
53
|
+
size?: number;
|
|
54
|
+
dash?: number[];
|
|
55
|
+
}
|
|
56
|
+
export interface BorderConfig {
|
|
57
|
+
show?: boolean;
|
|
58
|
+
stroke?: string;
|
|
59
|
+
width?: number;
|
|
60
|
+
dash?: number[];
|
|
61
|
+
}
|
|
62
|
+
/** Runtime axis state (internal) */
|
|
63
|
+
export interface AxisState {
|
|
64
|
+
config: AxisConfig;
|
|
65
|
+
/** Whether currently visible (has valid scale range) */
|
|
66
|
+
_show: boolean;
|
|
67
|
+
/** Computed size in CSS pixels */
|
|
68
|
+
_size: number;
|
|
69
|
+
/** Position of axis line (CSS pixels from chart origin) */
|
|
70
|
+
_pos: number;
|
|
71
|
+
/** Position of axis label (CSS pixels from chart origin) */
|
|
72
|
+
_lpos: number;
|
|
73
|
+
/** Computed tick splits */
|
|
74
|
+
_splits: number[] | null;
|
|
75
|
+
/** Computed tick labels */
|
|
76
|
+
_values: string[] | null;
|
|
77
|
+
/** Computed tick increment */
|
|
78
|
+
_incr: number;
|
|
79
|
+
/** Computed tick spacing */
|
|
80
|
+
_space: number;
|
|
81
|
+
/** Label rotation */
|
|
82
|
+
_rotate: number;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=axes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axes.d.ts","sourceRoot":"","sources":["../../src/types/axes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,gCAAgC;AAChC,MAAM,WAAW,UAAU;IACzB,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,IAAI,EAAE,IAAI,CAAC;IACX,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,kCAAkC;IAClC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;IACrE,kCAAkC;IAClC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EA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A4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Configuration for a band (shaded area between two series). */
|
|
2
|
+
export interface BandConfig {
|
|
3
|
+
/** The two series indices within the group: [upper, lower] */
|
|
4
|
+
series: [number, number];
|
|
5
|
+
/** Group index containing both series */
|
|
6
|
+
group: number;
|
|
7
|
+
/** Fill color for the band region */
|
|
8
|
+
fill?: string;
|
|
9
|
+
/** Direction: -1=below only, 0=between (both sides), 1=above only */
|
|
10
|
+
dir?: -1 | 0 | 1;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=bands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bands.d.ts","sourceRoot":"","sources":["../../src/types/bands.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,WAAW,UAAU;IACzB,8DAA8D;IAC9D,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAClB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ChartData } from './data';
|
|
2
|
+
import type { DrawCallback, CursorDrawCallback } from './hooks';
|
|
3
|
+
import type { ChartEventInfo, SelectEventInfo, ScaleChangeCallback } from './events';
|
|
4
|
+
/** Focus mode configuration */
|
|
5
|
+
export interface FocusConfig {
|
|
6
|
+
/** Alpha opacity for non-focused series (default: 0.15) */
|
|
7
|
+
alpha?: number;
|
|
8
|
+
}
|
|
9
|
+
/** Cursor/interaction configuration */
|
|
10
|
+
export interface CursorConfig {
|
|
11
|
+
/** Enable mouse wheel zoom on x-axis (default: false) */
|
|
12
|
+
wheelZoom?: boolean;
|
|
13
|
+
/** Focus mode: dims non-closest series on hover */
|
|
14
|
+
focus?: FocusConfig;
|
|
15
|
+
}
|
|
16
|
+
/** Props for the Chart component */
|
|
17
|
+
export interface ChartProps {
|
|
18
|
+
/** Width in CSS pixels */
|
|
19
|
+
width: number;
|
|
20
|
+
/** Height in CSS pixels */
|
|
21
|
+
height: number;
|
|
22
|
+
/** Chart data */
|
|
23
|
+
data: ChartData;
|
|
24
|
+
/** React children (Scale, Series, Axis, Legend, Tooltip, Band) */
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
/** CSS class name */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** Device pixel ratio override (default: window.devicePixelRatio) */
|
|
29
|
+
pxRatio?: number;
|
|
30
|
+
/** Draw on the persistent layer (after series, before snapshot). */
|
|
31
|
+
onDraw?: DrawCallback;
|
|
32
|
+
/** Draw on the cursor overlay (redrawn every frame). */
|
|
33
|
+
onCursorDraw?: CursorDrawCallback;
|
|
34
|
+
/** Sync key — charts with the same key synchronize their cursors. */
|
|
35
|
+
syncKey?: string;
|
|
36
|
+
/** Cursor and interaction config */
|
|
37
|
+
cursor?: CursorConfig;
|
|
38
|
+
/** Fires on click within the plot area, with resolved nearest point */
|
|
39
|
+
onClick?: (info: ChartEventInfo) => void;
|
|
40
|
+
/** Fires on right-click within the plot area */
|
|
41
|
+
onContextMenu?: (info: ChartEventInfo) => void;
|
|
42
|
+
/** Fires on double-click (before zoom reset) — return false to prevent reset */
|
|
43
|
+
onDblClick?: (info: ChartEventInfo) => boolean | void;
|
|
44
|
+
/** Fires when cursor moves over the plot */
|
|
45
|
+
onCursorMove?: (info: ChartEventInfo) => void;
|
|
46
|
+
/** Fires when cursor leaves the plot area */
|
|
47
|
+
onCursorLeave?: () => void;
|
|
48
|
+
/** Fires after a scale range changes (zoom, pan, or programmatic) */
|
|
49
|
+
onScaleChange?: ScaleChangeCallback;
|
|
50
|
+
/** Fires when drag selection completes (before zoom is applied) — return false to prevent zoom */
|
|
51
|
+
onSelect?: (sel: SelectEventInfo) => boolean | void;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../src/types/chart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAErF,+BAA+B;AAC/B,MAAM,WAAW,WAAW;IAC1B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,uCAAuC;AACvC,MAAM,WAAW,YAAY;IAC3B,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,oCAAoC;AACpC,MAAM,WAAW,UAAU;IACzB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,wDAAwD;IACxD,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,MAAM,CAAC,EAAE,YAAY,CAAC;IAItB,uEAAuE;IACvE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,gDAAgD;IAChD,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC/C,gFAAgF;IAChF,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,GAAG,IAAI,CAAC;IACtD,4CAA4C;IAC5C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,qEAAqE;IACrE,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,kGAAkG;IAClG,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,OAAO,GAAG,IAAI,CAAC;CACrD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** Numeric array type used for data */
|
|
2
|
+
export type NumArray = number[] | Float64Array;
|
|
3
|
+
/** Nullable numeric array (supports gaps in data). Float64Array cannot hold null, so use NumArray for gap-free data. */
|
|
4
|
+
export type NullableNumArray = (number | null)[];
|
|
5
|
+
/** Bounding box in CSS pixels */
|
|
6
|
+
export interface BBox {
|
|
7
|
+
left: number;
|
|
8
|
+
top: number;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}
|
|
12
|
+
/** Range with min/max */
|
|
13
|
+
export interface Range {
|
|
14
|
+
min: number;
|
|
15
|
+
max: number;
|
|
16
|
+
}
|
|
17
|
+
/** Side of chart: Top=0, Right=1, Bottom=2, Left=3 */
|
|
18
|
+
export declare const enum Side {
|
|
19
|
+
Top = 0,
|
|
20
|
+
Right = 1,
|
|
21
|
+
Bottom = 2,
|
|
22
|
+
Left = 3
|
|
23
|
+
}
|
|
24
|
+
/** Orientation: Horizontal=0 (top/bottom), Vertical=1 (left/right) */
|
|
25
|
+
export declare const enum Orientation {
|
|
26
|
+
Horizontal = 0,
|
|
27
|
+
Vertical = 1
|
|
28
|
+
}
|
|
29
|
+
/** Direction: Forward=1 (L→R / B→T), Backward=-1 (R→L / T→B) */
|
|
30
|
+
export declare const enum Direction {
|
|
31
|
+
Forward = 1,
|
|
32
|
+
Backward = -1
|
|
33
|
+
}
|
|
34
|
+
/** Distribution type for scales */
|
|
35
|
+
export declare const enum Distribution {
|
|
36
|
+
Linear = 1,
|
|
37
|
+
Ordinal = 2,
|
|
38
|
+
Log = 3,
|
|
39
|
+
Asinh = 4
|
|
40
|
+
}
|
|
41
|
+
/** Sort order for series data */
|
|
42
|
+
export declare const enum SortOrder {
|
|
43
|
+
Ascending = 1,
|
|
44
|
+
Descending = -1,
|
|
45
|
+
Unsorted = 0
|
|
46
|
+
}
|
|
47
|
+
/** Derive orientation from side: top/bottom → Horizontal, left/right → Vertical */
|
|
48
|
+
export declare function sideOrientation(side: Side): Orientation;
|
|
49
|
+
/** Pixel rounding function */
|
|
50
|
+
export type PxRound = (v: number) => number;
|
|
51
|
+
/** Dirty flags for the render scheduler */
|
|
52
|
+
export declare const enum DirtyFlag {
|
|
53
|
+
None = 0,
|
|
54
|
+
Scales = 1,
|
|
55
|
+
Axes = 2,
|
|
56
|
+
Paths = 4,
|
|
57
|
+
Cursor = 8,
|
|
58
|
+
Select = 16,
|
|
59
|
+
Size = 32,
|
|
60
|
+
Full = 63
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,MAAM,MAAM,QAAQ,GAAG,MAAM,EAAE,GAAG,YAAY,CAAC;AAE/C,wHAAwH;AACxH,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;AAEjD,iCAAiC;AACjC,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,yBAAyB;AACzB,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,sDAAsD;AACtD,0BAAkB,IAAI;IACpB,GAAG,IAAO;IACV,KAAK,IAAK;IACV,MAAM,IAAI;IACV,IAAI,IAAM;CACX;AAED,sEAAsE;AACtE,0BAAkB,WAAW;IAC3B,UAAU,IAAI;IACd,QAAQ,IAAM;CACf;AAED,gEAAgE;AAChE,0BAAkB,SAAS;IACzB,OAAO,IAAM;IACb,QAAQ,KAAK;CACd;AAED,mCAAmC;AACnC,0BAAkB,YAAY;IAC5B,MAAM,IAAK;IACX,OAAO,IAAI;IACX,GAAG,IAAQ;IACX,KAAK,IAAM;CACZ;AAED,iCAAiC;AACjC,0BAAkB,SAAS;IACzB,SAAS,IAAM;IACf,UAAU,KAAK;IACf,QAAQ,IAAO;CAChB;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,WAAW,CAEvD;AAED,8BAA8B;AAC9B,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAE5C,2CAA2C;AAC3C,0BAAkB,SAAS;IACzB,IAAI,IAAO;IACX,MAAM,IAAK;IACX,IAAI,IAAO;IACX,KAAK,IAAM;IACX,MAAM,IAAK;IACX,MAAM,KAAM;IACZ,IAAI,KAAQ;IACZ,IAAI,KAAQ;CACb"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Cursor state */
|
|
2
|
+
export interface CursorState {
|
|
3
|
+
/** CSS pixel position from plot left edge (-10 = off) */
|
|
4
|
+
left: number;
|
|
5
|
+
/** CSS pixel position from plot top edge (-10 = off) */
|
|
6
|
+
top: number;
|
|
7
|
+
/** Active group index (which xGroup the closest point belongs to) */
|
|
8
|
+
activeGroup: number;
|
|
9
|
+
/** Active series index within the group */
|
|
10
|
+
activeSeriesIdx: number;
|
|
11
|
+
/** Active data index within the series's x array */
|
|
12
|
+
activeDataIdx: number;
|
|
13
|
+
}
|
|
14
|
+
/** Selection rectangle state */
|
|
15
|
+
export interface SelectState {
|
|
16
|
+
show: boolean;
|
|
17
|
+
left: number;
|
|
18
|
+
top: number;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=cursor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/types/cursor.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAC;IACZ,qEAAqE;IACrE,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,eAAe,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,gCAAgC;AAChC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { NumArray, NullableNumArray } from './common';
|
|
2
|
+
/**
|
|
3
|
+
* An XGroup: a set of series sharing a single x-value array.
|
|
4
|
+
* The x array provides the x-coordinates, and each entry in series
|
|
5
|
+
* is a y-value array plotted against those x-coordinates.
|
|
6
|
+
*/
|
|
7
|
+
export interface XGroup {
|
|
8
|
+
x: NumArray;
|
|
9
|
+
series: NullableNumArray[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Chart data is a list of XGroups.
|
|
13
|
+
* Each group has its own x-values and one or more y-series.
|
|
14
|
+
*
|
|
15
|
+
* Example - single x-axis:
|
|
16
|
+
* [{ x: [1,2,3], series: [[10,20,30], [40,50,60]] }]
|
|
17
|
+
*
|
|
18
|
+
* Example - two independent x-axes:
|
|
19
|
+
* [
|
|
20
|
+
* { x: [t0,t1,t2], series: [[temp0,temp1,temp2]] },
|
|
21
|
+
* { x: [f0,f1,f2], series: [[spectrum0,spectrum1,spectrum2]] },
|
|
22
|
+
* ]
|
|
23
|
+
*/
|
|
24
|
+
export type ChartData = XGroup[];
|
|
25
|
+
/**
|
|
26
|
+
* Identifies a specific series by its group index and series index within that group.
|
|
27
|
+
*/
|
|
28
|
+
export interface SeriesRef {
|
|
29
|
+
group: number;
|
|
30
|
+
index: number;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/types/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE3D;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB,CAAC,EAAE,QAAQ,CAAC;IACZ,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC;AAEjC;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** Nearest data point resolved from cursor position */
|
|
2
|
+
export interface NearestPoint {
|
|
3
|
+
/** XGroup index */
|
|
4
|
+
group: number;
|
|
5
|
+
/** Series index within the group */
|
|
6
|
+
seriesIdx: number;
|
|
7
|
+
/** Data array index */
|
|
8
|
+
dataIdx: number;
|
|
9
|
+
/** X data value */
|
|
10
|
+
xVal: number;
|
|
11
|
+
/** Y data value */
|
|
12
|
+
yVal: number;
|
|
13
|
+
/** CSS pixel X of the snapped point (relative to plot left) */
|
|
14
|
+
pxX: number;
|
|
15
|
+
/** CSS pixel Y of the snapped point (relative to plot top) */
|
|
16
|
+
pxY: number;
|
|
17
|
+
/** Pixel distance from cursor to this point */
|
|
18
|
+
dist: number;
|
|
19
|
+
}
|
|
20
|
+
/** Resolved chart event data — passed to all interaction callbacks */
|
|
21
|
+
export interface ChartEventInfo {
|
|
22
|
+
/** CSS pixel X within the plot area */
|
|
23
|
+
plotX: number;
|
|
24
|
+
/** CSS pixel Y within the plot area */
|
|
25
|
+
plotY: number;
|
|
26
|
+
/** The nearest data point (null if no data is close) */
|
|
27
|
+
point: NearestPoint | null;
|
|
28
|
+
/** The original DOM event */
|
|
29
|
+
srcEvent: MouseEvent | TouchEvent;
|
|
30
|
+
}
|
|
31
|
+
/** Info about a completed drag selection */
|
|
32
|
+
export interface SelectEventInfo {
|
|
33
|
+
/** Fractional left edge [0..1] */
|
|
34
|
+
left: number;
|
|
35
|
+
/** Fractional right edge [0..1] */
|
|
36
|
+
right: number;
|
|
37
|
+
/** Data-space min/max for each x-scale */
|
|
38
|
+
ranges: Record<string, {
|
|
39
|
+
min: number;
|
|
40
|
+
max: number;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
/** Callback for scale range changes (zoom/pan) */
|
|
44
|
+
export type ScaleChangeCallback = (scaleId: string, min: number, max: number) => void;
|
|
45
|
+
/** Callback for selection events — return false to prevent zoom */
|
|
46
|
+
export type SelectCallback = (sel: SelectEventInfo) => boolean | void;
|
|
47
|
+
/** Bag of event callbacks stored on ChartStore — updated via refs from Chart props */
|
|
48
|
+
export interface EventCallbacks {
|
|
49
|
+
onClick?: (info: ChartEventInfo) => void;
|
|
50
|
+
onContextMenu?: (info: ChartEventInfo) => void;
|
|
51
|
+
onDblClick?: (info: ChartEventInfo) => boolean | void;
|
|
52
|
+
onCursorMove?: (info: ChartEventInfo) => void;
|
|
53
|
+
onCursorLeave?: () => void;
|
|
54
|
+
onScaleChange?: ScaleChangeCallback;
|
|
55
|
+
onSelect?: SelectCallback;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,MAAM,WAAW,YAAY;IAC3B,mBAAmB;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,6BAA6B;IAC7B,QAAQ,EAAE,UAAU,GAAG,UAAU,CAAC;CACnC;AAED,4CAA4C;AAC5C,MAAM,WAAW,eAAe;IAC9B,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtD;AAED,kDAAkD;AAClD,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;AAEtF,mEAAmE;AACnE,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,eAAe,KAAK,OAAO,GAAG,IAAI,CAAC;AAEtE,sFAAsF;AACtF,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC/C,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,GAAG,IAAI,CAAC;IACtD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BBox } from './common';
|
|
2
|
+
import type { CursorState } from './cursor';
|
|
3
|
+
import type { ScaleState } from './scales';
|
|
4
|
+
/** Context passed to draw callbacks — everything needed to draw on the canvas.
|
|
5
|
+
*
|
|
6
|
+
* The canvas context is pre-configured by the library:
|
|
7
|
+
* - **Clipped** to the plot area (persistent hooks only) — drawing outside is impossible
|
|
8
|
+
* - **Scaled** by `pxRatio` — all coordinates are in CSS pixels, not device pixels
|
|
9
|
+
*
|
|
10
|
+
* Use the `valToX` / `valToY` helpers to convert data values to CSS pixel positions
|
|
11
|
+
* without needing to look up scales or call `valToPos` manually.
|
|
12
|
+
*/
|
|
13
|
+
export interface DrawContext {
|
|
14
|
+
ctx: CanvasRenderingContext2D;
|
|
15
|
+
plotBox: BBox;
|
|
16
|
+
pxRatio: number;
|
|
17
|
+
/** Get a live scale state by id (reflects current zoom/pan). */
|
|
18
|
+
getScale: (id: string) => ScaleState | undefined;
|
|
19
|
+
/** Convert a data value to CSS pixel X position. Uses scale `'x'` by default. Returns `null` if scale is not ready. */
|
|
20
|
+
valToX: (val: number, scaleId?: string) => number | null;
|
|
21
|
+
/** Convert a data value to CSS pixel Y position. Returns `null` if scale is not ready. */
|
|
22
|
+
valToY: (val: number, scaleId: string) => number | null;
|
|
23
|
+
}
|
|
24
|
+
/** Callback that draws persistent content (included in snapshot, not redrawn on cursor move). */
|
|
25
|
+
export type DrawCallback = (dc: DrawContext) => void;
|
|
26
|
+
/** Callback that draws on the cursor overlay (redrawn every frame). */
|
|
27
|
+
export type CursorDrawCallback = (dc: DrawContext, cursor: CursorState) => void;
|
|
28
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/types/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,wBAAwB,CAAC;IAC9B,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,UAAU,GAAG,SAAS,CAAC;IACjD,uHAAuH;IACvH,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACzD,0FAA0F;IAC1F,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACzD;AAED,iGAAiG;AACjG,MAAM,MAAM,YAAY,GAAG,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;AAErD,uEAAuE;AACvE,MAAM,MAAM,kBAAkB,GAAG,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { NumArray, NullableNumArray, BBox, Range, PxRound } from './common';
|
|
2
|
+
export { Side, Orientation, Direction, Distribution, SortOrder, sideOrientation, DirtyFlag } from './common';
|
|
3
|
+
export type { XGroup, ChartData, SeriesRef } from './data';
|
|
4
|
+
export type { ScaleConfig, ScaleState, RangeConfig, RangePart } from './scales';
|
|
5
|
+
export type { SeriesConfig, SeriesState, PointsConfig, GradientConfig, ColorValue } from './series';
|
|
6
|
+
export type { AxisConfig, AxisState, GridConfig, TickConfig, BorderConfig } from './axes';
|
|
7
|
+
export type { CursorState, SelectState } from './cursor';
|
|
8
|
+
export type { ChartProps, CursorConfig, FocusConfig } from './chart';
|
|
9
|
+
export type { DrawContext, DrawCallback, CursorDrawCallback } from './hooks';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7G,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC3D,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAChF,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACpG,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC1F,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACzD,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACrE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/types/legend.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,qCAAqC;IACrC,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;CAC7B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Orientation, Direction, Distribution } from './common';
|
|
2
|
+
/** Configuration for a scale */
|
|
3
|
+
export interface ScaleConfig {
|
|
4
|
+
/** Unique scale identifier */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Whether this is a time-based scale */
|
|
7
|
+
time?: boolean;
|
|
8
|
+
/** Auto-range from data */
|
|
9
|
+
auto?: boolean;
|
|
10
|
+
/** Distribution type */
|
|
11
|
+
distr?: Distribution;
|
|
12
|
+
/** Log base (when distr=3) */
|
|
13
|
+
log?: number;
|
|
14
|
+
/** Asinh linear threshold (when distr=4) */
|
|
15
|
+
asinh?: number;
|
|
16
|
+
/** Fixed min value (overrides auto) */
|
|
17
|
+
min?: number | null;
|
|
18
|
+
/** Fixed max value (overrides auto) */
|
|
19
|
+
max?: number | null;
|
|
20
|
+
/** Direction */
|
|
21
|
+
dir?: Direction;
|
|
22
|
+
/** Orientation: Horizontal (x), Vertical (y) */
|
|
23
|
+
ori?: Orientation;
|
|
24
|
+
/** Range configuration for auto-ranging */
|
|
25
|
+
range?: RangeConfig;
|
|
26
|
+
}
|
|
27
|
+
/** Range padding/bounds configuration */
|
|
28
|
+
export interface RangeConfig {
|
|
29
|
+
min?: RangePart;
|
|
30
|
+
max?: RangePart;
|
|
31
|
+
}
|
|
32
|
+
export interface RangePart {
|
|
33
|
+
/** Padding as fraction of data range */
|
|
34
|
+
pad?: number;
|
|
35
|
+
/** Hard limit */
|
|
36
|
+
hard?: number;
|
|
37
|
+
/** Soft limit */
|
|
38
|
+
soft?: number;
|
|
39
|
+
/** Soft mode: 0=off, 1=always, 2=inside, 3=outside */
|
|
40
|
+
mode?: 0 | 1 | 2 | 3;
|
|
41
|
+
}
|
|
42
|
+
/** Runtime scale state */
|
|
43
|
+
export interface ScaleState {
|
|
44
|
+
id: string;
|
|
45
|
+
min: number | null;
|
|
46
|
+
max: number | null;
|
|
47
|
+
distr: Distribution;
|
|
48
|
+
log: number;
|
|
49
|
+
asinh: number;
|
|
50
|
+
ori: Orientation;
|
|
51
|
+
dir: Direction;
|
|
52
|
+
time: boolean;
|
|
53
|
+
auto: boolean;
|
|
54
|
+
range: RangeConfig | null;
|
|
55
|
+
/** Cached transformed min (for log/asinh distributions) */
|
|
56
|
+
_min: number | null;
|
|
57
|
+
/** Cached transformed max (for log/asinh distributions) */
|
|
58
|
+
_max: number | null;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=scales.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scales.d.ts","sourceRoot":"","sources":["../../src/types/scales.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAErE,gCAAgC;AAChC,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,yCAAyC;IACzC,IAAI,CAAC,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AO,CAAC;IACd,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,2DAA2D;IAC3D,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,2DAA2D;IAC3D,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { SortOrder } from './common';
|
|
2
|
+
import type { PathBuilder } from '../paths/types';
|
|
3
|
+
/** Gradient configuration for fills/strokes */
|
|
4
|
+
export interface GradientConfig {
|
|
5
|
+
type: 'linear';
|
|
6
|
+
/** Gradient stops: [offset 0-1, css color string] */
|
|
7
|
+
stops: [number, string][];
|
|
8
|
+
}
|
|
9
|
+
/** Color value: plain CSS string or gradient config */
|
|
10
|
+
export type ColorValue = string | GradientConfig;
|
|
11
|
+
/** Configuration for a data series */
|
|
12
|
+
export interface SeriesConfig {
|
|
13
|
+
/** Which data group this series belongs to (index into ChartData[]) */
|
|
14
|
+
group: number;
|
|
15
|
+
/** Which series within the group (index into XGroup.series[]) */
|
|
16
|
+
index: number;
|
|
17
|
+
/** Y-axis scale key */
|
|
18
|
+
yScale: string;
|
|
19
|
+
/** Whether to show this series */
|
|
20
|
+
show?: boolean;
|
|
21
|
+
/** Label for legend/tooltip */
|
|
22
|
+
label?: string;
|
|
23
|
+
/** Stroke color (string or gradient config) */
|
|
24
|
+
stroke?: ColorValue;
|
|
25
|
+
/** Fill color (string or gradient config) */
|
|
26
|
+
fill?: ColorValue;
|
|
27
|
+
/** Stroke width in CSS pixels */
|
|
28
|
+
width?: number;
|
|
29
|
+
/** Opacity 0-1 */
|
|
30
|
+
alpha?: number;
|
|
31
|
+
/** Whether data is sorted */
|
|
32
|
+
sorted?: SortOrder;
|
|
33
|
+
/** Whether to connect across null gaps */
|
|
34
|
+
spanGaps?: boolean;
|
|
35
|
+
/** Path builder function */
|
|
36
|
+
paths?: PathBuilder;
|
|
37
|
+
/** Points configuration */
|
|
38
|
+
points?: PointsConfig;
|
|
39
|
+
/** Dash pattern */
|
|
40
|
+
dash?: number[];
|
|
41
|
+
/** Line cap */
|
|
42
|
+
cap?: CanvasLineCap;
|
|
43
|
+
/** Line join */
|
|
44
|
+
join?: CanvasLineJoin;
|
|
45
|
+
/** Pixel alignment: 0=none, 1=round to pixel (default), other=snap to increment */
|
|
46
|
+
pxAlign?: number;
|
|
47
|
+
/** Fill-to value or function */
|
|
48
|
+
fillTo?: number | ((min: number, max: number) => number);
|
|
49
|
+
/** Cursor behavior for this series */
|
|
50
|
+
cursor?: {
|
|
51
|
+
/** Whether to draw the point indicator on hover (default: true) */
|
|
52
|
+
show?: boolean;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export interface PointsConfig {
|
|
56
|
+
show?: boolean | ((groupIdx: number, seriesIdx: number, i0: number, i1: number, dim: number) => boolean);
|
|
57
|
+
size?: number;
|
|
58
|
+
space?: number;
|
|
59
|
+
width?: number;
|
|
60
|
+
stroke?: string;
|
|
61
|
+
fill?: string;
|
|
62
|
+
dash?: number[];
|
|
63
|
+
}
|
|
64
|
+
/** Runtime series state (internal) */
|
|
65
|
+
export interface SeriesState {
|
|
66
|
+
config: SeriesConfig;
|
|
67
|
+
/** X-scale key (derived from group) */
|
|
68
|
+
xScale: string;
|
|
69
|
+
/** Cached min y-value in current window */
|
|
70
|
+
min: number;
|
|
71
|
+
/** Cached max y-value in current window */
|
|
72
|
+
max: number;
|
|
73
|
+
/** Visible index range within this series's xGroup */
|
|
74
|
+
idxs: [number, number];
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=series.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"series.d.ts","sourceRoot":"","sources":["../../src/types/series.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,+CAA+C;AAC/C,MAAM,WAAW,cAAc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