velo-plot 3.1.0 → 4.0.0-alpha.1

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