uplot-plus 0.1.0 → 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 (154) hide show
  1. package/README.md +13 -62
  2. package/package.json +1 -1
  3. package/dist/annotations.d.ts +0 -22
  4. package/dist/annotations.d.ts.map +0 -1
  5. package/dist/axes/layout.d.ts +0 -30
  6. package/dist/axes/layout.d.ts.map +0 -1
  7. package/dist/axes/ticks.d.ts +0 -47
  8. package/dist/axes/ticks.d.ts.map +0 -1
  9. package/dist/colors.d.ts +0 -32
  10. package/dist/colors.d.ts.map +0 -1
  11. package/dist/components/Axis.d.ts +0 -14
  12. package/dist/components/Axis.d.ts.map +0 -1
  13. package/dist/components/Band.d.ts +0 -10
  14. package/dist/components/Band.d.ts.map +0 -1
  15. package/dist/components/Chart.d.ts +0 -8
  16. package/dist/components/Chart.d.ts.map +0 -1
  17. package/dist/components/Legend.d.ts +0 -12
  18. package/dist/components/Legend.d.ts.map +0 -1
  19. package/dist/components/ResponsiveChart.d.ts +0 -18
  20. package/dist/components/ResponsiveChart.d.ts.map +0 -1
  21. package/dist/components/Scale.d.ts +0 -11
  22. package/dist/components/Scale.d.ts.map +0 -1
  23. package/dist/components/Series.d.ts +0 -11
  24. package/dist/components/Series.d.ts.map +0 -1
  25. package/dist/components/Sparkline.d.ts +0 -28
  26. package/dist/components/Sparkline.d.ts.map +0 -1
  27. package/dist/components/Timeline.d.ts +0 -8
  28. package/dist/components/Timeline.d.ts.map +0 -1
  29. package/dist/components/Tooltip.d.ts +0 -9
  30. package/dist/components/Tooltip.d.ts.map +0 -1
  31. package/dist/components/ZoomRanger.d.ts +0 -26
  32. package/dist/components/ZoomRanger.d.ts.map +0 -1
  33. package/dist/components/annotations/AnnotationLabel.d.ts +0 -26
  34. package/dist/components/annotations/AnnotationLabel.d.ts.map +0 -1
  35. package/dist/components/annotations/HLine.d.ts +0 -22
  36. package/dist/components/annotations/HLine.d.ts.map +0 -1
  37. package/dist/components/annotations/Region.d.ts +0 -22
  38. package/dist/components/annotations/Region.d.ts.map +0 -1
  39. package/dist/components/annotations/VLine.d.ts +0 -22
  40. package/dist/components/annotations/VLine.d.ts.map +0 -1
  41. package/dist/components/annotations/index.d.ts +0 -9
  42. package/dist/components/annotations/index.d.ts.map +0 -1
  43. package/dist/core/BlockMinMax.d.ts +0 -42
  44. package/dist/core/BlockMinMax.d.ts.map +0 -1
  45. package/dist/core/CursorManager.d.ts +0 -43
  46. package/dist/core/CursorManager.d.ts.map +0 -1
  47. package/dist/core/DataStore.d.ts +0 -51
  48. package/dist/core/DataStore.d.ts.map +0 -1
  49. package/dist/core/RenderScheduler.d.ts +0 -28
  50. package/dist/core/RenderScheduler.d.ts.map +0 -1
  51. package/dist/core/Scale.d.ts +0 -23
  52. package/dist/core/Scale.d.ts.map +0 -1
  53. package/dist/core/ScaleManager.d.ts +0 -45
  54. package/dist/core/ScaleManager.d.ts.map +0 -1
  55. package/dist/formatters.d.ts +0 -39
  56. package/dist/formatters.d.ts.map +0 -1
  57. package/dist/hooks/useChart.d.ts +0 -5
  58. package/dist/hooks/useChart.d.ts.map +0 -1
  59. package/dist/hooks/useChartStore.d.ts +0 -69
  60. package/dist/hooks/useChartStore.d.ts.map +0 -1
  61. package/dist/hooks/useDrawHook.d.ts +0 -14
  62. package/dist/hooks/useDrawHook.d.ts.map +0 -1
  63. package/dist/hooks/useInteraction.d.ts +0 -14
  64. package/dist/hooks/useInteraction.d.ts.map +0 -1
  65. package/dist/hooks/useStreamingData.d.ts +0 -35
  66. package/dist/hooks/useStreamingData.d.ts.map +0 -1
  67. package/dist/index.cjs +0 -1
  68. package/dist/index.d.ts +0 -47
  69. package/dist/index.d.ts.map +0 -1
  70. package/dist/index.js +0 -3203
  71. package/dist/math/align.d.ts +0 -10
  72. package/dist/math/align.d.ts.map +0 -1
  73. package/dist/math/increments.d.ts +0 -9
  74. package/dist/math/increments.d.ts.map +0 -1
  75. package/dist/math/stack.d.ts +0 -16
  76. package/dist/math/stack.d.ts.map +0 -1
  77. package/dist/math/utils.d.ts +0 -74
  78. package/dist/math/utils.d.ts.map +0 -1
  79. package/dist/paths/bars.d.ts +0 -9
  80. package/dist/paths/bars.d.ts.map +0 -1
  81. package/dist/paths/candlestick.d.ts +0 -35
  82. package/dist/paths/candlestick.d.ts.map +0 -1
  83. package/dist/paths/catmullRom.d.ts +0 -9
  84. package/dist/paths/catmullRom.d.ts.map +0 -1
  85. package/dist/paths/linear.d.ts +0 -10
  86. package/dist/paths/linear.d.ts.map +0 -1
  87. package/dist/paths/monotoneCubic.d.ts +0 -10
  88. package/dist/paths/monotoneCubic.d.ts.map +0 -1
  89. package/dist/paths/points.d.ts +0 -10
  90. package/dist/paths/points.d.ts.map +0 -1
  91. package/dist/paths/spline.d.ts +0 -9
  92. package/dist/paths/spline.d.ts.map +0 -1
  93. package/dist/paths/stepped.d.ts +0 -9
  94. package/dist/paths/stepped.d.ts.map +0 -1
  95. package/dist/paths/types.d.ts +0 -32
  96. package/dist/paths/types.d.ts.map +0 -1
  97. package/dist/paths/utils.d.ts +0 -19
  98. package/dist/paths/utils.d.ts.map +0 -1
  99. package/dist/rendering/CanvasRenderer.d.ts +0 -75
  100. package/dist/rendering/CanvasRenderer.d.ts.map +0 -1
  101. package/dist/rendering/drawAxes.d.ts +0 -8
  102. package/dist/rendering/drawAxes.d.ts.map +0 -1
  103. package/dist/rendering/drawBands.d.ts +0 -8
  104. package/dist/rendering/drawBands.d.ts.map +0 -1
  105. package/dist/rendering/drawCursor.d.ts +0 -22
  106. package/dist/rendering/drawCursor.d.ts.map +0 -1
  107. package/dist/rendering/drawPoints.d.ts +0 -13
  108. package/dist/rendering/drawPoints.d.ts.map +0 -1
  109. package/dist/rendering/drawSelect.d.ts +0 -14
  110. package/dist/rendering/drawSelect.d.ts.map +0 -1
  111. package/dist/rendering/drawSeries.d.ts +0 -7
  112. package/dist/rendering/drawSeries.d.ts.map +0 -1
  113. package/dist/sync/SyncGroup.d.ts +0 -33
  114. package/dist/sync/SyncGroup.d.ts.map +0 -1
  115. package/dist/sync/useSyncGroup.d.ts +0 -8
  116. package/dist/sync/useSyncGroup.d.ts.map +0 -1
  117. package/dist/time/fmtDate.d.ts +0 -15
  118. package/dist/time/fmtDate.d.ts.map +0 -1
  119. package/dist/time/timeIncrs.d.ts +0 -17
  120. package/dist/time/timeIncrs.d.ts.map +0 -1
  121. package/dist/time/timeSplits.d.ts +0 -6
  122. package/dist/time/timeSplits.d.ts.map +0 -1
  123. package/dist/time/timeVals.d.ts +0 -16
  124. package/dist/time/timeVals.d.ts.map +0 -1
  125. package/dist/types/axes.d.ts +0 -84
  126. package/dist/types/axes.d.ts.map +0 -1
  127. package/dist/types/bands.d.ts +0 -12
  128. package/dist/types/bands.d.ts.map +0 -1
  129. package/dist/types/chart.d.ts +0 -53
  130. package/dist/types/chart.d.ts.map +0 -1
  131. package/dist/types/common.d.ts +0 -62
  132. package/dist/types/common.d.ts.map +0 -1
  133. package/dist/types/cursor.d.ts +0 -22
  134. package/dist/types/cursor.d.ts.map +0 -1
  135. package/dist/types/data.d.ts +0 -32
  136. package/dist/types/data.d.ts.map +0 -1
  137. package/dist/types/events.d.ts +0 -57
  138. package/dist/types/events.d.ts.map +0 -1
  139. package/dist/types/hooks.d.ts +0 -28
  140. package/dist/types/hooks.d.ts.map +0 -1
  141. package/dist/types/index.d.ts +0 -10
  142. package/dist/types/index.d.ts.map +0 -1
  143. package/dist/types/legend.d.ts +0 -8
  144. package/dist/types/legend.d.ts.map +0 -1
  145. package/dist/types/scales.d.ts +0 -60
  146. package/dist/types/scales.d.ts.map +0 -1
  147. package/dist/types/series.d.ts +0 -76
  148. package/dist/types/series.d.ts.map +0 -1
  149. package/dist/types/timeline.d.ts +0 -30
  150. package/dist/types/timeline.d.ts.map +0 -1
  151. package/dist/types/tooltip.d.ts +0 -33
  152. package/dist/types/tooltip.d.ts.map +0 -1
  153. package/dist/utils/shallowEqual.d.ts +0 -10
  154. package/dist/utils/shallowEqual.d.ts.map +0 -1
@@ -1,42 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,43 +0,0 @@
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
@@ -1 +0,0 @@
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;IA8FP;;;OAGG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI;CA6CnD"}
@@ -1,51 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,28 +0,0 @@
1
- import { DirtyFlag } from '../types/common';
2
- /**
3
- * Render scheduler with dirty-flag tracking.
4
- * Accumulates dirty flags between frames and coalesces redraws
5
- * via requestAnimationFrame to avoid redundant work.
6
- */
7
- export declare class RenderScheduler {
8
- private flags;
9
- private frameId;
10
- private callback;
11
- /** Mark one or more dirty flags */
12
- mark(flag: DirtyFlag): void;
13
- /** Check if a specific flag is set */
14
- has(flag: DirtyFlag): boolean;
15
- /** Get current flags value */
16
- get dirty(): number;
17
- /** Clear all flags (called after a redraw) */
18
- clear(): void;
19
- /** Set the redraw callback */
20
- onRedraw(cb: () => void): void;
21
- /** Schedule a frame if not already pending */
22
- private scheduleFrame;
23
- /** Cancel any pending frame */
24
- cancel(): void;
25
- /** Clean up */
26
- dispose(): void;
27
- }
28
- //# sourceMappingURL=RenderScheduler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RenderScheduler.d.ts","sourceRoot":"","sources":["../../src/core/RenderScheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,QAAQ,CAA6B;IAE7C,mCAAmC;IACnC,IAAI,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAK3B,sCAAsC;IACtC,GAAG,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO;IAI7B,8BAA8B;IAC9B,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,8CAA8C;IAC9C,KAAK,IAAI,IAAI;IAIb,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI;IAI9B,8CAA8C;IAC9C,OAAO,CAAC,aAAa;IAarB,+BAA+B;IAC/B,MAAM,IAAI,IAAI;IAOd,eAAe;IACf,OAAO,IAAI,IAAI;CAKhB"}
@@ -1,23 +0,0 @@
1
- import type { ScaleConfig, ScaleState } from '../types';
2
- /** Create a ScaleState from config with defaults */
3
- export declare function createScaleState(cfg: ScaleConfig): ScaleState;
4
- /** Invalidate cached transformed min/max (call when min/max change) */
5
- export declare function invalidateScaleCache(scale: ScaleState): void;
6
- /**
7
- * Convert a data value to a 0-1 fraction within the scale range.
8
- * Uses cached transformed min/max for log/asinh distributions.
9
- */
10
- export declare function valToPct(val: number, scale: ScaleState): number;
11
- /**
12
- * Convert a 0-1 fraction to a data value within the scale range.
13
- */
14
- export declare function pctToVal(pct: number, scale: ScaleState): number;
15
- /**
16
- * Convert a data value to a CSS pixel position within a dimension.
17
- */
18
- export declare function valToPos(val: number, scale: ScaleState, dim: number, off: number): number;
19
- /**
20
- * Convert a CSS pixel position to a data value.
21
- */
22
- export declare function posToVal(pos: number, scale: ScaleState, dim: number, off: number): number;
23
- //# sourceMappingURL=Scale.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Scale.d.ts","sourceRoot":"","sources":["../../src/core/Scale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAIxD,oDAAoD;AACpD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,WAAW,GAAG,UAAU,CAgB7D;AAED,uEAAuE;AACvE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAG5D;AAkCD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAsB/D;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAmB/D;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAazF;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAazF"}
@@ -1,45 +0,0 @@
1
- import type { ScaleConfig, ScaleState } from '../types';
2
- import type { ChartData } from '../types';
3
- import type { DataStore } from './DataStore';
4
- /**
5
- * Manages all scales for a chart.
6
- * Handles auto-ranging from data, scale updates, and mapping between
7
- * xGroups and their x-scales.
8
- */
9
- export declare class ScaleManager {
10
- scales: Map<string, ScaleState>;
11
- /**
12
- * Map from xGroup index to its x-scale key.
13
- * Set when series configs register which scale each group uses.
14
- */
15
- groupXScales: Map<number, string>;
16
- addScale(cfg: ScaleConfig): void;
17
- removeScale(id: string): void;
18
- getScale(id: string): ScaleState | undefined;
19
- /** Get all scale states (for zoom reset, iteration) */
20
- getAllScales(): IterableIterator<ScaleState>;
21
- /** Assign a group index to an x-scale */
22
- setGroupXScale(groupIdx: number, scaleKey: string): void;
23
- /** Get the x-scale key for a group */
24
- getGroupXScaleKey(groupIdx: number): string | undefined;
25
- /**
26
- * Set a scale's range directly (e.g., for zoom).
27
- */
28
- setRange(scaleKey: string, min: number, max: number): void;
29
- /**
30
- * Auto-range only x-scales from data (cheap: just reads first/last x values).
31
- * Call before updateWindows() so the x-scale range is set for window clipping.
32
- */
33
- autoRangeX(data: ChartData): void;
34
- /**
35
- * Auto-range scales from data.
36
- * For each x-scale: range from its group's x values.
37
- * For each y-scale: range from all series that reference it, within the visible x-window.
38
- */
39
- autoRange(data: ChartData, seriesScaleMap: {
40
- group: number;
41
- index: number;
42
- yScale: string;
43
- }[], dataStore: DataStore): void;
44
- }
45
- //# sourceMappingURL=ScaleManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScaleManager.d.ts","sourceRoot":"","sources":["../../src/core/ScaleManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAI1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;GAIG;AACH,qBAAa,YAAY;IACvB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAa;IAE5C;;;OAGG;IACH,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAa;IAE9C,QAAQ,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAIhC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAI7B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAI5C,uDAAuD;IACvD,YAAY,IAAI,gBAAgB,CAAC,UAAU,CAAC;IAI5C,yCAAyC;IACzC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAIxD,sCAAsC;IACtC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIvD;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAS1D;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAiDjC;;;;OAIG;IACH,SAAS,CACP,IAAI,EAAE,SAAS,EACf,cAAc,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,EAClE,SAAS,EAAE,SAAS,GACnB,IAAI;CAuGR"}
@@ -1,39 +0,0 @@
1
- /** Axis value formatter compatible with AxisConfig.values */
2
- export type AxisValueFormatter = (splits: number[], space: number, incr: number) => string[];
3
- /**
4
- * Format numbers compactly with SI suffixes: 1200 → "1.2K", 2500000 → "2.5M".
5
- * Handles negative values and zero. Useful for log scales and large-range axes.
6
- */
7
- export declare function fmtCompact(opts?: {
8
- decimals?: number;
9
- }): AxisValueFormatter;
10
- /**
11
- * Append a suffix to each formatted value: fmtSuffix('%') → "42%", fmtSuffix('°C', 1) → "23.5°C".
12
- */
13
- export declare function fmtSuffix(suffix: string, decimals?: number): AxisValueFormatter;
14
- /**
15
- * Format unix timestamps (seconds) as HH:MM.
16
- */
17
- export declare function fmtHourMin(opts?: {
18
- utc?: boolean;
19
- }): AxisValueFormatter;
20
- /**
21
- * Format unix timestamps (seconds) as month names: "Jan", "Feb", etc.
22
- */
23
- export declare function fmtMonthName(opts?: {
24
- utc?: boolean;
25
- format?: 'short' | 'long';
26
- }): AxisValueFormatter;
27
- /**
28
- * Format unix timestamps (seconds) using arbitrary Intl.DateTimeFormat options.
29
- */
30
- export declare function fmtDateStr(opts?: Intl.DateTimeFormatOptions & {
31
- tz?: string;
32
- }): AxisValueFormatter;
33
- /**
34
- * Map numeric indices to labels from an array.
35
- * Useful for categorical/ordinal axes: fmtLabels(['Jan','Feb','Mar']).
36
- * @param offset - subtract this from the split value before indexing (default 0)
37
- */
38
- export declare function fmtLabels(labels: readonly string[], offset?: number): AxisValueFormatter;
39
- //# sourceMappingURL=formatters.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../src/formatters.ts"],"names":[],"mappings":"AAEA,6DAA6D;AAC7D,MAAM,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;AAE7F;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CAU3E;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,SAAI,GAAG,kBAAkB,CAG1E;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,kBAAkB,CASvE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CAAE,GAAG,kBAAkB,CAKpG;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CAIlG;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,SAAI,GAAG,kBAAkB,CAMnF"}
@@ -1,5 +0,0 @@
1
- import type { ChartStore } from './useChartStore';
2
- export declare const ChartContext: import("react").Context<ChartStore | null>;
3
- /** Access the chart store from within a Chart's children */
4
- export declare function useChart(): ChartStore;
5
- //# sourceMappingURL=useChart.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useChart.d.ts","sourceRoot":"","sources":["../../src/hooks/useChart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,eAAO,MAAM,YAAY,4CAAyC,CAAC;AAEnE,4DAA4D;AAC5D,wBAAgB,QAAQ,IAAI,UAAU,CAMrC"}
@@ -1,69 +0,0 @@
1
- import type { ScaleConfig, SeriesConfig, BBox } from '../types';
2
- import type { AxisConfig, AxisState } from '../types/axes';
3
- import type { SelectState } from '../types/cursor';
4
- import { ScaleManager } from '../core/ScaleManager';
5
- import { DataStore } from '../core/DataStore';
6
- import { CursorManager } from '../core/CursorManager';
7
- import { RenderScheduler } from '../core/RenderScheduler';
8
- import { CanvasRenderer } from '../rendering/CanvasRenderer';
9
- import type { BandConfig } from '../types/bands';
10
- import type { DrawCallback, CursorDrawCallback } from '../types/hooks';
11
- import type { EventCallbacks } from '../types/events';
12
- /**
13
- * Mutable chart store — holds all chart state outside of React state.
14
- * Canvas operations subscribe to this store and are triggered imperatively,
15
- * not through React re-renders.
16
- */
17
- export interface ChartStore {
18
- scaleManager: ScaleManager;
19
- dataStore: DataStore;
20
- renderer: CanvasRenderer;
21
- cursorManager: CursorManager;
22
- selectState: SelectState;
23
- scaleConfigs: ScaleConfig[];
24
- seriesConfigs: SeriesConfig[];
25
- axisConfigs: AxisConfig[];
26
- bandConfigs: BandConfig[];
27
- axisStates: AxisState[];
28
- width: number;
29
- height: number;
30
- pxRatio: number;
31
- plotBox: BBox;
32
- canvas: HTMLCanvasElement | null;
33
- listeners: Set<() => void>;
34
- scheduler: RenderScheduler;
35
- drawHooks: Set<DrawCallback>;
36
- cursorDrawHooks: Set<CursorDrawCallback>;
37
- focusedSeries: number | null;
38
- /** Alpha for non-focused series (0-1, default 0.15) */
39
- focusAlpha: number;
40
- /** Whether wheel zoom is enabled */
41
- wheelZoom: boolean;
42
- revision: number;
43
- eventCallbacks: EventCallbacks;
44
- _prevScaleRanges: Map<string, {
45
- min: number;
46
- max: number;
47
- }>;
48
- registerScale: (cfg: ScaleConfig) => void;
49
- unregisterScale: (id: string) => void;
50
- registerSeries: (cfg: SeriesConfig) => void;
51
- unregisterSeries: (group: number, index: number) => void;
52
- toggleSeries: (group: number, index: number) => void;
53
- setFocus: (seriesIdx: number | null) => void;
54
- setSize: (w: number, h: number) => void;
55
- scheduleRedraw: () => void;
56
- scheduleCursorRedraw: () => void;
57
- subscribe: (fn: () => void) => () => void;
58
- redraw: () => void;
59
- }
60
- /**
61
- * Creates a mutable ChartStore. Called once per Chart component instance.
62
- * This is NOT React state — it's a plain mutable object to avoid re-renders.
63
- */
64
- export declare function createChartStore(): ChartStore;
65
- /**
66
- * Hook that creates and returns a stable ChartStore reference.
67
- */
68
- export declare function useChartStore(): ChartStore;
69
- //# sourceMappingURL=useChartStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useChartStore.d.ts","sourceRoot":"","sources":["../../src/hooks/useChartStore.ts"],"names":[],"mappings":"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"}
@@ -1,14 +0,0 @@
1
- import type { DrawCallback, CursorDrawCallback } from '../types/hooks';
2
- /**
3
- * Register a draw callback that fires after all series are drawn
4
- * but before the snapshot (persistent layer).
5
- * Uses a ref wrapper so the callback can be an inline function.
6
- */
7
- export declare function useDrawHook(fn: DrawCallback): void;
8
- /**
9
- * Register a draw callback that fires on the cursor overlay
10
- * (redrawn every frame, including cursor-only fast path).
11
- * Uses a ref wrapper so the callback can be an inline function.
12
- */
13
- export declare function useCursorDrawHook(fn: CursorDrawCallback): void;
14
- //# sourceMappingURL=useDrawHook.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDrawHook.d.ts","sourceRoot":"","sources":["../../src/hooks/useDrawHook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGvE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAYlD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,kBAAkB,GAAG,IAAI,CAY9D"}
@@ -1,14 +0,0 @@
1
- import type { ChartStore } from './useChartStore';
2
- /**
3
- * Hook that attaches mouse/touch listeners to the chart container
4
- * for cursor tracking, drag-to-zoom selection, wheel zoom, focus mode,
5
- * pinch zoom, and y-axis drag.
6
- */
7
- export declare function useInteraction(store: ChartStore, containerEl: HTMLDivElement | null): void;
8
- /**
9
- * Attach mouse/touch listeners to a container element for chart interactions.
10
- * Returns a cleanup function that removes all listeners.
11
- * Extracted from useInteraction for testability.
12
- */
13
- export declare function setupInteraction(store: ChartStore, el: HTMLElement): () => void;
14
- //# sourceMappingURL=useInteraction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useInteraction.d.ts","sourceRoot":"","sources":["../../src/hooks/useInteraction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAWlD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,cAAc,GAAG,IAAI,GACjC,IAAI,CAKN;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,WAAW,GAAG,MAAM,IAAI,CAsjB/E"}
@@ -1,35 +0,0 @@
1
- import type { ChartData } from '../types';
2
- export interface StreamingOptions {
3
- /** Maximum number of data points to retain (sliding window size) */
4
- window: number;
5
- /** Number of points to push per tick (default: 1) */
6
- batchSize?: number;
7
- /** Start streaming immediately on mount (default: true) */
8
- autoStart?: boolean;
9
- }
10
- export interface StreamingResult {
11
- /** Current chart data (pass to <Chart data={...}>) */
12
- data: ChartData;
13
- /**
14
- * Push new data points. Oldest points beyond the window are dropped.
15
- * @param x - new x values
16
- * @param ySeries - one array of new y values per series
17
- */
18
- push: (x: number[], ...ySeries: number[][]) => void;
19
- /** Start the rAF loop (calls the onTick callback each frame) */
20
- start: () => void;
21
- /** Stop the rAF loop */
22
- stop: () => void;
23
- /** Whether the rAF loop is running */
24
- running: boolean;
25
- /** Frames per second (smoothed) */
26
- fps: number;
27
- }
28
- /**
29
- * Hook for streaming/real-time chart data with a sliding window.
30
- *
31
- * Manages a requestAnimationFrame loop and FPS counter.
32
- * Call `push()` from your own tick callback, or use it standalone.
33
- */
34
- export declare function useStreamingData(initialData: ChartData, options: StreamingOptions): StreamingResult;
35
- //# sourceMappingURL=useStreamingData.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useStreamingData.d.ts","sourceRoot":"","sources":["../../src/hooks/useStreamingData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,WAAW,gBAAgB;IAC/B,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,IAAI,EAAE,SAAS,CAAC;IAChB;;;;OAIG;IACH,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,IAAI,CAAC;IACpD,gEAAgE;IAChE,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,wBAAwB;IACxB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,sCAAsC;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,SAAS,EACtB,OAAO,EAAE,gBAAgB,GACxB,eAAe,CAqFjB"}