velo-plot 2.20.0 → 3.1.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 (287) hide show
  1. package/README.md +26 -12
  2. package/dist/ChartCore-AnR_3Xkb.js +7338 -0
  3. package/dist/ChartCore-AnR_3Xkb.js.map +1 -0
  4. package/dist/GpuChartRenderer-Dxc0hrQA.js +75 -0
  5. package/dist/GpuChartRenderer-Dxc0hrQA.js.map +1 -0
  6. package/dist/{index.core-COREBDNq.js → PluginRegistry-CzMHebYP.js} +24 -38
  7. package/dist/PluginRegistry-CzMHebYP.js.map +1 -0
  8. package/dist/a11y-Bw6urYpr.js +105 -0
  9. package/dist/a11y-Bw6urYpr.js.map +1 -0
  10. package/dist/angular/hooks-entry.d.ts +1 -0
  11. package/dist/angular/hooks.d.ts +26 -0
  12. package/dist/angular/index.d.ts +8 -0
  13. package/dist/angular/velo-plot.component.d.ts +46 -0
  14. package/dist/angular-hooks.d.ts +1 -0
  15. package/dist/angular-hooks.js +9 -0
  16. package/dist/angular-hooks.js.map +1 -0
  17. package/dist/angular.d.ts +1 -0
  18. package/dist/angular.js +166 -0
  19. package/dist/angular.js.map +1 -0
  20. package/dist/assets/indicator.worker-bv0zC4EX.js.map +1 -1
  21. package/dist/astro/StackedPlot.astro +19 -0
  22. package/dist/astro/VeloPlot.astro +23 -0
  23. package/dist/{axisFormat-CzumxpCL.js → axisFormat-Sz4WIJfQ.js} +2 -2
  24. package/dist/{axisFormat-CzumxpCL.js.map → axisFormat-Sz4WIJfQ.js.map} +1 -1
  25. package/dist/bindings/shared/a11y.d.ts +26 -0
  26. package/dist/bindings/shared/chartLifecycle.d.ts +16 -0
  27. package/dist/bindings/shared/chartSyncBridge.d.ts +8 -0
  28. package/dist/bindings/shared/dimensions.d.ts +1 -0
  29. package/dist/bindings/shared/index.d.ts +9 -0
  30. package/dist/bindings/shared/indicatorBridge.d.ts +11 -0
  31. package/dist/bindings/shared/optionsSync.d.ts +7 -0
  32. package/dist/bindings/shared/seriesDiff.d.ts +8 -0
  33. package/dist/bindings/shared/stackedSync.d.ts +9 -0
  34. package/dist/bindings/shared/types.d.ts +46 -0
  35. package/dist/bindings/test-utils/index.d.ts +35 -0
  36. package/dist/bindings/test-utils/mockLifecycle.d.ts +120 -0
  37. package/dist/bindings/test-utils/vitestSveltePlugin.d.ts +3 -0
  38. package/dist/chartSyncBridge-D_rCtbFq.js +58 -0
  39. package/dist/chartSyncBridge-D_rCtbFq.js.map +1 -0
  40. package/dist/core/Chart.d.ts +1 -1
  41. package/dist/core/ChartStatistics.d.ts +1 -1
  42. package/dist/core/InteractionManager.d.ts +7 -1
  43. package/dist/core/OverlayRenderer.d.ts +5 -0
  44. package/dist/core/annotations/types.d.ts +1 -1
  45. package/dist/core/chart/ChartCore.d.ts +14 -19
  46. package/dist/core/chart/ChartFeatureHooks.d.ts +7 -0
  47. package/dist/core/chart/chartExportPatch.d.ts +2 -0
  48. package/dist/core/chart/overlaySeriesRegistry.d.ts +7 -0
  49. package/dist/core/chart/series/SeriesActions.d.ts +1 -0
  50. package/dist/core/chart/series/SeriesBufferLite.d.ts +13 -0
  51. package/dist/core/chart/series/seriesOptionsRegistry.d.ts +8 -0
  52. package/dist/core/chart/series/seriesTypeRegistry.d.ts +5 -0
  53. package/dist/core/chart/types.d.ts +1 -1
  54. package/dist/core/clipboard/index.d.ts +1 -1
  55. package/dist/core/debug/index.d.ts +1 -1
  56. package/dist/core/keybindings/index.d.ts +1 -1
  57. package/dist/core/loading/index.d.ts +1 -1
  58. package/dist/core/locale/index.d.ts +1 -1
  59. package/dist/core/stacked/paneResize.d.ts +3 -0
  60. package/dist/core/stacked/types.d.ts +10 -0
  61. package/dist/core/theme-editor/index.d.ts +1 -1
  62. package/dist/createStackedChart-DqcLCFGS.js +1338 -0
  63. package/dist/createStackedChart-DqcLCFGS.js.map +1 -0
  64. package/dist/examples/PluginDemonstration.d.ts +1 -1
  65. package/dist/hooks-DH-3bewj.js +69 -0
  66. package/dist/hooks-DH-3bewj.js.map +1 -0
  67. package/dist/{index-BBpJwOct.js → index-0InEyj0q.js} +119 -121
  68. package/dist/index-0InEyj0q.js.map +1 -0
  69. package/dist/{index-qunX30Xu.js → index-B7PTX94B.js} +2133 -2133
  70. package/dist/index-B7PTX94B.js.map +1 -0
  71. package/dist/{index-BMiZoKmm.js → index-BgrvqltV.js} +67 -67
  72. package/dist/index-BgrvqltV.js.map +1 -0
  73. package/dist/{index-DoYxf1cV.js → index-CWxIHdwX.js} +38 -98
  74. package/dist/index-CWxIHdwX.js.map +1 -0
  75. package/dist/index-CaXWSOTk.js.map +1 -1
  76. package/dist/{mockDatafeed-927foCM4.js → index-Cv6ZDLWf.js} +227 -217
  77. package/dist/index-Cv6ZDLWf.js.map +1 -0
  78. package/dist/index-Dag88bW4.js.map +1 -1
  79. package/dist/index-qhscKTDy.js.map +1 -1
  80. package/dist/index.core.d.ts +9 -7
  81. package/dist/index.d.ts +2 -15
  82. package/dist/indicators--eJGmVox.js.map +1 -1
  83. package/dist/optionsSync-QUiN4Inw.js +119 -0
  84. package/dist/optionsSync-QUiN4Inw.js.map +1 -0
  85. package/dist/plugins/3d/index.d.ts +2 -2
  86. package/dist/plugins/3d.d.ts +2 -2
  87. package/dist/plugins/3d.js +3 -1
  88. package/dist/plugins/3d.js.map +1 -1
  89. package/dist/plugins/analysis/index.d.ts +1 -1
  90. package/dist/plugins/analysis/indicators.d.ts +1 -1
  91. package/dist/plugins/analysis.d.ts +2 -2
  92. package/dist/plugins/analysis.js +2 -2
  93. package/dist/plugins/analysis.js.map +1 -1
  94. package/dist/plugins/annotations/index.d.ts +1 -1
  95. package/dist/plugins/annotations.d.ts +2 -2
  96. package/dist/plugins/annotations.js.map +1 -1
  97. package/dist/plugins/anomaly-detection.js +1 -1
  98. package/dist/plugins/anomaly-detection.js.map +1 -1
  99. package/dist/plugins/broken-axis.d.ts +2 -2
  100. package/dist/plugins/builtins/crosshair/CrosshairPlugin.d.ts +1 -1
  101. package/dist/plugins/builtins/index.d.ts +1 -1
  102. package/dist/plugins/caching.d.ts +2 -2
  103. package/dist/plugins/clipboard/index.d.ts +2 -2
  104. package/dist/plugins/clipboard.d.ts +2 -2
  105. package/dist/plugins/clipboard.js.map +1 -1
  106. package/dist/plugins/context-menu/index.d.ts +1 -1
  107. package/dist/plugins/context-menu.d.ts +2 -2
  108. package/dist/plugins/context-menu.js +1 -1
  109. package/dist/plugins/context-menu.js.map +1 -1
  110. package/dist/plugins/createPlugin.d.ts +8 -0
  111. package/dist/plugins/data-export/index.d.ts +1 -1
  112. package/dist/plugins/data-export.d.ts +2 -2
  113. package/dist/plugins/data-export.js +2 -2
  114. package/dist/plugins/data-export.js.map +1 -1
  115. package/dist/plugins/data-transform.d.ts +2 -2
  116. package/dist/plugins/data-transform.js +19 -19
  117. package/dist/plugins/data-transform.js.map +1 -1
  118. package/dist/plugins/debug/index.d.ts +2 -2
  119. package/dist/plugins/debug.d.ts +2 -2
  120. package/dist/plugins/debug.js +33 -33
  121. package/dist/plugins/debug.js.map +1 -1
  122. package/dist/plugins/forecasting/index.d.ts +1 -1
  123. package/dist/plugins/forecasting.js.map +1 -1
  124. package/dist/plugins/gpu/index.d.ts +2 -2
  125. package/dist/plugins/gpu.d.ts +2 -2
  126. package/dist/plugins/gpu.js +2033 -209
  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 +286 -23
  131. package/dist/plugins/i18n.js.map +1 -1
  132. package/dist/plugins/index.d.ts +1 -1
  133. package/dist/plugins/keyboard.d.ts +2 -2
  134. package/dist/plugins/keyboard.js +65 -5
  135. package/dist/plugins/keyboard.js.map +1 -1
  136. package/dist/plugins/latex.js +766 -207
  137. package/dist/plugins/latex.js.map +1 -1
  138. package/dist/plugins/lazy-load.d.ts +2 -2
  139. package/dist/plugins/loading/index.d.ts +2 -3
  140. package/dist/plugins/loading.d.ts +2 -2
  141. package/dist/plugins/loading.js +3 -4
  142. package/dist/plugins/ml-integration.d.ts +2 -2
  143. package/dist/plugins/ml-integration.js +5 -5
  144. package/dist/plugins/ml-integration.js.map +1 -1
  145. package/dist/plugins/offscreen.d.ts +2 -2
  146. package/dist/plugins/offscreen.js +11 -10
  147. package/dist/plugins/offscreen.js.map +1 -1
  148. package/dist/plugins/pattern-recognition.d.ts +2 -2
  149. package/dist/plugins/pattern-recognition.js +1 -1
  150. package/dist/plugins/pattern-recognition.js.map +1 -1
  151. package/dist/plugins/radar.d.ts +2 -2
  152. package/dist/plugins/regression.d.ts +2 -2
  153. package/dist/plugins/regression.js +255 -257
  154. package/dist/plugins/regression.js.map +1 -1
  155. package/dist/plugins/roi.js +9 -9
  156. package/dist/plugins/roi.js.map +1 -1
  157. package/dist/plugins/snapshot/index.d.ts +1 -1
  158. package/dist/plugins/snapshot/types.d.ts +1 -1
  159. package/dist/plugins/snapshot.d.ts +2 -2
  160. package/dist/plugins/snapshot.js.map +1 -1
  161. package/dist/plugins/streaming/index.d.ts +2 -2
  162. package/dist/plugins/streaming.d.ts +2 -2
  163. package/dist/plugins/streaming.js +1 -1
  164. package/dist/plugins/sync/index.d.ts +3 -2
  165. package/dist/plugins/sync.d.ts +2 -2
  166. package/dist/plugins/sync.js.map +1 -1
  167. package/dist/plugins/theme-editor/index.d.ts +1 -1
  168. package/dist/plugins/theme-editor.d.ts +2 -2
  169. package/dist/plugins/tools/index.d.ts +1 -1
  170. package/dist/plugins/tools/tooltip/index.d.ts +1 -1
  171. package/dist/plugins/tools.d.ts +2 -2
  172. package/dist/plugins/tools.js +1 -1
  173. package/dist/plugins/types.d.ts +1 -1
  174. package/dist/plugins/video-recorder.d.ts +2 -2
  175. package/dist/plugins/virtualization.d.ts +2 -2
  176. package/dist/plugins/virtualization.js +1 -1
  177. package/dist/pool-DZ8shSqv.js +109 -0
  178. package/dist/pool-DZ8shSqv.js.map +1 -0
  179. package/dist/react/StackedPlot.d.ts +31 -0
  180. package/dist/react/VeloPlot.d.ts +29 -0
  181. package/dist/react/index.d.ts +25 -3
  182. package/dist/react/useChartSync.d.ts +8 -0
  183. package/dist/react/useIndicator.d.ts +12 -0
  184. package/dist/react/useVeloPlot.d.ts +19 -0
  185. package/dist/react.js +325 -24
  186. package/dist/react.js.map +1 -1
  187. package/dist/renderer/NativeWebGLRenderer.d.ts +2 -1
  188. package/dist/renderer/native/NativeWebGLRenderer.d.ts +5 -1
  189. package/dist/renderer/native/draw.d.ts +2 -47
  190. package/dist/renderer/native/drawCore.d.ts +27 -0
  191. package/dist/renderer/native/drawExtended.d.ts +29 -0
  192. package/dist/renderer/native/frameRenderExtended.d.ts +1 -0
  193. package/dist/renderer/native/frameRenderRegistry.d.ts +27 -0
  194. package/dist/renderer/native/programFactoryCore.d.ts +6 -0
  195. package/dist/renderer/native/programFactoryExtended.d.ts +4 -0
  196. package/dist/renderer/native/utils.d.ts +3 -29
  197. package/dist/renderer/native/utilsCore.d.ts +14 -0
  198. package/dist/renderer/native/utilsExtended.d.ts +17 -0
  199. package/dist/renderer/overlaySeriesExtended.d.ts +1 -0
  200. package/dist/renderer/registerExtendedSeries.d.ts +1 -0
  201. package/dist/renderer/registerWebGPU.d.ts +2 -0
  202. package/dist/renderer/seriesBufferExtended.d.ts +4 -0
  203. package/dist/scientific/index.d.ts +44 -0
  204. package/dist/scientific/registerScientific.d.ts +1 -0
  205. package/dist/scientific.d.ts +1 -0
  206. package/dist/scientific.js +91 -0
  207. package/dist/scientific.js.map +1 -0
  208. package/dist/solid/VeloPlot.d.ts +16 -0
  209. package/dist/solid/index.d.ts +13 -0
  210. package/dist/solid/useChartSync.d.ts +6 -0
  211. package/dist/solid/useIndicator.d.ts +11 -0
  212. package/dist/solid/useStackedPlot.d.ts +14 -0
  213. package/dist/solid/useVeloPlot.d.ts +18 -0
  214. package/dist/solid.d.ts +1 -0
  215. package/dist/solid.js +169 -0
  216. package/dist/solid.js.map +1 -0
  217. package/dist/stackedSync-tnrunZMt.js +100 -0
  218. package/dist/stackedSync-tnrunZMt.js.map +1 -0
  219. package/dist/svelte/StackedPlot.svelte +29 -0
  220. package/dist/svelte/StackedPlot.test.ts +114 -0
  221. package/dist/svelte/VeloPlot.svelte +44 -0
  222. package/dist/svelte/VeloPlot.test.ts +105 -0
  223. package/dist/svelte/index.d.ts +11 -0
  224. package/dist/svelte/index.test.ts +20 -0
  225. package/dist/svelte/index.ts +15 -0
  226. package/dist/svelte/useChartSync.d.ts +8 -0
  227. package/dist/svelte/useChartSync.test.ts +49 -0
  228. package/dist/svelte/useChartSync.ts +29 -0
  229. package/dist/svelte/useIndicator.d.ts +13 -0
  230. package/dist/svelte/useIndicator.test.ts +67 -0
  231. package/dist/svelte/useIndicator.ts +43 -0
  232. package/dist/svelte/useStackedPlot.d.ts +16 -0
  233. package/dist/svelte/useStackedPlot.test.ts +76 -0
  234. package/dist/svelte/useStackedPlot.ts +54 -0
  235. package/dist/svelte/useVeloPlot.d.ts +21 -0
  236. package/dist/svelte/useVeloPlot.test.ts +100 -0
  237. package/dist/svelte/useVeloPlot.ts +81 -0
  238. package/dist/svelte.d.ts +1 -0
  239. package/dist/svelte.js +140 -0
  240. package/dist/svelte.js.map +1 -0
  241. package/dist/testing/index.d.ts +1 -1
  242. package/dist/theme/index.d.ts +2 -1
  243. package/dist/trading/index.d.ts +1 -4
  244. package/dist/trading/registerTrading.d.ts +3 -0
  245. package/dist/trading.js +42 -42
  246. package/dist/types.d.ts +4 -4
  247. package/dist/{utils-BK5UUXxj.js → utils-Dx0h0bgQ.js} +9 -9
  248. package/dist/{utils-BK5UUXxj.js.map → utils-Dx0h0bgQ.js.map} +1 -1
  249. package/dist/velo-plot.full.js +2216 -1346
  250. package/dist/velo-plot.full.js.map +1 -1
  251. package/dist/velo-plot.js +33 -28
  252. package/dist/velo-plot.js.map +1 -1
  253. package/dist/vue/StackedPlot.vue.d.ts +48 -0
  254. package/dist/vue/VeloPlot.vue.d.ts +64 -0
  255. package/dist/vue/index.d.ts +250 -0
  256. package/dist/vue/useChartSync.d.ts +52 -0
  257. package/dist/vue/useIndicator.d.ts +23 -0
  258. package/dist/vue/useStackedPlot.d.ts +15 -0
  259. package/dist/vue/useVeloPlot.d.ts +20 -0
  260. package/dist/vue.d.ts +1 -0
  261. package/dist/vue.js +309 -0
  262. package/dist/vue.js.map +1 -0
  263. package/dist/workers/indicatorsAsync.d.ts +2 -0
  264. package/dist/workers/pool.d.ts +9 -0
  265. package/package.json +96 -10
  266. package/dist/ChartCore-ivzLqxVb.js +0 -8350
  267. package/dist/ChartCore-ivzLqxVb.js.map +0 -1
  268. package/dist/SciPlot-CEU4ApgD.js +0 -463
  269. package/dist/SciPlot-CEU4ApgD.js.map +0 -1
  270. package/dist/createStackedChart-DxNW0VkF.js +0 -705
  271. package/dist/createStackedChart-DxNW0VkF.js.map +0 -1
  272. package/dist/gpuRenderer-BpaMYz-k.js +0 -1848
  273. package/dist/gpuRenderer-BpaMYz-k.js.map +0 -1
  274. package/dist/index-BBpJwOct.js.map +0 -1
  275. package/dist/index-BMiZoKmm.js.map +0 -1
  276. package/dist/index-DoYxf1cV.js.map +0 -1
  277. package/dist/index-qunX30Xu.js.map +0 -1
  278. package/dist/index-x4stH3jD.js +0 -282
  279. package/dist/index-x4stH3jD.js.map +0 -1
  280. package/dist/index.core-COREBDNq.js.map +0 -1
  281. package/dist/mockDatafeed-927foCM4.js.map +0 -1
  282. package/dist/pool-15HMCNv8.js +0 -88
  283. package/dist/pool-15HMCNv8.js.map +0 -1
  284. package/dist/react/SciPlot.d.ts +0 -60
  285. package/dist/react/useSciPlot.d.ts +0 -56
  286. package/dist/symbols-DT0eLlpW.js +0 -568
  287. package/dist/symbols-DT0eLlpW.js.map +0 -1
@@ -0,0 +1,14 @@
1
+ export declare function parseColor(color: string): [number, number, number, number];
2
+ export declare function brightenColor(color: string, isDarkTheme?: boolean): string;
3
+ export declare function interleaveData(x: Float32Array | Float64Array | number[], y: Float32Array | Float64Array | number[]): Float32Array;
4
+ export declare function interleaveStepData(x: Float32Array | Float64Array | number[], y: Float32Array | Float64Array | number[], mode?: "before" | "after" | "center"): Float32Array;
5
+ export declare function interleaveBandData(x: Float32Array | Float64Array | number[], y1: Float32Array | Float64Array | number[], y2: Float32Array | Float64Array | number[]): Float32Array;
6
+ export declare function interleaveErrorData(x: Float32Array | Float64Array | number[], y: Float32Array | Float64Array | number[], yErr?: {
7
+ yError?: Float32Array | Float64Array;
8
+ yErrorMinus?: Float32Array | Float64Array;
9
+ yErrorPlus?: Float32Array | Float64Array;
10
+ }, xErr?: {
11
+ xError?: Float32Array | Float64Array;
12
+ xErrorMinus?: Float32Array | Float64Array;
13
+ xErrorPlus?: Float32Array | Float64Array;
14
+ }): Float32Array;
@@ -0,0 +1,17 @@
1
+ export declare function interleaveBoxPlotData(x: Float32Array | Float64Array | number[], min: Float32Array | Float64Array | number[], q1: Float32Array | Float64Array | number[], median: Float32Array | Float64Array | number[], q3: Float32Array | Float64Array | number[], max: Float32Array | Float64Array | number[], width: number): {
2
+ lines: Float32Array;
3
+ boxes: Float32Array;
4
+ };
5
+ /**
6
+ * Interleave data for Waterfall charts
7
+ * Creates rectangles that show cumulative changes from a running total
8
+ */
9
+ export declare function interleaveWaterfallData(x: Float32Array | Float64Array | number[], y: Float32Array | Float64Array | number[], width: number, isSubtotal?: boolean[]): {
10
+ positiveData: Float32Array;
11
+ negativeData: Float32Array;
12
+ subtotalData: Float32Array;
13
+ connectorData: Float32Array;
14
+ positiveCount: number;
15
+ negativeCount: number;
16
+ subtotalCount: number;
17
+ };
@@ -0,0 +1 @@
1
+ export declare function registerExtendedOverlayDrawers(): void;
@@ -0,0 +1 @@
1
+ export declare function registerExtendedSeries(): void;
@@ -0,0 +1,2 @@
1
+ /** Enable `renderer: 'webgpu'` for charts (extended bundles only). */
2
+ export declare function registerWebGPURenderer(): void;
@@ -0,0 +1,4 @@
1
+ declare const CORE_LITE_TYPES: Set<string>;
2
+ /** Register extended series buffer handlers (call from trading/scientific/full entries). */
3
+ export declare function registerExtendedSeriesBuffers(): void;
4
+ export { CORE_LITE_TYPES };
@@ -0,0 +1,44 @@
1
+
2
+ export { createChart } from '../core/Chart';
3
+ export type { Chart, ChartOptions, ExportOptions } from '../core/Chart';
4
+ export { Series } from '../core/Series';
5
+ export { EventEmitter } from '../core/EventEmitter';
6
+ export { createStackedChart } from '../core/stacked/createStackedChart';
7
+ export type { StackedChart, StackedChartOptions, StackedPaneConfig, } from '../core/stacked/types';
8
+ export { LinearScale, LogScale, createScale, type Scale } from '../scales';
9
+ export { DARK_THEME, LIGHT_THEME, MIDNIGHT_THEME, ELECTROCHEM_THEME, DEFAULT_THEME, createTheme, getThemeByName, type ChartTheme, } from '../theme';
10
+ 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';
11
+ export { downsampleAsync, ohlcDownsampleAsync, destroyDownsamplePool, } from '../workers/downsampleAsync';
12
+ export { rsiAsync, smaAsync, emaAsync, macdAsync, bollingerBandsAsync, destroyIndicatorPool, } from '../workers/indicatorsAsync';
13
+ export { PluginAnalysis } from '../plugins/analysis';
14
+ export type { PluginAnalysisConfig } from '../plugins/analysis';
15
+ export { PluginRegression } from '../plugins/regression';
16
+ export type { PluginRegressionConfig, RegressionAPI, RegressionResult } from '../plugins/regression';
17
+ export { PluginForecasting } from '../plugins/forecasting';
18
+ export type { PluginForecastingConfig } from '../plugins/forecasting';
19
+ export { PluginLaTeX } from '../plugins/latex';
20
+ export type { PluginLaTeXConfig } from '../plugins/latex';
21
+ export { Plugin3D } from '../plugins/3d';
22
+ export type { Plugin3DConfig } from '../plugins/3d';
23
+ export { PluginAnomalyDetection } from '../plugins/anomaly-detection';
24
+ export type { PluginAnomalyDetectionConfig } from '../plugins/anomaly-detection';
25
+ export { PluginPatternRecognition } from '../plugins/pattern-recognition';
26
+ export type { PluginPatternRecognitionConfig } from '../plugins/pattern-recognition';
27
+ export { PluginMLIntegration } from '../plugins/ml-integration';
28
+ export type { PluginMLIntegrationConfig } from '../plugins/ml-integration';
29
+ export { PluginBrokenAxis } from '../plugins/broken-axis';
30
+ export type { PluginBrokenAxisConfig } from '../plugins/broken-axis';
31
+ export { PluginRadar } from '../plugins/radar';
32
+ export type { PluginRadarConfig } from '../plugins/radar';
33
+ export { PluginDataTransform } from '../plugins/data-transform';
34
+ export type { PluginDataTransformConfig } from '../plugins/data-transform';
35
+ export { PluginVirtualization } from '../plugins/virtualization';
36
+ export type { PluginVirtualizationConfig } from '../plugins/virtualization';
37
+ export { PluginSnapshot } from '../plugins/snapshot';
38
+ export type { PluginSnapshotConfig } from '../plugins/snapshot';
39
+ export { PluginAnnotations } from '../plugins/annotations';
40
+ export type { Annotation, AnnotationType } from '../plugins/annotations';
41
+ export { PluginTools } from '../plugins/tools';
42
+ export type { PluginToolsConfig } from '../plugins/tools';
43
+ export { ChartGroup, createChartGroup } from '../core/sync';
44
+ export type { SeriesOptions, SeriesData, AxisOptions, Bounds, SeriesType, } from '../types';
@@ -0,0 +1 @@
1
+ export declare function registerScientificBundle(): void;
@@ -0,0 +1 @@
1
+ export * from './scientific/index'
@@ -0,0 +1,91 @@
1
+ import { E as r } from "./axisFormat-Sz4WIJfQ.js";
2
+ import { b as t, c as s, d as n, e as i, m, r as l, s as c } from "./createStackedChart-DqcLCFGS.js";
3
+ import { D as p, e as g, E as u, d as x, L as P, a as d, M as y, S as E, c as T, b as A, f as S, g as h } from "./ChartCore-AnR_3Xkb.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 B, ifft as R, 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 K } from "./plugins/forecasting.js";
8
+ import { PluginLaTeX as U } from "./plugins/latex.js";
9
+ import { Plugin3D as j } 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-B7PTX94B.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 Sa, f as ha, 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 Ba, s as Ra } from "./math-Ddm2EZjj.js";
22
+ export {
23
+ ua as ChartGroup,
24
+ p as DARK_THEME,
25
+ g as DEFAULT_THEME,
26
+ u as ELECTROCHEM_THEME,
27
+ r as EventEmitter,
28
+ x as LIGHT_THEME,
29
+ P as LinearScale,
30
+ d as LogScale,
31
+ y as MIDNIGHT_THEME,
32
+ j as Plugin3D,
33
+ D as PluginAnalysis,
34
+ ca as PluginAnnotations,
35
+ Q as PluginAnomalyDetection,
36
+ ra as PluginBrokenAxis,
37
+ na as PluginDataTransform,
38
+ K as PluginForecasting,
39
+ U 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
+ E as Series,
48
+ L as analyzeComplexSpectrum,
49
+ v as analyzeSpectrum,
50
+ M as blackmanWindow,
51
+ t as bollingerBandsAsync,
52
+ Ha as calculateR2,
53
+ da as calculateStats,
54
+ T as createChart,
55
+ xa as createChartGroup,
56
+ A as createScale,
57
+ s as createStackedChart,
58
+ S as createTheme,
59
+ Ia as cumulativeIntegral,
60
+ ba as derivative,
61
+ G as destroyDownsamplePool,
62
+ n as destroyIndicatorPool,
63
+ ya as detectCycles,
64
+ Ea as detectPeaks,
65
+ w as dominantFrequency,
66
+ W as downsampleAsync,
67
+ Ta as downsampleLTTB,
68
+ i as emaAsync,
69
+ H as fft,
70
+ I as fftFromComplexInput,
71
+ Aa as formatScientific,
72
+ Sa as formatValue,
73
+ ha as formatWithPrefix,
74
+ Ca as generateCycleColors,
75
+ Da as getBestPrefix,
76
+ h as getThemeByName,
77
+ b as hammingWindow,
78
+ B as hanningWindow,
79
+ R as ifft,
80
+ Ba as integrate,
81
+ m as macdAsync,
82
+ La as movingAverage,
83
+ z as ohlcDownsampleAsync,
84
+ _ as powerSpectrum,
85
+ l as rsiAsync,
86
+ c as smaAsync,
87
+ Ra 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
+ };
@@ -0,0 +1,18 @@
1
+ import { Chart } from '../core/Chart';
2
+ import { SeriesOptions, SeriesUpdateData, ZoomOptions, Bounds } from '../types';
3
+ import { ChartBindingOptions } from '../bindings/shared';
4
+
5
+ export interface UseVeloPlotOptions extends ChartBindingOptions {
6
+ }
7
+ export declare function useVeloPlot(options?: () => UseVeloPlotOptions): {
8
+ setContainerRef: (el: HTMLDivElement | null | undefined) => void;
9
+ chart: import('solid-js').Accessor<Chart | null>;
10
+ isReady: import('solid-js').Accessor<boolean>;
11
+ error: import('solid-js').Accessor<Error | null>;
12
+ bounds: import('solid-js').Accessor<Bounds | null>;
13
+ addSeries: (opts: SeriesOptions) => void;
14
+ updateSeries: (id: string, data: SeriesUpdateData) => void | undefined;
15
+ removeSeries: (id: string) => void | undefined;
16
+ zoom: (z: ZoomOptions) => void | undefined;
17
+ resetZoom: () => void;
18
+ };
@@ -0,0 +1 @@
1
+ export * from './solid/index'
package/dist/solid.js ADDED
@@ -0,0 +1,169 @@
1
+ import { template as I, use as b, effect as P, setStyleProperty as g } from "solid-js/web";
2
+ import { createSignal as f, onCleanup as C, createEffect as y } from "solid-js";
3
+ import { p as w, o as B, s as $, d as A } from "./optionsSync-QUiN4Inw.js";
4
+ import { c as K, a as V, i as p, r as L, b as M } from "./chartSyncBridge-D_rCtbFq.js";
5
+ import { c as z } from "./createStackedChart-DqcLCFGS.js";
6
+ import { s as R, a as G, b as x } from "./stackedSync-tnrunZMt.js";
7
+ function k(e = () => ({})) {
8
+ const [t, l] = f(null), [n, a] = f(!1), [o, u] = f(null), [d, h] = f(null);
9
+ let S, s = null, r = w(e());
10
+ const v = (i) => {
11
+ S = i, s == null || s();
12
+ const c = K(i, e(), {
13
+ onBoundsChange: h,
14
+ onError: u
15
+ });
16
+ l(c.chart), s = c.destroy, h(c.getBounds()), a(!0), r = w(e());
17
+ };
18
+ return C(() => {
19
+ s == null || s(), l(null), a(!1);
20
+ }), y(() => {
21
+ const i = t(), c = e();
22
+ if (!i) return;
23
+ const m = w(c);
24
+ B(r, m) && ($(i, r, m), r = m);
25
+ }), {
26
+ setContainerRef: (i) => {
27
+ i && i !== S && v(i);
28
+ },
29
+ chart: t,
30
+ isReady: n,
31
+ error: o,
32
+ bounds: d,
33
+ addSeries: (i) => {
34
+ var m;
35
+ (m = t()) == null || m.addSeries(i);
36
+ const c = t();
37
+ c && h(c.getViewBounds());
38
+ },
39
+ updateSeries: (i, c) => {
40
+ var m;
41
+ return (m = t()) == null ? void 0 : m.updateSeries(i, c);
42
+ },
43
+ removeSeries: (i) => {
44
+ var c;
45
+ return (c = t()) == null ? void 0 : c.removeSeries(i);
46
+ },
47
+ zoom: (i) => {
48
+ var c;
49
+ return (c = t()) == null ? void 0 : c.zoom(i);
50
+ },
51
+ resetZoom: () => {
52
+ var c;
53
+ (c = t()) == null || c.resetZoom();
54
+ const i = t();
55
+ i && h(i.getViewBounds());
56
+ }
57
+ };
58
+ }
59
+ function N(e) {
60
+ const [t, l] = f(null), [n, a] = f(!1);
61
+ let o = null, u = "", d = /* @__PURE__ */ new Map();
62
+ const h = (s) => {
63
+ o == null || o();
64
+ const r = e(), v = z({ ...r, container: s });
65
+ l(v), o = () => v.destroy(), u = R(r.panes), d = x(v, r.panes, /* @__PURE__ */ new Map()), v.whenReady().then(() => a(!0));
66
+ }, S = (s) => {
67
+ s && h(s);
68
+ };
69
+ return C(() => {
70
+ o == null || o(), l(null), a(!1);
71
+ }), {
72
+ setContainerRef: S,
73
+ stack: t,
74
+ isReady: n,
75
+ fitAll: (s) => {
76
+ var r;
77
+ return (r = t()) == null ? void 0 : r.fitAll(s);
78
+ },
79
+ resetAll: () => {
80
+ var s;
81
+ return (s = t()) == null ? void 0 : s.resetAll();
82
+ },
83
+ sync: () => {
84
+ const s = t(), r = e();
85
+ if (!s || !n()) return;
86
+ if (R(r.panes) !== u) {
87
+ h(s.container);
88
+ return;
89
+ }
90
+ G(s, r), d = x(s, r.panes, d);
91
+ }
92
+ };
93
+ }
94
+ var E = /* @__PURE__ */ I("<div role=img style=position:relative>");
95
+ function O(e) {
96
+ const t = k(() => e);
97
+ let l = /* @__PURE__ */ new Map();
98
+ return y(() => {
99
+ !t.isReady() || !t.chart() || (l = A({
100
+ addSeries: t.addSeries,
101
+ updateSeries: t.updateSeries,
102
+ removeSeries: t.removeSeries,
103
+ autoScale: () => t.chart().autoScale()
104
+ }, e.series ?? [], l));
105
+ }), (() => {
106
+ var n = E();
107
+ return b((a) => t.setContainerRef(a), n), P((a) => {
108
+ var o = `velo-plot-container${e.class ? ` ${e.class}` : ""}`, u = typeof e.width == "number" ? `${e.width}px` : e.width ?? "100%", d = typeof e.height == "number" ? `${e.height}px` : e.height ?? "400px";
109
+ return o !== a.e && (n.className = a.e = o), u !== a.t && g(n, "width", a.t = u), d !== a.a && g(n, "height", a.a = d), a;
110
+ }, {
111
+ e: void 0,
112
+ t: void 0,
113
+ a: void 0
114
+ }), n;
115
+ })();
116
+ }
117
+ function J(e) {
118
+ const t = N(() => e);
119
+ return y(() => t.sync()), (() => {
120
+ var l = E();
121
+ return b((n) => t.setContainerRef(n), l), P((n) => {
122
+ var a = `velo-plot-stacked${e.class ? ` ${e.class}` : ""}`, o = typeof e.width == "number" ? `${e.width}px` : e.width ?? "100%", u = typeof e.height == "number" ? `${e.height}px` : e.height ?? "480px";
123
+ return a !== n.e && (l.className = n.e = a), o !== n.t && g(l, "width", n.t = o), u !== n.a && g(l, "height", n.a = u), n;
124
+ }, {
125
+ e: void 0,
126
+ t: void 0,
127
+ a: void 0
128
+ }), l;
129
+ })();
130
+ }
131
+ function Q(e, t, l = {}) {
132
+ const [n, a] = f(null), [o, u] = f(!1), [d, h] = f(null);
133
+ return y(() => {
134
+ const S = e();
135
+ if (!S) return;
136
+ let s = !1;
137
+ u(!0), V(S, t, l).then((r) => {
138
+ s || (a(r), u(!1));
139
+ }).catch((r) => {
140
+ s || (h(r instanceof Error ? r : new Error(String(r))), u(!1));
141
+ }), C(() => {
142
+ s = !0;
143
+ const r = n();
144
+ r && !p(S) && L(S, r.id);
145
+ });
146
+ }), { result: n, isLoading: o, error: d };
147
+ }
148
+ function Z(e, t) {
149
+ const [l, n] = f(null);
150
+ return y(() => {
151
+ const a = e();
152
+ let o = null;
153
+ a.length >= 2 ? (o = M(a, t), n(o.group)) : n(null), C(() => o == null ? void 0 : o.destroy());
154
+ }), { group: l };
155
+ }
156
+ const U = Z, W = O, X = k, Y = k;
157
+ export {
158
+ W as SciPlot,
159
+ J as StackedPlot,
160
+ O as VeloPlot,
161
+ U as useChartGroup,
162
+ Z as useChartSync,
163
+ Q as useIndicator,
164
+ Y as useSciChart,
165
+ X as useSciPlot,
166
+ N as useStackedPlot,
167
+ k as useVeloPlot
168
+ };
169
+ //# sourceMappingURL=solid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solid.js","sources":["../src/solid/useVeloPlot.ts","../src/solid/useStackedPlot.ts","../src/solid/VeloPlot.tsx","../src/solid/useIndicator.ts","../src/solid/useChartSync.ts","../src/solid/index.ts"],"sourcesContent":["import { createSignal, onCleanup, createEffect } from \"solid-js\";\nimport type { Chart } from \"../core/Chart\";\nimport type { SeriesOptions, SeriesUpdateData, ZoomOptions, Bounds } 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 function useVeloPlot(options: () => UseVeloPlotOptions = () => ({})) {\n const [chart, setChart] = createSignal<Chart | null>(null);\n const [isReady, setIsReady] = createSignal(false);\n const [error, setError] = createSignal<Error | null>(null);\n const [bounds, setBounds] = createSignal<Bounds | null>(null);\n let container: HTMLDivElement | undefined;\n let destroy: (() => void) | null = null;\n let prevSync = pickSyncableOptions(options());\n\n const mount = (el: HTMLDivElement) => {\n container = el;\n destroy?.();\n const handle = createChartLifecycle(el, options(), {\n onBoundsChange: setBounds,\n onError: setError,\n });\n setChart(handle.chart);\n destroy = handle.destroy;\n setBounds(handle.getBounds());\n setIsReady(true);\n prevSync = pickSyncableOptions(options());\n };\n\n onCleanup(() => {\n destroy?.();\n setChart(null);\n setIsReady(false);\n });\n\n createEffect(() => {\n const c = chart();\n const opts = options();\n if (!c) return;\n const next = pickSyncableOptions(opts);\n if (optionsChanged(prevSync, next)) {\n syncChartOptions(c, prevSync, next);\n prevSync = next;\n }\n });\n\n return {\n setContainerRef: (el: HTMLDivElement | null | undefined) => {\n if (el && el !== container) mount(el);\n },\n chart,\n isReady,\n error,\n bounds,\n addSeries: (opts: SeriesOptions) => {\n chart()?.addSeries(opts);\n const c = chart();\n if (c) setBounds(c.getViewBounds());\n },\n updateSeries: (id: string, data: SeriesUpdateData) => chart()?.updateSeries(id, data),\n removeSeries: (id: string) => chart()?.removeSeries(id),\n zoom: (z: ZoomOptions) => chart()?.zoom(z),\n resetZoom: () => {\n chart()?.resetZoom();\n const c = chart();\n if (c) setBounds(c.getViewBounds());\n },\n };\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createStackedChart } from \"../core/stacked\";\nimport type { StackedChart, StackedChartOptions } from \"../core/stacked\";\nimport type { Range } from \"../types\";\nimport { stackedStructureKey, syncStackedOptions, syncStackedPaneSeries } from \"../bindings/shared\";\nimport type { VeloPlotSeries } from \"../bindings/shared\";\n\nexport function useStackedPlot(getOptions: () => Omit<StackedChartOptions, \"container\">) {\n const [stack, setStack] = createSignal<StackedChart | null>(null);\n const [isReady, setIsReady] = createSignal(false);\n let destroy: (() => void) | null = null;\n let structureKey = \"\";\n let paneSeries = new Map<string, Map<string, VeloPlotSeries>>();\n\n const mount = (el: HTMLDivElement) => {\n destroy?.();\n const opts = getOptions();\n const created = createStackedChart({ ...opts, container: el });\n setStack(created);\n destroy = () => created.destroy();\n structureKey = stackedStructureKey(opts.panes);\n paneSeries = syncStackedPaneSeries(created, opts.panes, new Map());\n created.whenReady().then(() => setIsReady(true));\n };\n\n const setContainerRef = (el: HTMLDivElement | null | undefined) => {\n if (el) mount(el);\n };\n\n onCleanup(() => {\n destroy?.();\n setStack(null);\n setIsReady(false);\n });\n\n return {\n setContainerRef,\n stack,\n isReady,\n fitAll: (opts?: { x?: Range; padding?: number }) => stack()?.fitAll(opts),\n resetAll: () => stack()?.resetAll(),\n sync: () => {\n const s = stack();\n const opts = getOptions();\n if (!s || !isReady()) return;\n const nextKey = stackedStructureKey(opts.panes);\n if (nextKey !== structureKey) {\n mount(s.container);\n return;\n }\n syncStackedOptions(s, opts);\n paneSeries = syncStackedPaneSeries(s, opts.panes, paneSeries);\n },\n };\n}\n","import { createEffect } from \"solid-js\";\nimport { useVeloPlot, type UseVeloPlotOptions } from \"./useVeloPlot\";\nimport { useStackedPlot } from \"./useStackedPlot\";\nimport { diffSeries, type VeloPlotSeries } from \"../bindings/shared\";\n\nexport interface VeloPlotProps extends UseVeloPlotOptions {\n series?: VeloPlotSeries[];\n width?: number | string;\n height?: number | string;\n class?: string;\n}\n\nexport function VeloPlot(props: VeloPlotProps) {\n const api = useVeloPlot(() => props);\n let previous = new Map<string, VeloPlotSeries>();\n\n createEffect(() => {\n if (!api.isReady() || !api.chart()) return;\n previous = diffSeries(\n {\n addSeries: api.addSeries,\n updateSeries: api.updateSeries,\n removeSeries: api.removeSeries,\n autoScale: () => api.chart()!.autoScale(),\n },\n props.series ?? [],\n previous,\n );\n });\n\n return (\n <div\n ref={(el) => api.setContainerRef(el)}\n className={`velo-plot-container${props.class ? ` ${props.class}` : \"\"}`}\n role=\"img\"\n style={{\n position: \"relative\",\n width: typeof props.width === \"number\" ? `${props.width}px` : props.width ?? \"100%\",\n height: typeof props.height === \"number\" ? `${props.height}px` : props.height ?? \"400px\",\n }}\n />\n );\n}\n\nexport function StackedPlot(\n props: {\n panes: import(\"../core/stacked\").StackedPaneConfig[];\n width?: number | string;\n height?: number | string;\n class?: string;\n } & Omit<import(\"../core/stacked\").StackedChartOptions, \"container\" | \"panes\">,\n) {\n const api = useStackedPlot(() => props);\n createEffect(() => api.sync());\n\n return (\n <div\n ref={(el) => api.setContainerRef(el)}\n className={`velo-plot-stacked${props.class ? ` ${props.class}` : \"\"}`}\n role=\"img\"\n style={{\n position: \"relative\",\n width: typeof props.width === \"number\" ? `${props.width}px` : props.width ?? \"100%\",\n height: typeof props.height === \"number\" ? `${props.height}px` : props.height ?? \"480px\",\n }}\n />\n );\n}\n","import { createSignal, createEffect, onCleanup } from \"solid-js\";\nimport type { AddIndicatorOptions, AddIndicatorResult } from \"../core/indicator/addIndicator\";\nimport type { IndicatorPresetName } from \"../core/indicator/indicatorPresets\";\nimport { addIndicatorToHost, isStackedChart, removeIndicatorFromChart, type IndicatorHost } from \"../bindings/shared\";\nimport type { Chart } from \"../core/chart/types\";\n\nexport function useIndicator(\n host: () => IndicatorHost,\n preset: IndicatorPresetName,\n options: AddIndicatorOptions = {},\n) {\n const [result, setResult] = createSignal<(AddIndicatorResult & { paneId?: string }) | null>(null);\n const [isLoading, setIsLoading] = createSignal(false);\n const [error, setError] = createSignal<Error | null>(null);\n\n createEffect(() => {\n const h = host();\n if (!h) return;\n let cancelled = false;\n setIsLoading(true);\n addIndicatorToHost(h, preset, options)\n .then((res) => {\n if (!cancelled) {\n setResult(res);\n setIsLoading(false);\n }\n })\n .catch((e) => {\n if (!cancelled) {\n setError(e instanceof Error ? e : new Error(String(e)));\n setIsLoading(false);\n }\n });\n onCleanup(() => {\n cancelled = true;\n const res = result();\n if (res && !isStackedChart(h)) removeIndicatorFromChart(h as Chart, res.id);\n });\n });\n\n return { result, isLoading, error };\n}\n","import { createSignal, createEffect, onCleanup } from \"solid-js\";\nimport type { ChartLike, SyncOptions } from \"../core/sync\";\nimport { ChartGroup } from \"../core/sync\";\nimport { createChartSync } from \"../bindings/shared\";\n\nexport function useChartSync(charts: () => ChartLike[], options?: SyncOptions) {\n const [group, setGroup] = createSignal<ChartGroup | null>(null);\n\n createEffect(() => {\n const list = charts();\n let handle: ReturnType<typeof createChartSync> | null = null;\n if (list.length >= 2) {\n handle = createChartSync(list, options);\n setGroup(handle.group);\n } else {\n setGroup(null);\n }\n onCleanup(() => handle?.destroy());\n });\n\n return { group };\n}\n\nexport const useChartGroup = useChartSync;\n","export { VeloPlot, StackedPlot } from \"./VeloPlot\";\nexport { useVeloPlot, type UseVeloPlotOptions } from \"./useVeloPlot\";\nexport { useStackedPlot } from \"./useStackedPlot\";\nexport { useIndicator } from \"./useIndicator\";\nexport { useChartSync, useChartGroup } from \"./useChartSync\";\n\nimport { VeloPlot as VeloPlotImpl } from \"./VeloPlot\";\nimport { useVeloPlot as useVeloPlotImpl } from \"./useVeloPlot\";\n\n/** @deprecated Use `VeloPlot` instead. **Removed in v4.0.** */\nexport const SciPlot = VeloPlotImpl;\n/** @deprecated Use `useVeloPlot` instead. **Removed in v4.0.** */\nexport const useSciPlot = useVeloPlotImpl;\n/** @deprecated Use `useVeloPlot` instead. **Removed in v4.0.** */\nexport const useSciChart = useVeloPlotImpl;\n"],"names":["useVeloPlot","options","chart","setChart","createSignal","isReady","setIsReady","error","setError","bounds","setBounds","container","destroy","prevSync","pickSyncableOptions","mount","el","handle","createChartLifecycle","onCleanup","createEffect","c","opts","next","optionsChanged","syncChartOptions","_a","id","data","z","useStackedPlot","getOptions","stack","setStack","structureKey","paneSeries","created","createStackedChart","stackedStructureKey","syncStackedPaneSeries","setContainerRef","syncStackedOptions","VeloPlot","props","api","previous","Map","diffSeries","addSeries","updateSeries","removeSeries","autoScale","series","_el$","_tmpl$","_$use","_$effect","_p$","_v$","class","_v$2","width","_v$3","height","e","className","t","_$setStyleProperty","a","undefined","StackedPlot","sync","_el$2","_v$4","_v$5","_v$6","useIndicator","host","preset","result","setResult","isLoading","setIsLoading","h","cancelled","addIndicatorToHost","res","isStackedChart","removeIndicatorFromChart","useChartSync","charts","group","setGroup","list","createChartSync","useChartGroup","SciPlot","VeloPlotImpl","useSciPlot","useVeloPlotImpl","useSciChart"],"mappings":";;;;;;AAaO,SAASA,EAAYC,IAAoC,OAAO,CAAA,IAAK;AAC1E,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAA2B,IAAI,GACnD,CAACC,GAASC,CAAU,IAAIF,EAAa,EAAK,GAC1C,CAACG,GAAOC,CAAQ,IAAIJ,EAA2B,IAAI,GACnD,CAACK,GAAQC,CAAS,IAAIN,EAA4B,IAAI;AAC5D,MAAIO,GACAC,IAA+B,MAC/BC,IAAWC,EAAoBb,GAAS;AAE5C,QAAMc,IAAQ,CAACC,MAAuB;AACpC,IAAAL,IAAYK,GACZJ,KAAA,QAAAA;AACA,UAAMK,IAASC,EAAqBF,GAAIf,EAAA,GAAW;AAAA,MACjD,gBAAgBS;AAAA,MAChB,SAASF;AAAA,IAAA,CACV;AACD,IAAAL,EAASc,EAAO,KAAK,GACrBL,IAAUK,EAAO,SACjBP,EAAUO,EAAO,WAAW,GAC5BX,EAAW,EAAI,GACfO,IAAWC,EAAoBb,GAAS;AAAA,EAC1C;AAEA,SAAAkB,EAAU,MAAM;AACd,IAAAP,KAAA,QAAAA,KACAT,EAAS,IAAI,GACbG,EAAW,EAAK;AAAA,EAClB,CAAC,GAEDc,EAAa,MAAM;AACjB,UAAMC,IAAInB,EAAA,GACJoB,IAAOrB,EAAA;AACb,QAAI,CAACoB,EAAG;AACR,UAAME,IAAOT,EAAoBQ,CAAI;AACrC,IAAIE,EAAeX,GAAUU,CAAI,MAC/BE,EAAiBJ,GAAGR,GAAUU,CAAI,GAClCV,IAAWU;AAAA,EAEf,CAAC,GAEM;AAAA,IACL,iBAAiB,CAACP,MAA0C;AAC1D,MAAIA,KAAMA,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O,SAASkF,EAAaC,GAA2BzF,GAAuB;AAC7E,QAAM,CAAC0F,GAAOC,CAAQ,IAAIxF,EAAgC,IAAI;AAE9D,SAAAgB,EAAa,MAAM;AACjB,UAAMyE,IAAOH,EAAA;AACb,QAAIzE,IAAoD;AACxD,IAAI4E,EAAK,UAAU,KACjB5E,IAAS6E,EAAgBD,GAAM5F,CAAO,GACtC2F,EAAS3E,EAAO,KAAK,KAErB2E,EAAS,IAAI,GAEfzE,EAAU,MAAMF,KAAA,gBAAAA,EAAQ,SAAS;AAAA,EACnC,CAAC,GAEM,EAAE,OAAA0E,EAAA;AACX;AAEO,MAAMI,IAAgBN,GCbhBO,IAAUC,GAEVC,IAAaC,GAEbC,IAAcD;"}
@@ -0,0 +1,100 @@
1
+ import { d as w, v as x } from "./optionsSync-QUiN4Inw.js";
2
+ function P(i) {
3
+ return i.map(
4
+ (t) => `${t.id}:${t.height}:${t.showXAxis ?? ""}:${t.showYAxis ?? ""}`
5
+ ).join("|");
6
+ }
7
+ function b(i, t) {
8
+ if (t !== void 0)
9
+ for (const d of i.getPanes())
10
+ d.setTheme(t);
11
+ }
12
+ function g(i, t) {
13
+ if (t === !1) {
14
+ i.setSyncAxis("none");
15
+ return;
16
+ }
17
+ t === !0 || t === void 0 || i.setSyncOptions(t);
18
+ }
19
+ function k(i, t, d) {
20
+ var s;
21
+ const r = /* @__PURE__ */ new Map();
22
+ for (const a of t) {
23
+ const o = i.getPane(a.id);
24
+ if (!o || !((s = a.series) != null && s.length)) {
25
+ r.set(a.id, /* @__PURE__ */ new Map());
26
+ continue;
27
+ }
28
+ const c = a.series.map((e) => {
29
+ var n, f, y, p, h, S, m;
30
+ if (e.type === "candlestick" && e.data)
31
+ return {
32
+ id: e.id,
33
+ type: "candlestick",
34
+ x: e.data.x,
35
+ open: e.data.open,
36
+ high: e.data.high,
37
+ low: e.data.low,
38
+ close: e.data.close,
39
+ color: (n = e.style) == null ? void 0 : n.color,
40
+ width: (f = e.style) == null ? void 0 : f.width,
41
+ visible: e.visible,
42
+ name: e.name
43
+ };
44
+ if (e.type === "bar" && e.data)
45
+ return {
46
+ id: e.id,
47
+ type: "bar",
48
+ x: e.data.x,
49
+ y: e.data.y,
50
+ color: (y = e.style) == null ? void 0 : y.color,
51
+ width: (p = e.style) == null ? void 0 : p.width,
52
+ visible: e.visible,
53
+ name: e.name
54
+ };
55
+ if (e.type === "heatmap" && e.data) {
56
+ const l = e.data;
57
+ return {
58
+ id: e.id,
59
+ type: "heatmap",
60
+ data: {
61
+ xValues: l.xValues,
62
+ yValues: l.yValues,
63
+ zValues: l.zValues
64
+ },
65
+ color: (h = e.style) == null ? void 0 : h.color,
66
+ visible: e.visible,
67
+ name: e.name
68
+ };
69
+ }
70
+ return {
71
+ id: e.id,
72
+ type: "line",
73
+ x: e.data.x,
74
+ y: e.data.y,
75
+ color: (S = e.style) == null ? void 0 : S.color,
76
+ width: (m = e.style) == null ? void 0 : m.width,
77
+ visible: e.visible,
78
+ name: e.name
79
+ };
80
+ }), u = d.get(a.id) ?? /* @__PURE__ */ new Map(), v = {
81
+ addSeries: (e) => o.addSeries(e),
82
+ updateSeries: (e, n) => o.updateSeries(e, n),
83
+ removeSeries: (e) => o.removeSeries(e),
84
+ autoScale: () => o.autoScale()
85
+ };
86
+ if (r.set(a.id, w(v, c, u)), u.size === 0 && a.series.length > 0)
87
+ for (const e of a.series)
88
+ o.getAllSeries().some((n) => n.getId() === e.id) || o.addSeries(x(c.find((n) => n.id === e.id)));
89
+ }
90
+ return r;
91
+ }
92
+ function z(i, t) {
93
+ b(i, t.theme), g(i, t.sync), t.gap !== void 0 && i.resize();
94
+ }
95
+ export {
96
+ z as a,
97
+ k as b,
98
+ P as s
99
+ };
100
+ //# sourceMappingURL=stackedSync-tnrunZMt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stackedSync-tnrunZMt.js","sources":["../src/bindings/shared/stackedSync.ts"],"sourcesContent":["/**\n * Stacked chart option sync without full remount when possible.\n */\n\nimport type { StackedChart, StackedChartOptions } from \"../../core/stacked/types\";\nimport type { StackedPaneConfig } from \"../../core/stacked/types\";\nimport { diffSeries } from \"./seriesDiff\";\nimport type { VeloPlotSeries } from \"./types\";\nimport { veloPlotSeriesToOptions } from \"./seriesDiff\";\n\nexport type SyncableStackedOptions = Omit<StackedChartOptions, \"container\">;\n\nexport function stackedStructureKey(panes: StackedPaneConfig[]): string {\n return panes\n .map(\n (p) =>\n `${p.id}:${p.height}:${p.showXAxis ?? \"\"}:${p.showYAxis ?? \"\"}`,\n )\n .join(\"|\");\n}\n\nexport function syncStackedTheme(\n stack: StackedChart,\n theme: StackedChartOptions[\"theme\"],\n): void {\n if (theme === undefined) return;\n for (const pane of stack.getPanes()) {\n pane.setTheme(theme);\n }\n}\n\nexport function syncStackedSyncOptions(\n stack: StackedChart,\n sync: StackedChartOptions[\"sync\"],\n): void {\n if (sync === false) {\n stack.setSyncAxis(\"none\");\n return;\n }\n if (sync === true || sync === undefined) return;\n stack.setSyncOptions(sync);\n}\n\nexport function syncStackedPaneSeries(\n stack: StackedChart,\n panes: StackedPaneConfig[],\n previousSeries: Map<string, Map<string, VeloPlotSeries>>,\n): Map<string, Map<string, VeloPlotSeries>> {\n const next = new Map<string, Map<string, VeloPlotSeries>>();\n\n for (const pane of panes) {\n const chart = stack.getPane(pane.id);\n if (!chart || !pane.series?.length) {\n next.set(pane.id, new Map());\n continue;\n }\n\n const asVeloPlot: VeloPlotSeries[] = pane.series.map((s) => {\n if (s.type === \"candlestick\" && s.data) {\n return {\n id: s.id,\n type: \"candlestick\" as const,\n x: s.data.x,\n open: s.data.open!,\n high: s.data.high!,\n low: s.data.low!,\n close: s.data.close!,\n color: s.style?.color,\n width: s.style?.width,\n visible: s.visible,\n name: s.name,\n };\n }\n if (s.type === \"bar\" && s.data) {\n return {\n id: s.id,\n type: \"bar\" as const,\n x: s.data.x,\n y: s.data.y,\n color: s.style?.color,\n width: s.style?.width,\n visible: s.visible,\n name: s.name,\n };\n }\n if (s.type === \"heatmap\" && s.data) {\n const hd = s.data as unknown as import(\"../../types\").HeatmapData;\n return {\n id: s.id,\n type: \"heatmap\" as const,\n data: {\n xValues: hd.xValues,\n yValues: hd.yValues,\n zValues: hd.zValues,\n },\n color: s.style?.color,\n visible: s.visible,\n name: s.name,\n };\n }\n return {\n id: s.id,\n type: \"line\" as const,\n x: s.data.x,\n y: s.data.y,\n color: s.style?.color,\n width: s.style?.width,\n visible: s.visible,\n name: s.name,\n };\n });\n\n const prev = previousSeries.get(pane.id) ?? new Map();\n const actions = {\n addSeries: (opts: Parameters<typeof chart.addSeries>[0]) =>\n chart.addSeries(opts),\n updateSeries: (id: string, data: Parameters<typeof chart.updateSeries>[1]) =>\n chart.updateSeries(id, data),\n removeSeries: (id: string) => chart.removeSeries(id),\n autoScale: () => chart.autoScale(),\n };\n next.set(pane.id, diffSeries(actions, asVeloPlot, prev));\n\n // Also handle initial series from StackedPaneConfig on first mount\n if (prev.size === 0 && pane.series.length > 0) {\n for (const s of pane.series) {\n if (!chart.getAllSeries().some((existing) => existing.getId() === s.id)) {\n chart.addSeries(veloPlotSeriesToOptions(asVeloPlot.find((x) => x.id === s.id)!));\n }\n }\n }\n }\n\n return next;\n}\n\nexport function syncStackedOptions(\n stack: StackedChart,\n options: SyncableStackedOptions,\n): void {\n syncStackedTheme(stack, options.theme);\n syncStackedSyncOptions(stack, options.sync);\n if (options.gap !== undefined) {\n stack.resize();\n }\n}\n"],"names":["stackedStructureKey","panes","p","syncStackedTheme","stack","theme","pane","syncStackedSyncOptions","sync","syncStackedPaneSeries","previousSeries","next","chart","_a","asVeloPlot","s","_b","_c","_d","hd","_e","_f","_g","prev","actions","opts","id","data","diffSeries","existing","veloPlotSeriesToOptions","x","syncStackedOptions","options"],"mappings":";AAYO,SAASA,EAAoBC,GAAoC;AACtE,SAAOA,EACJ;AAAA,IACC,CAACC,MACC,GAAGA,EAAE,EAAE,IAAIA,EAAE,MAAM,IAAIA,EAAE,aAAa,EAAE,IAAIA,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AAKT,EAAK;AACnB,QAAKM,EAAM,aAAA,EAAe,KAAK,CAACiB,MAAaA,EAAS,MAAA,MAAYd,EAAE,EAAE,KACpEH,EAAM,UAAUkB,EAAwBhB,EAAW,KAAK,CAACiB,MAAMA,EAAE,OAAOhB,EAAE,EAAE,CAAE,CAAC;AAAA,EAIvF;AAEA,SAAOJ;AACT;AAEO,SAASqB,EACd5B,GACA6B,GACM;AACN,EAAA9B,EAAiBC,GAAO6B,EAAQ,KAAK,GACrC1B,EAAuBH,GAAO6B,EAAQ,IAAI,GACtCA,EAAQ,QAAQ,UAClB7B,EAAM,OAAA;AAEV;"}
@@ -0,0 +1,29 @@
1
+ <script lang="ts">
2
+ import { onMount, onDestroy } from "svelte";
3
+ import { createStackedPlot } from "./useStackedPlot";
4
+ import type { StackedChartOptions } from "../core/stacked";
5
+
6
+ export let panes: StackedChartOptions["panes"];
7
+ export let width: number | string = "100%";
8
+ export let height: number | string = 480;
9
+ export let stackOptions: Omit<StackedChartOptions, "container" | "panes"> = {};
10
+ let className = "";
11
+ export { className as class };
12
+
13
+ const api = createStackedPlot({ panes, ...stackOptions });
14
+ let container: HTMLDivElement;
15
+
16
+ onMount(() => api.mount(container));
17
+ onDestroy(() => api.unmount());
18
+
19
+ $: api.sync({ panes, ...stackOptions });
20
+ </script>
21
+
22
+ <div
23
+ bind:this={container}
24
+ class={`velo-plot-stacked${className ? ` ${className}` : ""}`}
25
+ role="img"
26
+ style:position="relative"
27
+ style:width={typeof width === "number" ? `${width}px` : width}
28
+ style:height={typeof height === "number" ? `${height}px` : height}
29
+ />