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.
Files changed (151) hide show
  1. package/dist/annotations.d.ts +22 -0
  2. package/dist/annotations.d.ts.map +1 -0
  3. package/dist/axes/layout.d.ts +30 -0
  4. package/dist/axes/layout.d.ts.map +1 -0
  5. package/dist/axes/ticks.d.ts +47 -0
  6. package/dist/axes/ticks.d.ts.map +1 -0
  7. package/dist/colors.d.ts +32 -0
  8. package/dist/colors.d.ts.map +1 -0
  9. package/dist/components/Axis.d.ts +14 -0
  10. package/dist/components/Axis.d.ts.map +1 -0
  11. package/dist/components/Band.d.ts +10 -0
  12. package/dist/components/Band.d.ts.map +1 -0
  13. package/dist/components/Chart.d.ts +8 -0
  14. package/dist/components/Chart.d.ts.map +1 -0
  15. package/dist/components/Legend.d.ts +12 -0
  16. package/dist/components/Legend.d.ts.map +1 -0
  17. package/dist/components/Scale.d.ts +11 -0
  18. package/dist/components/Scale.d.ts.map +1 -0
  19. package/dist/components/Series.d.ts +11 -0
  20. package/dist/components/Series.d.ts.map +1 -0
  21. package/dist/components/Sparkline.d.ts +28 -0
  22. package/dist/components/Sparkline.d.ts.map +1 -0
  23. package/dist/components/Timeline.d.ts +8 -0
  24. package/dist/components/Timeline.d.ts.map +1 -0
  25. package/dist/components/Tooltip.d.ts +9 -0
  26. package/dist/components/Tooltip.d.ts.map +1 -0
  27. package/dist/components/ZoomRanger.d.ts +26 -0
  28. package/dist/components/ZoomRanger.d.ts.map +1 -0
  29. package/dist/components/annotations/AnnotationLabel.d.ts +26 -0
  30. package/dist/components/annotations/AnnotationLabel.d.ts.map +1 -0
  31. package/dist/components/annotations/HLine.d.ts +22 -0
  32. package/dist/components/annotations/HLine.d.ts.map +1 -0
  33. package/dist/components/annotations/Region.d.ts +22 -0
  34. package/dist/components/annotations/Region.d.ts.map +1 -0
  35. package/dist/components/annotations/VLine.d.ts +22 -0
  36. package/dist/components/annotations/VLine.d.ts.map +1 -0
  37. package/dist/components/annotations/index.d.ts +9 -0
  38. package/dist/components/annotations/index.d.ts.map +1 -0
  39. package/dist/core/BlockMinMax.d.ts +42 -0
  40. package/dist/core/BlockMinMax.d.ts.map +1 -0
  41. package/dist/core/CursorManager.d.ts +43 -0
  42. package/dist/core/CursorManager.d.ts.map +1 -0
  43. package/dist/core/DataStore.d.ts +51 -0
  44. package/dist/core/DataStore.d.ts.map +1 -0
  45. package/dist/core/RenderScheduler.d.ts +28 -0
  46. package/dist/core/RenderScheduler.d.ts.map +1 -0
  47. package/dist/core/Scale.d.ts +23 -0
  48. package/dist/core/Scale.d.ts.map +1 -0
  49. package/dist/core/ScaleManager.d.ts +45 -0
  50. package/dist/core/ScaleManager.d.ts.map +1 -0
  51. package/dist/formatters.d.ts +39 -0
  52. package/dist/formatters.d.ts.map +1 -0
  53. package/dist/hooks/useChart.d.ts +5 -0
  54. package/dist/hooks/useChart.d.ts.map +1 -0
  55. package/dist/hooks/useChartStore.d.ts +69 -0
  56. package/dist/hooks/useChartStore.d.ts.map +1 -0
  57. package/dist/hooks/useDrawHook.d.ts +26 -0
  58. package/dist/hooks/useDrawHook.d.ts.map +1 -0
  59. package/dist/hooks/useInteraction.d.ts +14 -0
  60. package/dist/hooks/useInteraction.d.ts.map +1 -0
  61. package/dist/hooks/useStreamingData.d.ts +48 -0
  62. package/dist/hooks/useStreamingData.d.ts.map +1 -0
  63. package/dist/index.cjs +1 -0
  64. package/dist/index.d.ts +45 -0
  65. package/dist/index.d.ts.map +1 -0
  66. package/dist/index.js +3245 -0
  67. package/dist/math/align.d.ts +10 -0
  68. package/dist/math/align.d.ts.map +1 -0
  69. package/dist/math/increments.d.ts +9 -0
  70. package/dist/math/increments.d.ts.map +1 -0
  71. package/dist/math/stack.d.ts +16 -0
  72. package/dist/math/stack.d.ts.map +1 -0
  73. package/dist/math/utils.d.ts +74 -0
  74. package/dist/math/utils.d.ts.map +1 -0
  75. package/dist/paths/bars.d.ts +9 -0
  76. package/dist/paths/bars.d.ts.map +1 -0
  77. package/dist/paths/candlestick.d.ts +35 -0
  78. package/dist/paths/candlestick.d.ts.map +1 -0
  79. package/dist/paths/catmullRom.d.ts +9 -0
  80. package/dist/paths/catmullRom.d.ts.map +1 -0
  81. package/dist/paths/linear.d.ts +10 -0
  82. package/dist/paths/linear.d.ts.map +1 -0
  83. package/dist/paths/monotoneCubic.d.ts +10 -0
  84. package/dist/paths/monotoneCubic.d.ts.map +1 -0
  85. package/dist/paths/points.d.ts +10 -0
  86. package/dist/paths/points.d.ts.map +1 -0
  87. package/dist/paths/spline.d.ts +9 -0
  88. package/dist/paths/spline.d.ts.map +1 -0
  89. package/dist/paths/stepped.d.ts +9 -0
  90. package/dist/paths/stepped.d.ts.map +1 -0
  91. package/dist/paths/types.d.ts +32 -0
  92. package/dist/paths/types.d.ts.map +1 -0
  93. package/dist/paths/utils.d.ts +19 -0
  94. package/dist/paths/utils.d.ts.map +1 -0
  95. package/dist/rendering/CanvasRenderer.d.ts +86 -0
  96. package/dist/rendering/CanvasRenderer.d.ts.map +1 -0
  97. package/dist/rendering/drawAxes.d.ts +8 -0
  98. package/dist/rendering/drawAxes.d.ts.map +1 -0
  99. package/dist/rendering/drawBands.d.ts +12 -0
  100. package/dist/rendering/drawBands.d.ts.map +1 -0
  101. package/dist/rendering/drawCursor.d.ts +22 -0
  102. package/dist/rendering/drawCursor.d.ts.map +1 -0
  103. package/dist/rendering/drawPoints.d.ts +13 -0
  104. package/dist/rendering/drawPoints.d.ts.map +1 -0
  105. package/dist/rendering/drawSelect.d.ts +14 -0
  106. package/dist/rendering/drawSelect.d.ts.map +1 -0
  107. package/dist/rendering/drawSeries.d.ts +7 -0
  108. package/dist/rendering/drawSeries.d.ts.map +1 -0
  109. package/dist/sync/SyncGroup.d.ts +33 -0
  110. package/dist/sync/SyncGroup.d.ts.map +1 -0
  111. package/dist/sync/useSyncGroup.d.ts +8 -0
  112. package/dist/sync/useSyncGroup.d.ts.map +1 -0
  113. package/dist/time/fmtDate.d.ts +15 -0
  114. package/dist/time/fmtDate.d.ts.map +1 -0
  115. package/dist/time/timeIncrs.d.ts +17 -0
  116. package/dist/time/timeIncrs.d.ts.map +1 -0
  117. package/dist/time/timeSplits.d.ts +6 -0
  118. package/dist/time/timeSplits.d.ts.map +1 -0
  119. package/dist/time/timeVals.d.ts +16 -0
  120. package/dist/time/timeVals.d.ts.map +1 -0
  121. package/dist/types/axes.d.ts +84 -0
  122. package/dist/types/axes.d.ts.map +1 -0
  123. package/dist/types/bands.d.ts +12 -0
  124. package/dist/types/bands.d.ts.map +1 -0
  125. package/dist/types/chart.d.ts +53 -0
  126. package/dist/types/chart.d.ts.map +1 -0
  127. package/dist/types/common.d.ts +62 -0
  128. package/dist/types/common.d.ts.map +1 -0
  129. package/dist/types/cursor.d.ts +22 -0
  130. package/dist/types/cursor.d.ts.map +1 -0
  131. package/dist/types/data.d.ts +32 -0
  132. package/dist/types/data.d.ts.map +1 -0
  133. package/dist/types/events.d.ts +57 -0
  134. package/dist/types/events.d.ts.map +1 -0
  135. package/dist/types/hooks.d.ts +28 -0
  136. package/dist/types/hooks.d.ts.map +1 -0
  137. package/dist/types/index.d.ts +10 -0
  138. package/dist/types/index.d.ts.map +1 -0
  139. package/dist/types/legend.d.ts +8 -0
  140. package/dist/types/legend.d.ts.map +1 -0
  141. package/dist/types/scales.d.ts +60 -0
  142. package/dist/types/scales.d.ts.map +1 -0
  143. package/dist/types/series.d.ts +76 -0
  144. package/dist/types/series.d.ts.map +1 -0
  145. package/dist/types/timeline.d.ts +30 -0
  146. package/dist/types/timeline.d.ts.map +1 -0
  147. package/dist/types/tooltip.d.ts +33 -0
  148. package/dist/types/tooltip.d.ts.map +1 -0
  149. package/dist/utils/shallowEqual.d.ts +10 -0
  150. package/dist/utils/shallowEqual.d.ts.map +1 -0
  151. package/package.json +1 -1
@@ -0,0 +1,22 @@
1
+ import type { DrawContext } from './types/hooks';
2
+ import type { ScaleState } from './types';
3
+ export interface AnnotationStyle {
4
+ stroke?: string;
5
+ width?: number;
6
+ dash?: number[];
7
+ fill?: string;
8
+ font?: string;
9
+ }
10
+ /** Draw a horizontal line at a y-value.
11
+ * Assumes ctx is already pxRatio-scaled (handled by the library). */
12
+ export declare function drawHLine(dc: DrawContext, yScale: ScaleState, value: number, style?: AnnotationStyle): void;
13
+ /** Draw a vertical line at an x-value.
14
+ * Assumes ctx is already pxRatio-scaled (handled by the library). */
15
+ export declare function drawVLine(dc: DrawContext, xScale: ScaleState, value: number, style?: AnnotationStyle): void;
16
+ /** Draw a text label at data coordinates.
17
+ * Assumes ctx is already pxRatio-scaled (handled by the library). */
18
+ export declare function drawLabel(dc: DrawContext, xScale: ScaleState, yScale: ScaleState, xVal: number, yVal: number, text: string, style?: AnnotationStyle): void;
19
+ /** Draw a shaded region between two y-values.
20
+ * Assumes ctx is already pxRatio-scaled (handled by the library). */
21
+ export declare function drawRegion(dc: DrawContext, yScale: ScaleState, yMin: number, yMax: number, style?: AnnotationStyle): void;
22
+ //# sourceMappingURL=annotations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../src/annotations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;sEACsE;AACtE,wBAAgB,SAAS,CACvB,EAAE,EAAE,WAAW,EACf,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,eAAoB,GAC1B,IAAI,CAYN;AAED;sEACsE;AACtE,wBAAgB,SAAS,CACvB,EAAE,EAAE,WAAW,EACf,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,eAAoB,GAC1B,IAAI,CAYN;AAED;sEACsE;AACtE,wBAAgB,SAAS,CACvB,EAAE,EAAE,WAAW,EACf,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,eAAoB,GAC1B,IAAI,CASN;AAED;sEACsE;AACtE,wBAAgB,UAAU,CACxB,EAAE,EAAE,WAAW,EACf,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,eAAoB,GAC1B,IAAI,CAcN"}
@@ -0,0 +1,30 @@
1
+ import type { ScaleState, BBox } from '../types';
2
+ import type { AxisState } from '../types/axes';
3
+ /**
4
+ * Run one cycle of axis calculation.
5
+ * For each visible axis, compute tick positions, labels, and size.
6
+ * Returns true if all axis sizes have converged.
7
+ *
8
+ * Ported from uPlot uPlot.js axesCalc.
9
+ */
10
+ export declare function axesCalc(axisStates: AxisState[], getScale: (id: string) => ScaleState | undefined, plotWidCss: number, plotHgtCss: number, cycleNum: number): boolean;
11
+ /**
12
+ * Compute the plot area bounding box by subtracting axis sizes from the chart dimensions.
13
+ *
14
+ * Ported from uPlot uPlot.js calcPlotRect (lines 818-870).
15
+ */
16
+ export declare function calcPlotRect(chartWidth: number, chartHeight: number, axisStates: AxisState[]): BBox;
17
+ /**
18
+ * Compute axis positions (_pos and _lpos) using cumulative offsets from plot edges.
19
+ *
20
+ * Ported from uPlot uPlot.js calcAxesRects (lines 872-899).
21
+ */
22
+ export declare function calcAxesRects(axisStates: AxisState[], plotBox: BBox): void;
23
+ /**
24
+ * Run the convergence loop: repeatedly calculate axes and plot rect
25
+ * until axis sizes stabilize (or max 3 cycles).
26
+ *
27
+ * Ported from uPlot uPlot.js convergeSize.
28
+ */
29
+ export declare function convergeSize(chartWidth: number, chartHeight: number, axisStates: AxisState[], getScale: (id: string) => ScaleState | undefined): BBox;
30
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/axes/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAiB/C;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,UAAU,EAAE,SAAS,EAAE,EACvB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,UAAU,GAAG,SAAS,EAChD,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAoFT;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,SAAS,EAAE,GACtB,IAAI,CAsCN;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,GAAG,IAAI,CA8B1E;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,SAAS,EAAE,EACvB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,UAAU,GAAG,SAAS,GAC/C,IAAI,CAqCN"}
@@ -0,0 +1,47 @@
1
+ import type { AxisConfig, AxisState } from '../types/axes';
2
+ /**
3
+ * Generate tick split positions for a numeric (linear) axis.
4
+ * Ported from uPlot opts.js numAxisSplits.
5
+ */
6
+ export declare function numAxisSplits(scaleMin: number, scaleMax: number, foundIncr: number, _foundSpace: number, forceMin: boolean): number[];
7
+ /**
8
+ * Format tick values as strings for a numeric axis.
9
+ * Ported from uPlot opts.js numAxisVals.
10
+ */
11
+ export declare function numAxisVals(splits: number[]): string[];
12
+ /**
13
+ * Generate tick split positions for a log-scale axis.
14
+ * Ported from uPlot opts.js logAxisSplits.
15
+ */
16
+ export declare function logAxisSplits(scaleMin: number, scaleMax: number, logBase: number): number[];
17
+ /**
18
+ * Generate tick split positions for an asinh (symmetric log) axis.
19
+ * Produces linear ticks near zero and logarithmic ticks at larger magnitudes.
20
+ *
21
+ * @param scaleMin - minimum value on the scale
22
+ * @param scaleMax - maximum value on the scale
23
+ * @param linthresh - linear threshold (values within [-linthresh, linthresh] are linear)
24
+ */
25
+ export declare function asinhAxisSplits(scaleMin: number, scaleMax: number, linthresh?: number): number[];
26
+ /**
27
+ * Filter log axis split values to reduce label density.
28
+ * Keeps only values that are exact powers of the log base.
29
+ * This prevents crowded labels at intermediate ticks (2, 3, 4... between 1 and 10).
30
+ */
31
+ export declare function logAxisValFilter(splits: number[], logBase: number): boolean[];
32
+ /**
33
+ * Determine optimal tick increment and spacing for an axis.
34
+ * Ported from uPlot uPlot.js getIncrSpace.
35
+ */
36
+ export declare function getIncrSpace(axis: AxisConfig, min: number, max: number, fullDim: number): [number, number];
37
+ /**
38
+ * Compute the size of an axis in CSS pixels.
39
+ * For vertical axes, estimates width from the longest tick label.
40
+ * For horizontal axes, uses a fixed height based on font size.
41
+ */
42
+ export declare function computeAxisSize(axis: AxisConfig, _values: string[] | null, _cycleNum: number): number;
43
+ /**
44
+ * Create an initial AxisState from an AxisConfig.
45
+ */
46
+ export declare function createAxisState(config: AxisConfig): AxisState;
47
+ //# sourceMappingURL=ticks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticks.d.ts","sourceRoot":"","sources":["../../src/axes/ticks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAiB3D;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,OAAO,GAChB,MAAM,EAAE,CAaV;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAEtD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,MAAM,EAAE,CA0CV;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,SAAI,GACZ,MAAM,EAAE,CA8CV;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,EAAE,MAAM,GACd,OAAO,EAAE,CAUX;AAYD;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,CAAC,MAAM,EAAE,MAAM,CAAC,CAWlB;AAKD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EACxB,SAAS,EAAE,MAAM,GAChB,MAAM,CAsBR;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,CAa7D"}
@@ -0,0 +1,32 @@
1
+ import type { GradientConfig } from './types';
2
+ /**
3
+ * Create a vertical linear gradient that fades a color from one opacity to another.
4
+ * Useful for area charts: `fill={fadeGradient('#3498db')}`.
5
+ *
6
+ * Supports hex (#rgb, #rrggbb) and rgb()/rgba() color strings.
7
+ *
8
+ * @param color - CSS color string (hex or rgb/rgba)
9
+ * @param fromAlpha - opacity at the top (default 0.8)
10
+ * @param toAlpha - opacity at the bottom (default 0.0)
11
+ */
12
+ export declare function fadeGradient(color: string, fromAlpha?: number, toAlpha?: number): GradientConfig;
13
+ /**
14
+ * Return a CSS color string with a new alpha value.
15
+ * Useful for matching fill to stroke: `fill={withAlpha(stroke, 0.1)}`.
16
+ *
17
+ * Supports hex (#rgb, #rrggbb) and rgb()/rgba() color strings.
18
+ *
19
+ * @param color - CSS color string (hex or rgb/rgba)
20
+ * @param alpha - opacity 0–1
21
+ */
22
+ export declare function withAlpha(color: string, alpha: number): string;
23
+ /**
24
+ * Generate a palette of N visually distinct colors using HSL rotation.
25
+ * Uses the golden angle (~137.5°) for maximum separation between adjacent colors.
26
+ *
27
+ * @param n - number of colors to generate
28
+ * @param saturation - HSL saturation percentage (default 65)
29
+ * @param lightness - HSL lightness percentage (default 50)
30
+ */
31
+ export declare function palette(n: number, saturation?: number, lightness?: number): string[];
32
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAqC9C;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EACb,SAAS,SAAM,EACf,OAAO,SAAM,GACZ,cAAc,CAchB;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAK9D;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,SAAK,EAAE,SAAS,SAAK,GAAG,MAAM,EAAE,CAQ5E"}
@@ -0,0 +1,14 @@
1
+ import type { AxisConfig } from '../types';
2
+ import { Side } from '../types';
3
+ export type AxisProps = Omit<AxisConfig, 'side'> & {
4
+ side?: Side;
5
+ };
6
+ /**
7
+ * Renderless component that registers an axis config with the chart store.
8
+ * Must be a child of <Chart>.
9
+ *
10
+ * Mount effect registers/unregisters based on identity keys (scale, side).
11
+ * Sync effect updates config when any prop changes (shallow-equality bail-out).
12
+ */
13
+ export declare function Axis(props: AxisProps): null;
14
+ //# sourceMappingURL=Axis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Axis.d.ts","sourceRoot":"","sources":["../../src/components/Axis.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIhC,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAMnE;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAuC3C"}
@@ -0,0 +1,10 @@
1
+ import type { BandConfig } from '../types/bands';
2
+ /**
3
+ * Renderless component that registers a band config with the chart store.
4
+ * A band fills the area between two series.
5
+ *
6
+ * Uses a mount/update split: registers once on mount, replaces config immutably on prop changes.
7
+ * Destructures series tuple to primitives for stable dependency comparison.
8
+ */
9
+ export declare function Band({ series, group, fill, dir }: BandConfig): null;
10
+ //# sourceMappingURL=Band.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Band.d.ts","sourceRoot":"","sources":["../../src/components/Band.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,UAAU,GAAG,IAAI,CA6BnE"}
@@ -0,0 +1,8 @@
1
+ import type { ChartProps } from '../types';
2
+ /**
3
+ * Root chart component.
4
+ * Creates a canvas element, manages the chart store, and provides context to children.
5
+ * Canvas drawing is completely decoupled from React's reconciliation cycle.
6
+ */
7
+ export declare function Chart({ width, height, data, children, className, pxRatio: pxRatioOverride, onDraw, onCursorDraw, syncKey, cursor, onClick, onContextMenu, onDblClick, onCursorMove, onCursorLeave, onScaleChange, onSelect, }: ChartProps): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=Chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../src/components/Chart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAO3C;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,EACpB,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAClE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EACrC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAC/D,aAAa,EAAE,QAAQ,GACxB,EAAE,UAAU,2CAsJZ"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { LegendConfig } from '../types/legend';
3
+ interface LegendProps extends LegendConfig {
4
+ className?: string;
5
+ }
6
+ /**
7
+ * Legend component that shows series labels with color swatches.
8
+ * Updates live as the cursor moves. Click to toggle series visibility.
9
+ */
10
+ export declare function Legend({ show, position, className }: LegendProps): React.ReactElement | null;
11
+ export {};
12
+ //# sourceMappingURL=Legend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../src/components/Legend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0D,MAAM,OAAO,CAAC;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,UAAU,WAAY,SAAQ,YAAY;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAwDD;;;GAGG;AACH,wBAAgB,MAAM,CAAC,EAAE,IAAW,EAAE,QAAmB,EAAE,SAAS,EAAE,EAAE,WAAW,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAiE9G"}
@@ -0,0 +1,11 @@
1
+ import type { ScaleConfig } from '../types';
2
+ export type ScaleProps = ScaleConfig;
3
+ /**
4
+ * Renderless component that registers a scale config with the chart store.
5
+ * Must be a child of <Chart>.
6
+ *
7
+ * Mount effect registers/unregisters based on identity key (id).
8
+ * Sync effect updates config when any prop changes (shallow-equality bail-out).
9
+ */
10
+ export declare function Scale(props: ScaleProps): null;
11
+ //# sourceMappingURL=Scale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Scale.d.ts","sourceRoot":"","sources":["../../src/components/Scale.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAI5C,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;AAErC;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAiC7C"}
@@ -0,0 +1,11 @@
1
+ import type { SeriesConfig } from '../types';
2
+ export type SeriesProps = SeriesConfig;
3
+ /**
4
+ * Renderless component that registers a series config with the chart store.
5
+ * Must be a child of <Chart>.
6
+ *
7
+ * Mount effect registers/unregisters based on identity keys (group, index).
8
+ * Sync effect updates config when any prop changes (shallow-equality bail-out).
9
+ */
10
+ export declare function Series(props: SeriesProps): null;
11
+ //# sourceMappingURL=Series.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Series.d.ts","sourceRoot":"","sources":["../../src/components/Series.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC;AAEvC;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAoC/C"}
@@ -0,0 +1,28 @@
1
+ import type { ChartData, ColorValue } from '../types';
2
+ import type { PathBuilder } from '../paths/types';
3
+ export interface SparklineProps {
4
+ /** Chart data (single group, single series expected) */
5
+ data: ChartData;
6
+ /** Width in CSS pixels (default: 150) */
7
+ width?: number;
8
+ /** Height in CSS pixels (default: 30) */
9
+ height?: number;
10
+ /** Line/bar color (default: '#03a9f4') */
11
+ stroke?: ColorValue;
12
+ /** Fill color */
13
+ fill?: ColorValue;
14
+ /** Line width in CSS pixels (default: 1) */
15
+ lineWidth?: number;
16
+ /** Path builder — pass bars() for bar sparklines (default: linear) */
17
+ paths?: PathBuilder;
18
+ /** Fill target value (e.g. 0 for bars) */
19
+ fillTo?: number;
20
+ /** CSS class name for the wrapper div */
21
+ className?: string;
22
+ }
23
+ /**
24
+ * Compact inline chart with no axes or interaction.
25
+ * Ideal for sparklines in tables and dashboards.
26
+ */
27
+ export declare function Sparkline({ data, width, height, stroke, fill, lineWidth, paths, fillTo, className, }: SparklineProps): React.JSX.Element;
28
+ //# sourceMappingURL=Sparkline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sparkline.d.ts","sourceRoot":"","sources":["../../src/components/Sparkline.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,IAAI,EAAE,SAAS,CAAC;IAChB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,iBAAiB;IACjB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,KAAW,EACX,MAAW,EACX,MAAkB,EAClB,IAAI,EACJ,SAAa,EACb,KAAK,EACL,MAAM,EACN,SAAS,GACV,EAAE,cAAc,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAqBpC"}
@@ -0,0 +1,8 @@
1
+ import type { TimelineProps } from '../types/timeline';
2
+ /**
3
+ * Timeline component — renders discrete event spans as horizontal colored bars.
4
+ * Each lane is a category, each segment is a time range with optional color/label.
5
+ * Uses useDrawHook to draw on the persistent canvas layer.
6
+ */
7
+ export declare function Timeline({ lanes, laneHeight, gap, scaleId, }: TimelineProps): null;
8
+ //# sourceMappingURL=Timeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../src/components/Timeline.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,UAAe,EACf,GAAO,EACP,OAAa,GACd,EAAE,aAAa,GAAG,IAAI,CA+DtB"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { TooltipProps } from '../types/tooltip';
3
+ /**
4
+ * Tooltip component that shows data values at the cursor position.
5
+ * Uses useSyncExternalStore to subscribe to cursor state updates.
6
+ * Positioned as an absolute HTML overlay inside the chart container.
7
+ */
8
+ export declare function Tooltip({ show, className, children, offset, }: TooltipProps): React.ReactElement | null;
9
+ //# sourceMappingURL=Tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/components/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,YAAY,EAA4B,MAAM,kBAAkB,CAAC;AAa/E;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAW,EACX,SAAS,EACT,QAAQ,EACR,MAAW,GACZ,EAAE,YAAY,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAiI1C"}
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import type { ChartData } from '../types';
3
+ export interface ZoomRangerProps {
4
+ /** Chart width in CSS pixels */
5
+ width: number;
6
+ /** Chart height in CSS pixels */
7
+ height: number;
8
+ /** Data to render in the overview */
9
+ data: ChartData;
10
+ /** Called when the selection range changes */
11
+ onRangeChange?: (min: number, max: number) => void;
12
+ /** Initial selection range as [min, max] data values */
13
+ initialRange?: [number, number];
14
+ /** CSS class for the outer wrapper */
15
+ className?: string;
16
+ /** Series colors (one per series in group 0) */
17
+ colors?: string[];
18
+ /** Show grip handles on edges */
19
+ grips?: boolean;
20
+ }
21
+ /**
22
+ * ZoomRanger — an overview mini-chart with a draggable selection window.
23
+ * The selection controls the zoom range of a linked detail chart via onRangeChange.
24
+ */
25
+ export declare function ZoomRanger({ width, height, data, onRangeChange, initialRange, className, colors, grips, }: ZoomRangerProps): React.ReactElement;
26
+ //# sourceMappingURL=ZoomRanger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomRanger.d.ts","sourceRoot":"","sources":["../../src/components/ZoomRanger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAM1C,MAAM,WAAW,eAAe;IAC9B,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,IAAI,EAAE,SAAS,CAAC;IAChB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,wDAAwD;IACxD,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,iCAAiC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,MAAM,EACN,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,SAAS,EACT,MAAM,EACN,KAAa,GACd,EAAE,eAAe,GAAG,KAAK,CAAC,YAAY,CAwNtC"}
@@ -0,0 +1,26 @@
1
+ export interface AnnotationLabelProps {
2
+ /** X data value */
3
+ x: number;
4
+ /** Y data value */
5
+ y: number;
6
+ /** Label text */
7
+ text: string;
8
+ /** Scale id for the x-axis (default: 'x') */
9
+ xScale?: string;
10
+ /** Scale id for the y-axis (default: 'y') */
11
+ yScale?: string;
12
+ /** Text color (default: '#000') */
13
+ fill?: string;
14
+ /** Font (default: '12px sans-serif') */
15
+ font?: string;
16
+ /** Text alignment (default: 'left') */
17
+ align?: CanvasTextAlign;
18
+ /** Text baseline (default: 'bottom') */
19
+ baseline?: CanvasTextBaseline;
20
+ }
21
+ /**
22
+ * Declarative text label annotation at data coordinates.
23
+ * Place inside `<Chart>`.
24
+ */
25
+ export declare function AnnotationLabel(props: AnnotationLabelProps): null;
26
+ //# sourceMappingURL=AnnotationLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnnotationLabel.d.ts","sourceRoot":"","sources":["../../../src/components/annotations/AnnotationLabel.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,oBAAoB;IACnC,mBAAmB;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,mBAAmB;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAmBjE"}
@@ -0,0 +1,22 @@
1
+ export interface HLineProps {
2
+ /** Y data value where the line is drawn */
3
+ value: number;
4
+ /** Scale id for the y-axis (default: 'y') */
5
+ yScale?: string;
6
+ /** Line color (default: 'red') */
7
+ stroke?: string;
8
+ /** Line width in CSS pixels (default: 1) */
9
+ width?: number;
10
+ /** Dash pattern */
11
+ dash?: number[];
12
+ /** Optional text label drawn at the left edge */
13
+ label?: string;
14
+ /** Font for the label */
15
+ labelFont?: string;
16
+ }
17
+ /**
18
+ * Declarative horizontal line annotation.
19
+ * Renders a horizontal line at a y-data-value. Place inside `<Chart>`.
20
+ */
21
+ export declare function HLine(props: HLineProps): null;
22
+ //# sourceMappingURL=HLine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HLine.d.ts","sourceRoot":"","sources":["../../../src/components/annotations/HLine.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CA6B7C"}
@@ -0,0 +1,22 @@
1
+ export interface RegionProps {
2
+ /** Lower y data value */
3
+ yMin: number;
4
+ /** Upper y data value */
5
+ yMax: number;
6
+ /** Scale id for the y-axis (default: 'y') */
7
+ yScale?: string;
8
+ /** Fill color (default: 'rgba(255,0,0,0.1)') */
9
+ fill?: string;
10
+ /** Border stroke color */
11
+ stroke?: string;
12
+ /** Border stroke width */
13
+ strokeWidth?: number;
14
+ /** Border dash pattern */
15
+ dash?: number[];
16
+ }
17
+ /**
18
+ * Declarative shaded region annotation.
19
+ * Fills the area between two y-data-values. Place inside `<Chart>`.
20
+ */
21
+ export declare function Region(props: RegionProps): null;
22
+ //# sourceMappingURL=Region.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Region.d.ts","sourceRoot":"","sources":["../../../src/components/annotations/Region.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAkB/C"}
@@ -0,0 +1,22 @@
1
+ export interface VLineProps {
2
+ /** X data value where the line is drawn */
3
+ value: number;
4
+ /** Scale id for the x-axis (default: 'x') */
5
+ xScale?: string;
6
+ /** Line color (default: 'red') */
7
+ stroke?: string;
8
+ /** Line width in CSS pixels (default: 1) */
9
+ width?: number;
10
+ /** Dash pattern */
11
+ dash?: number[];
12
+ /** Optional text label drawn at the top */
13
+ label?: string;
14
+ /** Font for the label */
15
+ labelFont?: string;
16
+ }
17
+ /**
18
+ * Declarative vertical line annotation.
19
+ * Renders a vertical line at an x-data-value. Place inside `<Chart>`.
20
+ */
21
+ export declare function VLine(props: VLineProps): null;
22
+ //# sourceMappingURL=VLine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VLine.d.ts","sourceRoot":"","sources":["../../../src/components/annotations/VLine.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CA6B7C"}
@@ -0,0 +1,9 @@
1
+ export { HLine } from './HLine';
2
+ export { VLine } from './VLine';
3
+ export { Region } from './Region';
4
+ export { AnnotationLabel } from './AnnotationLabel';
5
+ export type { HLineProps } from './HLine';
6
+ export type { VLineProps } from './VLine';
7
+ export type { RegionProps } from './Region';
8
+ export type { AnnotationLabelProps } from './AnnotationLabel';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/annotations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Block Min-Max Tree for O(n/blockSize) range min/max queries.
3
+ *
4
+ * Divides a data array into fixed-size blocks and pre-computes
5
+ * min/max for each block. Range queries decompose into:
6
+ * partial-left-block + full-middle-blocks + partial-right-block
7
+ *
8
+ * Build: O(n) | Query: O(n/blockSize + blockSize) | Update: O(blockSize)
9
+ */
10
+ export declare class BlockMinMaxTree {
11
+ /** Flat array of [min, max] pairs per block */
12
+ private blocks;
13
+ /** Number of blocks */
14
+ private nBlocks;
15
+ /** Block size */
16
+ private blockSize;
17
+ /** Reference to underlying data */
18
+ private data;
19
+ /** Total data length */
20
+ private len;
21
+ constructor(data: ArrayLike<number | null>, blockSize?: number);
22
+ /** Build min/max for all blocks */
23
+ private buildAll;
24
+ /**
25
+ * Query min/max over index range [i0, i1] (inclusive).
26
+ * Returns [Infinity, -Infinity] if no valid data in range.
27
+ */
28
+ rangeMinMax(i0: number, i1: number): [number, number];
29
+ /**
30
+ * Rebuild a single block (for incremental append).
31
+ * @param blockIdx - index of the block to rebuild
32
+ */
33
+ updateBlock(blockIdx: number): void;
34
+ /**
35
+ * Grow the tree to accommodate new data length.
36
+ * Only rebuilds newly added blocks.
37
+ */
38
+ grow(newLen: number): void;
39
+ /** Update data reference (for when the backing array changes, e.g. append with realloc) */
40
+ setData(data: ArrayLike<number | null>): void;
41
+ }
42
+ //# sourceMappingURL=BlockMinMax.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockMinMax.d.ts","sourceRoot":"","sources":["../../src/core/BlockMinMax.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,qBAAa,eAAe;IAC1B,+CAA+C;IAC/C,OAAO,CAAC,MAAM,CAAe;IAC7B,uBAAuB;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,iBAAiB;IACjB,OAAO,CAAC,SAAS,CAAS;IAC1B,mCAAmC;IACnC,OAAO,CAAC,IAAI,CAA2B;IACvC,wBAAwB;IACxB,OAAO,CAAC,GAAG,CAAS;gBAER,IAAI,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,SAAS,SAAqB;IAS1E,mCAAmC;IACnC,OAAO,CAAC,QAAQ;IAsBhB;;;OAGG;IACH,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAqDrD;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAsBnC;;;OAGG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAkB1B,2FAA2F;IAC3F,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI;CAG9C"}
@@ -0,0 +1,43 @@
1
+ import type { CursorState, ScaleState, BBox } from '../types';
2
+ import type { ChartData } from '../types/data';
3
+ import type { SeriesConfig } from '../types/series';
4
+ /** Minimal store interface to avoid circular dependency with ChartStore. */
5
+ export interface SyncTarget {
6
+ dataStore: {
7
+ data: ChartData;
8
+ getWindow(gi: number): [number, number];
9
+ };
10
+ scaleManager: {
11
+ getGroupXScaleKey(gi: number): string | undefined;
12
+ getScale(id: string): ScaleState | undefined;
13
+ };
14
+ seriesConfigs: SeriesConfig[];
15
+ plotBox: BBox;
16
+ }
17
+ /**
18
+ * Manages cursor position and nearest-point snapping.
19
+ * Computes the closest data point across all visible series/groups
20
+ * using pixel-space Euclidean distance.
21
+ */
22
+ export declare class CursorManager {
23
+ state: CursorState;
24
+ /** Hide the cursor (move off-screen) */
25
+ hide(): void;
26
+ /**
27
+ * Update cursor position and snap to nearest data point.
28
+ *
29
+ * @param cssX - cursor X in CSS pixels relative to plot area left
30
+ * @param cssY - cursor Y in CSS pixels relative to plot area top
31
+ * @param plotBox - current plot bounding box
32
+ * @param data - chart data groups
33
+ * @param seriesConfigs - all series configs
34
+ * @param getScale - scale lookup
35
+ */
36
+ update(cssX: number, cssY: number, plotBox: BBox, data: ChartData, seriesConfigs: SeriesConfig[], getScale: (id: string) => ScaleState | undefined, getWindow: (groupIdx: number) => [number, number], getGroupXScaleKey: (groupIdx: number) => string | undefined): void;
37
+ /**
38
+ * Sync cursor to a specific x-value (from another chart in a sync group).
39
+ * Finds the closest data index and positions the cursor there.
40
+ */
41
+ syncToValue(xVal: number, store: SyncTarget): void;
42
+ }
43
+ //# sourceMappingURL=CursorManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CursorManager.d.ts","sourceRoot":"","sources":["../../src/core/CursorManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD,4EAA4E;AAC5E,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;IACxE,YAAY,EAAE;QAAE,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAA;KAAE,CAAC;IAClH,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,OAAO,EAAE,IAAI,CAAC;CACf;AAED;;;;GAIG;AACH,qBAAa,aAAa;IACxB,KAAK,EAAE,WAAW,CAMhB;IAEF,wCAAwC;IACxC,IAAI,IAAI,IAAI;IAQZ;;;;;;;;;OASG;IACH,MAAM,CACJ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,IAAI,EACb,IAAI,EAAE,SAAS,EACf,aAAa,EAAE,YAAY,EAAE,EAC7B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,UAAU,GAAG,SAAS,EAChD,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,EACjD,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GAC1D,IAAI;IAyGP;;;OAGG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI;CA6CnD"}
@@ -0,0 +1,51 @@
1
+ import type { ChartData } from '../types';
2
+ import type { ScaleState } from '../types';
3
+ import { SortOrder } from '../types';
4
+ import { BlockMinMaxTree } from './BlockMinMax';
5
+ /**
6
+ * Manages chart data and per-xGroup visible windows.
7
+ * The window for each group is the index range [i0, i1] of x-values
8
+ * that fall within the group's x-scale range.
9
+ */
10
+ export declare class DataStore {
11
+ data: ChartData;
12
+ /** Per-group visible window: groupIdx -> [i0, i1] */
13
+ windows: Map<number, [number, number]>;
14
+ /** Per-group min/max cache: groupIdx -> ("index:i0:i1" -> [min, max]) */
15
+ private minMaxCache;
16
+ /** Block min-max trees for fast range queries: "group:seriesIndex" -> tree */
17
+ private blockTrees;
18
+ setData(data: ChartData): void;
19
+ /** Get or lazily build a block min-max tree for a series */
20
+ private getOrBuildTree;
21
+ /**
22
+ * Update the visible window for each xGroup based on its x-scale range.
23
+ * @param getXScale - function to look up the x-scale for a group index
24
+ */
25
+ /** Update windows and return true if any window actually changed */
26
+ updateWindows(getXScale: (groupIdx: number) => ScaleState | undefined): boolean;
27
+ /** Get the visible window for a group */
28
+ getWindow(groupIdx: number): [number, number];
29
+ /** Get x values for a group */
30
+ getXValues(groupIdx: number): ArrayLike<number>;
31
+ /** Get y values for a specific series */
32
+ getYValues(groupIdx: number, seriesIdx: number): ArrayLike<number | null>;
33
+ /** Get cached min/max for a series within a window range */
34
+ getCachedMinMax(group: number, index: number, i0: number, i1: number, sorted: SortOrder, isLog: boolean): [number, number];
35
+ /** Get block tree for a series (exposed for incremental append) */
36
+ getBlockTree(group: number, index: number): BlockMinMaxTree | undefined;
37
+ /**
38
+ * Append new data points to an existing group.
39
+ * Much cheaper than setData() for streaming scenarios — O(newPoints) instead of O(totalPoints).
40
+ *
41
+ * Only works with regular arrays (not Float64Array) since arrays need to grow.
42
+ * Block trees are incrementally updated, and only the affected group's cache is invalidated.
43
+ */
44
+ appendData(groupIdx: number, newX: number[], newSeries: (number | null)[][]): void;
45
+ /**
46
+ * Convert x-arrays in chart data to Float64Array for optimal memory layout.
47
+ * Call before setData() when not using appendData() (Float64Array is fixed-length).
48
+ */
49
+ static toTypedX(data: ChartData): ChartData;
50
+ }
51
+ //# sourceMappingURL=DataStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataStore.d.ts","sourceRoot":"","sources":["../../src/core/DataStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;GAIG;AACH,qBAAa,SAAS;IACpB,IAAI,EAAE,SAAS,CAAM;IAErB,qDAAqD;IACrD,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAa;IAEnD,yEAAyE;IACzE,OAAO,CAAC,WAAW,CAAyD;IAE5E,8EAA8E;IAC9E,OAAO,CAAC,UAAU,CAA2C;IAE7D,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAQ9B,4DAA4D;IAC5D,OAAO,CAAC,cAAc;IAetB;;;OAGG;IACH,oEAAoE;IACpE,aAAa,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,UAAU,GAAG,SAAS,GAAG,OAAO;IA2C/E,yCAAyC;IACzC,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAI7C,+BAA+B;IAC/B,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;IAI/C,yCAAyC;IACzC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC;IAIzE,4DAA4D;IAC5D,eAAe,CACb,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,OAAO,GACb,CAAC,MAAM,EAAE,MAAM,CAAC;IAgCnB,mEAAmE;IACnE,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAIvE;;;;;;OAMG;IACH,UAAU,CACR,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EAAE,EACd,SAAS,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,EAAE,GAC7B,IAAI;IAqCP;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS;CAQ5C"}