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