velo-plot 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/README.md +15 -8
  2. package/dist/{ChartCore-BhQ4j7f5.js → ChartCore-BpzRvN4Y.js} +998 -855
  3. package/dist/ChartCore-BpzRvN4Y.js.map +1 -0
  4. package/dist/a11y-Bw6urYpr.js +105 -0
  5. package/dist/a11y-Bw6urYpr.js.map +1 -0
  6. package/dist/angular/hooks-entry.d.ts +1 -0
  7. package/dist/angular/hooks.d.ts +26 -0
  8. package/dist/angular/index.d.ts +8 -0
  9. package/dist/angular/velo-plot.component.d.ts +46 -0
  10. package/dist/angular-hooks.d.ts +1 -0
  11. package/dist/angular-hooks.js +9 -0
  12. package/dist/angular-hooks.js.map +1 -0
  13. package/dist/angular.d.ts +1 -0
  14. package/dist/angular.js +166 -0
  15. package/dist/angular.js.map +1 -0
  16. package/dist/assets/indicator.worker-bv0zC4EX.js.map +1 -1
  17. package/dist/astro/StackedPlot.astro +19 -0
  18. package/dist/astro/VeloPlot.astro +23 -0
  19. package/dist/{axisFormat-SPX-CD5s.js → axisFormat-CzumxpCL.js} +3 -3
  20. package/dist/axisFormat-CzumxpCL.js.map +1 -0
  21. package/dist/bindings/shared/a11y.d.ts +26 -0
  22. package/dist/bindings/shared/chartLifecycle.d.ts +16 -0
  23. package/dist/bindings/shared/chartSyncBridge.d.ts +8 -0
  24. package/dist/bindings/shared/dimensions.d.ts +1 -0
  25. package/dist/bindings/shared/index.d.ts +9 -0
  26. package/dist/bindings/shared/indicatorBridge.d.ts +11 -0
  27. package/dist/bindings/shared/optionsSync.d.ts +7 -0
  28. package/dist/bindings/shared/seriesDiff.d.ts +8 -0
  29. package/dist/bindings/shared/stackedSync.d.ts +9 -0
  30. package/dist/bindings/shared/types.d.ts +46 -0
  31. package/dist/bindings/test-utils/index.d.ts +35 -0
  32. package/dist/bindings/test-utils/mockLifecycle.d.ts +120 -0
  33. package/dist/bindings/test-utils/vitestSveltePlugin.d.ts +3 -0
  34. package/dist/chartSyncBridge-DbWrwtyP.js +57 -0
  35. package/dist/chartSyncBridge-DbWrwtyP.js.map +1 -0
  36. package/dist/core/Chart.d.ts +1 -1
  37. package/dist/core/InteractionManager.d.ts +7 -1
  38. package/dist/core/OverlayRenderer.d.ts +5 -0
  39. package/dist/core/annotations/types.d.ts +1 -1
  40. package/dist/core/chart/ChartAxisManager.d.ts +2 -0
  41. package/dist/core/chart/ChartCore.d.ts +17 -2
  42. package/dist/core/chart/ChartPluginBridge.d.ts +1 -0
  43. package/dist/core/chart/ChartRenderLoop.d.ts +2 -0
  44. package/dist/core/chart/ChartStateManager.d.ts +2 -0
  45. package/dist/core/chart/types.d.ts +6 -1
  46. package/dist/core/clipboard/index.d.ts +1 -1
  47. package/dist/core/debug/index.d.ts +1 -1
  48. package/dist/core/keybindings/index.d.ts +1 -1
  49. package/dist/core/loading/index.d.ts +1 -1
  50. package/dist/core/locale/index.d.ts +1 -1
  51. package/dist/core/stacked/paneResize.d.ts +3 -0
  52. package/dist/core/stacked/types.d.ts +10 -0
  53. package/dist/core/sync/index.d.ts +0 -1
  54. package/dist/core/theme-editor/index.d.ts +1 -1
  55. package/dist/createStackedChart-Dm-YqUT7.js +756 -0
  56. package/dist/createStackedChart-Dm-YqUT7.js.map +1 -0
  57. package/dist/examples/PluginDemonstration.d.ts +1 -1
  58. package/dist/gpuRenderer-BpaMYz-k.js.map +1 -1
  59. package/dist/hooks-CYPCxoZx.js +69 -0
  60. package/dist/hooks-CYPCxoZx.js.map +1 -0
  61. package/dist/{index-D7dTq6VB.js → index-0InEyj0q.js} +130 -134
  62. package/dist/index-0InEyj0q.js.map +1 -0
  63. package/dist/index-BMiZoKmm.js.map +1 -1
  64. package/dist/{index-DoYxf1cV.js → index-CWxIHdwX.js} +38 -98
  65. package/dist/index-CWxIHdwX.js.map +1 -0
  66. package/dist/{index-CUGS98p4.js → index-CaXWSOTk.js} +3 -6
  67. package/dist/index-CaXWSOTk.js.map +1 -0
  68. package/dist/index-Dag88bW4.js.map +1 -1
  69. package/dist/index-qhscKTDy.js.map +1 -1
  70. package/dist/{index-CWipqOLP.js → index-qunX30Xu.js} +2 -2
  71. package/dist/index-qunX30Xu.js.map +1 -0
  72. package/dist/index-x4stH3jD.js.map +1 -1
  73. package/dist/{index.core-fpZ1dYN0.js → index.core-BmZe2jRQ.js} +30 -29
  74. package/dist/index.core-BmZe2jRQ.js.map +1 -0
  75. package/dist/index.core.d.ts +1 -1
  76. package/dist/index.d.ts +3 -3
  77. package/dist/indicators--eJGmVox.js.map +1 -1
  78. package/dist/{mockDatafeed-Cdg5hKEo.js → mockDatafeed-DHIDPcpX.js} +150 -146
  79. package/dist/mockDatafeed-DHIDPcpX.js.map +1 -0
  80. package/dist/optionsSync-QUiN4Inw.js +119 -0
  81. package/dist/optionsSync-QUiN4Inw.js.map +1 -0
  82. package/dist/plugins/3d/index.d.ts +2 -2
  83. package/dist/plugins/3d.d.ts +2 -2
  84. package/dist/plugins/3d.js.map +1 -1
  85. package/dist/plugins/analysis/contours.d.ts +31 -0
  86. package/dist/plugins/analysis/index.d.ts +1 -1
  87. package/dist/plugins/analysis/indicators.d.ts +1 -1
  88. package/dist/plugins/analysis.d.ts +2 -2
  89. package/dist/plugins/analysis.js +495 -408
  90. package/dist/plugins/analysis.js.map +1 -1
  91. package/dist/plugins/annotations/index.d.ts +1 -1
  92. package/dist/plugins/annotations.d.ts +2 -2
  93. package/dist/plugins/annotations.js.map +1 -1
  94. package/dist/plugins/anomaly-detection.js +1 -1
  95. package/dist/plugins/anomaly-detection.js.map +1 -1
  96. package/dist/plugins/broken-axis.d.ts +2 -2
  97. package/dist/plugins/broken-axis.js +170 -181
  98. package/dist/plugins/broken-axis.js.map +1 -1
  99. package/dist/plugins/builtins/crosshair/CrosshairPlugin.d.ts +1 -1
  100. package/dist/plugins/builtins/index.d.ts +1 -1
  101. package/dist/plugins/caching.d.ts +2 -2
  102. package/dist/plugins/clipboard/index.d.ts +2 -2
  103. package/dist/plugins/clipboard.d.ts +2 -2
  104. package/dist/plugins/clipboard.js.map +1 -1
  105. package/dist/plugins/context-menu/index.d.ts +1 -1
  106. package/dist/plugins/context-menu.d.ts +2 -2
  107. package/dist/plugins/context-menu.js +1 -1
  108. package/dist/plugins/context-menu.js.map +1 -1
  109. package/dist/plugins/data-export/index.d.ts +1 -1
  110. package/dist/plugins/data-export.d.ts +2 -2
  111. package/dist/plugins/data-export.js +2 -2
  112. package/dist/plugins/data-export.js.map +1 -1
  113. package/dist/plugins/data-transform.d.ts +2 -2
  114. package/dist/plugins/data-transform.js +19 -19
  115. package/dist/plugins/data-transform.js.map +1 -1
  116. package/dist/plugins/debug/index.d.ts +2 -2
  117. package/dist/plugins/debug.d.ts +2 -2
  118. package/dist/plugins/debug.js +2 -2
  119. package/dist/plugins/debug.js.map +1 -1
  120. package/dist/plugins/forecasting/algorithms.d.ts +7 -2
  121. package/dist/plugins/forecasting/index.d.ts +1 -1
  122. package/dist/plugins/forecasting/types.d.ts +13 -3
  123. package/dist/plugins/forecasting.js +355 -175
  124. package/dist/plugins/forecasting.js.map +1 -1
  125. package/dist/plugins/gpu/index.d.ts +2 -2
  126. package/dist/plugins/gpu.d.ts +2 -2
  127. package/dist/plugins/gpu.js.map +1 -1
  128. package/dist/plugins/i18n/index.d.ts +2 -2
  129. package/dist/plugins/i18n.d.ts +2 -2
  130. package/dist/plugins/i18n.js.map +1 -1
  131. package/dist/plugins/index.d.ts +1 -1
  132. package/dist/plugins/keyboard.d.ts +2 -2
  133. package/dist/plugins/keyboard.js +65 -5
  134. package/dist/plugins/keyboard.js.map +1 -1
  135. package/dist/plugins/latex/symbols.d.ts +50 -0
  136. package/dist/plugins/latex/types.d.ts +13 -1
  137. package/dist/plugins/latex.js +351 -331
  138. package/dist/plugins/latex.js.map +1 -1
  139. package/dist/plugins/lazy-load.d.ts +2 -2
  140. package/dist/plugins/loading/index.d.ts +1 -1
  141. package/dist/plugins/loading.d.ts +2 -2
  142. package/dist/plugins/ml-integration/native-algorithms.d.ts +24 -4
  143. package/dist/plugins/ml-integration/types.d.ts +19 -0
  144. package/dist/plugins/ml-integration.d.ts +2 -2
  145. package/dist/plugins/ml-integration.js +190 -139
  146. package/dist/plugins/ml-integration.js.map +1 -1
  147. package/dist/plugins/offscreen.d.ts +2 -2
  148. package/dist/plugins/pattern-recognition/types.d.ts +28 -1
  149. package/dist/plugins/pattern-recognition.d.ts +2 -2
  150. package/dist/plugins/pattern-recognition.js +417 -344
  151. package/dist/plugins/pattern-recognition.js.map +1 -1
  152. package/dist/plugins/radar.d.ts +2 -2
  153. package/dist/plugins/regression.d.ts +2 -2
  154. package/dist/plugins/regression.js +1 -1
  155. package/dist/plugins/regression.js.map +1 -1
  156. package/dist/plugins/roi.js +9 -9
  157. package/dist/plugins/roi.js.map +1 -1
  158. package/dist/plugins/snapshot/index.d.ts +1 -1
  159. package/dist/plugins/snapshot/types.d.ts +1 -1
  160. package/dist/plugins/snapshot.d.ts +2 -2
  161. package/dist/plugins/snapshot.js +36 -36
  162. package/dist/plugins/snapshot.js.map +1 -1
  163. package/dist/plugins/streaming/index.d.ts +2 -2
  164. package/dist/plugins/streaming.d.ts +2 -2
  165. package/dist/plugins/sync/index.d.ts +3 -2
  166. package/dist/plugins/sync.d.ts +2 -2
  167. package/dist/plugins/sync.js +1 -1
  168. package/dist/plugins/sync.js.map +1 -1
  169. package/dist/plugins/theme-editor/index.d.ts +1 -1
  170. package/dist/plugins/theme-editor.d.ts +2 -2
  171. package/dist/plugins/tools/index.d.ts +1 -1
  172. package/dist/plugins/tools/tooltip/index.d.ts +1 -1
  173. package/dist/plugins/tools.d.ts +2 -2
  174. package/dist/plugins/tools.js +1 -1
  175. package/dist/plugins/types.d.ts +1 -1
  176. package/dist/plugins/video-recorder.d.ts +2 -2
  177. package/dist/plugins/virtualization.d.ts +2 -2
  178. package/dist/plugins/virtualization.js +1 -1
  179. package/dist/pool-DZ8shSqv.js +109 -0
  180. package/dist/pool-DZ8shSqv.js.map +1 -0
  181. package/dist/react/StackedPlot.d.ts +31 -0
  182. package/dist/react/VeloPlot.d.ts +29 -0
  183. package/dist/react/index.d.ts +25 -3
  184. package/dist/react/useChartSync.d.ts +8 -0
  185. package/dist/react/useIndicator.d.ts +12 -0
  186. package/dist/react/useVeloPlot.d.ts +19 -0
  187. package/dist/react.js +328 -24
  188. package/dist/react.js.map +1 -1
  189. package/dist/scientific/index.d.ts +48 -0
  190. package/dist/scientific.d.ts +1 -0
  191. package/dist/scientific.js +91 -0
  192. package/dist/scientific.js.map +1 -0
  193. package/dist/solid/VeloPlot.d.ts +16 -0
  194. package/dist/solid/index.d.ts +13 -0
  195. package/dist/solid/useChartSync.d.ts +6 -0
  196. package/dist/solid/useIndicator.d.ts +11 -0
  197. package/dist/solid/useStackedPlot.d.ts +14 -0
  198. package/dist/solid/useVeloPlot.d.ts +18 -0
  199. package/dist/solid.d.ts +1 -0
  200. package/dist/solid.js +172 -0
  201. package/dist/solid.js.map +1 -0
  202. package/dist/stackedSync-tnrunZMt.js +100 -0
  203. package/dist/stackedSync-tnrunZMt.js.map +1 -0
  204. package/dist/svelte/StackedPlot.svelte +29 -0
  205. package/dist/svelte/StackedPlot.test.ts +114 -0
  206. package/dist/svelte/VeloPlot.svelte +44 -0
  207. package/dist/svelte/VeloPlot.test.ts +105 -0
  208. package/dist/svelte/index.d.ts +11 -0
  209. package/dist/svelte/index.test.ts +20 -0
  210. package/dist/svelte/index.ts +15 -0
  211. package/dist/svelte/useChartSync.d.ts +8 -0
  212. package/dist/svelte/useChartSync.test.ts +49 -0
  213. package/dist/svelte/useChartSync.ts +29 -0
  214. package/dist/svelte/useIndicator.d.ts +13 -0
  215. package/dist/svelte/useIndicator.test.ts +67 -0
  216. package/dist/svelte/useIndicator.ts +43 -0
  217. package/dist/svelte/useStackedPlot.d.ts +16 -0
  218. package/dist/svelte/useStackedPlot.test.ts +76 -0
  219. package/dist/svelte/useStackedPlot.ts +54 -0
  220. package/dist/svelte/useVeloPlot.d.ts +21 -0
  221. package/dist/svelte/useVeloPlot.test.ts +100 -0
  222. package/dist/svelte/useVeloPlot.ts +81 -0
  223. package/dist/svelte.d.ts +1 -0
  224. package/dist/svelte.js +143 -0
  225. package/dist/svelte.js.map +1 -0
  226. package/dist/symbols-DT0eLlpW.js +568 -0
  227. package/dist/symbols-DT0eLlpW.js.map +1 -0
  228. package/dist/testing/index.d.ts +1 -1
  229. package/dist/theme/index.d.ts +2 -1
  230. package/dist/trading.js +7 -7
  231. package/dist/types.d.ts +1 -1
  232. package/dist/{utils-BK5UUXxj.js → utils-Dx0h0bgQ.js} +9 -9
  233. package/dist/{utils-BK5UUXxj.js.map → utils-Dx0h0bgQ.js.map} +1 -1
  234. package/dist/velo-plot.full.js +444 -433
  235. package/dist/velo-plot.full.js.map +1 -1
  236. package/dist/velo-plot.js +15 -15
  237. package/dist/vue/StackedPlot.vue.d.ts +48 -0
  238. package/dist/vue/VeloPlot.vue.d.ts +64 -0
  239. package/dist/vue/index.d.ts +250 -0
  240. package/dist/vue/useChartSync.d.ts +52 -0
  241. package/dist/vue/useIndicator.d.ts +23 -0
  242. package/dist/vue/useStackedPlot.d.ts +15 -0
  243. package/dist/vue/useVeloPlot.d.ts +20 -0
  244. package/dist/vue.d.ts +1 -0
  245. package/dist/vue.js +312 -0
  246. package/dist/vue.js.map +1 -0
  247. package/dist/workers/indicatorsAsync.d.ts +26 -0
  248. package/dist/workers/pool.d.ts +9 -0
  249. package/package.json +88 -10
  250. package/dist/ChartCore-BhQ4j7f5.js.map +0 -1
  251. package/dist/SciPlot-GJvw7GJo.js +0 -463
  252. package/dist/SciPlot-GJvw7GJo.js.map +0 -1
  253. package/dist/axisFormat-SPX-CD5s.js.map +0 -1
  254. package/dist/createStackedChart-DJSmqerD.js +0 -706
  255. package/dist/createStackedChart-DJSmqerD.js.map +0 -1
  256. package/dist/index-CUGS98p4.js.map +0 -1
  257. package/dist/index-CWipqOLP.js.map +0 -1
  258. package/dist/index-D7dTq6VB.js.map +0 -1
  259. package/dist/index-DoYxf1cV.js.map +0 -1
  260. package/dist/index.core-fpZ1dYN0.js.map +0 -1
  261. package/dist/mockDatafeed-Cdg5hKEo.js.map +0 -1
  262. package/dist/pool-15HMCNv8.js +0 -88
  263. package/dist/pool-15HMCNv8.js.map +0 -1
  264. package/dist/react/SciPlot.d.ts +0 -60
  265. package/dist/react/useSciPlot.d.ts +0 -56
package/dist/react.js CHANGED
@@ -1,31 +1,335 @@
1
- import { S as x, u as C } from "./SciPlot-GJvw7GJo.js";
2
- import { useRef as n, useState as a, useEffect as k, useCallback as f } from "react";
3
- import { c as m } from "./createStackedChart-DJSmqerD.js";
4
- function A(c) {
5
- const s = n(null), r = n(null), [i, l] = a(null), [d, u] = a(!1), o = n(c);
6
- o.current = c, k(() => {
7
- const t = s.current;
8
- if (!t) return;
9
- const e = m({
10
- ...o.current,
11
- container: t
1
+ import { jsx as O, jsxs as A } from "react/jsx-runtime";
2
+ import { useState as R, useRef as m, useEffect as b, useCallback as E, forwardRef as F, useImperativeHandle as K, useMemo as T } from "react";
3
+ import { c as j, a as G, i as H, r as J, b as X } from "./chartSyncBridge-DbWrwtyP.js";
4
+ import { p as B, o as Y, s as Z, d as q } from "./optionsSync-QUiN4Inw.js";
5
+ import "./ChartCore-BpzRvN4Y.js";
6
+ import "./index-x4stH3jD.js";
7
+ import "./symbols-DT0eLlpW.js";
8
+ import { a as D, u as L } from "./a11y-Bw6urYpr.js";
9
+ import { c as Q } from "./createStackedChart-Dm-YqUT7.js";
10
+ import { s as P, b as z, a as U } from "./stackedSync-tnrunZMt.js";
11
+ function I(a, t = {}) {
12
+ const [l, n] = R(null), [i, p] = R(!1), [S, C] = R(null), [y, d] = R(null), o = m(null), c = m(null), v = m(t), x = m(B(t));
13
+ v.current = t, b(() => {
14
+ const r = a.current;
15
+ if (r) {
16
+ try {
17
+ const e = j(
18
+ r,
19
+ v.current,
20
+ {
21
+ onBoundsChange: d,
22
+ onError: C
23
+ }
24
+ );
25
+ o.current = e.chart, c.current = e.destroy, n(e.chart), p(!0), d(e.getBounds()), C(null), x.current = B(v.current);
26
+ } catch (e) {
27
+ console.error("[useVeloPlot] Failed to initialize chart:", e), C(e instanceof Error ? e : new Error(String(e))), p(!1);
28
+ }
29
+ return () => {
30
+ var e;
31
+ (e = c.current) == null || e.call(c), c.current = null, o.current = null, n(null), p(!1);
32
+ };
33
+ }
34
+ }, [a]), b(() => {
35
+ const r = o.current;
36
+ if (!r || !i) return;
37
+ const e = B(t), k = x.current;
38
+ Y(k, e) && (Z(r, k, e), x.current = e);
39
+ });
40
+ const s = E((r) => {
41
+ const e = o.current;
42
+ e && (e.addSeries(r), d(e.getViewBounds()));
43
+ }, []), f = E((r, e) => {
44
+ var k;
45
+ (k = o.current) == null || k.updateSeries(r, e);
46
+ }, []), g = E((r) => {
47
+ var e;
48
+ (e = o.current) == null || e.removeSeries(r);
49
+ }, []), u = E((r) => {
50
+ var e;
51
+ (e = o.current) == null || e.zoom(r);
52
+ }, []), h = E(() => {
53
+ const r = o.current;
54
+ r && (r.resetZoom(), d(r.getViewBounds()));
55
+ }, []);
56
+ return {
57
+ chart: l,
58
+ isReady: i,
59
+ error: S,
60
+ bounds: y,
61
+ addSeries: s,
62
+ updateSeries: f,
63
+ removeSeries: g,
64
+ zoom: u,
65
+ resetZoom: h
66
+ };
67
+ }
68
+ const N = F(
69
+ function({
70
+ series: t = [],
71
+ zoom: l,
72
+ onZoomChange: n,
73
+ cursor: i,
74
+ width: p = "100%",
75
+ height: S = 400,
76
+ className: C = "",
77
+ style: y = {},
78
+ debug: d = !1,
79
+ ariaLabel: o,
80
+ keyboardNav: c = !0,
81
+ ...v
82
+ }, x) {
83
+ const s = m(null), f = m(/* @__PURE__ */ new Map()), g = m(null), {
84
+ chart: u,
85
+ isReady: h,
86
+ bounds: r,
87
+ addSeries: e,
88
+ updateSeries: k,
89
+ removeSeries: V,
90
+ resetZoom: $
91
+ } = I(s, v);
92
+ K(
93
+ x,
94
+ () => ({
95
+ getChart: () => u,
96
+ resetZoom: $,
97
+ getBounds: () => r
98
+ }),
99
+ [u, $, r]
100
+ ), b(() => {
101
+ !h || !u || (f.current = q(
102
+ { addSeries: e, updateSeries: k, removeSeries: V, autoScale: () => u.autoScale() },
103
+ t,
104
+ f.current
105
+ ));
106
+ }, [t, h, u, e, k, V]), b(() => {
107
+ !h || !u || !l || u.zoom(l);
108
+ }, [h, u, l]), b(() => {
109
+ if (!h || !u || !n) return;
110
+ const M = (w) => {
111
+ n({
112
+ xMin: w.x[0],
113
+ xMax: w.x[1],
114
+ yMin: w.y[0],
115
+ yMax: w.y[1]
116
+ });
117
+ };
118
+ return u.on("zoom", M), () => u.off("zoom", M);
119
+ }, [h, u, n]), b(() => {
120
+ !h || !u || (i != null && i.enabled ? u.enableCursor(i) : u.disableCursor());
121
+ }, [h, u, i]), b(() => {
122
+ const M = s.current;
123
+ if (!(!h || !u || !M))
124
+ return g.current = D(M, u, {
125
+ label: o,
126
+ series: t,
127
+ bounds: r,
128
+ enableKeyboard: c
129
+ }), () => {
130
+ var w;
131
+ (w = g.current) == null || w.cleanup(), g.current = null;
132
+ };
133
+ }, [h, u, c, o]), b(() => {
134
+ const M = s.current;
135
+ !M || !g.current || L(M, g.current.srTable, {
136
+ label: o,
137
+ series: t,
138
+ bounds: r
139
+ });
140
+ }, [t, r, o]);
141
+ const _ = T(
142
+ () => ({
143
+ position: "relative",
144
+ width: typeof p == "number" ? `${p}px` : p,
145
+ height: typeof S == "number" ? `${S}px` : S,
146
+ outline: "none",
147
+ ...y
148
+ }),
149
+ [p, S, y]
150
+ );
151
+ return /* @__PURE__ */ O(
152
+ "div",
153
+ {
154
+ ref: s,
155
+ className: `velo-plot-container ${C}`,
156
+ style: _,
157
+ children: d && r && /* @__PURE__ */ A(
158
+ "div",
159
+ {
160
+ style: {
161
+ position: "absolute",
162
+ top: 8,
163
+ right: 8,
164
+ background: "rgba(0,0,0,0.7)",
165
+ color: "#0f0",
166
+ padding: "4px 8px",
167
+ borderRadius: 4,
168
+ fontSize: 11,
169
+ fontFamily: "monospace",
170
+ pointerEvents: "none"
171
+ },
172
+ children: [
173
+ /* @__PURE__ */ A("div", { children: [
174
+ "X: [",
175
+ r.xMin.toFixed(3),
176
+ ", ",
177
+ r.xMax.toFixed(3),
178
+ "]"
179
+ ] }),
180
+ /* @__PURE__ */ A("div", { children: [
181
+ "Y: [",
182
+ r.yMin.toExponential(2),
183
+ ", ",
184
+ r.yMax.toExponential(2),
185
+ "]"
186
+ ] }),
187
+ /* @__PURE__ */ A("div", { children: [
188
+ "Series: ",
189
+ t.length
190
+ ] })
191
+ ]
192
+ }
193
+ )
194
+ }
195
+ );
196
+ }
197
+ );
198
+ function W(a) {
199
+ const t = m(null), l = m(null), n = m(null), [i, p] = R(null), [S, C] = R(!1), y = m(a), d = m(P(a.panes)), o = m(/* @__PURE__ */ new Map());
200
+ y.current = a;
201
+ const c = E(() => {
202
+ var g;
203
+ const s = t.current;
204
+ if (!s) return;
205
+ (g = n.current) == null || g.call(n);
206
+ const f = Q({
207
+ ...y.current,
208
+ container: s
12
209
  });
13
- return r.current = e, l(e), e.whenReady().then(() => u(!0)), () => {
14
- u(!1), e.destroy(), r.current = null, l(null);
15
- };
210
+ l.current = f, n.current = () => {
211
+ f.destroy(), l.current = null;
212
+ }, p(f), d.current = P(y.current.panes), o.current = z(
213
+ f,
214
+ y.current.panes,
215
+ /* @__PURE__ */ new Map()
216
+ ), f.whenReady().then(() => C(!0));
16
217
  }, []);
17
- const R = f((t) => {
18
- var e;
19
- (e = r.current) == null || e.fitAll(t);
20
- }, []), S = f(() => {
21
- var t;
22
- (t = r.current) == null || t.resetAll();
218
+ b(() => (c(), () => {
219
+ var s;
220
+ C(!1), (s = n.current) == null || s.call(n), n.current = null, p(null);
221
+ }), [c]), b(() => {
222
+ const s = l.current;
223
+ if (!s || !S) return;
224
+ if (P(a.panes) !== d.current) {
225
+ c();
226
+ return;
227
+ }
228
+ U(s, a), o.current = z(
229
+ s,
230
+ a.panes,
231
+ o.current
232
+ );
233
+ });
234
+ const v = E((s) => {
235
+ var f;
236
+ (f = l.current) == null || f.fitAll(s);
237
+ }, []), x = E(() => {
238
+ var s;
239
+ (s = l.current) == null || s.resetAll();
23
240
  }, []);
24
- return { containerRef: s, stack: i, isReady: d, fitAll: R, resetAll: S };
241
+ return { containerRef: t, stack: i, isReady: S, fitAll: v, resetAll: x };
242
+ }
243
+ const fe = F(
244
+ function({
245
+ width: t = "100%",
246
+ height: l = 480,
247
+ className: n = "",
248
+ style: i = {},
249
+ indicators: p,
250
+ onCrosshairMove: S,
251
+ drawingTools: C,
252
+ ariaLabel: y,
253
+ panes: d,
254
+ ...o
255
+ }, c) {
256
+ const { containerRef: v, stack: x, isReady: s, fitAll: f, resetAll: g } = W({
257
+ panes: d,
258
+ ...o
259
+ });
260
+ K(
261
+ c,
262
+ () => ({
263
+ getStack: () => x,
264
+ fitAll: () => f(),
265
+ resetAll: g,
266
+ getBounds: () => (x == null ? void 0 : x.getMaster().getViewBounds()) ?? null
267
+ }),
268
+ [x, f, g]
269
+ );
270
+ const u = T(
271
+ () => ({
272
+ position: "relative",
273
+ width: typeof t == "number" ? `${t}px` : t,
274
+ height: typeof l == "number" ? `${l}px` : l,
275
+ ...i
276
+ }),
277
+ [t, l, i]
278
+ );
279
+ return /* @__PURE__ */ O(
280
+ "div",
281
+ {
282
+ ref: v,
283
+ className: `velo-plot-stacked ${n}`,
284
+ style: u,
285
+ role: "img",
286
+ "aria-label": y ?? `Stacked chart with ${d.length} panes`,
287
+ "data-ready": s ? "true" : "false"
288
+ }
289
+ );
290
+ }
291
+ );
292
+ function de(a, t, l = {}) {
293
+ const [n, i] = R(null), [p, S] = R(!1), [C, y] = R(null), d = m(n);
294
+ return d.current = n, b(() => {
295
+ if (!a) return;
296
+ let o = !1;
297
+ return S(!0), y(null), G(a, t, l).then((c) => {
298
+ o || (i(c), S(!1));
299
+ }).catch((c) => {
300
+ o || (y(c instanceof Error ? c : new Error(String(c))), S(!1));
301
+ }), () => {
302
+ o = !0;
303
+ const c = d.current;
304
+ c && !H(a) && J(a, c.id);
305
+ };
306
+ }, [a, t, JSON.stringify(l)]), { result: n, isLoading: p, error: C };
307
+ }
308
+ function ee(a, t) {
309
+ const [l, n] = R(null);
310
+ return b(() => {
311
+ if (a.length < 2) {
312
+ n(null);
313
+ return;
314
+ }
315
+ const i = X(a, t);
316
+ return n(i.group), () => {
317
+ i.destroy(), n(null);
318
+ };
319
+ }, [a, JSON.stringify(t)]), { group: l };
25
320
  }
321
+ const pe = ee, Se = N, ye = N, me = I, xe = I;
26
322
  export {
27
- x as SciPlot,
28
- C as useSciPlot,
29
- A as useStackedPlot
323
+ ye as SciChart,
324
+ Se as SciPlot,
325
+ fe as StackedPlot,
326
+ N as VeloPlot,
327
+ pe as useChartGroup,
328
+ ee as useChartSync,
329
+ de as useIndicator,
330
+ xe as useSciChart,
331
+ me as useSciPlot,
332
+ W as useStackedPlot,
333
+ I as useVeloPlot
30
334
  };
31
335
  //# sourceMappingURL=react.js.map
package/dist/react.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sources":["../src/react/useStackedPlot.ts"],"sourcesContent":["/**\n * useStackedPlot - React hook for multi-pane stacked charts\n */\n\nimport {\n useEffect,\n useRef,\n useState,\n useCallback,\n type RefObject,\n} from \"react\";\nimport { createStackedChart } from \"../core/stacked\";\nimport type { StackedChart, StackedChartOptions } from \"../core/stacked\";\nimport type { Range } from \"../types\";\n\nexport interface UseStackedPlotOptions extends Omit<StackedChartOptions, \"container\"> {}\n\nexport interface UseStackedPlotReturn {\n containerRef: RefObject<HTMLDivElement>;\n stack: StackedChart | null;\n isReady: boolean;\n fitAll: (options?: { x?: Range; padding?: number }) => void;\n resetAll: () => void;\n}\n\nexport function useStackedPlot(\n options: UseStackedPlotOptions,\n): UseStackedPlotReturn {\n const containerRef = useRef<HTMLDivElement>(null);\n const stackRef = useRef<StackedChart | null>(null);\n const [stack, setStack] = useState<StackedChart | null>(null);\n const [isReady, setIsReady] = useState(false);\n const optionsRef = useRef(options);\n optionsRef.current = options;\n\n useEffect(() => {\n const el = containerRef.current;\n if (!el) return;\n\n const created = createStackedChart({\n ...optionsRef.current,\n container: el,\n });\n stackRef.current = created;\n setStack(created);\n\n created.whenReady().then(() => setIsReady(true));\n\n return () => {\n setIsReady(false);\n created.destroy();\n stackRef.current = null;\n setStack(null);\n };\n }, []);\n\n const fitAll = useCallback((opts?: { x?: Range; padding?: number }) => {\n stackRef.current?.fitAll(opts);\n }, []);\n\n const resetAll = useCallback(() => {\n stackRef.current?.resetAll();\n }, []);\n\n return { containerRef, stack, isReady, fitAll, resetAll };\n}\n"],"names":["useStackedPlot","options","containerRef","useRef","stackRef","stack","setStack","useState","isReady","setIsReady","optionsRef","useEffect","el","created","createStackedChart","fitAll","useCallback","opts","_a","resetAll"],"mappings":";;;AAyBO,SAASA,EACdC,GACsB;AACtB,QAAMC,IAAeC,EAAuB,IAAI,GAC1CC,IAAWD,EAA4B,IAAI,GAC3C,CAACE,GAAOC,CAAQ,IAAIC,EAA8B,IAAI,GACtD,CAACC,GAASC,CAAU,IAAIF,EAAS,EAAK,GACtCG,IAAaP,EAAOF,CAAO;AACjC,EAAAS,EAAW,UAAUT,GAErBU,EAAU,MAAM;AACd,UAAMC,IAAKV,EAAa;AACxB,QAAI,CAACU,EAAI;AAET,UAAMC,IAAUC,EAAmB;AAAA,MACjC,GAAGJ,EAAW;AAAA,MACd,WAAWE;AAAA,IAAA,CACZ;AACD,WAAAR,EAAS,UAAUS,GACnBP,EAASO,CAAO,GAEhBA,EAAQ,YAAY,KAAK,MAAMJ,EAAW,EAAI,CAAC,GAExC,MAAM;AACX,MAAAA,EAAW,EAAK,GAChBI,EAAQ,QAAA,GACRT,EAAS,UAAU,MACnBE,EAAS,IAAI;AAAA,IACf;AAAA,EACF,GAAG,CAAA,CAAE;AAEL,QAAMS,IAASC,EAAY,CAACC,MAA2C;;AACrE,KAAAC,IAAAd,EAAS,YAAT,QAAAc,EAAkB,OAAOD;AAAA,EAC3B,GAAG,CAAA,CAAE,GAECE,IAAWH,EAAY,MAAM;;AACjC,KAAAE,IAAAd,EAAS,YAAT,QAAAc,EAAkB;AAAA,EACpB,GAAG,CAAA,CAAE;AAEL,SAAO,EAAE,cAAAhB,GAAc,OAAAG,GAAO,SAAAG,GAAS,QAAAO,GAAQ,UAAAI,EAAA;AACjD;"}
1
+ {"version":3,"file":"react.js","sources":["../src/react/useVeloPlot.ts","../src/react/VeloPlot.tsx","../src/react/useStackedPlot.ts","../src/react/StackedPlot.tsx","../src/react/useIndicator.ts","../src/react/useChartSync.ts","../src/react/index.ts"],"sourcesContent":["/**\n * useVeloPlot - React hook for Velo Plot\n */\n\nimport {\n useEffect,\n useRef,\n useState,\n useCallback,\n type RefObject,\n} from \"react\";\nimport type { Chart } from \"../core/Chart\";\nimport type {\n SeriesOptions,\n SeriesUpdateData,\n ZoomOptions,\n Bounds,\n} from \"../types\";\nimport {\n createChartLifecycle,\n type ChartBindingOptions,\n optionsChanged,\n syncChartOptions,\n pickSyncableOptions,\n} from \"../bindings/shared\";\n\nexport interface UseVeloPlotOptions extends ChartBindingOptions {}\n\nexport interface UseVeloPlotReturn {\n chart: Chart | null;\n isReady: boolean;\n error: Error | null;\n bounds: Bounds | null;\n addSeries: (options: SeriesOptions) => void;\n updateSeries: (id: string, data: SeriesUpdateData) => void;\n removeSeries: (id: string) => void;\n zoom: (options: ZoomOptions) => void;\n resetZoom: () => void;\n}\n\nexport function useVeloPlot(\n containerRef: RefObject<HTMLDivElement>,\n options: UseVeloPlotOptions = {},\n): UseVeloPlotReturn {\n const [chart, setChart] = useState<Chart | null>(null);\n const [isReady, setIsReady] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const [bounds, setBounds] = useState<Bounds | null>(null);\n\n const chartRef = useRef<Chart | null>(null);\n const destroyRef = useRef<(() => void) | null>(null);\n const optionsRef = useRef(options);\n const prevSyncOptionsRef = useRef(pickSyncableOptions(options));\n optionsRef.current = options;\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n\n try {\n const handle = createChartLifecycle(\n container,\n optionsRef.current,\n {\n onBoundsChange: setBounds,\n onError: setError,\n },\n );\n chartRef.current = handle.chart;\n destroyRef.current = handle.destroy;\n setChart(handle.chart);\n setIsReady(true);\n setBounds(handle.getBounds());\n setError(null);\n prevSyncOptionsRef.current = pickSyncableOptions(optionsRef.current);\n } catch (err) {\n console.error(\"[useVeloPlot] Failed to initialize chart:\", err);\n setError(err instanceof Error ? err : new Error(String(err)));\n setIsReady(false);\n }\n\n return () => {\n destroyRef.current?.();\n destroyRef.current = null;\n chartRef.current = null;\n setChart(null);\n setIsReady(false);\n };\n }, [containerRef]);\n\n useEffect(() => {\n const currentChart = chartRef.current;\n if (!currentChart || !isReady) return;\n\n const next = pickSyncableOptions(options);\n const prev = prevSyncOptionsRef.current;\n if (optionsChanged(prev, next)) {\n syncChartOptions(currentChart, prev, next);\n prevSyncOptionsRef.current = next;\n }\n });\n\n const addSeries = useCallback((seriesOptions: SeriesOptions) => {\n const c = chartRef.current;\n if (c) {\n c.addSeries(seriesOptions);\n setBounds(c.getViewBounds());\n }\n }, []);\n\n const updateSeries = useCallback((id: string, data: SeriesUpdateData) => {\n chartRef.current?.updateSeries(id, data);\n }, []);\n\n const removeSeries = useCallback((id: string) => {\n chartRef.current?.removeSeries(id);\n }, []);\n\n const zoom = useCallback((zoomOptions: ZoomOptions) => {\n chartRef.current?.zoom(zoomOptions);\n }, []);\n\n const resetZoom = useCallback(() => {\n const c = chartRef.current;\n if (c) {\n c.resetZoom();\n setBounds(c.getViewBounds());\n }\n }, []);\n\n return {\n chart,\n isReady,\n error,\n bounds,\n addSeries,\n updateSeries,\n removeSeries,\n zoom,\n resetZoom,\n };\n}\n","/**\n * VeloPlot - React Component for Scientific Charts\n */\n\nimport {\n useRef,\n useEffect,\n useImperativeHandle,\n forwardRef,\n useMemo,\n type CSSProperties,\n} from \"react\";\nimport { useVeloPlot, type UseVeloPlotOptions } from \"./useVeloPlot\";\nimport type { ZoomOptions, CursorOptions, Bounds } from \"../types\";\nimport type { Chart } from \"../core/Chart\";\nimport {\n diffSeries,\n applyChartA11y,\n updateA11y,\n type VeloPlotSeries,\n} from \"../bindings/shared\";\n\nexport type { VeloPlotSeries } from \"../bindings/shared\";\n\nexport interface VeloPlotProps extends UseVeloPlotOptions {\n series?: VeloPlotSeries[];\n zoom?: ZoomOptions;\n onZoomChange?: (bounds: Bounds) => void;\n cursor?: CursorOptions;\n width?: number | string;\n height?: number | string;\n className?: string;\n style?: CSSProperties;\n debug?: boolean;\n /** Custom aria-label for accessibility */\n ariaLabel?: string;\n /** Enable keyboard navigation (default: true) */\n keyboardNav?: boolean;\n}\n\nexport interface VeloPlotRef {\n getChart: () => Chart | null;\n resetZoom: () => void;\n getBounds: () => Bounds | null;\n}\n\nexport const VeloPlot = forwardRef<VeloPlotRef, VeloPlotProps>(\n function VeloPlot(\n {\n series = [],\n zoom: zoomProp,\n onZoomChange,\n cursor,\n width = \"100%\",\n height = 400,\n className = \"\",\n style = {},\n debug = false,\n ariaLabel,\n keyboardNav = true,\n ...chartOptions\n },\n ref,\n ) {\n const containerRef = useRef<HTMLDivElement>(null);\n const previousSeriesRef = useRef<Map<string, VeloPlotSeries>>(new Map());\n const a11yRef = useRef<ReturnType<typeof applyChartA11y> | null>(null);\n\n const {\n chart,\n isReady,\n bounds,\n addSeries,\n updateSeries,\n removeSeries,\n resetZoom,\n } = useVeloPlot(containerRef, chartOptions);\n\n useImperativeHandle(\n ref,\n () => ({\n getChart: () => chart,\n resetZoom,\n getBounds: () => bounds,\n }),\n [chart, resetZoom, bounds],\n );\n\n useEffect(() => {\n if (!isReady || !chart) return;\n previousSeriesRef.current = diffSeries(\n { addSeries, updateSeries, removeSeries, autoScale: () => chart.autoScale() },\n series,\n previousSeriesRef.current,\n );\n }, [series, isReady, chart, addSeries, updateSeries, removeSeries]);\n\n useEffect(() => {\n if (!isReady || !chart || !zoomProp) return;\n chart.zoom(zoomProp);\n }, [isReady, chart, zoomProp]);\n\n useEffect(() => {\n if (!isReady || !chart || !onZoomChange) return;\n const handler = (event: { x: [number, number]; y: [number, number] }) => {\n onZoomChange({\n xMin: event.x[0],\n xMax: event.x[1],\n yMin: event.y[0],\n yMax: event.y[1],\n });\n };\n chart.on(\"zoom\", handler);\n return () => chart.off(\"zoom\", handler);\n }, [isReady, chart, onZoomChange]);\n\n useEffect(() => {\n if (!isReady || !chart) return;\n if (cursor?.enabled) {\n chart.enableCursor(cursor);\n } else {\n chart.disableCursor();\n }\n }, [isReady, chart, cursor]);\n\n useEffect(() => {\n const el = containerRef.current;\n if (!isReady || !chart || !el) return;\n\n a11yRef.current = applyChartA11y(el, chart, {\n label: ariaLabel,\n series,\n bounds,\n enableKeyboard: keyboardNav,\n });\n\n return () => {\n a11yRef.current?.cleanup();\n a11yRef.current = null;\n };\n }, [isReady, chart, keyboardNav, ariaLabel]);\n\n useEffect(() => {\n const el = containerRef.current;\n if (!el || !a11yRef.current) return;\n updateA11y(el, a11yRef.current.srTable, {\n label: ariaLabel,\n series,\n bounds,\n });\n }, [series, bounds, ariaLabel]);\n\n const containerStyle = useMemo<CSSProperties>(\n () => ({\n position: \"relative\",\n width: typeof width === \"number\" ? `${width}px` : width,\n height: typeof height === \"number\" ? `${height}px` : height,\n outline: \"none\",\n ...style,\n }),\n [width, height, style],\n );\n\n return (\n <div\n ref={containerRef}\n className={`velo-plot-container ${className}`}\n style={containerStyle}\n >\n {debug && bounds && (\n <div\n style={{\n position: \"absolute\",\n top: 8,\n right: 8,\n background: \"rgba(0,0,0,0.7)\",\n color: \"#0f0\",\n padding: \"4px 8px\",\n borderRadius: 4,\n fontSize: 11,\n fontFamily: \"monospace\",\n pointerEvents: \"none\",\n }}\n >\n <div>\n X: [{bounds.xMin.toFixed(3)}, {bounds.xMax.toFixed(3)}]\n </div>\n <div>\n Y: [{bounds.yMin.toExponential(2)}, {bounds.yMax.toExponential(2)}]\n </div>\n <div>Series: {series.length}</div>\n </div>\n )}\n </div>\n );\n },\n);\n\nexport default VeloPlot;\n","/**\n * useStackedPlot - React hook for multi-pane stacked charts\n */\n\nimport {\n useEffect,\n useRef,\n useState,\n useCallback,\n type RefObject,\n} from \"react\";\nimport { createStackedChart } from \"../core/stacked\";\nimport type { StackedChart, StackedChartOptions } from \"../core/stacked\";\nimport type { Range } from \"../types\";\nimport {\n stackedStructureKey,\n syncStackedOptions,\n syncStackedPaneSeries,\n} from \"../bindings/shared\";\nimport type { VeloPlotSeries } from \"../bindings/shared\";\n\nexport interface UseStackedPlotOptions\n extends Omit<StackedChartOptions, \"container\"> {}\n\nexport interface UseStackedPlotReturn {\n containerRef: RefObject<HTMLDivElement>;\n stack: StackedChart | null;\n isReady: boolean;\n fitAll: (options?: { x?: Range; padding?: number }) => void;\n resetAll: () => void;\n}\n\nexport function useStackedPlot(\n options: UseStackedPlotOptions,\n): UseStackedPlotReturn {\n const containerRef = useRef<HTMLDivElement>(null);\n const stackRef = useRef<StackedChart | null>(null);\n const destroyRef = useRef<(() => void) | null>(null);\n const [stack, setStack] = useState<StackedChart | null>(null);\n const [isReady, setIsReady] = useState(false);\n\n const optionsRef = useRef(options);\n const structureKeyRef = useRef(stackedStructureKey(options.panes));\n const paneSeriesRef = useRef(new Map<string, Map<string, VeloPlotSeries>>());\n optionsRef.current = options;\n\n const mountStack = useCallback(() => {\n const el = containerRef.current;\n if (!el) return;\n\n destroyRef.current?.();\n const created = createStackedChart({\n ...optionsRef.current,\n container: el,\n });\n stackRef.current = created;\n destroyRef.current = () => {\n created.destroy();\n stackRef.current = null;\n };\n setStack(created);\n structureKeyRef.current = stackedStructureKey(optionsRef.current.panes);\n paneSeriesRef.current = syncStackedPaneSeries(\n created,\n optionsRef.current.panes,\n new Map(),\n );\n\n created.whenReady().then(() => setIsReady(true));\n }, []);\n\n useEffect(() => {\n mountStack();\n return () => {\n setIsReady(false);\n destroyRef.current?.();\n destroyRef.current = null;\n setStack(null);\n };\n }, [mountStack]);\n\n useEffect(() => {\n const current = stackRef.current;\n if (!current || !isReady) return;\n\n const nextKey = stackedStructureKey(options.panes);\n if (nextKey !== structureKeyRef.current) {\n mountStack();\n return;\n }\n\n syncStackedOptions(current, options);\n paneSeriesRef.current = syncStackedPaneSeries(\n current,\n options.panes,\n paneSeriesRef.current,\n );\n });\n\n const fitAll = useCallback((opts?: { x?: Range; padding?: number }) => {\n stackRef.current?.fitAll(opts);\n }, []);\n\n const resetAll = useCallback(() => {\n stackRef.current?.resetAll();\n }, []);\n\n return { containerRef, stack, isReady, fitAll, resetAll };\n}\n","/**\n * StackedPlot - Declarative React component for multi-pane charts\n */\n\nimport {\n forwardRef,\n useImperativeHandle,\n useMemo,\n type CSSProperties,\n} from \"react\";\nimport { useStackedPlot, type UseStackedPlotOptions } from \"./useStackedPlot\";\nimport type { StackedChart } from \"../core/stacked\";\nimport type { Bounds } from \"../types\";\nimport type { AddIndicatorOptions } from \"../core/indicator/addIndicator\";\nimport type { IndicatorPresetName } from \"../core/indicator/indicatorPresets\";\n\nexport interface StackedPlotIndicator extends AddIndicatorOptions {\n type: IndicatorPresetName;\n}\n\nexport interface StackedPlotProps extends UseStackedPlotOptions {\n width?: number | string;\n height?: number | string;\n className?: string;\n style?: CSSProperties;\n indicators?: StackedPlotIndicator[];\n onCrosshairMove?: (event: { price?: number; x: number }) => void;\n drawingTools?: string[];\n ariaLabel?: string;\n}\n\nexport interface StackedPlotRef {\n getStack: () => StackedChart | null;\n fitAll: () => void;\n resetAll: () => void;\n getBounds: () => Bounds | null;\n}\n\nexport const StackedPlot = forwardRef<StackedPlotRef, StackedPlotProps>(\n function StackedPlot(\n {\n width = \"100%\",\n height = 480,\n className = \"\",\n style = {},\n indicators: _indicators,\n onCrosshairMove: _onCrosshairMove,\n drawingTools: _drawingTools,\n ariaLabel,\n panes,\n ...stackOptions\n },\n ref,\n ) {\n const { containerRef, stack, isReady, fitAll, resetAll } = useStackedPlot({\n panes,\n ...stackOptions,\n });\n\n useImperativeHandle(\n ref,\n () => ({\n getStack: () => stack,\n fitAll: () => fitAll(),\n resetAll,\n getBounds: () => stack?.getMaster().getViewBounds() ?? null,\n }),\n [stack, fitAll, resetAll],\n );\n\n const containerStyle = useMemo<CSSProperties>(\n () => ({\n position: \"relative\",\n width: typeof width === \"number\" ? `${width}px` : width,\n height: typeof height === \"number\" ? `${height}px` : height,\n ...style,\n }),\n [width, height, style],\n );\n\n return (\n <div\n ref={containerRef as React.RefObject<HTMLDivElement>}\n className={`velo-plot-stacked ${className}`}\n style={containerStyle}\n role=\"img\"\n aria-label={ariaLabel ?? `Stacked chart with ${panes.length} panes`}\n data-ready={isReady ? \"true\" : \"false\"}\n />\n );\n },\n);\n\nexport default StackedPlot;\n","/**\n * useIndicator - React hook for trading indicators\n */\n\nimport { useEffect, useRef, useState } from \"react\";\nimport type { Chart } from \"../core/chart/types\";\nimport type { AddIndicatorOptions, AddIndicatorResult } from \"../core/indicator/addIndicator\";\nimport type { IndicatorPresetName } from \"../core/indicator/indicatorPresets\";\nimport {\n addIndicatorToHost,\n isStackedChart,\n removeIndicatorFromChart,\n type IndicatorHost,\n} from \"../bindings/shared\";\n\nexport interface UseIndicatorReturn {\n result: (AddIndicatorResult & { paneId?: string }) | null;\n isLoading: boolean;\n error: Error | null;\n}\n\nexport function useIndicator(\n host: IndicatorHost,\n preset: IndicatorPresetName,\n options: AddIndicatorOptions = {},\n): UseIndicatorReturn {\n const [result, setResult] = useState<\n (AddIndicatorResult & { paneId?: string }) | null\n >(null);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const resultRef = useRef(result);\n resultRef.current = result;\n\n useEffect(() => {\n if (!host) return;\n\n let cancelled = false;\n setIsLoading(true);\n setError(null);\n\n addIndicatorToHost(host, preset, options)\n .then((res) => {\n if (!cancelled) {\n setResult(res);\n setIsLoading(false);\n }\n })\n .catch((err) => {\n if (!cancelled) {\n setError(err instanceof Error ? err : new Error(String(err)));\n setIsLoading(false);\n }\n });\n\n return () => {\n cancelled = true;\n const res = resultRef.current;\n if (res && !isStackedChart(host)) {\n removeIndicatorFromChart(host as Chart, res.id);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [host, preset, JSON.stringify(options)]);\n\n return { result, isLoading, error };\n}\n","/**\n * useChartSync - React hook for synchronizing multiple charts\n */\n\nimport { useEffect, useState } from \"react\";\nimport type { ChartLike, SyncOptions } from \"../core/sync\";\nimport { ChartGroup } from \"../core/sync\";\nimport { createChartSync } from \"../bindings/shared\";\n\nexport interface UseChartSyncReturn {\n group: ChartGroup | null;\n}\n\nexport function useChartSync(\n charts: ChartLike[],\n options?: SyncOptions,\n): UseChartSyncReturn {\n const [group, setGroup] = useState<ChartGroup | null>(null);\n\n useEffect(() => {\n if (charts.length < 2) {\n setGroup(null);\n return;\n }\n\n const handle = createChartSync(charts, options);\n setGroup(handle.group);\n\n return () => {\n handle.destroy();\n setGroup(null);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [charts, JSON.stringify(options)]);\n\n return { group };\n}\n\n/** Alias matching roadmap naming (`useChartGroup` ≡ `useChartSync`). */\nexport const useChartGroup = useChartSync;\n","/**\n * React bindings for Velo Plot\n */\n\nexport {\n VeloPlot,\n type VeloPlotProps,\n type VeloPlotRef,\n type VeloPlotSeries,\n} from \"./VeloPlot\";\nexport {\n StackedPlot,\n type StackedPlotProps,\n type StackedPlotRef,\n type StackedPlotIndicator,\n} from \"./StackedPlot\";\nexport {\n useVeloPlot,\n type UseVeloPlotOptions,\n type UseVeloPlotReturn,\n} from \"./useVeloPlot\";\nexport {\n useStackedPlot,\n type UseStackedPlotOptions,\n type UseStackedPlotReturn,\n} from \"./useStackedPlot\";\nexport {\n useIndicator,\n type UseIndicatorReturn,\n} from \"./useIndicator\";\nexport {\n useChartSync,\n useChartGroup,\n type UseChartSyncReturn,\n} from \"./useChartSync\";\n\n// ---------------------------------------------------------------------------\n// Backward-compatible aliases (SciPlot / SciChart branding → VeloPlot)\n// Removed in v4.0.\n// ---------------------------------------------------------------------------\nimport { VeloPlot as VeloPlotImpl } from \"./VeloPlot\";\nimport { useVeloPlot as useVeloPlotImpl } from \"./useVeloPlot\";\n\n/**\n * @deprecated Use `VeloPlot` instead. **Removed in v4.0.**\n */\nexport const SciPlot = VeloPlotImpl;\n/**\n * @deprecated Use `VeloPlot` instead. **Removed in v4.0.**\n */\nexport const SciChart = VeloPlotImpl;\n/**\n * @deprecated Use `useVeloPlot` instead. **Removed in v4.0.**\n */\nexport const useSciPlot = useVeloPlotImpl;\n/**\n * @deprecated Use `useVeloPlot` instead. **Removed in v4.0.**\n */\nexport const useSciChart = useVeloPlotImpl;\n\nexport type {\n VeloPlotProps as SciPlotProps,\n VeloPlotRef as SciPlotRef,\n VeloPlotSeries as SciPlotSeries,\n VeloPlotProps as SciChartProps,\n VeloPlotRef as SciChartRef,\n VeloPlotSeries as SciChartSeries,\n} from \"./VeloPlot\";\nexport type {\n UseVeloPlotOptions as UseSciPlotOptions,\n UseVeloPlotReturn as UseSciPlotReturn,\n UseVeloPlotOptions as UseSciChartOptions,\n UseVeloPlotReturn as UseSciChartReturn,\n} from \"./useVeloPlot\";\n"],"names":["useVeloPlot","containerRef","options","chart","setChart","useState","isReady","setIsReady","error","setError","bounds","setBounds","chartRef","useRef","destroyRef","optionsRef","prevSyncOptionsRef","pickSyncableOptions","useEffect","container","handle","createChartLifecycle","err","_a","currentChart","next","prev","optionsChanged","syncChartOptions","addSeries","useCallback","seriesOptions","c","updateSeries","id","data","removeSeries","zoom","zoomOptions","resetZoom","VeloPlot","forwardRef","series","zoomProp","onZoomChange","cursor","width","height","className","style","debug","ariaLabel","keyboardNav","chartOptions","ref","previousSeriesRef","a11yRef","useImperativeHandle","diffSeries","handler","event","el","applyChartA11y","updateA11y","containerStyle","useMemo","jsx","jsxs","useStackedPlot","stackRef","stack","setStack","structureKeyRef","stackedStructureKey","paneSeriesRef","mountStack","created","createStackedChart","syncStackedPaneSeries","current","syncStackedOptions","fitAll","opts","resetAll","StackedPlot","_indicators","_onCrosshairMove","_drawingTools","panes","stackOptions","useIndicator","host","preset","result","setResult","isLoading","setIsLoading","resultRef","cancelled","addIndicatorToHost","res","isStackedChart","removeIndicatorFromChart","useChartSync","charts","group","setGroup","createChartSync","useChartGroup","SciPlot","VeloPlotImpl","SciChart","useSciPlot","useVeloPlotImpl","useSciChart"],"mappings":";;;;;;;;;;AAwCO,SAASA,EACdC,GACAC,IAA8B,IACX;AACnB,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAuB,IAAI,GAC/C,CAACC,GAASC,CAAU,IAAIF,EAAS,EAAK,GACtC,CAACG,GAAOC,CAAQ,IAAIJ,EAAuB,IAAI,GAC/C,CAACK,GAAQC,CAAS,IAAIN,EAAwB,IAAI,GAElDO,IAAWC,EAAqB,IAAI,GACpCC,IAAaD,EAA4B,IAAI,GAC7CE,IAAaF,EAAOX,CAAO,GAC3Bc,IAAqBH,EAAOI,EAAoBf,CAAO,CAAC;AAC9D,EAAAa,EAAW,UAAUb,GAErBgB,EAAU,MAAM;AACd,UAAMC,IAAYlB,EAAa;AAC/B,QAAKkB,GAEL;AAAA,UAAI;AACF,cAAMC,IAASC;AAAA,UACbF;AAAA,UACAJ,EAAW;AAAA,UACX;AAAA,YACE,gBAAgBJ;AAAA,YAChB,SAASF;AAAA,UAAA;AAAA,QACX;AAEF,QAAAG,EAAS,UAAUQ,EAAO,OAC1BN,EAAW,UAAUM,EAAO,SAC5BhB,EAASgB,EAAO,KAAK,GACrBb,EAAW,EAAI,GACfI,EAAUS,EAAO,WAAW,GAC5BX,EAAS,IAAI,GACbO,EAAmB,UAAUC,EAAoBF,EAAW,OAAO;AAAA,MACrE,SAASO,GAAK;AACZ,gBAAQ,MAAM,6CAA6CA,CAAG,GAC9Db,EAASa,aAAe,QAAQA,IAAM,IAAI,MAAM,OAAOA,CAAG,CAAC,CAAC,GAC5Df,EAAW,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,MAAM,OAAOA,CAAG,CAAC,CAAC,GAC5D0E,EAAa,EAAK;AAAA,IAEtB,CAAC,GAEI,MAAM;AACX,MAAAE,IAAY;AACZ,YAAME,IAAMH,EAAU;AACtB,MAAIG,KAAO,CAACC,EAAeV,CAAI,KAC7BW,EAAyBX,GAAeS,EAAI,EAAE;AAAA,IAElD;AAAA,EAEF,GAAG,CAACT,GAAMC,GAAQ,KAAK,UAAU1F,CAAO,CAAC,CAAC,GAEnC,EAAE,QAAA2F,GAAQ,WAAAE,GAAW,OAAAvF,EAAA;AAC9B;ACrDO,SAAS+F,GACdC,GACAtG,GACoB;AACpB,QAAM,CAACuG,GAAOC,CAAQ,IAAIrG,EAA4B,IAAI;AAE1D,SAAAa,EAAU,MAAM;AACd,QAAIsF,EAAO,SAAS,GAAG;AACrB,MAAAE,EAAS,IAAI;AACb;AAAA,IACF;AAEA,UAAMtF,IAASuF,EAAgBH,GAAQtG,CAAO;AAC9C,WAAAwG,EAAStF,EAAO,KAAK,GAEd,MAAM;AACX,MAAAA,EAAO,QAAA,GACPsF,EAAS,IAAI;AAAA,IACf;AAAA,EAEF,GAAG,CAACF,GAAQ,KAAK,UAAUtG,CAAO,CAAC,CAAC,GAE7B,EAAE,OAAAuG,EAAA;AACX;AAGO,MAAMG,KAAgBL,ICOhBM,KAAUC,GAIVC,KAAWD,GAIXE,KAAaC,GAIbC,KAAcD;"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * velo-plot/scientific — focused scientific visualization bundle (Stage 5).
3
+ * Tree-shakes trading-only plugins; includes analysis, FFT, regression,
4
+ * forecasting, LaTeX, 3D, and related scientific tooling.
5
+ */
6
+ export { createChart } from '../core/Chart';
7
+ export type { Chart, ChartOptions, ExportOptions } from '../core/Chart';
8
+ export { Series } from '../core/Series';
9
+ export { EventEmitter } from '../core/EventEmitter';
10
+ export { createStackedChart } from '../core/stacked/createStackedChart';
11
+ export type { StackedChart, StackedChartOptions, StackedPaneConfig, } from '../core/stacked/types';
12
+ export { LinearScale, LogScale, createScale, type Scale } from '../scales';
13
+ export { DARK_THEME, LIGHT_THEME, MIDNIGHT_THEME, ELECTROCHEM_THEME, DEFAULT_THEME, createTheme, getThemeByName, type ChartTheme, } from '../theme';
14
+ export { formatWithPrefix, formatValue, formatScientific, getBestPrefix, detectCycles, generateCycleColors, detectPeaks, validateData, calculateStats, movingAverage, downsampleLTTB, subtractBaseline, integrate, derivative, cumulativeIntegral, calculateR2, solveLinearSystem, fft, ifft, analyzeSpectrum, powerSpectrum, dominantFrequency, analyzeComplexSpectrum, fftFromComplexInput, hanningWindow, hammingWindow, blackmanWindow, } from '../plugins/analysis';
15
+ export { downsampleAsync, ohlcDownsampleAsync, destroyDownsamplePool, } from '../workers/downsampleAsync';
16
+ export { rsiAsync, smaAsync, emaAsync, macdAsync, bollingerBandsAsync, destroyIndicatorPool, } from '../workers/indicatorsAsync';
17
+ export { PluginAnalysis } from '../plugins/analysis';
18
+ export type { PluginAnalysisConfig } from '../plugins/analysis';
19
+ export { PluginRegression } from '../plugins/regression';
20
+ export type { PluginRegressionConfig, RegressionAPI, RegressionResult } from '../plugins/regression';
21
+ export { PluginForecasting } from '../plugins/forecasting';
22
+ export type { PluginForecastingConfig } from '../plugins/forecasting';
23
+ export { PluginLaTeX } from '../plugins/latex';
24
+ export type { PluginLaTeXConfig } from '../plugins/latex';
25
+ export { Plugin3D } from '../plugins/3d';
26
+ export type { Plugin3DConfig } from '../plugins/3d';
27
+ export { PluginAnomalyDetection } from '../plugins/anomaly-detection';
28
+ export type { PluginAnomalyDetectionConfig } from '../plugins/anomaly-detection';
29
+ export { PluginPatternRecognition } from '../plugins/pattern-recognition';
30
+ export type { PluginPatternRecognitionConfig } from '../plugins/pattern-recognition';
31
+ export { PluginMLIntegration } from '../plugins/ml-integration';
32
+ export type { PluginMLIntegrationConfig } from '../plugins/ml-integration';
33
+ export { PluginBrokenAxis } from '../plugins/broken-axis';
34
+ export type { PluginBrokenAxisConfig } from '../plugins/broken-axis';
35
+ export { PluginRadar } from '../plugins/radar';
36
+ export type { PluginRadarConfig } from '../plugins/radar';
37
+ export { PluginDataTransform } from '../plugins/data-transform';
38
+ export type { PluginDataTransformConfig } from '../plugins/data-transform';
39
+ export { PluginVirtualization } from '../plugins/virtualization';
40
+ export type { PluginVirtualizationConfig } from '../plugins/virtualization';
41
+ export { PluginSnapshot } from '../plugins/snapshot';
42
+ export type { PluginSnapshotConfig } from '../plugins/snapshot';
43
+ export { PluginAnnotations } from '../plugins/annotations';
44
+ export type { Annotation, AnnotationType } from '../plugins/annotations';
45
+ export { PluginTools } from '../plugins/tools';
46
+ export type { PluginToolsConfig } from '../plugins/tools';
47
+ export { ChartGroup, createChartGroup } from '../core/sync';
48
+ export type { SeriesOptions, SeriesData, AxisOptions, Bounds, SeriesType, } from '../types';
@@ -0,0 +1 @@
1
+ export * from './scientific/index'
@@ -0,0 +1,91 @@
1
+ import { D as r, e as o, E as t, d as s, L as n, a as i, M as m, S as l, i as c, c as f, b as p, f as g, j as u, h as x, g as P, m as d, r as y, s as E } from "./ChartCore-BpzRvN4Y.js";
2
+ import { E as A } from "./axisFormat-CzumxpCL.js";
3
+ import { c as S } from "./createStackedChart-Dm-YqUT7.js";
4
+ import { PluginAnalysis as D, analyzeComplexSpectrum as L, analyzeSpectrum as v, blackmanWindow as M, dominantFrequency as w, fft as H, fftFromComplexInput as I, hammingWindow as B, hanningWindow as R, ifft as b, powerSpectrum as _ } from "./plugins/analysis.js";
5
+ import { P as F, a as G, d as W, o as z } from "./index-0InEyj0q.js";
6
+ import { PluginRegression as V } from "./plugins/regression.js";
7
+ import { PluginForecasting as q } from "./plugins/forecasting.js";
8
+ import { PluginLaTeX as O } from "./plugins/latex.js";
9
+ import { Plugin3D as X } from "./plugins/3d.js";
10
+ import { PluginAnomalyDetection as Q } from "./plugins/anomaly-detection.js";
11
+ import { PluginPatternRecognition as Z } from "./plugins/pattern-recognition.js";
12
+ import { PluginMLIntegration as aa } from "./plugins/ml-integration.js";
13
+ import { PluginBrokenAxis as ra } from "./plugins/broken-axis.js";
14
+ import { PluginRadar as ta } from "./plugins/radar.js";
15
+ import { PluginDataTransform as na } from "./plugins/data-transform.js";
16
+ import { PluginSnapshot as ma } from "./plugins/snapshot.js";
17
+ import { PluginAnnotations as ca } from "./plugins/annotations.js";
18
+ import { P as pa } from "./index-qunX30Xu.js";
19
+ import { C as ua, c as xa } from "./index-CaXWSOTk.js";
20
+ import { h as da, d as ya, e as Ea, i as Ta, b as Aa, a as ha, f as Sa, c as Ca, g as Da, m as La, s as va, v as Ma } from "./utils-Dx0h0bgQ.js";
21
+ import { a as Ha, c as Ia, d as Ba, i as Ra, s as ba } from "./math-Ddm2EZjj.js";
22
+ export {
23
+ ua as ChartGroup,
24
+ r as DARK_THEME,
25
+ o as DEFAULT_THEME,
26
+ t as ELECTROCHEM_THEME,
27
+ A as EventEmitter,
28
+ s as LIGHT_THEME,
29
+ n as LinearScale,
30
+ i as LogScale,
31
+ m as MIDNIGHT_THEME,
32
+ X as Plugin3D,
33
+ D as PluginAnalysis,
34
+ ca as PluginAnnotations,
35
+ Q as PluginAnomalyDetection,
36
+ ra as PluginBrokenAxis,
37
+ na as PluginDataTransform,
38
+ q as PluginForecasting,
39
+ O as PluginLaTeX,
40
+ aa as PluginMLIntegration,
41
+ Z as PluginPatternRecognition,
42
+ ta as PluginRadar,
43
+ V as PluginRegression,
44
+ ma as PluginSnapshot,
45
+ pa as PluginTools,
46
+ F as PluginVirtualization,
47
+ l as Series,
48
+ L as analyzeComplexSpectrum,
49
+ v as analyzeSpectrum,
50
+ M as blackmanWindow,
51
+ c as bollingerBandsAsync,
52
+ Ha as calculateR2,
53
+ da as calculateStats,
54
+ f as createChart,
55
+ xa as createChartGroup,
56
+ p as createScale,
57
+ S as createStackedChart,
58
+ g as createTheme,
59
+ Ia as cumulativeIntegral,
60
+ Ba as derivative,
61
+ G as destroyDownsamplePool,
62
+ u as destroyIndicatorPool,
63
+ ya as detectCycles,
64
+ Ea as detectPeaks,
65
+ w as dominantFrequency,
66
+ W as downsampleAsync,
67
+ Ta as downsampleLTTB,
68
+ x as emaAsync,
69
+ H as fft,
70
+ I as fftFromComplexInput,
71
+ Aa as formatScientific,
72
+ ha as formatValue,
73
+ Sa as formatWithPrefix,
74
+ Ca as generateCycleColors,
75
+ Da as getBestPrefix,
76
+ P as getThemeByName,
77
+ B as hammingWindow,
78
+ R as hanningWindow,
79
+ b as ifft,
80
+ Ra as integrate,
81
+ d as macdAsync,
82
+ La as movingAverage,
83
+ z as ohlcDownsampleAsync,
84
+ _ as powerSpectrum,
85
+ y as rsiAsync,
86
+ E as smaAsync,
87
+ ba as solveLinearSystem,
88
+ va as subtractBaseline,
89
+ Ma as validateData
90
+ };
91
+ //# sourceMappingURL=scientific.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scientific.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,16 @@
1
+ import { UseVeloPlotOptions } from './useVeloPlot';
2
+ import { VeloPlotSeries } from '../bindings/shared';
3
+
4
+ export interface VeloPlotProps extends UseVeloPlotOptions {
5
+ series?: VeloPlotSeries[];
6
+ width?: number | string;
7
+ height?: number | string;
8
+ class?: string;
9
+ }
10
+ export declare function VeloPlot(props: VeloPlotProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function StackedPlot(props: {
12
+ panes: import('../core/stacked').StackedPaneConfig[];
13
+ width?: number | string;
14
+ height?: number | string;
15
+ class?: string;
16
+ } & Omit<import('../core/stacked').StackedChartOptions, "container" | "panes">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { VeloPlot as VeloPlotImpl } from './VeloPlot';
2
+ import { useVeloPlot as useVeloPlotImpl } from './useVeloPlot';
3
+ export { VeloPlot, StackedPlot } from './VeloPlot';
4
+ export { useVeloPlot, type UseVeloPlotOptions } from './useVeloPlot';
5
+ export { useStackedPlot } from './useStackedPlot';
6
+ export { useIndicator } from './useIndicator';
7
+ export { useChartSync, useChartGroup } from './useChartSync';
8
+ /** @deprecated Use `VeloPlot` instead. **Removed in v4.0.** */
9
+ export declare const SciPlot: typeof VeloPlotImpl;
10
+ /** @deprecated Use `useVeloPlot` instead. **Removed in v4.0.** */
11
+ export declare const useSciPlot: typeof useVeloPlotImpl;
12
+ /** @deprecated Use `useVeloPlot` instead. **Removed in v4.0.** */
13
+ export declare const useSciChart: typeof useVeloPlotImpl;
@@ -0,0 +1,6 @@
1
+ import { ChartLike, SyncOptions, ChartGroup } from '../core/sync';
2
+
3
+ export declare function useChartSync(charts: () => ChartLike[], options?: SyncOptions): {
4
+ group: import('solid-js').Accessor<ChartGroup | null>;
5
+ };
6
+ export declare const useChartGroup: typeof useChartSync;
@@ -0,0 +1,11 @@
1
+ import { AddIndicatorOptions, AddIndicatorResult } from '../core/indicator/addIndicator';
2
+ import { IndicatorPresetName } from '../core/indicator/indicatorPresets';
3
+ import { IndicatorHost } from '../bindings/shared';
4
+
5
+ export declare function useIndicator(host: () => IndicatorHost, preset: IndicatorPresetName, options?: AddIndicatorOptions): {
6
+ result: import('solid-js').Accessor<(AddIndicatorResult & {
7
+ paneId?: string;
8
+ }) | null>;
9
+ isLoading: import('solid-js').Accessor<boolean>;
10
+ error: import('solid-js').Accessor<Error | null>;
11
+ };
@@ -0,0 +1,14 @@
1
+ import { StackedChart, StackedChartOptions } from '../core/stacked';
2
+ import { Range } from '../types';
3
+
4
+ export declare function useStackedPlot(getOptions: () => Omit<StackedChartOptions, "container">): {
5
+ setContainerRef: (el: HTMLDivElement | null | undefined) => void;
6
+ stack: import('solid-js').Accessor<StackedChart | null>;
7
+ isReady: import('solid-js').Accessor<boolean>;
8
+ fitAll: (opts?: {
9
+ x?: Range;
10
+ padding?: number;
11
+ }) => void | undefined;
12
+ resetAll: () => void | undefined;
13
+ sync: () => void;
14
+ };