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
@@ -1,211 +1,1597 @@
1
- var xe = Object.defineProperty;
2
- var ve = (n, e, t) => e in n ? xe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var Y = (n, e, t) => ve(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { D as ee, j as O, s as te, O as Pe } from "./ChartCore-ivzLqxVb.js";
5
- import { A as St, C as Tt, l as bt, G as At, f as Mt, E as Ct, L as Ft, u as Dt, z as Et, N as It, a5 as Lt, H as kt, S as Rt, U as Xt, a as Yt, Z as Bt, a0 as _t, b as Gt, g as Wt, a3 as zt, K as Ut, e as $t, d as Ot, a1 as Ht, c as qt, $ as Nt, N as Vt, a4 as Kt, v as jt, B as Jt, J as Qt, P as Zt, _ as en, a2 as tn, k as nn, X as an, I as on, p as rn, o as sn, F as ln, x as cn, Y as dn, n as un, m as fn, y as gn, q as pn, t as hn, V as mn, W as yn, Q as xn, R as vn, T as Pn, w as wn } from "./ChartCore-ivzLqxVb.js";
6
- import { E as Tn, c as bn, b as An, f as Mn, i as Cn, a as Fn, m as Dn } from "./axisFormat-CzumxpCL.js";
7
- import { AnnotationManager as In, PluginAnnotations as Ln } from "./plugins/annotations.js";
8
- import { d as G } from "./index.core-COREBDNq.js";
9
- import { e as Rn, h as Xn, f as Yn, c as Bn, a as _n, g as Gn, b as Wn, l as zn, r as Un, v as $n } from "./index.core-COREBDNq.js";
10
- import { G as Hn, S as qn, a as Nn, W as Vn, c as Kn, p as jn } from "./gpuRenderer-BpaMYz-k.js";
11
- import { P as Qn, a as Zn, T as ea, g as ta } from "./index-qunX30Xu.js";
12
- import { P as aa, c as oa, e as ra, d as ia, g as sa, a as la, l as ca, m as da, b as ua, o as fa, s as ga, u as pa } from "./index-BBpJwOct.js";
13
- import { W as ma, n as ya } from "./pool-15HMCNv8.js";
14
- import { PluginAnalysis as va, analyzeComplexSpectrum as Pa, analyzeSpectrum as wa, arraysToComplex as Sa, autoCorrelation as Ta, bandPassFilter as ba, bandStopFilter as Aa, blackmanWindow as Ma, butterworth as Ca, complexToArrays as Fa, crossCorrelation as Da, detectAnomalies as Ea, dominantFrequency as Ia, exponentialMovingAverage as La, fft as ka, fftFromComplexInput as Ra, gaussianSmooth as Xa, generateContours as Ya, getPositiveFrequencies as Ba, hammingWindow as _a, hanningWindow as Ga, highPassFilter as Wa, ifft as za, ifftComplex as Ua, ifftFromArrays as $a, joinSegments as Oa, lowPassFilter as Ha, medianFilter as qa, nextPowerOf2 as Na, powerSpectrum as Va, savitzkyGolay as Ka, simpsonsIntegration as ja, singleFrequencyFilter as Ja, tTest as Qa, trapezoidalIntegration as Za } from "./plugins/analysis.js";
15
- import { B as to, C as no, P as ao, a as oo, e as ro, g as io, b as so, d as lo, f as co, c as uo } from "./index-BMiZoKmm.js";
16
- import { S as go, u as po } from "./SciPlot-CEU4ApgD.js";
17
- import "react";
18
- import { a as mo, S as yo, c as xo } from "./createStackedChart-DxNW0VkF.js";
19
- import { BaseBufferStore as Po, BaseTextureStore as wo, GpuBenchmark as So, GpuCompute as To, PipelineCache as bo, PluginGpu as Ao } from "./plugins/gpu.js";
20
- import { b as Co, L as Fo, a as Do, c as Eo, f as Io, d as Lo, e as ko, i as Ro, g as Xo, h as Yo, r as Bo, s as _o } from "./index-x4stH3jD.js";
21
- import { D as Wo, K as zo, P as Uo, c as $o, p as Oo } from "./index-DoYxf1cV.js";
22
- import { ClipboardManager as qo, PluginClipboard as No, copyToClipboard as Vo, formatData as Ko, getClipboardManager as jo } from "./plugins/clipboard.js";
23
- import { DebugOverlay as Qo, PluginDebug as Zo, createDebugOverlay as er, enableDebugMode as tr } from "./plugins/debug.js";
24
- import { L as ar, P as or, c as rr, s as ir, a as sr } from "./index-qhscKTDy.js";
25
- import { C as cr, c as dr, a as ur, l as fr } from "./index-CaXWSOTk.js";
26
- import { P as pr, a as hr, b as mr, c as yr } from "./mockDatafeed-927foCM4.js";
27
- import { P as vr, b as Pr, T as wr, c as Sr, a as Tr, g as br } from "./index-Dag88bW4.js";
28
- import { c as Mr, a as Cr, b as Fr, d as Dr, h as Er, e as Ir, f as Lr, g as kr, i as Rr, m as Xr, s as Yr, v as Br } from "./utils-BK5UUXxj.js";
29
- import { a as Gr, c as Wr, d as zr, i as Ur, s as $r } from "./math-Ddm2EZjj.js";
30
- import { i as Hr, j as qr, g as Nr, f as Vr, k as Kr, d as jr, e as Jr, m as Qr, c as Zr, n as ei, o as ti, p as ni, b as ai, r as oi, s as ri, h as ii, a as si, t as li, v as ci, w as di } from "./indicators--eJGmVox.js";
31
- import { Plugin3D as fi } from "./plugins/3d.js";
32
- import { PluginI18n as pi } from "./plugins/i18n.js";
33
- import { PluginSync as mi } from "./plugins/sync.js";
34
- import { PluginDataExport as xi } from "./plugins/data-export.js";
35
- import { PluginContextMenu as Pi } from "./plugins/context-menu.js";
36
- import { PluginAnomalyDetection as Si } from "./plugins/anomaly-detection.js";
37
- import { PluginMLIntegration as bi } from "./plugins/ml-integration.js";
38
- import { PluginPatternRecognition as Mi } from "./plugins/pattern-recognition.js";
39
- import { PluginRegression as Fi } from "./plugins/regression.js";
40
- import { PluginRadar as Ei } from "./plugins/radar.js";
41
- import { PluginSnapshot as Li } from "./plugins/snapshot.js";
42
- import { PluginDataTransform as Ri } from "./plugins/data-transform.js";
43
- import { PluginLaTeX as Yi } from "./plugins/latex.js";
44
- import { PluginCaching as _i } from "./plugins/caching.js";
45
- import { PluginLazyLoad as Wi } from "./plugins/lazy-load.js";
46
- import { PluginBrokenAxis as Ui } from "./plugins/broken-axis.js";
47
- import { PluginVideoRecorder as Oi } from "./plugins/video-recorder.js";
48
- import { PluginOffscreen as qi } from "./plugins/offscreen.js";
49
- import { PluginROI as Vi } from "./plugins/roi.js";
50
- import { PluginForecasting as ji } from "./plugins/forecasting.js";
51
- class ae {
52
- constructor(e, t = {}) {
53
- Y(this, "available");
54
- Y(this, "canvas");
55
- Y(this, "adapter");
56
- Y(this, "device");
57
- Y(this, "context");
58
- this.canvas = e, this.available = ae.isSupported();
1
+ var Oe = Object.defineProperty;
2
+ var He = (t, e, r) => e in t ? Oe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var W = (t, e, r) => He(t, typeof e != "symbol" ? e + "" : e, r);
4
+ import { c as ze } from "./index-Cv6ZDLWf.js";
5
+ import { P as tn, a as rn, b as nn, d as on } from "./index-Cv6ZDLWf.js";
6
+ import { g as Ne, h as Ue, a as ge, c as pe } from "./axisFormat-Sz4WIJfQ.js";
7
+ import { E as sn, b as ln, f as cn, i as un, m as dn } from "./axisFormat-Sz4WIJfQ.js";
8
+ import { a as qe, h as je } from "./createStackedChart-DqcLCFGS.js";
9
+ import { i as hn, S as gn, b as pn, k as mn, f as yn, g as xn, l as bn, j as vn, c as wn, d as Pn, n as Sn, e as Tn, m as An, r as Cn, s as Mn } from "./createStackedChart-DqcLCFGS.js";
10
+ import { r as U, k as De, l as Ke, n as Je, o as Qe, q as Ze, s as et, t as tt, u as oe, p as ae, v as me, w as rt, H as nt, x as ot, C as ue, N as Le, y as Q, z as ye, A as at, B as it, F as st, D as xe, L as se, O as lt } from "./ChartCore-AnR_3Xkb.js";
11
+ import { G as En, R as Dn, J as Ln, X as kn, e as In, E as Rn, d as $n, a as Bn, M as _n, P as Yn, Y as Xn, S as Wn, a4 as Vn, $ as Gn, c as On, h as Hn, b as zn, f as Nn, _ as Un, a0 as qn, I as jn, Z as Kn, T as Jn, Q as Qn, g as Zn, K as eo, m as to, U as ro, W as no, a1 as oo, a2 as ao, a3 as io, V as so } from "./ChartCore-AnR_3Xkb.js";
12
+ import { P as co, c as uo, a as fo, d as ho, g as go, e as po, l as mo, m as yo, o as xo, b as bo, s as vo, u as wo } from "./index-0InEyj0q.js";
13
+ import { W as So, n as To } from "./pool-DZ8shSqv.js";
14
+ import { PluginAnalysis as Co, analyzeComplexSpectrum as Mo, analyzeSpectrum as Fo, arraysToComplex as Eo, autoCorrelation as Do, bandPassFilter as Lo, bandStopFilter as ko, blackmanWindow as Io, butterworth as Ro, complexToArrays as $o, crossCorrelation as Bo, detectAnomalies as _o, dominantFrequency as Yo, exponentialMovingAverage as Xo, fft as Wo, fftFromComplexInput as Vo, gaussianSmooth as Go, generateContours as Oo, getPositiveFrequencies as Ho, hammingWindow as zo, hanningWindow as No, highPassFilter as Uo, ifft as qo, ifftComplex as jo, ifftFromArrays as Ko, joinSegments as Jo, lowPassFilter as Qo, medianFilter as Zo, nextPowerOf2 as ea, powerSpectrum as ta, savitzkyGolay as ra, simpsonsIntegration as na, singleFrequencyFilter as oa, tTest as aa, trapezoidalIntegration as ia } from "./plugins/analysis.js";
15
+ import { SciChart as la, SciPlot as ca, StackedPlot as ua, VeloPlot as da, useChartGroup as fa, useChartSync as ha, useIndicator as ga, useSciChart as pa, useSciPlot as ma, useStackedPlot as ya, useVeloPlot as xa } from "./react.js";
16
+ import { LOCALE_DE_DE as va, LOCALE_EN_US as wa, LOCALE_ES_ES as Pa, LOCALE_FR_FR as Sa, LOCALE_JA_JP as Ta, LOCALE_PT_BR as Aa, LOCALE_ZH_CN as Ca, PluginI18n as Ma, createLocaleFormatter as Fa, getGlobalLocale as Ea, getLocale as Da, registerLocale as La, setGlobalLocale as ka } from "./plugins/i18n.js";
17
+ import { D as Ra, K as $a, c as Ba, p as _a } from "./index-CWxIHdwX.js";
18
+ import { ClipboardManager as Xa, PluginClipboard as Wa, copyToClipboard as Va, formatData as Ga, getClipboardManager as Oa } from "./plugins/clipboard.js";
19
+ import { DebugOverlay as za, PluginDebug as Na, createDebugOverlay as Ua, enableDebugMode as qa } from "./plugins/debug.js";
20
+ import { L as Ka, P as Ja, c as Qa, s as Za, a as ei } from "./index-qhscKTDy.js";
21
+ import { C as ri, c as ni, a as oi, l as ai } from "./index-CaXWSOTk.js";
22
+ import { P as si, b as li, T as ci, c as ui, a as di, g as fi } from "./index-Dag88bW4.js";
23
+ import { B as gi, C as pi, P as mi, a as yi, e as xi, g as bi, b as vi, d as wi, f as Pi, c as Si } from "./index-BgrvqltV.js";
24
+ import { AnnotationManager as Ai, PluginAnnotations as Ci } from "./plugins/annotations.js";
25
+ import { d as Z } from "./PluginRegistry-CzMHebYP.js";
26
+ import { e as Fi, c as Ei, a as Di, g as Li, b as ki, l as Ii, r as Ri, v as $i } from "./PluginRegistry-CzMHebYP.js";
27
+ import { P as _i, a as Yi, T as Xi, g as Wi } from "./index-B7PTX94B.js";
28
+ import { h as Gi, d as Oi, e as Hi, i as zi, b as Ni, a as Ui, f as qi, c as ji, g as Ki, m as Ji, s as Qi, v as Zi } from "./utils-Dx0h0bgQ.js";
29
+ import { a as ts, c as rs, d as ns, i as os, s as as } from "./math-Ddm2EZjj.js";
30
+ import { BaseBufferStore as ss, BaseTextureStore as ls, GpuBenchmark as cs, GpuCompute as us, GpuRenderer as ds, PipelineCache as fs, PluginGpu as hs, SeriesAdapter as gs, WebGLBackend as ps, WebGPUBackend as ms, createGpuRenderer as ys, parseColorToRGBA as xs } from "./plugins/gpu.js";
31
+ import { i as vs, j as ws, g as Ps, f as Ss, k as Ts, d as As, e as Cs, m as Ms, c as Fs, n as Es, o as Ds, p as Ls, b as ks, r as Is, s as Rs, h as $s, a as Bs, t as _s, v as Ys, w as Xs } from "./indicators--eJGmVox.js";
32
+ import { Plugin3D as Vs } from "./plugins/3d.js";
33
+ import { PluginKeyboard as Os } from "./plugins/keyboard.js";
34
+ import { PluginSync as zs } from "./plugins/sync.js";
35
+ import { PluginDataExport as Us } from "./plugins/data-export.js";
36
+ import { PluginContextMenu as js } from "./plugins/context-menu.js";
37
+ import { PluginAnomalyDetection as Js } from "./plugins/anomaly-detection.js";
38
+ import { PluginMLIntegration as Zs } from "./plugins/ml-integration.js";
39
+ import { PluginPatternRecognition as tl } from "./plugins/pattern-recognition.js";
40
+ import { PluginRegression as nl } from "./plugins/regression.js";
41
+ import { PluginRadar as al } from "./plugins/radar.js";
42
+ import { PluginSnapshot as sl } from "./plugins/snapshot.js";
43
+ import { PluginDataTransform as cl } from "./plugins/data-transform.js";
44
+ import { PluginLaTeX as dl } from "./plugins/latex.js";
45
+ import { PluginCaching as hl } from "./plugins/caching.js";
46
+ import { PluginLazyLoad as pl } from "./plugins/lazy-load.js";
47
+ import { PluginBrokenAxis as yl } from "./plugins/broken-axis.js";
48
+ import { PluginVideoRecorder as bl } from "./plugins/video-recorder.js";
49
+ import { PluginOffscreen as wl } from "./plugins/offscreen.js";
50
+ import { PluginROI as Sl } from "./plugins/roi.js";
51
+ import { PluginForecasting as Al } from "./plugins/forecasting.js";
52
+ function ct(t, e, r, n, o, a, i) {
53
+ const l = t.length, s = i / 2, c = new Float32Array(l * 20), u = new Float32Array(l * 12);
54
+ let d = 0, y = 0;
55
+ for (let h = 0; h < l; h++) {
56
+ const g = t[h], w = e[h], b = r[h], m = n[h], v = o[h], p = a[h];
57
+ c[d++] = g, c[d++] = w, c[d++] = g, c[d++] = b, c[d++] = g, c[d++] = v, c[d++] = g, c[d++] = p, c[d++] = g - s, c[d++] = m, c[d++] = g + s, c[d++] = m, c[d++] = g - s, c[d++] = b, c[d++] = g + s, c[d++] = b, c[d++] = g - s, c[d++] = v, c[d++] = g + s, c[d++] = v, u[y++] = g - s, u[y++] = b, u[y++] = g + s, u[y++] = b, u[y++] = g + s, u[y++] = v, u[y++] = g - s, u[y++] = b, u[y++] = g + s, u[y++] = v, u[y++] = g - s, u[y++] = v;
58
+ }
59
+ return { lines: c, boxes: u };
60
+ }
61
+ function ut(t, e, r, n) {
62
+ const o = t.length, a = r / 2, i = new Float32Array(o * 12), l = new Float32Array(o * 12), s = new Float32Array(o * 12), c = new Float32Array((o - 1) * 4);
63
+ let u = 0, d = 0, y = 0, h = 0, g = 0;
64
+ for (let w = 0; w < o; w++) {
65
+ const b = t[w], m = e[w], v = (n == null ? void 0 : n[w]) ?? !1;
66
+ let p, f;
67
+ if (v ? (p = 0, f = g, s[y++] = b - a, s[y++] = p, s[y++] = b + a, s[y++] = p, s[y++] = b + a, s[y++] = f, s[y++] = b - a, s[y++] = p, s[y++] = b + a, s[y++] = f, s[y++] = b - a, s[y++] = f) : (p = g, f = g + m, g = f, m >= 0 ? (i[u++] = b - a, i[u++] = p, i[u++] = b + a, i[u++] = p, i[u++] = b + a, i[u++] = f, i[u++] = b - a, i[u++] = p, i[u++] = b + a, i[u++] = f, i[u++] = b - a, i[u++] = f) : (l[d++] = b - a, l[d++] = f, l[d++] = b + a, l[d++] = f, l[d++] = b + a, l[d++] = p, l[d++] = b - a, l[d++] = f, l[d++] = b + a, l[d++] = p, l[d++] = b - a, l[d++] = p)), w < o - 1) {
68
+ const T = t[w + 1];
69
+ c[h++] = b + a, c[h++] = f, c[h++] = T - a, c[h++] = f;
70
+ }
71
+ }
72
+ return {
73
+ positiveData: i.subarray(0, u),
74
+ negativeData: l.subarray(0, d),
75
+ subtotalData: s.subarray(0, y),
76
+ connectorData: c.subarray(0, h),
77
+ positiveCount: u / 2,
78
+ negativeCount: d / 2,
79
+ subtotalCount: y / 2
80
+ };
81
+ }
82
+ function dt(t, e, r) {
83
+ const n = Math.min(t.length, e.length), o = new Float32Array(n * 6 * 2), a = r * 0.5;
84
+ for (let i = 0; i < n; i++) {
85
+ const l = t[i], s = e[i], c = i * 12, u = l - a, d = l + a, y = 0, h = s;
86
+ o[c + 0] = u, o[c + 1] = y, o[c + 2] = d, o[c + 3] = y, o[c + 4] = u, o[c + 5] = h, o[c + 6] = u, o[c + 7] = h, o[c + 8] = d, o[c + 9] = y, o[c + 10] = d, o[c + 11] = h;
87
+ }
88
+ return o;
89
+ }
90
+ function le(t) {
91
+ if (t.length < 2) return 1;
92
+ let e = 1 / 0;
93
+ for (let r = 1; r < t.length; r++) {
94
+ const n = Math.abs(t[r] - t[r - 1]);
95
+ n > 0 && n < e && (e = n);
96
+ }
97
+ return e === 1 / 0 ? 1 : e * 0.8;
98
+ }
99
+ function ft(t, e, r) {
100
+ const n = t.length, o = e.length;
101
+ n * o > r.length && console.warn("[Heatmap] Z array is too small for the specified grid dimensions");
102
+ const a = (n - 1) * (o - 1), i = new Float32Array(a * 6 * 3);
103
+ let l = 0;
104
+ for (let s = 0; s < o - 1; s++)
105
+ for (let c = 0; c < n - 1; c++) {
106
+ const u = t[c], d = t[c + 1], y = e[s], h = e[s + 1], g = r[s * n + c], w = r[s * n + (c + 1)], b = r[(s + 1) * n + c], m = r[(s + 1) * n + (c + 1)];
107
+ i[l++] = u, i[l++] = y, i[l++] = g, i[l++] = d, i[l++] = y, i[l++] = w, i[l++] = u, i[l++] = h, i[l++] = b, i[l++] = u, i[l++] = h, i[l++] = b, i[l++] = d, i[l++] = y, i[l++] = w, i[l++] = d, i[l++] = h, i[l++] = m;
108
+ }
109
+ return i;
110
+ }
111
+ function ht(t = "viridis") {
112
+ const r = new Uint8Array(1024);
113
+ for (let n = 0; n < 256; n++) {
114
+ const o = n / 255;
115
+ let a, i, l;
116
+ t === "jet" ? (a = Math.min(Math.max(1.5 - Math.abs(o * 4 - 3), 0), 1), i = Math.min(Math.max(1.5 - Math.abs(o * 4 - 2), 0), 1), l = Math.min(Math.max(1.5 - Math.abs(o * 4 - 1), 0), 1)) : t === "grayscale" ? a = i = l = o : t === "plasma" ? (a = 0.5 + 0.5 * Math.sin(Math.PI * (o - 0.5)), i = 0.5 + 0.5 * Math.sin(Math.PI * o), l = 0.8) : (a = 0.267 * (1 - o) + 0.993 * o, i = 5e-3 * (1 - o) + 0.906 * o, l = 0.337 * (1 - o) + 0.144 * o), r[n * 4 + 0] = a * 255, r[n * 4 + 1] = i * 255, r[n * 4 + 2] = l * 255, r[n * 4 + 3] = 255;
117
+ }
118
+ return r;
119
+ }
120
+ function gt(t, e, r, n, o, a, i = !1) {
121
+ const l = t.length, s = [], c = [], u = a / 2, y = a / 10 / 2;
122
+ for (let h = 0; h < l; h++) {
123
+ if (!Number.isFinite(t[h])) continue;
124
+ const g = o[h] >= e[h], w = g ? s : c, b = Math.max(e[h], o[h]), m = Math.min(e[h], o[h]);
125
+ i && g || be(w, t[h] - u, m, t[h] + u, b), be(w, t[h] - y, n[h], t[h] + y, r[h]);
126
+ }
127
+ return {
128
+ bullish: new Float32Array(s),
129
+ bearish: new Float32Array(c)
130
+ };
131
+ }
132
+ function be(t, e, r, n, o) {
133
+ t.push(e, r, n, r, e, o), t.push(n, r, n, o, e, o);
134
+ }
135
+ function de(t, e) {
136
+ const r = e.getData(), n = e.getId(), o = e.getType();
137
+ if (e.hasErrorData()) {
138
+ const a = Ze(
139
+ r.x,
140
+ r.y,
141
+ {
142
+ yError: r.yError,
143
+ yErrorMinus: r.yErrorMinus,
144
+ yErrorPlus: r.yErrorPlus
145
+ },
146
+ {
147
+ xError: r.xError,
148
+ xErrorMinus: r.xErrorMinus,
149
+ xErrorPlus: r.xErrorPlus
150
+ }
151
+ );
152
+ t.renderer.createBuffer(`${n}_errors`, a);
153
+ }
154
+ if (o === "step" || o === "step+scatter") {
155
+ const a = e.getStyle().stepMode ?? "after";
156
+ t.renderer.createBuffer(
157
+ `${n}_step`,
158
+ et(r.x, r.y, a)
159
+ );
160
+ }
161
+ }
162
+ function pt(t, e) {
163
+ const r = e.getData(), n = e.getStyle().barWidth ?? le(r.x);
164
+ t.renderer.createBuffer(
165
+ e.getId(),
166
+ dt(r.x, r.y, n)
167
+ ), de(t, e), e.resetLastAppendCount();
168
+ }
169
+ function mt(t, e) {
170
+ var a, i, l;
171
+ (i = (a = t.renderer) == null ? void 0 : a.installHeatmapProgram) == null || i.call(a);
172
+ const r = e.getHeatmapData(), n = e.getHeatmapStyle();
173
+ if (!r || r.xValues.length < 2) return;
174
+ t.renderer.createBuffer(
175
+ e.getId(),
176
+ ft(r.xValues, r.yValues, r.zValues)
177
+ );
178
+ const o = ((l = n == null ? void 0 : n.colorScale) == null ? void 0 : l.name) || "viridis";
179
+ t.renderer.createColormapTexture(
180
+ `${e.getId()}_colormap`,
181
+ ht(o)
182
+ ), e.resetLastAppendCount();
183
+ }
184
+ function yt(t, e) {
185
+ const r = e.getData(), n = e.getId();
186
+ if (r.open && r.high && r.low && r.close) {
187
+ const o = e.getStyle().barWidth ?? le(r.x), a = !!e.getStyle().hollow, { bullish: i, bearish: l } = gt(
188
+ r.x,
189
+ r.open,
190
+ r.high,
191
+ r.low,
192
+ r.close,
193
+ o,
194
+ a
195
+ );
196
+ t.renderer.createBuffer(`${n}_bullish`, i), t.renderer.createBuffer(`${n}_bearish`, l), e.bullishCount = i.length / 2, e.bearishCount = l.length / 2;
197
+ }
198
+ e.resetLastAppendCount();
199
+ }
200
+ function xt(t, e) {
201
+ const r = e.getData(), n = e.getId();
202
+ if (r.low && r.open && r.median && r.close && r.high) {
203
+ const o = e.getStyle().barWidth ?? le(r.x), { lines: a, boxes: i } = ct(
204
+ r.x,
205
+ r.low,
206
+ r.open,
207
+ r.median,
208
+ r.close,
209
+ r.high,
210
+ o
211
+ );
212
+ t.renderer.createBuffer(`${n}_box_lines`, a), t.renderer.createBuffer(`${n}_box_faces`, i);
213
+ }
214
+ e.resetLastAppendCount();
215
+ }
216
+ function bt(t, e) {
217
+ const r = e.getData(), n = e.getId(), o = e.getStyle().barWidth ?? le(r.x), a = e.getStyle().isSubtotal, i = ut(r.x, r.y, o, a);
218
+ t.renderer.createBuffer(`${n}_wf_positive`, i.positiveData), t.renderer.createBuffer(`${n}_wf_negative`, i.negativeData), t.renderer.createBuffer(`${n}_wf_subtotal`, i.subtotalData), t.renderer.createBuffer(`${n}_wf_connectors`, i.connectorData), e.waterfallCounts = {
219
+ positive: i.positiveCount,
220
+ negative: i.negativeCount,
221
+ subtotal: i.subtotalCount,
222
+ connectors: i.connectorData.length / 2
223
+ }, e.resetLastAppendCount();
224
+ }
225
+ function vt(t, e) {
226
+ const r = e.getPolarData();
227
+ if (!r || r.r.length === 0) return;
228
+ const n = e.getStyle(), o = n.angleMode || "degrees", a = n.closePath !== !1;
229
+ if (n.fill || !1) {
230
+ const l = Ke(r, o, a);
231
+ t.renderer.createBuffer(e.getId(), l);
232
+ } else {
233
+ const l = Je(r, o, a);
234
+ t.renderer.createBuffer(e.getId(), l);
235
+ }
236
+ e.resetLastAppendCount();
237
+ }
238
+ function ve(t, e) {
239
+ const r = e.getData(), o = e.getType() === "area" ? new Float32Array(r.x.length).fill(0) : r.y2 || new Float32Array(r.x.length).fill(0);
240
+ t.renderer.createBuffer(e.getId(), Qe(r.x, r.y, o)), de(t, e), e.resetLastAppendCount();
241
+ }
242
+ function wt(t, e) {
243
+ const r = e.getData();
244
+ t.renderer.createBuffer(e.getId(), De(r.x, r.y)), de(t, e), e.resetLastAppendCount();
245
+ }
246
+ let we = !1;
247
+ function Pt() {
248
+ if (!we) {
249
+ we = !0, U("bar", pt), U("heatmap", mt), U("candlestick", yt), U("boxplot", xt), U("waterfall", bt), U("polar", vt), U("band", ve), U("area", ve), U("heikin-ashi", (t, e) => {
250
+ var n;
251
+ const r = e.getData();
252
+ (n = r == null ? void 0 : r.x) != null && n.length && (t.renderer.createBuffer(e.getId(), De(r.x, r.y)), e.resetLastAppendCount());
253
+ });
254
+ for (const t of [
255
+ "line",
256
+ "scatter",
257
+ "line+scatter",
258
+ "step",
259
+ "step+scatter"
260
+ ])
261
+ U(t, wt);
262
+ }
263
+ }
264
+ function St(t, e, r, n, o, a = { min: 0, max: 1 }, i) {
265
+ t.useProgram(e.program), t.bindBuffer(t.ARRAY_BUFFER, r), t.enableVertexAttribArray(e.attributes.position), t.vertexAttribPointer(e.attributes.position, 2, t.FLOAT, !1, 12, 0), e.attributes.value !== void 0 && e.attributes.value !== -1 && (t.enableVertexAttribArray(e.attributes.value), t.vertexAttribPointer(e.attributes.value, 1, t.FLOAT, !1, 12, 8)), t.uniform2f(e.uniforms.uScale, o.scale[0], o.scale[1]), t.uniform2f(
266
+ e.uniforms.uTranslate,
267
+ o.translate[0],
268
+ o.translate[1]
269
+ ), e.uniforms.uMinValue && t.uniform1f(e.uniforms.uMinValue, a.min), e.uniforms.uMaxValue && t.uniform1f(e.uniforms.uMaxValue, a.max), i && e.uniforms.uColormap ? (t.activeTexture(t.TEXTURE0), t.bindTexture(t.TEXTURE_2D, i), t.uniform1i(e.uniforms.uColormap, 0)) : e.uniforms.uColormap && (t.activeTexture(t.TEXTURE0), t.bindTexture(t.TEXTURE_2D, null)), t.drawArrays(t.TRIANGLES, 0, n), t.disableVertexAttribArray(e.attributes.position), e.attributes.value !== void 0 && e.attributes.value !== -1 && t.disableVertexAttribArray(e.attributes.value);
270
+ }
271
+ function Tt(t, e, r, n, o, a) {
272
+ t.useProgram(e.program), t.bindBuffer(t.ARRAY_BUFFER, r), t.enableVertexAttribArray(e.attributes.position), t.vertexAttribPointer(e.attributes.position, 2, t.FLOAT, !1, 0, 0), t.uniform2f(e.uniforms.uScale, o.scale[0], o.scale[1]), t.uniform2f(
273
+ e.uniforms.uTranslate,
274
+ o.translate[0],
275
+ o.translate[1]
276
+ ), t.uniform4f(e.uniforms.uColor, a[0], a[1], a[2], a[3]), t.drawArrays(t.TRIANGLES, 0, n), t.disableVertexAttribArray(e.attributes.position);
277
+ }
278
+ function At(t, e, r, n, o) {
279
+ const a = tt(o);
280
+ t.useProgram(e.line.program), t.bindBuffer(t.ARRAY_BUFFER, r.boxBuffer), t.enableVertexAttribArray(e.line.attributes.position), t.vertexAttribPointer(e.line.attributes.position, 2, t.FLOAT, !1, 0, 0), t.uniform2f(e.line.uniforms.uScale, n.scale[0], n.scale[1]), t.uniform2f(
281
+ e.line.uniforms.uTranslate,
282
+ n.translate[0],
283
+ n.translate[1]
284
+ );
285
+ const i = [...a];
286
+ i[3] *= 0.5, t.uniform4f(e.line.uniforms.uColor, i[0], i[1], i[2], i[3]), t.drawArrays(t.TRIANGLES, 0, r.boxCount), t.uniform4f(e.line.uniforms.uColor, a[0], a[1], a[2], a[3]), t.lineWidth(o.width || 1), t.bindBuffer(t.ARRAY_BUFFER, r.linesBuffer), t.vertexAttribPointer(e.line.attributes.position, 2, t.FLOAT, !1, 0, 0), t.drawArrays(t.LINES, 0, r.linesCount), t.disableVertexAttribArray(e.line.attributes.position);
287
+ }
288
+ function Ct(t, e, r) {
289
+ St(
290
+ t.gl,
291
+ t.programs.heatmapProgram,
292
+ e.buffer,
293
+ e.count,
294
+ r,
295
+ e.zBounds,
296
+ e.colormapTexture
297
+ );
298
+ }
299
+ function Mt(t, e, r, n) {
300
+ Tt(
301
+ t.gl,
302
+ t.programs.lineProgram,
303
+ e.buffer,
304
+ e.count,
305
+ r,
306
+ n
307
+ );
308
+ }
309
+ function Ft(t, e, r) {
310
+ e.boxBuffer && e.boxLinesBuffer && At(
311
+ t.gl,
312
+ { line: t.programs.lineProgram, point: t.programs.pointProgram },
313
+ {
314
+ boxBuffer: e.boxBuffer,
315
+ boxCount: e.boxCount || 0,
316
+ linesBuffer: e.boxLinesBuffer,
317
+ linesCount: e.boxLinesCount || 0
318
+ },
319
+ r,
320
+ e.style
321
+ );
322
+ }
323
+ function Et(t, e, r) {
324
+ const { gl: n, programs: o, dpr: a } = t, i = ae(e.style.positiveColor || "#22c55e"), l = ae(e.style.negativeColor || "#ef4444"), s = ae(e.style.subtotalColor || "#3b82f6"), c = ae(e.style.connectorColor || "#64748b");
325
+ e.wfPositiveBuffer && e.wfPositiveCount && e.wfPositiveCount > 0 && (n.useProgram(o.lineProgram.program), n.bindBuffer(n.ARRAY_BUFFER, e.wfPositiveBuffer), n.enableVertexAttribArray(o.lineProgram.attributes.position), n.vertexAttribPointer(
326
+ o.lineProgram.attributes.position,
327
+ 2,
328
+ n.FLOAT,
329
+ !1,
330
+ 0,
331
+ 0
332
+ ), n.uniform2f(
333
+ o.lineProgram.uniforms.uScale,
334
+ r.scale[0],
335
+ r.scale[1]
336
+ ), n.uniform2f(
337
+ o.lineProgram.uniforms.uTranslate,
338
+ r.translate[0],
339
+ r.translate[1]
340
+ ), n.uniform4f(
341
+ o.lineProgram.uniforms.uColor,
342
+ i[0],
343
+ i[1],
344
+ i[2],
345
+ 0.9
346
+ ), n.drawArrays(n.TRIANGLES, 0, e.wfPositiveCount)), e.wfNegativeBuffer && e.wfNegativeCount && e.wfNegativeCount > 0 && (n.useProgram(o.lineProgram.program), n.bindBuffer(n.ARRAY_BUFFER, e.wfNegativeBuffer), n.enableVertexAttribArray(o.lineProgram.attributes.position), n.vertexAttribPointer(
347
+ o.lineProgram.attributes.position,
348
+ 2,
349
+ n.FLOAT,
350
+ !1,
351
+ 0,
352
+ 0
353
+ ), n.uniform2f(
354
+ o.lineProgram.uniforms.uScale,
355
+ r.scale[0],
356
+ r.scale[1]
357
+ ), n.uniform2f(
358
+ o.lineProgram.uniforms.uTranslate,
359
+ r.translate[0],
360
+ r.translate[1]
361
+ ), n.uniform4f(
362
+ o.lineProgram.uniforms.uColor,
363
+ l[0],
364
+ l[1],
365
+ l[2],
366
+ 0.9
367
+ ), n.drawArrays(n.TRIANGLES, 0, e.wfNegativeCount)), e.wfSubtotalBuffer && e.wfSubtotalCount && e.wfSubtotalCount > 0 && (n.useProgram(o.lineProgram.program), n.bindBuffer(n.ARRAY_BUFFER, e.wfSubtotalBuffer), n.enableVertexAttribArray(o.lineProgram.attributes.position), n.vertexAttribPointer(
368
+ o.lineProgram.attributes.position,
369
+ 2,
370
+ n.FLOAT,
371
+ !1,
372
+ 0,
373
+ 0
374
+ ), n.uniform2f(
375
+ o.lineProgram.uniforms.uScale,
376
+ r.scale[0],
377
+ r.scale[1]
378
+ ), n.uniform2f(
379
+ o.lineProgram.uniforms.uTranslate,
380
+ r.translate[0],
381
+ r.translate[1]
382
+ ), n.uniform4f(
383
+ o.lineProgram.uniforms.uColor,
384
+ s[0],
385
+ s[1],
386
+ s[2],
387
+ 0.9
388
+ ), n.drawArrays(n.TRIANGLES, 0, e.wfSubtotalCount)), e.style.showConnectors !== !1 && e.wfConnectorBuffer && e.wfConnectorCount && e.wfConnectorCount > 0 && (n.useProgram(o.lineProgram.program), n.bindBuffer(n.ARRAY_BUFFER, e.wfConnectorBuffer), n.enableVertexAttribArray(o.lineProgram.attributes.position), n.vertexAttribPointer(
389
+ o.lineProgram.attributes.position,
390
+ 2,
391
+ n.FLOAT,
392
+ !1,
393
+ 0,
394
+ 0
395
+ ), n.uniform2f(
396
+ o.lineProgram.uniforms.uScale,
397
+ r.scale[0],
398
+ r.scale[1]
399
+ ), n.uniform2f(
400
+ o.lineProgram.uniforms.uTranslate,
401
+ r.translate[0],
402
+ r.translate[1]
403
+ ), n.uniform4f(
404
+ o.lineProgram.uniforms.uColor,
405
+ c[0],
406
+ c[1],
407
+ c[2],
408
+ 0.6
409
+ ), n.lineWidth(1), n.drawArrays(n.LINES, 0, e.wfConnectorCount)), n.disableVertexAttribArray(o.lineProgram.attributes.position);
410
+ }
411
+ let Pe = !1;
412
+ function Dt() {
413
+ Pe || (Pe = !0, oe(
414
+ "heatmap",
415
+ (t, e, r) => Ct(t, e, r)
416
+ ), oe(
417
+ "bar",
418
+ (t, e, r, n) => Mt(t, e, r, n)
419
+ ), oe(
420
+ "boxplot",
421
+ (t, e, r) => Ft(t, e, r)
422
+ ), oe(
423
+ "waterfall",
424
+ (t, e, r) => Et(t, e, r)
425
+ ));
426
+ }
427
+ function Lt(t, e, r, n) {
428
+ const { value: o, min: a, max: i } = e, {
429
+ needleColor: l = "#333",
430
+ needleWidth: s = 3,
431
+ ranges: c = [],
432
+ radius: u = 0.8,
433
+ startAngle: d = 135,
434
+ endAngle: y = 405,
435
+ showValue: h = !0,
436
+ valueColor: g = "#fff",
437
+ valueSize: w = 24,
438
+ label: b
439
+ } = r, m = n.x + n.width / 2, v = n.y + n.height / 2, p = Math.min(n.width, n.height) / 2 * u, f = y - d, T = Math.max(0, Math.min(1, (o - a) / (i - a))), S = (d + T * f) * (Math.PI / 180);
440
+ t.save(), t.beginPath(), t.arc(m, v, p, d * (Math.PI / 180), y * (Math.PI / 180)), t.strokeStyle = "rgba(255, 255, 255, 0.1)", t.lineWidth = p * 0.2, t.lineCap = "round", t.stroke();
441
+ for (const D of c) {
442
+ const k = Math.max(0, Math.min(1, (D.from - a) / (i - a))), M = Math.max(0, Math.min(1, (D.to - a) / (i - a)));
443
+ t.beginPath(), t.arc(
444
+ m,
445
+ v,
446
+ p,
447
+ (d + k * f) * (Math.PI / 180),
448
+ (d + M * f) * (Math.PI / 180)
449
+ ), t.strokeStyle = D.color, t.lineWidth = p * 0.2, t.stroke();
450
+ }
451
+ const L = 11;
452
+ for (let D = 0; D < L; D++) {
453
+ const k = (d + D / (L - 1) * f) * (Math.PI / 180), M = p * 0.85, B = p * 0.95;
454
+ t.beginPath(), t.moveTo(m + M * Math.cos(k), v + M * Math.sin(k)), t.lineTo(m + B * Math.cos(k), v + B * Math.sin(k)), t.strokeStyle = "rgba(255, 255, 255, 0.5)", t.lineWidth = 2, t.stroke();
455
+ }
456
+ t.beginPath(), t.moveTo(m, v), t.lineTo(m + p * 0.9 * Math.cos(S), v + p * 0.9 * Math.sin(S)), t.strokeStyle = l, t.lineWidth = s, t.lineCap = "round", t.shadowColor = l, t.shadowBlur = 10, t.stroke(), t.shadowBlur = 0, t.beginPath(), t.arc(m, v, 8, 0, Math.PI * 2), t.fillStyle = l, t.fill(), t.strokeStyle = "#fff", t.lineWidth = 2, t.stroke(), h && (t.textAlign = "center", t.textBaseline = "middle", t.font = `bold ${w}px Inter, sans-serif`, t.fillStyle = g, t.fillText(o.toFixed(1), m, v + p * 0.4), b && (t.font = `${w * 0.5}px Inter, sans-serif`, t.fillStyle = "rgba(255, 255, 255, 0.6)", t.fillText(b, m, v + p * 0.6))), t.restore();
457
+ }
458
+ function kt(t, e, r, n) {
459
+ const { nodes: o, links: a } = e, {
460
+ nodeWidth: i = 18,
461
+ nodePadding: l = 12,
462
+ palette: s = ["#6366f1", "#10b981", "#3b82f6", "#f43f5e", "#f59e0b"],
463
+ linkOpacity: c = 0.4,
464
+ showLabels: u = !0
465
+ } = r;
466
+ if (!a.length) return;
467
+ const d = 1.8, y = n.width / d, h = n.height / d, g = (n.width - y) / 2, w = (n.height - h) / 2, m = {
468
+ x: n.x + g,
469
+ y: n.y + w,
470
+ width: y,
471
+ height: h
472
+ }, v = /* @__PURE__ */ new Set();
473
+ a.forEach((x) => {
474
+ v.add(x.source), v.add(x.target);
475
+ });
476
+ const p = Array.from(v), f = /* @__PURE__ */ new Map(), T = new Set(a.map((x) => x.target));
477
+ p.filter((x) => !T.has(x)).forEach((x) => f.set(x, 0));
478
+ let L = !0;
479
+ for (; L; )
480
+ L = !1, a.forEach((x) => {
481
+ const A = f.get(x.source);
482
+ if (A !== void 0) {
483
+ const E = f.get(x.target), _ = A + 1;
484
+ (E === void 0 || _ > E) && (f.set(x.target, _), L = !0);
485
+ }
486
+ });
487
+ p.forEach((x) => {
488
+ f.get(x) === void 0 && f.set(x, 0);
489
+ });
490
+ const D = Math.max(...Array.from(f.values())), k = Array.from({ length: D + 1 }, () => []);
491
+ p.forEach((x) => k[f.get(x)].push(x));
492
+ const M = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
493
+ a.forEach((x) => {
494
+ B.set(x.source, (B.get(x.source) || 0) + x.value), M.set(x.target, (M.get(x.target) || 0) + x.value);
495
+ });
496
+ const P = (x) => Math.max(M.get(x) || 0, B.get(x) || 0);
497
+ let F = 0;
498
+ k.forEach((x) => {
499
+ let A = 0;
500
+ x.forEach((E) => A += P(E)), A > F && (F = A);
501
+ });
502
+ const C = /* @__PURE__ */ new Map(), $ = k.length, I = (m.width - i) / Math.max(1, $ - 1);
503
+ k.forEach((x, A) => {
504
+ const E = m.x + A * I, _ = [];
505
+ let O = 0;
506
+ x.forEach((z) => {
507
+ const G = P(z), V = F > 0 ? G / F * (m.height * 0.9) : 20;
508
+ _.push(V), O += V;
509
+ });
510
+ const q = (x.length - 1) * l, j = O + q;
511
+ let H = m.y + (m.height - j) / 2;
512
+ x.forEach((z, G) => {
513
+ const V = _[G];
514
+ let N = s[G % s.length];
515
+ if (o.length > 0) {
516
+ const X = o.find((K) => K.id === z);
517
+ X != null && X.color && (N = X.color);
518
+ }
519
+ C.set(z, { x: E, y: H, width: i, height: V, color: N, value: P(z) }), H += V + l;
520
+ });
521
+ }), t.save();
522
+ const Y = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map();
523
+ a.forEach((x) => {
524
+ const A = C.get(x.source), E = C.get(x.target);
525
+ if (!A || !E) return;
526
+ const _ = Y.get(x.source) || 0, O = R.get(x.target) || 0, q = B.get(x.source) || 1, j = M.get(x.target) || 1, H = x.value / q * A.height, z = x.value / j * E.height, G = A.x + A.width, V = A.y + _, N = V + H, X = E.x, K = E.y + O, ee = K + z, J = (X - G) * 0.5, te = t.createLinearGradient(G, (V + N) / 2, X, (K + ee) / 2);
527
+ te.addColorStop(0, A.color), te.addColorStop(1, E.color), t.beginPath(), t.moveTo(G, V), t.bezierCurveTo(G + J, V, X - J, K, X, K), t.lineTo(X, ee), t.bezierCurveTo(X - J, ee, G + J, N, G, N), t.closePath(), t.fillStyle = te, t.globalAlpha = c, t.fill(), t.strokeStyle = A.color, t.globalAlpha = c * 0.3, t.lineWidth = 0.5, t.stroke(), Y.set(x.source, _ + H), R.set(x.target, O + z);
528
+ }), t.restore(), t.save(), t.globalAlpha = 1, C.forEach((x) => {
529
+ t.fillStyle = x.color, t.fillRect(x.x, x.y, x.width, x.height);
530
+ const A = t.createLinearGradient(x.x, x.y, x.x + x.width, x.y);
531
+ A.addColorStop(0, "rgba(255, 255, 255, 0.15)"), A.addColorStop(1, "rgba(0, 0, 0, 0.15)"), t.fillStyle = A, t.fillRect(x.x, x.y, x.width, x.height);
532
+ }), t.restore(), u && (t.save(), t.font = "bold 11px Inter, -apple-system, sans-serif", t.textBaseline = "middle", C.forEach((x, A) => {
533
+ let E = String(A);
534
+ const _ = o.find((j) => j.id === A);
535
+ _ != null && _.name && (E = _.name);
536
+ const O = x.x <= m.x + 5, q = x.x >= m.x + m.width - i - 5;
537
+ t.shadowBlur = 3, t.shadowColor = "rgba(0, 0, 0, 0.7)", t.fillStyle = "#ffffff", O ? (t.textAlign = "right", t.fillText(E, x.x - 10, x.y + x.height / 2)) : q ? (t.textAlign = "left", t.fillText(E, x.x + x.width + 10, x.y + x.height / 2)) : (t.textAlign = "center", t.fillText(E, x.x + x.width / 2, x.y - 10));
538
+ }), t.restore());
539
+ }
540
+ let Se = !1;
541
+ function It() {
542
+ Se || (Se = !0, me("gauge", (t, e, r) => {
543
+ const n = e.getGaugeData(), o = e.getGaugeStyle();
544
+ n && o && Lt(t, n, o, r);
545
+ }), me("sankey", (t, e, r) => {
546
+ const n = e.getSankeyData(), o = e.getSankeyStyle();
547
+ n && o && kt(t, n, o, r);
548
+ }));
549
+ }
550
+ function Rt(t, e) {
551
+ e.heatmapProgram = rt(t, ot, nt, "heatmap");
552
+ }
553
+ let Te = !1;
554
+ function $t() {
555
+ Te || (Te = !0, ue.afterConstruct = (t, e) => {
556
+ e.renderer === "webgpu" && (t._webgpuInitPromise = Bt(t));
557
+ });
558
+ }
559
+ async function Bt(t) {
560
+ var o, a;
561
+ const e = t, { createGpuChartRenderer: r } = await import("./GpuChartRenderer-Dxc0hrQA.js"), n = await r(e.webglCanvas, {
562
+ backend: "webgpu",
563
+ powerPreference: "high-performance"
564
+ });
565
+ if (n) {
566
+ e.renderer = n, e.activeRendererType = n.backend, e.renderer.setDPR(e.dpr), (o = e.renderLoop) == null || o.setRenderer(e.renderer);
567
+ return;
568
+ }
569
+ console.warn(
570
+ "[VeloPlot] WebGPU unavailable — falling back to WebGL2. See docs/adr/001-webgpu-renderer-strategy.md."
571
+ ), e.renderer = new Le(e.webglCanvas), e.activeRendererType = "webgl", e.renderer.setDPR(e.dpr), (a = e.renderLoop) == null || a.setRenderer(e.renderer);
572
+ }
573
+ let Ae = !1;
574
+ function _t() {
575
+ Ae || (Ae = !0, Le.heatmapProgramInstaller = Rt, $t(), Pt(), Dt(), It());
576
+ }
577
+ function Ce(t) {
578
+ return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
579
+ }
580
+ function ke(t, e) {
581
+ return e && t.has(e) ? t.get(e) : t.get("default") ?? t.values().next().value;
582
+ }
583
+ function Yt(t, e, r, n, o, a, i, l, s = {}) {
584
+ const c = ke(o, s.primaryYAxisId);
585
+ if (!c)
586
+ throw new Error("SVG export requires at least one Y scale");
587
+ const u = [
588
+ `<svg width="${i}" height="${l}" viewBox="0 0 ${i} ${l}" xmlns="http://www.w3.org/2000/svg" font-family="${a.xAxis.fontFamily || "sans-serif"}">`,
589
+ `<rect width="100%" height="100%" fill="${a.backgroundColor}" />`,
590
+ '<g transform="translate(0,0)">'
591
+ ];
592
+ return Gt(u, r, n, c, a), Xt(u, t, r, n, o, s.primaryYAxisId), Wt(u, r, n, c, a), Vt(u, r, n, c, a, s), u.push("</g>"), u.push("</svg>"), u.join(`
593
+ `);
594
+ }
595
+ function Xt(t, e, r, n, o, a) {
596
+ for (const i of e) {
597
+ if (!i.isVisible()) continue;
598
+ const l = o.get(i.getYAxisId() || a || "default") ?? ke(o, a);
599
+ if (!l) continue;
600
+ const s = i.getData();
601
+ if (!s || s.x.length === 0) continue;
602
+ const c = i.getStyle(), u = i.getType();
603
+ if (u === "line" || u === "step") {
604
+ const d = [], y = c.stepMode || "after";
605
+ for (let h = 0; h < s.x.length; h++) {
606
+ const g = n.transform(s.x[h]), w = l.transform(s.y[h]);
607
+ if (h > 0 && u === "step") {
608
+ const b = n.transform(s.x[h - 1]), m = l.transform(s.y[h - 1]);
609
+ if (y === "after") d.push(`${g.toFixed(1)},${m.toFixed(1)}`);
610
+ else if (y === "before") d.push(`${b.toFixed(1)},${w.toFixed(1)}`);
611
+ else if (y === "center") {
612
+ const v = (b + g) / 2;
613
+ d.push(`${v.toFixed(1)},${m.toFixed(1)}`), d.push(`${v.toFixed(1)},${w.toFixed(1)}`);
614
+ }
615
+ }
616
+ d.push(`${g.toFixed(1)},${w.toFixed(1)}`);
617
+ }
618
+ t.push(
619
+ `<polyline points="${d.join(" ")}" fill="none" stroke="${c.color}" stroke-width="${c.width || 1.5}" stroke-opacity="${c.opacity || 1}" stroke-linejoin="round" />`
620
+ );
621
+ } else if (u === "scatter")
622
+ for (let d = 0; d < s.x.length; d++) {
623
+ const y = n.transform(s.x[d]), h = l.transform(s.y[d]);
624
+ t.push(
625
+ `<circle cx="${y.toFixed(1)}" cy="${h.toFixed(1)}" r="${((c.pointSize || 4) / 2).toFixed(1)}" fill="${c.color}" fill-opacity="${c.opacity || 1}" />`
626
+ );
627
+ }
628
+ else if (u === "bar") {
629
+ const d = (c.barWidth || 5) * (r.width / (n.domain[1] - n.domain[0]));
630
+ for (let y = 0; y < s.x.length; y++) {
631
+ const h = n.transform(s.x[y]), g = l.transform(s.y[y]), w = l.transform(0), b = Math.min(g, w), m = Math.abs(g - w);
632
+ t.push(
633
+ `<rect x="${(h - d / 2).toFixed(1)}" y="${b.toFixed(1)}" width="${d.toFixed(1)}" height="${m.toFixed(1)}" fill="${c.color}" fill-opacity="${c.opacity || 1}" />`
634
+ );
635
+ }
636
+ } else if (u === "band" || u === "area") {
637
+ const d = u === "area" ? new Float32Array(s.x.length).fill(0) : s.y2 || new Float32Array(s.x.length).fill(0), y = [];
638
+ for (let h = 0; h < s.x.length; h++)
639
+ y.push(
640
+ `${n.transform(s.x[h]).toFixed(1)},${l.transform(s.y[h]).toFixed(1)}`
641
+ );
642
+ for (let h = s.x.length - 1; h >= 0; h--)
643
+ y.push(
644
+ `${n.transform(s.x[h]).toFixed(1)},${l.transform(d[h]).toFixed(1)}`
645
+ );
646
+ t.push(
647
+ `<polygon points="${y.join(" ")}" fill="${c.color}" fill-opacity="${(Number(c.opacity) || 1) * 0.3}" stroke="${c.color}" stroke-width="${c.width || 1}" />`
648
+ );
649
+ } else if (u === "candlestick") {
650
+ const d = (c.barWidth || 5) * (r.width / (n.domain[1] - n.domain[0])), y = c.bullishColor || "#26a69a", h = c.bearishColor || "#ef5350";
651
+ if (s.open && s.high && s.low && s.close)
652
+ for (let g = 0; g < s.x.length; g++) {
653
+ const w = s.close[g] >= s.open[g], b = n.transform(s.x[g]), m = l.transform(s.open[g]), v = l.transform(s.close[g]), p = l.transform(s.high[g]), f = l.transform(s.low[g]), T = w ? y : h;
654
+ t.push(
655
+ `<line x1="${b.toFixed(1)}" y1="${p.toFixed(1)}" x2="${b.toFixed(1)}" y2="${f.toFixed(1)}" stroke="${T}" stroke-width="1" />`
656
+ );
657
+ const S = Math.min(m, v), L = Math.max(1, Math.abs(m - v));
658
+ t.push(
659
+ `<rect x="${(b - d / 2).toFixed(1)}" y="${S.toFixed(1)}" width="${d.toFixed(1)}" height="${L.toFixed(1)}" fill="${T}" />`
660
+ );
661
+ }
662
+ }
663
+ }
664
+ }
665
+ function Wt(t, e, r, n, o) {
666
+ const a = Q(e.y + e.height), i = Q(e.x);
667
+ t.push(
668
+ `<line x1="${e.x}" y1="${a}" x2="${e.x + e.width}" y2="${a}" stroke="${o.xAxis.lineColor}" stroke-width="${o.xAxis.lineWidth || 2}" />`
669
+ ), t.push(
670
+ `<line x1="${i}" y1="${e.y}" x2="${i}" y2="${e.y + e.height}" stroke="${o.yAxis.lineColor}" stroke-width="${o.yAxis.lineWidth || 2}" />`
671
+ );
672
+ }
673
+ function Vt(t, e, r, n, o, a) {
674
+ const i = a.xAxis, l = a.yAxis, s = (i == null ? void 0 : i.tickCount) ?? 8, c = (l == null ? void 0 : l.tickCount) ?? 6, u = r.domain[1] - r.domain[0], d = e.y + e.height, y = e.x, h = o.xAxis, g = o.yAxis;
675
+ (i == null ? void 0 : i.showLabels) !== !1 && r.ticks(s).forEach((w) => {
676
+ const b = ye(r.transform(w));
677
+ if (b < e.x || b > e.x + e.width) return;
678
+ const m = Ne(w, i, u), v = d + (h.tickLength ?? 4) + h.labelSize * 0.75;
679
+ t.push(
680
+ `<text x="${b.toFixed(1)}" y="${v.toFixed(1)}" fill="${h.labelColor}" font-size="${h.labelSize}" text-anchor="middle">${Ce(m)}</text>`
681
+ );
682
+ }), (l == null ? void 0 : l.showLabels) !== !1 && n.ticks(c).forEach((w) => {
683
+ const b = ye(n.transform(w));
684
+ if (b < e.y || b > e.y + e.height) return;
685
+ const m = Ue(w, l), v = y - (g.tickLength ?? 4) - 4;
686
+ t.push(
687
+ `<text x="${v.toFixed(1)}" y="${(b + g.labelSize * 0.35).toFixed(1)}" fill="${g.labelColor}" font-size="${g.labelSize}" text-anchor="end">${Ce(m)}</text>`
688
+ );
689
+ });
690
+ }
691
+ function Gt(t, e, r, n, o) {
692
+ o.grid.visible && (r.ticks(10).forEach((a) => {
693
+ const i = Q(r.transform(a));
694
+ i >= e.x && i <= e.x + e.width && t.push(
695
+ `<line x1="${i.toFixed(1)}" y1="${e.y}" x2="${i.toFixed(1)}" y2="${e.y + e.height}" stroke="${o.grid.majorColor}" stroke-opacity="0.1" stroke-dasharray="2,2" />`
696
+ );
697
+ }), n.ticks(10).forEach((a) => {
698
+ const i = Q(n.transform(a));
699
+ i >= e.y && i <= e.y + e.height && t.push(
700
+ `<line x1="${e.x}" y1="${i.toFixed(1)}" x2="${e.x + e.width}" y2="${i.toFixed(1)}" stroke="${o.grid.majorColor}" stroke-opacity="0.1" stroke-dasharray="2,2" />`
701
+ );
702
+ }));
703
+ }
704
+ let Me = !1;
705
+ function Ot() {
706
+ Me || (Me = !0, ue.prototype.exportSVG = function() {
707
+ const t = this, e = t.container.getBoundingClientRect();
708
+ return Yt(
709
+ t.getAllSeries(),
710
+ t.viewBounds,
711
+ t.getPlotArea(),
712
+ t.xScale,
713
+ t.yScales,
714
+ t.theme,
715
+ e.width || t.container.clientWidth,
716
+ e.height || t.container.clientHeight,
717
+ {
718
+ xAxis: t.xAxisOptions,
719
+ yAxis: t.yAxisOptionsMap.get(t.primaryYAxisId),
720
+ primaryYAxisId: t.primaryYAxisId
721
+ }
722
+ );
723
+ });
724
+ }
725
+ class Ht {
726
+ constructor(e, r) {
727
+ W(this, "alerts", /* @__PURE__ */ new Map());
728
+ W(this, "idCounter", 0);
729
+ this.events = e, this.getSeries = r;
730
+ }
731
+ addAlert(e) {
732
+ const r = e.id ?? `alert_${++this.idCounter}`;
733
+ return this.alerts.set(r, { ...e, id: r }), r;
734
+ }
735
+ removeAlert(e) {
736
+ return this.alerts.delete(e);
737
+ }
738
+ clearAlerts() {
739
+ this.alerts.clear();
740
+ }
741
+ getAlerts() {
742
+ return Array.from(this.alerts.values());
743
+ }
744
+ /** Call after data updates / render tick. */
745
+ evaluate() {
746
+ for (const [e, r] of [...this.alerts.entries()]) {
747
+ const n = this.getSeries(r.seriesId);
748
+ if (!n) continue;
749
+ const o = n.getData(), a = o.close ?? o.y;
750
+ if (!(a != null && a.length)) continue;
751
+ const i = a[a.length - 1];
752
+ if (!Number.isFinite(i)) continue;
753
+ const l = a.length > 1 ? a[a.length - 2] : i;
754
+ let s = !1;
755
+ switch (r.direction) {
756
+ case "above":
757
+ s = i >= r.price;
758
+ break;
759
+ case "below":
760
+ s = i <= r.price;
761
+ break;
762
+ case "cross":
763
+ s = l < r.price && i >= r.price || l > r.price && i <= r.price;
764
+ break;
765
+ }
766
+ if (!s) continue;
767
+ const c = {
768
+ id: e,
769
+ price: r.price,
770
+ direction: r.direction,
771
+ seriesId: r.seriesId ?? n.getId(),
772
+ triggeredAt: Date.now(),
773
+ triggerPrice: i
774
+ };
775
+ this.events.emit("alert", c), r.once !== !1 && this.alerts.delete(e);
776
+ }
777
+ }
778
+ destroy() {
779
+ this.alerts.clear();
780
+ }
781
+ }
782
+ const zt = {
783
+ entry: "#38bdf8",
784
+ sl: "#ef4444",
785
+ tp: "#22c55e"
786
+ }, Nt = {
787
+ entry: "Entry",
788
+ sl: "SL",
789
+ tp: "TP"
790
+ };
791
+ function Ut(t, e) {
792
+ const r = t.style ?? "entry";
793
+ return {
794
+ id: e,
795
+ type: "horizontal-line",
796
+ y: t.price,
797
+ color: t.color ?? zt[r],
798
+ label: t.label ?? Nt[r],
799
+ labelPosition: "right",
800
+ lineDash: r === "sl" ? [6, 4] : r === "tp" ? [4, 4] : void 0,
801
+ interactive: t.interactive ?? !1
802
+ };
803
+ }
804
+ let Fe = !1;
805
+ function qt() {
806
+ at((t, e) => {
807
+ var n, o;
808
+ if (e.type === "heatmap" || e.type === "indicator")
809
+ return e;
810
+ let r = { ...e };
811
+ if (r.type === "heikin-ashi") {
812
+ const a = r.data;
813
+ if (a != null && a.open && a.high && a.low && a.close) {
814
+ const i = ze({
815
+ open: a.open,
816
+ high: a.high,
817
+ low: a.low,
818
+ close: a.close
819
+ });
820
+ r = {
821
+ ...r,
822
+ type: "candlestick",
823
+ data: { ...a, ...i }
824
+ };
825
+ }
826
+ }
827
+ if (ge(t.xAxisOptions) && ((o = (n = r.data) == null ? void 0 : n.x) != null && o.length)) {
828
+ const { displayX: a, mapping: i } = pe(
829
+ r.data.x,
830
+ t.xAxisOptions
831
+ );
832
+ t.setTimeScaleMapping(i), r = {
833
+ ...r,
834
+ data: { ...r.data, x: a }
835
+ };
836
+ }
837
+ return r;
838
+ }), it((t) => t.type === "indicator" ? je(t) : [t]), st((t, e) => {
839
+ if (e.x && ge(t.xAxisOptions)) {
840
+ const { displayX: r, mapping: n } = pe(e.x, t.xAxisOptions);
841
+ return t.setTimeScaleMapping(n), { ...e, x: r };
842
+ }
843
+ return e;
844
+ });
845
+ }
846
+ function jt() {
847
+ const t = ue.prototype;
848
+ if (t._tradingPatched) return;
849
+ t._tradingPatched = !0, t.addIndicator = async function(r, n) {
850
+ return qe(this, r, n);
851
+ }, t.addAlert = function(r) {
852
+ return ie(this).addAlert(r);
853
+ }, t.removeAlert = function(r) {
854
+ return ie(this).removeAlert(r);
855
+ }, t.clearAlerts = function() {
856
+ ie(this).clearAlerts();
857
+ }, t.getAlerts = function() {
858
+ return ie(this).getAlerts();
859
+ }, t.addPositionLine = function(r) {
860
+ const n = this;
861
+ n._positionLineCounter === void 0 && (n._positionLineCounter = 0);
862
+ const o = r.id ?? `position-${++n._positionLineCounter}`;
863
+ return n.addAnnotation(Ut(r, o)), o;
864
+ }, t.setDrawingMode = function(r) {
865
+ var o;
866
+ const n = this.getPlugin(
867
+ "velo-plot-drawing-tools"
868
+ );
869
+ (o = n == null ? void 0 : n.setMode) == null || o.call(n, r);
870
+ };
871
+ const e = t.destroy;
872
+ t.destroy = function() {
873
+ var n;
874
+ const r = this;
875
+ return (n = r._alertManager) == null || n.destroy(), r._alertManager = void 0, r.setFeatureHooks(null), e.call(this);
876
+ };
877
+ }
878
+ function ie(t) {
879
+ const e = t;
880
+ return e._alertManager || (e._alertManager = new Ht(t.events, (r) => {
881
+ const n = r ? t.series.get(r) : void 0;
882
+ return n || t.series.values().next().value;
883
+ }), t.setFeatureHooks({
884
+ onDataUpdate: () => {
885
+ var r;
886
+ return (r = e._alertManager) == null ? void 0 : r.evaluate();
887
+ },
888
+ getAlerts: () => {
889
+ var r;
890
+ return ((r = e._alertManager) == null ? void 0 : r.getAlerts()) ?? [];
891
+ },
892
+ destroy: () => {
893
+ var r;
894
+ return (r = e._alertManager) == null ? void 0 : r.destroy();
895
+ }
896
+ })), e._alertManager;
897
+ }
898
+ function Ie() {
899
+ Fe || (Fe = !0, _t(), qt(), jt(), Ot());
900
+ }
901
+ Ie();
902
+ class Re {
903
+ constructor(e, r = {}) {
904
+ W(this, "available");
905
+ W(this, "canvas");
906
+ W(this, "adapter");
907
+ W(this, "device");
908
+ W(this, "context");
909
+ this.canvas = e, this.available = Re.isSupported();
59
910
  }
60
911
  static isSupported() {
61
912
  return typeof globalThis.navigator < "u" && typeof globalThis.navigator.gpu < "u";
62
913
  }
63
914
  async init(e = {}) {
64
915
  if (!this.available)
65
- throw new Error("[SciPlot] WebGPU is not supported in this environment");
66
- const t = globalThis.navigator.gpu;
67
- if (this.adapter = await t.requestAdapter({
916
+ throw new Error("[VeloPlot] WebGPU is not supported in this environment");
917
+ const r = globalThis.navigator.gpu;
918
+ if (this.adapter = await r.requestAdapter({
68
919
  powerPreference: e.powerPreference ?? "high-performance"
69
920
  }), !this.adapter)
70
- throw new Error("[SciPlot] Failed to request WebGPU adapter");
921
+ throw new Error("[VeloPlot] Failed to request WebGPU adapter");
71
922
  this.device = await this.adapter.requestDevice();
72
- const o = this.canvas.getContext("webgpu");
73
- if (!o)
74
- throw new Error("[SciPlot] Failed to get WebGPU context");
75
- this.context = o;
76
- const r = e.preferredFormat ?? (t.getPreferredCanvasFormat ? t.getPreferredCanvasFormat() : "bgra8unorm");
923
+ const n = this.canvas.getContext("webgpu");
924
+ if (!n)
925
+ throw new Error("[VeloPlot] Failed to get WebGPU context");
926
+ this.context = n;
927
+ const o = e.preferredFormat ?? (r.getPreferredCanvasFormat ? r.getPreferredCanvasFormat() : "bgra8unorm");
77
928
  this.context.configure({
78
929
  device: this.device,
79
- format: r,
930
+ format: o,
80
931
  alphaMode: "premultiplied"
81
932
  });
82
933
  }
83
- destroy() {
84
- this.device = void 0, this.adapter = void 0, this.context = void 0;
934
+ destroy() {
935
+ this.device = void 0, this.adapter = void 0, this.context = void 0;
936
+ }
937
+ }
938
+ const Kt = `
939
+ attribute vec2 aPosition;
940
+ uniform vec2 uResolution;
941
+ void main() {
942
+ vec2 clip = (aPosition / uResolution) * 2.0 - 1.0;
943
+ gl_Position = vec4(clip.x, -clip.y, 0.0, 1.0);
944
+ }
945
+ `, Jt = `
946
+ precision mediump float;
947
+ uniform vec4 uColor;
948
+ void main() {
949
+ gl_FragColor = uColor;
950
+ }
951
+ `;
952
+ function Ee(t, e, r) {
953
+ const n = t.createShader(e);
954
+ if (!n) throw new Error("createShader failed");
955
+ if (t.shaderSource(n, r), t.compileShader(n), !t.getShaderParameter(n, t.COMPILE_STATUS))
956
+ throw new Error(t.getShaderInfoLog(n) ?? "shader compile failed");
957
+ return n;
958
+ }
959
+ function Qt(t) {
960
+ const e = Ee(t, t.VERTEX_SHADER, Kt), r = Ee(t, t.FRAGMENT_SHADER, Jt), n = t.createProgram();
961
+ if (!n) throw new Error("createProgram failed");
962
+ if (t.attachShader(n, e), t.attachShader(n, r), t.linkProgram(n), !t.getProgramParameter(n, t.LINK_STATUS))
963
+ throw new Error(t.getProgramInfoLog(n) ?? "program link failed");
964
+ return t.deleteShader(e), t.deleteShader(r), n;
965
+ }
966
+ function Zt(t) {
967
+ const { plotArea: e, xLines: r, yLines: n } = t, o = e.y, a = e.y + e.height, i = e.x, l = e.x + e.width, s = (r.length + n.length) * 2, c = new Float32Array(s * 2);
968
+ let u = 0;
969
+ for (const d of r)
970
+ c[u++] = d, c[u++] = o, c[u++] = d, c[u++] = a;
971
+ for (const d of n)
972
+ c[u++] = i, c[u++] = d, c[u++] = l, c[u++] = d;
973
+ return c;
974
+ }
975
+ class er {
976
+ constructor(e) {
977
+ W(this, "gl");
978
+ W(this, "program");
979
+ W(this, "buffer");
980
+ W(this, "aPosition");
981
+ W(this, "uResolution");
982
+ W(this, "uColor");
983
+ const r = e.getContext("webgl", {
984
+ alpha: !0,
985
+ antialias: !1,
986
+ preserveDrawingBuffer: !0
987
+ });
988
+ if (!r) throw new Error("WebGL not available for grid spike");
989
+ this.gl = r, this.program = Qt(r), this.aPosition = r.getAttribLocation(this.program, "aPosition"), this.uResolution = r.getUniformLocation(this.program, "uResolution"), this.uColor = r.getUniformLocation(this.program, "uColor");
990
+ const n = r.createBuffer();
991
+ if (!n) throw new Error("createBuffer failed");
992
+ this.buffer = n;
993
+ }
994
+ /** Upload vertices and draw grid lines */
995
+ draw(e) {
996
+ const r = this.gl, n = Zt(e), o = n.length / 4;
997
+ r.viewport(0, 0, e.width, e.height), r.clearColor(0.04, 0.05, 0.08, 1), r.clear(r.COLOR_BUFFER_BIT), r.useProgram(this.program), r.bindBuffer(r.ARRAY_BUFFER, this.buffer), r.bufferData(r.ARRAY_BUFFER, n, r.DYNAMIC_DRAW), r.enableVertexAttribArray(this.aPosition), r.vertexAttribPointer(this.aPosition, 2, r.FLOAT, !1, 0, 0), r.uniform2f(this.uResolution, e.width, e.height);
998
+ const a = e.color ?? [0.2, 0.22, 0.3, 0.6];
999
+ return r.uniform4f(this.uColor, a[0], a[1], a[2], a[3]), r.lineWidth(e.lineWidth ?? 1), r.drawArrays(r.LINES, 0, n.length / 2), o;
1000
+ }
1001
+ destroy() {
1002
+ const e = this.gl;
1003
+ e.deleteBuffer(this.buffer), e.deleteProgram(this.program);
1004
+ }
1005
+ }
1006
+ function tr(t) {
1007
+ const e = () => {
1008
+ };
1009
+ return {
1010
+ canvas: t,
1011
+ strokeStyle: "",
1012
+ fillStyle: "",
1013
+ lineWidth: 1,
1014
+ font: "",
1015
+ textAlign: "left",
1016
+ textBaseline: "alphabetic",
1017
+ beginPath: e,
1018
+ moveTo: e,
1019
+ lineTo: e,
1020
+ stroke: e,
1021
+ fill: e,
1022
+ clearRect: e,
1023
+ setTransform: e,
1024
+ setLineDash: e,
1025
+ save: e,
1026
+ restore: e,
1027
+ translate: e,
1028
+ rotate: e,
1029
+ fillText: e,
1030
+ measureText: (r) => ({ width: r.length * 7 })
1031
+ };
1032
+ }
1033
+ function rr(t, e) {
1034
+ const r = document.createElement("canvas");
1035
+ return r.width = t, r.height = e, r.getContext("2d") ?? tr(r);
1036
+ }
1037
+ function $e(t, e) {
1038
+ const r = { top: 40, right: 40, bottom: 50, left: 60 };
1039
+ return {
1040
+ x: r.left,
1041
+ y: r.top,
1042
+ width: t - r.left - r.right,
1043
+ height: e - r.top - r.bottom
1044
+ };
1045
+ }
1046
+ function Be(t, e, r, n, o) {
1047
+ const a = e.ticks(n).map((l) => Q(e.transform(l))), i = r.ticks(o).map((l) => Q(r.transform(l)));
1048
+ return { xLines: a, yLines: i };
1049
+ }
1050
+ function _e(t, e) {
1051
+ const r = [];
1052
+ for (let a = 0; a < e; a++) {
1053
+ const i = performance.now();
1054
+ t(), r.push((performance.now() - i) * 1e3);
1055
+ }
1056
+ r.sort((a, i) => a - i);
1057
+ const n = r.reduce((a, i) => a + i, 0) / r.length, o = r[Math.floor(r.length * 0.95)] ?? n;
1058
+ return { avg: n, p95: o };
1059
+ }
1060
+ function nr(t = {}) {
1061
+ const e = Math.round((t.width ?? 1920) * (t.dpr ?? 1)), r = Math.round((t.height ?? 1080) * (t.dpr ?? 1)), n = t.xTickCount ?? 24, o = t.yTickCount ?? 16, a = t.frames ?? 120, i = rr(e, r), l = {
1062
+ ...xe,
1063
+ grid: {
1064
+ ...xe.grid,
1065
+ visible: !0,
1066
+ showMinor: t.showMinor ?? !0
1067
+ }
1068
+ }, s = $e(e, r), c = new se(), u = new se();
1069
+ c.setDomain(0, 1e6), u.setDomain(-1, 1), c.setRange(s.x, s.x + s.width), u.setRange(s.y + s.height, s.y);
1070
+ const d = new lt(i, l), { avg: y, p95: h } = _e(() => {
1071
+ i.clearRect(0, 0, e, r), d.drawGrid(s, c, u, { tickCount: n }, { tickCount: o });
1072
+ }, a), { xLines: g, yLines: w } = Be(s, c, u, n, o);
1073
+ return {
1074
+ backend: "canvas2d",
1075
+ dpr: t.dpr ?? 1,
1076
+ width: e,
1077
+ height: r,
1078
+ xTicks: n,
1079
+ yTicks: o,
1080
+ lineSegments: g.length + w.length,
1081
+ avgFrameUs: Math.round(y),
1082
+ p95FrameUs: Math.round(h),
1083
+ frames: a
1084
+ };
1085
+ }
1086
+ function or(t = {}) {
1087
+ const e = Math.round((t.width ?? 1920) * (t.dpr ?? 1)), r = Math.round((t.height ?? 1080) * (t.dpr ?? 1)), n = t.xTickCount ?? 24, o = t.yTickCount ?? 16, a = t.frames ?? 120, i = document.createElement("canvas");
1088
+ i.width = e, i.height = r;
1089
+ let l;
1090
+ try {
1091
+ l = new er(i);
1092
+ } catch {
1093
+ return null;
1094
+ }
1095
+ const s = $e(e, r), c = new se(), u = new se();
1096
+ c.setDomain(0, 1e6), u.setDomain(-1, 1), c.setRange(s.x, s.x + s.width), u.setRange(s.y + s.height, s.y);
1097
+ const { xLines: d, yLines: y } = Be(s, c, u, n, o), h = { plotArea: s, xLines: d, yLines: y, width: e, height: r };
1098
+ let g = 0;
1099
+ const { avg: w, p95: b } = _e(() => {
1100
+ g = l.draw(h);
1101
+ }, a);
1102
+ return l.destroy(), {
1103
+ backend: "webgl",
1104
+ dpr: t.dpr ?? 1,
1105
+ width: e,
1106
+ height: r,
1107
+ xTicks: n,
1108
+ yTicks: o,
1109
+ lineSegments: g,
1110
+ avgFrameUs: Math.round(w),
1111
+ p95FrameUs: Math.round(b),
1112
+ frames: a
1113
+ };
1114
+ }
1115
+ function kr(t) {
1116
+ const e = (t == null ? void 0 : t.dpr) ?? 2, r = (t == null ? void 0 : t.frames) ?? 120, n = nr({ dpr: e, frames: r, showMinor: !0 }), o = or({ dpr: e, frames: r });
1117
+ if (!o)
1118
+ return {
1119
+ canvas2d: n,
1120
+ webgl: null,
1121
+ gainPercent: 0,
1122
+ recommendation: "defer"
1123
+ };
1124
+ const a = (n.avgFrameUs - o.avgFrameUs) / n.avgFrameUs * 100;
1125
+ return {
1126
+ canvas2d: n,
1127
+ webgl: o,
1128
+ gainPercent: Math.round(a * 10) / 10,
1129
+ recommendation: a >= 20 ? "implement" : "defer"
1130
+ };
1131
+ }
1132
+ const ar = "1.17.0", ir = "2026-07-05", sr = "Stage 1 baselines. Headless CI uses effective FPS (render throughput when rAF throttled) via scripts/benchmark-scenario-eval.mjs smoke floors.", lr = 0.1, cr = 0.95, ur = {
1133
+ "line-1m-pan": {
1134
+ minAvgFps: 50,
1135
+ maxAvgFrameTimeMs: 20,
1136
+ points: 1e6,
1137
+ description: "1M line points, continuous pan/zoom simulation"
1138
+ },
1139
+ "candlestick-500k": {
1140
+ minAvgFps: 45,
1141
+ maxAvgFrameTimeMs: 22,
1142
+ points: 5e5,
1143
+ description: "500k OHLC bars with PluginVirtualization"
1144
+ },
1145
+ "stack-5pane-resize": {
1146
+ minAvgFps: 48,
1147
+ maxAvgFrameTimeMs: 21,
1148
+ description: "5-pane stack divider drag (batched overlay redraw)"
1149
+ },
1150
+ "line-200k-webgl": {
1151
+ minAvgFps: 45,
1152
+ description: "200k line WebGL baseline for renderer compare"
1153
+ },
1154
+ "line-200k-webgpu": {
1155
+ minAvgFps: 42,
1156
+ description: "200k line WebGPU — target ≥95% of WebGL FPS"
1157
+ },
1158
+ "boxplot-5k-webgpu": {
1159
+ minAvgFps: 50,
1160
+ description: "5k boxplot series on WebGPU chart path"
1161
+ },
1162
+ "grid-canvas2d-dpr2": {
1163
+ maxAvgFrameUs: 1200,
1164
+ dpr: 2,
1165
+ description: "Canvas 2D grid+minor at 1920×1080 @2x"
1166
+ },
1167
+ "grid-webgl-dpr2": {
1168
+ maxAvgFrameUs: 400,
1169
+ dpr: 2,
1170
+ description: "WebGL grid spike lines only @2x"
1171
+ }
1172
+ }, ce = {
1173
+ version: ar,
1174
+ recordedAt: ir,
1175
+ notes: sr,
1176
+ regressionThreshold: lr,
1177
+ webgpuMinFpsRatio: cr,
1178
+ scenarios: ur
1179
+ };
1180
+ function Ir() {
1181
+ return ce;
1182
+ }
1183
+ function Rr(t, e) {
1184
+ const r = ce.scenarios[t];
1185
+ if (!r)
1186
+ return { passed: !0, failures: [] };
1187
+ const n = [], o = ce.regressionThreshold ?? 0.1;
1188
+ if ("avgFps" in e && r.minAvgFps !== void 0) {
1189
+ const a = r.minAvgFps * (1 - o);
1190
+ e.avgFps < a && n.push(
1191
+ `FPS ${e.avgFps} < baseline min ${r.minAvgFps} (allowed ${a.toFixed(1)} with ${o * 100}% slack)`
1192
+ );
1193
+ }
1194
+ if ("avgFrameTime" in e && r.maxAvgFrameTimeMs !== void 0) {
1195
+ const a = r.maxAvgFrameTimeMs * (1 + o);
1196
+ e.avgFrameTime > a && n.push(
1197
+ `Frame time ${e.avgFrameTime}ms > baseline max ${r.maxAvgFrameTimeMs}ms`
1198
+ );
1199
+ }
1200
+ if ("avgFrameUs" in e && r.maxAvgFrameUs !== void 0) {
1201
+ const a = r.maxAvgFrameUs * (1 + o);
1202
+ e.avgFrameUs > a && n.push(
1203
+ `Grid frame ${e.avgFrameUs}µs > baseline max ${r.maxAvgFrameUs}µs`
1204
+ );
1205
+ }
1206
+ return { passed: n.length === 0, failures: n };
1207
+ }
1208
+ function $r(t, e, r, n = 0.95) {
1209
+ if (!r || !e)
1210
+ return {
1211
+ webgl: t,
1212
+ webgpu: e,
1213
+ webgpuActive: !1,
1214
+ fpsRatio: 0,
1215
+ meetsTarget: !1,
1216
+ recommendation: "webgpu-unavailable"
1217
+ };
1218
+ const o = t.avgFps > 0 ? e.avgFps / t.avgFps : 0, a = o >= n;
1219
+ return {
1220
+ webgl: t,
1221
+ webgpu: e,
1222
+ webgpuActive: !0,
1223
+ fpsRatio: o,
1224
+ meetsTarget: a,
1225
+ recommendation: a ? "webgpu-ready" : "webgl-faster"
1226
+ };
1227
+ }
1228
+ class dr {
1229
+ constructor(e) {
1230
+ W(this, "seed");
1231
+ this.seed = e;
1232
+ }
1233
+ next() {
1234
+ let e = this.seed += 1831565813;
1235
+ return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
1236
+ }
1237
+ nextRange(e, r) {
1238
+ return e + this.next() * (r - e);
1239
+ }
1240
+ }
1241
+ function Br(t) {
1242
+ const e = {
1243
+ pointCount: 1e3,
1244
+ amplitude: 1,
1245
+ frequency: 1,
1246
+ phase: 0,
1247
+ noise: 0,
1248
+ xStart: 0,
1249
+ xEnd: 10,
1250
+ offset: 0,
1251
+ ...t
1252
+ }, r = new Float32Array(e.pointCount), n = new Float32Array(e.pointCount), o = (e.xEnd - e.xStart) / (e.pointCount - 1);
1253
+ for (let a = 0; a < e.pointCount; a++) {
1254
+ r[a] = e.xStart + a * o;
1255
+ const i = e.amplitude * Math.sin(2 * Math.PI * e.frequency * r[a] + e.phase), l = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
1256
+ n[a] = i + l + e.offset;
1257
+ }
1258
+ return { x: r, y: n };
1259
+ }
1260
+ function _r(t) {
1261
+ const e = {
1262
+ pointCount: 1e3,
1263
+ amplitude: 1,
1264
+ frequency: 1,
1265
+ phase: 0,
1266
+ noise: 0,
1267
+ xStart: 0,
1268
+ xEnd: 10,
1269
+ offset: 0,
1270
+ ...t
1271
+ }, r = new Float32Array(e.pointCount), n = new Float32Array(e.pointCount), o = (e.xEnd - e.xStart) / (e.pointCount - 1);
1272
+ for (let a = 0; a < e.pointCount; a++) {
1273
+ r[a] = e.xStart + a * o;
1274
+ const i = r[a] * e.frequency + e.phase / (2 * Math.PI), l = Math.sign(Math.sin(2 * Math.PI * i)) * e.amplitude, s = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
1275
+ n[a] = l + s + e.offset;
1276
+ }
1277
+ return { x: r, y: n };
1278
+ }
1279
+ function Yr(t) {
1280
+ const e = {
1281
+ pointCount: 1e3,
1282
+ amplitude: 1,
1283
+ frequency: 1,
1284
+ phase: 0,
1285
+ noise: 0,
1286
+ xStart: 0,
1287
+ xEnd: 10,
1288
+ offset: 0,
1289
+ ...t
1290
+ }, r = new Float32Array(e.pointCount), n = new Float32Array(e.pointCount), o = (e.xEnd - e.xStart) / (e.pointCount - 1);
1291
+ for (let a = 0; a < e.pointCount; a++) {
1292
+ r[a] = e.xStart + a * o;
1293
+ const i = r[a] * e.frequency + e.phase / (2 * Math.PI), l = e.amplitude * 2 * (i - Math.floor(i + 0.5)), s = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
1294
+ n[a] = l + s + e.offset;
1295
+ }
1296
+ return { x: r, y: n };
1297
+ }
1298
+ function Xr(t) {
1299
+ const e = {
1300
+ pointCount: 1e3,
1301
+ amplitude: 1,
1302
+ frequency: 1,
1303
+ phase: 0,
1304
+ noise: 0,
1305
+ xStart: 0,
1306
+ xEnd: 10,
1307
+ offset: 0,
1308
+ ...t
1309
+ }, r = new Float32Array(e.pointCount), n = new Float32Array(e.pointCount), o = (e.xEnd - e.xStart) / (e.pointCount - 1);
1310
+ for (let a = 0; a < e.pointCount; a++) {
1311
+ r[a] = e.xStart + a * o;
1312
+ const i = r[a] * e.frequency + e.phase / (2 * Math.PI), l = e.amplitude * 2 * Math.abs(2 * (i - Math.floor(i + 0.5))) - e.amplitude, s = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
1313
+ n[a] = l + s + e.offset;
1314
+ }
1315
+ return { x: r, y: n };
1316
+ }
1317
+ function Wr(t) {
1318
+ const e = {
1319
+ pointCount: 1e3,
1320
+ xRange: [0, 100],
1321
+ yRange: [-1, 1],
1322
+ sorted: !0,
1323
+ seed: Date.now(),
1324
+ ...t
1325
+ }, r = new dr(e.seed), n = new Float32Array(e.pointCount), o = new Float32Array(e.pointCount);
1326
+ for (let a = 0; a < e.pointCount; a++)
1327
+ n[a] = r.nextRange(e.xRange[0], e.xRange[1]), o[a] = r.nextRange(e.yRange[0], e.yRange[1]);
1328
+ if (e.sorted) {
1329
+ const a = Array.from({ length: e.pointCount }, (s, c) => c);
1330
+ a.sort((s, c) => n[s] - n[c]);
1331
+ const i = new Float32Array(e.pointCount), l = new Float32Array(e.pointCount);
1332
+ for (let s = 0; s < e.pointCount; s++)
1333
+ i[s] = n[a[s]], l[s] = o[a[s]];
1334
+ return { x: i, y: l };
1335
+ }
1336
+ return { x: n, y: o };
1337
+ }
1338
+ function Vr(t) {
1339
+ const e = {
1340
+ pointCount: 2e3,
1341
+ vMin: -0.5,
1342
+ vMax: 0.5,
1343
+ cycles: 1,
1344
+ peakCurrent: 1e-5,
1345
+ // 10 µA
1346
+ noise: 0.02,
1347
+ ...t
1348
+ }, r = e.pointCount * e.cycles, n = new Float32Array(r), o = new Float32Array(r), a = e.pointCount, i = a / 2;
1349
+ for (let l = 0; l < e.cycles; l++)
1350
+ for (let s = 0; s < a; s++) {
1351
+ const c = l * a + s;
1352
+ s < i ? n[c] = e.vMin + (e.vMax - e.vMin) * (s / i) : n[c] = e.vMax - (e.vMax - e.vMin) * ((s - i) / i);
1353
+ const u = n[c], d = 0, y = s < i ? 1 : -1, h = 0.1, g = -Math.pow(u - d, 2) / (2 * h * h), w = e.peakCurrent * Math.exp(g), b = y * e.peakCurrent * 0.1, m = (Math.random() - 0.5) * 2 * e.noise * e.peakCurrent;
1354
+ o[c] = y * w + b + m;
1355
+ }
1356
+ return { x: n, y: o };
1357
+ }
1358
+ function Gr(t) {
1359
+ const e = {
1360
+ pointCount: 50,
1361
+ rSolution: 100,
1362
+ // Ohms
1363
+ rCharge: 1e3,
1364
+ // Ohms
1365
+ frequency: [1e5, 0.01],
1366
+ ...t
1367
+ }, r = new Float32Array(e.pointCount), n = new Float32Array(e.pointCount), o = Math.log10(e.frequency[1]), a = Math.log10(e.frequency[0]);
1368
+ for (let i = 0; i < e.pointCount; i++) {
1369
+ const l = a - (a - o) * (i / (e.pointCount - 1)), s = 2 * Math.PI * Math.pow(10, l), c = e.rCharge * 1e-5, u = e.rSolution + e.rCharge / (1 + Math.pow(s * c, 2)), d = s * c * e.rCharge / (1 + Math.pow(s * c, 2));
1370
+ r[i] = u, n[i] = -d;
1371
+ }
1372
+ return { x: r, y: n };
1373
+ }
1374
+ async function Or(t, e) {
1375
+ const r = {
1376
+ duration: 5e3,
1377
+ warmup: 1e3,
1378
+ ...e
1379
+ }, n = [], o = [];
1380
+ let a = 0;
1381
+ const i = t.getAllSeries().reduce((l, s) => l + s.getPointCount(), 0);
1382
+ return new Promise((l) => {
1383
+ const s = performance.now() + r.warmup + r.duration, c = performance.now() + r.warmup;
1384
+ let u = !1, d = 0;
1385
+ function y() {
1386
+ const h = performance.now();
1387
+ if (h >= s) {
1388
+ const b = o.length > 0 ? o.reduce((T, S) => T + S, 0) / o.length : 0, m = d > 0 ? h - d : r.duration, v = a > 0 && m > 0 ? a / m * 1e3 : 0, p = n.length > 0 ? n.reduce((T, S) => T + S, 0) / n.length : b > 0 ? 1e3 / b : 0, f = {
1389
+ avgFps: Math.round(v * 100) / 100,
1390
+ minFps: Math.round((n.length > 0 ? Math.min(...n) : v) * 100) / 100,
1391
+ maxFps: Math.round((n.length > 0 ? Math.max(...n) : v) * 100) / 100,
1392
+ avgFrameTime: Math.round(b * 1e3) / 1e3,
1393
+ frameCount: a,
1394
+ duration: r.duration,
1395
+ pointsRendered: i,
1396
+ throughput: Math.round(i * v / 1e3) * 1e3,
1397
+ /** @internal render-only FPS (not wall clock) */
1398
+ ...p > 0 ? { renderFps: Math.round(p * 100) / 100 } : {}
1399
+ };
1400
+ l(f);
1401
+ return;
1402
+ }
1403
+ h >= c && !u && (u = !0, d = h, a = 0, o.length = 0, n.length = 0);
1404
+ const g = performance.now();
1405
+ t.render();
1406
+ const w = performance.now();
1407
+ if (u) {
1408
+ const b = w - g;
1409
+ o.push(b), a++;
1410
+ const m = o.slice(-30);
1411
+ if (m.length > 0) {
1412
+ const v = m.reduce((p, f) => p + f, 0) / m.length;
1413
+ v > 0 && n.push(1e3 / v);
1414
+ }
1415
+ }
1416
+ requestAnimationFrame(y);
1417
+ }
1418
+ requestAnimationFrame(y);
1419
+ });
1420
+ }
1421
+ function Hr(t, e) {
1422
+ const r = {
1423
+ format: "json",
1424
+ includeStyles: !0,
1425
+ ...e
1426
+ }, n = t.getAllSeries().map((a) => ({
1427
+ id: a.getId(),
1428
+ type: a.getType(),
1429
+ pointCount: a.getPointCount(),
1430
+ ...r.includeStyles ? { style: a.getStyle() } : {}
1431
+ })), o = {
1432
+ timestamp: Date.now(),
1433
+ config: {},
1434
+ series: n,
1435
+ bounds: t.getViewBounds()
1436
+ };
1437
+ return r.format === "png" && t.exportImage && (o.image = t.exportImage()), o;
1438
+ }
1439
+ function zr(t, e, r = 1e-6) {
1440
+ const n = [];
1441
+ t.series.length !== e.series.length && n.push(`Series count: ${t.series.length} vs ${e.series.length}`);
1442
+ for (let a = 0; a < Math.min(t.series.length, e.series.length); a++) {
1443
+ const i = t.series[a], l = e.series[a];
1444
+ i.id !== l.id && n.push(`Series[${a}] id: "${i.id}" vs "${l.id}"`), i.type !== l.type && n.push(`Series[${a}] type: "${i.type}" vs "${l.type}"`), i.pointCount !== l.pointCount && n.push(`Series[${a}] pointCount: ${i.pointCount} vs ${l.pointCount}`);
85
1445
  }
1446
+ const o = ["xMin", "xMax", "yMin", "yMax"];
1447
+ for (const a of o)
1448
+ Math.abs(t.bounds[a] - e.bounds[a]) > r && n.push(`Bounds.${a}: ${t.bounds[a]} vs ${e.bounds[a]}`);
1449
+ return {
1450
+ equal: n.length === 0,
1451
+ differences: n
1452
+ };
1453
+ }
1454
+ function Nr(t, e) {
1455
+ const r = [];
1456
+ return e.minFps && t.avgFps < e.minFps && r.push(`FPS ${t.avgFps} < required ${e.minFps}`), e.maxFrameTime && t.avgFrameTime > e.maxFrameTime && r.push(`Frame time ${t.avgFrameTime}ms > required ${e.maxFrameTime}ms`), e.minThroughput && t.throughput < e.minThroughput && r.push(`Throughput ${t.throughput} < required ${e.minThroughput}`), {
1457
+ passed: r.length === 0,
1458
+ failures: r
1459
+ };
86
1460
  }
87
- const we = {
1461
+ function Ur(t = 1) {
1462
+ return new Promise((e) => {
1463
+ let r = t;
1464
+ function n() {
1465
+ r--, r <= 0 ? e() : requestAnimationFrame(n);
1466
+ }
1467
+ requestAnimationFrame(n);
1468
+ });
1469
+ }
1470
+ function qr(t) {
1471
+ return new Promise((e) => setTimeout(e, t));
1472
+ }
1473
+ const fr = {
88
1474
  name: "crosshair",
89
1475
  version: "1.0.0",
90
1476
  description: "Interactive crosshair that follows mouse cursor",
91
1477
  provides: ["interaction", "visualization"],
92
1478
  tags: ["cursor", "crosshair", "tooltip"]
93
- }, Se = G(
94
- we,
95
- (n = {}) => {
1479
+ }, hr = Z(
1480
+ fr,
1481
+ (t = {}) => {
96
1482
  const {
97
1483
  showVertical: e = !0,
98
- showHorizontal: t = !0,
99
- color: o,
100
- lineStyle: r = "dashed",
1484
+ showHorizontal: r = !0,
1485
+ color: n,
1486
+ lineStyle: o = "dashed",
101
1487
  lineWidth: a = 1,
102
- snapToData: d = !1,
103
- valueFormat: c = { xPrecision: 4, yPrecision: 4 }
104
- } = n;
105
- let i = n.valueDisplayMode ?? "disabled";
106
- n.showAxisLabels !== void 0 && n.valueDisplayMode === void 0 && (i = n.showAxisLabels ? "floating" : "disabled");
107
- const s = n.cornerPosition ?? "top-left";
108
- let u = -1, h = -1, S, v = null, p = null;
1488
+ snapToData: i = !1,
1489
+ valueFormat: l = { xPrecision: 4, yPrecision: 4 }
1490
+ } = t;
1491
+ let s = t.valueDisplayMode ?? "disabled";
1492
+ t.showAxisLabels !== void 0 && t.valueDisplayMode === void 0 && (s = t.showAxisLabels ? "floating" : "disabled");
1493
+ const c = t.cornerPosition ?? "top-left";
1494
+ let u = -1, d = -1, y, h = null, g = null;
109
1495
  return {
110
- onInit(f) {
111
- S = "crosshair-overlay";
112
- const l = f.ui.createOverlay(S, {
1496
+ onInit(p) {
1497
+ y = "crosshair-overlay";
1498
+ const f = p.ui.createOverlay(y, {
113
1499
  zIndex: 500,
114
1500
  position: { top: "0", left: "0", right: "0", bottom: "0" }
115
1501
  });
116
- v = document.createElement("canvas"), v.style.cssText = "width: 100%; height: 100%;", l.appendChild(v), p = v.getContext("2d"), w(f);
1502
+ h = document.createElement("canvas"), h.style.cssText = "width: 100%; height: 100%;", f.appendChild(h), g = h.getContext("2d"), w(p);
117
1503
  },
118
- onDestroy(f) {
119
- f.ui.removeOverlay(S), v = null, p = null;
1504
+ onDestroy(p) {
1505
+ p.ui.removeOverlay(y), h = null, g = null;
120
1506
  },
121
- onResize(f) {
122
- w(f);
1507
+ onResize(p) {
1508
+ w(p);
123
1509
  },
124
- onInteraction(f, l) {
125
- if (l.type === "mousemove") {
126
- if (u = l.pixelX, h = l.pixelY, d && l.inPlotArea) {
127
- const P = f.coords.pickPoint(u, h);
128
- P && (u = P.pixelX, h = P.pixelY);
1510
+ onInteraction(p, f) {
1511
+ if (f.type === "mousemove") {
1512
+ if (u = f.pixelX, d = f.pixelY, i && f.inPlotArea) {
1513
+ const T = p.coords.pickPoint(u, d);
1514
+ T && (u = T.pixelX, d = T.pixelY);
129
1515
  }
130
- b(f);
1516
+ b(p);
131
1517
  }
132
1518
  },
133
1519
  onViewChange() {
134
1520
  }
135
1521
  };
136
- function w(f) {
137
- if (!v || !p) return;
138
- const l = f.render.canvasSize, P = f.render.pixelRatio;
139
- v.width = l.width * P, v.height = l.height * P, p.setTransform(1, 0, 0, 1, 0, 0), p.scale(P, P);
1522
+ function w(p) {
1523
+ if (!h || !g) return;
1524
+ const f = p.render.canvasSize, T = p.render.pixelRatio;
1525
+ h.width = f.width * T, h.height = f.height * T, g.setTransform(1, 0, 0, 1, 0, 0), g.scale(T, T);
140
1526
  }
141
- function b(f) {
142
- var C;
143
- if (!p || !v) return;
144
- const { width: l, height: P } = f.render.canvasSize;
145
- if (p.clearRect(0, 0, l, P), u < 0 || h < 0) return;
146
- const x = f.render.plotArea;
147
- if (u < x.x || u > x.x + x.width || h < x.y || h > x.y + x.height)
1527
+ function b(p) {
1528
+ var D;
1529
+ if (!g || !h) return;
1530
+ const { width: f, height: T } = p.render.canvasSize;
1531
+ if (g.clearRect(0, 0, f, T), u < 0 || d < 0) return;
1532
+ const S = p.render.plotArea;
1533
+ if (u < S.x || u > S.x + S.width || d < S.y || d > S.y + S.height)
148
1534
  return;
149
- const D = o || ((C = f.ui.theme.cursor) == null ? void 0 : C.color) || "#888888";
150
- p.save(), p.strokeStyle = D, p.lineWidth = a, r === "dashed" ? p.setLineDash([6, 4]) : r === "dotted" && p.setLineDash([2, 2]), e && (p.beginPath(), p.moveTo(u, x.y), p.lineTo(u, x.y + x.height), p.stroke()), t && (p.beginPath(), p.moveTo(x.x, h), p.lineTo(x.x + x.width, h), p.stroke()), p.restore(), i === "floating" ? g(f, p, u, h, D) : i === "corner" && y(f, p, u, h, D);
1535
+ const L = n || ((D = p.ui.theme.cursor) == null ? void 0 : D.color) || "#888888";
1536
+ g.save(), g.strokeStyle = L, g.lineWidth = a, o === "dashed" ? g.setLineDash([6, 4]) : o === "dotted" && g.setLineDash([2, 2]), e && (g.beginPath(), g.moveTo(u, S.y), g.lineTo(u, S.y + S.height), g.stroke()), r && (g.beginPath(), g.moveTo(S.x, d), g.lineTo(S.x + S.width, d), g.stroke()), g.restore(), s === "floating" ? m(p, g, u, d, L) : s === "corner" && v(p, g, u, d, L);
151
1537
  }
152
- function g(f, l, P, x, D) {
153
- const C = f.coords.pixelToDataX(P), B = f.coords.pixelToDataY(x), M = f.render.plotArea;
154
- l.save(), l.font = "11px system-ui, sans-serif", l.textAlign = "center", l.textBaseline = "top";
155
- const _ = C.toPrecision(c.xPrecision), A = l.measureText(_).width + 8, T = 18, I = P - A / 2, F = M.y + M.height + 2;
156
- l.fillStyle = D, l.fillRect(I, F, A, T), l.fillStyle = "#ffffff", l.fillText(_, P, F + 3), l.textAlign = "right", l.textBaseline = "middle";
157
- const k = B.toPrecision(c.yPrecision), X = l.measureText(k).width + 8, L = 18, R = M.x - X - 2, U = x - L / 2;
158
- l.fillStyle = D, l.fillRect(R, U, X, L), l.fillStyle = "#ffffff", l.fillText(k, M.x - 6, x), l.restore();
1538
+ function m(p, f, T, S, L) {
1539
+ const D = p.coords.pixelToDataX(T), k = p.coords.pixelToDataY(S), M = p.render.plotArea;
1540
+ f.save(), f.font = "11px system-ui, sans-serif", f.textAlign = "center", f.textBaseline = "top";
1541
+ const B = D.toPrecision(l.xPrecision), F = f.measureText(B).width + 8, C = 18, $ = T - F / 2, I = M.y + M.height + 2;
1542
+ f.fillStyle = L, f.fillRect($, I, F, C), f.fillStyle = "#ffffff", f.fillText(B, T, I + 3), f.textAlign = "right", f.textBaseline = "middle";
1543
+ const Y = k.toPrecision(l.yPrecision), x = f.measureText(Y).width + 8, A = 18, E = M.x - x - 2, _ = S - A / 2;
1544
+ f.fillStyle = L, f.fillRect(E, _, x, A), f.fillStyle = "#ffffff", f.fillText(Y, M.x - 6, S), f.restore();
159
1545
  }
160
- function y(f, l, P, x, D) {
161
- const C = f.coords.pixelToDataX(P), B = f.coords.pixelToDataY(x), M = f.render.plotArea;
162
- l.save(), l.font = "11px system-ui, sans-serif";
163
- const _ = `X: ${C.toPrecision(c.xPrecision)}`, m = `Y: ${B.toPrecision(c.yPrecision)}`, A = l.measureText(_), T = l.measureText(m), I = Math.max(A.width, T.width), F = 6, k = 16, E = I + F * 2, X = k * 2 + F * 2;
164
- let L, R;
165
- switch (s) {
1546
+ function v(p, f, T, S, L) {
1547
+ const D = p.coords.pixelToDataX(T), k = p.coords.pixelToDataY(S), M = p.render.plotArea;
1548
+ f.save(), f.font = "11px system-ui, sans-serif";
1549
+ const B = `X: ${D.toPrecision(l.xPrecision)}`, P = `Y: ${k.toPrecision(l.yPrecision)}`, F = f.measureText(B), C = f.measureText(P), $ = Math.max(F.width, C.width), I = 6, Y = 16, R = $ + I * 2, x = Y * 2 + I * 2;
1550
+ let A, E;
1551
+ switch (c) {
166
1552
  case "top-left":
167
- L = M.x + 8, R = M.y + 8;
1553
+ A = M.x + 8, E = M.y + 8;
168
1554
  break;
169
1555
  case "top-right":
170
- L = M.x + M.width - E - 8, R = M.y + 8;
1556
+ A = M.x + M.width - R - 8, E = M.y + 8;
171
1557
  break;
172
1558
  case "bottom-left":
173
- L = M.x + 8, R = M.y + M.height - X - 8;
1559
+ A = M.x + 8, E = M.y + M.height - x - 8;
174
1560
  break;
175
1561
  case "bottom-right":
176
- L = M.x + M.width - E - 8, R = M.y + M.height - X - 8;
1562
+ A = M.x + M.width - R - 8, E = M.y + M.height - x - 8;
177
1563
  break;
178
1564
  default:
179
- L = M.x + 8, R = M.y + 8;
1565
+ A = M.x + 8, E = M.y + 8;
180
1566
  }
181
- l.fillStyle = D, l.globalAlpha = 0.85, l.fillRect(L, R, E, X), l.globalAlpha = 1, l.strokeStyle = "rgba(255,255,255,0.3)", l.lineWidth = 1, l.strokeRect(L, R, E, X), l.fillStyle = "#ffffff", l.textAlign = "left", l.textBaseline = "top", l.fillText(_, L + F, R + F), l.fillText(m, L + F, R + F + k), l.restore();
1567
+ f.fillStyle = L, f.globalAlpha = 0.85, f.fillRect(A, E, R, x), f.globalAlpha = 1, f.strokeStyle = "rgba(255,255,255,0.3)", f.lineWidth = 1, f.strokeRect(A, E, R, x), f.fillStyle = "#ffffff", f.textAlign = "left", f.textBaseline = "top", f.fillText(B, A + I, E + I), f.fillText(P, A + I, E + I + Y), f.restore();
182
1568
  }
183
1569
  }
184
- ), Te = {
1570
+ ), gr = {
185
1571
  name: "statistics-overlay",
186
1572
  version: "1.0.0",
187
1573
  description: "Displays real-time statistics for chart data",
188
1574
  provides: ["visualization", "analysis"],
189
1575
  tags: ["statistics", "overlay", "analytics"]
190
- }, be = G(
191
- Te,
192
- (n = {}) => {
1576
+ }, pr = Z(
1577
+ gr,
1578
+ (t = {}) => {
193
1579
  const {
194
1580
  position: e = "top-right",
195
- show: t = ["count", "mean", "min", "max"],
196
- seriesId: o,
197
- autoUpdate: r = !0
198
- } = n;
199
- let a, d = null;
1581
+ show: r = ["count", "mean", "min", "max"],
1582
+ seriesId: n,
1583
+ autoUpdate: o = !0
1584
+ } = t;
1585
+ let a, i = null;
200
1586
  return {
201
- onInit(s) {
1587
+ onInit(c) {
202
1588
  a = "stats-overlay";
203
1589
  const u = {};
204
- e.includes("top") && (u.top = "10px"), e.includes("bottom") && (u.bottom = "10px"), e.includes("left") && (u.left = "10px"), e.includes("right") && (u.right = "10px"), d = s.ui.createOverlay(a, {
1590
+ e.includes("top") && (u.top = "10px"), e.includes("bottom") && (u.bottom = "10px"), e.includes("left") && (u.left = "10px"), e.includes("right") && (u.right = "10px"), i = c.ui.createOverlay(a, {
205
1591
  zIndex: 800,
206
1592
  position: u,
207
1593
  pointerEvents: !1
208
- }), d.innerHTML = `
1594
+ }), i.innerHTML = `
209
1595
  <div style="
210
1596
  background: rgba(0, 0, 0, 0.85);
211
1597
  color: #fff;
@@ -219,188 +1605,188 @@ const we = {
219
1605
  <div style="font-weight: bold; margin-bottom: 4px; color: #4ade80;">📊 Statistics</div>
220
1606
  <div class="stats-content"></div>
221
1607
  </div>
222
- `, c(s);
1608
+ `, l(c);
223
1609
  },
224
- onDestroy(s) {
225
- s.ui.removeOverlay(a), d = null;
1610
+ onDestroy(c) {
1611
+ c.ui.removeOverlay(a), i = null;
226
1612
  },
227
- onDataUpdate(s) {
228
- r && c(s);
1613
+ onDataUpdate(c) {
1614
+ o && l(c);
229
1615
  },
230
- onSeriesAdd(s) {
231
- c(s);
1616
+ onSeriesAdd(c) {
1617
+ l(c);
232
1618
  },
233
- onSeriesRemove(s) {
234
- c(s);
1619
+ onSeriesRemove(c) {
1620
+ l(c);
235
1621
  },
236
1622
  api: {
237
- refresh(s) {
238
- c(s);
1623
+ refresh(c) {
1624
+ l(c);
239
1625
  }
240
1626
  }
241
1627
  };
242
- function c(s) {
243
- if (!d) return;
244
- const u = d.querySelector(".stats-content");
1628
+ function l(c) {
1629
+ if (!i) return;
1630
+ const u = i.querySelector(".stats-content");
245
1631
  if (!u) return;
246
- const h = s.data.getAllSeries(), S = o ? h.filter((b) => b.getId() === o) : h;
247
- if (S.length === 0) {
1632
+ const d = c.data.getAllSeries(), y = n ? d.filter((b) => b.getId() === n) : d;
1633
+ if (y.length === 0) {
248
1634
  u.innerHTML = "<div style='color: #888'>No data</div>";
249
1635
  return;
250
1636
  }
251
- let v = [];
252
- if (S.forEach((b) => {
253
- const g = b.getData();
254
- g != null && g.y && (v = v.concat(Array.from(g.y)));
255
- }), v.length === 0) {
1637
+ let h = [];
1638
+ if (y.forEach((b) => {
1639
+ const m = b.getData();
1640
+ m != null && m.y && (h = h.concat(Array.from(m.y)));
1641
+ }), h.length === 0) {
256
1642
  u.innerHTML = "<div style='color: #888'>No data</div>";
257
1643
  return;
258
1644
  }
259
- const p = i(v), w = [];
260
- t.includes("count") && w.push(`<div>N: <span style="color: #60a5fa">${p.count.toLocaleString()}</span></div>`), t.includes("mean") && w.push(`<div>μ: <span style="color: #60a5fa">${p.mean.toPrecision(4)}</span></div>`), t.includes("min") && w.push(`<div>Min: <span style="color: #60a5fa">${p.min.toPrecision(4)}</span></div>`), t.includes("max") && w.push(`<div>Max: <span style="color: #60a5fa">${p.max.toPrecision(4)}</span></div>`), t.includes("std") && w.push(`<div>σ: <span style="color: #60a5fa">${p.std.toPrecision(4)}</span></div>`), t.includes("range") && w.push(`<div>Range: <span style="color: #60a5fa">${p.range.toPrecision(4)}</span></div>`), u.innerHTML = w.join("");
1645
+ const g = s(h), w = [];
1646
+ r.includes("count") && w.push(`<div>N: <span style="color: #60a5fa">${g.count.toLocaleString()}</span></div>`), r.includes("mean") && w.push(`<div>μ: <span style="color: #60a5fa">${g.mean.toPrecision(4)}</span></div>`), r.includes("min") && w.push(`<div>Min: <span style="color: #60a5fa">${g.min.toPrecision(4)}</span></div>`), r.includes("max") && w.push(`<div>Max: <span style="color: #60a5fa">${g.max.toPrecision(4)}</span></div>`), r.includes("std") && w.push(`<div>σ: <span style="color: #60a5fa">${g.std.toPrecision(4)}</span></div>`), r.includes("range") && w.push(`<div>Range: <span style="color: #60a5fa">${g.range.toPrecision(4)}</span></div>`), u.innerHTML = w.join("");
261
1647
  }
262
- function i(s) {
263
- const u = s.length;
264
- let h = 0, S = 1 / 0, v = -1 / 0;
265
- for (const g of s)
266
- h += g, g < S && (S = g), g > v && (v = g);
267
- const p = h / u;
1648
+ function s(c) {
1649
+ const u = c.length;
1650
+ let d = 0, y = 1 / 0, h = -1 / 0;
1651
+ for (const m of c)
1652
+ d += m, m < y && (y = m), m > h && (h = m);
1653
+ const g = d / u;
268
1654
  let w = 0;
269
- for (const g of s)
270
- w += (g - p) ** 2;
1655
+ for (const m of c)
1656
+ w += (m - g) ** 2;
271
1657
  const b = Math.sqrt(w / u);
272
1658
  return {
273
1659
  count: u,
274
- mean: p,
275
- min: S,
276
- max: v,
1660
+ mean: g,
1661
+ min: y,
1662
+ max: h,
277
1663
  std: b,
278
- range: v - S
1664
+ range: h - y
279
1665
  };
280
1666
  }
281
1667
  }
282
- ), Ae = {
1668
+ ), mr = {
283
1669
  name: "watermark",
284
1670
  version: "1.0.0",
285
1671
  description: "Adds a customizable watermark to the chart",
286
1672
  provides: ["visualization"],
287
1673
  tags: ["watermark", "branding", "overlay"]
288
- }, Me = G(
289
- Ae,
290
- (n) => {
291
- if (!(n != null && n.text))
1674
+ }, yr = Z(
1675
+ mr,
1676
+ (t) => {
1677
+ if (!(t != null && t.text))
292
1678
  throw new Error("WatermarkPlugin requires 'text' configuration");
293
1679
  const {
294
1680
  text: e,
295
- fontSize: t = 48,
296
- fontFamily: o = "system-ui, sans-serif",
297
- color: r = "rgba(128, 128, 128, 0.15)",
1681
+ fontSize: r = 48,
1682
+ fontFamily: n = "system-ui, sans-serif",
1683
+ color: o = "rgba(128, 128, 128, 0.15)",
298
1684
  position: a = "center",
299
- rotation: d = a === "center" ? -30 : 0
300
- } = n;
1685
+ rotation: i = a === "center" ? -30 : 0
1686
+ } = t;
301
1687
  return {
302
- onRenderOverlay(c) {
303
- const i = c.render.ctx2d;
304
- if (!i) return;
305
- c.render.canvasSize;
306
- const s = c.render.plotArea;
307
- i.save(), i.font = `${t}px ${o}`, i.fillStyle = r, i.textAlign = "center", i.textBaseline = "middle";
308
- let u, h;
309
- a === "center" ? (u = s.x + s.width / 2, h = s.y + s.height / 2) : a === "bottom-right" ? (u = s.x + s.width - t, h = s.y + s.height - t / 2) : (u = s.x + t, h = s.y + s.height - t / 2), i.translate(u, h), i.rotate(d * Math.PI / 180), i.fillText(e, 0, 0), i.restore();
1688
+ onRenderOverlay(l) {
1689
+ const s = l.render.ctx2d;
1690
+ if (!s) return;
1691
+ l.render.canvasSize;
1692
+ const c = l.render.plotArea;
1693
+ s.save(), s.font = `${r}px ${n}`, s.fillStyle = o, s.textAlign = "center", s.textBaseline = "middle";
1694
+ let u, d;
1695
+ a === "center" ? (u = c.x + c.width / 2, d = c.y + c.height / 2) : a === "bottom-right" ? (u = c.x + c.width - r, d = c.y + c.height - r / 2) : (u = c.x + r, d = c.y + c.height - r / 2), s.translate(u, d), s.rotate(i * Math.PI / 180), s.fillText(e, 0, 0), s.restore();
310
1696
  }
311
1697
  };
312
1698
  }
313
- ), Ce = {
1699
+ ), xr = {
314
1700
  name: "grid-highlight",
315
1701
  version: "1.0.0",
316
1702
  description: "Highlights specific regions of the chart grid",
317
1703
  provides: ["visualization"],
318
1704
  tags: ["grid", "highlight", "regions"]
319
- }, Fe = G(
320
- Ce,
321
- (n = {}) => {
322
- const { xIntervals: e = [], yIntervals: t = [], opacity: o = 0.1 } = n;
1705
+ }, br = Z(
1706
+ xr,
1707
+ (t = {}) => {
1708
+ const { xIntervals: e = [], yIntervals: r = [], opacity: n = 0.1 } = t;
323
1709
  return {
324
- onRenderOverlay(r, a) {
325
- const d = r.render.ctx2d;
326
- if (!d) return;
327
- const c = r.render.plotArea;
328
- r.data.getViewBounds(), d.save(), d.beginPath(), d.rect(c.x, c.y, c.width, c.height), d.clip(), d.globalAlpha = o;
329
- for (const i of e) {
330
- const s = r.coords.dataToPixelX(i.start), u = r.coords.dataToPixelX(i.end);
331
- d.fillStyle = i.color, d.fillRect(
332
- Math.min(s, u),
333
- c.y,
334
- Math.abs(u - s),
335
- c.height
1710
+ onRenderOverlay(o, a) {
1711
+ const i = o.render.ctx2d;
1712
+ if (!i) return;
1713
+ const l = o.render.plotArea;
1714
+ o.data.getViewBounds(), i.save(), i.beginPath(), i.rect(l.x, l.y, l.width, l.height), i.clip(), i.globalAlpha = n;
1715
+ for (const s of e) {
1716
+ const c = o.coords.dataToPixelX(s.start), u = o.coords.dataToPixelX(s.end);
1717
+ i.fillStyle = s.color, i.fillRect(
1718
+ Math.min(c, u),
1719
+ l.y,
1720
+ Math.abs(u - c),
1721
+ l.height
336
1722
  );
337
1723
  }
338
- for (const i of t) {
339
- const s = r.coords.dataToPixelY(i.start), u = r.coords.dataToPixelY(i.end);
340
- d.fillStyle = i.color, d.fillRect(
341
- c.x,
342
- Math.min(s, u),
343
- c.width,
344
- Math.abs(u - s)
1724
+ for (const s of r) {
1725
+ const c = o.coords.dataToPixelY(s.start), u = o.coords.dataToPixelY(s.end);
1726
+ i.fillStyle = s.color, i.fillRect(
1727
+ l.x,
1728
+ Math.min(c, u),
1729
+ l.width,
1730
+ Math.abs(u - c)
345
1731
  );
346
1732
  }
347
- d.restore();
1733
+ i.restore();
348
1734
  }
349
1735
  };
350
1736
  }
351
- ), De = {
1737
+ ), vr = {
352
1738
  name: "data-logger",
353
1739
  version: "1.0.0",
354
1740
  description: "Logs chart events for debugging and analysis",
355
1741
  provides: ["analysis"],
356
1742
  tags: ["debug", "logging", "events"]
357
- }, Ee = G(
358
- De,
359
- (n = {}) => {
1743
+ }, wr = Z(
1744
+ vr,
1745
+ (t = {}) => {
360
1746
  const {
361
1747
  logDataUpdates: e = !0,
362
- logViewChanges: t = !0,
363
- logInteractions: o = !1,
364
- maxEntries: r = 100
365
- } = n, a = [];
366
- function d(c, i) {
1748
+ logViewChanges: r = !0,
1749
+ logInteractions: n = !1,
1750
+ maxEntries: o = 100
1751
+ } = t, a = [];
1752
+ function i(l, s) {
367
1753
  a.push({
368
1754
  timestamp: Date.now(),
369
- type: c,
370
- data: i
371
- }), a.length > r && a.shift();
1755
+ type: l,
1756
+ data: s
1757
+ }), a.length > o && a.shift();
372
1758
  }
373
1759
  return {
374
- onInit(c) {
375
- c.log.info("Data logger initialized");
1760
+ onInit(l) {
1761
+ l.log.info("Data logger initialized");
376
1762
  },
377
- onDataUpdate(c, i) {
378
- e && (d("dataUpdate", {
379
- seriesId: i.seriesId,
380
- mode: i.mode,
381
- pointCount: i.pointCount
382
- }), c.log.debug(`Data update: ${i.seriesId} (${i.mode}, ${i.pointCount} points)`));
1763
+ onDataUpdate(l, s) {
1764
+ e && (i("dataUpdate", {
1765
+ seriesId: s.seriesId,
1766
+ mode: s.mode,
1767
+ pointCount: s.pointCount
1768
+ }), l.log.debug(`Data update: ${s.seriesId} (${s.mode}, ${s.pointCount} points)`));
383
1769
  },
384
- onViewChange(c, i) {
385
- t && (d("viewChange", {
386
- trigger: i.trigger,
387
- bounds: i.current
388
- }), c.log.debug(`View change: ${i.trigger}`));
1770
+ onViewChange(l, s) {
1771
+ r && (i("viewChange", {
1772
+ trigger: s.trigger,
1773
+ bounds: s.current
1774
+ }), l.log.debug(`View change: ${s.trigger}`));
389
1775
  },
390
- onInteraction(c, i) {
391
- o && d("interaction", {
392
- type: i.type,
393
- pixelX: i.pixelX,
394
- pixelY: i.pixelY,
395
- inPlotArea: i.inPlotArea
1776
+ onInteraction(l, s) {
1777
+ n && i("interaction", {
1778
+ type: s.type,
1779
+ pixelX: s.pixelX,
1780
+ pixelY: s.pixelY,
1781
+ inPlotArea: s.inPlotArea
396
1782
  });
397
1783
  },
398
- onSerialize(c) {
1784
+ onSerialize(l) {
399
1785
  return { entries: a };
400
1786
  },
401
- onDeserialize(c, i) {
402
- const s = i;
403
- s != null && s.entries && (a.length = 0, a.push(...s.entries));
1787
+ onDeserialize(l, s) {
1788
+ const c = s;
1789
+ c != null && c.entries && (a.length = 0, a.push(...c.entries));
404
1790
  },
405
1791
  api: {
406
1792
  getEntries() {
@@ -415,1128 +1801,612 @@ const we = {
415
1801
  }
416
1802
  };
417
1803
  }
418
- ), Ie = {
1804
+ ), Pr = {
419
1805
  name: "direction-indicator",
420
1806
  version: "1.0.0",
421
1807
  description: "Shows an arrow indicating the direction and trend of streaming data",
422
1808
  provides: ["visualization", "analysis"],
423
1809
  tags: ["streaming", "direction", "trend", "arrow"]
424
- }, Le = G(
425
- Ie,
426
- (n = {}) => {
1810
+ }, Sr = Z(
1811
+ Pr,
1812
+ (t = {}) => {
427
1813
  const {
428
1814
  seriesId: e,
429
- sampleSize: t = 20,
430
- color: o,
431
- size: r = 40,
432
- minVelocity: a = 0.01,
433
- historySize: d = 20,
434
- idleTimeout: c
435
- } = n;
436
- let i, s = null, u = null, h = null, S = null;
437
- const v = [], p = [], w = [];
438
- let b = d, g = null, y = Date.now(), f = -1 / 0, l = -1 / 0, P = c;
439
- return {
440
- onInit(m) {
441
- i = "direction-indicator-overlay";
442
- const A = m.ui.createOverlay(i, {
443
- zIndex: 600,
444
- position: { top: "0", left: "0", right: "0", bottom: "0" },
445
- pointerEvents: !1
446
- });
447
- if (s = document.createElement("canvas"), s.style.cssText = "width: 100%; height: 100%; pointer-events: none;", A.appendChild(s), u = s.getContext("2d"), x(m), e)
448
- S = e;
449
- else {
450
- const T = m.data.getAllSeries();
451
- T.length > 0 && (S = T[0].getId());
452
- }
453
- },
454
- onDestroy(m) {
455
- m.ui.removeOverlay(i), g && clearTimeout(g), s = null, u = null, h = null;
456
- },
457
- onResize(m) {
458
- x(m);
459
- },
460
- onAfterRender(m) {
461
- if (D(m), M(m), P) {
462
- g && clearTimeout(g);
463
- const A = Date.now() - y;
464
- A < P && (g = setTimeout(() => {
465
- m.requestRender();
466
- }, P - A + 10));
467
- }
468
- },
469
- onConfigChange(m, A) {
470
- if (A.historySize !== void 0) {
471
- for (b = A.historySize; v.length > b; ) v.shift();
472
- for (; p.length > b; ) p.shift();
473
- for (; w.length > b; ) w.shift();
474
- }
475
- A.idleTimeout !== void 0 && (P = A.idleTimeout);
476
- }
477
- };
478
- function x(m) {
479
- if (!s || !u) return;
480
- const A = m.render.canvasSize, T = m.render.pixelRatio;
481
- s.width = A.width * T, s.height = A.height * T, u.setTransform(1, 0, 0, 1, 0, 0), u.scale(T, T);
482
- }
483
- function D(m) {
484
- if (!S || !m.data.getSeries(S)) return;
485
- const T = m.data.getSeriesData(S);
486
- if (!T || !T.x || !T.y) return;
487
- const I = T.x.length;
488
- if (I < 2) return;
489
- const F = T.x[I - 1], k = T.y[I - 1];
490
- (F !== f || k !== l) && (f = F, l = k, y = Date.now());
491
- const E = Math.min(t, I), X = I - E;
492
- let L = 0, R = 0, U = 0, K = 0, j = 0, J = 0;
493
- for (let W = X; W < I; W++) {
494
- const z = W - X, me = T.x[W], ye = T.y[W], Q = m.coords.dataToPixelX(me), Z = m.coords.dataToPixelY(ye);
495
- L += z, R += Q, U += Z, K += z * Q, j += z * Z, J += z * z;
496
- }
497
- const $ = L / E, se = R / E, le = U / E, H = J - E * $ * $;
498
- if (Math.abs(H) < 1e-10) return;
499
- const q = (K - E * $ * se) / H, N = (j - E * $ * le) / H, ce = Math.atan2(N, q), de = m.coords.dataToPixelX(F), ue = m.coords.dataToPixelY(k);
500
- v.push(de), p.push(ue), v.length > b && (v.shift(), p.shift()), w.push(ce), w.length > b && w.shift();
501
- const fe = C(v), ge = C(p), pe = B(w), he = Math.sqrt(q * q + N * N);
502
- h = { angle: pe, magnitude: he, lastX: F, lastY: k, smoothX: fe, smoothY: ge };
503
- }
504
- function C(m) {
505
- return m.length === 0 ? 0 : m.reduce((A, T) => A + T, 0) / m.length;
506
- }
507
- function B(m) {
508
- if (m.length === 0) return 0;
509
- let A = 0, T = 0;
510
- for (const I of m)
511
- A += Math.cos(I), T += Math.sin(I);
512
- return Math.atan2(T / m.length, A / m.length);
513
- }
514
- function M(m) {
515
- if (!u || !s || !h) return;
516
- const { width: A, height: T } = m.render.canvasSize;
517
- if (u.clearRect(0, 0, A, T), P !== void 0 && Date.now() - y > P || h.magnitude < a) return;
518
- const I = h.smoothX, F = h.smoothY, k = o || "#FF9800";
519
- u.save(), _(u, I, F, h.angle, r, k), u.restore();
520
- }
521
- function _(m, A, T, I, F, k) {
522
- const E = F * 0.6, X = F * 0.4;
523
- m.save(), m.translate(A, T), m.rotate(I), m.fillStyle = k, m.beginPath(), m.moveTo(E / 2, 0), m.lineTo(-E / 2, -X / 2), m.lineTo(-E / 2, X / 2), m.closePath(), m.fill(), m.restore();
524
- }
525
- }
526
- ), tt = {
527
- Crosshair: Se,
528
- Statistics: be,
529
- Watermark: Me,
530
- GridHighlight: Fe,
531
- DataLogger: Ee,
532
- DirectionIndicator: Le
533
- }, ke = {
534
- name: "velo-plot-drag-edit",
535
- version: "1.0.0",
536
- description: "Interactive drag & drop editing of data points",
537
- provides: ["drag-edit", "point-editing"],
538
- tags: ["interaction", "editing", "ux"]
539
- }, Re = {
540
- enabled: !0,
541
- constraint: "both",
542
- snapToGrid: !1,
543
- snapIntervalX: 1,
544
- snapIntervalY: 1,
545
- dragThreshold: 5,
546
- hitRadius: 10,
547
- editableSeries: [],
548
- validator: () => ({ valid: !0 }),
549
- onDragStart: () => {
550
- },
551
- onDrag: () => {
552
- },
553
- onDragEnd: () => {
554
- },
555
- highlightColor: "#ffff00",
556
- showPreview: !0,
557
- previewStyle: {
558
- color: "#ffffff",
559
- width: 2,
560
- dash: [5, 5],
561
- opacity: 0.5
562
- }
563
- };
564
- function nt(n = {}) {
565
- const e = { ...Re, ...n };
566
- let t = null, o = !1, r = null, a = 0, d = 0, c = !1;
567
- function i(g, y) {
568
- if (!t) return null;
569
- const f = t.coords.pickPoint(g, y, e.hitRadius);
570
- return !f || e.editableSeries.length > 0 && !e.editableSeries.includes(f.seriesId) ? null : {
571
- seriesId: f.seriesId,
572
- index: f.index,
573
- originalX: f.x,
574
- originalY: f.y,
575
- currentX: f.x,
576
- currentY: f.y
577
- };
578
- }
579
- function s(g, y) {
580
- return t ? {
581
- x: t.coords.pixelToDataX(g),
582
- y: t.coords.pixelToDataY(y)
583
- } : { x: 0, y: 0 };
584
- }
585
- function u(g, y) {
586
- return Math.round(g / y) * y;
587
- }
588
- function h(g, y, f) {
589
- if (!r) return { x: g, y };
590
- switch (f) {
591
- case "x":
592
- return { x: g, y: r.originalY };
593
- case "y":
594
- return { x: r.originalX, y };
595
- case "none":
596
- return { x: r.originalX, y: r.originalY };
597
- default:
598
- return { x: g, y };
599
- }
600
- }
601
- function S(g, y) {
602
- let f = g, l = y;
603
- if (e.snapToGrid && (f = u(g, e.snapIntervalX), l = u(y, e.snapIntervalY)), r && e.validator) {
604
- const P = { ...r, currentX: f, currentY: l }, x = e.validator(P);
605
- if (typeof x == "boolean")
606
- return { x: f, y: l, valid: x };
607
- if (!x.valid)
608
- return { x: f, y: l, valid: !1 };
609
- x.snapX !== void 0 && (f = x.snapX), x.snapY !== void 0 && (l = x.snapY);
610
- }
611
- return { x: f, y: l, valid: !0 };
612
- }
613
- function v(g, y, f, l) {
614
- var D, C, B;
615
- if (!t) return;
616
- const P = (C = (D = t.chart).getSeries) == null ? void 0 : C.call(D, g);
617
- if (!P) return;
618
- const x = P.getData();
619
- !x || !x.x || !x.y || (x.x[y] = f, x.y[y] = l, (B = P.invalidateBuffers) == null || B.call(P), t.requestRender());
620
- }
621
- function p() {
622
- return r ? {
623
- seriesId: r.seriesId,
624
- index: r.index,
625
- oldX: r.originalX,
626
- oldY: r.originalY,
627
- newX: r.currentX,
628
- newY: r.currentY,
629
- deltaX: r.currentX - r.originalX,
630
- deltaY: r.currentY - r.originalY
631
- } : null;
632
- }
633
- function w(g) {
634
- if (!o || !r || !e.showPreview) return;
635
- const { render: y, coords: f } = g, { ctx2d: l } = y;
636
- if (!l) return;
637
- l.save();
638
- const P = f.dataToPixelX(r.originalX), x = f.dataToPixelY(r.originalY), D = f.dataToPixelX(r.currentX), C = f.dataToPixelY(r.currentY);
639
- l.strokeStyle = e.previewStyle.color || "#ffffff", l.lineWidth = e.previewStyle.width || 2, l.globalAlpha = e.previewStyle.opacity || 0.5, l.setLineDash(e.previewStyle.dash || [5, 5]), l.beginPath(), l.moveTo(P, x), l.lineTo(D, C), l.stroke(), l.globalAlpha = 1, l.fillStyle = e.highlightColor, l.setLineDash([]), l.beginPath(), l.arc(D, C, 6, 0, Math.PI * 2), l.fill(), l.strokeStyle = "#000000", l.lineWidth = 1, l.stroke(), l.restore();
640
- }
641
- const b = {
642
- enable() {
643
- e.enabled = !0;
644
- },
645
- disable() {
646
- e.enabled = !1, o && (r = null, o = !1, c = !1, t == null || t.requestRender());
647
- },
648
- isEnabled() {
649
- return e.enabled;
650
- },
651
- setEditableSeries(g) {
652
- e.editableSeries = g;
653
- },
654
- getDraggedPoint() {
655
- return r;
656
- },
657
- cancelDrag() {
658
- o && r && (r = null, o = !1, c = !1, t == null || t.requestRender());
659
- },
660
- updateConfig(g) {
661
- Object.assign(e, g);
662
- }
663
- };
664
- return {
665
- manifest: ke,
666
- onInit(g) {
667
- t = g, t.chart.dragEdit = b;
668
- },
669
- onDestroy(g) {
670
- delete g.chart.dragEdit, t = null;
671
- },
672
- onInteraction(g, y) {
673
- if (e.enabled) {
674
- if (y.type === "mousedown") {
675
- const f = i(y.pixelX, y.pixelY);
676
- f && (r = f, a = y.pixelX, d = y.pixelY, c = !1, o = !1, y.preventDefault());
677
- } else if (y.type === "mousemove") {
678
- if (!r) return;
679
- if (!o) {
680
- const C = y.pixelX - a, B = y.pixelY - d;
681
- if (Math.sqrt(C * C + B * B) > e.dragThreshold) {
682
- o = !0, c = !0;
683
- const _ = p();
684
- _ && e.onDragStart(_);
685
- } else
686
- return;
687
- }
688
- o && y.preventDefault();
689
- let { x: f, y: l } = s(y.pixelX, y.pixelY);
690
- ({ x: f, y: l } = h(f, l, e.constraint));
691
- const { x: P, y: x, valid: D } = S(f, l);
692
- if (D) {
693
- r.currentX = P, r.currentY = x;
694
- const C = p();
695
- C && e.onDrag(C), t == null || t.requestRender();
696
- }
697
- } else if (y.type === "mouseup") {
698
- if (!r) return;
699
- if (o && c) {
700
- v(
701
- r.seriesId,
702
- r.index,
703
- r.currentX,
704
- r.currentY
705
- );
706
- const f = p();
707
- f && e.onDragEnd(f), y.preventDefault();
708
- }
709
- r = null, o = !1, c = !1, t == null || t.requestRender();
710
- }
711
- }
712
- },
713
- onRenderOverlay(g) {
714
- w(g);
715
- },
716
- api: b
717
- };
718
- }
719
- const Xe = `
720
- attribute vec2 aPosition;
721
- uniform vec2 uResolution;
722
- void main() {
723
- vec2 clip = (aPosition / uResolution) * 2.0 - 1.0;
724
- gl_Position = vec4(clip.x, -clip.y, 0.0, 1.0);
725
- }
726
- `, Ye = `
727
- precision mediump float;
728
- uniform vec4 uColor;
729
- void main() {
730
- gl_FragColor = uColor;
731
- }
732
- `;
733
- function ne(n, e, t) {
734
- const o = n.createShader(e);
735
- if (!o) throw new Error("createShader failed");
736
- if (n.shaderSource(o, t), n.compileShader(o), !n.getShaderParameter(o, n.COMPILE_STATUS))
737
- throw new Error(n.getShaderInfoLog(o) ?? "shader compile failed");
738
- return o;
739
- }
740
- function Be(n) {
741
- const e = ne(n, n.VERTEX_SHADER, Xe), t = ne(n, n.FRAGMENT_SHADER, Ye), o = n.createProgram();
742
- if (!o) throw new Error("createProgram failed");
743
- if (n.attachShader(o, e), n.attachShader(o, t), n.linkProgram(o), !n.getProgramParameter(o, n.LINK_STATUS))
744
- throw new Error(n.getProgramInfoLog(o) ?? "program link failed");
745
- return n.deleteShader(e), n.deleteShader(t), o;
746
- }
747
- function _e(n) {
748
- const { plotArea: e, xLines: t, yLines: o } = n, r = e.y, a = e.y + e.height, d = e.x, c = e.x + e.width, i = (t.length + o.length) * 2, s = new Float32Array(i * 2);
749
- let u = 0;
750
- for (const h of t)
751
- s[u++] = h, s[u++] = r, s[u++] = h, s[u++] = a;
752
- for (const h of o)
753
- s[u++] = d, s[u++] = h, s[u++] = c, s[u++] = h;
754
- return s;
755
- }
756
- class Ge {
757
- constructor(e) {
758
- Y(this, "gl");
759
- Y(this, "program");
760
- Y(this, "buffer");
761
- Y(this, "aPosition");
762
- Y(this, "uResolution");
763
- Y(this, "uColor");
764
- const t = e.getContext("webgl", {
765
- alpha: !0,
766
- antialias: !1,
767
- preserveDrawingBuffer: !0
768
- });
769
- if (!t) throw new Error("WebGL not available for grid spike");
770
- this.gl = t, this.program = Be(t), this.aPosition = t.getAttribLocation(this.program, "aPosition"), this.uResolution = t.getUniformLocation(this.program, "uResolution"), this.uColor = t.getUniformLocation(this.program, "uColor");
771
- const o = t.createBuffer();
772
- if (!o) throw new Error("createBuffer failed");
773
- this.buffer = o;
774
- }
775
- /** Upload vertices and draw grid lines */
776
- draw(e) {
777
- const t = this.gl, o = _e(e), r = o.length / 4;
778
- t.viewport(0, 0, e.width, e.height), t.clearColor(0.04, 0.05, 0.08, 1), t.clear(t.COLOR_BUFFER_BIT), t.useProgram(this.program), t.bindBuffer(t.ARRAY_BUFFER, this.buffer), t.bufferData(t.ARRAY_BUFFER, o, t.DYNAMIC_DRAW), t.enableVertexAttribArray(this.aPosition), t.vertexAttribPointer(this.aPosition, 2, t.FLOAT, !1, 0, 0), t.uniform2f(this.uResolution, e.width, e.height);
779
- const a = e.color ?? [0.2, 0.22, 0.3, 0.6];
780
- return t.uniform4f(this.uColor, a[0], a[1], a[2], a[3]), t.lineWidth(e.lineWidth ?? 1), t.drawArrays(t.LINES, 0, o.length / 2), r;
781
- }
782
- destroy() {
783
- const e = this.gl;
784
- e.deleteBuffer(this.buffer), e.deleteProgram(this.program);
785
- }
786
- }
787
- function We(n) {
788
- const e = () => {
789
- };
790
- return {
791
- canvas: n,
792
- strokeStyle: "",
793
- fillStyle: "",
794
- lineWidth: 1,
795
- font: "",
796
- textAlign: "left",
797
- textBaseline: "alphabetic",
798
- beginPath: e,
799
- moveTo: e,
800
- lineTo: e,
801
- stroke: e,
802
- fill: e,
803
- clearRect: e,
804
- setTransform: e,
805
- setLineDash: e,
806
- save: e,
807
- restore: e,
808
- translate: e,
809
- rotate: e,
810
- fillText: e,
811
- measureText: (t) => ({ width: t.length * 7 })
812
- };
813
- }
814
- function ze(n, e) {
815
- const t = document.createElement("canvas");
816
- return t.width = n, t.height = e, t.getContext("2d") ?? We(t);
817
- }
818
- function oe(n, e) {
819
- const t = { top: 40, right: 40, bottom: 50, left: 60 };
820
- return {
821
- x: t.left,
822
- y: t.top,
823
- width: n - t.left - t.right,
824
- height: e - t.top - t.bottom
825
- };
826
- }
827
- function re(n, e, t, o, r) {
828
- const a = e.ticks(o).map((c) => te(e.transform(c))), d = t.ticks(r).map((c) => te(t.transform(c)));
829
- return { xLines: a, yLines: d };
830
- }
831
- function ie(n, e) {
832
- const t = [];
833
- for (let a = 0; a < e; a++) {
834
- const d = performance.now();
835
- n(), t.push((performance.now() - d) * 1e3);
836
- }
837
- t.sort((a, d) => a - d);
838
- const o = t.reduce((a, d) => a + d, 0) / t.length, r = t[Math.floor(t.length * 0.95)] ?? o;
839
- return { avg: o, p95: r };
840
- }
841
- function Ue(n = {}) {
842
- const e = Math.round((n.width ?? 1920) * (n.dpr ?? 1)), t = Math.round((n.height ?? 1080) * (n.dpr ?? 1)), o = n.xTickCount ?? 24, r = n.yTickCount ?? 16, a = n.frames ?? 120, d = ze(e, t), c = {
843
- ...ee,
844
- grid: {
845
- ...ee.grid,
846
- visible: !0,
847
- showMinor: n.showMinor ?? !0
848
- }
849
- }, i = oe(e, t), s = new O(), u = new O();
850
- s.setDomain(0, 1e6), u.setDomain(-1, 1), s.setRange(i.x, i.x + i.width), u.setRange(i.y + i.height, i.y);
851
- const h = new Pe(d, c), { avg: S, p95: v } = ie(() => {
852
- d.clearRect(0, 0, e, t), h.drawGrid(i, s, u, { tickCount: o }, { tickCount: r });
853
- }, a), { xLines: p, yLines: w } = re(i, s, u, o, r);
854
- return {
855
- backend: "canvas2d",
856
- dpr: n.dpr ?? 1,
857
- width: e,
858
- height: t,
859
- xTicks: o,
860
- yTicks: r,
861
- lineSegments: p.length + w.length,
862
- avgFrameUs: Math.round(S),
863
- p95FrameUs: Math.round(v),
864
- frames: a
865
- };
866
- }
867
- function $e(n = {}) {
868
- const e = Math.round((n.width ?? 1920) * (n.dpr ?? 1)), t = Math.round((n.height ?? 1080) * (n.dpr ?? 1)), o = n.xTickCount ?? 24, r = n.yTickCount ?? 16, a = n.frames ?? 120, d = document.createElement("canvas");
869
- d.width = e, d.height = t;
870
- let c;
871
- try {
872
- c = new Ge(d);
873
- } catch {
874
- return null;
875
- }
876
- const i = oe(e, t), s = new O(), u = new O();
877
- s.setDomain(0, 1e6), u.setDomain(-1, 1), s.setRange(i.x, i.x + i.width), u.setRange(i.y + i.height, i.y);
878
- const { xLines: h, yLines: S } = re(i, s, u, o, r), v = { plotArea: i, xLines: h, yLines: S, width: e, height: t };
879
- let p = 0;
880
- const { avg: w, p95: b } = ie(() => {
881
- p = c.draw(v);
882
- }, a);
883
- return c.destroy(), {
884
- backend: "webgl",
885
- dpr: n.dpr ?? 1,
886
- width: e,
887
- height: t,
888
- xTicks: o,
889
- yTicks: r,
890
- lineSegments: p,
891
- avgFrameUs: Math.round(w),
892
- p95FrameUs: Math.round(b),
893
- frames: a
894
- };
895
- }
896
- function at(n) {
897
- const e = (n == null ? void 0 : n.dpr) ?? 2, t = (n == null ? void 0 : n.frames) ?? 120, o = Ue({ dpr: e, frames: t, showMinor: !0 }), r = $e({ dpr: e, frames: t });
898
- if (!r)
1815
+ sampleSize: r = 20,
1816
+ color: n,
1817
+ size: o = 40,
1818
+ minVelocity: a = 0.01,
1819
+ historySize: i = 20,
1820
+ idleTimeout: l
1821
+ } = t;
1822
+ let s, c = null, u = null, d = null, y = null;
1823
+ const h = [], g = [], w = [];
1824
+ let b = i, m = null, v = Date.now(), p = -1 / 0, f = -1 / 0, T = l;
899
1825
  return {
900
- canvas2d: o,
901
- webgl: null,
902
- gainPercent: 0,
903
- recommendation: "defer"
1826
+ onInit(P) {
1827
+ s = "direction-indicator-overlay";
1828
+ const F = P.ui.createOverlay(s, {
1829
+ zIndex: 600,
1830
+ position: { top: "0", left: "0", right: "0", bottom: "0" },
1831
+ pointerEvents: !1
1832
+ });
1833
+ if (c = document.createElement("canvas"), c.style.cssText = "width: 100%; height: 100%; pointer-events: none;", F.appendChild(c), u = c.getContext("2d"), S(P), e)
1834
+ y = e;
1835
+ else {
1836
+ const C = P.data.getAllSeries();
1837
+ C.length > 0 && (y = C[0].getId());
1838
+ }
1839
+ },
1840
+ onDestroy(P) {
1841
+ P.ui.removeOverlay(s), m && clearTimeout(m), c = null, u = null, d = null;
1842
+ },
1843
+ onResize(P) {
1844
+ S(P);
1845
+ },
1846
+ onAfterRender(P) {
1847
+ if (L(P), M(P), T) {
1848
+ m && clearTimeout(m);
1849
+ const F = Date.now() - v;
1850
+ F < T && (m = setTimeout(() => {
1851
+ P.requestRender();
1852
+ }, T - F + 10));
1853
+ }
1854
+ },
1855
+ onConfigChange(P, F) {
1856
+ if (F.historySize !== void 0) {
1857
+ for (b = F.historySize; h.length > b; ) h.shift();
1858
+ for (; g.length > b; ) g.shift();
1859
+ for (; w.length > b; ) w.shift();
1860
+ }
1861
+ F.idleTimeout !== void 0 && (T = F.idleTimeout);
1862
+ }
904
1863
  };
905
- const a = (o.avgFrameUs - r.avgFrameUs) / o.avgFrameUs * 100;
906
- return {
907
- canvas2d: o,
908
- webgl: r,
909
- gainPercent: Math.round(a * 10) / 10,
910
- recommendation: a >= 20 ? "implement" : "defer"
911
- };
912
- }
913
- const Oe = "1.17.0", He = "2026-07-05", qe = "Stage 1 baselines. Headless CI uses effective FPS (render throughput when rAF throttled) via scripts/benchmark-scenario-eval.mjs smoke floors.", Ne = 0.1, Ve = 0.95, Ke = {
914
- "line-1m-pan": {
915
- minAvgFps: 50,
916
- maxAvgFrameTimeMs: 20,
917
- points: 1e6,
918
- description: "1M line points, continuous pan/zoom simulation"
919
- },
920
- "candlestick-500k": {
921
- minAvgFps: 45,
922
- maxAvgFrameTimeMs: 22,
923
- points: 5e5,
924
- description: "500k OHLC bars with PluginVirtualization"
925
- },
926
- "stack-5pane-resize": {
927
- minAvgFps: 48,
928
- maxAvgFrameTimeMs: 21,
929
- description: "5-pane stack divider drag (batched overlay redraw)"
930
- },
931
- "line-200k-webgl": {
932
- minAvgFps: 45,
933
- description: "200k line WebGL baseline for renderer compare"
934
- },
935
- "line-200k-webgpu": {
936
- minAvgFps: 42,
937
- description: "200k line WebGPU — target ≥95% of WebGL FPS"
1864
+ function S(P) {
1865
+ if (!c || !u) return;
1866
+ const F = P.render.canvasSize, C = P.render.pixelRatio;
1867
+ c.width = F.width * C, c.height = F.height * C, u.setTransform(1, 0, 0, 1, 0, 0), u.scale(C, C);
1868
+ }
1869
+ function L(P) {
1870
+ if (!y || !P.data.getSeries(y)) return;
1871
+ const C = P.data.getSeriesData(y);
1872
+ if (!C || !C.x || !C.y) return;
1873
+ const $ = C.x.length;
1874
+ if ($ < 2) return;
1875
+ const I = C.x[$ - 1], Y = C.y[$ - 1];
1876
+ (I !== p || Y !== f) && (p = I, f = Y, v = Date.now());
1877
+ const R = Math.min(r, $), x = $ - R;
1878
+ let A = 0, E = 0, _ = 0, O = 0, q = 0, j = 0;
1879
+ for (let re = x; re < $; re++) {
1880
+ const ne = re - x, Ve = C.x[re], Ge = C.y[re], fe = P.coords.dataToPixelX(Ve), he = P.coords.dataToPixelY(Ge);
1881
+ A += ne, E += fe, _ += he, O += ne * fe, q += ne * he, j += ne * ne;
1882
+ }
1883
+ const H = A / R, z = E / R, G = _ / R, V = j - R * H * H;
1884
+ if (Math.abs(V) < 1e-10) return;
1885
+ const N = (O - R * H * z) / V, X = (q - R * H * G) / V, K = Math.atan2(X, N), ee = P.coords.dataToPixelX(I), J = P.coords.dataToPixelY(Y);
1886
+ h.push(ee), g.push(J), h.length > b && (h.shift(), g.shift()), w.push(K), w.length > b && w.shift();
1887
+ const te = D(h), Ye = D(g), Xe = k(w), We = Math.sqrt(N * N + X * X);
1888
+ d = { angle: Xe, magnitude: We, lastX: I, lastY: Y, smoothX: te, smoothY: Ye };
1889
+ }
1890
+ function D(P) {
1891
+ return P.length === 0 ? 0 : P.reduce((F, C) => F + C, 0) / P.length;
1892
+ }
1893
+ function k(P) {
1894
+ if (P.length === 0) return 0;
1895
+ let F = 0, C = 0;
1896
+ for (const $ of P)
1897
+ F += Math.cos($), C += Math.sin($);
1898
+ return Math.atan2(C / P.length, F / P.length);
1899
+ }
1900
+ function M(P) {
1901
+ if (!u || !c || !d) return;
1902
+ const { width: F, height: C } = P.render.canvasSize;
1903
+ if (u.clearRect(0, 0, F, C), T !== void 0 && Date.now() - v > T || d.magnitude < a) return;
1904
+ const $ = d.smoothX, I = d.smoothY, Y = n || "#FF9800";
1905
+ u.save(), B(u, $, I, d.angle, o, Y), u.restore();
1906
+ }
1907
+ function B(P, F, C, $, I, Y) {
1908
+ const R = I * 0.6, x = I * 0.4;
1909
+ P.save(), P.translate(F, C), P.rotate($), P.fillStyle = Y, P.beginPath(), P.moveTo(R / 2, 0), P.lineTo(-R / 2, -x / 2), P.lineTo(-R / 2, x / 2), P.closePath(), P.fill(), P.restore();
1910
+ }
1911
+ }
1912
+ ), jr = {
1913
+ Crosshair: hr,
1914
+ Statistics: pr,
1915
+ Watermark: yr,
1916
+ GridHighlight: br,
1917
+ DataLogger: wr,
1918
+ DirectionIndicator: Sr
1919
+ }, Tr = {
1920
+ name: "velo-plot-drag-edit",
1921
+ version: "1.0.0",
1922
+ description: "Interactive drag & drop editing of data points",
1923
+ provides: ["drag-edit", "point-editing"],
1924
+ tags: ["interaction", "editing", "ux"]
1925
+ }, Ar = {
1926
+ enabled: !0,
1927
+ constraint: "both",
1928
+ snapToGrid: !1,
1929
+ snapIntervalX: 1,
1930
+ snapIntervalY: 1,
1931
+ dragThreshold: 5,
1932
+ hitRadius: 10,
1933
+ editableSeries: [],
1934
+ validator: () => ({ valid: !0 }),
1935
+ onDragStart: () => {
938
1936
  },
939
- "boxplot-5k-webgpu": {
940
- minAvgFps: 50,
941
- description: "5k boxplot series on WebGPU chart path"
1937
+ onDrag: () => {
942
1938
  },
943
- "grid-canvas2d-dpr2": {
944
- maxAvgFrameUs: 1200,
945
- dpr: 2,
946
- description: "Canvas 2D grid+minor at 1920×1080 @2x"
1939
+ onDragEnd: () => {
947
1940
  },
948
- "grid-webgl-dpr2": {
949
- maxAvgFrameUs: 400,
950
- dpr: 2,
951
- description: "WebGL grid spike lines only @2x"
1941
+ highlightColor: "#ffff00",
1942
+ showPreview: !0,
1943
+ previewStyle: {
1944
+ color: "#ffffff",
1945
+ width: 2,
1946
+ dash: [5, 5],
1947
+ opacity: 0.5
952
1948
  }
953
- }, V = {
954
- version: Oe,
955
- recordedAt: He,
956
- notes: qe,
957
- regressionThreshold: Ne,
958
- webgpuMinFpsRatio: Ve,
959
- scenarios: Ke
960
1949
  };
961
- function ot() {
962
- return V;
963
- }
964
- function rt(n, e) {
965
- const t = V.scenarios[n];
966
- if (!t)
967
- return { passed: !0, failures: [] };
968
- const o = [], r = V.regressionThreshold ?? 0.1;
969
- if ("avgFps" in e && t.minAvgFps !== void 0) {
970
- const a = t.minAvgFps * (1 - r);
971
- e.avgFps < a && o.push(
972
- `FPS ${e.avgFps} < baseline min ${t.minAvgFps} (allowed ${a.toFixed(1)} with ${r * 100}% slack)`
973
- );
974
- }
975
- if ("avgFrameTime" in e && t.maxAvgFrameTimeMs !== void 0) {
976
- const a = t.maxAvgFrameTimeMs * (1 + r);
977
- e.avgFrameTime > a && o.push(
978
- `Frame time ${e.avgFrameTime}ms > baseline max ${t.maxAvgFrameTimeMs}ms`
979
- );
980
- }
981
- if ("avgFrameUs" in e && t.maxAvgFrameUs !== void 0) {
982
- const a = t.maxAvgFrameUs * (1 + r);
983
- e.avgFrameUs > a && o.push(
984
- `Grid frame ${e.avgFrameUs}µs > baseline max ${t.maxAvgFrameUs}µs`
985
- );
986
- }
987
- return { passed: o.length === 0, failures: o };
988
- }
989
- function it(n, e, t, o = 0.95) {
990
- if (!t || !e)
991
- return {
992
- webgl: n,
993
- webgpu: e,
994
- webgpuActive: !1,
995
- fpsRatio: 0,
996
- meetsTarget: !1,
997
- recommendation: "webgpu-unavailable"
1950
+ function Kr(t = {}) {
1951
+ const e = { ...Ar, ...t };
1952
+ let r = null, n = !1, o = null, a = 0, i = 0, l = !1;
1953
+ function s(m, v) {
1954
+ if (!r) return null;
1955
+ const p = r.coords.pickPoint(m, v, e.hitRadius);
1956
+ return !p || e.editableSeries.length > 0 && !e.editableSeries.includes(p.seriesId) ? null : {
1957
+ seriesId: p.seriesId,
1958
+ index: p.index,
1959
+ originalX: p.x,
1960
+ originalY: p.y,
1961
+ currentX: p.x,
1962
+ currentY: p.y
998
1963
  };
999
- const r = n.avgFps > 0 ? e.avgFps / n.avgFps : 0, a = r >= o;
1000
- return {
1001
- webgl: n,
1002
- webgpu: e,
1003
- webgpuActive: !0,
1004
- fpsRatio: r,
1005
- meetsTarget: a,
1006
- recommendation: a ? "webgpu-ready" : "webgl-faster"
1007
- };
1008
- }
1009
- class je {
1010
- constructor(e) {
1011
- Y(this, "seed");
1012
- this.seed = e;
1013
- }
1014
- next() {
1015
- let e = this.seed += 1831565813;
1016
- return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
1017
1964
  }
1018
- nextRange(e, t) {
1019
- return e + this.next() * (t - e);
1965
+ function c(m, v) {
1966
+ return r ? {
1967
+ x: r.coords.pixelToDataX(m),
1968
+ y: r.coords.pixelToDataY(v)
1969
+ } : { x: 0, y: 0 };
1020
1970
  }
1021
- }
1022
- function st(n) {
1023
- const e = {
1024
- pointCount: 1e3,
1025
- amplitude: 1,
1026
- frequency: 1,
1027
- phase: 0,
1028
- noise: 0,
1029
- xStart: 0,
1030
- xEnd: 10,
1031
- offset: 0,
1032
- ...n
1033
- }, t = new Float32Array(e.pointCount), o = new Float32Array(e.pointCount), r = (e.xEnd - e.xStart) / (e.pointCount - 1);
1034
- for (let a = 0; a < e.pointCount; a++) {
1035
- t[a] = e.xStart + a * r;
1036
- const d = e.amplitude * Math.sin(2 * Math.PI * e.frequency * t[a] + e.phase), c = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
1037
- o[a] = d + c + e.offset;
1971
+ function u(m, v) {
1972
+ return Math.round(m / v) * v;
1038
1973
  }
1039
- return { x: t, y: o };
1040
- }
1041
- function lt(n) {
1042
- const e = {
1043
- pointCount: 1e3,
1044
- amplitude: 1,
1045
- frequency: 1,
1046
- phase: 0,
1047
- noise: 0,
1048
- xStart: 0,
1049
- xEnd: 10,
1050
- offset: 0,
1051
- ...n
1052
- }, t = new Float32Array(e.pointCount), o = new Float32Array(e.pointCount), r = (e.xEnd - e.xStart) / (e.pointCount - 1);
1053
- for (let a = 0; a < e.pointCount; a++) {
1054
- t[a] = e.xStart + a * r;
1055
- const d = t[a] * e.frequency + e.phase / (2 * Math.PI), c = Math.sign(Math.sin(2 * Math.PI * d)) * e.amplitude, i = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
1056
- o[a] = c + i + e.offset;
1974
+ function d(m, v, p) {
1975
+ if (!o) return { x: m, y: v };
1976
+ switch (p) {
1977
+ case "x":
1978
+ return { x: m, y: o.originalY };
1979
+ case "y":
1980
+ return { x: o.originalX, y: v };
1981
+ case "none":
1982
+ return { x: o.originalX, y: o.originalY };
1983
+ default:
1984
+ return { x: m, y: v };
1985
+ }
1057
1986
  }
1058
- return { x: t, y: o };
1059
- }
1060
- function ct(n) {
1061
- const e = {
1062
- pointCount: 1e3,
1063
- amplitude: 1,
1064
- frequency: 1,
1065
- phase: 0,
1066
- noise: 0,
1067
- xStart: 0,
1068
- xEnd: 10,
1069
- offset: 0,
1070
- ...n
1071
- }, t = new Float32Array(e.pointCount), o = new Float32Array(e.pointCount), r = (e.xEnd - e.xStart) / (e.pointCount - 1);
1072
- for (let a = 0; a < e.pointCount; a++) {
1073
- t[a] = e.xStart + a * r;
1074
- const d = t[a] * e.frequency + e.phase / (2 * Math.PI), c = e.amplitude * 2 * (d - Math.floor(d + 0.5)), i = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
1075
- o[a] = c + i + e.offset;
1987
+ function y(m, v) {
1988
+ let p = m, f = v;
1989
+ if (e.snapToGrid && (p = u(m, e.snapIntervalX), f = u(v, e.snapIntervalY)), o && e.validator) {
1990
+ const T = { ...o, currentX: p, currentY: f }, S = e.validator(T);
1991
+ if (typeof S == "boolean")
1992
+ return { x: p, y: f, valid: S };
1993
+ if (!S.valid)
1994
+ return { x: p, y: f, valid: !1 };
1995
+ S.snapX !== void 0 && (p = S.snapX), S.snapY !== void 0 && (f = S.snapY);
1996
+ }
1997
+ return { x: p, y: f, valid: !0 };
1076
1998
  }
1077
- return { x: t, y: o };
1078
- }
1079
- function dt(n) {
1080
- const e = {
1081
- pointCount: 1e3,
1082
- amplitude: 1,
1083
- frequency: 1,
1084
- phase: 0,
1085
- noise: 0,
1086
- xStart: 0,
1087
- xEnd: 10,
1088
- offset: 0,
1089
- ...n
1090
- }, t = new Float32Array(e.pointCount), o = new Float32Array(e.pointCount), r = (e.xEnd - e.xStart) / (e.pointCount - 1);
1091
- for (let a = 0; a < e.pointCount; a++) {
1092
- t[a] = e.xStart + a * r;
1093
- const d = t[a] * e.frequency + e.phase / (2 * Math.PI), c = e.amplitude * 2 * Math.abs(2 * (d - Math.floor(d + 0.5))) - e.amplitude, i = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
1094
- o[a] = c + i + e.offset;
1999
+ function h(m, v, p, f) {
2000
+ var L, D, k;
2001
+ if (!r) return;
2002
+ const T = (D = (L = r.chart).getSeries) == null ? void 0 : D.call(L, m);
2003
+ if (!T) return;
2004
+ const S = T.getData();
2005
+ !S || !S.x || !S.y || (S.x[v] = p, S.y[v] = f, (k = T.invalidateBuffers) == null || k.call(T), r.requestRender());
1095
2006
  }
1096
- return { x: t, y: o };
1097
- }
1098
- function ut(n) {
1099
- const e = {
1100
- pointCount: 1e3,
1101
- xRange: [0, 100],
1102
- yRange: [-1, 1],
1103
- sorted: !0,
1104
- seed: Date.now(),
1105
- ...n
1106
- }, t = new je(e.seed), o = new Float32Array(e.pointCount), r = new Float32Array(e.pointCount);
1107
- for (let a = 0; a < e.pointCount; a++)
1108
- o[a] = t.nextRange(e.xRange[0], e.xRange[1]), r[a] = t.nextRange(e.yRange[0], e.yRange[1]);
1109
- if (e.sorted) {
1110
- const a = Array.from({ length: e.pointCount }, (i, s) => s);
1111
- a.sort((i, s) => o[i] - o[s]);
1112
- const d = new Float32Array(e.pointCount), c = new Float32Array(e.pointCount);
1113
- for (let i = 0; i < e.pointCount; i++)
1114
- d[i] = o[a[i]], c[i] = r[a[i]];
1115
- return { x: d, y: c };
2007
+ function g() {
2008
+ return o ? {
2009
+ seriesId: o.seriesId,
2010
+ index: o.index,
2011
+ oldX: o.originalX,
2012
+ oldY: o.originalY,
2013
+ newX: o.currentX,
2014
+ newY: o.currentY,
2015
+ deltaX: o.currentX - o.originalX,
2016
+ deltaY: o.currentY - o.originalY
2017
+ } : null;
1116
2018
  }
1117
- return { x: o, y: r };
1118
- }
1119
- function ft(n) {
1120
- const e = {
1121
- pointCount: 2e3,
1122
- vMin: -0.5,
1123
- vMax: 0.5,
1124
- cycles: 1,
1125
- peakCurrent: 1e-5,
1126
- // 10 µA
1127
- noise: 0.02,
1128
- ...n
1129
- }, t = e.pointCount * e.cycles, o = new Float32Array(t), r = new Float32Array(t), a = e.pointCount, d = a / 2;
1130
- for (let c = 0; c < e.cycles; c++)
1131
- for (let i = 0; i < a; i++) {
1132
- const s = c * a + i;
1133
- i < d ? o[s] = e.vMin + (e.vMax - e.vMin) * (i / d) : o[s] = e.vMax - (e.vMax - e.vMin) * ((i - d) / d);
1134
- const u = o[s], h = 0, S = i < d ? 1 : -1, v = 0.1, p = -Math.pow(u - h, 2) / (2 * v * v), w = e.peakCurrent * Math.exp(p), b = S * e.peakCurrent * 0.1, g = (Math.random() - 0.5) * 2 * e.noise * e.peakCurrent;
1135
- r[s] = S * w + b + g;
1136
- }
1137
- return { x: o, y: r };
1138
- }
1139
- function gt(n) {
1140
- const e = {
1141
- pointCount: 50,
1142
- rSolution: 100,
1143
- // Ohms
1144
- rCharge: 1e3,
1145
- // Ohms
1146
- frequency: [1e5, 0.01],
1147
- ...n
1148
- }, t = new Float32Array(e.pointCount), o = new Float32Array(e.pointCount), r = Math.log10(e.frequency[1]), a = Math.log10(e.frequency[0]);
1149
- for (let d = 0; d < e.pointCount; d++) {
1150
- const c = a - (a - r) * (d / (e.pointCount - 1)), i = 2 * Math.PI * Math.pow(10, c), s = e.rCharge * 1e-5, u = e.rSolution + e.rCharge / (1 + Math.pow(i * s, 2)), h = i * s * e.rCharge / (1 + Math.pow(i * s, 2));
1151
- t[d] = u, o[d] = -h;
2019
+ function w(m) {
2020
+ if (!n || !o || !e.showPreview) return;
2021
+ const { render: v, coords: p } = m, { ctx2d: f } = v;
2022
+ if (!f) return;
2023
+ f.save();
2024
+ const T = p.dataToPixelX(o.originalX), S = p.dataToPixelY(o.originalY), L = p.dataToPixelX(o.currentX), D = p.dataToPixelY(o.currentY);
2025
+ f.strokeStyle = e.previewStyle.color || "#ffffff", f.lineWidth = e.previewStyle.width || 2, f.globalAlpha = e.previewStyle.opacity || 0.5, f.setLineDash(e.previewStyle.dash || [5, 5]), f.beginPath(), f.moveTo(T, S), f.lineTo(L, D), f.stroke(), f.globalAlpha = 1, f.fillStyle = e.highlightColor, f.setLineDash([]), f.beginPath(), f.arc(L, D, 6, 0, Math.PI * 2), f.fill(), f.strokeStyle = "#000000", f.lineWidth = 1, f.stroke(), f.restore();
1152
2026
  }
1153
- return { x: t, y: o };
1154
- }
1155
- async function pt(n, e) {
1156
- const t = {
1157
- duration: 5e3,
1158
- warmup: 1e3,
1159
- ...e
1160
- }, o = [], r = [];
1161
- let a = 0;
1162
- const d = n.getAllSeries().reduce((c, i) => c + i.getPointCount(), 0);
1163
- return new Promise((c) => {
1164
- const i = performance.now() + t.warmup + t.duration, s = performance.now() + t.warmup;
1165
- let u = !1, h = 0;
1166
- function S() {
1167
- const v = performance.now();
1168
- if (v >= i) {
1169
- const b = r.length > 0 ? r.reduce((P, x) => P + x, 0) / r.length : 0, g = h > 0 ? v - h : t.duration, y = a > 0 && g > 0 ? a / g * 1e3 : 0, f = o.length > 0 ? o.reduce((P, x) => P + x, 0) / o.length : b > 0 ? 1e3 / b : 0, l = {
1170
- avgFps: Math.round(y * 100) / 100,
1171
- minFps: Math.round((o.length > 0 ? Math.min(...o) : y) * 100) / 100,
1172
- maxFps: Math.round((o.length > 0 ? Math.max(...o) : y) * 100) / 100,
1173
- avgFrameTime: Math.round(b * 1e3) / 1e3,
1174
- frameCount: a,
1175
- duration: t.duration,
1176
- pointsRendered: d,
1177
- throughput: Math.round(d * y / 1e3) * 1e3,
1178
- /** @internal render-only FPS (not wall clock) */
1179
- ...f > 0 ? { renderFps: Math.round(f * 100) / 100 } : {}
1180
- };
1181
- c(l);
1182
- return;
1183
- }
1184
- v >= s && !u && (u = !0, h = v, a = 0, r.length = 0, o.length = 0);
1185
- const p = performance.now();
1186
- n.render();
1187
- const w = performance.now();
1188
- if (u) {
1189
- const b = w - p;
1190
- r.push(b), a++;
1191
- const g = r.slice(-30);
1192
- if (g.length > 0) {
1193
- const y = g.reduce((f, l) => f + l, 0) / g.length;
1194
- y > 0 && o.push(1e3 / y);
1195
- }
1196
- }
1197
- requestAnimationFrame(S);
2027
+ const b = {
2028
+ enable() {
2029
+ e.enabled = !0;
2030
+ },
2031
+ disable() {
2032
+ e.enabled = !1, n && (o = null, n = !1, l = !1, r == null || r.requestRender());
2033
+ },
2034
+ isEnabled() {
2035
+ return e.enabled;
2036
+ },
2037
+ setEditableSeries(m) {
2038
+ e.editableSeries = m;
2039
+ },
2040
+ getDraggedPoint() {
2041
+ return o;
2042
+ },
2043
+ cancelDrag() {
2044
+ n && o && (o = null, n = !1, l = !1, r == null || r.requestRender());
2045
+ },
2046
+ updateConfig(m) {
2047
+ Object.assign(e, m);
1198
2048
  }
1199
- requestAnimationFrame(S);
1200
- });
1201
- }
1202
- function ht(n, e) {
1203
- const t = {
1204
- format: "json",
1205
- includeStyles: !0,
1206
- ...e
1207
- }, o = n.getAllSeries().map((a) => ({
1208
- id: a.getId(),
1209
- type: a.getType(),
1210
- pointCount: a.getPointCount(),
1211
- ...t.includeStyles ? { style: a.getStyle() } : {}
1212
- })), r = {
1213
- timestamp: Date.now(),
1214
- config: {},
1215
- series: o,
1216
- bounds: n.getViewBounds()
1217
2049
  };
1218
- return t.format === "png" && n.exportImage && (r.image = n.exportImage()), r;
1219
- }
1220
- function mt(n, e, t = 1e-6) {
1221
- const o = [];
1222
- n.series.length !== e.series.length && o.push(`Series count: ${n.series.length} vs ${e.series.length}`);
1223
- for (let a = 0; a < Math.min(n.series.length, e.series.length); a++) {
1224
- const d = n.series[a], c = e.series[a];
1225
- d.id !== c.id && o.push(`Series[${a}] id: "${d.id}" vs "${c.id}"`), d.type !== c.type && o.push(`Series[${a}] type: "${d.type}" vs "${c.type}"`), d.pointCount !== c.pointCount && o.push(`Series[${a}] pointCount: ${d.pointCount} vs ${c.pointCount}`);
1226
- }
1227
- const r = ["xMin", "xMax", "yMin", "yMax"];
1228
- for (const a of r)
1229
- Math.abs(n.bounds[a] - e.bounds[a]) > t && o.push(`Bounds.${a}: ${n.bounds[a]} vs ${e.bounds[a]}`);
1230
2050
  return {
1231
- equal: o.length === 0,
1232
- differences: o
2051
+ manifest: Tr,
2052
+ onInit(m) {
2053
+ r = m, r.chart.dragEdit = b;
2054
+ },
2055
+ onDestroy(m) {
2056
+ delete m.chart.dragEdit, r = null;
2057
+ },
2058
+ onInteraction(m, v) {
2059
+ if (e.enabled) {
2060
+ if (v.type === "mousedown") {
2061
+ const p = s(v.pixelX, v.pixelY);
2062
+ p && (o = p, a = v.pixelX, i = v.pixelY, l = !1, n = !1, v.preventDefault());
2063
+ } else if (v.type === "mousemove") {
2064
+ if (!o) return;
2065
+ if (!n) {
2066
+ const D = v.pixelX - a, k = v.pixelY - i;
2067
+ if (Math.sqrt(D * D + k * k) > e.dragThreshold) {
2068
+ n = !0, l = !0;
2069
+ const B = g();
2070
+ B && e.onDragStart(B);
2071
+ } else
2072
+ return;
2073
+ }
2074
+ n && v.preventDefault();
2075
+ let { x: p, y: f } = c(v.pixelX, v.pixelY);
2076
+ ({ x: p, y: f } = d(p, f, e.constraint));
2077
+ const { x: T, y: S, valid: L } = y(p, f);
2078
+ if (L) {
2079
+ o.currentX = T, o.currentY = S;
2080
+ const D = g();
2081
+ D && e.onDrag(D), r == null || r.requestRender();
2082
+ }
2083
+ } else if (v.type === "mouseup") {
2084
+ if (!o) return;
2085
+ if (n && l) {
2086
+ h(
2087
+ o.seriesId,
2088
+ o.index,
2089
+ o.currentX,
2090
+ o.currentY
2091
+ );
2092
+ const p = g();
2093
+ p && e.onDragEnd(p), v.preventDefault();
2094
+ }
2095
+ o = null, n = !1, l = !1, r == null || r.requestRender();
2096
+ }
2097
+ }
2098
+ },
2099
+ onRenderOverlay(m) {
2100
+ w(m);
2101
+ },
2102
+ api: b
1233
2103
  };
1234
2104
  }
1235
- function yt(n, e) {
1236
- const t = [];
1237
- return e.minFps && n.avgFps < e.minFps && t.push(`FPS ${n.avgFps} < required ${e.minFps}`), e.maxFrameTime && n.avgFrameTime > e.maxFrameTime && t.push(`Frame time ${n.avgFrameTime}ms > required ${e.maxFrameTime}ms`), e.minThroughput && n.throughput < e.minThroughput && t.push(`Throughput ${n.throughput} < required ${e.minThroughput}`), {
1238
- passed: t.length === 0,
1239
- failures: t
1240
- };
2105
+ function Jr(t) {
2106
+ return t;
1241
2107
  }
1242
- function xt(n = 1) {
1243
- return new Promise((e) => {
1244
- let t = n;
1245
- function o() {
1246
- t--, t <= 0 ? e() : requestAnimationFrame(o);
1247
- }
1248
- requestAnimationFrame(o);
2108
+ function Qr(t, e) {
2109
+ return (r) => ({
2110
+ ...e(r),
2111
+ manifest: t
1249
2112
  });
1250
2113
  }
1251
- function vt(n) {
1252
- return new Promise((e) => setTimeout(e, n));
1253
- }
2114
+ Ie();
1254
2115
  export {
1255
- St as AnimationEngine,
1256
- In as AnnotationManager,
1257
- to as BackpressureManager,
1258
- Po as BaseBufferStore,
1259
- wo as BaseTextureStore,
1260
- tt as BuiltinPlugins,
1261
- cr as ChartGroup,
1262
- Tt as ChartInitQueue,
1263
- no as CircularBuffer,
1264
- qo as ClipboardManager,
1265
- Se as CrosshairPlugin,
1266
- ee as DARK_THEME,
1267
- bt as DEFAULT_ANIMATION_CONFIG,
1268
- Wo as DEFAULT_KEY_BINDINGS,
1269
- At as DEFAULT_LAYOUT,
1270
- Mt as DEFAULT_THEME,
1271
- Ee as DataLoggerPlugin,
1272
- Qo as DebugOverlay,
1273
- Le as DirectionIndicatorPlugin,
1274
- Ct as ELECTROCHEM_THEME,
1275
- Tn as EventEmitter,
1276
- So as GpuBenchmark,
1277
- To as GpuCompute,
1278
- Hn as GpuRenderer,
1279
- Fe as GridHighlightPlugin,
1280
- zo as KeyBindingManager,
1281
- Ft as LIGHT_THEME,
1282
- Co as LOCALE_DE_DE,
1283
- Fo as LOCALE_EN_US,
1284
- Do as LOCALE_ES_ES,
1285
- Eo as LOCALE_FR_FR,
1286
- Io as LOCALE_JA_JP,
1287
- Lo as LOCALE_PT_BR,
1288
- ko as LOCALE_ZH_CN,
1289
- O as LinearScale,
1290
- ar as LoadingIndicator,
1291
- Dt as LogScale,
1292
- Et as MIDNIGHT_THEME,
1293
- It as NativeWebGLRenderer,
1294
- Pe as OverlayRenderer,
1295
- bo as PipelineCache,
1296
- fi as Plugin3D,
1297
- va as PluginAnalysis,
1298
- Ln as PluginAnnotations,
1299
- Si as PluginAnomalyDetection,
1300
- Ui as PluginBrokenAxis,
1301
- _i as PluginCaching,
1302
- No as PluginClipboard,
1303
- Pi as PluginContextMenu,
1304
- xi as PluginDataExport,
1305
- Ri as PluginDataTransform,
1306
- Zo as PluginDebug,
1307
- nt as PluginDragEdit,
1308
- pr as PluginDrawingTools,
1309
- ji as PluginForecasting,
1310
- Ao as PluginGpu,
1311
- pi as PluginI18n,
1312
- Uo as PluginKeyboard,
1313
- Yi as PluginLaTeX,
1314
- Wi as PluginLazyLoad,
1315
- or as PluginLoading,
1316
- bi as PluginMLIntegration,
1317
- Lt as PluginManagerImpl,
1318
- qi as PluginOffscreen,
1319
- Mi as PluginPatternRecognition,
1320
- Vi as PluginROI,
1321
- Ei as PluginRadar,
1322
- Fi as PluginRegression,
1323
- hr as PluginReplay,
1324
- Li as PluginSnapshot,
1325
- ao as PluginStreaming,
1326
- mi as PluginSync,
1327
- vr as PluginThemeEditor,
1328
- Qn as PluginTools,
1329
- Oi as PluginVideoRecorder,
1330
- aa as PluginVirtualization,
1331
- kt as SERIALIZATION_VERSION,
1332
- mo as STACKED_DEFAULT_MIN_PANE_RATIO,
1333
- yo as STACKED_MAX_PANES,
1334
- go as SciPlot,
1335
- Rt as Series,
1336
- qn as SeriesAdapter,
1337
- Xt as StateHistory,
1338
- be as StatsPlugin,
1339
- Pr as THEME_PRESETS,
1340
- Zn as TOOLTIP_THEMES,
1341
- wr as ThemeEditor,
1342
- ea as TooltipManager,
1343
- Me as WatermarkPlugin,
1344
- Nn as WebGLBackend,
1345
- Vn as WebGPUBackend,
1346
- ae as WebGPURenderer,
1347
- ma as WorkerPool,
1348
- Yt as addIndicatorToChart,
1349
- Hr as adx,
1350
- Pa as analyzeComplexSpectrum,
1351
- wa as analyzeSpectrum,
1352
- bn as applyBusinessDayX,
1353
- qr as aroon,
1354
- Sa as arraysToComplex,
1355
- yt as assertPerformance,
1356
- Nr as atr,
1357
- Ta as autoCorrelation,
1358
- ba as bandPassFilter,
1359
- Aa as bandStopFilter,
1360
- mr as barsToOhlc,
1361
- Ue as benchmarkCanvasGrid,
1362
- pt as benchmarkRender,
1363
- $e as benchmarkWebGLGrid,
1364
- Ma as blackmanWindow,
1365
- Vr as bollingerBands,
1366
- Bt as bollingerBandsAsync,
1367
- _t as buildIndicatorPane,
1368
- Gt as buildIndicatorPaneFromPreset,
1369
- Wt as buildIndicatorSeries,
1370
- zt as buildPositionLineAnnotation,
1371
- An as businessDaySpanMs,
1372
- Ca as butterworth,
1373
- Gr as calculateR2,
1374
- Mr as calculateStats,
1375
- oa as calculateTargetPoints,
1376
- Rn as checkPluginCompatibility,
1377
- at as compareGridBackends,
1378
- rt as compareScenarioToBaseline,
1379
- mt as compareSnapshots,
1380
- Fa as complexToArrays,
1381
- Ut as compressString,
1382
- $t as computeHeikinAshi,
1383
- Ot as computeIndicatorFromSeries,
1384
- Ht as computeIndicatorPreset,
1385
- oo as connectStreamToChart,
1386
- Vo as copyToClipboard,
1387
- ro as createBackpressureManager,
1388
- qt as createChart,
1389
- dr as createChartGroup,
1390
- Xn as createConfigurablePlugin,
1391
- er as createDebugOverlay,
1392
- Kn as createGpuRenderer,
1393
- Nt as createIndicatorSeries,
1394
- $o as createKeyBinding,
1395
- rr as createLoadingIndicator,
1396
- Ro as createLocaleFormatter,
1397
- io as createLosslessBackpressure,
1398
- ur as createMasterSlave,
1399
- so as createMessageParser,
1400
- yr as createMockDatafeed,
1401
- lo as createMockStream,
1402
- Vt as createNativeRenderer,
1403
- Yn as createPlugin,
1404
- Kt as createPluginContext,
1405
- co as createRealtimeBackpressure,
1406
- Bn as createRenderer,
1407
- jt as createScale,
1408
- ht as createSnapshot,
1409
- xo as createStackedChart,
1410
- Jt as createTheme,
1411
- Sr as createThemeEditor,
1412
- uo as createWebSocketStream,
1413
- Da as crossCorrelation,
1414
- Kr as cumsum,
1415
- Wr as cumulativeIntegral,
1416
- Qt as decodeFloat32Array,
1417
- Zt as decompressString,
1418
- _n as defineAndRegister,
1419
- G as definePlugin,
1420
- jr as dema,
1421
- zr as derivative,
1422
- ra as destroyDownsamplePool,
1423
- en as destroyIndicatorPool,
1424
- Ea as detectAnomalies,
1425
- Cr as detectCycles,
1426
- tn as detectIndicatorMarkers,
1427
- Fr as detectPeaks,
1428
- Ia as dominantFrequency,
1429
- ia as downsampleAsync,
1430
- Dr as downsampleLTTB,
1431
- nn as easings,
1432
- Jr as ema,
1433
- an as emaAsync,
1434
- tr as enableDebugMode,
1435
- on as encodeFloat32Array,
1436
- it as evaluateRendererCompare,
1437
- La as exponentialMovingAverage,
1438
- ka as fft,
1439
- Ra as fftFromComplexInput,
1440
- Mn as formatBusinessDayTick,
1441
- Ko as formatData,
1442
- Er as formatScientific,
1443
- Ir as formatValue,
1444
- Lr as formatWithPrefix,
1445
- Xa as gaussianSmooth,
1446
- ft as generateCVData,
1447
- Ya as generateContours,
1448
- kr as generateCycleColors,
1449
- gt as generateNyquistData,
1450
- ut as generateRandomData,
1451
- ct as generateSawtoothWave,
1452
- st as generateSineWave,
1453
- lt as generateSquareWave,
1454
- dt as generateTriangleWave,
1455
- ot as getBaseline,
1456
- Rr as getBestPrefix,
1457
- rn as getChartInitQueue,
1458
- jo as getClipboardManager,
1459
- sa as getDownsamplePoolSize,
1460
- Xo as getGlobalLocale,
1461
- Yo as getLocale,
1462
- Gn as getPluginRegistry,
1463
- Ba as getPositiveFrequencies,
1464
- Tr as getPresetNames,
1465
- br as getPresetTheme,
1466
- sn as getSharedAnimationEngine,
1467
- ln as getThemeByName,
1468
- ta as getTooltipThemeForChartTheme,
1469
- _a as hammingWindow,
1470
- Ga as hanningWindow,
1471
- Wa as highPassFilter,
1472
- za as ifft,
1473
- Ua as ifftComplex,
1474
- $a as ifftFromArrays,
1475
- Ur as integrate,
1476
- cn as interleaveData,
1477
- Cn as isBusinessDay,
1478
- Fn as isBusinessDayScaleActive,
1479
- Oa as joinSegments,
1480
- fr as linkCharts,
1481
- Wn as listPluginsByCategory,
1482
- zn as loadPlugin,
1483
- Ha as lowPassFilter,
1484
- la as lowerBoundX,
1485
- ca as lttbDownsample,
1486
- Qr as macd,
1487
- dn as macdAsync,
1488
- Dn as mapToBusinessDayScale,
1489
- qa as medianFilter,
1490
- un as mergeAnimationConfig,
1491
- fn as mergeLayoutOptions,
1492
- da as minMaxDownsample,
1493
- Zr as momentum,
1494
- Xr as movingAverage,
1495
- Na as nextPowerOf2,
1496
- ya as nextTaskId,
1497
- ei as normalize,
1498
- ti as obv,
1499
- ua as ohlcDownsampleAsync,
1500
- fa as ohlcMinMaxDownsample,
1501
- gn as parseColor,
1502
- jn as parseColorToRGBA,
1503
- Oo as parseShortcut,
1504
- ni as percentChange,
1505
- Va as powerSpectrum,
1506
- pn as queueChartInit,
1507
- Bo as registerLocale,
1508
- Un as registerPlugin,
1509
- hn as resetChartQueue,
1510
- ai as roc,
1511
- oi as rsi,
1512
- mn as rsiAsync,
1513
- Ka as savitzkyGolay,
1514
- _o as setGlobalLocale,
1515
- ir as showLoading,
1516
- sr as showProgress,
1517
- ja as simpsonsIntegration,
1518
- Ja as singleFrequencyFilter,
1519
- ga as sliceSeriesToViewport,
1520
- ri as sma,
1521
- yn as smaAsync,
1522
- $r as solveLinearSystem,
1523
- ii as standardDeviation,
1524
- xn as stateToUrlHash,
1525
- si as stochastic,
1526
- Yr as subtractBaseline,
1527
- Qa as tTest,
1528
- li as tema,
1529
- Za as trapezoidalIntegration,
1530
- pa as upperBoundX,
1531
- vn as urlHashToState,
1532
- po as useSciPlot,
1533
- Pn as validateChartState,
1534
- Br as validateData,
1535
- $n as validateManifest,
1536
- ci as vwap,
1537
- vt as waitFor,
1538
- wn as waitForAnimations,
1539
- xt as waitForFrames,
1540
- di as wma
2116
+ En as AnimationEngine,
2117
+ Ai as AnnotationManager,
2118
+ gi as BackpressureManager,
2119
+ ss as BaseBufferStore,
2120
+ ls as BaseTextureStore,
2121
+ jr as BuiltinPlugins,
2122
+ ri as ChartGroup,
2123
+ Dn as ChartInitQueue,
2124
+ pi as CircularBuffer,
2125
+ Xa as ClipboardManager,
2126
+ hr as CrosshairPlugin,
2127
+ xe as DARK_THEME,
2128
+ Ln as DEFAULT_ANIMATION_CONFIG,
2129
+ Ra as DEFAULT_KEY_BINDINGS,
2130
+ kn as DEFAULT_LAYOUT,
2131
+ In as DEFAULT_THEME,
2132
+ wr as DataLoggerPlugin,
2133
+ za as DebugOverlay,
2134
+ Sr as DirectionIndicatorPlugin,
2135
+ Rn as ELECTROCHEM_THEME,
2136
+ sn as EventEmitter,
2137
+ cs as GpuBenchmark,
2138
+ us as GpuCompute,
2139
+ ds as GpuRenderer,
2140
+ br as GridHighlightPlugin,
2141
+ $a as KeyBindingManager,
2142
+ $n as LIGHT_THEME,
2143
+ va as LOCALE_DE_DE,
2144
+ wa as LOCALE_EN_US,
2145
+ Pa as LOCALE_ES_ES,
2146
+ Sa as LOCALE_FR_FR,
2147
+ Ta as LOCALE_JA_JP,
2148
+ Aa as LOCALE_PT_BR,
2149
+ Ca as LOCALE_ZH_CN,
2150
+ se as LinearScale,
2151
+ Ka as LoadingIndicator,
2152
+ Bn as LogScale,
2153
+ _n as MIDNIGHT_THEME,
2154
+ Le as NativeWebGLRenderer,
2155
+ lt as OverlayRenderer,
2156
+ fs as PipelineCache,
2157
+ Vs as Plugin3D,
2158
+ Co as PluginAnalysis,
2159
+ Ci as PluginAnnotations,
2160
+ Js as PluginAnomalyDetection,
2161
+ yl as PluginBrokenAxis,
2162
+ hl as PluginCaching,
2163
+ Wa as PluginClipboard,
2164
+ js as PluginContextMenu,
2165
+ Us as PluginDataExport,
2166
+ cl as PluginDataTransform,
2167
+ Na as PluginDebug,
2168
+ Kr as PluginDragEdit,
2169
+ tn as PluginDrawingTools,
2170
+ Al as PluginForecasting,
2171
+ hs as PluginGpu,
2172
+ Ma as PluginI18n,
2173
+ Os as PluginKeyboard,
2174
+ dl as PluginLaTeX,
2175
+ pl as PluginLazyLoad,
2176
+ Ja as PluginLoading,
2177
+ Zs as PluginMLIntegration,
2178
+ Yn as PluginManagerImpl,
2179
+ wl as PluginOffscreen,
2180
+ tl as PluginPatternRecognition,
2181
+ Sl as PluginROI,
2182
+ al as PluginRadar,
2183
+ nl as PluginRegression,
2184
+ rn as PluginReplay,
2185
+ sl as PluginSnapshot,
2186
+ mi as PluginStreaming,
2187
+ zs as PluginSync,
2188
+ si as PluginThemeEditor,
2189
+ _i as PluginTools,
2190
+ bl as PluginVideoRecorder,
2191
+ co as PluginVirtualization,
2192
+ Xn as SERIALIZATION_VERSION,
2193
+ hn as STACKED_DEFAULT_MIN_PANE_RATIO,
2194
+ gn as STACKED_MAX_PANES,
2195
+ la as SciChart,
2196
+ ca as SciPlot,
2197
+ Wn as Series,
2198
+ gs as SeriesAdapter,
2199
+ ua as StackedPlot,
2200
+ Vn as StateHistory,
2201
+ pr as StatsPlugin,
2202
+ li as THEME_PRESETS,
2203
+ Yi as TOOLTIP_THEMES,
2204
+ ci as ThemeEditor,
2205
+ Xi as TooltipManager,
2206
+ da as VeloPlot,
2207
+ yr as WatermarkPlugin,
2208
+ ps as WebGLBackend,
2209
+ ms as WebGPUBackend,
2210
+ Re as WebGPURenderer,
2211
+ So as WorkerPool,
2212
+ qe as addIndicatorToChart,
2213
+ vs as adx,
2214
+ Mo as analyzeComplexSpectrum,
2215
+ Fo as analyzeSpectrum,
2216
+ pe as applyBusinessDayX,
2217
+ ws as aroon,
2218
+ Eo as arraysToComplex,
2219
+ Nr as assertPerformance,
2220
+ Ps as atr,
2221
+ Do as autoCorrelation,
2222
+ Lo as bandPassFilter,
2223
+ ko as bandStopFilter,
2224
+ nn as barsToOhlc,
2225
+ nr as benchmarkCanvasGrid,
2226
+ Or as benchmarkRender,
2227
+ or as benchmarkWebGLGrid,
2228
+ Io as blackmanWindow,
2229
+ Ss as bollingerBands,
2230
+ pn as bollingerBandsAsync,
2231
+ mn as buildIndicatorPane,
2232
+ yn as buildIndicatorPaneFromPreset,
2233
+ je as buildIndicatorSeries,
2234
+ Ut as buildPositionLineAnnotation,
2235
+ ln as businessDaySpanMs,
2236
+ Ro as butterworth,
2237
+ ts as calculateR2,
2238
+ Gi as calculateStats,
2239
+ uo as calculateTargetPoints,
2240
+ Fi as checkPluginCompatibility,
2241
+ kr as compareGridBackends,
2242
+ Rr as compareScenarioToBaseline,
2243
+ zr as compareSnapshots,
2244
+ $o as complexToArrays,
2245
+ Gn as compressString,
2246
+ ze as computeHeikinAshi,
2247
+ xn as computeIndicatorFromSeries,
2248
+ bn as computeIndicatorPreset,
2249
+ yi as connectStreamToChart,
2250
+ Va as copyToClipboard,
2251
+ xi as createBackpressureManager,
2252
+ On as createChart,
2253
+ ni as createChartGroup,
2254
+ Qr as createConfigurablePlugin,
2255
+ Ua as createDebugOverlay,
2256
+ ys as createGpuRenderer,
2257
+ vn as createIndicatorSeries,
2258
+ Ba as createKeyBinding,
2259
+ Qa as createLoadingIndicator,
2260
+ Fa as createLocaleFormatter,
2261
+ bi as createLosslessBackpressure,
2262
+ oi as createMasterSlave,
2263
+ vi as createMessageParser,
2264
+ on as createMockDatafeed,
2265
+ wi as createMockStream,
2266
+ Le as createNativeRenderer,
2267
+ Jr as createPlugin,
2268
+ Hn as createPluginContext,
2269
+ Pi as createRealtimeBackpressure,
2270
+ Ei as createRenderer,
2271
+ zn as createScale,
2272
+ Hr as createSnapshot,
2273
+ wn as createStackedChart,
2274
+ Nn as createTheme,
2275
+ ui as createThemeEditor,
2276
+ Si as createWebSocketStream,
2277
+ Bo as crossCorrelation,
2278
+ Ts as cumsum,
2279
+ rs as cumulativeIntegral,
2280
+ Un as decodeFloat32Array,
2281
+ qn as decompressString,
2282
+ Di as defineAndRegister,
2283
+ Z as definePlugin,
2284
+ As as dema,
2285
+ ns as derivative,
2286
+ fo as destroyDownsamplePool,
2287
+ Pn as destroyIndicatorPool,
2288
+ _o as detectAnomalies,
2289
+ Oi as detectCycles,
2290
+ Sn as detectIndicatorMarkers,
2291
+ Hi as detectPeaks,
2292
+ Yo as dominantFrequency,
2293
+ ho as downsampleAsync,
2294
+ zi as downsampleLTTB,
2295
+ jn as easings,
2296
+ Cs as ema,
2297
+ Tn as emaAsync,
2298
+ qa as enableDebugMode,
2299
+ Kn as encodeFloat32Array,
2300
+ $r as evaluateRendererCompare,
2301
+ Xo as exponentialMovingAverage,
2302
+ Wo as fft,
2303
+ Vo as fftFromComplexInput,
2304
+ cn as formatBusinessDayTick,
2305
+ Ga as formatData,
2306
+ Ni as formatScientific,
2307
+ Ui as formatValue,
2308
+ qi as formatWithPrefix,
2309
+ Go as gaussianSmooth,
2310
+ Vr as generateCVData,
2311
+ Oo as generateContours,
2312
+ ji as generateCycleColors,
2313
+ Gr as generateNyquistData,
2314
+ Wr as generateRandomData,
2315
+ Yr as generateSawtoothWave,
2316
+ Br as generateSineWave,
2317
+ _r as generateSquareWave,
2318
+ Xr as generateTriangleWave,
2319
+ Ir as getBaseline,
2320
+ Ki as getBestPrefix,
2321
+ Jn as getChartInitQueue,
2322
+ Oa as getClipboardManager,
2323
+ go as getDownsamplePoolSize,
2324
+ Ea as getGlobalLocale,
2325
+ Da as getLocale,
2326
+ Li as getPluginRegistry,
2327
+ Ho as getPositiveFrequencies,
2328
+ di as getPresetNames,
2329
+ fi as getPresetTheme,
2330
+ Qn as getSharedAnimationEngine,
2331
+ Zn as getThemeByName,
2332
+ Wi as getTooltipThemeForChartTheme,
2333
+ zo as hammingWindow,
2334
+ No as hanningWindow,
2335
+ Uo as highPassFilter,
2336
+ qo as ifft,
2337
+ jo as ifftComplex,
2338
+ Ko as ifftFromArrays,
2339
+ os as integrate,
2340
+ De as interleaveData,
2341
+ un as isBusinessDay,
2342
+ ge as isBusinessDayScaleActive,
2343
+ Jo as joinSegments,
2344
+ ai as linkCharts,
2345
+ ki as listPluginsByCategory,
2346
+ Ii as loadPlugin,
2347
+ Qo as lowPassFilter,
2348
+ po as lowerBoundX,
2349
+ mo as lttbDownsample,
2350
+ Ms as macd,
2351
+ An as macdAsync,
2352
+ dn as mapToBusinessDayScale,
2353
+ Zo as medianFilter,
2354
+ eo as mergeAnimationConfig,
2355
+ to as mergeLayoutOptions,
2356
+ yo as minMaxDownsample,
2357
+ Fs as momentum,
2358
+ Ji as movingAverage,
2359
+ ea as nextPowerOf2,
2360
+ To as nextTaskId,
2361
+ Es as normalize,
2362
+ Ds as obv,
2363
+ xo as ohlcDownsampleAsync,
2364
+ bo as ohlcMinMaxDownsample,
2365
+ ae as parseColor,
2366
+ xs as parseColorToRGBA,
2367
+ _a as parseShortcut,
2368
+ Ls as percentChange,
2369
+ ta as powerSpectrum,
2370
+ ro as queueChartInit,
2371
+ La as registerLocale,
2372
+ Ri as registerPlugin,
2373
+ no as resetChartQueue,
2374
+ ks as roc,
2375
+ Is as rsi,
2376
+ Cn as rsiAsync,
2377
+ ra as savitzkyGolay,
2378
+ ka as setGlobalLocale,
2379
+ Za as showLoading,
2380
+ ei as showProgress,
2381
+ na as simpsonsIntegration,
2382
+ oa as singleFrequencyFilter,
2383
+ vo as sliceSeriesToViewport,
2384
+ Rs as sma,
2385
+ Mn as smaAsync,
2386
+ as as solveLinearSystem,
2387
+ $s as standardDeviation,
2388
+ oo as stateToUrlHash,
2389
+ Bs as stochastic,
2390
+ Qi as subtractBaseline,
2391
+ aa as tTest,
2392
+ _s as tema,
2393
+ ia as trapezoidalIntegration,
2394
+ wo as upperBoundX,
2395
+ ao as urlHashToState,
2396
+ fa as useChartGroup,
2397
+ ha as useChartSync,
2398
+ ga as useIndicator,
2399
+ pa as useSciChart,
2400
+ ma as useSciPlot,
2401
+ ya as useStackedPlot,
2402
+ xa as useVeloPlot,
2403
+ io as validateChartState,
2404
+ Zi as validateData,
2405
+ $i as validateManifest,
2406
+ Ys as vwap,
2407
+ qr as waitFor,
2408
+ so as waitForAnimations,
2409
+ Ur as waitForFrames,
2410
+ Xs as wma
1541
2411
  };
1542
2412
  //# sourceMappingURL=velo-plot.full.js.map