velo-plot 1.15.0 → 1.19.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/dist/{ChartCore-BimVvUEg.js → ChartCore-DQ691eXH.js} +1523 -996
- package/dist/ChartCore-DQ691eXH.js.map +1 -0
- package/dist/assets/downsample.worker-C70QJ04y.js +2 -0
- package/dist/assets/downsample.worker-C70QJ04y.js.map +1 -0
- package/dist/assets/indicator.worker-bv0zC4EX.js +2 -0
- package/dist/assets/indicator.worker-bv0zC4EX.js.map +1 -0
- package/dist/core/OverlayRenderer.d.ts +2 -0
- package/dist/core/chart/ChartAlerts.d.ts +42 -0
- package/dist/core/chart/ChartCore.d.ts +19 -1
- package/dist/core/chart/ChartRenderLoop.d.ts +4 -2
- package/dist/core/chart/ChartRenderer.d.ts +3 -2
- package/dist/core/chart/candlestickMarkers.d.ts +23 -0
- package/dist/core/chart/heikinAshi.d.ts +10 -0
- package/dist/core/chart/series/types.d.ts +2 -2
- package/dist/core/chart/types.d.ts +7 -0
- package/dist/core/indicator/addIndicator.d.ts +36 -0
- package/dist/core/indicator/index.d.ts +2 -0
- package/dist/core/indicator/indicatorPresets.d.ts +37 -0
- package/dist/core/series/Series.d.ts +3 -0
- package/dist/core/stacked/types.d.ts +8 -0
- package/dist/core/time/TimeScale.d.ts +31 -0
- package/dist/createStackedChart-BPooTQ9z.js +1164 -0
- package/dist/createStackedChart-BPooTQ9z.js.map +1 -0
- package/dist/gpu/adapter/gpuRenderer.d.ts +21 -0
- package/dist/gpu/backends/webgpu/WebGPUBackend.d.ts +2 -1
- package/dist/gpuRenderer-BpaMYz-k.js +1848 -0
- package/dist/gpuRenderer-BpaMYz-k.js.map +1 -0
- package/dist/index-D7dTq6VB.js +503 -0
- package/dist/index-D7dTq6VB.js.map +1 -0
- package/dist/{index-Ce2JgkH_.js → index-DoYxf1cV.js} +86 -43
- package/dist/{index-Ce2JgkH_.js.map → index-DoYxf1cV.js.map} +1 -1
- package/dist/{index.core-C_-CFftD.js → index.core-BtGFYMOu.js} +2 -2
- package/dist/{index.core-C_-CFftD.js.map → index.core-BtGFYMOu.js.map} +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/indicators--eJGmVox.js +302 -0
- package/dist/indicators--eJGmVox.js.map +1 -0
- package/dist/plugins/analysis.js +530 -807
- package/dist/plugins/analysis.js.map +1 -1
- package/dist/plugins/caching.js +26 -21
- package/dist/plugins/caching.js.map +1 -1
- package/dist/plugins/drawing-tools/index.d.ts +16 -0
- package/dist/plugins/gpu.js +202 -1895
- package/dist/plugins/gpu.js.map +1 -1
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/keyboard/index.d.ts +1 -7
- package/dist/plugins/keyboard.js +1 -1
- package/dist/plugins/lazy-load/types.d.ts +7 -0
- package/dist/plugins/lazy-load.js +131 -108
- package/dist/plugins/lazy-load.js.map +1 -1
- package/dist/plugins/replay/index.d.ts +19 -0
- package/dist/plugins/virtualization/types.d.ts +12 -0
- package/dist/plugins/virtualization.js +1 -1
- package/dist/pool-15HMCNv8.js +88 -0
- package/dist/pool-15HMCNv8.js.map +1 -0
- package/dist/react.js +2 -2
- package/dist/renderer/CandlestickRenderer.d.ts +1 -1
- package/dist/renderer/ChartSeriesRenderer.d.ts +6 -0
- package/dist/renderer/GpuChartRenderer.d.ts +23 -0
- package/dist/renderer/index.d.ts +3 -0
- package/dist/renderer/spike/WebGLGridSpike.d.ts +40 -0
- package/dist/testing/baselines/v1.15.0.json.d.ts +51 -0
- package/dist/testing/gridSpikeBenchmark.d.ts +49 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/rendererBenchmark.d.ts +13 -0
- package/dist/testing/stage1BrowserBench.d.ts +42 -0
- package/dist/types.d.ts +21 -1
- package/dist/velo-plot.full.js +1322 -789
- package/dist/velo-plot.full.js.map +1 -1
- package/dist/velo-plot.js +20 -20
- package/dist/workers/downsample.d.ts +38 -0
- package/dist/workers/downsampleAsync.d.ts +6 -0
- package/dist/workers/indicator.worker.d.ts +32 -0
- package/dist/workers/indicatorsAsync.d.ts +26 -0
- package/dist/workers/pool.d.ts +36 -0
- package/package.json +11 -1
- package/dist/ChartCore-BimVvUEg.js.map +0 -1
- package/dist/createStackedChart-CjsKcOvX.js +0 -1088
- package/dist/createStackedChart-CjsKcOvX.js.map +0 -1
- package/dist/index-ChgIdk3N.js +0 -229
- package/dist/index-ChgIdk3N.js.map +0 -1
package/dist/velo-plot.full.js
CHANGED
|
@@ -1,56 +1,59 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import { A as
|
|
6
|
-
import { E as
|
|
7
|
-
import { AnnotationManager as
|
|
8
|
-
import { d as
|
|
9
|
-
import { e as
|
|
10
|
-
import {
|
|
11
|
-
import { P as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
var ve = Object.defineProperty;
|
|
2
|
+
var we = (n, e, t) => e in n ? ve(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var X = (n, e, t) => we(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { D as ee, L as O, s as te, O as Pe } from "./ChartCore-DQ691eXH.js";
|
|
5
|
+
import { A as Et, C as Lt, h as Rt, B as Yt, x as Xt, E as Bt, u as _t, n as zt, v as Wt, N as Gt, a3 as Ut, F as $t, S as Ot, R as Ht, a as Nt, X as qt, _ as Vt, d as Kt, b as jt, I as Jt, $ as Qt, a0 as Zt, c as en, Z as tn, N as nn, a2 as on, o as rn, y as an, H as sn, J as ln, Y as cn, a1 as dn, f as un, V as fn, G as hn, k as gn, j as pn, z as mn, p as yn, W as xn, i as vn, m as wn, t as Pn, q as Sn, l as Tn, T as bn, U as An, K as Mn, P as Fn, Q as Cn, w as In } from "./ChartCore-DQ691eXH.js";
|
|
6
|
+
import { E as kn } from "./axisFormat-B7o_uIEA.js";
|
|
7
|
+
import { AnnotationManager as Ln, PluginAnnotations as Rn } from "./plugins/annotations.js";
|
|
8
|
+
import { d as z } from "./index.core-BtGFYMOu.js";
|
|
9
|
+
import { e as Xn, h as Bn, f as _n, c as zn, a as Wn, g as Gn, b as Un, l as $n, r as On, v as Hn } from "./index.core-BtGFYMOu.js";
|
|
10
|
+
import { G as qn, S as Vn, a as Kn, W as jn, c as Jn, p as Qn } from "./gpuRenderer-BpaMYz-k.js";
|
|
11
|
+
import { P as eo, a as to, T as no, g as oo } from "./index-DjeWClO9.js";
|
|
12
|
+
import { P as ao, c as io, e as so, d as lo, g as co, a as uo, l as fo, m as ho, b as go, o as po, s as mo, u as yo } from "./index-D7dTq6VB.js";
|
|
13
|
+
import { W as vo, n as wo } from "./pool-15HMCNv8.js";
|
|
14
|
+
import { PluginAnalysis as So, analyzeComplexSpectrum as To, analyzeSpectrum as bo, arraysToComplex as Ao, autoCorrelation as Mo, bandPassFilter as Fo, bandStopFilter as Co, blackmanWindow as Io, butterworth as Do, complexToArrays as ko, crossCorrelation as Eo, detectAnomalies as Lo, dominantFrequency as Ro, exponentialMovingAverage as Yo, fft as Xo, fftFromComplexInput as Bo, gaussianSmooth as _o, getPositiveFrequencies as zo, hammingWindow as Wo, hanningWindow as Go, highPassFilter as Uo, ifft as $o, ifftComplex as Oo, ifftFromArrays as Ho, lowPassFilter as No, medianFilter as qo, nextPowerOf2 as Vo, powerSpectrum as Ko, savitzkyGolay as jo, simpsonsIntegration as Jo, singleFrequencyFilter as Qo, tTest as Zo, trapezoidalIntegration as er } from "./plugins/analysis.js";
|
|
15
|
+
import { B as nr, C as or, P as rr, a as ar, e as ir, g as sr, b as lr, d as cr, f as dr, c as ur } from "./index-BMiZoKmm.js";
|
|
16
|
+
import { b as hr, a as gr, S as pr, c as mr, u as yr } from "./createStackedChart-BPooTQ9z.js";
|
|
15
17
|
import "react";
|
|
16
|
-
import { BaseBufferStore as
|
|
17
|
-
import { b as
|
|
18
|
-
import { D as
|
|
19
|
-
import { ClipboardManager as
|
|
20
|
-
import { DebugOverlay as
|
|
21
|
-
import { L as
|
|
22
|
-
import { C as
|
|
23
|
-
import { P as
|
|
24
|
-
import { c as
|
|
25
|
-
import { a as
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
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
|
-
|
|
18
|
+
import { BaseBufferStore as vr, BaseTextureStore as wr, GpuBenchmark as Pr, GpuCompute as Sr, PipelineCache as Tr, PluginGpu as br } from "./plugins/gpu.js";
|
|
19
|
+
import { b as Mr, L as Fr, a as Cr, c as Ir, f as Dr, d as kr, e as Er, i as Lr, g as Rr, h as Yr, r as Xr, s as Br } from "./index-x4stH3jD.js";
|
|
20
|
+
import { D as zr, K as Wr, P as Gr, c as Ur, p as $r } from "./index-DoYxf1cV.js";
|
|
21
|
+
import { ClipboardManager as Hr, PluginClipboard as Nr, copyToClipboard as qr, formatData as Vr, getClipboardManager as Kr } from "./plugins/clipboard.js";
|
|
22
|
+
import { DebugOverlay as Jr, PluginDebug as Qr, createDebugOverlay as Zr, enableDebugMode as ea } from "./plugins/debug.js";
|
|
23
|
+
import { L as na, P as oa, c as ra, s as aa, a as ia } from "./index-qhscKTDy.js";
|
|
24
|
+
import { C as la, c as ca, a as da, l as ua } from "./index-CUGS98p4.js";
|
|
25
|
+
import { P as ha, b as ga, T as pa, c as ma, a as ya, g as xa } from "./index-Dag88bW4.js";
|
|
26
|
+
import { c as wa, a as Pa, b as Sa, d as Ta, h as ba, e as Aa, f as Ma, g as Fa, i as Ca, m as Ia, s as Da, v as ka } from "./utils-BK5UUXxj.js";
|
|
27
|
+
import { a as La, c as Ra, d as Ya, i as Xa, s as Ba } from "./math-Ddm2EZjj.js";
|
|
28
|
+
import { i as za, j as Wa, g as Ga, f as Ua, k as $a, d as Oa, e as Ha, m as Na, c as qa, n as Va, o as Ka, p as ja, b as Ja, r as Qa, s as Za, h as ei, a as ti, t as ni, v as oi, w as ri } from "./indicators--eJGmVox.js";
|
|
29
|
+
import { Plugin3D as ii } from "./plugins/3d.js";
|
|
30
|
+
import { PluginI18n as li } from "./plugins/i18n.js";
|
|
31
|
+
import { PluginSync as di } from "./plugins/sync.js";
|
|
32
|
+
import { PluginDataExport as fi } from "./plugins/data-export.js";
|
|
33
|
+
import { PluginContextMenu as gi } from "./plugins/context-menu.js";
|
|
34
|
+
import { PluginAnomalyDetection as mi } from "./plugins/anomaly-detection.js";
|
|
35
|
+
import { PluginMLIntegration as xi } from "./plugins/ml-integration.js";
|
|
36
|
+
import { PluginPatternRecognition as wi } from "./plugins/pattern-recognition.js";
|
|
37
|
+
import { PluginRegression as Si } from "./plugins/regression.js";
|
|
38
|
+
import { PluginRadar as bi } from "./plugins/radar.js";
|
|
39
|
+
import { PluginSnapshot as Mi } from "./plugins/snapshot.js";
|
|
40
|
+
import { PluginDataTransform as Ci } from "./plugins/data-transform.js";
|
|
41
|
+
import { PluginLaTeX as Di } from "./plugins/latex.js";
|
|
42
|
+
import { PluginCaching as Ei } from "./plugins/caching.js";
|
|
43
|
+
import { PluginLazyLoad as Ri } from "./plugins/lazy-load.js";
|
|
44
|
+
import { PluginBrokenAxis as Xi } from "./plugins/broken-axis.js";
|
|
45
|
+
import { PluginVideoRecorder as _i } from "./plugins/video-recorder.js";
|
|
46
|
+
import { PluginOffscreen as Wi } from "./plugins/offscreen.js";
|
|
47
|
+
import { PluginROI as Ui } from "./plugins/roi.js";
|
|
48
|
+
import { PluginForecasting as Oi } from "./plugins/forecasting.js";
|
|
49
|
+
class re {
|
|
47
50
|
constructor(e, t = {}) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this.canvas = e, this.available =
|
|
51
|
+
X(this, "available");
|
|
52
|
+
X(this, "canvas");
|
|
53
|
+
X(this, "adapter");
|
|
54
|
+
X(this, "device");
|
|
55
|
+
X(this, "context");
|
|
56
|
+
this.canvas = e, this.available = re.isSupported();
|
|
54
57
|
}
|
|
55
58
|
static isSupported() {
|
|
56
59
|
return typeof globalThis.navigator < "u" && typeof globalThis.navigator.gpu < "u";
|
|
@@ -64,14 +67,14 @@ class Q {
|
|
|
64
67
|
}), !this.adapter)
|
|
65
68
|
throw new Error("[SciPlot] Failed to request WebGPU adapter");
|
|
66
69
|
this.device = await this.adapter.requestDevice();
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
70
|
+
const r = this.canvas.getContext("webgpu");
|
|
71
|
+
if (!r)
|
|
69
72
|
throw new Error("[SciPlot] Failed to get WebGPU context");
|
|
70
|
-
this.context =
|
|
71
|
-
const
|
|
73
|
+
this.context = r;
|
|
74
|
+
const a = e.preferredFormat ?? (t.getPreferredCanvasFormat ? t.getPreferredCanvasFormat() : "bgra8unorm");
|
|
72
75
|
this.context.configure({
|
|
73
76
|
device: this.device,
|
|
74
|
-
format:
|
|
77
|
+
format: a,
|
|
75
78
|
alphaMode: "premultiplied"
|
|
76
79
|
});
|
|
77
80
|
}
|
|
@@ -79,128 +82,128 @@ class Q {
|
|
|
79
82
|
this.device = void 0, this.adapter = void 0, this.context = void 0;
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
|
-
const
|
|
85
|
+
const Se = {
|
|
83
86
|
name: "crosshair",
|
|
84
87
|
version: "1.0.0",
|
|
85
88
|
description: "Interactive crosshair that follows mouse cursor",
|
|
86
89
|
provides: ["interaction", "visualization"],
|
|
87
90
|
tags: ["cursor", "crosshair", "tooltip"]
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
(
|
|
91
|
+
}, Te = z(
|
|
92
|
+
Se,
|
|
93
|
+
(n = {}) => {
|
|
91
94
|
const {
|
|
92
95
|
showVertical: e = !0,
|
|
93
96
|
showHorizontal: t = !0,
|
|
94
|
-
color:
|
|
95
|
-
lineStyle:
|
|
96
|
-
lineWidth:
|
|
97
|
-
snapToData:
|
|
98
|
-
valueFormat:
|
|
99
|
-
} =
|
|
100
|
-
let i =
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
let
|
|
97
|
+
color: r,
|
|
98
|
+
lineStyle: a = "dashed",
|
|
99
|
+
lineWidth: o = 1,
|
|
100
|
+
snapToData: l = !1,
|
|
101
|
+
valueFormat: d = { xPrecision: 4, yPrecision: 4 }
|
|
102
|
+
} = n;
|
|
103
|
+
let i = n.valueDisplayMode ?? "disabled";
|
|
104
|
+
n.showAxisLabels !== void 0 && n.valueDisplayMode === void 0 && (i = n.showAxisLabels ? "floating" : "disabled");
|
|
105
|
+
const s = n.cornerPosition ?? "top-left";
|
|
106
|
+
let c = -1, f = -1, w, v = null, p = null;
|
|
104
107
|
return {
|
|
105
|
-
onInit(
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
+
onInit(h) {
|
|
109
|
+
w = "crosshair-overlay";
|
|
110
|
+
const u = h.ui.createOverlay(w, {
|
|
108
111
|
zIndex: 500,
|
|
109
112
|
position: { top: "0", left: "0", right: "0", bottom: "0" }
|
|
110
113
|
});
|
|
111
|
-
v = document.createElement("canvas"), v.style.cssText = "width: 100%; height: 100%;",
|
|
114
|
+
v = document.createElement("canvas"), v.style.cssText = "width: 100%; height: 100%;", u.appendChild(v), p = v.getContext("2d"), S(h);
|
|
112
115
|
},
|
|
113
|
-
onDestroy(
|
|
114
|
-
|
|
116
|
+
onDestroy(h) {
|
|
117
|
+
h.ui.removeOverlay(w), v = null, p = null;
|
|
115
118
|
},
|
|
116
|
-
onResize(
|
|
117
|
-
S(
|
|
119
|
+
onResize(h) {
|
|
120
|
+
S(h);
|
|
118
121
|
},
|
|
119
|
-
onInteraction(
|
|
120
|
-
if (
|
|
121
|
-
if (
|
|
122
|
-
const P =
|
|
123
|
-
P && (
|
|
122
|
+
onInteraction(h, u) {
|
|
123
|
+
if (u.type === "mousemove") {
|
|
124
|
+
if (c = u.pixelX, f = u.pixelY, l && u.inPlotArea) {
|
|
125
|
+
const P = h.coords.pickPoint(c, f);
|
|
126
|
+
P && (c = P.pixelX, f = P.pixelY);
|
|
124
127
|
}
|
|
125
|
-
|
|
128
|
+
b(h);
|
|
126
129
|
}
|
|
127
130
|
},
|
|
128
131
|
onViewChange() {
|
|
129
132
|
}
|
|
130
133
|
};
|
|
131
|
-
function S(
|
|
134
|
+
function S(h) {
|
|
132
135
|
if (!v || !p) return;
|
|
133
|
-
const
|
|
134
|
-
v.width =
|
|
136
|
+
const u = h.render.canvasSize, P = h.render.pixelRatio;
|
|
137
|
+
v.width = u.width * P, v.height = u.height * P, p.setTransform(1, 0, 0, 1, 0, 0), p.scale(P, P);
|
|
135
138
|
}
|
|
136
|
-
function
|
|
137
|
-
var
|
|
139
|
+
function b(h) {
|
|
140
|
+
var F;
|
|
138
141
|
if (!p || !v) return;
|
|
139
|
-
const { width:
|
|
140
|
-
if (p.clearRect(0, 0,
|
|
141
|
-
const x =
|
|
142
|
-
if (
|
|
142
|
+
const { width: u, height: P } = h.render.canvasSize;
|
|
143
|
+
if (p.clearRect(0, 0, u, P), c < 0 || f < 0) return;
|
|
144
|
+
const x = h.render.plotArea;
|
|
145
|
+
if (c < x.x || c > x.x + x.width || f < x.y || f > x.y + x.height)
|
|
143
146
|
return;
|
|
144
|
-
const
|
|
145
|
-
p.save(), p.strokeStyle =
|
|
147
|
+
const I = r || ((F = h.ui.theme.cursor) == null ? void 0 : F.color) || "#888888";
|
|
148
|
+
p.save(), p.strokeStyle = I, p.lineWidth = o, a === "dashed" ? p.setLineDash([6, 4]) : a === "dotted" && p.setLineDash([2, 2]), e && (p.beginPath(), p.moveTo(c, x.y), p.lineTo(c, x.y + x.height), p.stroke()), t && (p.beginPath(), p.moveTo(x.x, f), p.lineTo(x.x + x.width, f), p.stroke()), p.restore(), i === "floating" ? g(h, p, c, f, I) : i === "corner" && y(h, p, c, f, I);
|
|
146
149
|
}
|
|
147
|
-
function g(
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
150
|
+
function g(h, u, P, x, I) {
|
|
151
|
+
const F = h.coords.pixelToDataX(P), B = h.coords.pixelToDataY(x), M = h.render.plotArea;
|
|
152
|
+
u.save(), u.font = "11px system-ui, sans-serif", u.textAlign = "center", u.textBaseline = "top";
|
|
153
|
+
const _ = F.toPrecision(d.xPrecision), A = u.measureText(_).width + 8, T = 18, k = P - A / 2, C = M.y + M.height + 2;
|
|
154
|
+
u.fillStyle = I, u.fillRect(k, C, A, T), u.fillStyle = "#ffffff", u.fillText(_, P, C + 3), u.textAlign = "right", u.textBaseline = "middle";
|
|
155
|
+
const L = B.toPrecision(d.yPrecision), Y = u.measureText(L).width + 8, E = 18, R = M.x - Y - 2, U = x - E / 2;
|
|
156
|
+
u.fillStyle = I, u.fillRect(R, U, Y, E), u.fillStyle = "#ffffff", u.fillText(L, M.x - 6, x), u.restore();
|
|
154
157
|
}
|
|
155
|
-
function
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
let
|
|
160
|
-
switch (
|
|
158
|
+
function y(h, u, P, x, I) {
|
|
159
|
+
const F = h.coords.pixelToDataX(P), B = h.coords.pixelToDataY(x), M = h.render.plotArea;
|
|
160
|
+
u.save(), u.font = "11px system-ui, sans-serif";
|
|
161
|
+
const _ = `X: ${F.toPrecision(d.xPrecision)}`, m = `Y: ${B.toPrecision(d.yPrecision)}`, A = u.measureText(_), T = u.measureText(m), k = Math.max(A.width, T.width), C = 6, L = 16, D = k + C * 2, Y = L * 2 + C * 2;
|
|
162
|
+
let E, R;
|
|
163
|
+
switch (s) {
|
|
161
164
|
case "top-left":
|
|
162
|
-
|
|
165
|
+
E = M.x + 8, R = M.y + 8;
|
|
163
166
|
break;
|
|
164
167
|
case "top-right":
|
|
165
|
-
|
|
168
|
+
E = M.x + M.width - D - 8, R = M.y + 8;
|
|
166
169
|
break;
|
|
167
170
|
case "bottom-left":
|
|
168
|
-
|
|
171
|
+
E = M.x + 8, R = M.y + M.height - Y - 8;
|
|
169
172
|
break;
|
|
170
173
|
case "bottom-right":
|
|
171
|
-
|
|
174
|
+
E = M.x + M.width - D - 8, R = M.y + M.height - Y - 8;
|
|
172
175
|
break;
|
|
173
176
|
default:
|
|
174
|
-
|
|
177
|
+
E = M.x + 8, R = M.y + 8;
|
|
175
178
|
}
|
|
176
|
-
|
|
179
|
+
u.fillStyle = I, u.globalAlpha = 0.85, u.fillRect(E, R, D, Y), u.globalAlpha = 1, u.strokeStyle = "rgba(255,255,255,0.3)", u.lineWidth = 1, u.strokeRect(E, R, D, Y), u.fillStyle = "#ffffff", u.textAlign = "left", u.textBaseline = "top", u.fillText(_, E + C, R + C), u.fillText(m, E + C, R + C + L), u.restore();
|
|
177
180
|
}
|
|
178
181
|
}
|
|
179
|
-
),
|
|
182
|
+
), be = {
|
|
180
183
|
name: "statistics-overlay",
|
|
181
184
|
version: "1.0.0",
|
|
182
185
|
description: "Displays real-time statistics for chart data",
|
|
183
186
|
provides: ["visualization", "analysis"],
|
|
184
187
|
tags: ["statistics", "overlay", "analytics"]
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
(
|
|
188
|
+
}, Ae = z(
|
|
189
|
+
be,
|
|
190
|
+
(n = {}) => {
|
|
188
191
|
const {
|
|
189
192
|
position: e = "top-right",
|
|
190
193
|
show: t = ["count", "mean", "min", "max"],
|
|
191
|
-
seriesId:
|
|
192
|
-
autoUpdate:
|
|
193
|
-
} =
|
|
194
|
-
let
|
|
194
|
+
seriesId: r,
|
|
195
|
+
autoUpdate: a = !0
|
|
196
|
+
} = n;
|
|
197
|
+
let o, l = null;
|
|
195
198
|
return {
|
|
196
|
-
onInit(
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
e.includes("top") && (
|
|
199
|
+
onInit(s) {
|
|
200
|
+
o = "stats-overlay";
|
|
201
|
+
const c = {};
|
|
202
|
+
e.includes("top") && (c.top = "10px"), e.includes("bottom") && (c.bottom = "10px"), e.includes("left") && (c.left = "10px"), e.includes("right") && (c.right = "10px"), l = s.ui.createOverlay(o, {
|
|
200
203
|
zIndex: 800,
|
|
201
|
-
position:
|
|
204
|
+
position: c,
|
|
202
205
|
pointerEvents: !1
|
|
203
|
-
}),
|
|
206
|
+
}), l.innerHTML = `
|
|
204
207
|
<div style="
|
|
205
208
|
background: rgba(0, 0, 0, 0.85);
|
|
206
209
|
color: #fff;
|
|
@@ -214,324 +217,324 @@ const ge = {
|
|
|
214
217
|
<div style="font-weight: bold; margin-bottom: 4px; color: #4ade80;">📊 Statistics</div>
|
|
215
218
|
<div class="stats-content"></div>
|
|
216
219
|
</div>
|
|
217
|
-
`,
|
|
220
|
+
`, d(s);
|
|
218
221
|
},
|
|
219
|
-
onDestroy(
|
|
220
|
-
|
|
222
|
+
onDestroy(s) {
|
|
223
|
+
s.ui.removeOverlay(o), l = null;
|
|
221
224
|
},
|
|
222
|
-
onDataUpdate(
|
|
223
|
-
|
|
225
|
+
onDataUpdate(s) {
|
|
226
|
+
a && d(s);
|
|
224
227
|
},
|
|
225
|
-
onSeriesAdd(
|
|
226
|
-
|
|
228
|
+
onSeriesAdd(s) {
|
|
229
|
+
d(s);
|
|
227
230
|
},
|
|
228
|
-
onSeriesRemove(
|
|
229
|
-
|
|
231
|
+
onSeriesRemove(s) {
|
|
232
|
+
d(s);
|
|
230
233
|
},
|
|
231
234
|
api: {
|
|
232
|
-
refresh(
|
|
233
|
-
|
|
235
|
+
refresh(s) {
|
|
236
|
+
d(s);
|
|
234
237
|
}
|
|
235
238
|
}
|
|
236
239
|
};
|
|
237
|
-
function
|
|
238
|
-
if (!
|
|
239
|
-
const
|
|
240
|
-
if (!
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
243
|
-
|
|
240
|
+
function d(s) {
|
|
241
|
+
if (!l) return;
|
|
242
|
+
const c = l.querySelector(".stats-content");
|
|
243
|
+
if (!c) return;
|
|
244
|
+
const f = s.data.getAllSeries(), w = r ? f.filter((b) => b.getId() === r) : f;
|
|
245
|
+
if (w.length === 0) {
|
|
246
|
+
c.innerHTML = "<div style='color: #888'>No data</div>";
|
|
244
247
|
return;
|
|
245
248
|
}
|
|
246
249
|
let v = [];
|
|
247
|
-
if (
|
|
248
|
-
const g =
|
|
250
|
+
if (w.forEach((b) => {
|
|
251
|
+
const g = b.getData();
|
|
249
252
|
g != null && g.y && (v = v.concat(Array.from(g.y)));
|
|
250
253
|
}), v.length === 0) {
|
|
251
|
-
|
|
254
|
+
c.innerHTML = "<div style='color: #888'>No data</div>";
|
|
252
255
|
return;
|
|
253
256
|
}
|
|
254
257
|
const p = i(v), S = [];
|
|
255
|
-
t.includes("count") && S.push(`<div>N: <span style="color: #60a5fa">${p.count.toLocaleString()}</span></div>`), t.includes("mean") && S.push(`<div>μ: <span style="color: #60a5fa">${p.mean.toPrecision(4)}</span></div>`), t.includes("min") && S.push(`<div>Min: <span style="color: #60a5fa">${p.min.toPrecision(4)}</span></div>`), t.includes("max") && S.push(`<div>Max: <span style="color: #60a5fa">${p.max.toPrecision(4)}</span></div>`), t.includes("std") && S.push(`<div>σ: <span style="color: #60a5fa">${p.std.toPrecision(4)}</span></div>`), t.includes("range") && S.push(`<div>Range: <span style="color: #60a5fa">${p.range.toPrecision(4)}</span></div>`),
|
|
258
|
+
t.includes("count") && S.push(`<div>N: <span style="color: #60a5fa">${p.count.toLocaleString()}</span></div>`), t.includes("mean") && S.push(`<div>μ: <span style="color: #60a5fa">${p.mean.toPrecision(4)}</span></div>`), t.includes("min") && S.push(`<div>Min: <span style="color: #60a5fa">${p.min.toPrecision(4)}</span></div>`), t.includes("max") && S.push(`<div>Max: <span style="color: #60a5fa">${p.max.toPrecision(4)}</span></div>`), t.includes("std") && S.push(`<div>σ: <span style="color: #60a5fa">${p.std.toPrecision(4)}</span></div>`), t.includes("range") && S.push(`<div>Range: <span style="color: #60a5fa">${p.range.toPrecision(4)}</span></div>`), c.innerHTML = S.join("");
|
|
256
259
|
}
|
|
257
|
-
function i(
|
|
258
|
-
const
|
|
259
|
-
let
|
|
260
|
-
for (const g of
|
|
261
|
-
|
|
262
|
-
const p =
|
|
260
|
+
function i(s) {
|
|
261
|
+
const c = s.length;
|
|
262
|
+
let f = 0, w = 1 / 0, v = -1 / 0;
|
|
263
|
+
for (const g of s)
|
|
264
|
+
f += g, g < w && (w = g), g > v && (v = g);
|
|
265
|
+
const p = f / c;
|
|
263
266
|
let S = 0;
|
|
264
|
-
for (const g of
|
|
267
|
+
for (const g of s)
|
|
265
268
|
S += (g - p) ** 2;
|
|
266
|
-
const
|
|
269
|
+
const b = Math.sqrt(S / c);
|
|
267
270
|
return {
|
|
268
|
-
count:
|
|
271
|
+
count: c,
|
|
269
272
|
mean: p,
|
|
270
|
-
min:
|
|
273
|
+
min: w,
|
|
271
274
|
max: v,
|
|
272
|
-
std:
|
|
273
|
-
range: v -
|
|
275
|
+
std: b,
|
|
276
|
+
range: v - w
|
|
274
277
|
};
|
|
275
278
|
}
|
|
276
279
|
}
|
|
277
|
-
),
|
|
280
|
+
), Me = {
|
|
278
281
|
name: "watermark",
|
|
279
282
|
version: "1.0.0",
|
|
280
283
|
description: "Adds a customizable watermark to the chart",
|
|
281
284
|
provides: ["visualization"],
|
|
282
285
|
tags: ["watermark", "branding", "overlay"]
|
|
283
|
-
},
|
|
284
|
-
|
|
285
|
-
(
|
|
286
|
-
if (!(
|
|
286
|
+
}, Fe = z(
|
|
287
|
+
Me,
|
|
288
|
+
(n) => {
|
|
289
|
+
if (!(n != null && n.text))
|
|
287
290
|
throw new Error("WatermarkPlugin requires 'text' configuration");
|
|
288
291
|
const {
|
|
289
292
|
text: e,
|
|
290
293
|
fontSize: t = 48,
|
|
291
|
-
fontFamily:
|
|
292
|
-
color:
|
|
293
|
-
position:
|
|
294
|
-
rotation:
|
|
295
|
-
} =
|
|
294
|
+
fontFamily: r = "system-ui, sans-serif",
|
|
295
|
+
color: a = "rgba(128, 128, 128, 0.15)",
|
|
296
|
+
position: o = "center",
|
|
297
|
+
rotation: l = o === "center" ? -30 : 0
|
|
298
|
+
} = n;
|
|
296
299
|
return {
|
|
297
|
-
onRenderOverlay(
|
|
298
|
-
const i =
|
|
300
|
+
onRenderOverlay(d) {
|
|
301
|
+
const i = d.render.ctx2d;
|
|
299
302
|
if (!i) return;
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
i.save(), i.font = `${t}px ${
|
|
303
|
-
let
|
|
304
|
-
|
|
303
|
+
d.render.canvasSize;
|
|
304
|
+
const s = d.render.plotArea;
|
|
305
|
+
i.save(), i.font = `${t}px ${r}`, i.fillStyle = a, i.textAlign = "center", i.textBaseline = "middle";
|
|
306
|
+
let c, f;
|
|
307
|
+
o === "center" ? (c = s.x + s.width / 2, f = s.y + s.height / 2) : o === "bottom-right" ? (c = s.x + s.width - t, f = s.y + s.height - t / 2) : (c = s.x + t, f = s.y + s.height - t / 2), i.translate(c, f), i.rotate(l * Math.PI / 180), i.fillText(e, 0, 0), i.restore();
|
|
305
308
|
}
|
|
306
309
|
};
|
|
307
310
|
}
|
|
308
|
-
),
|
|
311
|
+
), Ce = {
|
|
309
312
|
name: "grid-highlight",
|
|
310
313
|
version: "1.0.0",
|
|
311
314
|
description: "Highlights specific regions of the chart grid",
|
|
312
315
|
provides: ["visualization"],
|
|
313
316
|
tags: ["grid", "highlight", "regions"]
|
|
314
|
-
},
|
|
315
|
-
|
|
316
|
-
(
|
|
317
|
-
const { xIntervals: e = [], yIntervals: t = [], opacity:
|
|
317
|
+
}, Ie = z(
|
|
318
|
+
Ce,
|
|
319
|
+
(n = {}) => {
|
|
320
|
+
const { xIntervals: e = [], yIntervals: t = [], opacity: r = 0.1 } = n;
|
|
318
321
|
return {
|
|
319
|
-
onRenderOverlay(
|
|
320
|
-
const
|
|
321
|
-
if (!
|
|
322
|
-
const
|
|
323
|
-
|
|
322
|
+
onRenderOverlay(a, o) {
|
|
323
|
+
const l = a.render.ctx2d;
|
|
324
|
+
if (!l) return;
|
|
325
|
+
const d = a.render.plotArea;
|
|
326
|
+
a.data.getViewBounds(), l.save(), l.beginPath(), l.rect(d.x, d.y, d.width, d.height), l.clip(), l.globalAlpha = r;
|
|
324
327
|
for (const i of e) {
|
|
325
|
-
const
|
|
326
|
-
|
|
327
|
-
Math.min(
|
|
328
|
-
|
|
329
|
-
Math.abs(
|
|
330
|
-
|
|
328
|
+
const s = a.coords.dataToPixelX(i.start), c = a.coords.dataToPixelX(i.end);
|
|
329
|
+
l.fillStyle = i.color, l.fillRect(
|
|
330
|
+
Math.min(s, c),
|
|
331
|
+
d.y,
|
|
332
|
+
Math.abs(c - s),
|
|
333
|
+
d.height
|
|
331
334
|
);
|
|
332
335
|
}
|
|
333
336
|
for (const i of t) {
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
Math.min(
|
|
338
|
-
|
|
339
|
-
Math.abs(
|
|
337
|
+
const s = a.coords.dataToPixelY(i.start), c = a.coords.dataToPixelY(i.end);
|
|
338
|
+
l.fillStyle = i.color, l.fillRect(
|
|
339
|
+
d.x,
|
|
340
|
+
Math.min(s, c),
|
|
341
|
+
d.width,
|
|
342
|
+
Math.abs(c - s)
|
|
340
343
|
);
|
|
341
344
|
}
|
|
342
|
-
|
|
345
|
+
l.restore();
|
|
343
346
|
}
|
|
344
347
|
};
|
|
345
348
|
}
|
|
346
|
-
),
|
|
349
|
+
), De = {
|
|
347
350
|
name: "data-logger",
|
|
348
351
|
version: "1.0.0",
|
|
349
352
|
description: "Logs chart events for debugging and analysis",
|
|
350
353
|
provides: ["analysis"],
|
|
351
354
|
tags: ["debug", "logging", "events"]
|
|
352
|
-
},
|
|
353
|
-
|
|
354
|
-
(
|
|
355
|
+
}, ke = z(
|
|
356
|
+
De,
|
|
357
|
+
(n = {}) => {
|
|
355
358
|
const {
|
|
356
359
|
logDataUpdates: e = !0,
|
|
357
360
|
logViewChanges: t = !0,
|
|
358
|
-
logInteractions:
|
|
359
|
-
maxEntries:
|
|
360
|
-
} =
|
|
361
|
-
function
|
|
362
|
-
|
|
361
|
+
logInteractions: r = !1,
|
|
362
|
+
maxEntries: a = 100
|
|
363
|
+
} = n, o = [];
|
|
364
|
+
function l(d, i) {
|
|
365
|
+
o.push({
|
|
363
366
|
timestamp: Date.now(),
|
|
364
|
-
type:
|
|
367
|
+
type: d,
|
|
365
368
|
data: i
|
|
366
|
-
}),
|
|
369
|
+
}), o.length > a && o.shift();
|
|
367
370
|
}
|
|
368
371
|
return {
|
|
369
|
-
onInit(
|
|
370
|
-
|
|
372
|
+
onInit(d) {
|
|
373
|
+
d.log.info("Data logger initialized");
|
|
371
374
|
},
|
|
372
|
-
onDataUpdate(
|
|
373
|
-
e && (
|
|
375
|
+
onDataUpdate(d, i) {
|
|
376
|
+
e && (l("dataUpdate", {
|
|
374
377
|
seriesId: i.seriesId,
|
|
375
378
|
mode: i.mode,
|
|
376
379
|
pointCount: i.pointCount
|
|
377
|
-
}),
|
|
380
|
+
}), d.log.debug(`Data update: ${i.seriesId} (${i.mode}, ${i.pointCount} points)`));
|
|
378
381
|
},
|
|
379
|
-
onViewChange(
|
|
380
|
-
t && (
|
|
382
|
+
onViewChange(d, i) {
|
|
383
|
+
t && (l("viewChange", {
|
|
381
384
|
trigger: i.trigger,
|
|
382
385
|
bounds: i.current
|
|
383
|
-
}),
|
|
386
|
+
}), d.log.debug(`View change: ${i.trigger}`));
|
|
384
387
|
},
|
|
385
|
-
onInteraction(
|
|
386
|
-
|
|
388
|
+
onInteraction(d, i) {
|
|
389
|
+
r && l("interaction", {
|
|
387
390
|
type: i.type,
|
|
388
391
|
pixelX: i.pixelX,
|
|
389
392
|
pixelY: i.pixelY,
|
|
390
393
|
inPlotArea: i.inPlotArea
|
|
391
394
|
});
|
|
392
395
|
},
|
|
393
|
-
onSerialize(
|
|
394
|
-
return { entries:
|
|
396
|
+
onSerialize(d) {
|
|
397
|
+
return { entries: o };
|
|
395
398
|
},
|
|
396
|
-
onDeserialize(
|
|
397
|
-
const
|
|
398
|
-
|
|
399
|
+
onDeserialize(d, i) {
|
|
400
|
+
const s = i;
|
|
401
|
+
s != null && s.entries && (o.length = 0, o.push(...s.entries));
|
|
399
402
|
},
|
|
400
403
|
api: {
|
|
401
404
|
getEntries() {
|
|
402
|
-
return [...
|
|
405
|
+
return [...o];
|
|
403
406
|
},
|
|
404
407
|
clear() {
|
|
405
|
-
|
|
408
|
+
o.length = 0;
|
|
406
409
|
},
|
|
407
410
|
export() {
|
|
408
|
-
return JSON.stringify(
|
|
411
|
+
return JSON.stringify(o, null, 2);
|
|
409
412
|
}
|
|
410
413
|
}
|
|
411
414
|
};
|
|
412
415
|
}
|
|
413
|
-
),
|
|
416
|
+
), Ee = {
|
|
414
417
|
name: "direction-indicator",
|
|
415
418
|
version: "1.0.0",
|
|
416
419
|
description: "Shows an arrow indicating the direction and trend of streaming data",
|
|
417
420
|
provides: ["visualization", "analysis"],
|
|
418
421
|
tags: ["streaming", "direction", "trend", "arrow"]
|
|
419
|
-
},
|
|
420
|
-
|
|
421
|
-
(
|
|
422
|
+
}, Le = z(
|
|
423
|
+
Ee,
|
|
424
|
+
(n = {}) => {
|
|
422
425
|
const {
|
|
423
426
|
seriesId: e,
|
|
424
427
|
sampleSize: t = 20,
|
|
425
|
-
color:
|
|
426
|
-
size:
|
|
427
|
-
minVelocity:
|
|
428
|
-
historySize:
|
|
429
|
-
idleTimeout:
|
|
430
|
-
} =
|
|
431
|
-
let i,
|
|
428
|
+
color: r,
|
|
429
|
+
size: a = 40,
|
|
430
|
+
minVelocity: o = 0.01,
|
|
431
|
+
historySize: l = 20,
|
|
432
|
+
idleTimeout: d
|
|
433
|
+
} = n;
|
|
434
|
+
let i, s = null, c = null, f = null, w = null;
|
|
432
435
|
const v = [], p = [], S = [];
|
|
433
|
-
let
|
|
436
|
+
let b = l, g = null, y = Date.now(), h = -1 / 0, u = -1 / 0, P = d;
|
|
434
437
|
return {
|
|
435
|
-
onInit(
|
|
438
|
+
onInit(m) {
|
|
436
439
|
i = "direction-indicator-overlay";
|
|
437
|
-
const
|
|
440
|
+
const A = m.ui.createOverlay(i, {
|
|
438
441
|
zIndex: 600,
|
|
439
442
|
position: { top: "0", left: "0", right: "0", bottom: "0" },
|
|
440
443
|
pointerEvents: !1
|
|
441
444
|
});
|
|
442
|
-
if (
|
|
443
|
-
|
|
445
|
+
if (s = document.createElement("canvas"), s.style.cssText = "width: 100%; height: 100%; pointer-events: none;", A.appendChild(s), c = s.getContext("2d"), x(m), e)
|
|
446
|
+
w = e;
|
|
444
447
|
else {
|
|
445
|
-
const T =
|
|
446
|
-
T.length > 0 && (
|
|
448
|
+
const T = m.data.getAllSeries();
|
|
449
|
+
T.length > 0 && (w = T[0].getId());
|
|
447
450
|
}
|
|
448
451
|
},
|
|
449
|
-
onDestroy(
|
|
450
|
-
|
|
452
|
+
onDestroy(m) {
|
|
453
|
+
m.ui.removeOverlay(i), g && clearTimeout(g), s = null, c = null, f = null;
|
|
451
454
|
},
|
|
452
|
-
onResize(
|
|
453
|
-
x(
|
|
455
|
+
onResize(m) {
|
|
456
|
+
x(m);
|
|
454
457
|
},
|
|
455
|
-
onAfterRender(
|
|
456
|
-
if (
|
|
458
|
+
onAfterRender(m) {
|
|
459
|
+
if (I(m), M(m), P) {
|
|
457
460
|
g && clearTimeout(g);
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
}, P -
|
|
461
|
+
const A = Date.now() - y;
|
|
462
|
+
A < P && (g = setTimeout(() => {
|
|
463
|
+
m.requestRender();
|
|
464
|
+
}, P - A + 10));
|
|
462
465
|
}
|
|
463
466
|
},
|
|
464
|
-
onConfigChange(
|
|
465
|
-
if (
|
|
466
|
-
for (
|
|
467
|
-
for (; p.length >
|
|
468
|
-
for (; S.length >
|
|
467
|
+
onConfigChange(m, A) {
|
|
468
|
+
if (A.historySize !== void 0) {
|
|
469
|
+
for (b = A.historySize; v.length > b; ) v.shift();
|
|
470
|
+
for (; p.length > b; ) p.shift();
|
|
471
|
+
for (; S.length > b; ) S.shift();
|
|
469
472
|
}
|
|
470
|
-
|
|
473
|
+
A.idleTimeout !== void 0 && (P = A.idleTimeout);
|
|
471
474
|
}
|
|
472
475
|
};
|
|
473
|
-
function x(
|
|
474
|
-
if (!
|
|
475
|
-
const
|
|
476
|
-
|
|
476
|
+
function x(m) {
|
|
477
|
+
if (!s || !c) return;
|
|
478
|
+
const A = m.render.canvasSize, T = m.render.pixelRatio;
|
|
479
|
+
s.width = A.width * T, s.height = A.height * T, c.setTransform(1, 0, 0, 1, 0, 0), c.scale(T, T);
|
|
477
480
|
}
|
|
478
|
-
function
|
|
479
|
-
if (!
|
|
480
|
-
const T =
|
|
481
|
+
function I(m) {
|
|
482
|
+
if (!w || !m.data.getSeries(w)) return;
|
|
483
|
+
const T = m.data.getSeriesData(w);
|
|
481
484
|
if (!T || !T.x || !T.y) return;
|
|
482
|
-
const
|
|
483
|
-
if (
|
|
484
|
-
const
|
|
485
|
-
(
|
|
486
|
-
const
|
|
487
|
-
let
|
|
488
|
-
for (let
|
|
489
|
-
const
|
|
490
|
-
|
|
485
|
+
const k = T.x.length;
|
|
486
|
+
if (k < 2) return;
|
|
487
|
+
const C = T.x[k - 1], L = T.y[k - 1];
|
|
488
|
+
(C !== h || L !== u) && (h = C, u = L, y = Date.now());
|
|
489
|
+
const D = Math.min(t, k), Y = k - D;
|
|
490
|
+
let E = 0, R = 0, U = 0, K = 0, j = 0, J = 0;
|
|
491
|
+
for (let W = Y; W < k; W++) {
|
|
492
|
+
const G = W - Y, ye = T.x[W], xe = T.y[W], Q = m.coords.dataToPixelX(ye), Z = m.coords.dataToPixelY(xe);
|
|
493
|
+
E += G, R += Q, U += Z, K += G * Q, j += G * Z, J += G * G;
|
|
491
494
|
}
|
|
492
|
-
const
|
|
493
|
-
if (Math.abs(
|
|
494
|
-
const
|
|
495
|
-
v.push(
|
|
496
|
-
const
|
|
497
|
-
|
|
495
|
+
const $ = E / D, le = R / D, ce = U / D, H = J - D * $ * $;
|
|
496
|
+
if (Math.abs(H) < 1e-10) return;
|
|
497
|
+
const N = (K - D * $ * le) / H, q = (j - D * $ * ce) / H, de = Math.atan2(q, N), ue = m.coords.dataToPixelX(C), fe = m.coords.dataToPixelY(L);
|
|
498
|
+
v.push(ue), p.push(fe), v.length > b && (v.shift(), p.shift()), S.push(de), S.length > b && S.shift();
|
|
499
|
+
const he = F(v), ge = F(p), pe = B(S), me = Math.sqrt(N * N + q * q);
|
|
500
|
+
f = { angle: pe, magnitude: me, lastX: C, lastY: L, smoothX: he, smoothY: ge };
|
|
498
501
|
}
|
|
499
|
-
function
|
|
500
|
-
return
|
|
502
|
+
function F(m) {
|
|
503
|
+
return m.length === 0 ? 0 : m.reduce((A, T) => A + T, 0) / m.length;
|
|
501
504
|
}
|
|
502
|
-
function
|
|
503
|
-
if (
|
|
504
|
-
let
|
|
505
|
-
for (const
|
|
506
|
-
|
|
507
|
-
return Math.atan2(T /
|
|
505
|
+
function B(m) {
|
|
506
|
+
if (m.length === 0) return 0;
|
|
507
|
+
let A = 0, T = 0;
|
|
508
|
+
for (const k of m)
|
|
509
|
+
A += Math.cos(k), T += Math.sin(k);
|
|
510
|
+
return Math.atan2(T / m.length, A / m.length);
|
|
508
511
|
}
|
|
509
|
-
function M(
|
|
510
|
-
if (!
|
|
511
|
-
const { width:
|
|
512
|
-
if (
|
|
513
|
-
const
|
|
514
|
-
|
|
512
|
+
function M(m) {
|
|
513
|
+
if (!c || !s || !f) return;
|
|
514
|
+
const { width: A, height: T } = m.render.canvasSize;
|
|
515
|
+
if (c.clearRect(0, 0, A, T), P !== void 0 && Date.now() - y > P || f.magnitude < o) return;
|
|
516
|
+
const k = f.smoothX, C = f.smoothY, L = r || "#FF9800";
|
|
517
|
+
c.save(), _(c, k, C, f.angle, a, L), c.restore();
|
|
515
518
|
}
|
|
516
|
-
function
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
+
function _(m, A, T, k, C, L) {
|
|
520
|
+
const D = C * 0.6, Y = C * 0.4;
|
|
521
|
+
m.save(), m.translate(A, T), m.rotate(k), m.fillStyle = L, m.beginPath(), m.moveTo(D / 2, 0), m.lineTo(-D / 2, -Y / 2), m.lineTo(-D / 2, Y / 2), m.closePath(), m.fill(), m.restore();
|
|
519
522
|
}
|
|
520
523
|
}
|
|
521
|
-
),
|
|
522
|
-
Crosshair:
|
|
523
|
-
Statistics:
|
|
524
|
-
Watermark:
|
|
525
|
-
GridHighlight:
|
|
526
|
-
DataLogger:
|
|
527
|
-
DirectionIndicator:
|
|
528
|
-
},
|
|
524
|
+
), it = {
|
|
525
|
+
Crosshair: Te,
|
|
526
|
+
Statistics: Ae,
|
|
527
|
+
Watermark: Fe,
|
|
528
|
+
GridHighlight: Ie,
|
|
529
|
+
DataLogger: ke,
|
|
530
|
+
DirectionIndicator: Le
|
|
531
|
+
}, Re = {
|
|
529
532
|
name: "velo-plot-drag-edit",
|
|
530
533
|
version: "1.0.0",
|
|
531
534
|
description: "Interactive drag & drop editing of data points",
|
|
532
535
|
provides: ["drag-edit", "point-editing"],
|
|
533
536
|
tags: ["interaction", "editing", "ux"]
|
|
534
|
-
},
|
|
537
|
+
}, Ye = {
|
|
535
538
|
enabled: !0,
|
|
536
539
|
constraint: "both",
|
|
537
540
|
snapToGrid: !1,
|
|
@@ -556,89 +559,89 @@ const ge = {
|
|
|
556
559
|
opacity: 0.5
|
|
557
560
|
}
|
|
558
561
|
};
|
|
559
|
-
function
|
|
560
|
-
const e = { ...
|
|
561
|
-
let t = null,
|
|
562
|
-
function i(g,
|
|
562
|
+
function st(n = {}) {
|
|
563
|
+
const e = { ...Ye, ...n };
|
|
564
|
+
let t = null, r = !1, a = null, o = 0, l = 0, d = !1;
|
|
565
|
+
function i(g, y) {
|
|
563
566
|
if (!t) return null;
|
|
564
|
-
const
|
|
565
|
-
return !
|
|
566
|
-
seriesId:
|
|
567
|
-
index:
|
|
568
|
-
originalX:
|
|
569
|
-
originalY:
|
|
570
|
-
currentX:
|
|
571
|
-
currentY:
|
|
567
|
+
const h = t.coords.pickPoint(g, y, e.hitRadius);
|
|
568
|
+
return !h || e.editableSeries.length > 0 && !e.editableSeries.includes(h.seriesId) ? null : {
|
|
569
|
+
seriesId: h.seriesId,
|
|
570
|
+
index: h.index,
|
|
571
|
+
originalX: h.x,
|
|
572
|
+
originalY: h.y,
|
|
573
|
+
currentX: h.x,
|
|
574
|
+
currentY: h.y
|
|
572
575
|
};
|
|
573
576
|
}
|
|
574
|
-
function
|
|
577
|
+
function s(g, y) {
|
|
575
578
|
return t ? {
|
|
576
579
|
x: t.coords.pixelToDataX(g),
|
|
577
|
-
y: t.coords.pixelToDataY(
|
|
580
|
+
y: t.coords.pixelToDataY(y)
|
|
578
581
|
} : { x: 0, y: 0 };
|
|
579
582
|
}
|
|
580
|
-
function
|
|
581
|
-
return Math.round(g /
|
|
583
|
+
function c(g, y) {
|
|
584
|
+
return Math.round(g / y) * y;
|
|
582
585
|
}
|
|
583
|
-
function
|
|
584
|
-
if (!
|
|
585
|
-
switch (
|
|
586
|
+
function f(g, y, h) {
|
|
587
|
+
if (!a) return { x: g, y };
|
|
588
|
+
switch (h) {
|
|
586
589
|
case "x":
|
|
587
|
-
return { x: g, y:
|
|
590
|
+
return { x: g, y: a.originalY };
|
|
588
591
|
case "y":
|
|
589
|
-
return { x:
|
|
592
|
+
return { x: a.originalX, y };
|
|
590
593
|
case "none":
|
|
591
|
-
return { x:
|
|
594
|
+
return { x: a.originalX, y: a.originalY };
|
|
592
595
|
default:
|
|
593
|
-
return { x: g, y
|
|
596
|
+
return { x: g, y };
|
|
594
597
|
}
|
|
595
598
|
}
|
|
596
|
-
function
|
|
597
|
-
let
|
|
598
|
-
if (e.snapToGrid && (
|
|
599
|
-
const P = { ...
|
|
599
|
+
function w(g, y) {
|
|
600
|
+
let h = g, u = y;
|
|
601
|
+
if (e.snapToGrid && (h = c(g, e.snapIntervalX), u = c(y, e.snapIntervalY)), a && e.validator) {
|
|
602
|
+
const P = { ...a, currentX: h, currentY: u }, x = e.validator(P);
|
|
600
603
|
if (typeof x == "boolean")
|
|
601
|
-
return { x:
|
|
604
|
+
return { x: h, y: u, valid: x };
|
|
602
605
|
if (!x.valid)
|
|
603
|
-
return { x:
|
|
604
|
-
x.snapX !== void 0 && (
|
|
606
|
+
return { x: h, y: u, valid: !1 };
|
|
607
|
+
x.snapX !== void 0 && (h = x.snapX), x.snapY !== void 0 && (u = x.snapY);
|
|
605
608
|
}
|
|
606
|
-
return { x:
|
|
609
|
+
return { x: h, y: u, valid: !0 };
|
|
607
610
|
}
|
|
608
|
-
function v(g,
|
|
609
|
-
var
|
|
611
|
+
function v(g, y, h, u) {
|
|
612
|
+
var I, F, B;
|
|
610
613
|
if (!t) return;
|
|
611
|
-
const P = (
|
|
614
|
+
const P = (F = (I = t.chart).getSeries) == null ? void 0 : F.call(I, g);
|
|
612
615
|
if (!P) return;
|
|
613
616
|
const x = P.getData();
|
|
614
|
-
!x || !x.x || !x.y || (x.x[
|
|
617
|
+
!x || !x.x || !x.y || (x.x[y] = h, x.y[y] = u, (B = P.invalidateBuffers) == null || B.call(P), t.requestRender());
|
|
615
618
|
}
|
|
616
619
|
function p() {
|
|
617
|
-
return
|
|
618
|
-
seriesId:
|
|
619
|
-
index:
|
|
620
|
-
oldX:
|
|
621
|
-
oldY:
|
|
622
|
-
newX:
|
|
623
|
-
newY:
|
|
624
|
-
deltaX:
|
|
625
|
-
deltaY:
|
|
620
|
+
return a ? {
|
|
621
|
+
seriesId: a.seriesId,
|
|
622
|
+
index: a.index,
|
|
623
|
+
oldX: a.originalX,
|
|
624
|
+
oldY: a.originalY,
|
|
625
|
+
newX: a.currentX,
|
|
626
|
+
newY: a.currentY,
|
|
627
|
+
deltaX: a.currentX - a.originalX,
|
|
628
|
+
deltaY: a.currentY - a.originalY
|
|
626
629
|
} : null;
|
|
627
630
|
}
|
|
628
631
|
function S(g) {
|
|
629
|
-
if (!
|
|
630
|
-
const { render:
|
|
631
|
-
if (!
|
|
632
|
-
|
|
633
|
-
const P =
|
|
634
|
-
|
|
632
|
+
if (!r || !a || !e.showPreview) return;
|
|
633
|
+
const { render: y, coords: h } = g, { ctx2d: u } = y;
|
|
634
|
+
if (!u) return;
|
|
635
|
+
u.save();
|
|
636
|
+
const P = h.dataToPixelX(a.originalX), x = h.dataToPixelY(a.originalY), I = h.dataToPixelX(a.currentX), F = h.dataToPixelY(a.currentY);
|
|
637
|
+
u.strokeStyle = e.previewStyle.color || "#ffffff", u.lineWidth = e.previewStyle.width || 2, u.globalAlpha = e.previewStyle.opacity || 0.5, u.setLineDash(e.previewStyle.dash || [5, 5]), u.beginPath(), u.moveTo(P, x), u.lineTo(I, F), u.stroke(), u.globalAlpha = 1, u.fillStyle = e.highlightColor, u.setLineDash([]), u.beginPath(), u.arc(I, F, 6, 0, Math.PI * 2), u.fill(), u.strokeStyle = "#000000", u.lineWidth = 1, u.stroke(), u.restore();
|
|
635
638
|
}
|
|
636
|
-
const
|
|
639
|
+
const b = {
|
|
637
640
|
enable() {
|
|
638
641
|
e.enabled = !0;
|
|
639
642
|
},
|
|
640
643
|
disable() {
|
|
641
|
-
e.enabled = !1,
|
|
644
|
+
e.enabled = !1, r && (a = null, r = !1, d = !1, t == null || t.requestRender());
|
|
642
645
|
},
|
|
643
646
|
isEnabled() {
|
|
644
647
|
return e.enabled;
|
|
@@ -647,73 +650,545 @@ function Re(r = {}) {
|
|
|
647
650
|
e.editableSeries = g;
|
|
648
651
|
},
|
|
649
652
|
getDraggedPoint() {
|
|
650
|
-
return
|
|
653
|
+
return a;
|
|
651
654
|
},
|
|
652
655
|
cancelDrag() {
|
|
653
|
-
|
|
656
|
+
r && a && (a = null, r = !1, d = !1, t == null || t.requestRender());
|
|
654
657
|
},
|
|
655
658
|
updateConfig(g) {
|
|
656
659
|
Object.assign(e, g);
|
|
657
660
|
}
|
|
658
661
|
};
|
|
659
662
|
return {
|
|
660
|
-
manifest:
|
|
663
|
+
manifest: Re,
|
|
661
664
|
onInit(g) {
|
|
662
|
-
t = g, t.chart.dragEdit =
|
|
665
|
+
t = g, t.chart.dragEdit = b;
|
|
663
666
|
},
|
|
664
667
|
onDestroy(g) {
|
|
665
668
|
delete g.chart.dragEdit, t = null;
|
|
666
669
|
},
|
|
667
|
-
onInteraction(g,
|
|
670
|
+
onInteraction(g, y) {
|
|
668
671
|
if (e.enabled) {
|
|
669
|
-
if (
|
|
670
|
-
const
|
|
671
|
-
|
|
672
|
-
} else if (
|
|
673
|
-
if (!
|
|
674
|
-
if (!
|
|
675
|
-
const
|
|
676
|
-
if (Math.sqrt(
|
|
677
|
-
|
|
678
|
-
const
|
|
679
|
-
|
|
672
|
+
if (y.type === "mousedown") {
|
|
673
|
+
const h = i(y.pixelX, y.pixelY);
|
|
674
|
+
h && (a = h, o = y.pixelX, l = y.pixelY, d = !1, r = !1, y.preventDefault());
|
|
675
|
+
} else if (y.type === "mousemove") {
|
|
676
|
+
if (!a) return;
|
|
677
|
+
if (!r) {
|
|
678
|
+
const F = y.pixelX - o, B = y.pixelY - l;
|
|
679
|
+
if (Math.sqrt(F * F + B * B) > e.dragThreshold) {
|
|
680
|
+
r = !0, d = !0;
|
|
681
|
+
const _ = p();
|
|
682
|
+
_ && e.onDragStart(_);
|
|
680
683
|
} else
|
|
681
684
|
return;
|
|
682
685
|
}
|
|
683
|
-
|
|
684
|
-
let { x:
|
|
685
|
-
({ x:
|
|
686
|
-
const { x: P, y: x, valid:
|
|
687
|
-
if (
|
|
688
|
-
|
|
689
|
-
const
|
|
690
|
-
|
|
686
|
+
r && y.preventDefault();
|
|
687
|
+
let { x: h, y: u } = s(y.pixelX, y.pixelY);
|
|
688
|
+
({ x: h, y: u } = f(h, u, e.constraint));
|
|
689
|
+
const { x: P, y: x, valid: I } = w(h, u);
|
|
690
|
+
if (I) {
|
|
691
|
+
a.currentX = P, a.currentY = x;
|
|
692
|
+
const F = p();
|
|
693
|
+
F && e.onDrag(F), t == null || t.requestRender();
|
|
691
694
|
}
|
|
692
|
-
} else if (
|
|
693
|
-
if (!
|
|
694
|
-
if (
|
|
695
|
+
} else if (y.type === "mouseup") {
|
|
696
|
+
if (!a) return;
|
|
697
|
+
if (r && d) {
|
|
695
698
|
v(
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
699
|
+
a.seriesId,
|
|
700
|
+
a.index,
|
|
701
|
+
a.currentX,
|
|
702
|
+
a.currentY
|
|
700
703
|
);
|
|
701
|
-
const
|
|
702
|
-
|
|
704
|
+
const h = p();
|
|
705
|
+
h && e.onDragEnd(h), y.preventDefault();
|
|
703
706
|
}
|
|
704
|
-
|
|
707
|
+
a = null, r = !1, d = !1, t == null || t.requestRender();
|
|
705
708
|
}
|
|
706
709
|
}
|
|
707
710
|
},
|
|
708
711
|
onRenderOverlay(g) {
|
|
709
712
|
S(g);
|
|
710
713
|
},
|
|
711
|
-
api:
|
|
714
|
+
api: b
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
const Xe = {
|
|
718
|
+
name: "velo-plot-drawing-tools",
|
|
719
|
+
version: "1.0.0",
|
|
720
|
+
description: "Interactive trendline, horizontal, vertical, and rectangle drawing",
|
|
721
|
+
provides: ["drawing"],
|
|
722
|
+
tags: ["drawing", "annotations", "trading"]
|
|
723
|
+
};
|
|
724
|
+
function lt(n = {}) {
|
|
725
|
+
let e = null, t = {
|
|
726
|
+
mode: "none",
|
|
727
|
+
pending: null,
|
|
728
|
+
undoStack: [],
|
|
729
|
+
redoStack: []
|
|
730
|
+
}, r = null;
|
|
731
|
+
const a = n.color ?? "#38bdf8";
|
|
732
|
+
function o() {
|
|
733
|
+
var i, s;
|
|
734
|
+
return ((s = e == null ? void 0 : (i = e.chart).getAnnotations) == null ? void 0 : s.call(i)) ?? [];
|
|
735
|
+
}
|
|
736
|
+
function l() {
|
|
737
|
+
t.undoStack.push(o()), t.redoStack = [];
|
|
738
|
+
}
|
|
739
|
+
return {
|
|
740
|
+
manifest: Xe,
|
|
741
|
+
api: {
|
|
742
|
+
setMode(i) {
|
|
743
|
+
t.mode = i, t.pending = null;
|
|
744
|
+
},
|
|
745
|
+
getMode() {
|
|
746
|
+
return t.mode;
|
|
747
|
+
},
|
|
748
|
+
undo() {
|
|
749
|
+
if (!e || t.undoStack.length === 0) return !1;
|
|
750
|
+
t.redoStack.push(o());
|
|
751
|
+
const i = t.undoStack.pop(), s = o();
|
|
752
|
+
for (const c of s) e.chart.removeAnnotation(c.id);
|
|
753
|
+
for (const c of i) e.chart.addAnnotation(c);
|
|
754
|
+
return !0;
|
|
755
|
+
},
|
|
756
|
+
redo() {
|
|
757
|
+
if (!e || t.redoStack.length === 0) return !1;
|
|
758
|
+
t.undoStack.push(o());
|
|
759
|
+
const i = t.redoStack.pop(), s = o();
|
|
760
|
+
for (const c of s) e.chart.removeAnnotation(c.id);
|
|
761
|
+
for (const c of i) e.chart.addAnnotation(c);
|
|
762
|
+
return !0;
|
|
763
|
+
},
|
|
764
|
+
clear() {
|
|
765
|
+
if (e) {
|
|
766
|
+
l();
|
|
767
|
+
for (const i of o()) e.chart.removeAnnotation(i.id);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
},
|
|
771
|
+
onInit(i) {
|
|
772
|
+
e = i, r = (s) => {
|
|
773
|
+
if (!e || t.mode === "none" || t.mode === "pan") return;
|
|
774
|
+
const { x: c, y: f } = s.point;
|
|
775
|
+
if (t.mode === "horizontal") {
|
|
776
|
+
l(), e.chart.addAnnotation({
|
|
777
|
+
type: "horizontal-line",
|
|
778
|
+
y: f,
|
|
779
|
+
color: a,
|
|
780
|
+
interactive: !0
|
|
781
|
+
});
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
if (t.mode === "vertical") {
|
|
785
|
+
l(), e.chart.addAnnotation({
|
|
786
|
+
type: "vertical-line",
|
|
787
|
+
x: c,
|
|
788
|
+
color: a,
|
|
789
|
+
interactive: !0
|
|
790
|
+
});
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
if (!t.pending) {
|
|
794
|
+
t.pending = { x: c, y: f };
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
const w = t.pending;
|
|
798
|
+
t.pending = null, l(), t.mode === "trendline" ? e.chart.addAnnotation({
|
|
799
|
+
type: "arrow",
|
|
800
|
+
x1: w.x,
|
|
801
|
+
y1: w.y,
|
|
802
|
+
x2: c,
|
|
803
|
+
y2: f,
|
|
804
|
+
color: a,
|
|
805
|
+
interactive: !0
|
|
806
|
+
}) : t.mode === "rectangle" && e.chart.addAnnotation({
|
|
807
|
+
type: "rectangle",
|
|
808
|
+
xMin: Math.min(w.x, c),
|
|
809
|
+
xMax: Math.max(w.x, c),
|
|
810
|
+
yMin: Math.min(w.y, f),
|
|
811
|
+
yMax: Math.max(w.y, f),
|
|
812
|
+
strokeColor: a,
|
|
813
|
+
fillColor: a + "22",
|
|
814
|
+
interactive: !0
|
|
815
|
+
});
|
|
816
|
+
}, e.chart.on("click", r);
|
|
817
|
+
},
|
|
818
|
+
onDestroy(i) {
|
|
819
|
+
r && i.chart.off("click", r), e = null, r = null;
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
const Be = {
|
|
824
|
+
name: "velo-plot-replay",
|
|
825
|
+
version: "1.0.0",
|
|
826
|
+
description: "Bar-by-bar chart replay with speed control",
|
|
827
|
+
provides: ["replay"],
|
|
828
|
+
tags: ["replay", "trading"]
|
|
829
|
+
};
|
|
830
|
+
function ct(n) {
|
|
831
|
+
let e = null, t = null, r = 0, a = null, o = 1;
|
|
832
|
+
const l = n.frameMs ?? 250;
|
|
833
|
+
function d(s) {
|
|
834
|
+
if (!e || !t) return;
|
|
835
|
+
const c = Math.min(s + 1, t.x.length), f = (w) => w ? w.subarray(0, c) : void 0;
|
|
836
|
+
e.chart.updateSeries(n.seriesId, {
|
|
837
|
+
x: f(t.x),
|
|
838
|
+
y: f(t.y),
|
|
839
|
+
open: f(t.open),
|
|
840
|
+
high: f(t.high),
|
|
841
|
+
low: f(t.low),
|
|
842
|
+
close: f(t.close)
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
const i = {
|
|
846
|
+
play(s = 1) {
|
|
847
|
+
t && (o = Math.max(0.1, s), a && clearInterval(a), a = setInterval(() => {
|
|
848
|
+
if (r >= t.x.length - 1) {
|
|
849
|
+
i.pause();
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
r++, d(r);
|
|
853
|
+
}, l / o));
|
|
854
|
+
},
|
|
855
|
+
pause() {
|
|
856
|
+
a && (clearInterval(a), a = null);
|
|
857
|
+
},
|
|
858
|
+
step(s = 1) {
|
|
859
|
+
t && (r = Math.min(t.x.length - 1, r + s), d(r));
|
|
860
|
+
},
|
|
861
|
+
seek(s) {
|
|
862
|
+
t && (r = Math.max(0, Math.min(t.x.length - 1, s)), d(r));
|
|
863
|
+
},
|
|
864
|
+
getIndex() {
|
|
865
|
+
return r;
|
|
866
|
+
},
|
|
867
|
+
getLength() {
|
|
868
|
+
return (t == null ? void 0 : t.x.length) ?? 0;
|
|
869
|
+
},
|
|
870
|
+
isPlaying() {
|
|
871
|
+
return a != null;
|
|
872
|
+
}
|
|
873
|
+
};
|
|
874
|
+
return {
|
|
875
|
+
manifest: Be,
|
|
876
|
+
api: i,
|
|
877
|
+
onInit(s) {
|
|
878
|
+
e = s;
|
|
879
|
+
const c = e.chart.getSeries(n.seriesId);
|
|
880
|
+
if (!c) {
|
|
881
|
+
console.warn(`[PluginReplay] Series "${n.seriesId}" not found`);
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
const f = c.getData();
|
|
885
|
+
t = {
|
|
886
|
+
x: Float32Array.from(f.x),
|
|
887
|
+
y: f.y ? Float32Array.from(f.y) : void 0,
|
|
888
|
+
open: f.open ? Float32Array.from(f.open) : void 0,
|
|
889
|
+
high: f.high ? Float32Array.from(f.high) : void 0,
|
|
890
|
+
low: f.low ? Float32Array.from(f.low) : void 0,
|
|
891
|
+
close: f.close ? Float32Array.from(f.close) : void 0
|
|
892
|
+
}, r = Math.max(0, t.x.length - 1);
|
|
893
|
+
},
|
|
894
|
+
onDestroy() {
|
|
895
|
+
i.pause(), e = null, t = null;
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
const _e = `
|
|
900
|
+
attribute vec2 aPosition;
|
|
901
|
+
uniform vec2 uResolution;
|
|
902
|
+
void main() {
|
|
903
|
+
vec2 clip = (aPosition / uResolution) * 2.0 - 1.0;
|
|
904
|
+
gl_Position = vec4(clip.x, -clip.y, 0.0, 1.0);
|
|
905
|
+
}
|
|
906
|
+
`, ze = `
|
|
907
|
+
precision mediump float;
|
|
908
|
+
uniform vec4 uColor;
|
|
909
|
+
void main() {
|
|
910
|
+
gl_FragColor = uColor;
|
|
911
|
+
}
|
|
912
|
+
`;
|
|
913
|
+
function ne(n, e, t) {
|
|
914
|
+
const r = n.createShader(e);
|
|
915
|
+
if (!r) throw new Error("createShader failed");
|
|
916
|
+
if (n.shaderSource(r, t), n.compileShader(r), !n.getShaderParameter(r, n.COMPILE_STATUS))
|
|
917
|
+
throw new Error(n.getShaderInfoLog(r) ?? "shader compile failed");
|
|
918
|
+
return r;
|
|
919
|
+
}
|
|
920
|
+
function We(n) {
|
|
921
|
+
const e = ne(n, n.VERTEX_SHADER, _e), t = ne(n, n.FRAGMENT_SHADER, ze), r = n.createProgram();
|
|
922
|
+
if (!r) throw new Error("createProgram failed");
|
|
923
|
+
if (n.attachShader(r, e), n.attachShader(r, t), n.linkProgram(r), !n.getProgramParameter(r, n.LINK_STATUS))
|
|
924
|
+
throw new Error(n.getProgramInfoLog(r) ?? "program link failed");
|
|
925
|
+
return n.deleteShader(e), n.deleteShader(t), r;
|
|
926
|
+
}
|
|
927
|
+
function Ge(n) {
|
|
928
|
+
const { plotArea: e, xLines: t, yLines: r } = n, a = e.y, o = e.y + e.height, l = e.x, d = e.x + e.width, i = (t.length + r.length) * 2, s = new Float32Array(i * 2);
|
|
929
|
+
let c = 0;
|
|
930
|
+
for (const f of t)
|
|
931
|
+
s[c++] = f, s[c++] = a, s[c++] = f, s[c++] = o;
|
|
932
|
+
for (const f of r)
|
|
933
|
+
s[c++] = l, s[c++] = f, s[c++] = d, s[c++] = f;
|
|
934
|
+
return s;
|
|
935
|
+
}
|
|
936
|
+
class Ue {
|
|
937
|
+
constructor(e) {
|
|
938
|
+
X(this, "gl");
|
|
939
|
+
X(this, "program");
|
|
940
|
+
X(this, "buffer");
|
|
941
|
+
X(this, "aPosition");
|
|
942
|
+
X(this, "uResolution");
|
|
943
|
+
X(this, "uColor");
|
|
944
|
+
const t = e.getContext("webgl", {
|
|
945
|
+
alpha: !0,
|
|
946
|
+
antialias: !1,
|
|
947
|
+
preserveDrawingBuffer: !0
|
|
948
|
+
});
|
|
949
|
+
if (!t) throw new Error("WebGL not available for grid spike");
|
|
950
|
+
this.gl = t, this.program = We(t), this.aPosition = t.getAttribLocation(this.program, "aPosition"), this.uResolution = t.getUniformLocation(this.program, "uResolution"), this.uColor = t.getUniformLocation(this.program, "uColor");
|
|
951
|
+
const r = t.createBuffer();
|
|
952
|
+
if (!r) throw new Error("createBuffer failed");
|
|
953
|
+
this.buffer = r;
|
|
954
|
+
}
|
|
955
|
+
/** Upload vertices and draw grid lines */
|
|
956
|
+
draw(e) {
|
|
957
|
+
const t = this.gl, r = Ge(e), a = r.length / 4;
|
|
958
|
+
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, r, 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);
|
|
959
|
+
const o = e.color ?? [0.2, 0.22, 0.3, 0.6];
|
|
960
|
+
return t.uniform4f(this.uColor, o[0], o[1], o[2], o[3]), t.lineWidth(e.lineWidth ?? 1), t.drawArrays(t.LINES, 0, r.length / 2), a;
|
|
961
|
+
}
|
|
962
|
+
destroy() {
|
|
963
|
+
const e = this.gl;
|
|
964
|
+
e.deleteBuffer(this.buffer), e.deleteProgram(this.program);
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
function $e(n) {
|
|
968
|
+
const e = () => {
|
|
969
|
+
};
|
|
970
|
+
return {
|
|
971
|
+
canvas: n,
|
|
972
|
+
strokeStyle: "",
|
|
973
|
+
fillStyle: "",
|
|
974
|
+
lineWidth: 1,
|
|
975
|
+
font: "",
|
|
976
|
+
textAlign: "left",
|
|
977
|
+
textBaseline: "alphabetic",
|
|
978
|
+
beginPath: e,
|
|
979
|
+
moveTo: e,
|
|
980
|
+
lineTo: e,
|
|
981
|
+
stroke: e,
|
|
982
|
+
fill: e,
|
|
983
|
+
clearRect: e,
|
|
984
|
+
setTransform: e,
|
|
985
|
+
setLineDash: e,
|
|
986
|
+
save: e,
|
|
987
|
+
restore: e,
|
|
988
|
+
translate: e,
|
|
989
|
+
rotate: e,
|
|
990
|
+
fillText: e,
|
|
991
|
+
measureText: (t) => ({ width: t.length * 7 })
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
function Oe(n, e) {
|
|
995
|
+
const t = document.createElement("canvas");
|
|
996
|
+
return t.width = n, t.height = e, t.getContext("2d") ?? $e(t);
|
|
997
|
+
}
|
|
998
|
+
function ae(n, e) {
|
|
999
|
+
const t = { top: 40, right: 40, bottom: 50, left: 60 };
|
|
1000
|
+
return {
|
|
1001
|
+
x: t.left,
|
|
1002
|
+
y: t.top,
|
|
1003
|
+
width: n - t.left - t.right,
|
|
1004
|
+
height: e - t.top - t.bottom
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
function ie(n, e, t, r, a) {
|
|
1008
|
+
const o = e.ticks(r).map((d) => te(e.transform(d))), l = t.ticks(a).map((d) => te(t.transform(d)));
|
|
1009
|
+
return { xLines: o, yLines: l };
|
|
1010
|
+
}
|
|
1011
|
+
function se(n, e) {
|
|
1012
|
+
const t = [];
|
|
1013
|
+
for (let o = 0; o < e; o++) {
|
|
1014
|
+
const l = performance.now();
|
|
1015
|
+
n(), t.push((performance.now() - l) * 1e3);
|
|
1016
|
+
}
|
|
1017
|
+
t.sort((o, l) => o - l);
|
|
1018
|
+
const r = t.reduce((o, l) => o + l, 0) / t.length, a = t[Math.floor(t.length * 0.95)] ?? r;
|
|
1019
|
+
return { avg: r, p95: a };
|
|
1020
|
+
}
|
|
1021
|
+
function He(n = {}) {
|
|
1022
|
+
const e = Math.round((n.width ?? 1920) * (n.dpr ?? 1)), t = Math.round((n.height ?? 1080) * (n.dpr ?? 1)), r = n.xTickCount ?? 24, a = n.yTickCount ?? 16, o = n.frames ?? 120, l = Oe(e, t), d = {
|
|
1023
|
+
...ee,
|
|
1024
|
+
grid: {
|
|
1025
|
+
...ee.grid,
|
|
1026
|
+
visible: !0,
|
|
1027
|
+
showMinor: n.showMinor ?? !0
|
|
1028
|
+
}
|
|
1029
|
+
}, i = ae(e, t), s = new O(), c = new O();
|
|
1030
|
+
s.setDomain(0, 1e6), c.setDomain(-1, 1), s.setRange(i.x, i.x + i.width), c.setRange(i.y + i.height, i.y);
|
|
1031
|
+
const f = new Pe(l, d), { avg: w, p95: v } = se(() => {
|
|
1032
|
+
l.clearRect(0, 0, e, t), f.drawGrid(i, s, c, { tickCount: r }, { tickCount: a });
|
|
1033
|
+
}, o), { xLines: p, yLines: S } = ie(i, s, c, r, a);
|
|
1034
|
+
return {
|
|
1035
|
+
backend: "canvas2d",
|
|
1036
|
+
dpr: n.dpr ?? 1,
|
|
1037
|
+
width: e,
|
|
1038
|
+
height: t,
|
|
1039
|
+
xTicks: r,
|
|
1040
|
+
yTicks: a,
|
|
1041
|
+
lineSegments: p.length + S.length,
|
|
1042
|
+
avgFrameUs: Math.round(w),
|
|
1043
|
+
p95FrameUs: Math.round(v),
|
|
1044
|
+
frames: o
|
|
712
1045
|
};
|
|
713
1046
|
}
|
|
714
|
-
|
|
1047
|
+
function Ne(n = {}) {
|
|
1048
|
+
const e = Math.round((n.width ?? 1920) * (n.dpr ?? 1)), t = Math.round((n.height ?? 1080) * (n.dpr ?? 1)), r = n.xTickCount ?? 24, a = n.yTickCount ?? 16, o = n.frames ?? 120, l = document.createElement("canvas");
|
|
1049
|
+
l.width = e, l.height = t;
|
|
1050
|
+
let d;
|
|
1051
|
+
try {
|
|
1052
|
+
d = new Ue(l);
|
|
1053
|
+
} catch {
|
|
1054
|
+
return null;
|
|
1055
|
+
}
|
|
1056
|
+
const i = ae(e, t), s = new O(), c = new O();
|
|
1057
|
+
s.setDomain(0, 1e6), c.setDomain(-1, 1), s.setRange(i.x, i.x + i.width), c.setRange(i.y + i.height, i.y);
|
|
1058
|
+
const { xLines: f, yLines: w } = ie(i, s, c, r, a), v = { plotArea: i, xLines: f, yLines: w, width: e, height: t };
|
|
1059
|
+
let p = 0;
|
|
1060
|
+
const { avg: S, p95: b } = se(() => {
|
|
1061
|
+
p = d.draw(v);
|
|
1062
|
+
}, o);
|
|
1063
|
+
return d.destroy(), {
|
|
1064
|
+
backend: "webgl",
|
|
1065
|
+
dpr: n.dpr ?? 1,
|
|
1066
|
+
width: e,
|
|
1067
|
+
height: t,
|
|
1068
|
+
xTicks: r,
|
|
1069
|
+
yTicks: a,
|
|
1070
|
+
lineSegments: p,
|
|
1071
|
+
avgFrameUs: Math.round(S),
|
|
1072
|
+
p95FrameUs: Math.round(b),
|
|
1073
|
+
frames: o
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
function dt(n) {
|
|
1077
|
+
const e = (n == null ? void 0 : n.dpr) ?? 2, t = (n == null ? void 0 : n.frames) ?? 120, r = He({ dpr: e, frames: t, showMinor: !0 }), a = Ne({ dpr: e, frames: t });
|
|
1078
|
+
if (!a)
|
|
1079
|
+
return {
|
|
1080
|
+
canvas2d: r,
|
|
1081
|
+
webgl: null,
|
|
1082
|
+
gainPercent: 0,
|
|
1083
|
+
recommendation: "defer"
|
|
1084
|
+
};
|
|
1085
|
+
const o = (r.avgFrameUs - a.avgFrameUs) / r.avgFrameUs * 100;
|
|
1086
|
+
return {
|
|
1087
|
+
canvas2d: r,
|
|
1088
|
+
webgl: a,
|
|
1089
|
+
gainPercent: Math.round(o * 10) / 10,
|
|
1090
|
+
recommendation: o >= 20 ? "implement" : "defer"
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
const qe = "1.17.0", Ve = "2026-07-05", Ke = "Stage 1 baselines. Headless CI uses effective FPS (render throughput when rAF throttled) via scripts/benchmark-scenario-eval.mjs smoke floors.", je = 0.1, Je = 0.95, Qe = {
|
|
1094
|
+
"line-1m-pan": {
|
|
1095
|
+
minAvgFps: 50,
|
|
1096
|
+
maxAvgFrameTimeMs: 20,
|
|
1097
|
+
points: 1e6,
|
|
1098
|
+
description: "1M line points, continuous pan/zoom simulation"
|
|
1099
|
+
},
|
|
1100
|
+
"candlestick-500k": {
|
|
1101
|
+
minAvgFps: 45,
|
|
1102
|
+
maxAvgFrameTimeMs: 22,
|
|
1103
|
+
points: 5e5,
|
|
1104
|
+
description: "500k OHLC bars with PluginVirtualization"
|
|
1105
|
+
},
|
|
1106
|
+
"stack-5pane-resize": {
|
|
1107
|
+
minAvgFps: 48,
|
|
1108
|
+
maxAvgFrameTimeMs: 21,
|
|
1109
|
+
description: "5-pane stack divider drag (batched overlay redraw)"
|
|
1110
|
+
},
|
|
1111
|
+
"line-200k-webgl": {
|
|
1112
|
+
minAvgFps: 45,
|
|
1113
|
+
description: "200k line WebGL baseline for renderer compare"
|
|
1114
|
+
},
|
|
1115
|
+
"line-200k-webgpu": {
|
|
1116
|
+
minAvgFps: 42,
|
|
1117
|
+
description: "200k line WebGPU — target ≥95% of WebGL FPS"
|
|
1118
|
+
},
|
|
1119
|
+
"boxplot-5k-webgpu": {
|
|
1120
|
+
minAvgFps: 50,
|
|
1121
|
+
description: "5k boxplot series on WebGPU chart path"
|
|
1122
|
+
},
|
|
1123
|
+
"grid-canvas2d-dpr2": {
|
|
1124
|
+
maxAvgFrameUs: 1200,
|
|
1125
|
+
dpr: 2,
|
|
1126
|
+
description: "Canvas 2D grid+minor at 1920×1080 @2x"
|
|
1127
|
+
},
|
|
1128
|
+
"grid-webgl-dpr2": {
|
|
1129
|
+
maxAvgFrameUs: 400,
|
|
1130
|
+
dpr: 2,
|
|
1131
|
+
description: "WebGL grid spike lines only @2x"
|
|
1132
|
+
}
|
|
1133
|
+
}, V = {
|
|
1134
|
+
version: qe,
|
|
1135
|
+
recordedAt: Ve,
|
|
1136
|
+
notes: Ke,
|
|
1137
|
+
regressionThreshold: je,
|
|
1138
|
+
webgpuMinFpsRatio: Je,
|
|
1139
|
+
scenarios: Qe
|
|
1140
|
+
};
|
|
1141
|
+
function ut() {
|
|
1142
|
+
return V;
|
|
1143
|
+
}
|
|
1144
|
+
function ft(n, e) {
|
|
1145
|
+
const t = V.scenarios[n];
|
|
1146
|
+
if (!t)
|
|
1147
|
+
return { passed: !0, failures: [] };
|
|
1148
|
+
const r = [], a = V.regressionThreshold ?? 0.1;
|
|
1149
|
+
if ("avgFps" in e && t.minAvgFps !== void 0) {
|
|
1150
|
+
const o = t.minAvgFps * (1 - a);
|
|
1151
|
+
e.avgFps < o && r.push(
|
|
1152
|
+
`FPS ${e.avgFps} < baseline min ${t.minAvgFps} (allowed ${o.toFixed(1)} with ${a * 100}% slack)`
|
|
1153
|
+
);
|
|
1154
|
+
}
|
|
1155
|
+
if ("avgFrameTime" in e && t.maxAvgFrameTimeMs !== void 0) {
|
|
1156
|
+
const o = t.maxAvgFrameTimeMs * (1 + a);
|
|
1157
|
+
e.avgFrameTime > o && r.push(
|
|
1158
|
+
`Frame time ${e.avgFrameTime}ms > baseline max ${t.maxAvgFrameTimeMs}ms`
|
|
1159
|
+
);
|
|
1160
|
+
}
|
|
1161
|
+
if ("avgFrameUs" in e && t.maxAvgFrameUs !== void 0) {
|
|
1162
|
+
const o = t.maxAvgFrameUs * (1 + a);
|
|
1163
|
+
e.avgFrameUs > o && r.push(
|
|
1164
|
+
`Grid frame ${e.avgFrameUs}µs > baseline max ${t.maxAvgFrameUs}µs`
|
|
1165
|
+
);
|
|
1166
|
+
}
|
|
1167
|
+
return { passed: r.length === 0, failures: r };
|
|
1168
|
+
}
|
|
1169
|
+
function ht(n, e, t, r = 0.95) {
|
|
1170
|
+
if (!t || !e)
|
|
1171
|
+
return {
|
|
1172
|
+
webgl: n,
|
|
1173
|
+
webgpu: e,
|
|
1174
|
+
webgpuActive: !1,
|
|
1175
|
+
fpsRatio: 0,
|
|
1176
|
+
meetsTarget: !1,
|
|
1177
|
+
recommendation: "webgpu-unavailable"
|
|
1178
|
+
};
|
|
1179
|
+
const a = n.avgFps > 0 ? e.avgFps / n.avgFps : 0, o = a >= r;
|
|
1180
|
+
return {
|
|
1181
|
+
webgl: n,
|
|
1182
|
+
webgpu: e,
|
|
1183
|
+
webgpuActive: !0,
|
|
1184
|
+
fpsRatio: a,
|
|
1185
|
+
meetsTarget: o,
|
|
1186
|
+
recommendation: o ? "webgpu-ready" : "webgl-faster"
|
|
1187
|
+
};
|
|
1188
|
+
}
|
|
1189
|
+
class Ze {
|
|
715
1190
|
constructor(e) {
|
|
716
|
-
|
|
1191
|
+
X(this, "seed");
|
|
717
1192
|
this.seed = e;
|
|
718
1193
|
}
|
|
719
1194
|
next() {
|
|
@@ -724,7 +1199,7 @@ class Ae {
|
|
|
724
1199
|
return e + this.next() * (t - e);
|
|
725
1200
|
}
|
|
726
1201
|
}
|
|
727
|
-
function
|
|
1202
|
+
function gt(n) {
|
|
728
1203
|
const e = {
|
|
729
1204
|
pointCount: 1e3,
|
|
730
1205
|
amplitude: 1,
|
|
@@ -734,16 +1209,16 @@ function Xe(r) {
|
|
|
734
1209
|
xStart: 0,
|
|
735
1210
|
xEnd: 10,
|
|
736
1211
|
offset: 0,
|
|
737
|
-
...
|
|
738
|
-
}, t = new Float32Array(e.pointCount),
|
|
739
|
-
for (let
|
|
740
|
-
t[
|
|
741
|
-
const
|
|
742
|
-
|
|
1212
|
+
...n
|
|
1213
|
+
}, t = new Float32Array(e.pointCount), r = new Float32Array(e.pointCount), a = (e.xEnd - e.xStart) / (e.pointCount - 1);
|
|
1214
|
+
for (let o = 0; o < e.pointCount; o++) {
|
|
1215
|
+
t[o] = e.xStart + o * a;
|
|
1216
|
+
const l = e.amplitude * Math.sin(2 * Math.PI * e.frequency * t[o] + e.phase), d = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
|
|
1217
|
+
r[o] = l + d + e.offset;
|
|
743
1218
|
}
|
|
744
|
-
return { x: t, y:
|
|
1219
|
+
return { x: t, y: r };
|
|
745
1220
|
}
|
|
746
|
-
function
|
|
1221
|
+
function pt(n) {
|
|
747
1222
|
const e = {
|
|
748
1223
|
pointCount: 1e3,
|
|
749
1224
|
amplitude: 1,
|
|
@@ -753,16 +1228,16 @@ function Ye(r) {
|
|
|
753
1228
|
xStart: 0,
|
|
754
1229
|
xEnd: 10,
|
|
755
1230
|
offset: 0,
|
|
756
|
-
...
|
|
757
|
-
}, t = new Float32Array(e.pointCount),
|
|
758
|
-
for (let
|
|
759
|
-
t[
|
|
760
|
-
const
|
|
761
|
-
|
|
1231
|
+
...n
|
|
1232
|
+
}, t = new Float32Array(e.pointCount), r = new Float32Array(e.pointCount), a = (e.xEnd - e.xStart) / (e.pointCount - 1);
|
|
1233
|
+
for (let o = 0; o < e.pointCount; o++) {
|
|
1234
|
+
t[o] = e.xStart + o * a;
|
|
1235
|
+
const l = t[o] * e.frequency + e.phase / (2 * Math.PI), d = Math.sign(Math.sin(2 * Math.PI * l)) * e.amplitude, i = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
|
|
1236
|
+
r[o] = d + i + e.offset;
|
|
762
1237
|
}
|
|
763
|
-
return { x: t, y:
|
|
1238
|
+
return { x: t, y: r };
|
|
764
1239
|
}
|
|
765
|
-
function
|
|
1240
|
+
function mt(n) {
|
|
766
1241
|
const e = {
|
|
767
1242
|
pointCount: 1e3,
|
|
768
1243
|
amplitude: 1,
|
|
@@ -772,16 +1247,16 @@ function ke(r) {
|
|
|
772
1247
|
xStart: 0,
|
|
773
1248
|
xEnd: 10,
|
|
774
1249
|
offset: 0,
|
|
775
|
-
...
|
|
776
|
-
}, t = new Float32Array(e.pointCount),
|
|
777
|
-
for (let
|
|
778
|
-
t[
|
|
779
|
-
const
|
|
780
|
-
|
|
1250
|
+
...n
|
|
1251
|
+
}, t = new Float32Array(e.pointCount), r = new Float32Array(e.pointCount), a = (e.xEnd - e.xStart) / (e.pointCount - 1);
|
|
1252
|
+
for (let o = 0; o < e.pointCount; o++) {
|
|
1253
|
+
t[o] = e.xStart + o * a;
|
|
1254
|
+
const l = t[o] * e.frequency + e.phase / (2 * Math.PI), d = e.amplitude * 2 * (l - Math.floor(l + 0.5)), i = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
|
|
1255
|
+
r[o] = d + i + e.offset;
|
|
781
1256
|
}
|
|
782
|
-
return { x: t, y:
|
|
1257
|
+
return { x: t, y: r };
|
|
783
1258
|
}
|
|
784
|
-
function
|
|
1259
|
+
function yt(n) {
|
|
785
1260
|
const e = {
|
|
786
1261
|
pointCount: 1e3,
|
|
787
1262
|
amplitude: 1,
|
|
@@ -791,37 +1266,37 @@ function ze(r) {
|
|
|
791
1266
|
xStart: 0,
|
|
792
1267
|
xEnd: 10,
|
|
793
1268
|
offset: 0,
|
|
794
|
-
...
|
|
795
|
-
}, t = new Float32Array(e.pointCount),
|
|
796
|
-
for (let
|
|
797
|
-
t[
|
|
798
|
-
const
|
|
799
|
-
|
|
1269
|
+
...n
|
|
1270
|
+
}, t = new Float32Array(e.pointCount), r = new Float32Array(e.pointCount), a = (e.xEnd - e.xStart) / (e.pointCount - 1);
|
|
1271
|
+
for (let o = 0; o < e.pointCount; o++) {
|
|
1272
|
+
t[o] = e.xStart + o * a;
|
|
1273
|
+
const l = t[o] * e.frequency + e.phase / (2 * Math.PI), d = e.amplitude * 2 * Math.abs(2 * (l - Math.floor(l + 0.5))) - e.amplitude, i = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
|
|
1274
|
+
r[o] = d + i + e.offset;
|
|
800
1275
|
}
|
|
801
|
-
return { x: t, y:
|
|
1276
|
+
return { x: t, y: r };
|
|
802
1277
|
}
|
|
803
|
-
function
|
|
1278
|
+
function xt(n) {
|
|
804
1279
|
const e = {
|
|
805
1280
|
pointCount: 1e3,
|
|
806
1281
|
xRange: [0, 100],
|
|
807
1282
|
yRange: [-1, 1],
|
|
808
1283
|
sorted: !0,
|
|
809
1284
|
seed: Date.now(),
|
|
810
|
-
...
|
|
811
|
-
}, t = new
|
|
812
|
-
for (let
|
|
813
|
-
|
|
1285
|
+
...n
|
|
1286
|
+
}, t = new Ze(e.seed), r = new Float32Array(e.pointCount), a = new Float32Array(e.pointCount);
|
|
1287
|
+
for (let o = 0; o < e.pointCount; o++)
|
|
1288
|
+
r[o] = t.nextRange(e.xRange[0], e.xRange[1]), a[o] = t.nextRange(e.yRange[0], e.yRange[1]);
|
|
814
1289
|
if (e.sorted) {
|
|
815
|
-
const
|
|
816
|
-
|
|
817
|
-
const
|
|
1290
|
+
const o = Array.from({ length: e.pointCount }, (i, s) => s);
|
|
1291
|
+
o.sort((i, s) => r[i] - r[s]);
|
|
1292
|
+
const l = new Float32Array(e.pointCount), d = new Float32Array(e.pointCount);
|
|
818
1293
|
for (let i = 0; i < e.pointCount; i++)
|
|
819
|
-
|
|
820
|
-
return { x:
|
|
1294
|
+
l[i] = r[o[i]], d[i] = a[o[i]];
|
|
1295
|
+
return { x: l, y: d };
|
|
821
1296
|
}
|
|
822
|
-
return { x:
|
|
1297
|
+
return { x: r, y: a };
|
|
823
1298
|
}
|
|
824
|
-
function
|
|
1299
|
+
function vt(n) {
|
|
825
1300
|
const e = {
|
|
826
1301
|
pointCount: 2e3,
|
|
827
1302
|
vMin: -0.5,
|
|
@@ -830,18 +1305,18 @@ function Oe(r) {
|
|
|
830
1305
|
peakCurrent: 1e-5,
|
|
831
1306
|
// 10 µA
|
|
832
1307
|
noise: 0.02,
|
|
833
|
-
...
|
|
834
|
-
}, t = e.pointCount * e.cycles,
|
|
835
|
-
for (let
|
|
836
|
-
for (let i = 0; i <
|
|
837
|
-
const
|
|
838
|
-
i <
|
|
839
|
-
const
|
|
840
|
-
|
|
1308
|
+
...n
|
|
1309
|
+
}, t = e.pointCount * e.cycles, r = new Float32Array(t), a = new Float32Array(t), o = e.pointCount, l = o / 2;
|
|
1310
|
+
for (let d = 0; d < e.cycles; d++)
|
|
1311
|
+
for (let i = 0; i < o; i++) {
|
|
1312
|
+
const s = d * o + i;
|
|
1313
|
+
i < l ? r[s] = e.vMin + (e.vMax - e.vMin) * (i / l) : r[s] = e.vMax - (e.vMax - e.vMin) * ((i - l) / l);
|
|
1314
|
+
const c = r[s], f = 0, w = i < l ? 1 : -1, v = 0.1, p = -Math.pow(c - f, 2) / (2 * v * v), S = e.peakCurrent * Math.exp(p), b = w * e.peakCurrent * 0.1, g = (Math.random() - 0.5) * 2 * e.noise * e.peakCurrent;
|
|
1315
|
+
a[s] = w * S + b + g;
|
|
841
1316
|
}
|
|
842
|
-
return { x:
|
|
1317
|
+
return { x: r, y: a };
|
|
843
1318
|
}
|
|
844
|
-
function
|
|
1319
|
+
function wt(n) {
|
|
845
1320
|
const e = {
|
|
846
1321
|
pointCount: 50,
|
|
847
1322
|
rSolution: 100,
|
|
@@ -849,380 +1324,438 @@ function $e(r) {
|
|
|
849
1324
|
rCharge: 1e3,
|
|
850
1325
|
// Ohms
|
|
851
1326
|
frequency: [1e5, 0.01],
|
|
852
|
-
...
|
|
853
|
-
}, t = new Float32Array(e.pointCount),
|
|
854
|
-
for (let
|
|
855
|
-
const
|
|
856
|
-
t[
|
|
1327
|
+
...n
|
|
1328
|
+
}, t = new Float32Array(e.pointCount), r = new Float32Array(e.pointCount), a = Math.log10(e.frequency[1]), o = Math.log10(e.frequency[0]);
|
|
1329
|
+
for (let l = 0; l < e.pointCount; l++) {
|
|
1330
|
+
const d = o - (o - a) * (l / (e.pointCount - 1)), i = 2 * Math.PI * Math.pow(10, d), s = e.rCharge * 1e-5, c = e.rSolution + e.rCharge / (1 + Math.pow(i * s, 2)), f = i * s * e.rCharge / (1 + Math.pow(i * s, 2));
|
|
1331
|
+
t[l] = c, r[l] = -f;
|
|
857
1332
|
}
|
|
858
|
-
return { x: t, y:
|
|
1333
|
+
return { x: t, y: r };
|
|
859
1334
|
}
|
|
860
|
-
async function
|
|
1335
|
+
async function Pt(n, e) {
|
|
861
1336
|
const t = {
|
|
862
1337
|
duration: 5e3,
|
|
863
1338
|
warmup: 1e3,
|
|
864
1339
|
...e
|
|
865
|
-
},
|
|
866
|
-
let
|
|
867
|
-
const
|
|
868
|
-
return new Promise((
|
|
869
|
-
const
|
|
870
|
-
let
|
|
871
|
-
function
|
|
1340
|
+
}, r = [], a = [];
|
|
1341
|
+
let o = 0;
|
|
1342
|
+
const l = n.getAllSeries().reduce((d, i) => d + i.getPointCount(), 0);
|
|
1343
|
+
return new Promise((d) => {
|
|
1344
|
+
const i = performance.now() + t.warmup + t.duration, s = performance.now() + t.warmup;
|
|
1345
|
+
let c = !1, f = 0;
|
|
1346
|
+
function w() {
|
|
872
1347
|
const v = performance.now();
|
|
873
|
-
if (v >=
|
|
874
|
-
const
|
|
875
|
-
avgFps: Math.round(
|
|
876
|
-
minFps:
|
|
877
|
-
maxFps:
|
|
878
|
-
avgFrameTime: Math.round(
|
|
879
|
-
frameCount:
|
|
1348
|
+
if (v >= i) {
|
|
1349
|
+
const b = a.length > 0 ? a.reduce((P, x) => P + x, 0) / a.length : 0, g = f > 0 ? v - f : t.duration, y = o > 0 && g > 0 ? o / g * 1e3 : 0, h = r.length > 0 ? r.reduce((P, x) => P + x, 0) / r.length : b > 0 ? 1e3 / b : 0, u = {
|
|
1350
|
+
avgFps: Math.round(y * 100) / 100,
|
|
1351
|
+
minFps: Math.round((r.length > 0 ? Math.min(...r) : y) * 100) / 100,
|
|
1352
|
+
maxFps: Math.round((r.length > 0 ? Math.max(...r) : y) * 100) / 100,
|
|
1353
|
+
avgFrameTime: Math.round(b * 1e3) / 1e3,
|
|
1354
|
+
frameCount: o,
|
|
880
1355
|
duration: t.duration,
|
|
881
|
-
pointsRendered:
|
|
882
|
-
throughput: Math.round(
|
|
1356
|
+
pointsRendered: l,
|
|
1357
|
+
throughput: Math.round(l * y / 1e3) * 1e3,
|
|
1358
|
+
/** @internal render-only FPS (not wall clock) */
|
|
1359
|
+
...h > 0 ? { renderFps: Math.round(h * 100) / 100 } : {}
|
|
883
1360
|
};
|
|
884
|
-
|
|
1361
|
+
d(u);
|
|
885
1362
|
return;
|
|
886
1363
|
}
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
1364
|
+
v >= s && !c && (c = !0, f = v, o = 0, a.length = 0, r.length = 0);
|
|
1365
|
+
const p = performance.now();
|
|
1366
|
+
n.render();
|
|
1367
|
+
const S = performance.now();
|
|
1368
|
+
if (c) {
|
|
1369
|
+
const b = S - p;
|
|
1370
|
+
a.push(b), o++;
|
|
1371
|
+
const g = a.slice(-30);
|
|
1372
|
+
if (g.length > 0) {
|
|
1373
|
+
const y = g.reduce((h, u) => h + u, 0) / g.length;
|
|
1374
|
+
y > 0 && r.push(1e3 / y);
|
|
894
1375
|
}
|
|
895
1376
|
}
|
|
896
|
-
|
|
1377
|
+
requestAnimationFrame(w);
|
|
897
1378
|
}
|
|
898
|
-
requestAnimationFrame(
|
|
1379
|
+
requestAnimationFrame(w);
|
|
899
1380
|
});
|
|
900
1381
|
}
|
|
901
|
-
function
|
|
1382
|
+
function St(n, e) {
|
|
902
1383
|
const t = {
|
|
903
1384
|
format: "json",
|
|
904
1385
|
includeStyles: !0,
|
|
905
1386
|
...e
|
|
906
|
-
},
|
|
907
|
-
id:
|
|
908
|
-
type:
|
|
909
|
-
pointCount:
|
|
910
|
-
...t.includeStyles ? { style:
|
|
911
|
-
})),
|
|
1387
|
+
}, r = n.getAllSeries().map((o) => ({
|
|
1388
|
+
id: o.getId(),
|
|
1389
|
+
type: o.getType(),
|
|
1390
|
+
pointCount: o.getPointCount(),
|
|
1391
|
+
...t.includeStyles ? { style: o.getStyle() } : {}
|
|
1392
|
+
})), a = {
|
|
912
1393
|
timestamp: Date.now(),
|
|
913
1394
|
config: {},
|
|
914
|
-
series:
|
|
915
|
-
bounds:
|
|
1395
|
+
series: r,
|
|
1396
|
+
bounds: n.getViewBounds()
|
|
916
1397
|
};
|
|
917
|
-
return t.format === "png" &&
|
|
1398
|
+
return t.format === "png" && n.exportImage && (a.image = n.exportImage()), a;
|
|
918
1399
|
}
|
|
919
|
-
function
|
|
920
|
-
const
|
|
921
|
-
|
|
922
|
-
for (let
|
|
923
|
-
const
|
|
924
|
-
|
|
1400
|
+
function Tt(n, e, t = 1e-6) {
|
|
1401
|
+
const r = [];
|
|
1402
|
+
n.series.length !== e.series.length && r.push(`Series count: ${n.series.length} vs ${e.series.length}`);
|
|
1403
|
+
for (let o = 0; o < Math.min(n.series.length, e.series.length); o++) {
|
|
1404
|
+
const l = n.series[o], d = e.series[o];
|
|
1405
|
+
l.id !== d.id && r.push(`Series[${o}] id: "${l.id}" vs "${d.id}"`), l.type !== d.type && r.push(`Series[${o}] type: "${l.type}" vs "${d.type}"`), l.pointCount !== d.pointCount && r.push(`Series[${o}] pointCount: ${l.pointCount} vs ${d.pointCount}`);
|
|
925
1406
|
}
|
|
926
|
-
const
|
|
927
|
-
for (const
|
|
928
|
-
Math.abs(
|
|
1407
|
+
const a = ["xMin", "xMax", "yMin", "yMax"];
|
|
1408
|
+
for (const o of a)
|
|
1409
|
+
Math.abs(n.bounds[o] - e.bounds[o]) > t && r.push(`Bounds.${o}: ${n.bounds[o]} vs ${e.bounds[o]}`);
|
|
929
1410
|
return {
|
|
930
|
-
equal:
|
|
931
|
-
differences:
|
|
1411
|
+
equal: r.length === 0,
|
|
1412
|
+
differences: r
|
|
932
1413
|
};
|
|
933
1414
|
}
|
|
934
|
-
function
|
|
1415
|
+
function bt(n, e) {
|
|
935
1416
|
const t = [];
|
|
936
|
-
return e.minFps &&
|
|
1417
|
+
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}`), {
|
|
937
1418
|
passed: t.length === 0,
|
|
938
1419
|
failures: t
|
|
939
1420
|
};
|
|
940
1421
|
}
|
|
941
|
-
function
|
|
1422
|
+
function At(n = 1) {
|
|
942
1423
|
return new Promise((e) => {
|
|
943
|
-
let t =
|
|
944
|
-
function
|
|
945
|
-
t--, t <= 0 ? e() : requestAnimationFrame(
|
|
1424
|
+
let t = n;
|
|
1425
|
+
function r() {
|
|
1426
|
+
t--, t <= 0 ? e() : requestAnimationFrame(r);
|
|
946
1427
|
}
|
|
947
|
-
requestAnimationFrame(
|
|
1428
|
+
requestAnimationFrame(r);
|
|
948
1429
|
});
|
|
949
1430
|
}
|
|
950
|
-
function
|
|
951
|
-
return new Promise((e) => setTimeout(e,
|
|
1431
|
+
function Mt(n) {
|
|
1432
|
+
return new Promise((e) => setTimeout(e, n));
|
|
952
1433
|
}
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
1434
|
+
const oe = 864e5;
|
|
1435
|
+
function et(n) {
|
|
1436
|
+
return new Date(n).getUTCDay();
|
|
1437
|
+
}
|
|
1438
|
+
function tt(n, e = {}) {
|
|
1439
|
+
const t = et(n);
|
|
1440
|
+
return t !== 0 && t !== 6;
|
|
1441
|
+
}
|
|
1442
|
+
function Ft(n, e = {}) {
|
|
1443
|
+
const t = e.calendar ?? "business-day", r = n.length, a = new Float32Array(r), o = new Int32Array(r);
|
|
1444
|
+
if (o.fill(-1), t === "continuous") {
|
|
1445
|
+
for (let i = 0; i < r; i++)
|
|
1446
|
+
a[i] = n[i], o[i] = i;
|
|
1447
|
+
return {
|
|
1448
|
+
scaledX: a,
|
|
1449
|
+
timeByIndex: n instanceof Float32Array ? n : Float32Array.from(n),
|
|
1450
|
+
sourceToScaled: o
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
const l = [];
|
|
1454
|
+
let d = 0;
|
|
1455
|
+
for (let i = 0; i < r; i++) {
|
|
1456
|
+
const s = n[i];
|
|
1457
|
+
if (!Number.isFinite(s) || !tt(s, e)) {
|
|
1458
|
+
a[i] = Number.NaN;
|
|
1459
|
+
continue;
|
|
1460
|
+
}
|
|
1461
|
+
a[i] = d, l[d] = s, o[i] = d, d++;
|
|
1462
|
+
}
|
|
960
1463
|
return {
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
yRange: r.yRange,
|
|
965
|
-
chart: {
|
|
966
|
-
yAxis: {
|
|
967
|
-
label: r.label ?? "Indicator",
|
|
968
|
-
auto: r.yRange === void 0 || r.yRange === "auto",
|
|
969
|
-
tickCount: r.tickCount ?? 5,
|
|
970
|
-
scientific: !1
|
|
971
|
-
},
|
|
972
|
-
xAxis: { showLabels: !1, showTicks: !1, showLine: !1 },
|
|
973
|
-
animations: !1,
|
|
974
|
-
loading: !1,
|
|
975
|
-
showLegend: !1
|
|
976
|
-
},
|
|
977
|
-
series: s
|
|
1464
|
+
scaledX: a,
|
|
1465
|
+
timeByIndex: Float32Array.from(l),
|
|
1466
|
+
sourceToScaled: o
|
|
978
1467
|
};
|
|
979
1468
|
}
|
|
1469
|
+
function Ct(n, e, t) {
|
|
1470
|
+
const r = Math.max(0, Math.floor(e)), a = Math.min(n.timeByIndex.length - 1, Math.ceil(t)), o = n.timeByIndex[r], l = n.timeByIndex[a];
|
|
1471
|
+
return o == null || l == null ? oe : Math.abs(l - o) || oe;
|
|
1472
|
+
}
|
|
1473
|
+
function It(n) {
|
|
1474
|
+
const e = n.close.length, t = new Float32Array(e), r = new Float32Array(e), a = new Float32Array(e), o = new Float32Array(e);
|
|
1475
|
+
for (let l = 0; l < e; l++) {
|
|
1476
|
+
const d = n.open[l], i = n.high[l], s = n.low[l], c = n.close[l];
|
|
1477
|
+
o[l] = (d + i + s + c) / 4, t[l] = l === 0 ? (d + c) / 2 : (t[l - 1] + o[l - 1]) / 2, r[l] = Math.max(i, t[l], o[l]), a[l] = Math.min(s, t[l], o[l]);
|
|
1478
|
+
}
|
|
1479
|
+
return { open: t, high: r, low: a, close: o };
|
|
1480
|
+
}
|
|
980
1481
|
export {
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
Gn as
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
$
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
Vo as
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1482
|
+
Et as AnimationEngine,
|
|
1483
|
+
Ln as AnnotationManager,
|
|
1484
|
+
nr as BackpressureManager,
|
|
1485
|
+
vr as BaseBufferStore,
|
|
1486
|
+
wr as BaseTextureStore,
|
|
1487
|
+
it as BuiltinPlugins,
|
|
1488
|
+
la as ChartGroup,
|
|
1489
|
+
Lt as ChartInitQueue,
|
|
1490
|
+
or as CircularBuffer,
|
|
1491
|
+
Hr as ClipboardManager,
|
|
1492
|
+
Te as CrosshairPlugin,
|
|
1493
|
+
ee as DARK_THEME,
|
|
1494
|
+
Rt as DEFAULT_ANIMATION_CONFIG,
|
|
1495
|
+
zr as DEFAULT_KEY_BINDINGS,
|
|
1496
|
+
Yt as DEFAULT_LAYOUT,
|
|
1497
|
+
Xt as DEFAULT_THEME,
|
|
1498
|
+
ke as DataLoggerPlugin,
|
|
1499
|
+
Jr as DebugOverlay,
|
|
1500
|
+
Le as DirectionIndicatorPlugin,
|
|
1501
|
+
Bt as ELECTROCHEM_THEME,
|
|
1502
|
+
kn as EventEmitter,
|
|
1503
|
+
Pr as GpuBenchmark,
|
|
1504
|
+
Sr as GpuCompute,
|
|
1505
|
+
qn as GpuRenderer,
|
|
1506
|
+
Ie as GridHighlightPlugin,
|
|
1507
|
+
Wr as KeyBindingManager,
|
|
1508
|
+
_t as LIGHT_THEME,
|
|
1509
|
+
Mr as LOCALE_DE_DE,
|
|
1510
|
+
Fr as LOCALE_EN_US,
|
|
1511
|
+
Cr as LOCALE_ES_ES,
|
|
1512
|
+
Ir as LOCALE_FR_FR,
|
|
1513
|
+
Dr as LOCALE_JA_JP,
|
|
1514
|
+
kr as LOCALE_PT_BR,
|
|
1515
|
+
Er as LOCALE_ZH_CN,
|
|
1516
|
+
O as LinearScale,
|
|
1517
|
+
na as LoadingIndicator,
|
|
1518
|
+
zt as LogScale,
|
|
1519
|
+
Wt as MIDNIGHT_THEME,
|
|
1520
|
+
Gt as NativeWebGLRenderer,
|
|
1521
|
+
Pe as OverlayRenderer,
|
|
1522
|
+
Tr as PipelineCache,
|
|
1523
|
+
ii as Plugin3D,
|
|
1524
|
+
So as PluginAnalysis,
|
|
1525
|
+
Rn as PluginAnnotations,
|
|
1526
|
+
mi as PluginAnomalyDetection,
|
|
1527
|
+
Xi as PluginBrokenAxis,
|
|
1528
|
+
Ei as PluginCaching,
|
|
1529
|
+
Nr as PluginClipboard,
|
|
1530
|
+
gi as PluginContextMenu,
|
|
1531
|
+
fi as PluginDataExport,
|
|
1532
|
+
Ci as PluginDataTransform,
|
|
1533
|
+
Qr as PluginDebug,
|
|
1534
|
+
st as PluginDragEdit,
|
|
1535
|
+
lt as PluginDrawingTools,
|
|
1536
|
+
Oi as PluginForecasting,
|
|
1537
|
+
br as PluginGpu,
|
|
1538
|
+
li as PluginI18n,
|
|
1539
|
+
Gr as PluginKeyboard,
|
|
1540
|
+
Di as PluginLaTeX,
|
|
1541
|
+
Ri as PluginLazyLoad,
|
|
1542
|
+
oa as PluginLoading,
|
|
1543
|
+
xi as PluginMLIntegration,
|
|
1544
|
+
Ut as PluginManagerImpl,
|
|
1545
|
+
Wi as PluginOffscreen,
|
|
1546
|
+
wi as PluginPatternRecognition,
|
|
1547
|
+
Ui as PluginROI,
|
|
1548
|
+
bi as PluginRadar,
|
|
1549
|
+
Si as PluginRegression,
|
|
1550
|
+
ct as PluginReplay,
|
|
1551
|
+
Mi as PluginSnapshot,
|
|
1552
|
+
rr as PluginStreaming,
|
|
1553
|
+
di as PluginSync,
|
|
1554
|
+
ha as PluginThemeEditor,
|
|
1555
|
+
eo as PluginTools,
|
|
1556
|
+
_i as PluginVideoRecorder,
|
|
1557
|
+
ao as PluginVirtualization,
|
|
1558
|
+
$t as SERIALIZATION_VERSION,
|
|
1559
|
+
hr as STACKED_DEFAULT_MIN_PANE_RATIO,
|
|
1560
|
+
gr as STACKED_MAX_PANES,
|
|
1561
|
+
pr as SciPlot,
|
|
1562
|
+
Ot as Series,
|
|
1563
|
+
Vn as SeriesAdapter,
|
|
1564
|
+
Ht as StateHistory,
|
|
1565
|
+
Ae as StatsPlugin,
|
|
1566
|
+
ga as THEME_PRESETS,
|
|
1567
|
+
to as TOOLTIP_THEMES,
|
|
1568
|
+
pa as ThemeEditor,
|
|
1569
|
+
no as TooltipManager,
|
|
1570
|
+
Fe as WatermarkPlugin,
|
|
1571
|
+
Kn as WebGLBackend,
|
|
1572
|
+
jn as WebGPUBackend,
|
|
1573
|
+
re as WebGPURenderer,
|
|
1574
|
+
vo as WorkerPool,
|
|
1575
|
+
Nt as addIndicatorToChart,
|
|
1576
|
+
za as adx,
|
|
1577
|
+
To as analyzeComplexSpectrum,
|
|
1578
|
+
bo as analyzeSpectrum,
|
|
1579
|
+
Wa as aroon,
|
|
1580
|
+
Ao as arraysToComplex,
|
|
1581
|
+
bt as assertPerformance,
|
|
1582
|
+
Ga as atr,
|
|
1583
|
+
Mo as autoCorrelation,
|
|
1584
|
+
Fo as bandPassFilter,
|
|
1585
|
+
Co as bandStopFilter,
|
|
1586
|
+
He as benchmarkCanvasGrid,
|
|
1587
|
+
Pt as benchmarkRender,
|
|
1588
|
+
Ne as benchmarkWebGLGrid,
|
|
1589
|
+
Io as blackmanWindow,
|
|
1590
|
+
Ua as bollingerBands,
|
|
1591
|
+
qt as bollingerBandsAsync,
|
|
1592
|
+
Vt as buildIndicatorPane,
|
|
1593
|
+
Kt as buildIndicatorPaneFromPreset,
|
|
1594
|
+
jt as buildIndicatorSeries,
|
|
1595
|
+
Ct as businessDaySpanMs,
|
|
1596
|
+
Do as butterworth,
|
|
1597
|
+
La as calculateR2,
|
|
1598
|
+
wa as calculateStats,
|
|
1599
|
+
io as calculateTargetPoints,
|
|
1600
|
+
Xn as checkPluginCompatibility,
|
|
1601
|
+
dt as compareGridBackends,
|
|
1602
|
+
ft as compareScenarioToBaseline,
|
|
1603
|
+
Tt as compareSnapshots,
|
|
1604
|
+
ko as complexToArrays,
|
|
1605
|
+
Jt as compressString,
|
|
1606
|
+
It as computeHeikinAshi,
|
|
1607
|
+
Qt as computeIndicatorFromSeries,
|
|
1608
|
+
Zt as computeIndicatorPreset,
|
|
1609
|
+
ar as connectStreamToChart,
|
|
1610
|
+
qr as copyToClipboard,
|
|
1611
|
+
ir as createBackpressureManager,
|
|
1612
|
+
en as createChart,
|
|
1613
|
+
ca as createChartGroup,
|
|
1614
|
+
Bn as createConfigurablePlugin,
|
|
1615
|
+
Zr as createDebugOverlay,
|
|
1616
|
+
Jn as createGpuRenderer,
|
|
1617
|
+
tn as createIndicatorSeries,
|
|
1618
|
+
Ur as createKeyBinding,
|
|
1619
|
+
ra as createLoadingIndicator,
|
|
1620
|
+
Lr as createLocaleFormatter,
|
|
1621
|
+
sr as createLosslessBackpressure,
|
|
1622
|
+
da as createMasterSlave,
|
|
1623
|
+
lr as createMessageParser,
|
|
1624
|
+
cr as createMockStream,
|
|
1625
|
+
nn as createNativeRenderer,
|
|
1626
|
+
_n as createPlugin,
|
|
1627
|
+
on as createPluginContext,
|
|
1628
|
+
dr as createRealtimeBackpressure,
|
|
1629
|
+
zn as createRenderer,
|
|
1630
|
+
rn as createScale,
|
|
1631
|
+
St as createSnapshot,
|
|
1632
|
+
mr as createStackedChart,
|
|
1633
|
+
an as createTheme,
|
|
1634
|
+
ma as createThemeEditor,
|
|
1635
|
+
ur as createWebSocketStream,
|
|
1636
|
+
Eo as crossCorrelation,
|
|
1637
|
+
$a as cumsum,
|
|
1638
|
+
Ra as cumulativeIntegral,
|
|
1639
|
+
sn as decodeFloat32Array,
|
|
1640
|
+
ln as decompressString,
|
|
1641
|
+
Wn as defineAndRegister,
|
|
1642
|
+
z as definePlugin,
|
|
1643
|
+
Oa as dema,
|
|
1644
|
+
Ya as derivative,
|
|
1645
|
+
so as destroyDownsamplePool,
|
|
1646
|
+
cn as destroyIndicatorPool,
|
|
1647
|
+
Lo as detectAnomalies,
|
|
1648
|
+
Pa as detectCycles,
|
|
1649
|
+
dn as detectIndicatorMarkers,
|
|
1650
|
+
Sa as detectPeaks,
|
|
1651
|
+
Ro as dominantFrequency,
|
|
1652
|
+
lo as downsampleAsync,
|
|
1653
|
+
Ta as downsampleLTTB,
|
|
1654
|
+
un as easings,
|
|
1655
|
+
Ha as ema,
|
|
1656
|
+
fn as emaAsync,
|
|
1657
|
+
ea as enableDebugMode,
|
|
1658
|
+
hn as encodeFloat32Array,
|
|
1659
|
+
ht as evaluateRendererCompare,
|
|
1660
|
+
Yo as exponentialMovingAverage,
|
|
1661
|
+
Xo as fft,
|
|
1662
|
+
Bo as fftFromComplexInput,
|
|
1663
|
+
Vr as formatData,
|
|
1664
|
+
ba as formatScientific,
|
|
1665
|
+
Aa as formatValue,
|
|
1666
|
+
Ma as formatWithPrefix,
|
|
1667
|
+
_o as gaussianSmooth,
|
|
1668
|
+
vt as generateCVData,
|
|
1669
|
+
Fa as generateCycleColors,
|
|
1670
|
+
wt as generateNyquistData,
|
|
1671
|
+
xt as generateRandomData,
|
|
1672
|
+
mt as generateSawtoothWave,
|
|
1673
|
+
gt as generateSineWave,
|
|
1674
|
+
pt as generateSquareWave,
|
|
1675
|
+
yt as generateTriangleWave,
|
|
1676
|
+
ut as getBaseline,
|
|
1677
|
+
Ca as getBestPrefix,
|
|
1678
|
+
gn as getChartInitQueue,
|
|
1679
|
+
Kr as getClipboardManager,
|
|
1680
|
+
co as getDownsamplePoolSize,
|
|
1681
|
+
Rr as getGlobalLocale,
|
|
1682
|
+
Yr as getLocale,
|
|
1683
|
+
Gn as getPluginRegistry,
|
|
1684
|
+
zo as getPositiveFrequencies,
|
|
1685
|
+
ya as getPresetNames,
|
|
1686
|
+
xa as getPresetTheme,
|
|
1687
|
+
pn as getSharedAnimationEngine,
|
|
1688
|
+
mn as getThemeByName,
|
|
1689
|
+
oo as getTooltipThemeForChartTheme,
|
|
1690
|
+
Wo as hammingWindow,
|
|
1691
|
+
Go as hanningWindow,
|
|
1692
|
+
Uo as highPassFilter,
|
|
1693
|
+
$o as ifft,
|
|
1694
|
+
Oo as ifftComplex,
|
|
1695
|
+
Ho as ifftFromArrays,
|
|
1696
|
+
Xa as integrate,
|
|
1697
|
+
yn as interleaveData,
|
|
1698
|
+
tt as isBusinessDay,
|
|
1699
|
+
ua as linkCharts,
|
|
1700
|
+
Un as listPluginsByCategory,
|
|
1701
|
+
$n as loadPlugin,
|
|
1702
|
+
No as lowPassFilter,
|
|
1703
|
+
uo as lowerBoundX,
|
|
1704
|
+
fo as lttbDownsample,
|
|
1705
|
+
Na as macd,
|
|
1706
|
+
xn as macdAsync,
|
|
1707
|
+
Ft as mapToBusinessDayScale,
|
|
1708
|
+
qo as medianFilter,
|
|
1709
|
+
vn as mergeAnimationConfig,
|
|
1710
|
+
wn as mergeLayoutOptions,
|
|
1711
|
+
ho as minMaxDownsample,
|
|
1712
|
+
qa as momentum,
|
|
1713
|
+
Ia as movingAverage,
|
|
1714
|
+
Vo as nextPowerOf2,
|
|
1715
|
+
wo as nextTaskId,
|
|
1716
|
+
Va as normalize,
|
|
1717
|
+
Ka as obv,
|
|
1718
|
+
go as ohlcDownsampleAsync,
|
|
1719
|
+
po as ohlcMinMaxDownsample,
|
|
1720
|
+
Pn as parseColor,
|
|
1721
|
+
Qn as parseColorToRGBA,
|
|
1722
|
+
$r as parseShortcut,
|
|
1723
|
+
ja as percentChange,
|
|
1724
|
+
Ko as powerSpectrum,
|
|
1725
|
+
Sn as queueChartInit,
|
|
1726
|
+
Xr as registerLocale,
|
|
1727
|
+
On as registerPlugin,
|
|
1728
|
+
Tn as resetChartQueue,
|
|
1729
|
+
Ja as roc,
|
|
1730
|
+
Qa as rsi,
|
|
1731
|
+
bn as rsiAsync,
|
|
1732
|
+
jo as savitzkyGolay,
|
|
1733
|
+
Br as setGlobalLocale,
|
|
1734
|
+
aa as showLoading,
|
|
1735
|
+
ia as showProgress,
|
|
1736
|
+
Jo as simpsonsIntegration,
|
|
1737
|
+
Qo as singleFrequencyFilter,
|
|
1738
|
+
mo as sliceSeriesToViewport,
|
|
1739
|
+
Za as sma,
|
|
1740
|
+
An as smaAsync,
|
|
1741
|
+
Ba as solveLinearSystem,
|
|
1742
|
+
ei as standardDeviation,
|
|
1743
|
+
Mn as stateToUrlHash,
|
|
1744
|
+
ti as stochastic,
|
|
1745
|
+
Da as subtractBaseline,
|
|
1746
|
+
Zo as tTest,
|
|
1747
|
+
ni as tema,
|
|
1748
|
+
er as trapezoidalIntegration,
|
|
1749
|
+
yo as upperBoundX,
|
|
1750
|
+
Fn as urlHashToState,
|
|
1751
|
+
yr as useSciPlot,
|
|
1752
|
+
Cn as validateChartState,
|
|
1753
|
+
ka as validateData,
|
|
1754
|
+
Hn as validateManifest,
|
|
1755
|
+
oi as vwap,
|
|
1756
|
+
Mt as waitFor,
|
|
1757
|
+
In as waitForAnimations,
|
|
1758
|
+
At as waitForFrames,
|
|
1759
|
+
ri as wma
|
|
1227
1760
|
};
|
|
1228
1761
|
//# sourceMappingURL=velo-plot.full.js.map
|