velo-plot 2.20.0 → 3.0.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 +15 -8
- package/dist/{ChartCore-ivzLqxVb.js → ChartCore-BpzRvN4Y.js} +978 -861
- package/dist/ChartCore-BpzRvN4Y.js.map +1 -0
- package/dist/a11y-Bw6urYpr.js +105 -0
- package/dist/a11y-Bw6urYpr.js.map +1 -0
- package/dist/angular/hooks-entry.d.ts +1 -0
- package/dist/angular/hooks.d.ts +26 -0
- package/dist/angular/index.d.ts +8 -0
- package/dist/angular/velo-plot.component.d.ts +46 -0
- package/dist/angular-hooks.d.ts +1 -0
- package/dist/angular-hooks.js +9 -0
- package/dist/angular-hooks.js.map +1 -0
- package/dist/angular.d.ts +1 -0
- package/dist/angular.js +166 -0
- package/dist/angular.js.map +1 -0
- package/dist/assets/indicator.worker-bv0zC4EX.js.map +1 -1
- package/dist/astro/StackedPlot.astro +19 -0
- package/dist/astro/VeloPlot.astro +23 -0
- package/dist/bindings/shared/a11y.d.ts +26 -0
- package/dist/bindings/shared/chartLifecycle.d.ts +16 -0
- package/dist/bindings/shared/chartSyncBridge.d.ts +8 -0
- package/dist/bindings/shared/dimensions.d.ts +1 -0
- package/dist/bindings/shared/index.d.ts +9 -0
- package/dist/bindings/shared/indicatorBridge.d.ts +11 -0
- package/dist/bindings/shared/optionsSync.d.ts +7 -0
- package/dist/bindings/shared/seriesDiff.d.ts +8 -0
- package/dist/bindings/shared/stackedSync.d.ts +9 -0
- package/dist/bindings/shared/types.d.ts +46 -0
- package/dist/bindings/test-utils/index.d.ts +35 -0
- package/dist/bindings/test-utils/mockLifecycle.d.ts +120 -0
- package/dist/bindings/test-utils/vitestSveltePlugin.d.ts +3 -0
- package/dist/chartSyncBridge-DbWrwtyP.js +57 -0
- package/dist/chartSyncBridge-DbWrwtyP.js.map +1 -0
- package/dist/core/Chart.d.ts +1 -1
- package/dist/core/InteractionManager.d.ts +7 -1
- package/dist/core/OverlayRenderer.d.ts +5 -0
- package/dist/core/annotations/types.d.ts +1 -1
- package/dist/core/chart/ChartCore.d.ts +2 -2
- package/dist/core/chart/types.d.ts +1 -1
- package/dist/core/clipboard/index.d.ts +1 -1
- package/dist/core/debug/index.d.ts +1 -1
- package/dist/core/keybindings/index.d.ts +1 -1
- package/dist/core/loading/index.d.ts +1 -1
- package/dist/core/locale/index.d.ts +1 -1
- package/dist/core/stacked/paneResize.d.ts +3 -0
- package/dist/core/stacked/types.d.ts +10 -0
- package/dist/core/theme-editor/index.d.ts +1 -1
- package/dist/createStackedChart-Dm-YqUT7.js +756 -0
- package/dist/createStackedChart-Dm-YqUT7.js.map +1 -0
- package/dist/examples/PluginDemonstration.d.ts +1 -1
- package/dist/gpuRenderer-BpaMYz-k.js.map +1 -1
- package/dist/hooks-CYPCxoZx.js +69 -0
- package/dist/hooks-CYPCxoZx.js.map +1 -0
- package/dist/{index-BBpJwOct.js → index-0InEyj0q.js} +119 -121
- package/dist/index-0InEyj0q.js.map +1 -0
- package/dist/index-BMiZoKmm.js.map +1 -1
- package/dist/{index-DoYxf1cV.js → index-CWxIHdwX.js} +38 -98
- package/dist/index-CWxIHdwX.js.map +1 -0
- package/dist/index-CaXWSOTk.js.map +1 -1
- package/dist/index-Dag88bW4.js.map +1 -1
- package/dist/index-qhscKTDy.js.map +1 -1
- package/dist/index-qunX30Xu.js.map +1 -1
- package/dist/index-x4stH3jD.js.map +1 -1
- package/dist/{index.core-COREBDNq.js → index.core-BmZe2jRQ.js} +9 -9
- package/dist/index.core-BmZe2jRQ.js.map +1 -0
- package/dist/index.core.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/indicators--eJGmVox.js.map +1 -1
- package/dist/{mockDatafeed-927foCM4.js → mockDatafeed-DHIDPcpX.js} +150 -146
- package/dist/mockDatafeed-DHIDPcpX.js.map +1 -0
- package/dist/optionsSync-QUiN4Inw.js +119 -0
- package/dist/optionsSync-QUiN4Inw.js.map +1 -0
- package/dist/plugins/3d/index.d.ts +2 -2
- package/dist/plugins/3d.d.ts +2 -2
- package/dist/plugins/3d.js.map +1 -1
- package/dist/plugins/analysis/index.d.ts +1 -1
- package/dist/plugins/analysis/indicators.d.ts +1 -1
- package/dist/plugins/analysis.d.ts +2 -2
- package/dist/plugins/analysis.js +2 -2
- package/dist/plugins/analysis.js.map +1 -1
- package/dist/plugins/annotations/index.d.ts +1 -1
- package/dist/plugins/annotations.d.ts +2 -2
- package/dist/plugins/annotations.js.map +1 -1
- package/dist/plugins/anomaly-detection.js +1 -1
- package/dist/plugins/anomaly-detection.js.map +1 -1
- package/dist/plugins/broken-axis.d.ts +2 -2
- package/dist/plugins/builtins/crosshair/CrosshairPlugin.d.ts +1 -1
- package/dist/plugins/builtins/index.d.ts +1 -1
- package/dist/plugins/caching.d.ts +2 -2
- package/dist/plugins/clipboard/index.d.ts +2 -2
- package/dist/plugins/clipboard.d.ts +2 -2
- package/dist/plugins/clipboard.js.map +1 -1
- package/dist/plugins/context-menu/index.d.ts +1 -1
- package/dist/plugins/context-menu.d.ts +2 -2
- package/dist/plugins/context-menu.js +1 -1
- package/dist/plugins/context-menu.js.map +1 -1
- package/dist/plugins/data-export/index.d.ts +1 -1
- package/dist/plugins/data-export.d.ts +2 -2
- package/dist/plugins/data-export.js +2 -2
- package/dist/plugins/data-export.js.map +1 -1
- package/dist/plugins/data-transform.d.ts +2 -2
- package/dist/plugins/data-transform.js +19 -19
- package/dist/plugins/data-transform.js.map +1 -1
- package/dist/plugins/debug/index.d.ts +2 -2
- package/dist/plugins/debug.d.ts +2 -2
- package/dist/plugins/debug.js +2 -2
- package/dist/plugins/debug.js.map +1 -1
- package/dist/plugins/forecasting/index.d.ts +1 -1
- package/dist/plugins/forecasting.js.map +1 -1
- package/dist/plugins/gpu/index.d.ts +2 -2
- package/dist/plugins/gpu.d.ts +2 -2
- package/dist/plugins/gpu.js.map +1 -1
- package/dist/plugins/i18n/index.d.ts +2 -2
- package/dist/plugins/i18n.d.ts +2 -2
- package/dist/plugins/i18n.js.map +1 -1
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/keyboard.d.ts +2 -2
- package/dist/plugins/keyboard.js +65 -5
- package/dist/plugins/keyboard.js.map +1 -1
- package/dist/plugins/latex.js.map +1 -1
- package/dist/plugins/lazy-load.d.ts +2 -2
- package/dist/plugins/loading/index.d.ts +1 -1
- package/dist/plugins/loading.d.ts +2 -2
- package/dist/plugins/ml-integration.d.ts +2 -2
- package/dist/plugins/ml-integration.js +5 -5
- package/dist/plugins/ml-integration.js.map +1 -1
- package/dist/plugins/offscreen.d.ts +2 -2
- package/dist/plugins/pattern-recognition.d.ts +2 -2
- package/dist/plugins/pattern-recognition.js +1 -1
- package/dist/plugins/pattern-recognition.js.map +1 -1
- package/dist/plugins/radar.d.ts +2 -2
- package/dist/plugins/regression.d.ts +2 -2
- package/dist/plugins/regression.js +1 -1
- package/dist/plugins/regression.js.map +1 -1
- package/dist/plugins/roi.js +9 -9
- package/dist/plugins/roi.js.map +1 -1
- package/dist/plugins/snapshot/index.d.ts +1 -1
- package/dist/plugins/snapshot/types.d.ts +1 -1
- package/dist/plugins/snapshot.d.ts +2 -2
- package/dist/plugins/snapshot.js.map +1 -1
- package/dist/plugins/streaming/index.d.ts +2 -2
- package/dist/plugins/streaming.d.ts +2 -2
- package/dist/plugins/sync/index.d.ts +3 -2
- package/dist/plugins/sync.d.ts +2 -2
- package/dist/plugins/sync.js.map +1 -1
- package/dist/plugins/theme-editor/index.d.ts +1 -1
- package/dist/plugins/theme-editor.d.ts +2 -2
- package/dist/plugins/tools/index.d.ts +1 -1
- package/dist/plugins/tools/tooltip/index.d.ts +1 -1
- package/dist/plugins/tools.d.ts +2 -2
- package/dist/plugins/types.d.ts +1 -1
- package/dist/plugins/video-recorder.d.ts +2 -2
- package/dist/plugins/virtualization.d.ts +2 -2
- package/dist/plugins/virtualization.js +1 -1
- package/dist/pool-DZ8shSqv.js +109 -0
- package/dist/pool-DZ8shSqv.js.map +1 -0
- package/dist/react/StackedPlot.d.ts +31 -0
- package/dist/react/VeloPlot.d.ts +29 -0
- package/dist/react/index.d.ts +25 -3
- package/dist/react/useChartSync.d.ts +8 -0
- package/dist/react/useIndicator.d.ts +12 -0
- package/dist/react/useVeloPlot.d.ts +19 -0
- package/dist/react.js +328 -24
- package/dist/react.js.map +1 -1
- package/dist/scientific/index.d.ts +48 -0
- package/dist/scientific.d.ts +1 -0
- package/dist/scientific.js +91 -0
- package/dist/scientific.js.map +1 -0
- package/dist/solid/VeloPlot.d.ts +16 -0
- package/dist/solid/index.d.ts +13 -0
- package/dist/solid/useChartSync.d.ts +6 -0
- package/dist/solid/useIndicator.d.ts +11 -0
- package/dist/solid/useStackedPlot.d.ts +14 -0
- package/dist/solid/useVeloPlot.d.ts +18 -0
- package/dist/solid.d.ts +1 -0
- package/dist/solid.js +172 -0
- package/dist/solid.js.map +1 -0
- package/dist/stackedSync-tnrunZMt.js +100 -0
- package/dist/stackedSync-tnrunZMt.js.map +1 -0
- package/dist/svelte/StackedPlot.svelte +29 -0
- package/dist/svelte/StackedPlot.test.ts +114 -0
- package/dist/svelte/VeloPlot.svelte +44 -0
- package/dist/svelte/VeloPlot.test.ts +105 -0
- package/dist/svelte/index.d.ts +11 -0
- package/dist/svelte/index.test.ts +20 -0
- package/dist/svelte/index.ts +15 -0
- package/dist/svelte/useChartSync.d.ts +8 -0
- package/dist/svelte/useChartSync.test.ts +49 -0
- package/dist/svelte/useChartSync.ts +29 -0
- package/dist/svelte/useIndicator.d.ts +13 -0
- package/dist/svelte/useIndicator.test.ts +67 -0
- package/dist/svelte/useIndicator.ts +43 -0
- package/dist/svelte/useStackedPlot.d.ts +16 -0
- package/dist/svelte/useStackedPlot.test.ts +76 -0
- package/dist/svelte/useStackedPlot.ts +54 -0
- package/dist/svelte/useVeloPlot.d.ts +21 -0
- package/dist/svelte/useVeloPlot.test.ts +100 -0
- package/dist/svelte/useVeloPlot.ts +81 -0
- package/dist/svelte.d.ts +1 -0
- package/dist/svelte.js +143 -0
- package/dist/svelte.js.map +1 -0
- package/dist/testing/index.d.ts +1 -1
- package/dist/theme/index.d.ts +2 -1
- package/dist/trading.js +6 -6
- package/dist/types.d.ts +1 -1
- package/dist/{utils-BK5UUXxj.js → utils-Dx0h0bgQ.js} +9 -9
- package/dist/{utils-BK5UUXxj.js.map → utils-Dx0h0bgQ.js.map} +1 -1
- package/dist/velo-plot.full.js +452 -443
- package/dist/velo-plot.full.js.map +1 -1
- package/dist/velo-plot.js +15 -15
- package/dist/vue/StackedPlot.vue.d.ts +48 -0
- package/dist/vue/VeloPlot.vue.d.ts +64 -0
- package/dist/vue/index.d.ts +250 -0
- package/dist/vue/useChartSync.d.ts +52 -0
- package/dist/vue/useIndicator.d.ts +23 -0
- package/dist/vue/useStackedPlot.d.ts +15 -0
- package/dist/vue/useVeloPlot.d.ts +20 -0
- package/dist/vue.d.ts +1 -0
- package/dist/vue.js +312 -0
- package/dist/vue.js.map +1 -0
- package/dist/workers/indicatorsAsync.d.ts +2 -0
- package/dist/workers/pool.d.ts +9 -0
- package/package.json +88 -10
- package/dist/ChartCore-ivzLqxVb.js.map +0 -1
- package/dist/SciPlot-CEU4ApgD.js +0 -463
- package/dist/SciPlot-CEU4ApgD.js.map +0 -1
- package/dist/createStackedChart-DxNW0VkF.js +0 -705
- package/dist/createStackedChart-DxNW0VkF.js.map +0 -1
- package/dist/index-BBpJwOct.js.map +0 -1
- package/dist/index-DoYxf1cV.js.map +0 -1
- package/dist/index.core-COREBDNq.js.map +0 -1
- package/dist/mockDatafeed-927foCM4.js.map +0 -1
- package/dist/pool-15HMCNv8.js +0 -88
- package/dist/pool-15HMCNv8.js.map +0 -1
- package/dist/react/SciPlot.d.ts +0 -60
- package/dist/react/useSciPlot.d.ts +0 -56
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var m = (i, e, t) =>
|
|
4
|
-
import { g as
|
|
5
|
-
import { G as
|
|
1
|
+
var gt = Object.defineProperty;
|
|
2
|
+
var yt = (i, e, t) => e in i ? gt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var m = (i, e, t) => yt(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { g as je, h as Ze, a as Qe, c as Je, E as mt } from "./axisFormat-CzumxpCL.js";
|
|
5
|
+
import { G as pt } from "./gpuRenderer-BpaMYz-k.js";
|
|
6
6
|
import "./index-x4stH3jD.js";
|
|
7
|
-
import { P as
|
|
7
|
+
import { P as xt } from "./index-qhscKTDy.js";
|
|
8
8
|
import "./symbols-DT0eLlpW.js";
|
|
9
|
-
import { f as
|
|
10
|
-
import { n as
|
|
9
|
+
import { f as bt, m as vt, e as wt, s as Mt, r as St, a as Ct } from "./indicators--eJGmVox.js";
|
|
10
|
+
import { n as At, W as kt } from "./pool-DZ8shSqv.js";
|
|
11
11
|
const ae = { top: 20, right: 30, bottom: 55, left: 75 };
|
|
12
|
-
class
|
|
12
|
+
class Pt {
|
|
13
13
|
constructor(e) {
|
|
14
14
|
m(this, "buffers", /* @__PURE__ */ new Map());
|
|
15
15
|
m(this, "bufferSizes", /* @__PURE__ */ new Map());
|
|
@@ -41,7 +41,7 @@ class Mt {
|
|
|
41
41
|
this.buffers.forEach((e) => this.gl.deleteBuffer(e)), this.buffers.clear(), this.bufferSizes.clear();
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
const
|
|
44
|
+
const Tt = `
|
|
45
45
|
precision highp float;
|
|
46
46
|
attribute vec2 position;
|
|
47
47
|
uniform vec2 uScale;
|
|
@@ -51,14 +51,14 @@ void main() {
|
|
|
51
51
|
vec2 pos = position * uScale + uTranslate;
|
|
52
52
|
gl_Position = vec4(pos, 0.0, 1.0);
|
|
53
53
|
}
|
|
54
|
-
`,
|
|
54
|
+
`, Bt = `
|
|
55
55
|
precision highp float;
|
|
56
56
|
uniform vec4 uColor;
|
|
57
57
|
|
|
58
58
|
void main() {
|
|
59
59
|
gl_FragColor = uColor;
|
|
60
60
|
}
|
|
61
|
-
`,
|
|
61
|
+
`, It = `
|
|
62
62
|
precision highp float;
|
|
63
63
|
attribute vec2 position;
|
|
64
64
|
uniform vec2 uScale;
|
|
@@ -70,7 +70,7 @@ void main() {
|
|
|
70
70
|
gl_Position = vec4(pos, 0.0, 1.0);
|
|
71
71
|
gl_PointSize = uPointSize;
|
|
72
72
|
}
|
|
73
|
-
`,
|
|
73
|
+
`, Et = `
|
|
74
74
|
precision highp float;
|
|
75
75
|
uniform vec4 uColor;
|
|
76
76
|
uniform int uSymbol;
|
|
@@ -151,7 +151,7 @@ void main() {
|
|
|
151
151
|
float alpha = 1.0 - smoothstep(0.0, 0.02, d);
|
|
152
152
|
gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);
|
|
153
153
|
}
|
|
154
|
-
`,
|
|
154
|
+
`, Rt = `
|
|
155
155
|
precision highp float;
|
|
156
156
|
attribute vec2 aPosition;
|
|
157
157
|
attribute float aValue;
|
|
@@ -163,7 +163,7 @@ void main() {
|
|
|
163
163
|
gl_Position = vec4(aPosition * uScale + uTranslate, 0.0, 1.0);
|
|
164
164
|
vValue = aValue;
|
|
165
165
|
}
|
|
166
|
-
`,
|
|
166
|
+
`, Dt = `
|
|
167
167
|
precision highp float;
|
|
168
168
|
varying float vValue;
|
|
169
169
|
uniform float uMinValue;
|
|
@@ -177,7 +177,7 @@ void main() {
|
|
|
177
177
|
gl_FragColor = texture2D(uColormap, vec2(t, 0.5));
|
|
178
178
|
}
|
|
179
179
|
`;
|
|
180
|
-
function
|
|
180
|
+
function ze(i, e, t) {
|
|
181
181
|
const n = i.createShader(t);
|
|
182
182
|
if (!n) throw new Error("Failed to create shader");
|
|
183
183
|
if (i.shaderSource(n, e), i.compileShader(n), !i.getShaderParameter(n, i.COMPILE_STATUS)) {
|
|
@@ -186,8 +186,8 @@ function Le(i, e, t) {
|
|
|
186
186
|
}
|
|
187
187
|
return n;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
190
|
-
const s =
|
|
189
|
+
function Ae(i, e, t, n) {
|
|
190
|
+
const s = ze(i, e, i.VERTEX_SHADER), o = ze(i, t, i.FRAGMENT_SHADER), r = i.createProgram();
|
|
191
191
|
if (!r) throw new Error("Failed to create program");
|
|
192
192
|
if (i.attachShader(r, s), i.attachShader(r, o), i.linkProgram(r), !i.getProgramParameter(r, i.LINK_STATUS)) {
|
|
193
193
|
const a = i.getProgramInfoLog(r);
|
|
@@ -214,11 +214,11 @@ function Ce(i, e, t, n) {
|
|
|
214
214
|
}
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function Ft(i) {
|
|
218
218
|
return {
|
|
219
|
-
lineProgram:
|
|
220
|
-
pointProgram:
|
|
221
|
-
heatmapProgram:
|
|
219
|
+
lineProgram: Ae(i, Tt, Bt, "line"),
|
|
220
|
+
pointProgram: Ae(i, It, Et, "point"),
|
|
221
|
+
heatmapProgram: Ae(i, Rt, Dt, "heatmap")
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
224
|
function _(i) {
|
|
@@ -245,14 +245,14 @@ function _(i) {
|
|
|
245
245
|
}
|
|
246
246
|
return [1, 0, 1, 1];
|
|
247
247
|
}
|
|
248
|
-
function
|
|
249
|
-
const [t, n, s, o] = _(i), [r, a, l] =
|
|
248
|
+
function Lt(i, e = !0) {
|
|
249
|
+
const [t, n, s, o] = _(i), [r, a, l] = zt(t, n, s), h = (r + 0.12) % 1, d = Math.min(1, a + 0.4);
|
|
250
250
|
let c;
|
|
251
251
|
e ? c = l < 0.4 ? 0.8 : Math.min(0.95, l + 0.2) : c = l > 0.6 ? 0.25 : Math.max(0.1, l - 0.2), c = Math.max(0.15, Math.min(0.9, c));
|
|
252
|
-
const [f, u, g] =
|
|
252
|
+
const [f, u, g] = Ot(h, d, c), y = Math.round(f * 255), x = Math.round(u * 255), b = Math.round(g * 255);
|
|
253
253
|
return o < 1 ? `rgba(${y}, ${x}, ${b}, ${o})` : `rgb(${y}, ${x}, ${b})`;
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function zt(i, e, t) {
|
|
256
256
|
const n = Math.max(i, e, t), s = Math.min(i, e, t);
|
|
257
257
|
let o = 0, r = 0, a = (n + s) / 2;
|
|
258
258
|
if (n !== s) {
|
|
@@ -272,7 +272,7 @@ function Rt(i, e, t) {
|
|
|
272
272
|
}
|
|
273
273
|
return [o, r, a];
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function Ot(i, e, t) {
|
|
276
276
|
let n, s, o;
|
|
277
277
|
if (e === 0)
|
|
278
278
|
n = s = o = t;
|
|
@@ -282,16 +282,16 @@ function Ft(i, e, t) {
|
|
|
282
282
|
}
|
|
283
283
|
return [n, s, o];
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function Ke(i, e) {
|
|
286
286
|
const t = Math.min(i.length, e.length), n = new Float32Array(t * 2);
|
|
287
287
|
for (let s = 0; s < t; s++)
|
|
288
288
|
n[s * 2] = i[s], n[s * 2 + 1] = e[s];
|
|
289
289
|
return n;
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function Yt(i, e, t = "after") {
|
|
292
292
|
const n = Math.min(i.length, e.length);
|
|
293
293
|
if (n < 2)
|
|
294
|
-
return
|
|
294
|
+
return Ke(i, e);
|
|
295
295
|
const s = t === "center" ? 1 + (n - 1) * 3 : n * 2 - 1, o = new Float32Array(s * 2);
|
|
296
296
|
let r = 0;
|
|
297
297
|
for (let a = 0; a < n; a++)
|
|
@@ -310,7 +310,7 @@ function Dt(i, e, t = "after") {
|
|
|
310
310
|
}
|
|
311
311
|
return o.subarray(0, r);
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function et(i, e, t) {
|
|
314
314
|
const n = Math.min(i.length, e.length, t.length), s = new Float32Array(n * 2 * 2);
|
|
315
315
|
for (let o = 0; o < n; o++) {
|
|
316
316
|
const r = o * 4, a = i[o];
|
|
@@ -318,7 +318,7 @@ function Je(i, e, t) {
|
|
|
318
318
|
}
|
|
319
319
|
return s;
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function $t(i, e, t, n) {
|
|
322
322
|
const s = i.length;
|
|
323
323
|
let o = 0;
|
|
324
324
|
t && o++, n && o++;
|
|
@@ -337,24 +337,24 @@ function Lt(i, e, t, n) {
|
|
|
337
337
|
}
|
|
338
338
|
return r.subarray(0, a);
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function _t(i, e, t, n, s, o, r) {
|
|
341
341
|
const a = i.length, l = r / 2, h = new Float32Array(a * 20), d = new Float32Array(a * 12);
|
|
342
342
|
let c = 0, f = 0;
|
|
343
343
|
for (let u = 0; u < a; u++) {
|
|
344
|
-
const g = i[u], y = e[u], x = t[u], b = n[u],
|
|
345
|
-
h[c++] = g, h[c++] = y, h[c++] = g, h[c++] = x, h[c++] = g, h[c++] =
|
|
344
|
+
const g = i[u], y = e[u], x = t[u], b = n[u], w = s[u], p = o[u];
|
|
345
|
+
h[c++] = g, h[c++] = y, h[c++] = g, h[c++] = x, h[c++] = g, h[c++] = w, h[c++] = g, h[c++] = p, h[c++] = g - l, h[c++] = b, h[c++] = g + l, h[c++] = b, h[c++] = g - l, h[c++] = x, h[c++] = g + l, h[c++] = x, h[c++] = g - l, h[c++] = w, h[c++] = g + l, h[c++] = w, d[f++] = g - l, d[f++] = x, d[f++] = g + l, d[f++] = x, d[f++] = g + l, d[f++] = w, d[f++] = g - l, d[f++] = x, d[f++] = g + l, d[f++] = w, d[f++] = g - l, d[f++] = w;
|
|
346
346
|
}
|
|
347
347
|
return { lines: h, boxes: d };
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function Vt(i, e, t, n) {
|
|
350
350
|
const s = i.length, o = t / 2, r = new Float32Array(s * 12), a = new Float32Array(s * 12), l = new Float32Array(s * 12), h = new Float32Array((s - 1) * 4);
|
|
351
351
|
let d = 0, c = 0, f = 0, u = 0, g = 0;
|
|
352
352
|
for (let y = 0; y < s; y++) {
|
|
353
|
-
const x = i[y], b = e[y],
|
|
353
|
+
const x = i[y], b = e[y], w = (n == null ? void 0 : n[y]) ?? !1;
|
|
354
354
|
let p, v;
|
|
355
|
-
if (
|
|
356
|
-
const
|
|
357
|
-
h[u++] = x + o, h[u++] = v, h[u++] =
|
|
355
|
+
if (w ? (p = 0, v = g, l[f++] = x - o, l[f++] = p, l[f++] = x + o, l[f++] = p, l[f++] = x + o, l[f++] = v, l[f++] = x - o, l[f++] = p, l[f++] = x + o, l[f++] = v, l[f++] = x - o, l[f++] = v) : (p = g, v = g + b, g = v, b >= 0 ? (r[d++] = x - o, r[d++] = p, r[d++] = x + o, r[d++] = p, r[d++] = x + o, r[d++] = v, r[d++] = x - o, r[d++] = p, r[d++] = x + o, r[d++] = v, r[d++] = x - o, r[d++] = v) : (a[c++] = x - o, a[c++] = v, a[c++] = x + o, a[c++] = v, a[c++] = x + o, a[c++] = p, a[c++] = x - o, a[c++] = v, a[c++] = x + o, a[c++] = p, a[c++] = x - o, a[c++] = p)), y < s - 1) {
|
|
356
|
+
const M = i[y + 1];
|
|
357
|
+
h[u++] = x + o, h[u++] = v, h[u++] = M - o, h[u++] = v;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
return {
|
|
@@ -367,21 +367,21 @@ function Ot(i, e, t, n) {
|
|
|
367
367
|
subtotalCount: f / 2
|
|
368
368
|
};
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function Xt(i, e = !1) {
|
|
371
371
|
const t = i.xMax - i.xMin, n = i.yMax - i.yMin, s = t > 0 ? (e ? -2 : 2) / t : 1, o = n > 0 ? 2 / n : 1, r = e ? 1 - i.xMin * s : -1 - i.xMin * s, a = -1 - i.yMin * o;
|
|
372
372
|
return {
|
|
373
373
|
scale: [s, o],
|
|
374
374
|
translate: [r, a]
|
|
375
375
|
};
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function xe(i, e, t, n, s, o, r = 1) {
|
|
378
378
|
i.useProgram(e.program), i.lineWidth(r), i.bindBuffer(i.ARRAY_BUFFER, t), i.enableVertexAttribArray(e.attributes.position), i.vertexAttribPointer(e.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(e.uniforms.uScale, s.scale[0], s.scale[1]), i.uniform2f(
|
|
379
379
|
e.uniforms.uTranslate,
|
|
380
380
|
s.translate[0],
|
|
381
381
|
s.translate[1]
|
|
382
382
|
), i.uniform4f(e.uniforms.uColor, o[0], o[1], o[2], o[3]), i.drawArrays(i.LINE_STRIP, 0, n), i.disableVertexAttribArray(e.attributes.position);
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function Wt(i, e, t, n, s, o) {
|
|
385
385
|
i.useProgram(e.program), i.bindBuffer(i.ARRAY_BUFFER, t), i.enableVertexAttribArray(e.attributes.position), i.vertexAttribPointer(e.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(e.uniforms.uScale, s.scale[0], s.scale[1]), i.uniform2f(
|
|
386
386
|
e.uniforms.uTranslate,
|
|
387
387
|
s.translate[0],
|
|
@@ -390,7 +390,7 @@ function Yt(i, e, t, n, s, o) {
|
|
|
390
390
|
const r = o[3] * 0.4;
|
|
391
391
|
i.uniform4f(e.uniforms.uColor, o[0], o[1], o[2], r), i.drawArrays(i.TRIANGLE_STRIP, 0, n), i.disableVertexAttribArray(e.attributes.position);
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function ke(i, e, t, n, s, o, r, a = "circle") {
|
|
394
394
|
if (i.useProgram(e.program), i.bindBuffer(i.ARRAY_BUFFER, t), i.enableVertexAttribArray(e.attributes.position), i.vertexAttribPointer(e.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(e.uniforms.uScale, s.scale[0], s.scale[1]), i.uniform2f(
|
|
395
395
|
e.uniforms.uTranslate,
|
|
396
396
|
s.translate[0],
|
|
@@ -410,28 +410,28 @@ function Ae(i, e, t, n, s, o, r, a = "circle") {
|
|
|
410
410
|
}
|
|
411
411
|
i.drawArrays(i.POINTS, 0, n), i.disableVertexAttribArray(e.attributes.position);
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function Nt(i, e, t, n, s, o = { min: 0, max: 1 }, r) {
|
|
414
414
|
i.useProgram(e.program), i.bindBuffer(i.ARRAY_BUFFER, t), i.enableVertexAttribArray(e.attributes.position), i.vertexAttribPointer(e.attributes.position, 2, i.FLOAT, !1, 12, 0), e.attributes.value !== void 0 && e.attributes.value !== -1 && (i.enableVertexAttribArray(e.attributes.value), i.vertexAttribPointer(e.attributes.value, 1, i.FLOAT, !1, 12, 8)), i.uniform2f(e.uniforms.uScale, s.scale[0], s.scale[1]), i.uniform2f(
|
|
415
415
|
e.uniforms.uTranslate,
|
|
416
416
|
s.translate[0],
|
|
417
417
|
s.translate[1]
|
|
418
418
|
), e.uniforms.uMinValue && i.uniform1f(e.uniforms.uMinValue, o.min), e.uniforms.uMaxValue && i.uniform1f(e.uniforms.uMaxValue, o.max), r && e.uniforms.uColormap ? (i.activeTexture(i.TEXTURE0), i.bindTexture(i.TEXTURE_2D, r), i.uniform1i(e.uniforms.uColormap, 0)) : e.uniforms.uColormap && (i.activeTexture(i.TEXTURE0), i.bindTexture(i.TEXTURE_2D, null)), i.drawArrays(i.TRIANGLES, 0, n), i.disableVertexAttribArray(e.attributes.position), e.attributes.value !== void 0 && e.attributes.value !== -1 && i.disableVertexAttribArray(e.attributes.value);
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function Ht(i, e, t, n, s, o) {
|
|
421
421
|
i.useProgram(e.program), i.bindBuffer(i.ARRAY_BUFFER, t), i.enableVertexAttribArray(e.attributes.position), i.vertexAttribPointer(e.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(e.uniforms.uScale, s.scale[0], s.scale[1]), i.uniform2f(
|
|
422
422
|
e.uniforms.uTranslate,
|
|
423
423
|
s.translate[0],
|
|
424
424
|
s.translate[1]
|
|
425
425
|
), i.uniform4f(e.uniforms.uColor, o[0], o[1], o[2], o[3]), i.drawArrays(i.TRIANGLES, 0, n), i.disableVertexAttribArray(e.attributes.position);
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function Ut(i, e, t, n, s, o, r = 1) {
|
|
428
428
|
i.useProgram(e.program), i.lineWidth(r), i.bindBuffer(i.ARRAY_BUFFER, t), i.enableVertexAttribArray(e.attributes.position), i.vertexAttribPointer(e.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(e.uniforms.uScale, s.scale[0], s.scale[1]), i.uniform2f(
|
|
429
429
|
e.uniforms.uTranslate,
|
|
430
430
|
s.translate[0],
|
|
431
431
|
s.translate[1]
|
|
432
432
|
), i.uniform4f(e.uniforms.uColor, o[0], o[1], o[2], o[3]), i.drawArrays(i.LINES, 0, n), i.disableVertexAttribArray(e.attributes.position);
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function qt(i, e, t, n, s) {
|
|
435
435
|
const o = Be(s);
|
|
436
436
|
i.useProgram(e.line.program), i.bindBuffer(i.ARRAY_BUFFER, t.boxBuffer), i.enableVertexAttribArray(e.line.attributes.position), i.vertexAttribPointer(e.line.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(e.line.uniforms.uScale, n.scale[0], n.scale[1]), i.uniform2f(
|
|
437
437
|
e.line.uniforms.uTranslate,
|
|
@@ -445,7 +445,7 @@ function Be(i) {
|
|
|
445
445
|
const e = _(i.color ?? "#ff0055");
|
|
446
446
|
return e[3] = i.opacity ?? 1, e;
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function Gt(i, e, t, n, s, o) {
|
|
449
449
|
const { bounds: r, backgroundColor: a = [0.1, 0.1, 0.18, 1], plotArea: l } = o, h = e.height, d = e.width, c = l ? {
|
|
450
450
|
x: l.x * t,
|
|
451
451
|
y: h - (l.y + l.height) * t,
|
|
@@ -468,15 +468,15 @@ function Nt(i, e, t, n, s, o) {
|
|
|
468
468
|
o.plotAreaBackground[2],
|
|
469
469
|
o.plotAreaBackground[3]
|
|
470
470
|
), i.clear(i.COLOR_BUFFER_BIT));
|
|
471
|
-
const f =
|
|
471
|
+
const f = Xt(r, o.invertX);
|
|
472
472
|
for (const u of s) {
|
|
473
473
|
if (!u.visible || u.count === 0 && u.type !== "boxplot" && u.type !== "waterfall") continue;
|
|
474
|
-
const g = u.yBounds ? u.yBounds.min : r.yMin, x = (u.yBounds ? u.yBounds.max : r.yMax) - g, b = x > 0 ? 2 / x : 1,
|
|
474
|
+
const g = u.yBounds ? u.yBounds.min : r.yMin, x = (u.yBounds ? u.yBounds.max : r.yMax) - g, b = x > 0 ? 2 / x : 1, w = -1 - g * b, p = {
|
|
475
475
|
scale: [f.scale[0], b],
|
|
476
|
-
translate: [f.translate[0],
|
|
476
|
+
translate: [f.translate[0], w]
|
|
477
477
|
}, v = Be(u.style);
|
|
478
478
|
if (u.type === "scatter")
|
|
479
|
-
|
|
479
|
+
ke(
|
|
480
480
|
i,
|
|
481
481
|
n.pointProgram,
|
|
482
482
|
u.buffer,
|
|
@@ -487,7 +487,7 @@ function Nt(i, e, t, n, s, o) {
|
|
|
487
487
|
u.style.symbol
|
|
488
488
|
);
|
|
489
489
|
else if (u.type === "line")
|
|
490
|
-
|
|
490
|
+
xe(
|
|
491
491
|
i,
|
|
492
492
|
n.lineProgram,
|
|
493
493
|
u.buffer,
|
|
@@ -497,7 +497,7 @@ function Nt(i, e, t, n, s, o) {
|
|
|
497
497
|
(u.style.width ?? 1) * t
|
|
498
498
|
);
|
|
499
499
|
else if (u.type === "line+scatter")
|
|
500
|
-
|
|
500
|
+
xe(
|
|
501
501
|
i,
|
|
502
502
|
n.lineProgram,
|
|
503
503
|
u.buffer,
|
|
@@ -505,7 +505,7 @@ function Nt(i, e, t, n, s, o) {
|
|
|
505
505
|
p,
|
|
506
506
|
v,
|
|
507
507
|
(u.style.width ?? 1) * t
|
|
508
|
-
),
|
|
508
|
+
), ke(
|
|
509
509
|
i,
|
|
510
510
|
n.pointProgram,
|
|
511
511
|
u.buffer,
|
|
@@ -516,7 +516,7 @@ function Nt(i, e, t, n, s, o) {
|
|
|
516
516
|
u.style.symbol
|
|
517
517
|
);
|
|
518
518
|
else if (u.type === "step" || u.type === "step+scatter")
|
|
519
|
-
u.stepBuffer && u.stepCount ?
|
|
519
|
+
u.stepBuffer && u.stepCount ? xe(
|
|
520
520
|
i,
|
|
521
521
|
n.lineProgram,
|
|
522
522
|
u.stepBuffer,
|
|
@@ -524,7 +524,7 @@ function Nt(i, e, t, n, s, o) {
|
|
|
524
524
|
p,
|
|
525
525
|
v,
|
|
526
526
|
(u.style.width ?? 1) * t
|
|
527
|
-
) :
|
|
527
|
+
) : xe(
|
|
528
528
|
i,
|
|
529
529
|
n.lineProgram,
|
|
530
530
|
u.buffer,
|
|
@@ -532,7 +532,7 @@ function Nt(i, e, t, n, s, o) {
|
|
|
532
532
|
p,
|
|
533
533
|
v,
|
|
534
534
|
(u.style.width ?? 1) * t
|
|
535
|
-
), u.type === "step+scatter" &&
|
|
535
|
+
), u.type === "step+scatter" && ke(
|
|
536
536
|
i,
|
|
537
537
|
n.pointProgram,
|
|
538
538
|
u.buffer,
|
|
@@ -543,7 +543,7 @@ function Nt(i, e, t, n, s, o) {
|
|
|
543
543
|
u.style.symbol
|
|
544
544
|
);
|
|
545
545
|
else if (u.type === "band")
|
|
546
|
-
|
|
546
|
+
Wt(
|
|
547
547
|
i,
|
|
548
548
|
n.lineProgram,
|
|
549
549
|
u.buffer,
|
|
@@ -552,7 +552,7 @@ function Nt(i, e, t, n, s, o) {
|
|
|
552
552
|
v
|
|
553
553
|
);
|
|
554
554
|
else if (u.type === "heatmap")
|
|
555
|
-
|
|
555
|
+
Nt(
|
|
556
556
|
i,
|
|
557
557
|
n.heatmapProgram,
|
|
558
558
|
u.buffer,
|
|
@@ -562,7 +562,7 @@ function Nt(i, e, t, n, s, o) {
|
|
|
562
562
|
u.colormapTexture
|
|
563
563
|
);
|
|
564
564
|
else if (u.type === "bar")
|
|
565
|
-
|
|
565
|
+
Ht(
|
|
566
566
|
i,
|
|
567
567
|
n.lineProgram,
|
|
568
568
|
u.buffer,
|
|
@@ -571,7 +571,7 @@ function Nt(i, e, t, n, s, o) {
|
|
|
571
571
|
v
|
|
572
572
|
);
|
|
573
573
|
else if (u.type === "boxplot")
|
|
574
|
-
u.boxBuffer && u.boxLinesBuffer &&
|
|
574
|
+
u.boxBuffer && u.boxLinesBuffer && qt(
|
|
575
575
|
i,
|
|
576
576
|
{ line: n.lineProgram, point: n.pointProgram },
|
|
577
577
|
{
|
|
@@ -584,24 +584,24 @@ function Nt(i, e, t, n, s, o) {
|
|
|
584
584
|
u.style
|
|
585
585
|
);
|
|
586
586
|
else if (u.type === "waterfall") {
|
|
587
|
-
const
|
|
588
|
-
u.wfPositiveBuffer && u.wfPositiveCount && u.wfPositiveCount > 0 && (i.useProgram(n.lineProgram.program), i.bindBuffer(i.ARRAY_BUFFER, u.wfPositiveBuffer), i.enableVertexAttribArray(n.lineProgram.attributes.position), i.vertexAttribPointer(n.lineProgram.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(n.lineProgram.uniforms.uScale, p.scale[0], p.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, p.translate[0], p.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor,
|
|
587
|
+
const M = _(u.style.positiveColor || "#22c55e"), S = _(u.style.negativeColor || "#ef4444"), A = _(u.style.subtotalColor || "#3b82f6"), P = _(u.style.connectorColor || "#64748b");
|
|
588
|
+
u.wfPositiveBuffer && u.wfPositiveCount && u.wfPositiveCount > 0 && (i.useProgram(n.lineProgram.program), i.bindBuffer(i.ARRAY_BUFFER, u.wfPositiveBuffer), i.enableVertexAttribArray(n.lineProgram.attributes.position), i.vertexAttribPointer(n.lineProgram.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(n.lineProgram.uniforms.uScale, p.scale[0], p.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, p.translate[0], p.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor, M[0], M[1], M[2], 0.9), i.drawArrays(i.TRIANGLES, 0, u.wfPositiveCount)), u.wfNegativeBuffer && u.wfNegativeCount && u.wfNegativeCount > 0 && (i.useProgram(n.lineProgram.program), i.bindBuffer(i.ARRAY_BUFFER, u.wfNegativeBuffer), i.enableVertexAttribArray(n.lineProgram.attributes.position), i.vertexAttribPointer(n.lineProgram.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(n.lineProgram.uniforms.uScale, p.scale[0], p.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, p.translate[0], p.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor, S[0], S[1], S[2], 0.9), i.drawArrays(i.TRIANGLES, 0, u.wfNegativeCount)), u.wfSubtotalBuffer && u.wfSubtotalCount && u.wfSubtotalCount > 0 && (i.useProgram(n.lineProgram.program), i.bindBuffer(i.ARRAY_BUFFER, u.wfSubtotalBuffer), i.enableVertexAttribArray(n.lineProgram.attributes.position), i.vertexAttribPointer(n.lineProgram.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(n.lineProgram.uniforms.uScale, p.scale[0], p.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, p.translate[0], p.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor, A[0], A[1], A[2], 0.9), i.drawArrays(i.TRIANGLES, 0, u.wfSubtotalCount)), u.style.showConnectors !== !1 && u.wfConnectorBuffer && u.wfConnectorCount && u.wfConnectorCount > 0 && (i.useProgram(n.lineProgram.program), i.bindBuffer(i.ARRAY_BUFFER, u.wfConnectorBuffer), i.enableVertexAttribArray(n.lineProgram.attributes.position), i.vertexAttribPointer(n.lineProgram.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(n.lineProgram.uniforms.uScale, p.scale[0], p.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, p.translate[0], p.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor, P[0], P[1], P[2], 0.6), i.lineWidth(1), i.drawArrays(i.LINES, 0, u.wfConnectorCount)), i.disableVertexAttribArray(n.lineProgram.attributes.position);
|
|
589
589
|
}
|
|
590
590
|
if (u.errorBuffer && u.errorCount) {
|
|
591
|
-
const
|
|
592
|
-
|
|
591
|
+
const M = u.style.errorBars || {}, S = M.color ? Be({ color: M.color, opacity: M.opacity ?? 0.7 }) : v;
|
|
592
|
+
Ut(
|
|
593
593
|
i,
|
|
594
594
|
n.lineProgram,
|
|
595
595
|
u.errorBuffer,
|
|
596
596
|
u.errorCount,
|
|
597
597
|
p,
|
|
598
|
-
|
|
599
|
-
|
|
598
|
+
S,
|
|
599
|
+
M.width ?? 1
|
|
600
600
|
);
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
|
-
class
|
|
604
|
+
class jt {
|
|
605
605
|
constructor(e) {
|
|
606
606
|
m(this, "textures", /* @__PURE__ */ new Map());
|
|
607
607
|
this.gl = e;
|
|
@@ -645,7 +645,7 @@ class Pe {
|
|
|
645
645
|
powerPreference: "high-performance"
|
|
646
646
|
});
|
|
647
647
|
if (!t) throw new Error("WebGL not supported");
|
|
648
|
-
this.gl = t, this.programs =
|
|
648
|
+
this.gl = t, this.programs = Ft(t), this.buffers = new Pt(t), this.textures = new jt(t), t.enable(t.BLEND), t.blendFunc(t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA), this.isInitialized = !0;
|
|
649
649
|
}
|
|
650
650
|
setDPR(e) {
|
|
651
651
|
this.dpr = e;
|
|
@@ -675,7 +675,7 @@ class Pe {
|
|
|
675
675
|
return this.textures.getTexture(e);
|
|
676
676
|
}
|
|
677
677
|
render(e, t) {
|
|
678
|
-
this.isInitialized &&
|
|
678
|
+
this.isInitialized && Gt(this.gl, this.canvas, this.dpr, this.programs, e, t);
|
|
679
679
|
}
|
|
680
680
|
resize() {
|
|
681
681
|
const e = this.canvas.getBoundingClientRect(), t = Math.round(e.width * this.dpr), n = Math.round(e.height * this.dpr);
|
|
@@ -695,8 +695,8 @@ class Pe {
|
|
|
695
695
|
this.buffers.destroy(), this.textures.destroy(), e.deleteProgram(this.programs.lineProgram.program), e.deleteProgram(this.programs.pointProgram.program), e.deleteProgram(this.programs.heatmapProgram.program), this.isInitialized = !1;
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
|
-
const
|
|
699
|
-
class
|
|
698
|
+
const Oe = {};
|
|
699
|
+
class Zt {
|
|
700
700
|
constructor(e, t) {
|
|
701
701
|
m(this, "gpu");
|
|
702
702
|
m(this, "dpr");
|
|
@@ -723,7 +723,7 @@ class Ut {
|
|
|
723
723
|
return this.gpu.updateBuffer(e, t, n);
|
|
724
724
|
}
|
|
725
725
|
getBuffer(e) {
|
|
726
|
-
return this.gpu.hasBuffer(e) ?
|
|
726
|
+
return this.gpu.hasBuffer(e) ? Oe : void 0;
|
|
727
727
|
}
|
|
728
728
|
deleteBuffer(e) {
|
|
729
729
|
this.gpu.deleteBuffer(e);
|
|
@@ -734,7 +734,7 @@ class Ut {
|
|
|
734
734
|
}
|
|
735
735
|
getTexture(e) {
|
|
736
736
|
const t = e.replace(/_colormap$/, "");
|
|
737
|
-
return this.gpu.hasColormap(t) ?
|
|
737
|
+
return this.gpu.hasColormap(t) ? Oe : void 0;
|
|
738
738
|
}
|
|
739
739
|
render(e, t) {
|
|
740
740
|
this.gpu.renderNativeSeries(e, {
|
|
@@ -757,11 +757,11 @@ class Ut {
|
|
|
757
757
|
this.gpu.destroy();
|
|
758
758
|
}
|
|
759
759
|
}
|
|
760
|
-
async function
|
|
761
|
-
const t = new
|
|
762
|
-
return await t.init() ? new
|
|
760
|
+
async function Qt(i, e = {}) {
|
|
761
|
+
const t = new pt(i, e);
|
|
762
|
+
return await t.init() ? new Zt(t, i) : null;
|
|
763
763
|
}
|
|
764
|
-
const
|
|
764
|
+
const De = {
|
|
765
765
|
name: "vibrant",
|
|
766
766
|
isDark: !0,
|
|
767
767
|
colors: [
|
|
@@ -808,7 +808,7 @@ const Ee = {
|
|
|
808
808
|
],
|
|
809
809
|
highlightColor: "#FFFFFF"
|
|
810
810
|
// Pure White
|
|
811
|
-
},
|
|
811
|
+
}, tt = {
|
|
812
812
|
name: "pastel",
|
|
813
813
|
isDark: !1,
|
|
814
814
|
colors: [
|
|
@@ -855,7 +855,7 @@ const Ee = {
|
|
|
855
855
|
],
|
|
856
856
|
highlightColor: "#1A1A1A"
|
|
857
857
|
// Near Black
|
|
858
|
-
},
|
|
858
|
+
}, Jt = {
|
|
859
859
|
name: "neon",
|
|
860
860
|
isDark: !0,
|
|
861
861
|
colors: [
|
|
@@ -902,7 +902,7 @@ const Ee = {
|
|
|
902
902
|
],
|
|
903
903
|
highlightColor: "#FFFFFF"
|
|
904
904
|
// Pure White
|
|
905
|
-
},
|
|
905
|
+
}, Kt = {
|
|
906
906
|
name: "earth",
|
|
907
907
|
isDark: !1,
|
|
908
908
|
colors: [
|
|
@@ -949,7 +949,7 @@ const Ee = {
|
|
|
949
949
|
],
|
|
950
950
|
highlightColor: "#000000"
|
|
951
951
|
// Pure Black
|
|
952
|
-
},
|
|
952
|
+
}, ei = {
|
|
953
953
|
name: "ocean",
|
|
954
954
|
isDark: !0,
|
|
955
955
|
colors: [
|
|
@@ -996,21 +996,21 @@ const Ee = {
|
|
|
996
996
|
],
|
|
997
997
|
highlightColor: "#FFD700"
|
|
998
998
|
// Gold
|
|
999
|
-
},
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
999
|
+
}, ti = [
|
|
1000
|
+
De,
|
|
1001
|
+
tt,
|
|
1002
|
+
Jt,
|
|
1003
|
+
Kt,
|
|
1004
|
+
ei
|
|
1005
1005
|
];
|
|
1006
|
-
function
|
|
1007
|
-
const e =
|
|
1008
|
-
return e || (console.warn(`[ColorScheme] Unknown scheme "${i}", using vibrant`),
|
|
1006
|
+
function Ye(i) {
|
|
1007
|
+
const e = ti.find((t) => t.name === i);
|
|
1008
|
+
return e || (console.warn(`[ColorScheme] Unknown scheme "${i}", using vibrant`), De);
|
|
1009
1009
|
}
|
|
1010
1010
|
function $e(i) {
|
|
1011
|
-
return i ?
|
|
1011
|
+
return i ? De : tt;
|
|
1012
1012
|
}
|
|
1013
|
-
const
|
|
1013
|
+
const V = {
|
|
1014
1014
|
lineColor: "#666666",
|
|
1015
1015
|
// Brighter
|
|
1016
1016
|
lineWidth: 1,
|
|
@@ -1026,19 +1026,19 @@ const H = {
|
|
|
1026
1026
|
titleSize: 14,
|
|
1027
1027
|
// Larger
|
|
1028
1028
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
1029
|
-
},
|
|
1029
|
+
}, ue = {
|
|
1030
1030
|
visible: !0,
|
|
1031
1031
|
majorColor: "rgba(255, 255, 255, 0.12)",
|
|
1032
1032
|
// Higher opacity
|
|
1033
1033
|
minorColor: "rgba(255, 255, 255, 0.05)",
|
|
1034
1034
|
majorWidth: 1,
|
|
1035
1035
|
minorWidth: 0.5,
|
|
1036
|
-
|
|
1036
|
+
// Solid majors — dashed + minor divisions read as a “grid inside the grid”.
|
|
1037
|
+
majorDash: [],
|
|
1037
1038
|
minorDash: [2, 4],
|
|
1038
|
-
showMinor: !
|
|
1039
|
-
// Default to show minor
|
|
1039
|
+
showMinor: !1,
|
|
1040
1040
|
minorDivisions: 5
|
|
1041
|
-
},
|
|
1041
|
+
}, de = {
|
|
1042
1042
|
visible: !0,
|
|
1043
1043
|
position: "top-right",
|
|
1044
1044
|
backgroundColor: "rgba(15, 23, 42, 0.2)",
|
|
@@ -1050,11 +1050,11 @@ const H = {
|
|
|
1050
1050
|
padding: 5,
|
|
1051
1051
|
itemGap: 3,
|
|
1052
1052
|
swatchSize: 12
|
|
1053
|
-
},
|
|
1053
|
+
}, we = {
|
|
1054
1054
|
backgroundColor: "rgba(15, 23, 42, 0.2)",
|
|
1055
1055
|
borderColor: "rgba(255, 255, 255, 0.08)",
|
|
1056
1056
|
borderRadius: 8
|
|
1057
|
-
},
|
|
1057
|
+
}, fe = {
|
|
1058
1058
|
lineColor: "rgba(255, 255, 255, 0.5)",
|
|
1059
1059
|
lineWidth: 1,
|
|
1060
1060
|
lineDash: [5, 5],
|
|
@@ -1062,100 +1062,106 @@ const H = {
|
|
|
1062
1062
|
tooltipBorder: "rgba(255, 255, 255, 0.2)",
|
|
1063
1063
|
tooltipColor: "#ffffff",
|
|
1064
1064
|
tooltipSize: 11
|
|
1065
|
-
},
|
|
1065
|
+
}, Ie = {
|
|
1066
1066
|
name: "dark",
|
|
1067
1067
|
isDark: !0,
|
|
1068
1068
|
backgroundColor: "#0b0e14",
|
|
1069
1069
|
plotAreaBackground: "#0b0e14",
|
|
1070
1070
|
plotBorderColor: "#444c56",
|
|
1071
1071
|
grid: {
|
|
1072
|
-
...
|
|
1072
|
+
...ue,
|
|
1073
1073
|
majorColor: "rgba(255, 255, 255, 0.12)",
|
|
1074
|
-
minorColor: "rgba(255, 255, 255, 0.04)"
|
|
1074
|
+
minorColor: "rgba(255, 255, 255, 0.04)",
|
|
1075
|
+
showMinor: !1,
|
|
1076
|
+
majorDash: []
|
|
1075
1077
|
},
|
|
1076
1078
|
xAxis: {
|
|
1077
|
-
...
|
|
1079
|
+
...V,
|
|
1078
1080
|
labelColor: "#adbac7",
|
|
1079
1081
|
titleColor: "#cdd9e5",
|
|
1080
1082
|
lineColor: "#444c56",
|
|
1081
1083
|
tickColor: "#444c56"
|
|
1082
1084
|
},
|
|
1083
1085
|
yAxis: {
|
|
1084
|
-
...
|
|
1086
|
+
...V,
|
|
1085
1087
|
labelColor: "#adbac7",
|
|
1086
1088
|
titleColor: "#cdd9e5",
|
|
1087
1089
|
lineColor: "#444c56",
|
|
1088
1090
|
tickColor: "#444c56"
|
|
1089
1091
|
},
|
|
1090
|
-
legend:
|
|
1091
|
-
cursor:
|
|
1092
|
-
toolbar:
|
|
1093
|
-
},
|
|
1092
|
+
legend: de,
|
|
1093
|
+
cursor: fe,
|
|
1094
|
+
toolbar: we
|
|
1095
|
+
}, ii = {
|
|
1094
1096
|
name: "midnight",
|
|
1095
1097
|
isDark: !0,
|
|
1096
1098
|
backgroundColor: "#05050a",
|
|
1097
1099
|
plotAreaBackground: "#070715",
|
|
1098
1100
|
plotBorderColor: "#3a3a5a",
|
|
1099
1101
|
grid: {
|
|
1100
|
-
...
|
|
1102
|
+
...ue,
|
|
1101
1103
|
majorColor: "rgba(150, 150, 255, 0.2)",
|
|
1102
|
-
minorColor: "rgba(150, 150, 255, 0.08)"
|
|
1104
|
+
minorColor: "rgba(150, 150, 255, 0.08)",
|
|
1105
|
+
showMinor: !1,
|
|
1106
|
+
majorDash: []
|
|
1103
1107
|
},
|
|
1104
1108
|
xAxis: {
|
|
1105
|
-
...
|
|
1109
|
+
...V,
|
|
1106
1110
|
lineColor: "#5a5a8a",
|
|
1107
1111
|
labelColor: "#b0b0e0",
|
|
1108
1112
|
titleColor: "#d0d0f0",
|
|
1109
1113
|
tickColor: "#5a5a8a"
|
|
1110
1114
|
},
|
|
1111
1115
|
yAxis: {
|
|
1112
|
-
...
|
|
1116
|
+
...V,
|
|
1113
1117
|
lineColor: "#5a5a8a",
|
|
1114
1118
|
labelColor: "#b0b0e0",
|
|
1115
1119
|
titleColor: "#d0d0f0",
|
|
1116
1120
|
tickColor: "#5a5a8a"
|
|
1117
1121
|
},
|
|
1118
1122
|
legend: {
|
|
1119
|
-
...
|
|
1123
|
+
...de,
|
|
1120
1124
|
backgroundColor: "rgba(5, 5, 15, 0.2)",
|
|
1121
1125
|
borderColor: "rgba(100, 100, 255, 0.4)"
|
|
1122
1126
|
},
|
|
1123
1127
|
toolbar: {
|
|
1124
|
-
...
|
|
1128
|
+
...we,
|
|
1125
1129
|
backgroundColor: "rgba(5, 5, 15, 0.2)",
|
|
1126
1130
|
borderColor: "rgba(100, 100, 255, 0.2)"
|
|
1127
1131
|
},
|
|
1128
1132
|
cursor: {
|
|
1129
|
-
...
|
|
1133
|
+
...fe,
|
|
1130
1134
|
lineColor: "rgba(150, 150, 255, 0.7)"
|
|
1131
1135
|
}
|
|
1132
|
-
},
|
|
1136
|
+
}, ni = {
|
|
1133
1137
|
name: "light",
|
|
1134
1138
|
isDark: !1,
|
|
1135
1139
|
backgroundColor: "#ffffff",
|
|
1136
1140
|
plotAreaBackground: "#ffffff",
|
|
1137
1141
|
plotBorderColor: "#cccccc",
|
|
1138
1142
|
grid: {
|
|
1139
|
-
...
|
|
1143
|
+
...ue,
|
|
1140
1144
|
majorColor: "rgba(0, 0, 0, 0.1)",
|
|
1141
|
-
minorColor: "rgba(0, 0, 0, 0.04)"
|
|
1145
|
+
minorColor: "rgba(0, 0, 0, 0.04)",
|
|
1146
|
+
showMinor: !1,
|
|
1147
|
+
majorDash: []
|
|
1142
1148
|
},
|
|
1143
1149
|
xAxis: {
|
|
1144
|
-
...
|
|
1150
|
+
...V,
|
|
1145
1151
|
lineColor: "#888888",
|
|
1146
1152
|
tickColor: "#888888",
|
|
1147
1153
|
labelColor: "#444444",
|
|
1148
1154
|
titleColor: "#222222"
|
|
1149
1155
|
},
|
|
1150
1156
|
yAxis: {
|
|
1151
|
-
...
|
|
1157
|
+
...V,
|
|
1152
1158
|
lineColor: "#888888",
|
|
1153
1159
|
tickColor: "#888888",
|
|
1154
1160
|
labelColor: "#444444",
|
|
1155
1161
|
titleColor: "#222222"
|
|
1156
1162
|
},
|
|
1157
1163
|
legend: {
|
|
1158
|
-
...
|
|
1164
|
+
...de,
|
|
1159
1165
|
backgroundColor: "rgba(255, 255, 255, 0.2)",
|
|
1160
1166
|
borderColor: "rgba(0, 0, 0, 0.15)",
|
|
1161
1167
|
textColor: "#222222"
|
|
@@ -1166,53 +1172,97 @@ const H = {
|
|
|
1166
1172
|
borderRadius: 8
|
|
1167
1173
|
},
|
|
1168
1174
|
cursor: {
|
|
1169
|
-
...
|
|
1175
|
+
...fe,
|
|
1170
1176
|
lineColor: "rgba(0, 0, 0, 0.4)",
|
|
1171
1177
|
tooltipBackground: "rgba(50, 50, 60, 0.95)"
|
|
1172
1178
|
}
|
|
1173
|
-
},
|
|
1179
|
+
}, si = {
|
|
1180
|
+
name: "high-contrast",
|
|
1181
|
+
isDark: !0,
|
|
1182
|
+
backgroundColor: "#000000",
|
|
1183
|
+
plotAreaBackground: "#0a0a0a",
|
|
1184
|
+
plotBorderColor: "#ffffff",
|
|
1185
|
+
grid: {
|
|
1186
|
+
...ue,
|
|
1187
|
+
majorColor: "rgba(255, 255, 255, 0.35)",
|
|
1188
|
+
minorColor: "rgba(255, 255, 255, 0.15)",
|
|
1189
|
+
showMinor: !1,
|
|
1190
|
+
majorDash: []
|
|
1191
|
+
},
|
|
1192
|
+
xAxis: {
|
|
1193
|
+
...V,
|
|
1194
|
+
lineColor: "#ffffff",
|
|
1195
|
+
tickColor: "#ffffff",
|
|
1196
|
+
labelColor: "#ffffff",
|
|
1197
|
+
titleColor: "#ffffff"
|
|
1198
|
+
},
|
|
1199
|
+
yAxis: {
|
|
1200
|
+
...V,
|
|
1201
|
+
lineColor: "#ffffff",
|
|
1202
|
+
tickColor: "#ffffff",
|
|
1203
|
+
labelColor: "#ffffff",
|
|
1204
|
+
titleColor: "#ffffff"
|
|
1205
|
+
},
|
|
1206
|
+
legend: {
|
|
1207
|
+
...de,
|
|
1208
|
+
backgroundColor: "#000000",
|
|
1209
|
+
borderColor: "#ffffff",
|
|
1210
|
+
textColor: "#ffffff"
|
|
1211
|
+
},
|
|
1212
|
+
toolbar: {
|
|
1213
|
+
...we,
|
|
1214
|
+
backgroundColor: "#000000",
|
|
1215
|
+
borderColor: "#ffffff"
|
|
1216
|
+
},
|
|
1217
|
+
cursor: {
|
|
1218
|
+
...fe,
|
|
1219
|
+
lineColor: "#ffff00",
|
|
1220
|
+
tooltipBackground: "#ffff00",
|
|
1221
|
+
tooltipColor: "#000000"
|
|
1222
|
+
}
|
|
1223
|
+
}, oi = {
|
|
1174
1224
|
name: "electrochemistry",
|
|
1175
1225
|
isDark: !0,
|
|
1176
1226
|
backgroundColor: "#0a1628",
|
|
1177
1227
|
plotAreaBackground: "#0d1b2e",
|
|
1178
1228
|
plotBorderColor: "#1e3a5f",
|
|
1179
1229
|
grid: {
|
|
1180
|
-
...
|
|
1230
|
+
...ue,
|
|
1181
1231
|
majorColor: "rgba(30, 136, 229, 0.15)",
|
|
1182
1232
|
minorColor: "rgba(30, 136, 229, 0.06)",
|
|
1183
1233
|
showMinor: !0,
|
|
1184
1234
|
minorDivisions: 2
|
|
1185
1235
|
},
|
|
1186
1236
|
xAxis: {
|
|
1187
|
-
...
|
|
1237
|
+
...V,
|
|
1188
1238
|
lineColor: "#1e88e5",
|
|
1189
1239
|
tickColor: "#42a5f5",
|
|
1190
1240
|
labelColor: "#90caf9",
|
|
1191
1241
|
titleColor: "#bbdefb"
|
|
1192
1242
|
},
|
|
1193
1243
|
yAxis: {
|
|
1194
|
-
...
|
|
1244
|
+
...V,
|
|
1195
1245
|
lineColor: "#1e88e5",
|
|
1196
1246
|
tickColor: "#42a5f5",
|
|
1197
1247
|
labelColor: "#90caf9",
|
|
1198
1248
|
titleColor: "#bbdefb"
|
|
1199
1249
|
},
|
|
1200
1250
|
legend: {
|
|
1201
|
-
...
|
|
1251
|
+
...de,
|
|
1202
1252
|
backgroundColor: "rgba(10, 22, 40, 0.2)",
|
|
1203
1253
|
borderColor: "rgba(30, 136, 229, 0.3)"
|
|
1204
1254
|
},
|
|
1205
1255
|
toolbar: {
|
|
1206
|
-
...
|
|
1256
|
+
...we,
|
|
1207
1257
|
backgroundColor: "rgba(10, 22, 40, 0.2)",
|
|
1208
1258
|
borderColor: "rgba(30, 136, 229, 0.15)"
|
|
1209
1259
|
},
|
|
1210
1260
|
cursor: {
|
|
1211
|
-
...
|
|
1261
|
+
...fe,
|
|
1212
1262
|
lineColor: "rgba(100, 180, 255, 0.6)"
|
|
1213
1263
|
}
|
|
1214
1264
|
};
|
|
1215
|
-
function
|
|
1265
|
+
function cs(i, e) {
|
|
1216
1266
|
return {
|
|
1217
1267
|
...i,
|
|
1218
1268
|
...e,
|
|
@@ -1224,29 +1274,32 @@ function os(i, e) {
|
|
|
1224
1274
|
toolbar: { ...i.toolbar, ...e.toolbar }
|
|
1225
1275
|
};
|
|
1226
1276
|
}
|
|
1227
|
-
function
|
|
1277
|
+
function it(i) {
|
|
1228
1278
|
switch (i) {
|
|
1229
1279
|
case "dark":
|
|
1230
|
-
return
|
|
1280
|
+
return Ie;
|
|
1231
1281
|
case "midnight":
|
|
1232
|
-
return
|
|
1282
|
+
return ii;
|
|
1233
1283
|
case "light":
|
|
1234
|
-
return
|
|
1284
|
+
return ni;
|
|
1235
1285
|
case "electrochemistry":
|
|
1236
1286
|
case "electrochem":
|
|
1237
|
-
return
|
|
1287
|
+
return oi;
|
|
1288
|
+
case "high-contrast":
|
|
1289
|
+
case "highContrast":
|
|
1290
|
+
return si;
|
|
1238
1291
|
default:
|
|
1239
|
-
return console.warn(`[Theme] Unknown theme "${i}", using dark`),
|
|
1292
|
+
return console.warn(`[Theme] Unknown theme "${i}", using dark`), Ie;
|
|
1240
1293
|
}
|
|
1241
1294
|
}
|
|
1242
|
-
const
|
|
1243
|
-
function
|
|
1295
|
+
const ri = Ie;
|
|
1296
|
+
function $(i) {
|
|
1244
1297
|
return Math.floor(i) + 0.5;
|
|
1245
1298
|
}
|
|
1246
1299
|
function he(i) {
|
|
1247
1300
|
return Math.round(i);
|
|
1248
1301
|
}
|
|
1249
|
-
class
|
|
1302
|
+
class ai {
|
|
1250
1303
|
constructor(e, t) {
|
|
1251
1304
|
m(this, "ctx");
|
|
1252
1305
|
m(this, "theme");
|
|
@@ -1274,6 +1327,13 @@ class ii {
|
|
|
1274
1327
|
const n = e.ticks(t);
|
|
1275
1328
|
return this.filterBusinessDayXTicks(n);
|
|
1276
1329
|
}
|
|
1330
|
+
/**
|
|
1331
|
+
* Grid X lines use the full viewport domain (nice even spacing), including
|
|
1332
|
+
* regions past the loaded series. Axis labels stay filtered to real data.
|
|
1333
|
+
*/
|
|
1334
|
+
resolveGridXTicks(e, t) {
|
|
1335
|
+
return e.ticks(t);
|
|
1336
|
+
}
|
|
1277
1337
|
/**
|
|
1278
1338
|
* Set LaTeX API for rendering mathematical expressions
|
|
1279
1339
|
*/
|
|
@@ -1322,21 +1382,21 @@ class ii {
|
|
|
1322
1382
|
*/
|
|
1323
1383
|
drawGrid(e, t, n, s, o) {
|
|
1324
1384
|
if (!this.theme.grid.visible) return;
|
|
1325
|
-
const { ctx: r } = this, a = this.theme.grid, l = (s == null ? void 0 : s.tickCount) ?? 8, h = (o == null ? void 0 : o.tickCount) ?? 6, d = this.
|
|
1385
|
+
const { ctx: r } = this, a = this.theme.grid, l = (s == null ? void 0 : s.tickCount) ?? 8, h = (o == null ? void 0 : o.tickCount) ?? 6, d = this.resolveGridXTicks(t, l), c = n.ticks(h);
|
|
1326
1386
|
if (r.strokeStyle = a.majorColor, r.lineWidth = a.majorWidth, r.setLineDash(a.majorDash), r.beginPath(), d.forEach((f) => {
|
|
1327
|
-
const u =
|
|
1387
|
+
const u = $(t.transform(f));
|
|
1328
1388
|
u >= e.x && u <= e.x + e.width && (r.moveTo(u, e.y), r.lineTo(u, e.y + e.height));
|
|
1329
1389
|
}), r.stroke(), r.beginPath(), c.forEach((f) => {
|
|
1330
|
-
const u =
|
|
1390
|
+
const u = $(n.transform(f));
|
|
1331
1391
|
u >= e.y && u <= e.y + e.height && (r.moveTo(e.x, u), r.lineTo(e.x + e.width, u));
|
|
1332
1392
|
}), r.stroke(), a.showMinor) {
|
|
1333
1393
|
r.strokeStyle = a.minorColor, r.lineWidth = a.minorWidth, r.setLineDash(a.minorDash);
|
|
1334
1394
|
const f = this.generateMinorTicks(d, a.minorDivisions), u = this.generateMinorTicks(c, a.minorDivisions);
|
|
1335
1395
|
r.beginPath(), f.forEach((g) => {
|
|
1336
|
-
const y =
|
|
1396
|
+
const y = $(t.transform(g));
|
|
1337
1397
|
y >= e.x && y <= e.x + e.width && (r.moveTo(y, e.y), r.lineTo(y, e.y + e.height));
|
|
1338
1398
|
}), r.stroke(), r.beginPath(), u.forEach((g) => {
|
|
1339
|
-
const y =
|
|
1399
|
+
const y = $(n.transform(g));
|
|
1340
1400
|
y >= e.y && y <= e.y + e.height && (r.moveTo(e.x, y), r.lineTo(e.x + e.width, y));
|
|
1341
1401
|
}), r.stroke();
|
|
1342
1402
|
}
|
|
@@ -1378,28 +1438,28 @@ class ii {
|
|
|
1378
1438
|
* Draw X axis with ticks and labels
|
|
1379
1439
|
*/
|
|
1380
1440
|
drawXAxis(e, t, n, s) {
|
|
1381
|
-
const { ctx: o } = this, r = this.theme.xAxis, a = (n == null ? void 0 : n.tickCount) ?? 8, l = this.resolveXTicks(t, a), h =
|
|
1441
|
+
const { ctx: o } = this, r = this.theme.xAxis, a = (n == null ? void 0 : n.tickCount) ?? 8, l = this.resolveXTicks(t, a), h = $(e.y + e.height), d = n == null ? void 0 : n.label, c = (n == null ? void 0 : n.showLine) !== !1, f = (n == null ? void 0 : n.showTicks) !== !1, u = (n == null ? void 0 : n.showLabels) !== !1, g = t.domain[1] - t.domain[0];
|
|
1382
1442
|
if (c && (o.strokeStyle = r.lineColor, o.lineWidth = r.lineWidth, o.beginPath(), o.moveTo(e.x, h), o.lineTo(e.x + e.width, h), o.stroke()), f || u) {
|
|
1383
1443
|
o.fillStyle = r.labelColor, o.font = `${r.labelSize}px ${r.fontFamily}`;
|
|
1384
1444
|
const y = [];
|
|
1385
1445
|
for (const p of l) {
|
|
1386
1446
|
const v = he(t.transform(p));
|
|
1387
1447
|
if (v >= e.x && v <= e.x + e.width) {
|
|
1388
|
-
const
|
|
1389
|
-
(!u ||
|
|
1448
|
+
const M = u ? this.formatXTick(p, n, g) : "";
|
|
1449
|
+
(!u || M) && y.push({ tick: p, x: v, label: M });
|
|
1390
1450
|
}
|
|
1391
1451
|
}
|
|
1392
1452
|
let x = !1;
|
|
1393
1453
|
if (u && y.length > 1) {
|
|
1394
1454
|
let p = 0;
|
|
1395
|
-
for (const
|
|
1396
|
-
p = Math.max(p, o.measureText(
|
|
1455
|
+
for (const M of y)
|
|
1456
|
+
p = Math.max(p, o.measureText(M.label).width);
|
|
1397
1457
|
let v = 1 / 0;
|
|
1398
|
-
for (let
|
|
1399
|
-
v = Math.min(v, y[
|
|
1458
|
+
for (let M = 1; M < y.length; M++)
|
|
1459
|
+
v = Math.min(v, y[M].x - y[M - 1].x);
|
|
1400
1460
|
x = p + 8 > v;
|
|
1401
1461
|
}
|
|
1402
|
-
const b = h + r.tickLength + (x ? 6 : 3),
|
|
1462
|
+
const b = h + r.tickLength + (x ? 6 : 3), w = x ? -Math.PI / 4 : void 0;
|
|
1403
1463
|
for (const p of y)
|
|
1404
1464
|
f && (o.strokeStyle = r.tickColor, o.beginPath(), o.moveTo(p.x, h), o.lineTo(p.x, h + r.tickLength), o.stroke()), u && p.label && this.drawLatexOrText(
|
|
1405
1465
|
p.label,
|
|
@@ -1411,7 +1471,7 @@ class ii {
|
|
|
1411
1471
|
color: r.labelColor,
|
|
1412
1472
|
align: x ? "right" : "center",
|
|
1413
1473
|
baseline: x ? "middle" : "top",
|
|
1414
|
-
rotation:
|
|
1474
|
+
rotation: w
|
|
1415
1475
|
}
|
|
1416
1476
|
);
|
|
1417
1477
|
}
|
|
@@ -1430,12 +1490,12 @@ class ii {
|
|
|
1430
1490
|
* Draw Y axis with ticks and labels
|
|
1431
1491
|
*/
|
|
1432
1492
|
drawYAxis(e, t, n, s = "left", o = 0, r) {
|
|
1433
|
-
const { ctx: a } = this, l = this.theme.yAxis, h = (n == null ? void 0 : n.tickCount) ?? 6, d = t.ticks(h), c = n == null ? void 0 : n.label, f = (n == null ? void 0 : n.showLine) !== !1, u = (n == null ? void 0 : n.showTicks) !== !1, g = (n == null ? void 0 : n.showLabels) !== !1, y =
|
|
1493
|
+
const { ctx: a } = this, l = this.theme.yAxis, h = (n == null ? void 0 : n.tickCount) ?? 6, d = t.ticks(h), c = n == null ? void 0 : n.label, f = (n == null ? void 0 : n.showLine) !== !1, u = (n == null ? void 0 : n.showTicks) !== !1, g = (n == null ? void 0 : n.showLabels) !== !1, y = $(s === "left" ? e.x - o : e.x + e.width + o), x = s === "left" ? -1 : 1;
|
|
1434
1494
|
if (f && (a.strokeStyle = l.lineColor, a.lineWidth = l.lineWidth, a.beginPath(), a.moveTo(y, e.y), a.lineTo(y, e.y + e.height), a.stroke()), (u || g) && (a.fillStyle = l.labelColor, a.font = `${l.labelSize}px ${l.fontFamily}`, a.textAlign = s === "left" ? "right" : "left", a.textBaseline = "middle", d.forEach((b) => {
|
|
1435
|
-
const
|
|
1436
|
-
if (
|
|
1495
|
+
const w = he(t.transform(b));
|
|
1496
|
+
if (w >= e.y && w <= e.y + e.height && (u && (a.strokeStyle = l.tickColor, a.beginPath(), a.moveTo(y, w), a.lineTo(y + l.tickLength * x, w), a.stroke()), g)) {
|
|
1437
1497
|
const p = y + (l.tickLength + 3) * x;
|
|
1438
|
-
this.drawLatexOrText(this.formatYTick(b, n), p,
|
|
1498
|
+
this.drawLatexOrText(this.formatYTick(b, n), p, w, {
|
|
1439
1499
|
fontSize: l.labelSize,
|
|
1440
1500
|
fontFamily: l.fontFamily,
|
|
1441
1501
|
color: l.labelColor,
|
|
@@ -1444,8 +1504,8 @@ class ii {
|
|
|
1444
1504
|
});
|
|
1445
1505
|
}
|
|
1446
1506
|
})), c) {
|
|
1447
|
-
const b = (r == null ? void 0 : r.titleGap) ?? 50,
|
|
1448
|
-
this.drawLatexOrText(c,
|
|
1507
|
+
const b = (r == null ? void 0 : r.titleGap) ?? 50, w = s === "left" ? y - b : y + b, p = e.y + e.height / 2;
|
|
1508
|
+
this.drawLatexOrText(c, w, p, {
|
|
1449
1509
|
fontSize: l.titleSize,
|
|
1450
1510
|
fontFamily: l.fontFamily,
|
|
1451
1511
|
color: l.titleColor,
|
|
@@ -1523,8 +1583,8 @@ class ii {
|
|
|
1523
1583
|
n.moveTo(h + c, d), n.lineTo(h + a - c, d), n.arcTo(h + a, d, h + a, d + c, c), n.lineTo(h + a, d + l - c), n.arcTo(h + a, d + l, h + a - c, d + l, c), n.lineTo(h + c, d + l), n.arcTo(h, d + l, h, d + l - c, c), n.lineTo(h, d + c), n.arcTo(h, d, h + c, d, c), n.closePath(), n.fill(), n.stroke(), n.textAlign = "left", n.textBaseline = "middle", r.forEach((f, u) => {
|
|
1524
1584
|
const g = d + s.padding + u * (s.swatchSize + s.itemGap), y = h + s.padding, x = g + s.swatchSize / 2, b = y + s.swatchSize / 2;
|
|
1525
1585
|
n.save(), n.globalAlpha = f.opacity, n.fillStyle = f.color, n.strokeStyle = f.color, n.lineWidth = 2;
|
|
1526
|
-
const
|
|
1527
|
-
|
|
1586
|
+
const w = s.swatchSize, p = String(f.type).toLowerCase(), v = !!f.symbol && f.symbol !== "circle", M = p === "scatter" || p === "1" || p === "line" && v, S = p.includes("scatter") || p === "2";
|
|
1587
|
+
M ? this.drawLegendSymbol(n, f.symbol ?? "circle", b, x, w * 0.9) : S ? (n.beginPath(), n.moveTo(y, x), n.lineTo(y + w, x), n.stroke(), this.drawLegendSymbol(n, f.symbol ?? "circle", b, x, w * 0.6)) : (n.beginPath(), n.moveTo(y, x), n.lineTo(y + w, x), n.stroke()), n.restore(), this.drawLatexOrText(f.label, h + s.padding + s.swatchSize + 8, x, {
|
|
1528
1588
|
fontSize: s.fontSize,
|
|
1529
1589
|
fontFamily: s.fontFamily,
|
|
1530
1590
|
color: s.textColor,
|
|
@@ -1600,10 +1660,10 @@ class ii {
|
|
|
1600
1660
|
let f = 0;
|
|
1601
1661
|
a.forEach((p) => {
|
|
1602
1662
|
if (!!this.latexAPI && (p.includes("\\") || p.includes("^") || p.includes("_") || p.includes("{") && p.includes("}"))) {
|
|
1603
|
-
const
|
|
1604
|
-
d = Math.max(d,
|
|
1605
|
-
const
|
|
1606
|
-
c.push(
|
|
1663
|
+
const M = this.latexAPI.measure(p, { fontSize: r.tooltipSize });
|
|
1664
|
+
d = Math.max(d, M.width);
|
|
1665
|
+
const S = Math.max(l, M.height);
|
|
1666
|
+
c.push(S), f += S;
|
|
1607
1667
|
} else
|
|
1608
1668
|
d = Math.max(d, o.measureText(p).width), c.push(l), f += l;
|
|
1609
1669
|
});
|
|
@@ -1612,15 +1672,15 @@ class ii {
|
|
|
1612
1672
|
y + u > s.x + s.width && (y = e - u - 15), x < s.y && (x = t + 15), o.fillStyle = r.tooltipBackground, o.strokeStyle = r.tooltipBorder, o.lineWidth = 1, o.beginPath();
|
|
1613
1673
|
const b = 4;
|
|
1614
1674
|
o.moveTo(y + b, x), o.lineTo(y + u - b, x), o.arcTo(y + u, x, y + u, x + b, b), o.lineTo(y + u, x + g - b), o.arcTo(y + u, x + g, y + u - b, x + g, b), o.lineTo(y + b, x + g), o.arcTo(y, x + g, y, x + g - b, b), o.lineTo(y, x + b), o.arcTo(y, x, y + b, x, b), o.closePath(), o.fill(), o.stroke();
|
|
1615
|
-
let
|
|
1675
|
+
let w = x + h;
|
|
1616
1676
|
a.forEach((p, v) => {
|
|
1617
|
-
this.drawLatexOrText(p, y + h,
|
|
1677
|
+
this.drawLatexOrText(p, y + h, w, {
|
|
1618
1678
|
fontSize: r.tooltipSize,
|
|
1619
1679
|
fontFamily: this.theme.xAxis.fontFamily,
|
|
1620
1680
|
color: r.tooltipColor,
|
|
1621
1681
|
align: "left",
|
|
1622
1682
|
baseline: "top"
|
|
1623
|
-
}),
|
|
1683
|
+
}), w += c[v];
|
|
1624
1684
|
});
|
|
1625
1685
|
}
|
|
1626
1686
|
/**
|
|
@@ -1634,10 +1694,10 @@ class ii {
|
|
|
1634
1694
|
let f = 0;
|
|
1635
1695
|
r.forEach((p) => {
|
|
1636
1696
|
if (!!this.latexAPI && (p.includes("\\") || p.includes("^") || p.includes("_") || p.includes("{") && p.includes("}"))) {
|
|
1637
|
-
const
|
|
1638
|
-
d = Math.max(d,
|
|
1639
|
-
const
|
|
1640
|
-
c.push(
|
|
1697
|
+
const M = this.latexAPI.measure(p, { fontSize: o.tooltipSize });
|
|
1698
|
+
d = Math.max(d, M.width);
|
|
1699
|
+
const S = Math.max(a, M.height);
|
|
1700
|
+
c.push(S), f += S;
|
|
1641
1701
|
} else
|
|
1642
1702
|
d = Math.max(d, s.measureText(p).width), c.push(a), f += a;
|
|
1643
1703
|
});
|
|
@@ -1660,15 +1720,15 @@ class ii {
|
|
|
1660
1720
|
s.fillStyle = o.tooltipBackground, s.strokeStyle = o.tooltipBorder, s.lineWidth = 1, s.beginPath();
|
|
1661
1721
|
const b = 4;
|
|
1662
1722
|
s.moveTo(y + b, x), s.lineTo(y + u - b, x), s.arcTo(y + u, x, y + u, x + b, b), s.lineTo(y + u, x + g - b), s.arcTo(y + u, x + g, y + u - b, x + g, b), s.lineTo(y + b, x + g), s.arcTo(y, x + g, y, x + g - b, b), s.lineTo(y, x + b), s.arcTo(y, x, y + b, x, b), s.closePath(), s.fill(), s.stroke();
|
|
1663
|
-
let
|
|
1723
|
+
let w = x + l;
|
|
1664
1724
|
r.forEach((p, v) => {
|
|
1665
|
-
this.drawLatexOrText(p, y + l,
|
|
1725
|
+
this.drawLatexOrText(p, y + l, w, {
|
|
1666
1726
|
fontSize: o.tooltipSize,
|
|
1667
1727
|
fontFamily: this.theme.xAxis.fontFamily,
|
|
1668
1728
|
color: o.tooltipColor,
|
|
1669
1729
|
align: "left",
|
|
1670
1730
|
baseline: "top"
|
|
1671
|
-
}),
|
|
1731
|
+
}), w += c[v];
|
|
1672
1732
|
});
|
|
1673
1733
|
}
|
|
1674
1734
|
/**
|
|
@@ -1690,15 +1750,15 @@ class ii {
|
|
|
1690
1750
|
for (let y = 0; y < r.x.length; y++) {
|
|
1691
1751
|
const x = n.transform(r.x[y]), b = s.transform(r.y[y]);
|
|
1692
1752
|
if (x < e.x || x > e.x + e.width || b < e.y || b > e.y + e.height) continue;
|
|
1693
|
-
const
|
|
1694
|
-
if (
|
|
1695
|
-
const [v,
|
|
1696
|
-
o.beginPath(), (g === "both" || g === "positive") && (o.moveTo(x, b), o.lineTo(x, A), f && (o.moveTo(x - c / 2, A), o.lineTo(x + c / 2, A))), (g === "both" || g === "negative") && (o.moveTo(x, b), o.lineTo(x,
|
|
1753
|
+
const w = t.getYError(y);
|
|
1754
|
+
if (w) {
|
|
1755
|
+
const [v, M] = w, S = r.y[y], A = s.transform(S + M), P = s.transform(S - v);
|
|
1756
|
+
o.beginPath(), (g === "both" || g === "positive") && (o.moveTo(x, b), o.lineTo(x, A), f && (o.moveTo(x - c / 2, A), o.lineTo(x + c / 2, A))), (g === "both" || g === "negative") && (o.moveTo(x, b), o.lineTo(x, P), f && (o.moveTo(x - c / 2, P), o.lineTo(x + c / 2, P))), o.stroke();
|
|
1697
1757
|
}
|
|
1698
1758
|
const p = t.getXError(y);
|
|
1699
1759
|
if (p) {
|
|
1700
|
-
const [v,
|
|
1701
|
-
o.beginPath(), (g === "both" || g === "positive") && (o.moveTo(x, b), o.lineTo(A, b), f && (o.moveTo(A, b - c / 2), o.lineTo(A, b + c / 2))), (g === "both" || g === "negative") && (o.moveTo(x, b), o.lineTo(
|
|
1760
|
+
const [v, M] = p, S = r.x[y], A = n.transform(S + M), P = n.transform(S - v);
|
|
1761
|
+
o.beginPath(), (g === "both" || g === "positive") && (o.moveTo(x, b), o.lineTo(A, b), f && (o.moveTo(A, b - c / 2), o.lineTo(A, b + c / 2))), (g === "both" || g === "negative") && (o.moveTo(x, b), o.lineTo(P, b), f && (o.moveTo(P, b - c / 2), o.lineTo(P, b + c / 2))), o.stroke();
|
|
1702
1762
|
}
|
|
1703
1763
|
}
|
|
1704
1764
|
o.restore();
|
|
@@ -1717,10 +1777,10 @@ class ii {
|
|
|
1717
1777
|
return n;
|
|
1718
1778
|
}
|
|
1719
1779
|
formatXTick(e, t, n) {
|
|
1720
|
-
return
|
|
1780
|
+
return je(e, t, n, this.businessDayMapping);
|
|
1721
1781
|
}
|
|
1722
1782
|
formatYTick(e, t) {
|
|
1723
|
-
return
|
|
1783
|
+
return Ze(e, t);
|
|
1724
1784
|
}
|
|
1725
1785
|
/** Draw buy/sell markers on candlestick series (Stage 2.14). */
|
|
1726
1786
|
drawCandlestickMarkers(e, t, n, s) {
|
|
@@ -1730,14 +1790,14 @@ class ii {
|
|
|
1730
1790
|
const r = t.getData(), a = this.ctx, l = r.x, h = r.high ?? r.y, d = r.low ?? r.y, c = r.close ?? r.y;
|
|
1731
1791
|
for (const u of o) {
|
|
1732
1792
|
const g = (() => {
|
|
1733
|
-
let
|
|
1793
|
+
let M = 0, S = Math.abs(l[0] - u.time);
|
|
1734
1794
|
for (let A = 1; A < l.length; A++) {
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1795
|
+
const P = Math.abs(l[A] - u.time);
|
|
1796
|
+
P < S && (S = P, M = A);
|
|
1737
1797
|
}
|
|
1738
|
-
return
|
|
1739
|
-
})(), y = u.position ?? "aboveBar", x = y === "belowBar" ? d[g] : y === "inBar" ? c[g] : h[g], b = e.x + n.transform(l[g]),
|
|
1740
|
-
a.save(), a.fillStyle = p, a.strokeStyle = p, a.lineWidth = 1.5, u.shape === "arrowDown" ? (a.beginPath(), a.moveTo(b,
|
|
1798
|
+
return M;
|
|
1799
|
+
})(), y = u.position ?? "aboveBar", x = y === "belowBar" ? d[g] : y === "inBar" ? c[g] : h[g], b = e.x + n.transform(l[g]), w = e.y + s.transform(x), p = u.color ?? "#22c55e", v = y === "belowBar" ? 10 : -10;
|
|
1800
|
+
a.save(), a.fillStyle = p, a.strokeStyle = p, a.lineWidth = 1.5, u.shape === "arrowDown" ? (a.beginPath(), a.moveTo(b, w - v), a.lineTo(b - 5, w - v - 8), a.lineTo(b + 5, w - v - 8), a.closePath(), a.fill()) : u.shape === "circle" ? (a.beginPath(), a.arc(b, w + v, 4, 0, Math.PI * 2), a.fill()) : (a.beginPath(), a.moveTo(b, w + v), a.lineTo(b - 5, w + v + 8), a.lineTo(b + 5, w + v + 8), a.closePath(), a.fill()), u.text && (a.font = "10px sans-serif", a.textAlign = "center", a.fillText(u.text, b, w + v + (y === "belowBar" ? 20 : -14))), a.restore();
|
|
1741
1801
|
}
|
|
1742
1802
|
}
|
|
1743
1803
|
/** Horizontal dashed lines for active price alerts (Stage 2.19). */
|
|
@@ -1752,7 +1812,7 @@ class ii {
|
|
|
1752
1812
|
s.setLineDash([]), s.restore();
|
|
1753
1813
|
}
|
|
1754
1814
|
}
|
|
1755
|
-
class
|
|
1815
|
+
class li {
|
|
1756
1816
|
constructor(e, t, n, s, o) {
|
|
1757
1817
|
m(this, "container");
|
|
1758
1818
|
m(this, "callbacks");
|
|
@@ -1767,6 +1827,10 @@ class ni {
|
|
|
1767
1827
|
m(this, "lastMousePos", { x: 0, y: 0 });
|
|
1768
1828
|
m(this, "mouseDownPos", { x: 0, y: 0 });
|
|
1769
1829
|
m(this, "mode", "pan");
|
|
1830
|
+
m(this, "pinchStartDistance", 0);
|
|
1831
|
+
m(this, "pinchStartBounds", null);
|
|
1832
|
+
m(this, "lastTapTime", 0);
|
|
1833
|
+
m(this, "doubleTapMs", 300);
|
|
1770
1834
|
// Bound handlers for cleanup
|
|
1771
1835
|
m(this, "boundWheel");
|
|
1772
1836
|
m(this, "boundMouseDown");
|
|
@@ -1788,7 +1852,7 @@ class ni {
|
|
|
1788
1852
|
}
|
|
1789
1853
|
/**
|
|
1790
1854
|
* Set the interaction mode
|
|
1791
|
-
* @deprecated Use setMode instead
|
|
1855
|
+
* @deprecated Use setMode instead. **Removed in v4.0.**
|
|
1792
1856
|
*/
|
|
1793
1857
|
setPanMode(e) {
|
|
1794
1858
|
this.mode = e ? "pan" : "select";
|
|
@@ -1814,10 +1878,10 @@ class ni {
|
|
|
1814
1878
|
e.preventDefault();
|
|
1815
1879
|
const n = this.container.getBoundingClientRect(), s = e.clientX - n.left, o = e.clientY - n.top, r = this.getAxesLayout();
|
|
1816
1880
|
let a = !1, l = !1, h;
|
|
1817
|
-
for (const
|
|
1881
|
+
for (const T of r) {
|
|
1818
1882
|
let I;
|
|
1819
|
-
if (
|
|
1820
|
-
h =
|
|
1883
|
+
if (T.position === "left" ? I = t.x - 65 - T.offset : I = t.x + t.width + T.offset, s >= I && s <= I + 65 && o >= t.y && o <= t.y + t.height) {
|
|
1884
|
+
h = T.id, l = !0, a = !1;
|
|
1821
1885
|
break;
|
|
1822
1886
|
}
|
|
1823
1887
|
}
|
|
@@ -1829,16 +1893,16 @@ class ni {
|
|
|
1829
1893
|
else
|
|
1830
1894
|
return;
|
|
1831
1895
|
const d = this.getBounds(h), c = e.deltaY > 0 ? 1.1 : 0.9, f = (s - t.x) / t.width, u = 1 - (o - t.y) / t.height, g = d.xMin + f * (d.xMax - d.xMin), y = d.yMin + u * (d.yMax - d.yMin), x = 1e-12, b = 1e15;
|
|
1832
|
-
let
|
|
1833
|
-
const
|
|
1834
|
-
(
|
|
1835
|
-
const
|
|
1836
|
-
xMin:
|
|
1896
|
+
let w = a ? g - (g - d.xMin) * c : d.xMin, p = a ? g + (d.xMax - g) * c : d.xMax, v = l ? y - (y - d.yMin) * c : d.yMin, M = l ? y + (d.yMax - y) * c : d.yMax;
|
|
1897
|
+
const S = p - w, A = M - v;
|
|
1898
|
+
(S < x || S > b) && (w = d.xMin, p = d.xMax), (A < x || A > b) && (v = d.yMin, M = d.yMax);
|
|
1899
|
+
const P = {
|
|
1900
|
+
xMin: w,
|
|
1837
1901
|
xMax: p,
|
|
1838
1902
|
yMin: v,
|
|
1839
|
-
yMax:
|
|
1903
|
+
yMax: M
|
|
1840
1904
|
};
|
|
1841
|
-
this.callbacks.onZoom(
|
|
1905
|
+
this.callbacks.onZoom(P, h);
|
|
1842
1906
|
}
|
|
1843
1907
|
handleMouseDown(e) {
|
|
1844
1908
|
var l, h, d, c, f, u, g, y, x, b;
|
|
@@ -1857,10 +1921,10 @@ class ni {
|
|
|
1857
1921
|
defaultPrevented: e.defaultPrevented
|
|
1858
1922
|
}), e.defaultPrevented) return;
|
|
1859
1923
|
const a = this.getAxesLayout();
|
|
1860
|
-
for (const
|
|
1924
|
+
for (const w of a) {
|
|
1861
1925
|
let v;
|
|
1862
|
-
if (
|
|
1863
|
-
this.isDragging = !0, this.panningAxisId =
|
|
1926
|
+
if (w.position === "left" ? v = t.x - 65 - w.offset : v = t.x + t.width + w.offset, s >= v && s <= v + 65 && o >= t.y && o <= t.y + t.height) {
|
|
1927
|
+
this.isDragging = !0, this.panningAxisId = w.id, this.lastMousePos = { x: e.clientX, y: e.clientY }, this.container.style.cursor = "ns-resize", (c = (d = this.callbacks).onDragStart) == null || c.call(d);
|
|
1864
1928
|
return;
|
|
1865
1929
|
}
|
|
1866
1930
|
}
|
|
@@ -1919,11 +1983,11 @@ class ni {
|
|
|
1919
1983
|
return;
|
|
1920
1984
|
}
|
|
1921
1985
|
if (this.isBoxZooming) {
|
|
1922
|
-
const y = Math.min(this.selectionStart.x, n), x = Math.min(this.selectionStart.y, s), b = Math.abs(n - this.selectionStart.x),
|
|
1923
|
-
b > 5 &&
|
|
1986
|
+
const y = Math.min(this.selectionStart.x, n), x = Math.min(this.selectionStart.y, s), b = Math.abs(n - this.selectionStart.x), w = Math.abs(s - this.selectionStart.y);
|
|
1987
|
+
b > 5 && w > 5 && this.callbacks.onBoxZoom({ x: y, y: x, width: b, height: w }), this.callbacks.onBoxZoom(null);
|
|
1924
1988
|
} else if (this.isBoxSelecting) {
|
|
1925
|
-
const y = Math.min(this.selectionStart.x, n), x = Math.min(this.selectionStart.y, s), b = Math.abs(n - this.selectionStart.x),
|
|
1926
|
-
this.callbacks.onBoxSelect && this.callbacks.onBoxSelect({ x: y, y: x, width: b, height:
|
|
1989
|
+
const y = Math.min(this.selectionStart.x, n), x = Math.min(this.selectionStart.y, s), b = Math.abs(n - this.selectionStart.x), w = Math.abs(s - this.selectionStart.y);
|
|
1990
|
+
this.callbacks.onBoxSelect && this.callbacks.onBoxSelect({ x: y, y: x, width: b, height: w }, e.shiftKey);
|
|
1927
1991
|
}
|
|
1928
1992
|
const o = this.isDragging || this.isBoxSelecting || this.isBoxZooming, r = Math.hypot(
|
|
1929
1993
|
n - this.mouseDownPos.x,
|
|
@@ -1938,19 +2002,49 @@ class ni {
|
|
|
1938
2002
|
// Touch Handlers
|
|
1939
2003
|
// ----------------------------------------
|
|
1940
2004
|
handleTouchStart(e) {
|
|
2005
|
+
if (e.touches.length === 2) {
|
|
2006
|
+
this.isDragging = !1;
|
|
2007
|
+
const [t, n] = [e.touches[0], e.touches[1]];
|
|
2008
|
+
this.pinchStartDistance = Math.hypot(
|
|
2009
|
+
n.clientX - t.clientX,
|
|
2010
|
+
n.clientY - t.clientY
|
|
2011
|
+
), this.pinchStartBounds = this.getBounds();
|
|
2012
|
+
return;
|
|
2013
|
+
}
|
|
1941
2014
|
if (e.touches.length === 1) {
|
|
1942
2015
|
const t = e.touches[0];
|
|
1943
2016
|
this.isDragging = !0, this.panningAxisId = void 0, this.lastMousePos = { x: t.clientX, y: t.clientY };
|
|
1944
2017
|
}
|
|
1945
2018
|
}
|
|
1946
2019
|
handleTouchMove(e) {
|
|
2020
|
+
if (e.touches.length === 2 && this.pinchStartBounds && this.pinchStartDistance > 0) {
|
|
2021
|
+
e.preventDefault();
|
|
2022
|
+
const [o, r] = [e.touches[0], e.touches[1]], a = Math.hypot(
|
|
2023
|
+
r.clientX - o.clientX,
|
|
2024
|
+
r.clientY - o.clientY
|
|
2025
|
+
), l = this.pinchStartDistance / a, h = this.pinchStartBounds, d = (h.xMin + h.xMax) / 2, c = (h.yMin + h.yMax) / 2, f = (h.xMax - h.xMin) / 2 * l, u = (h.yMax - h.yMin) / 2 * l;
|
|
2026
|
+
this.callbacks.onZoom(
|
|
2027
|
+
{
|
|
2028
|
+
xMin: d - f,
|
|
2029
|
+
xMax: d + f,
|
|
2030
|
+
yMin: c - u,
|
|
2031
|
+
yMax: c + u
|
|
2032
|
+
},
|
|
2033
|
+
this.panningAxisId
|
|
2034
|
+
);
|
|
2035
|
+
return;
|
|
2036
|
+
}
|
|
1947
2037
|
if (!this.isDragging || e.touches.length !== 1) return;
|
|
1948
2038
|
e.preventDefault();
|
|
1949
2039
|
const t = e.touches[0], n = t.clientX - this.lastMousePos.x, s = t.clientY - this.lastMousePos.y;
|
|
1950
2040
|
this.callbacks.onPan(n, s, this.panningAxisId), this.lastMousePos = { x: t.clientX, y: t.clientY };
|
|
1951
2041
|
}
|
|
1952
|
-
handleTouchEnd() {
|
|
1953
|
-
|
|
2042
|
+
handleTouchEnd(e) {
|
|
2043
|
+
var t, n;
|
|
2044
|
+
if (e.touches.length < 2 && (this.pinchStartDistance = 0, this.pinchStartBounds = null), e.touches.length === 0) {
|
|
2045
|
+
const s = Date.now();
|
|
2046
|
+
s - this.lastTapTime < this.doubleTapMs ? ((n = (t = this.callbacks).onDoubleTap) == null || n.call(t), this.lastTapTime = 0) : this.lastTapTime = s, this.isDragging = !1, this.panningAxisId = void 0;
|
|
2047
|
+
}
|
|
1954
2048
|
}
|
|
1955
2049
|
// ----------------------------------------
|
|
1956
2050
|
// Cleanup
|
|
@@ -1959,7 +2053,7 @@ class ni {
|
|
|
1959
2053
|
this.detachListeners();
|
|
1960
2054
|
}
|
|
1961
2055
|
}
|
|
1962
|
-
const
|
|
2056
|
+
const hi = {
|
|
1963
2057
|
enabled: !0,
|
|
1964
2058
|
hitRadius: 20,
|
|
1965
2059
|
multiSelect: !0,
|
|
@@ -1970,7 +2064,7 @@ const si = {
|
|
|
1970
2064
|
ringWidth: 3
|
|
1971
2065
|
}
|
|
1972
2066
|
};
|
|
1973
|
-
class
|
|
2067
|
+
class ci {
|
|
1974
2068
|
constructor(e, t) {
|
|
1975
2069
|
m(this, "ctx");
|
|
1976
2070
|
m(this, "config");
|
|
@@ -1979,7 +2073,7 @@ class oi {
|
|
|
1979
2073
|
m(this, "isBoxSelecting", !1);
|
|
1980
2074
|
m(this, "boxStart", null);
|
|
1981
2075
|
m(this, "boxEnd", null);
|
|
1982
|
-
this.ctx = e, this.config = { ...
|
|
2076
|
+
this.ctx = e, this.config = { ...hi, ...t };
|
|
1983
2077
|
}
|
|
1984
2078
|
// ============================================
|
|
1985
2079
|
// Configuration
|
|
@@ -2015,17 +2109,17 @@ class oi {
|
|
|
2015
2109
|
if (g.x.length === 0) return;
|
|
2016
2110
|
const y = f.getYAxisId() || this.ctx.getPrimaryYAxisId(), x = r.get(y);
|
|
2017
2111
|
if (!x) return;
|
|
2018
|
-
const b = o.invert(e),
|
|
2019
|
-
for (let
|
|
2020
|
-
const A = o.transform(g.x[
|
|
2112
|
+
const b = o.invert(e), w = this.findNearestIndex(g.x, b), p = 50, v = Math.max(0, w - p), M = Math.min(g.x.length, w + p);
|
|
2113
|
+
for (let S = v; S < M; S++) {
|
|
2114
|
+
const A = o.transform(g.x[S]), P = x.transform(g.y[S]), T = A - e, D = P - t, I = T * T + D * D;
|
|
2021
2115
|
I < c && I <= h && (c = I, d = {
|
|
2022
2116
|
seriesId: u,
|
|
2023
|
-
index:
|
|
2024
|
-
x: g.x[
|
|
2025
|
-
y: g.y[
|
|
2117
|
+
index: S,
|
|
2118
|
+
x: g.x[S],
|
|
2119
|
+
y: g.y[S],
|
|
2026
2120
|
distance: Math.sqrt(I),
|
|
2027
2121
|
pixelX: A,
|
|
2028
|
-
pixelY:
|
|
2122
|
+
pixelY: P
|
|
2029
2123
|
});
|
|
2030
2124
|
}
|
|
2031
2125
|
}), d;
|
|
@@ -2215,10 +2309,10 @@ class oi {
|
|
|
2215
2309
|
indices: v
|
|
2216
2310
|
}));
|
|
2217
2311
|
this.selectPoints(b, e ? "add" : "single");
|
|
2218
|
-
const
|
|
2312
|
+
const w = this.getSelectedPoints();
|
|
2219
2313
|
this.ctx.events.emit("regionSelect", {
|
|
2220
2314
|
bounds: g,
|
|
2221
|
-
containedPoints:
|
|
2315
|
+
containedPoints: w
|
|
2222
2316
|
});
|
|
2223
2317
|
} else e || this.clearSelection();
|
|
2224
2318
|
this.cancelBoxSelection();
|
|
@@ -2346,7 +2440,7 @@ const ee = {
|
|
|
2346
2440
|
reducedMotion: "auto",
|
|
2347
2441
|
resizeDebounce: 100
|
|
2348
2442
|
};
|
|
2349
|
-
class
|
|
2443
|
+
class ui {
|
|
2350
2444
|
constructor(e, t) {
|
|
2351
2445
|
m(this, "ctx");
|
|
2352
2446
|
m(this, "config");
|
|
@@ -2527,7 +2621,7 @@ class ri {
|
|
|
2527
2621
|
this.destroyed = !0, this.debounceTimer !== null && window.clearTimeout(this.debounceTimer), this.resizeObserver ? (this.resizeObserver.disconnect(), this.resizeObserver = null) : window.removeEventListener("resize", this.handleResize);
|
|
2528
2622
|
}
|
|
2529
2623
|
}
|
|
2530
|
-
function
|
|
2624
|
+
function di(i, e) {
|
|
2531
2625
|
const {
|
|
2532
2626
|
seriesIds: t,
|
|
2533
2627
|
includeHeaders: n = !0,
|
|
@@ -2553,7 +2647,7 @@ function ai(i, e) {
|
|
|
2553
2647
|
return a.join(`
|
|
2554
2648
|
`);
|
|
2555
2649
|
}
|
|
2556
|
-
function
|
|
2650
|
+
function fi(i, e, t) {
|
|
2557
2651
|
const { seriesIds: n, precision: s = 6 } = t ?? {}, o = n ? i.filter((a) => n.includes(a.getId())) : i, r = {};
|
|
2558
2652
|
return o.forEach((a) => {
|
|
2559
2653
|
const l = a.getData();
|
|
@@ -2573,7 +2667,7 @@ function li(i, e, t) {
|
|
|
2573
2667
|
series: r
|
|
2574
2668
|
}, null, 2);
|
|
2575
2669
|
}
|
|
2576
|
-
function
|
|
2670
|
+
function gi(i, e, t, n, s, o, r = "png") {
|
|
2577
2671
|
const a = document.createElement("canvas");
|
|
2578
2672
|
a.width = e.width, a.height = e.height;
|
|
2579
2673
|
const l = a.getContext("2d");
|
|
@@ -2583,14 +2677,14 @@ function hi(i, e, t, n, s, o, r = "png") {
|
|
|
2583
2677
|
h[1] * 255
|
|
2584
2678
|
)}, ${Math.round(h[2] * 255)}, ${h[3]})`, l.fillRect(0, 0, a.width, a.height), l.drawImage(i, 0, 0), l.drawImage(e, 0, 0), n && s && n.draw(l, o), a.toDataURL(`image/${r}`);
|
|
2585
2679
|
}
|
|
2586
|
-
function
|
|
2680
|
+
function _e(i) {
|
|
2587
2681
|
return i.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
2588
2682
|
}
|
|
2589
|
-
function
|
|
2683
|
+
function nt(i, e) {
|
|
2590
2684
|
return e && i.has(e) ? i.get(e) : i.get("default") ?? i.values().next().value;
|
|
2591
2685
|
}
|
|
2592
|
-
function
|
|
2593
|
-
const h =
|
|
2686
|
+
function yi(i, e, t, n, s, o, r, a, l = {}) {
|
|
2687
|
+
const h = nt(s, l.primaryYAxisId);
|
|
2594
2688
|
if (!h)
|
|
2595
2689
|
throw new Error("SVG export requires at least one Y scale");
|
|
2596
2690
|
const d = [
|
|
@@ -2598,13 +2692,13 @@ function ci(i, e, t, n, s, o, r, a, l = {}) {
|
|
|
2598
2692
|
`<rect width="100%" height="100%" fill="${o.backgroundColor}" />`,
|
|
2599
2693
|
'<g transform="translate(0,0)">'
|
|
2600
2694
|
];
|
|
2601
|
-
return
|
|
2695
|
+
return bi(d, t, n, h, o), mi(d, i, t, n, s, l.primaryYAxisId), pi(d, t, n, h, o), xi(d, t, n, h, o, l), d.push("</g>"), d.push("</svg>"), d.join(`
|
|
2602
2696
|
`);
|
|
2603
2697
|
}
|
|
2604
|
-
function
|
|
2698
|
+
function mi(i, e, t, n, s, o) {
|
|
2605
2699
|
for (const r of e) {
|
|
2606
2700
|
if (!r.isVisible()) continue;
|
|
2607
|
-
const a = s.get(r.getYAxisId() || o || "default") ??
|
|
2701
|
+
const a = s.get(r.getYAxisId() || o || "default") ?? nt(s, o);
|
|
2608
2702
|
if (!a) continue;
|
|
2609
2703
|
const l = r.getData();
|
|
2610
2704
|
if (!l || l.x.length === 0) continue;
|
|
@@ -2618,8 +2712,8 @@ function ui(i, e, t, n, s, o) {
|
|
|
2618
2712
|
if (f === "after") c.push(`${g.toFixed(1)},${b.toFixed(1)}`);
|
|
2619
2713
|
else if (f === "before") c.push(`${x.toFixed(1)},${y.toFixed(1)}`);
|
|
2620
2714
|
else if (f === "center") {
|
|
2621
|
-
const
|
|
2622
|
-
c.push(`${
|
|
2715
|
+
const w = (x + g) / 2;
|
|
2716
|
+
c.push(`${w.toFixed(1)},${b.toFixed(1)}`), c.push(`${w.toFixed(1)},${y.toFixed(1)}`);
|
|
2623
2717
|
}
|
|
2624
2718
|
}
|
|
2625
2719
|
c.push(`${g.toFixed(1)},${y.toFixed(1)}`);
|
|
@@ -2659,58 +2753,58 @@ function ui(i, e, t, n, s, o) {
|
|
|
2659
2753
|
const c = (h.barWidth || 5) * (t.width / (n.domain[1] - n.domain[0])), f = h.bullishColor || "#26a69a", u = h.bearishColor || "#ef5350";
|
|
2660
2754
|
if (l.open && l.high && l.low && l.close)
|
|
2661
2755
|
for (let g = 0; g < l.x.length; g++) {
|
|
2662
|
-
const y = l.close[g] >= l.open[g], x = n.transform(l.x[g]), b = a.transform(l.open[g]),
|
|
2756
|
+
const y = l.close[g] >= l.open[g], x = n.transform(l.x[g]), b = a.transform(l.open[g]), w = a.transform(l.close[g]), p = a.transform(l.high[g]), v = a.transform(l.low[g]), M = y ? f : u;
|
|
2663
2757
|
i.push(
|
|
2664
|
-
`<line x1="${x.toFixed(1)}" y1="${p.toFixed(1)}" x2="${x.toFixed(1)}" y2="${v.toFixed(1)}" stroke="${
|
|
2758
|
+
`<line x1="${x.toFixed(1)}" y1="${p.toFixed(1)}" x2="${x.toFixed(1)}" y2="${v.toFixed(1)}" stroke="${M}" stroke-width="1" />`
|
|
2665
2759
|
);
|
|
2666
|
-
const
|
|
2760
|
+
const S = Math.min(b, w), A = Math.max(1, Math.abs(b - w));
|
|
2667
2761
|
i.push(
|
|
2668
|
-
`<rect x="${(x - c / 2).toFixed(1)}" y="${
|
|
2762
|
+
`<rect x="${(x - c / 2).toFixed(1)}" y="${S.toFixed(1)}" width="${c.toFixed(1)}" height="${A.toFixed(1)}" fill="${M}" />`
|
|
2669
2763
|
);
|
|
2670
2764
|
}
|
|
2671
2765
|
}
|
|
2672
2766
|
}
|
|
2673
2767
|
}
|
|
2674
|
-
function
|
|
2675
|
-
const o =
|
|
2768
|
+
function pi(i, e, t, n, s) {
|
|
2769
|
+
const o = $(e.y + e.height), r = $(e.x);
|
|
2676
2770
|
i.push(
|
|
2677
2771
|
`<line x1="${e.x}" y1="${o}" x2="${e.x + e.width}" y2="${o}" stroke="${s.xAxis.lineColor}" stroke-width="${s.xAxis.lineWidth || 2}" />`
|
|
2678
2772
|
), i.push(
|
|
2679
2773
|
`<line x1="${r}" y1="${e.y}" x2="${r}" y2="${e.y + e.height}" stroke="${s.yAxis.lineColor}" stroke-width="${s.yAxis.lineWidth || 2}" />`
|
|
2680
2774
|
);
|
|
2681
2775
|
}
|
|
2682
|
-
function
|
|
2776
|
+
function xi(i, e, t, n, s, o) {
|
|
2683
2777
|
const r = o.xAxis, a = o.yAxis, l = (r == null ? void 0 : r.tickCount) ?? 8, h = (a == null ? void 0 : a.tickCount) ?? 6, d = t.domain[1] - t.domain[0], c = e.y + e.height, f = e.x, u = s.xAxis, g = s.yAxis;
|
|
2684
2778
|
(r == null ? void 0 : r.showLabels) !== !1 && t.ticks(l).forEach((y) => {
|
|
2685
2779
|
const x = he(t.transform(y));
|
|
2686
2780
|
if (x < e.x || x > e.x + e.width) return;
|
|
2687
|
-
const b =
|
|
2781
|
+
const b = je(y, r, d), w = c + (u.tickLength ?? 4) + u.labelSize * 0.75;
|
|
2688
2782
|
i.push(
|
|
2689
|
-
`<text x="${x.toFixed(1)}" y="${
|
|
2783
|
+
`<text x="${x.toFixed(1)}" y="${w.toFixed(1)}" fill="${u.labelColor}" font-size="${u.labelSize}" text-anchor="middle">${_e(b)}</text>`
|
|
2690
2784
|
);
|
|
2691
2785
|
}), (a == null ? void 0 : a.showLabels) !== !1 && n.ticks(h).forEach((y) => {
|
|
2692
2786
|
const x = he(n.transform(y));
|
|
2693
2787
|
if (x < e.y || x > e.y + e.height) return;
|
|
2694
|
-
const b =
|
|
2788
|
+
const b = Ze(y, a), w = f - (g.tickLength ?? 4) - 4;
|
|
2695
2789
|
i.push(
|
|
2696
|
-
`<text x="${
|
|
2790
|
+
`<text x="${w.toFixed(1)}" y="${(x + g.labelSize * 0.35).toFixed(1)}" fill="${g.labelColor}" font-size="${g.labelSize}" text-anchor="end">${_e(b)}</text>`
|
|
2697
2791
|
);
|
|
2698
2792
|
});
|
|
2699
2793
|
}
|
|
2700
|
-
function
|
|
2794
|
+
function bi(i, e, t, n, s) {
|
|
2701
2795
|
s.grid.visible && (t.ticks(10).forEach((o) => {
|
|
2702
|
-
const r =
|
|
2796
|
+
const r = $(t.transform(o));
|
|
2703
2797
|
r >= e.x && r <= e.x + e.width && i.push(
|
|
2704
2798
|
`<line x1="${r.toFixed(1)}" y1="${e.y}" x2="${r.toFixed(1)}" y2="${e.y + e.height}" stroke="${s.grid.majorColor}" stroke-opacity="0.1" stroke-dasharray="2,2" />`
|
|
2705
2799
|
);
|
|
2706
2800
|
}), n.ticks(10).forEach((o) => {
|
|
2707
|
-
const r =
|
|
2801
|
+
const r = $(n.transform(o));
|
|
2708
2802
|
r >= e.y && r <= e.y + e.height && i.push(
|
|
2709
2803
|
`<line x1="${e.x}" y1="${r.toFixed(1)}" x2="${e.x + e.width}" y2="${r.toFixed(1)}" stroke="${s.grid.majorColor}" stroke-opacity="0.1" stroke-dasharray="2,2" />`
|
|
2710
2804
|
);
|
|
2711
2805
|
}));
|
|
2712
2806
|
}
|
|
2713
|
-
const
|
|
2807
|
+
const vi = /* @__PURE__ */ new Set([
|
|
2714
2808
|
"line",
|
|
2715
2809
|
"band",
|
|
2716
2810
|
"scatter",
|
|
@@ -2719,13 +2813,13 @@ const yi = /* @__PURE__ */ new Set([
|
|
|
2719
2813
|
"candlestick",
|
|
2720
2814
|
"ohlc"
|
|
2721
2815
|
]);
|
|
2722
|
-
function
|
|
2816
|
+
function ve(i) {
|
|
2723
2817
|
const e = Array.from(i).filter((n) => n.isVisible());
|
|
2724
|
-
return e.some((n) => n.getType() === "bar") ? !e.some((n) =>
|
|
2818
|
+
return e.some((n) => n.getType() === "bar") ? !e.some((n) => vi.has(n.getType())) : !1;
|
|
2725
2819
|
}
|
|
2726
|
-
function
|
|
2820
|
+
function wi(i, e) {
|
|
2727
2821
|
e.x && (i.viewBounds.xMin = e.x[0], i.viewBounds.xMax = e.x[1]);
|
|
2728
|
-
const t =
|
|
2822
|
+
const t = ve(i.series.values()), n = e.y ? [...e.y] : null;
|
|
2729
2823
|
if (n && t && (n[0] = 0), n)
|
|
2730
2824
|
if (e.axisId) {
|
|
2731
2825
|
const s = i.yScales.get(e.axisId);
|
|
@@ -2743,17 +2837,17 @@ function mi(i, e) {
|
|
|
2743
2837
|
y: [i.viewBounds.yMin, i.viewBounds.yMax]
|
|
2744
2838
|
}), i.requestRender();
|
|
2745
2839
|
}
|
|
2746
|
-
function
|
|
2840
|
+
function Mi(i, e, t, n) {
|
|
2747
2841
|
const s = i.getPlotArea(), o = e / s.width * (i.viewBounds.xMax - i.viewBounds.xMin);
|
|
2748
2842
|
if (i.viewBounds.xMin -= o, i.viewBounds.xMax -= o, n) {
|
|
2749
2843
|
const a = i.yScales.get(n);
|
|
2750
2844
|
if (a) {
|
|
2751
|
-
const l =
|
|
2845
|
+
const l = ve(i.series.values()), h = a.domain[1] - a.domain[0], d = t / s.height * h;
|
|
2752
2846
|
let c = a.domain[0] + d, f = a.domain[1] + d;
|
|
2753
2847
|
l && (c = 0, f = a.domain[1] + d), a.setDomain(c, f), n === i.primaryYAxisId && (i.viewBounds.yMin = c, i.viewBounds.yMax = f);
|
|
2754
2848
|
}
|
|
2755
2849
|
} else {
|
|
2756
|
-
const a =
|
|
2850
|
+
const a = ve(i.series.values());
|
|
2757
2851
|
i.yScales.forEach((l, h) => {
|
|
2758
2852
|
const d = l.domain[1] - l.domain[0], c = t / s.height * d;
|
|
2759
2853
|
let f = l.domain[0] + c, u = l.domain[1] + c;
|
|
@@ -2763,7 +2857,7 @@ function pi(i, e, t, n) {
|
|
|
2763
2857
|
const r = t / s.height * (i.viewBounds.yMax - i.viewBounds.yMin);
|
|
2764
2858
|
i.events.emit("pan", { deltaX: o, deltaY: r }), i.requestRender();
|
|
2765
2859
|
}
|
|
2766
|
-
function
|
|
2860
|
+
function Si(i) {
|
|
2767
2861
|
if (i.series.size === 0) return;
|
|
2768
2862
|
let e = 1 / 0, t = -1 / 0;
|
|
2769
2863
|
const n = /* @__PURE__ */ new Map();
|
|
@@ -2800,7 +2894,7 @@ function xi(i) {
|
|
|
2800
2894
|
}
|
|
2801
2895
|
}), i.requestRender();
|
|
2802
2896
|
}
|
|
2803
|
-
function
|
|
2897
|
+
function Ci(i, e = {}) {
|
|
2804
2898
|
var l, h;
|
|
2805
2899
|
const t = typeof e.padding == "object" ? e.padding.x ?? 0.02 : e.padding ?? 0.02, n = typeof e.padding == "object" ? e.padding.y ?? 0.05 : e.padding ?? 0.05;
|
|
2806
2900
|
let s = (l = e.x) == null ? void 0 : l[0], o = (h = e.x) == null ? void 0 : h[1], r = s !== void 0 && o !== void 0;
|
|
@@ -2830,8 +2924,8 @@ function bi(i, e = {}) {
|
|
|
2830
2924
|
if (!g || !y) return;
|
|
2831
2925
|
let x = f.max - f.min;
|
|
2832
2926
|
(x <= 0 || !isFinite(x)) && (x = Math.abs(f.min) * 0.1 || 1);
|
|
2833
|
-
const b = x * n,
|
|
2834
|
-
y.setDomain(
|
|
2927
|
+
const b = x * n, w = Math.max(-1e15, f.min - b), p = Math.min(1e15, f.max + b);
|
|
2928
|
+
y.setDomain(w, p), u === i.primaryYAxisId && (i.viewBounds.yMin = w, i.viewBounds.yMax = p);
|
|
2835
2929
|
});
|
|
2836
2930
|
if (r && s !== void 0 && o !== void 0) {
|
|
2837
2931
|
let f = o - s;
|
|
@@ -2841,7 +2935,7 @@ function bi(i, e = {}) {
|
|
|
2841
2935
|
}
|
|
2842
2936
|
return i.requestRender(), !0;
|
|
2843
2937
|
}
|
|
2844
|
-
function
|
|
2938
|
+
function Ai(i) {
|
|
2845
2939
|
if (i.series.size === 0) return;
|
|
2846
2940
|
const e = /* @__PURE__ */ new Map();
|
|
2847
2941
|
i.yScales.forEach((o, r) => {
|
|
@@ -2870,7 +2964,7 @@ function vi(i) {
|
|
|
2870
2964
|
}
|
|
2871
2965
|
}), i.requestRender();
|
|
2872
2966
|
}
|
|
2873
|
-
function
|
|
2967
|
+
function ki(i, e, t, n) {
|
|
2874
2968
|
if (e === null) {
|
|
2875
2969
|
if (t && t.width > 5 && t.height > 5) {
|
|
2876
2970
|
const s = i.getPlotArea(), o = i.viewBounds, r = (t.x - s.x) / s.width, a = (t.x + t.width - s.x) / s.width, l = 1 - (t.y - s.y) / s.height, h = 1 - (t.y + t.height - s.y) / s.height, d = o.xMin + r * (o.xMax - o.xMin), c = o.xMin + a * (o.xMax - o.xMin), f = o.yMin + h * (o.yMax - o.yMin), u = o.yMin + l * (o.yMax - o.yMin);
|
|
@@ -2880,7 +2974,7 @@ function Si(i, e, t, n) {
|
|
|
2880
2974
|
}
|
|
2881
2975
|
return e;
|
|
2882
2976
|
}
|
|
2883
|
-
const
|
|
2977
|
+
const Pi = {
|
|
2884
2978
|
/** Linear easing - constant speed */
|
|
2885
2979
|
linear: (i) => i,
|
|
2886
2980
|
/** Ease in - starts slow, accelerates */
|
|
@@ -2906,7 +3000,7 @@ const wi = {
|
|
|
2906
3000
|
/** Bounce effect */
|
|
2907
3001
|
bounce: (i) => i < 1 / 2.75 ? 7.5625 * i * i : i < 2 / 2.75 ? 7.5625 * (i -= 1.5 / 2.75) * i + 0.75 : i < 2.5 / 2.75 ? 7.5625 * (i -= 2.25 / 2.75) * i + 0.9375 : 7.5625 * (i -= 2.625 / 2.75) * i + 0.984375
|
|
2908
3002
|
};
|
|
2909
|
-
class
|
|
3003
|
+
class st {
|
|
2910
3004
|
constructor() {
|
|
2911
3005
|
m(this, "animations", /* @__PURE__ */ new Map());
|
|
2912
3006
|
m(this, "frameId", null);
|
|
@@ -2917,7 +3011,7 @@ class it {
|
|
|
2917
3011
|
* Start a new animation
|
|
2918
3012
|
*/
|
|
2919
3013
|
animate(e) {
|
|
2920
|
-
const t = `anim_${++this.idCounter}`, n = typeof e.easing == "function" ? e.easing :
|
|
3014
|
+
const t = `anim_${++this.idCounter}`, n = typeof e.easing == "function" ? e.easing : Pi[e.easing || "easeOutCubic"];
|
|
2921
3015
|
let s, o;
|
|
2922
3016
|
const r = new Promise((a, l) => {
|
|
2923
3017
|
s = a, o = l;
|
|
@@ -3048,7 +3142,7 @@ class it {
|
|
|
3048
3142
|
}), this.animations.size > 0 ? this.frameId = requestAnimationFrame(() => this.tick()) : this.frameId = null;
|
|
3049
3143
|
}
|
|
3050
3144
|
}
|
|
3051
|
-
const
|
|
3145
|
+
const N = {
|
|
3052
3146
|
enabled: !0,
|
|
3053
3147
|
zoom: {
|
|
3054
3148
|
enabled: !1,
|
|
@@ -3082,25 +3176,25 @@ const W = {
|
|
|
3082
3176
|
easing: "easeOutCubic"
|
|
3083
3177
|
}
|
|
3084
3178
|
};
|
|
3085
|
-
function
|
|
3179
|
+
function Ve(i) {
|
|
3086
3180
|
return i ? {
|
|
3087
|
-
enabled: i.enabled ??
|
|
3088
|
-
zoom: { ...
|
|
3089
|
-
pan: { ...
|
|
3090
|
-
dataUpdate: { ...
|
|
3091
|
-
seriesEntry: { ...
|
|
3092
|
-
autoScale: { ...
|
|
3093
|
-
} : { ...
|
|
3094
|
-
}
|
|
3095
|
-
let
|
|
3096
|
-
function
|
|
3097
|
-
return
|
|
3181
|
+
enabled: i.enabled ?? N.enabled,
|
|
3182
|
+
zoom: { ...N.zoom, ...i.zoom },
|
|
3183
|
+
pan: { ...N.pan, ...i.pan },
|
|
3184
|
+
dataUpdate: { ...N.dataUpdate, ...i.dataUpdate },
|
|
3185
|
+
seriesEntry: { ...N.seriesEntry, ...i.seriesEntry },
|
|
3186
|
+
autoScale: { ...N.autoScale, ...i.autoScale }
|
|
3187
|
+
} : { ...N };
|
|
3188
|
+
}
|
|
3189
|
+
let Te = null;
|
|
3190
|
+
function us() {
|
|
3191
|
+
return Te || (Te = new st()), Te;
|
|
3098
3192
|
}
|
|
3099
3193
|
let G = null, j = null;
|
|
3100
|
-
function
|
|
3194
|
+
function Ti(i, e) {
|
|
3101
3195
|
const t = e.animate !== !1 && i.animationConfig.enabled && i.animationConfig.zoom.enabled;
|
|
3102
3196
|
G != null && G.isRunning() && G.cancel();
|
|
3103
|
-
const n =
|
|
3197
|
+
const n = ve(i.series.values()), s = e.x ? e.x[0] : i.viewBounds.xMin, o = e.x ? e.x[1] : i.viewBounds.xMax;
|
|
3104
3198
|
let r = e.y ? e.y[0] : i.viewBounds.yMin, a = e.y ? e.y[1] : i.viewBounds.yMax;
|
|
3105
3199
|
n && e.y && (r = 0);
|
|
3106
3200
|
const l = e.axisId;
|
|
@@ -3113,7 +3207,7 @@ function Mi(i, e) {
|
|
|
3113
3207
|
const c = i.viewBounds.yMax - i.viewBounds.yMin, f = a - r, u = c > 0 ? f / c : 1, g = c > 0 ? (r - i.viewBounds.yMin) / c : 0;
|
|
3114
3208
|
i.yScales.forEach((x, b) => {
|
|
3115
3209
|
if (b === i.primaryYAxisId) return;
|
|
3116
|
-
const
|
|
3210
|
+
const w = x.domain[1] - x.domain[0], p = n ? 0 : x.domain[0] + g * w, v = n ? x.domain[0] + u * w : p + u * w;
|
|
3117
3211
|
x.setDomain(p, v);
|
|
3118
3212
|
}), i.viewBounds.yMin = r, i.viewBounds.yMax = a;
|
|
3119
3213
|
const y = i.yScales.get(i.primaryYAxisId);
|
|
@@ -3143,8 +3237,8 @@ function Mi(i, e) {
|
|
|
3143
3237
|
if (u === i.primaryYAxisId)
|
|
3144
3238
|
f.setDomain(i.viewBounds.yMin, i.viewBounds.yMax);
|
|
3145
3239
|
else {
|
|
3146
|
-
const g = d.get(u), y = h.yMax - h.yMin, x = i.viewBounds.yMax - i.viewBounds.yMin, b = y > 0 ? x / y : 1,
|
|
3147
|
-
f.setDomain(v,
|
|
3240
|
+
const g = d.get(u), y = h.yMax - h.yMin, x = i.viewBounds.yMax - i.viewBounds.yMin, b = y > 0 ? x / y : 1, w = y > 0 ? (i.viewBounds.yMin - h.yMin) / y : 0, p = g[1] - g[0], v = g[0] + w * p, M = v + b * p;
|
|
3241
|
+
f.setDomain(v, M);
|
|
3148
3242
|
}
|
|
3149
3243
|
});
|
|
3150
3244
|
i.requestRender();
|
|
@@ -3157,78 +3251,78 @@ function Mi(i, e) {
|
|
|
3157
3251
|
}
|
|
3158
3252
|
}), G;
|
|
3159
3253
|
}
|
|
3160
|
-
function
|
|
3254
|
+
function Bi(i, e = !0) {
|
|
3161
3255
|
if (i.series.size === 0) return null;
|
|
3162
3256
|
let t = 1 / 0, n = -1 / 0;
|
|
3163
3257
|
const s = /* @__PURE__ */ new Map();
|
|
3164
|
-
i.yScales.forEach((
|
|
3258
|
+
i.yScales.forEach((w, p) => {
|
|
3165
3259
|
s.set(p, { min: 1 / 0, max: -1 / 0 });
|
|
3166
3260
|
});
|
|
3167
3261
|
let o = !1;
|
|
3168
|
-
if (i.series.forEach((
|
|
3169
|
-
if (!
|
|
3170
|
-
const p =
|
|
3262
|
+
if (i.series.forEach((w) => {
|
|
3263
|
+
if (!w.isVisible()) return;
|
|
3264
|
+
const p = w.getBounds();
|
|
3171
3265
|
if (p && isFinite(p.xMin) && isFinite(p.xMax) && isFinite(p.yMin) && isFinite(p.yMax)) {
|
|
3172
3266
|
t = Math.min(t, p.xMin), n = Math.max(n, p.xMax);
|
|
3173
|
-
const v =
|
|
3174
|
-
|
|
3267
|
+
const v = w.getYAxisId() || i.primaryYAxisId, M = s.get(v);
|
|
3268
|
+
M && (M.min = Math.min(M.min, p.yMin), M.max = Math.max(M.max, p.yMax)), o = !0;
|
|
3175
3269
|
}
|
|
3176
3270
|
}), !o) return null;
|
|
3177
3271
|
const r = 1e15, a = -1e15;
|
|
3178
3272
|
let l = i.viewBounds.xMin, h = i.viewBounds.xMax, d = i.viewBounds.yMin, c = i.viewBounds.yMax;
|
|
3179
3273
|
if (i.xAxisOptions.auto) {
|
|
3180
|
-
let
|
|
3181
|
-
(
|
|
3182
|
-
const p = Math.min(
|
|
3274
|
+
let w = n - t;
|
|
3275
|
+
(w <= 0 || !isFinite(w)) && (w = Math.abs(t) * 0.1 || 1);
|
|
3276
|
+
const p = Math.min(w * 5e-3, 1e10);
|
|
3183
3277
|
l = Math.max(a, t - p), h = Math.min(r, n + p);
|
|
3184
3278
|
}
|
|
3185
3279
|
const f = s.get(i.primaryYAxisId), u = i.yAxisOptionsMap.get(i.primaryYAxisId);
|
|
3186
3280
|
if (f && (u != null && u.auto) && f.min !== 1 / 0) {
|
|
3187
|
-
let
|
|
3188
|
-
(
|
|
3189
|
-
const p = Math.min(
|
|
3281
|
+
let w = f.max - f.min;
|
|
3282
|
+
(w <= 0 || !isFinite(w)) && (w = Math.abs(f.min) * 0.1 || 1);
|
|
3283
|
+
const p = Math.min(w * 5e-3, 1e10);
|
|
3190
3284
|
d = Math.max(a, f.min - p), c = Math.min(r, f.max + p);
|
|
3191
3285
|
}
|
|
3192
3286
|
const g = e && i.animationConfig.enabled && i.animationConfig.autoScale.enabled;
|
|
3193
3287
|
if (j != null && j.isRunning() && j.cancel(), !g)
|
|
3194
|
-
return i.viewBounds.xMin = l, i.viewBounds.xMax = h, i.viewBounds.yMin = d, i.viewBounds.yMax = c, i.yScales.forEach((
|
|
3195
|
-
const v = s.get(p),
|
|
3196
|
-
if (v && (
|
|
3197
|
-
let
|
|
3198
|
-
(
|
|
3199
|
-
const A = Math.min(
|
|
3200
|
-
|
|
3288
|
+
return i.viewBounds.xMin = l, i.viewBounds.xMax = h, i.viewBounds.yMin = d, i.viewBounds.yMax = c, i.yScales.forEach((w, p) => {
|
|
3289
|
+
const v = s.get(p), M = i.yAxisOptionsMap.get(p);
|
|
3290
|
+
if (v && (M != null && M.auto) && v.min !== 1 / 0) {
|
|
3291
|
+
let S = v.max - v.min;
|
|
3292
|
+
(S <= 0 || !isFinite(S)) && (S = Math.abs(v.min) * 0.1 || 1);
|
|
3293
|
+
const A = Math.min(S * 5e-3, 1e10);
|
|
3294
|
+
w.setDomain(
|
|
3201
3295
|
Math.max(a, v.min - A),
|
|
3202
3296
|
Math.min(r, v.max + A)
|
|
3203
3297
|
);
|
|
3204
3298
|
}
|
|
3205
3299
|
}), i.events.emit("autoScale", void 0), i.requestRender(), null;
|
|
3206
3300
|
const y = { ...i.viewBounds }, x = /* @__PURE__ */ new Map();
|
|
3207
|
-
i.yScales.forEach((
|
|
3208
|
-
x.set(p, [...
|
|
3301
|
+
i.yScales.forEach((w, p) => {
|
|
3302
|
+
x.set(p, [...w.domain]);
|
|
3209
3303
|
});
|
|
3210
3304
|
const b = /* @__PURE__ */ new Map();
|
|
3211
|
-
return i.yScales.forEach((
|
|
3212
|
-
const v = s.get(p),
|
|
3213
|
-
if (v && (
|
|
3214
|
-
let
|
|
3215
|
-
(
|
|
3216
|
-
const A = Math.min(
|
|
3305
|
+
return i.yScales.forEach((w, p) => {
|
|
3306
|
+
const v = s.get(p), M = i.yAxisOptionsMap.get(p);
|
|
3307
|
+
if (v && (M != null && M.auto) && v.min !== 1 / 0) {
|
|
3308
|
+
let S = v.max - v.min;
|
|
3309
|
+
(S <= 0 || !isFinite(S)) && (S = Math.abs(v.min) * 0.1 || 1);
|
|
3310
|
+
const A = Math.min(S * 5e-3, 1e10);
|
|
3217
3311
|
b.set(p, [
|
|
3218
3312
|
Math.max(a, v.min - A),
|
|
3219
3313
|
Math.min(r, v.max + A)
|
|
3220
3314
|
]);
|
|
3221
3315
|
} else
|
|
3222
|
-
b.set(p, [...
|
|
3316
|
+
b.set(p, [...w.domain]);
|
|
3223
3317
|
}), j = i.animationEngine.animate({
|
|
3224
3318
|
duration: i.animationConfig.autoScale.duration,
|
|
3225
3319
|
easing: i.animationConfig.autoScale.easing,
|
|
3226
|
-
onUpdate: (
|
|
3227
|
-
i.viewBounds.xMin = y.xMin + (l - y.xMin) *
|
|
3228
|
-
const
|
|
3320
|
+
onUpdate: (w) => {
|
|
3321
|
+
i.viewBounds.xMin = y.xMin + (l - y.xMin) * w, i.viewBounds.xMax = y.xMax + (h - y.xMax) * w, i.viewBounds.yMin = y.yMin + (d - y.yMin) * w, i.viewBounds.yMax = y.yMax + (c - y.yMax) * w, i.yScales.forEach((p, v) => {
|
|
3322
|
+
const M = x.get(v), S = b.get(v);
|
|
3229
3323
|
p.setDomain(
|
|
3230
|
-
|
|
3231
|
-
|
|
3324
|
+
M[0] + (S[0] - M[0]) * w,
|
|
3325
|
+
M[1] + (S[1] - M[1]) * w
|
|
3232
3326
|
);
|
|
3233
3327
|
}), i.requestRender();
|
|
3234
3328
|
},
|
|
@@ -3237,7 +3331,7 @@ function Ci(i, e = !0) {
|
|
|
3237
3331
|
}
|
|
3238
3332
|
}), j;
|
|
3239
3333
|
}
|
|
3240
|
-
function
|
|
3334
|
+
function Ii(i, e, t) {
|
|
3241
3335
|
const n = { ...i.viewBounds }, s = {
|
|
3242
3336
|
xMin: e.xMin ?? i.viewBounds.xMin,
|
|
3243
3337
|
xMax: e.xMax ?? i.viewBounds.xMax,
|
|
@@ -3260,7 +3354,7 @@ function Ai(i, e, t) {
|
|
|
3260
3354
|
}
|
|
3261
3355
|
});
|
|
3262
3356
|
}
|
|
3263
|
-
function
|
|
3357
|
+
function ot(i, e, t = "degrees") {
|
|
3264
3358
|
const n = Math.min(i.length, e.length), s = new Float32Array(n * 2), o = t === "degrees" ? Math.PI / 180 : 1;
|
|
3265
3359
|
for (let r = 0; r < n; r++) {
|
|
3266
3360
|
const a = i[r], l = e[r] * o;
|
|
@@ -3268,22 +3362,22 @@ function nt(i, e, t = "degrees") {
|
|
|
3268
3362
|
}
|
|
3269
3363
|
return s;
|
|
3270
3364
|
}
|
|
3271
|
-
function
|
|
3272
|
-
const n =
|
|
3365
|
+
function Ei(i, e = "degrees", t = !1) {
|
|
3366
|
+
const n = ot(i.r, i.theta, e);
|
|
3273
3367
|
if (!t)
|
|
3274
3368
|
return n;
|
|
3275
3369
|
const s = n.length / 2, o = new Float32Array((s + 1) * 2);
|
|
3276
3370
|
return o.set(n), o[s * 2] = n[0], o[s * 2 + 1] = n[1], o;
|
|
3277
3371
|
}
|
|
3278
|
-
function
|
|
3279
|
-
const n =
|
|
3372
|
+
function Ri(i, e = "degrees", t = !0) {
|
|
3373
|
+
const n = ot(i.r, i.theta, e), s = n.length / 2, o = t ? s : s - 1, r = new Float32Array(o * 3 * 2);
|
|
3280
3374
|
for (let a = 0; a < o; a++) {
|
|
3281
3375
|
const l = a * 6, h = a, d = (a + 1) % s;
|
|
3282
3376
|
r[l + 0] = 0, r[l + 1] = 0, r[l + 2] = n[h * 2], r[l + 3] = n[h * 2 + 1], r[l + 4] = n[d * 2], r[l + 5] = n[d * 2 + 1];
|
|
3283
3377
|
}
|
|
3284
3378
|
return r;
|
|
3285
3379
|
}
|
|
3286
|
-
function
|
|
3380
|
+
function Di(i) {
|
|
3287
3381
|
const e = Math.min(i.r.length, i.theta.length);
|
|
3288
3382
|
let t = 0;
|
|
3289
3383
|
for (let n = 0; n < e; n++)
|
|
@@ -3296,22 +3390,22 @@ function Bi(i) {
|
|
|
3296
3390
|
maxRadius: t
|
|
3297
3391
|
};
|
|
3298
3392
|
}
|
|
3299
|
-
function
|
|
3393
|
+
function Fi(i, e, t, n) {
|
|
3300
3394
|
if (i === "heatmap" && t) {
|
|
3301
3395
|
const { xValues: y, yValues: x } = t;
|
|
3302
|
-
let b = 1 / 0,
|
|
3303
|
-
for (let
|
|
3304
|
-
const
|
|
3305
|
-
|
|
3396
|
+
let b = 1 / 0, w = -1 / 0, p = 1 / 0, v = -1 / 0;
|
|
3397
|
+
for (let M = 0; M < y.length; M++) {
|
|
3398
|
+
const S = y[M];
|
|
3399
|
+
S < b && (b = S), S > w && (w = S);
|
|
3306
3400
|
}
|
|
3307
|
-
for (let
|
|
3308
|
-
const
|
|
3309
|
-
|
|
3401
|
+
for (let M = 0; M < x.length; M++) {
|
|
3402
|
+
const S = x[M];
|
|
3403
|
+
S < p && (p = S), S > v && (v = S);
|
|
3310
3404
|
}
|
|
3311
|
-
return b === 1 / 0 || p === 1 / 0 ? null : { xMin: b, xMax:
|
|
3405
|
+
return b === 1 / 0 || p === 1 / 0 ? null : { xMin: b, xMax: w, yMin: p, yMax: v };
|
|
3312
3406
|
}
|
|
3313
3407
|
if (i === "polar" && n)
|
|
3314
|
-
return
|
|
3408
|
+
return Di(n);
|
|
3315
3409
|
const { x: s, y: o, y2: r, open: a, high: l, low: h, close: d } = e;
|
|
3316
3410
|
if (s.length === 0) return null;
|
|
3317
3411
|
let c = 1 / 0, f = -1 / 0, u = 1 / 0, g = -1 / 0;
|
|
@@ -3321,19 +3415,19 @@ function Ti(i, e, t, n) {
|
|
|
3321
3415
|
x < c && (c = x), x > f && (f = x);
|
|
3322
3416
|
const b = [];
|
|
3323
3417
|
o.length > y && isFinite(o[y]) && b.push(o[y]), r && isFinite(r[y]) && b.push(r[y]), a && isFinite(a[y]) && b.push(a[y]), l && isFinite(l[y]) && b.push(l[y]), h && isFinite(h[y]) && b.push(h[y]), d && isFinite(d[y]) && b.push(d[y]);
|
|
3324
|
-
for (const
|
|
3325
|
-
|
|
3418
|
+
for (const w of b)
|
|
3419
|
+
w < u && (u = w), w > g && (g = w);
|
|
3326
3420
|
}
|
|
3327
3421
|
return c === 1 / 0 || u === 1 / 0 ? null : { xMin: c, xMax: f, yMin: u, yMax: g };
|
|
3328
3422
|
}
|
|
3329
|
-
function
|
|
3423
|
+
function k(i) {
|
|
3330
3424
|
return i ? i instanceof Float32Array || i instanceof Float64Array ? i : new Float32Array(i) : new Float32Array(0);
|
|
3331
3425
|
}
|
|
3332
|
-
function
|
|
3426
|
+
function W(i, e) {
|
|
3333
3427
|
const t = new i.constructor(i.length + e.length);
|
|
3334
3428
|
return t.set(i, 0), t.set(e, i.length), t;
|
|
3335
3429
|
}
|
|
3336
|
-
function
|
|
3430
|
+
function Li(i, e) {
|
|
3337
3431
|
const { x: t, y: n } = i, s = t.length;
|
|
3338
3432
|
if (s < e) return { ...i };
|
|
3339
3433
|
const o = new Float32Array(s), r = Math.floor(e / 2);
|
|
@@ -3345,7 +3439,7 @@ function Ii(i, e) {
|
|
|
3345
3439
|
}
|
|
3346
3440
|
return { x: t, y: o };
|
|
3347
3441
|
}
|
|
3348
|
-
function
|
|
3442
|
+
function zi(i, e) {
|
|
3349
3443
|
var s, o;
|
|
3350
3444
|
if (e < 0 || e >= i.x.length) return null;
|
|
3351
3445
|
if (i.yError && e < i.yError.length) {
|
|
@@ -3355,7 +3449,7 @@ function Ei(i, e) {
|
|
|
3355
3449
|
const t = ((s = i.yErrorMinus) == null ? void 0 : s[e]) ?? 0, n = ((o = i.yErrorPlus) == null ? void 0 : o[e]) ?? 0;
|
|
3356
3450
|
return t > 0 || n > 0 ? [t, n] : null;
|
|
3357
3451
|
}
|
|
3358
|
-
function
|
|
3452
|
+
function Oi(i, e) {
|
|
3359
3453
|
var s, o;
|
|
3360
3454
|
if (e < 0 || e >= i.x.length) return null;
|
|
3361
3455
|
if (i.xError && e < i.xError.length) {
|
|
@@ -3365,13 +3459,13 @@ function Ri(i, e) {
|
|
|
3365
3459
|
const t = ((s = i.xErrorMinus) == null ? void 0 : s[e]) ?? 0, n = ((o = i.xErrorPlus) == null ? void 0 : o[e]) ?? 0;
|
|
3366
3460
|
return t > 0 || n > 0 ? [t, n] : null;
|
|
3367
3461
|
}
|
|
3368
|
-
const
|
|
3462
|
+
const Yi = {
|
|
3369
3463
|
color: "#ff0055",
|
|
3370
3464
|
width: 1.5,
|
|
3371
3465
|
opacity: 1,
|
|
3372
3466
|
pointSize: 4
|
|
3373
3467
|
};
|
|
3374
|
-
class
|
|
3468
|
+
class $i {
|
|
3375
3469
|
constructor(e) {
|
|
3376
3470
|
m(this, "id");
|
|
3377
3471
|
m(this, "type");
|
|
@@ -3429,20 +3523,20 @@ class Di {
|
|
|
3429
3523
|
this.lastAppendCount = 0;
|
|
3430
3524
|
});
|
|
3431
3525
|
m(this, "hasErrorData", () => !!(this.data.yError || this.data.yErrorPlus || this.data.yErrorMinus || this.data.xError || this.data.xErrorPlus || this.data.xErrorMinus));
|
|
3432
|
-
m(this, "getYError", (e) =>
|
|
3433
|
-
m(this, "getXError", (e) =>
|
|
3526
|
+
m(this, "getYError", (e) => zi(this.data, e));
|
|
3527
|
+
m(this, "getXError", (e) => Oi(this.data, e));
|
|
3434
3528
|
if (this.id = e.id, this.name = e.name, this.type = e.type, this.yAxisId = e.yAxisId, this.visible = e.visible ?? !0, this.stackId = e.stackId, this.cycle = e.cycle, this.maxPoints = e.maxPoints, this.markers = e.markers ?? [], this.type === "heatmap") {
|
|
3435
3529
|
const t = e;
|
|
3436
3530
|
this.data = { x: new Float32Array(0), y: new Float32Array(0) }, this.heatmapData = {
|
|
3437
|
-
xValues:
|
|
3438
|
-
yValues:
|
|
3439
|
-
zValues:
|
|
3531
|
+
xValues: k(t.data.xValues),
|
|
3532
|
+
yValues: k(t.data.yValues),
|
|
3533
|
+
zValues: k(t.data.zValues)
|
|
3440
3534
|
}, this.heatmapStyle = t.style;
|
|
3441
3535
|
} else if (this.type === "polar") {
|
|
3442
3536
|
const t = e;
|
|
3443
3537
|
this.polarData = {
|
|
3444
|
-
r:
|
|
3445
|
-
theta:
|
|
3538
|
+
r: k(t.data.r),
|
|
3539
|
+
theta: k(t.data.theta)
|
|
3446
3540
|
}, this.data = { x: new Float32Array(0), y: new Float32Array(0) };
|
|
3447
3541
|
} else if (this.type === "gauge") {
|
|
3448
3542
|
const t = e;
|
|
@@ -3453,40 +3547,40 @@ class Di {
|
|
|
3453
3547
|
} else {
|
|
3454
3548
|
const t = e.data;
|
|
3455
3549
|
this.data = {
|
|
3456
|
-
x:
|
|
3457
|
-
y:
|
|
3458
|
-
yError: t != null && t.yError ?
|
|
3459
|
-
yErrorPlus: t != null && t.yErrorPlus ?
|
|
3460
|
-
yErrorMinus: t != null && t.yErrorMinus ?
|
|
3461
|
-
xError: t != null && t.xError ?
|
|
3462
|
-
xErrorPlus: t != null && t.xErrorPlus ?
|
|
3463
|
-
xErrorMinus: t != null && t.xErrorMinus ?
|
|
3464
|
-
y2: t != null && t.y2 ?
|
|
3465
|
-
open: t != null && t.open ?
|
|
3466
|
-
high: t != null && t.high ?
|
|
3467
|
-
low: t != null && t.low ?
|
|
3468
|
-
close: t != null && t.close ?
|
|
3469
|
-
median: t != null && t.median ?
|
|
3550
|
+
x: k(t == null ? void 0 : t.x),
|
|
3551
|
+
y: k(t == null ? void 0 : t.y),
|
|
3552
|
+
yError: t != null && t.yError ? k(t.yError) : void 0,
|
|
3553
|
+
yErrorPlus: t != null && t.yErrorPlus ? k(t.yErrorPlus) : void 0,
|
|
3554
|
+
yErrorMinus: t != null && t.yErrorMinus ? k(t.yErrorMinus) : void 0,
|
|
3555
|
+
xError: t != null && t.xError ? k(t.xError) : void 0,
|
|
3556
|
+
xErrorPlus: t != null && t.xErrorPlus ? k(t.xErrorPlus) : void 0,
|
|
3557
|
+
xErrorMinus: t != null && t.xErrorMinus ? k(t.xErrorMinus) : void 0,
|
|
3558
|
+
y2: t != null && t.y2 ? k(t.y2) : void 0,
|
|
3559
|
+
open: t != null && t.open ? k(t.open) : void 0,
|
|
3560
|
+
high: t != null && t.high ? k(t.high) : void 0,
|
|
3561
|
+
low: t != null && t.low ? k(t.low) : void 0,
|
|
3562
|
+
close: t != null && t.close ? k(t.close) : void 0,
|
|
3563
|
+
median: t != null && t.median ? k(t.median) : void 0
|
|
3470
3564
|
}, this.type === "candlestick" && this.data.close && this.data.y.length !== this.data.x.length && (this.data.y = this.data.close);
|
|
3471
3565
|
}
|
|
3472
|
-
this.style = { ...
|
|
3566
|
+
this.style = { ...Yi, ...e.style }, e.color && (this.style.color = e.color), e.width && (this.style.width = e.width), e.pointSize && (this.style.pointSize = e.pointSize);
|
|
3473
3567
|
}
|
|
3474
3568
|
getData() {
|
|
3475
|
-
return this.style.smoothing && this.style.smoothing > 0 ? ((this.smoothingNeedsUpdate || !this.smoothedData) && (this.smoothedData =
|
|
3569
|
+
return this.style.smoothing && this.style.smoothing > 0 ? ((this.smoothingNeedsUpdate || !this.smoothedData) && (this.smoothedData = Li(this.data, 5), this.smoothingNeedsUpdate = !1), this.smoothedData) : this.data;
|
|
3476
3570
|
}
|
|
3477
3571
|
getBounds() {
|
|
3478
|
-
return this.data.x.length === 0 && this.type !== "heatmap" && this.type !== "polar" && this.type !== "gauge" && this.type !== "sankey" ? null : (this.boundsNeedsUpdate && (this.cachedBounds =
|
|
3572
|
+
return this.data.x.length === 0 && this.type !== "heatmap" && this.type !== "polar" && this.type !== "gauge" && this.type !== "sankey" ? null : (this.boundsNeedsUpdate && (this.cachedBounds = Fi(this.type, this.data, this.heatmapData, this.polarData), this.boundsNeedsUpdate = !1), this.cachedBounds);
|
|
3479
3573
|
}
|
|
3480
3574
|
updateData(e) {
|
|
3481
3575
|
if (e) {
|
|
3482
3576
|
if (e.append) {
|
|
3483
|
-
const t =
|
|
3484
|
-
if (t.length > 0 && (this.data.x =
|
|
3577
|
+
const t = k(e.x), n = k(e.y);
|
|
3578
|
+
if (t.length > 0 && (this.data.x = W(this.data.x, t), this.data.y = W(this.data.y, n), e.y2 && (this.data.y2 = this.data.y2 ? W(this.data.y2, k(e.y2)) : k(e.y2)), e.open && (this.data.open = this.data.open ? W(this.data.open, k(e.open)) : k(e.open)), e.high && (this.data.high = this.data.high ? W(this.data.high, k(e.high)) : k(e.high)), e.low && (this.data.low = this.data.low ? W(this.data.low, k(e.low)) : k(e.low)), e.close && (this.data.close = this.data.close ? W(this.data.close, k(e.close)) : k(e.close)), e.median && (this.data.median = this.data.median ? W(this.data.median, k(e.median)) : k(e.median)), this.lastAppendCount += t.length, this.maxPoints && this.data.x.length > this.maxPoints)) {
|
|
3485
3579
|
const s = this.data.x.length - this.maxPoints;
|
|
3486
3580
|
this.data.x = this.data.x.slice(s), this.data.y = this.data.y.slice(s), this.data.y2 && (this.data.y2 = this.data.y2.slice(s)), this.data.open && (this.data.open = this.data.open.slice(s)), this.data.high && (this.data.high = this.data.high.slice(s)), this.data.low && (this.data.low = this.data.low.slice(s)), this.data.close && (this.data.close = this.data.close.slice(s)), this.lastAppendCount = 0;
|
|
3487
3581
|
}
|
|
3488
3582
|
} else
|
|
3489
|
-
e.x && (this.data.x =
|
|
3583
|
+
e.x && (this.data.x = k(e.x)), e.y && (this.data.y = k(e.y)), e.y2 && (this.data.y2 = k(e.y2)), e.open && (this.data.open = k(e.open)), e.high && (this.data.high = k(e.high)), e.low && (this.data.low = k(e.low)), e.close && (this.data.close = k(e.close)), e.median && (this.data.median = k(e.median)), this.type === "gauge" && e.value !== void 0 && (this.gaugeData = { ...this.gaugeData, ...e }), this.type === "sankey" && (e.nodes || e.links) && (this.sankeyData = { ...this.sankeyData, ...e }), this.lastAppendCount = 0;
|
|
3490
3584
|
this.boundsNeedsUpdate = !0, this.smoothingNeedsUpdate = !0, this._needsBufferUpdate = !0;
|
|
3491
3585
|
}
|
|
3492
3586
|
}
|
|
@@ -3522,7 +3616,7 @@ class Di {
|
|
|
3522
3616
|
this.data = { x: new Float32Array(0), y: new Float32Array(0) }, this.cachedBounds = null;
|
|
3523
3617
|
}
|
|
3524
3618
|
}
|
|
3525
|
-
function
|
|
3619
|
+
function _i(i, e, t) {
|
|
3526
3620
|
const n = Math.min(i.length, e.length), s = new Float32Array(n * 6 * 2), o = t * 0.5;
|
|
3527
3621
|
for (let r = 0; r < n; r++) {
|
|
3528
3622
|
const a = i[r], l = e[r], h = r * 12, d = a - o, c = a + o, f = 0, u = l;
|
|
@@ -3530,7 +3624,7 @@ function Li(i, e, t) {
|
|
|
3530
3624
|
}
|
|
3531
3625
|
return s;
|
|
3532
3626
|
}
|
|
3533
|
-
function
|
|
3627
|
+
function be(i) {
|
|
3534
3628
|
if (i.length < 2) return 1;
|
|
3535
3629
|
let e = 1 / 0;
|
|
3536
3630
|
for (let t = 1; t < i.length; t++) {
|
|
@@ -3539,7 +3633,7 @@ function me(i) {
|
|
|
3539
3633
|
}
|
|
3540
3634
|
return e === 1 / 0 ? 1 : e * 0.8;
|
|
3541
3635
|
}
|
|
3542
|
-
function
|
|
3636
|
+
function Vi(i, e, t) {
|
|
3543
3637
|
const n = i.length, s = e.length;
|
|
3544
3638
|
n * s > t.length && console.warn("[Heatmap] Z array is too small for the specified grid dimensions");
|
|
3545
3639
|
const o = (n - 1) * (s - 1), r = new Float32Array(o * 6 * 3);
|
|
@@ -3551,7 +3645,7 @@ function zi(i, e, t) {
|
|
|
3551
3645
|
}
|
|
3552
3646
|
return r;
|
|
3553
3647
|
}
|
|
3554
|
-
function
|
|
3648
|
+
function Xi(i = "viridis") {
|
|
3555
3649
|
const t = new Uint8Array(1024);
|
|
3556
3650
|
for (let n = 0; n < 256; n++) {
|
|
3557
3651
|
const s = n / 255;
|
|
@@ -3560,26 +3654,26 @@ function Oi(i = "viridis") {
|
|
|
3560
3654
|
}
|
|
3561
3655
|
return t;
|
|
3562
3656
|
}
|
|
3563
|
-
function
|
|
3657
|
+
function Wi(i, e, t, n, s, o, r = !1) {
|
|
3564
3658
|
const a = i.length, l = [], h = [], d = o / 2, f = o / 10 / 2;
|
|
3565
3659
|
for (let u = 0; u < a; u++) {
|
|
3566
3660
|
if (!Number.isFinite(i[u])) continue;
|
|
3567
3661
|
const g = s[u] >= e[u], y = g ? l : h, x = Math.max(e[u], s[u]), b = Math.min(e[u], s[u]);
|
|
3568
|
-
r && g ||
|
|
3662
|
+
r && g || Xe(y, i[u] - d, b, i[u] + d, x), Xe(y, i[u] - f, n[u], i[u] + f, t[u]);
|
|
3569
3663
|
}
|
|
3570
3664
|
return {
|
|
3571
3665
|
bullish: new Float32Array(l),
|
|
3572
3666
|
bearish: new Float32Array(h)
|
|
3573
3667
|
};
|
|
3574
3668
|
}
|
|
3575
|
-
function
|
|
3669
|
+
function Xe(i, e, t, n, s) {
|
|
3576
3670
|
i.push(e, t, n, t, e, s), i.push(n, t, n, s, e, s);
|
|
3577
3671
|
}
|
|
3578
3672
|
function ce(i, e) {
|
|
3579
3673
|
if (!i.renderer) return;
|
|
3580
3674
|
const t = e.getStackId();
|
|
3581
3675
|
if (t) {
|
|
3582
|
-
|
|
3676
|
+
Ui(i, t);
|
|
3583
3677
|
return;
|
|
3584
3678
|
}
|
|
3585
3679
|
const n = e.getData(), s = e.getType();
|
|
@@ -3587,16 +3681,16 @@ function ce(i, e) {
|
|
|
3587
3681
|
const o = e.getId();
|
|
3588
3682
|
if (s === "band" || s === "area") {
|
|
3589
3683
|
const r = s === "area" ? new Float32Array(n.x.length).fill(0) : n.y2 || new Float32Array(n.x.length).fill(0);
|
|
3590
|
-
i.renderer.createBuffer(o,
|
|
3684
|
+
i.renderer.createBuffer(o, et(n.x, n.y, r));
|
|
3591
3685
|
} else if (s === "bar") {
|
|
3592
|
-
const r = e.getStyle().barWidth ??
|
|
3593
|
-
i.renderer.createBuffer(o,
|
|
3686
|
+
const r = e.getStyle().barWidth ?? be(n.x);
|
|
3687
|
+
i.renderer.createBuffer(o, _i(n.x, n.y, r));
|
|
3594
3688
|
} else if (s === "heatmap")
|
|
3595
|
-
|
|
3689
|
+
Hi(i, e);
|
|
3596
3690
|
else if (s === "candlestick") {
|
|
3597
3691
|
const r = e.getData();
|
|
3598
3692
|
if (r.open && r.high && r.low && r.close) {
|
|
3599
|
-
const a = e.getStyle().barWidth ??
|
|
3693
|
+
const a = e.getStyle().barWidth ?? be(r.x), l = !!e.getStyle().hollow, { bullish: h, bearish: d } = Wi(
|
|
3600
3694
|
r.x,
|
|
3601
3695
|
r.open,
|
|
3602
3696
|
r.high,
|
|
@@ -3610,20 +3704,20 @@ function ce(i, e) {
|
|
|
3610
3704
|
} else if (s === "boxplot") {
|
|
3611
3705
|
const r = e.getData();
|
|
3612
3706
|
if (r.low && r.open && r.median && r.close && r.high) {
|
|
3613
|
-
const a = e.getStyle().barWidth ??
|
|
3707
|
+
const a = e.getStyle().barWidth ?? be(r.x), { lines: l, boxes: h } = _t(r.x, r.low, r.open, r.median, r.close, r.high, a);
|
|
3614
3708
|
i.renderer.createBuffer(`${o}_box_lines`, l), i.renderer.createBuffer(`${o}_box_faces`, h);
|
|
3615
3709
|
}
|
|
3616
3710
|
} else if (s === "waterfall") {
|
|
3617
|
-
const r = e.getData(), a = e.getStyle().barWidth ??
|
|
3711
|
+
const r = e.getData(), a = e.getStyle().barWidth ?? be(r.x), l = e.getStyle().isSubtotal, h = Vt(r.x, r.y, a, l);
|
|
3618
3712
|
i.renderer.createBuffer(`${o}_wf_positive`, h.positiveData), i.renderer.createBuffer(`${o}_wf_negative`, h.negativeData), i.renderer.createBuffer(`${o}_wf_subtotal`, h.subtotalData), i.renderer.createBuffer(`${o}_wf_connectors`, h.connectorData), e.waterfallCounts = {
|
|
3619
3713
|
positive: h.positiveCount,
|
|
3620
3714
|
negative: h.negativeCount,
|
|
3621
3715
|
subtotal: h.subtotalCount,
|
|
3622
3716
|
connectors: h.connectorData.length / 2
|
|
3623
3717
|
};
|
|
3624
|
-
} else s === "polar" ?
|
|
3718
|
+
} else s === "polar" ? Ni(i, e) : i.renderer.createBuffer(o, Ke(n.x, n.y));
|
|
3625
3719
|
if (e.hasErrorData()) {
|
|
3626
|
-
const r = e.getData(), a =
|
|
3720
|
+
const r = e.getData(), a = $t(
|
|
3627
3721
|
r.x,
|
|
3628
3722
|
r.y,
|
|
3629
3723
|
{ yError: r.yError, yErrorMinus: r.yErrorMinus, yErrorPlus: r.yErrorPlus },
|
|
@@ -3633,31 +3727,31 @@ function ce(i, e) {
|
|
|
3633
3727
|
}
|
|
3634
3728
|
if (s === "step" || s === "step+scatter") {
|
|
3635
3729
|
const r = e.getStyle().stepMode ?? "after";
|
|
3636
|
-
i.renderer.createBuffer(`${o}_step`,
|
|
3730
|
+
i.renderer.createBuffer(`${o}_step`, Yt(n.x, n.y, r));
|
|
3637
3731
|
}
|
|
3638
3732
|
e.resetLastAppendCount();
|
|
3639
3733
|
}
|
|
3640
|
-
function
|
|
3734
|
+
function Ni(i, e) {
|
|
3641
3735
|
const t = e.getPolarData();
|
|
3642
3736
|
if (!t || t.r.length === 0) return;
|
|
3643
3737
|
const n = e.getStyle(), s = n.angleMode || "degrees", o = n.closePath !== !1;
|
|
3644
3738
|
if (n.fill || !1) {
|
|
3645
|
-
const a =
|
|
3739
|
+
const a = Ri(t, s, o);
|
|
3646
3740
|
i.renderer.createBuffer(e.getId(), a);
|
|
3647
3741
|
} else {
|
|
3648
|
-
const a =
|
|
3742
|
+
const a = Ei(t, s, o);
|
|
3649
3743
|
i.renderer.createBuffer(e.getId(), a);
|
|
3650
3744
|
}
|
|
3651
3745
|
}
|
|
3652
|
-
function
|
|
3746
|
+
function Hi(i, e) {
|
|
3653
3747
|
var o;
|
|
3654
3748
|
const t = e.getHeatmapData(), n = e.getHeatmapStyle();
|
|
3655
3749
|
if (!t || t.xValues.length < 2) return;
|
|
3656
|
-
i.renderer.createBuffer(e.getId(),
|
|
3750
|
+
i.renderer.createBuffer(e.getId(), Vi(t.xValues, t.yValues, t.zValues));
|
|
3657
3751
|
const s = ((o = n == null ? void 0 : n.colorScale) == null ? void 0 : o.name) || "viridis";
|
|
3658
|
-
i.renderer.createColormapTexture(`${e.getId()}_colormap`,
|
|
3752
|
+
i.renderer.createColormapTexture(`${e.getId()}_colormap`, Xi(s));
|
|
3659
3753
|
}
|
|
3660
|
-
function
|
|
3754
|
+
function Ui(i, e) {
|
|
3661
3755
|
const t = Array.from(i.series.values()).filter((s) => s.getStackId() === e);
|
|
3662
3756
|
let n = null;
|
|
3663
3757
|
for (const s of t) {
|
|
@@ -3666,13 +3760,13 @@ function Vi(i, e) {
|
|
|
3666
3760
|
n || (n = new Float32Array(o.y.length).fill(0));
|
|
3667
3761
|
const r = new Float32Array(n);
|
|
3668
3762
|
for (let a = 0; a < o.y.length; a++) n[a] += o.y[a];
|
|
3669
|
-
i.renderer.createBuffer(s.getId(),
|
|
3763
|
+
i.renderer.createBuffer(s.getId(), et(o.x, n, r)), s.resetLastAppendCount();
|
|
3670
3764
|
}
|
|
3671
3765
|
}
|
|
3672
|
-
function
|
|
3766
|
+
function H(i) {
|
|
3673
3767
|
return i instanceof Float32Array || i instanceof Float64Array ? i : Float32Array.from(i);
|
|
3674
3768
|
}
|
|
3675
|
-
function
|
|
3769
|
+
function qi(i) {
|
|
3676
3770
|
const e = new Float32Array(i.length), t = new Float32Array(i.length);
|
|
3677
3771
|
for (let n = 0; n < i.length; n++) {
|
|
3678
3772
|
const s = i[n];
|
|
@@ -3680,13 +3774,13 @@ function Xi(i) {
|
|
|
3680
3774
|
}
|
|
3681
3775
|
return { positive: e, negative: t };
|
|
3682
3776
|
}
|
|
3683
|
-
function
|
|
3777
|
+
function Gi(i, e, t) {
|
|
3684
3778
|
if (i === void 0 || i === "zero") return 0;
|
|
3685
3779
|
if (typeof i == "number") return i;
|
|
3686
3780
|
const n = t.find((o) => o.id === i);
|
|
3687
|
-
return n ?
|
|
3781
|
+
return n ? H(n.y)[e] ?? 0 : 0;
|
|
3688
3782
|
}
|
|
3689
|
-
function
|
|
3783
|
+
function ji(i, e, t, n, s) {
|
|
3690
3784
|
const o = i.length;
|
|
3691
3785
|
if (o === 0) return [];
|
|
3692
3786
|
if (o === 1) {
|
|
@@ -3707,16 +3801,16 @@ function Ni(i, e, t, n, s) {
|
|
|
3707
3801
|
h(i[c], e[c], l(c));
|
|
3708
3802
|
continue;
|
|
3709
3803
|
}
|
|
3710
|
-
const
|
|
3711
|
-
h(v,
|
|
3804
|
+
const w = u - f - (y - g), p = Math.max(0, Math.min(1, (g - f) / w)), v = i[c - 1] + p * (i[c] - i[c - 1]), M = f + p * (u - f), S = x ? n : s, A = b ? n : s;
|
|
3805
|
+
h(v, M, S), d(), h(v, M, A), h(i[c], e[c], l(c));
|
|
3712
3806
|
}
|
|
3713
3807
|
return d(), r;
|
|
3714
3808
|
}
|
|
3715
|
-
function
|
|
3716
|
-
const l = s.colorZones, d =
|
|
3809
|
+
function Zi(i, e, t, n, s, o, r, a) {
|
|
3810
|
+
const l = s.colorZones, d = ji(
|
|
3717
3811
|
t,
|
|
3718
3812
|
n,
|
|
3719
|
-
(c) =>
|
|
3813
|
+
(c) => Gi(l.ref, c, o),
|
|
3720
3814
|
l.aboveColor,
|
|
3721
3815
|
l.belowColor
|
|
3722
3816
|
);
|
|
@@ -3738,7 +3832,7 @@ function Hi(i, e, t, n, s, o, r, a) {
|
|
|
3738
3832
|
});
|
|
3739
3833
|
}
|
|
3740
3834
|
}
|
|
3741
|
-
const
|
|
3835
|
+
const Qi = {
|
|
3742
3836
|
baselineColor: "rgba(255,255,255,0.35)",
|
|
3743
3837
|
baselineWidth: 1,
|
|
3744
3838
|
baselineDash: [4, 4],
|
|
@@ -3747,9 +3841,9 @@ const Ui = {
|
|
|
3747
3841
|
peakSize: 6,
|
|
3748
3842
|
troughSize: 6
|
|
3749
3843
|
};
|
|
3750
|
-
function
|
|
3844
|
+
function Me(i) {
|
|
3751
3845
|
var h, d, c, f;
|
|
3752
|
-
const { id: e, data: t, style: n = {}, visible: s = !0 } = i, o = { ...
|
|
3846
|
+
const { id: e, data: t, style: n = {}, visible: s = !0 } = i, o = { ...Qi, ...n }, r = H(t.x), a = r.length, l = [];
|
|
3753
3847
|
if ((h = t.fills) != null && h.length)
|
|
3754
3848
|
for (let u = 0; u < t.fills.length; u++) {
|
|
3755
3849
|
const g = t.fills[u], y = g.id ?? `${e}-fill-${u}`;
|
|
@@ -3759,8 +3853,8 @@ function Se(i) {
|
|
|
3759
3853
|
visible: s,
|
|
3760
3854
|
data: {
|
|
3761
3855
|
x: r,
|
|
3762
|
-
y:
|
|
3763
|
-
y2:
|
|
3856
|
+
y: H(g.upper),
|
|
3857
|
+
y2: H(g.lower)
|
|
3764
3858
|
},
|
|
3765
3859
|
style: {
|
|
3766
3860
|
color: g.color ?? "rgba(100, 80, 180, 0.25)",
|
|
@@ -3769,7 +3863,7 @@ function Se(i) {
|
|
|
3769
3863
|
});
|
|
3770
3864
|
}
|
|
3771
3865
|
if (t.histogram) {
|
|
3772
|
-
const u =
|
|
3866
|
+
const u = H(t.histogram.y), { positive: g, negative: y } = qi(u), x = t.histogram.barWidth, b = x !== void 0 ? { barWidth: x } : {};
|
|
3773
3867
|
l.push({
|
|
3774
3868
|
id: `${e}-hist-pos`,
|
|
3775
3869
|
type: "bar",
|
|
@@ -3794,9 +3888,9 @@ function Se(i) {
|
|
|
3794
3888
|
}
|
|
3795
3889
|
if ((d = t.lines) != null && d.length)
|
|
3796
3890
|
for (let u = 0; u < t.lines.length; u++) {
|
|
3797
|
-
const g = t.lines[u], y = g.id ?? `${e}-line-${u}`, x =
|
|
3891
|
+
const g = t.lines[u], y = g.id ?? `${e}-line-${u}`, x = H(g.y);
|
|
3798
3892
|
if (g.colorZones) {
|
|
3799
|
-
|
|
3893
|
+
Zi(l, y, r, x, g, t.lines, s, "zone");
|
|
3800
3894
|
continue;
|
|
3801
3895
|
}
|
|
3802
3896
|
l.push({
|
|
@@ -3880,11 +3974,11 @@ function Se(i) {
|
|
|
3880
3974
|
}
|
|
3881
3975
|
return l;
|
|
3882
3976
|
}
|
|
3883
|
-
function
|
|
3884
|
-
return
|
|
3977
|
+
function ds(i) {
|
|
3978
|
+
return Me(i);
|
|
3885
3979
|
}
|
|
3886
|
-
function
|
|
3887
|
-
const n =
|
|
3980
|
+
function fs(i, e, t = 3) {
|
|
3981
|
+
const n = H(i), s = H(e), o = [], r = Math.max(1, t);
|
|
3888
3982
|
for (let a = r; a < s.length - r; a++) {
|
|
3889
3983
|
let l = !0, h = !0;
|
|
3890
3984
|
for (let d = a - r; d <= a + r; d++)
|
|
@@ -3893,7 +3987,7 @@ function ls(i, e, t = 3) {
|
|
|
3893
3987
|
}
|
|
3894
3988
|
return o;
|
|
3895
3989
|
}
|
|
3896
|
-
function
|
|
3990
|
+
function Ji(i) {
|
|
3897
3991
|
const e = i.close.length, t = new Float32Array(e), n = new Float32Array(e), s = new Float32Array(e), o = new Float32Array(e);
|
|
3898
3992
|
for (let r = 0; r < e; r++) {
|
|
3899
3993
|
const a = i.open[r], l = i.high[r], h = i.low[r], d = i.close[r];
|
|
@@ -3901,7 +3995,7 @@ function qi(i) {
|
|
|
3901
3995
|
}
|
|
3902
3996
|
return { open: t, high: n, low: s, close: o };
|
|
3903
3997
|
}
|
|
3904
|
-
function
|
|
3998
|
+
function Ki(i, e) {
|
|
3905
3999
|
var n, s;
|
|
3906
4000
|
if (e.type === "heatmap" || e.type === "indicator")
|
|
3907
4001
|
return e;
|
|
@@ -3909,7 +4003,7 @@ function Gi(i, e) {
|
|
|
3909
4003
|
if (t.type === "heikin-ashi") {
|
|
3910
4004
|
const o = t.data;
|
|
3911
4005
|
if (o != null && o.open && o.high && o.low && o.close) {
|
|
3912
|
-
const r =
|
|
4006
|
+
const r = Ji({
|
|
3913
4007
|
open: o.open,
|
|
3914
4008
|
high: o.high,
|
|
3915
4009
|
low: o.low,
|
|
@@ -3922,8 +4016,8 @@ function Gi(i, e) {
|
|
|
3922
4016
|
};
|
|
3923
4017
|
}
|
|
3924
4018
|
}
|
|
3925
|
-
if (
|
|
3926
|
-
const { displayX: o, mapping: r } =
|
|
4019
|
+
if (Qe(i.xAxisOptions) && ((s = (n = t.data) == null ? void 0 : n.x) != null && s.length)) {
|
|
4020
|
+
const { displayX: o, mapping: r } = Je(t.data.x, i.xAxisOptions);
|
|
3927
4021
|
i.timeScaleMapping = r, t = {
|
|
3928
4022
|
...t,
|
|
3929
4023
|
data: { ...t.data, x: o }
|
|
@@ -3931,64 +4025,72 @@ function Gi(i, e) {
|
|
|
3931
4025
|
}
|
|
3932
4026
|
return t;
|
|
3933
4027
|
}
|
|
3934
|
-
function
|
|
3935
|
-
return i.type === "indicator" ?
|
|
4028
|
+
function en(i) {
|
|
4029
|
+
return i.type === "indicator" ? Me(i) : [i];
|
|
3936
4030
|
}
|
|
3937
|
-
function
|
|
3938
|
-
for (const t of
|
|
3939
|
-
|
|
4031
|
+
function tn(i, e) {
|
|
4032
|
+
for (const t of en(e))
|
|
4033
|
+
nn(i, t);
|
|
3940
4034
|
}
|
|
3941
|
-
function
|
|
4035
|
+
function nn(i, e) {
|
|
3942
4036
|
var s, o;
|
|
3943
|
-
const t =
|
|
4037
|
+
const t = Ki(i, e);
|
|
3944
4038
|
if (t.type !== "heatmap" && !((s = t.style) != null && s.color) && !t.color && i.colorScheme) {
|
|
3945
4039
|
const r = i.series.size, a = i.colorScheme.colors[r % i.colorScheme.colors.length];
|
|
3946
4040
|
t.style || (t.style = {}), t.style.color = a;
|
|
3947
4041
|
}
|
|
3948
|
-
const n = new
|
|
4042
|
+
const n = new $i(t);
|
|
3949
4043
|
i.series.set(n.getId(), n), ce(i, n), (i.xAxisOptions.auto || Array.from(i.yAxisOptionsMap.values()).some((r) => r.auto)) && i.autoScale(!1), (o = i.updateLegend) == null || o.call(i), i.requestRender();
|
|
3950
4044
|
}
|
|
3951
|
-
function
|
|
4045
|
+
function sn(i, e) {
|
|
3952
4046
|
var n;
|
|
3953
4047
|
const t = i.series.get(e);
|
|
3954
4048
|
t && (i.renderer.deleteBuffer(e), i.renderer.deleteBuffer(`${e}_step`), t.destroy(), i.series.delete(e), (n = i.updateLegend) == null || n.call(i), i.requestRender());
|
|
3955
4049
|
}
|
|
3956
|
-
function
|
|
4050
|
+
function on(i, e, t) {
|
|
4051
|
+
var a;
|
|
3957
4052
|
const n = i.series.get(e);
|
|
3958
|
-
if (n)
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
4053
|
+
if (!n) return;
|
|
4054
|
+
const s = !!t.append, o = s ? ((a = n.getBounds()) == null ? void 0 : a.xMax) ?? -1 / 0 : -1 / 0;
|
|
4055
|
+
let r = t;
|
|
4056
|
+
if (t.x && Qe(i.xAxisOptions)) {
|
|
4057
|
+
const { displayX: l, mapping: h } = Je(t.x, i.xAxisOptions);
|
|
4058
|
+
i.timeScaleMapping = h, r = { ...t, x: l };
|
|
4059
|
+
}
|
|
4060
|
+
n.updateData(r), ce(i, n), s && rt(i, n, o), i.requestRender();
|
|
4061
|
+
}
|
|
4062
|
+
function rt(i, e, t) {
|
|
4063
|
+
if (i.autoScrollEnabled) {
|
|
4064
|
+
const n = e.getBounds();
|
|
4065
|
+
if (n) {
|
|
4066
|
+
const s = i.viewBounds.xMax - i.viewBounds.xMin;
|
|
4067
|
+
if (t >= i.viewBounds.xMax - Math.max(s * 0.05, 1e-9)) {
|
|
4068
|
+
const o = s > 0 ? s : Math.max(n.xMax - n.xMin, 1);
|
|
4069
|
+
i.viewBounds.xMax = n.xMax, i.viewBounds.xMin = i.viewBounds.xMax - o;
|
|
4070
|
+
}
|
|
4071
|
+
}
|
|
4072
|
+
Array.from(i.yAxisOptionsMap.values()).some((s) => s.auto) && i.autoScaleYOnly();
|
|
4073
|
+
return;
|
|
4074
|
+
}
|
|
4075
|
+
if (Array.from(i.yAxisOptionsMap.values()).some((n) => n.auto) && i.autoScaleYOnly(), i.xAxisOptions.auto) {
|
|
4076
|
+
const n = e.getBounds();
|
|
4077
|
+
if (n) {
|
|
4078
|
+
const s = i.viewBounds.xMax - i.viewBounds.xMin, o = n.xMax - n.xMin;
|
|
4079
|
+
if (n.xMax > i.viewBounds.xMax || n.xMin < i.viewBounds.xMin || s > 0 && Math.abs(o - s) / s > 0.1) {
|
|
4080
|
+
const r = Math.min(o * 5e-3, 1e10);
|
|
4081
|
+
i.viewBounds.xMin = Math.max(-1e15, n.xMin - r), i.viewBounds.xMax = Math.min(1e15, n.xMax + r);
|
|
4082
|
+
}
|
|
3963
4083
|
}
|
|
3964
|
-
n.updateData(s), ce(i, n), i.requestRender();
|
|
3965
4084
|
}
|
|
3966
4085
|
}
|
|
3967
|
-
function
|
|
4086
|
+
function rn(i, e, t, n) {
|
|
3968
4087
|
var r;
|
|
3969
4088
|
const s = i.series.get(e);
|
|
3970
4089
|
if (!s) return;
|
|
3971
4090
|
const o = ((r = s.getBounds()) == null ? void 0 : r.xMax) ?? -1 / 0;
|
|
3972
|
-
|
|
3973
|
-
const a = s.getBounds();
|
|
3974
|
-
if (a) {
|
|
3975
|
-
const l = i.viewBounds.xMax - i.viewBounds.xMin;
|
|
3976
|
-
o >= i.viewBounds.xMax - l * 0.05 && (i.viewBounds.xMax = a.xMax, i.viewBounds.xMin = i.viewBounds.xMax - l);
|
|
3977
|
-
}
|
|
3978
|
-
Array.from(i.yAxisOptionsMap.values()).some((l) => l.auto) && i.autoScaleYOnly();
|
|
3979
|
-
} else if (Array.from(i.yAxisOptionsMap.values()).some((a) => a.auto) && i.autoScaleYOnly(), i.xAxisOptions.auto) {
|
|
3980
|
-
const a = s.getBounds();
|
|
3981
|
-
if (a) {
|
|
3982
|
-
const l = i.viewBounds.xMax - i.viewBounds.xMin, h = a.xMax - a.xMin;
|
|
3983
|
-
if (a.xMax > i.viewBounds.xMax || a.xMin < i.viewBounds.xMin || Math.abs(h - l) / l > 0.1) {
|
|
3984
|
-
const d = Math.min(h * 5e-3, 1e10);
|
|
3985
|
-
i.viewBounds.xMin = Math.max(-1e15, a.xMin - d), i.viewBounds.xMax = Math.min(1e15, a.xMax + d);
|
|
3986
|
-
}
|
|
3987
|
-
}
|
|
3988
|
-
}
|
|
3989
|
-
i.requestRender();
|
|
4091
|
+
s.updateData({ x: t, y: n, append: !0 }), ce(i, s), rt(i, s, o), i.requestRender();
|
|
3990
4092
|
}
|
|
3991
|
-
function
|
|
4093
|
+
function an(i, e, t) {
|
|
3992
4094
|
const n = i.series.get(e);
|
|
3993
4095
|
n && (n.setMaxPoints(t), i.requestRender());
|
|
3994
4096
|
}
|
|
@@ -4023,7 +4125,7 @@ class te {
|
|
|
4023
4125
|
ticks(e = 10) {
|
|
4024
4126
|
const [t, n] = this.domain;
|
|
4025
4127
|
if (!isFinite(t) || !isFinite(n) || t === n) return [];
|
|
4026
|
-
const s =
|
|
4128
|
+
const s = ln(t, n, e), o = Math.ceil(t / s) * s, r = [], a = 100;
|
|
4027
4129
|
let l = o;
|
|
4028
4130
|
for (; l <= n + s * 0.5 && r.length < a; )
|
|
4029
4131
|
r.push(Math.round(l * 1e12) / 1e12), l += s;
|
|
@@ -4067,14 +4169,14 @@ class ie {
|
|
|
4067
4169
|
return r;
|
|
4068
4170
|
}
|
|
4069
4171
|
}
|
|
4070
|
-
function
|
|
4172
|
+
function ln(i, e, t) {
|
|
4071
4173
|
const n = e - i;
|
|
4072
4174
|
if (n <= 0 || !isFinite(n)) return 1;
|
|
4073
4175
|
const s = n / t, o = Math.pow(10, Math.floor(Math.log10(s))), r = s / o;
|
|
4074
4176
|
let a;
|
|
4075
4177
|
return r < 1.5 ? a = 1 : r < 3 ? a = 2 : r < 7 ? a = 5 : a = 10, a * o;
|
|
4076
4178
|
}
|
|
4077
|
-
function
|
|
4179
|
+
function gs(i) {
|
|
4078
4180
|
return i === "log" ? new ie() : new te();
|
|
4079
4181
|
}
|
|
4080
4182
|
const O = {
|
|
@@ -4143,7 +4245,7 @@ const O = {
|
|
|
4143
4245
|
},
|
|
4144
4246
|
autoMargins: !0
|
|
4145
4247
|
};
|
|
4146
|
-
function
|
|
4248
|
+
function at(i) {
|
|
4147
4249
|
var e;
|
|
4148
4250
|
return i ? {
|
|
4149
4251
|
title: { ...O.title, ...i.title },
|
|
@@ -4164,23 +4266,23 @@ function st(i) {
|
|
|
4164
4266
|
autoMargins: i.autoMargins ?? O.autoMargins
|
|
4165
4267
|
} : { ...O };
|
|
4166
4268
|
}
|
|
4167
|
-
function
|
|
4168
|
-
var
|
|
4169
|
-
if (!i) throw new Error("[
|
|
4170
|
-
const t = e.devicePixelRatio ?? window.devicePixelRatio, n =
|
|
4269
|
+
function hn(i, e) {
|
|
4270
|
+
var S;
|
|
4271
|
+
if (!i) throw new Error("[VeloPlot] Container element is required");
|
|
4272
|
+
const t = e.devicePixelRatio ?? window.devicePixelRatio, n = at(e.layout), s = typeof e.theme == "string" ? it(e.theme) : e.theme ?? ri, o = _(e.background ?? s.backgroundColor), r = [o[0], o[1], o[2], o[3]], a = _(s.plotAreaBackground), l = [a[0], a[1], a[2], a[3]], h = e.showLegend ?? s.legend.visible, d = ((S = e.toolbar) == null ? void 0 : S.show) ?? e.showControls ?? !1, c = e.autoScroll ?? !1, f = e.showStatistics ?? !1, u = { scale: "linear", auto: !0, ...e.xAxis }, g = u.scale === "log" ? new ie() : new te(), y = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
|
|
4171
4273
|
let b = "default";
|
|
4172
|
-
(e.yAxis ? Array.isArray(e.yAxis) ? e.yAxis : [e.yAxis] : [{}]).forEach((A,
|
|
4173
|
-
const
|
|
4174
|
-
|
|
4175
|
-
const U = { scale: "linear", auto: !0, position: A.position || (
|
|
4274
|
+
(e.yAxis ? Array.isArray(e.yAxis) ? e.yAxis : [e.yAxis] : [{}]).forEach((A, P) => {
|
|
4275
|
+
const T = P === 0, D = T ? "default" : `y${P}`, I = A.id || D;
|
|
4276
|
+
T && (b = I);
|
|
4277
|
+
const U = { scale: "linear", auto: !0, position: A.position || (T ? "left" : "right"), ...A, id: I };
|
|
4176
4278
|
y.set(I, U), x.set(I, U.scale === "log" ? new ie() : new te());
|
|
4177
|
-
}), i.style.position = "relative", i.style.overflow = "hidden", i.style.backgroundColor = e.background ?? s.backgroundColor;
|
|
4178
|
-
const p =
|
|
4279
|
+
}), i.style.position !== "absolute" && (i.style.position = "relative"), i.style.overflow = "hidden", i.style.backgroundColor = e.background ?? s.backgroundColor;
|
|
4280
|
+
const p = We("webgl"), v = We("overlay");
|
|
4179
4281
|
for (; i.firstChild; )
|
|
4180
4282
|
i.removeChild(i.firstChild);
|
|
4181
4283
|
i.appendChild(p), i.appendChild(v);
|
|
4182
|
-
const
|
|
4183
|
-
if (!
|
|
4284
|
+
const M = v.getContext("2d");
|
|
4285
|
+
if (!M) throw new Error("Failed to get 2D context");
|
|
4184
4286
|
return {
|
|
4185
4287
|
theme: s,
|
|
4186
4288
|
backgroundColor: r,
|
|
@@ -4197,15 +4299,15 @@ function sn(i, e) {
|
|
|
4197
4299
|
primaryYAxisId: b,
|
|
4198
4300
|
webglCanvas: p,
|
|
4199
4301
|
overlayCanvas: v,
|
|
4200
|
-
overlayCtx:
|
|
4302
|
+
overlayCtx: M,
|
|
4201
4303
|
layout: n
|
|
4202
4304
|
};
|
|
4203
4305
|
}
|
|
4204
|
-
function
|
|
4306
|
+
function We(i) {
|
|
4205
4307
|
const e = document.createElement("canvas");
|
|
4206
4308
|
return e.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;", i === "overlay" && (e.style.pointerEvents = "none"), e;
|
|
4207
4309
|
}
|
|
4208
|
-
function
|
|
4310
|
+
function cn(i, e, t) {
|
|
4209
4311
|
const n = i.getBoundingClientRect(), s = Array.from(e.values()).filter((c) => c.position !== "right").length, o = Array.from(e.values()).filter((c) => c.position === "right").length, r = (t == null ? void 0 : t.margins) || ae, a = (r.left ?? ae.left) + Math.max(0, s - 1) * 65, l = (r.right ?? ae.right) + o * 65, h = r.top ?? ae.top, d = r.bottom ?? ae.bottom;
|
|
4210
4312
|
return {
|
|
4211
4313
|
x: a,
|
|
@@ -4214,7 +4316,7 @@ function on(i, e, t) {
|
|
|
4214
4316
|
height: Math.max(1, n.height - h - d)
|
|
4215
4317
|
};
|
|
4216
4318
|
}
|
|
4217
|
-
function
|
|
4319
|
+
function un(i) {
|
|
4218
4320
|
const e = [];
|
|
4219
4321
|
let t = 0, n = 0;
|
|
4220
4322
|
return i.forEach((s, o) => {
|
|
@@ -4222,13 +4324,13 @@ function rn(i) {
|
|
|
4222
4324
|
r === "left" ? t++ : n++, e.push({ id: o, position: r, offset: a });
|
|
4223
4325
|
}), e;
|
|
4224
4326
|
}
|
|
4225
|
-
function
|
|
4327
|
+
function dn(i, e, t, n, s) {
|
|
4226
4328
|
const o = i.getBoundingClientRect();
|
|
4227
4329
|
if (o.width === 0 || o.height === 0) return !1;
|
|
4228
4330
|
const r = Math.max(1, Math.round(o.width * s)), a = Math.max(1, Math.round(o.height * s)), l = `${Math.round(o.width)}px`, h = `${Math.round(o.height)}px`, d = e.width !== r || e.height !== a || e.style.width !== l || e.style.height !== h, c = t.width !== r || t.height !== a;
|
|
4229
4331
|
return !d && !c ? (n.setTransform(s, 0, 0, s, 0, 0), n.imageSmoothingEnabled = !0, "imageSmoothingQuality" in n && (n.imageSmoothingQuality = "high"), !1) : (d && (e.width = r, e.height = a, e.style.width = l, e.style.height = h), c && (t.width = r, t.height = a), t.style.width = l, t.style.height = h, n.setTransform(s, 0, 0, s, 0, 0), n.imageSmoothingEnabled = !0, "imageSmoothingQuality" in n && (n.imageSmoothingQuality = "high"), !0);
|
|
4230
4332
|
}
|
|
4231
|
-
class
|
|
4333
|
+
class fn {
|
|
4232
4334
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4233
4335
|
constructor(e) {
|
|
4234
4336
|
m(this, "data", /* @__PURE__ */ new Map());
|
|
@@ -4262,11 +4364,11 @@ class ln {
|
|
|
4262
4364
|
});
|
|
4263
4365
|
}
|
|
4264
4366
|
}
|
|
4265
|
-
class
|
|
4367
|
+
class gn {
|
|
4266
4368
|
constructor(e, t = !0) {
|
|
4267
4369
|
m(this, "prefix");
|
|
4268
4370
|
m(this, "enabled");
|
|
4269
|
-
this.prefix = `[
|
|
4371
|
+
this.prefix = `[VeloPlot:${e}]`, this.enabled = t;
|
|
4270
4372
|
}
|
|
4271
4373
|
debug(e, ...t) {
|
|
4272
4374
|
this.enabled && console.debug(this.prefix, e, ...t);
|
|
@@ -4281,7 +4383,7 @@ class hn {
|
|
|
4281
4383
|
console.error(this.prefix, e, ...t);
|
|
4282
4384
|
}
|
|
4283
4385
|
}
|
|
4284
|
-
class
|
|
4386
|
+
class yn {
|
|
4285
4387
|
constructor(e) {
|
|
4286
4388
|
m(this, "chart");
|
|
4287
4389
|
m(this, "subscriptions", []);
|
|
@@ -4305,7 +4407,7 @@ class cn {
|
|
|
4305
4407
|
try {
|
|
4306
4408
|
s(t);
|
|
4307
4409
|
} catch (o) {
|
|
4308
|
-
console.error(`[
|
|
4410
|
+
console.error(`[VeloPlot] Error in plugin event handler for "${e}":`, o);
|
|
4309
4411
|
}
|
|
4310
4412
|
});
|
|
4311
4413
|
}
|
|
@@ -4320,7 +4422,7 @@ class cn {
|
|
|
4320
4422
|
this.subscriptions.forEach((e) => e()), this.subscriptions = [], this.customListeners.clear();
|
|
4321
4423
|
}
|
|
4322
4424
|
}
|
|
4323
|
-
class
|
|
4425
|
+
class mn {
|
|
4324
4426
|
constructor(e, t) {
|
|
4325
4427
|
m(this, "_container");
|
|
4326
4428
|
m(this, "_theme");
|
|
@@ -4407,8 +4509,8 @@ class un {
|
|
|
4407
4509
|
this.overlays.forEach((t) => t.remove()), this.overlays.clear(), (e = this.notifications) == null || e.remove(), this.notifications = null;
|
|
4408
4510
|
}
|
|
4409
4511
|
}
|
|
4410
|
-
function
|
|
4411
|
-
const t = new
|
|
4512
|
+
function pn(i, e) {
|
|
4513
|
+
const t = new fn(i), n = new gn(i), s = new yn(e.chart), o = new mn(e.container, e.theme), r = {
|
|
4412
4514
|
get gl() {
|
|
4413
4515
|
var c;
|
|
4414
4516
|
return (c = e.getGL) == null ? void 0 : c.call(e);
|
|
@@ -4479,7 +4581,7 @@ function dn(i, e) {
|
|
|
4479
4581
|
}
|
|
4480
4582
|
};
|
|
4481
4583
|
}
|
|
4482
|
-
class
|
|
4584
|
+
class xn {
|
|
4483
4585
|
constructor(e) {
|
|
4484
4586
|
m(this, "plugins", /* @__PURE__ */ new Map());
|
|
4485
4587
|
m(this, "deps");
|
|
@@ -4507,22 +4609,22 @@ class fn {
|
|
|
4507
4609
|
async use(e, t) {
|
|
4508
4610
|
var l;
|
|
4509
4611
|
if (this.destroyed) {
|
|
4510
|
-
console.warn("[
|
|
4612
|
+
console.warn("[VeloPlot] Cannot add plugin to destroyed manager");
|
|
4511
4613
|
return;
|
|
4512
4614
|
}
|
|
4513
4615
|
const n = typeof e == "function" ? e(t) : e, s = n.manifest.name;
|
|
4514
4616
|
if (this.plugins.has(s)) {
|
|
4515
|
-
console.warn(`[
|
|
4617
|
+
console.warn(`[VeloPlot] Plugin "${s}" is already registered`);
|
|
4516
4618
|
return;
|
|
4517
4619
|
}
|
|
4518
4620
|
const o = await this.checkDependencies(n.manifest);
|
|
4519
4621
|
if (o.length > 0) {
|
|
4520
4622
|
console.error(
|
|
4521
|
-
`[
|
|
4623
|
+
`[VeloPlot] Plugin "${s}" requires plugins: ${o.join(", ")}`
|
|
4522
4624
|
);
|
|
4523
4625
|
return;
|
|
4524
4626
|
}
|
|
4525
|
-
const r =
|
|
4627
|
+
const r = pn(s, {
|
|
4526
4628
|
...this.deps,
|
|
4527
4629
|
getPlugin: (h) => this.get(h)
|
|
4528
4630
|
}), a = {
|
|
@@ -4536,7 +4638,7 @@ class fn {
|
|
|
4536
4638
|
const h = (l = n.onInit) == null ? void 0 : l.call(n, r, t);
|
|
4537
4639
|
h instanceof Promise && await h, a.initialized = !0;
|
|
4538
4640
|
} catch (h) {
|
|
4539
|
-
console.error(`[
|
|
4641
|
+
console.error(`[VeloPlot] Failed to initialize plugin "${s}":`, h), this.plugins.delete(s), r._cleanup();
|
|
4540
4642
|
return;
|
|
4541
4643
|
}
|
|
4542
4644
|
this.rebuildHookCaches();
|
|
@@ -4552,12 +4654,12 @@ class fn {
|
|
|
4552
4654
|
const n = this.findDependents(e);
|
|
4553
4655
|
if (n.length > 0)
|
|
4554
4656
|
return console.warn(
|
|
4555
|
-
`[
|
|
4657
|
+
`[VeloPlot] Cannot remove plugin "${e}", required by: ${n.join(", ")}`
|
|
4556
4658
|
), !1;
|
|
4557
4659
|
try {
|
|
4558
4660
|
(o = (s = t.plugin).onDestroy) == null || o.call(s, t.context);
|
|
4559
4661
|
} catch (r) {
|
|
4560
|
-
console.error(`[
|
|
4662
|
+
console.error(`[VeloPlot] Error destroying plugin "${e}":`, r);
|
|
4561
4663
|
}
|
|
4562
4664
|
return t.context._cleanup(), this.plugins.delete(e), this.rebuildHookCaches(), !0;
|
|
4563
4665
|
}
|
|
@@ -4593,7 +4695,7 @@ class fn {
|
|
|
4593
4695
|
var o, r;
|
|
4594
4696
|
const n = this.plugins.get(e);
|
|
4595
4697
|
if (!n) {
|
|
4596
|
-
console.warn(`[
|
|
4698
|
+
console.warn(`[VeloPlot] Plugin "${e}" not found`);
|
|
4597
4699
|
return;
|
|
4598
4700
|
}
|
|
4599
4701
|
const s = n.config;
|
|
@@ -4606,7 +4708,7 @@ class fn {
|
|
|
4606
4708
|
s
|
|
4607
4709
|
);
|
|
4608
4710
|
} catch (a) {
|
|
4609
|
-
console.error(`[
|
|
4711
|
+
console.error(`[VeloPlot] Error in plugin "${e}" config change:`, a);
|
|
4610
4712
|
}
|
|
4611
4713
|
}
|
|
4612
4714
|
/**
|
|
@@ -4620,7 +4722,7 @@ class fn {
|
|
|
4620
4722
|
s.call(n.plugin, n.context, ...t);
|
|
4621
4723
|
} catch (o) {
|
|
4622
4724
|
console.error(
|
|
4623
|
-
`[
|
|
4725
|
+
`[VeloPlot] Error in plugin "${n.plugin.manifest.name}" hook "${e}":`,
|
|
4624
4726
|
o
|
|
4625
4727
|
);
|
|
4626
4728
|
}
|
|
@@ -4640,7 +4742,7 @@ class fn {
|
|
|
4640
4742
|
return !1;
|
|
4641
4743
|
} catch (n) {
|
|
4642
4744
|
console.error(
|
|
4643
|
-
`[
|
|
4745
|
+
`[VeloPlot] Error in plugin "${t.plugin.manifest.name}" beforeRender:`,
|
|
4644
4746
|
n
|
|
4645
4747
|
);
|
|
4646
4748
|
}
|
|
@@ -4655,7 +4757,7 @@ class fn {
|
|
|
4655
4757
|
t.plugin.onAfterRender(t.context, e);
|
|
4656
4758
|
} catch (n) {
|
|
4657
4759
|
console.error(
|
|
4658
|
-
`[
|
|
4760
|
+
`[VeloPlot] Error in plugin "${t.plugin.manifest.name}" afterRender:`,
|
|
4659
4761
|
n
|
|
4660
4762
|
);
|
|
4661
4763
|
}
|
|
@@ -4669,7 +4771,7 @@ class fn {
|
|
|
4669
4771
|
t.plugin.onRenderWebGL(t.context, e);
|
|
4670
4772
|
} catch (n) {
|
|
4671
4773
|
console.error(
|
|
4672
|
-
`[
|
|
4774
|
+
`[VeloPlot] Error in plugin "${t.plugin.manifest.name}" renderWebGL:`,
|
|
4673
4775
|
n
|
|
4674
4776
|
);
|
|
4675
4777
|
}
|
|
@@ -4683,7 +4785,7 @@ class fn {
|
|
|
4683
4785
|
t.plugin.onRenderOverlay(t.context, e);
|
|
4684
4786
|
} catch (n) {
|
|
4685
4787
|
console.error(
|
|
4686
|
-
`[
|
|
4788
|
+
`[VeloPlot] Error in plugin "${t.plugin.manifest.name}" renderOverlay:`,
|
|
4687
4789
|
n
|
|
4688
4790
|
);
|
|
4689
4791
|
}
|
|
@@ -4699,7 +4801,7 @@ class fn {
|
|
|
4699
4801
|
return !1;
|
|
4700
4802
|
} catch (n) {
|
|
4701
4803
|
console.error(
|
|
4702
|
-
`[
|
|
4804
|
+
`[VeloPlot] Error in plugin "${t.plugin.manifest.name}" interaction:`,
|
|
4703
4805
|
n
|
|
4704
4806
|
);
|
|
4705
4807
|
}
|
|
@@ -4714,7 +4816,7 @@ class fn {
|
|
|
4714
4816
|
t.plugin.onViewChange(t.context, e);
|
|
4715
4817
|
} catch (n) {
|
|
4716
4818
|
console.error(
|
|
4717
|
-
`[
|
|
4819
|
+
`[VeloPlot] Error in plugin "${t.plugin.manifest.name}" viewChange:`,
|
|
4718
4820
|
n
|
|
4719
4821
|
);
|
|
4720
4822
|
}
|
|
@@ -4728,7 +4830,7 @@ class fn {
|
|
|
4728
4830
|
t.plugin.onDataUpdate(t.context, e);
|
|
4729
4831
|
} catch (n) {
|
|
4730
4832
|
console.error(
|
|
4731
|
-
`[
|
|
4833
|
+
`[VeloPlot] Error in plugin "${t.plugin.manifest.name}" dataUpdate:`,
|
|
4732
4834
|
n
|
|
4733
4835
|
);
|
|
4734
4836
|
}
|
|
@@ -4742,7 +4844,7 @@ class fn {
|
|
|
4742
4844
|
t.plugin.onSeriesAdd(t.context, e);
|
|
4743
4845
|
} catch (n) {
|
|
4744
4846
|
console.error(
|
|
4745
|
-
`[
|
|
4847
|
+
`[VeloPlot] Error in plugin "${t.plugin.manifest.name}" seriesAdd:`,
|
|
4746
4848
|
n
|
|
4747
4849
|
);
|
|
4748
4850
|
}
|
|
@@ -4756,7 +4858,7 @@ class fn {
|
|
|
4756
4858
|
t.plugin.onSeriesRemove(t.context, e);
|
|
4757
4859
|
} catch (n) {
|
|
4758
4860
|
console.error(
|
|
4759
|
-
`[
|
|
4861
|
+
`[VeloPlot] Error in plugin "${t.plugin.manifest.name}" seriesRemove:`,
|
|
4760
4862
|
n
|
|
4761
4863
|
);
|
|
4762
4864
|
}
|
|
@@ -4770,7 +4872,7 @@ class fn {
|
|
|
4770
4872
|
t.plugin.onSeriesChange(t.context, e);
|
|
4771
4873
|
} catch (n) {
|
|
4772
4874
|
console.error(
|
|
4773
|
-
`[
|
|
4875
|
+
`[VeloPlot] Error in plugin "${t.plugin.manifest.name}" seriesChange:`,
|
|
4774
4876
|
n
|
|
4775
4877
|
);
|
|
4776
4878
|
}
|
|
@@ -4784,7 +4886,7 @@ class fn {
|
|
|
4784
4886
|
t.plugin.onResize(t.context, e);
|
|
4785
4887
|
} catch (n) {
|
|
4786
4888
|
console.error(
|
|
4787
|
-
`[
|
|
4889
|
+
`[VeloPlot] Error in plugin "${t.plugin.manifest.name}" resize:`,
|
|
4788
4890
|
n
|
|
4789
4891
|
);
|
|
4790
4892
|
}
|
|
@@ -4801,7 +4903,7 @@ class fn {
|
|
|
4801
4903
|
s.plugin.onThemeChange(s.context, e);
|
|
4802
4904
|
} catch (o) {
|
|
4803
4905
|
console.error(
|
|
4804
|
-
`[
|
|
4906
|
+
`[VeloPlot] Error in plugin "${s.plugin.manifest.name}" themeChange:`,
|
|
4805
4907
|
o
|
|
4806
4908
|
);
|
|
4807
4909
|
}
|
|
@@ -4815,7 +4917,7 @@ class fn {
|
|
|
4815
4917
|
t.plugin.onSelectionChange(t.context, e);
|
|
4816
4918
|
} catch (n) {
|
|
4817
4919
|
console.error(
|
|
4818
|
-
`[
|
|
4920
|
+
`[VeloPlot] Error in plugin "${t.plugin.manifest.name}" selectionChange:`,
|
|
4819
4921
|
n
|
|
4820
4922
|
);
|
|
4821
4923
|
}
|
|
@@ -4834,7 +4936,7 @@ class fn {
|
|
|
4834
4936
|
});
|
|
4835
4937
|
} catch (n) {
|
|
4836
4938
|
console.error(
|
|
4837
|
-
`[
|
|
4939
|
+
`[VeloPlot] Error in plugin "${t.plugin.manifest.name}" serialize:`,
|
|
4838
4940
|
n
|
|
4839
4941
|
);
|
|
4840
4942
|
}
|
|
@@ -4853,7 +4955,7 @@ class fn {
|
|
|
4853
4955
|
s.plugin.onDeserialize(s.context, o);
|
|
4854
4956
|
} catch (a) {
|
|
4855
4957
|
console.error(
|
|
4856
|
-
`[
|
|
4958
|
+
`[VeloPlot] Error in plugin "${t}" deserialize:`,
|
|
4857
4959
|
a
|
|
4858
4960
|
);
|
|
4859
4961
|
}
|
|
@@ -4871,7 +4973,7 @@ class fn {
|
|
|
4871
4973
|
try {
|
|
4872
4974
|
(n = (t = o.plugin).onDestroy) == null || n.call(t, o.context);
|
|
4873
4975
|
} catch (r) {
|
|
4874
|
-
console.error(`[
|
|
4976
|
+
console.error(`[VeloPlot] Error destroying plugin "${s}":`, r);
|
|
4875
4977
|
}
|
|
4876
4978
|
o.context._cleanup();
|
|
4877
4979
|
}
|
|
@@ -4918,7 +5020,7 @@ const E = {
|
|
|
4918
5020
|
PIN: '<svg viewBox="0 0 24 24" width="11" height="11" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="17" x2="12" y2="22"></line><path d="M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6a3 3 0 0 0-6 0v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V17z"></path></svg>',
|
|
4919
5021
|
PIN_OFF: '<svg viewBox="0 0 24 24" width="11" height="11" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><line x1="2" y1="2" x2="22" y2="22"></line><line x1="12" y1="17" x2="12" y2="22"></line><path d="M9 10.76V6a3 3 0 0 1 1.43-2.54m2.68.74A3 3 0 0 1 15 6v4.76a2 2 0 0 0 1.11 1.79l1.78.9A2 2 0 0 1 19 15.24V17h-2"></path><path d="M5 17h8"></path></svg>'
|
|
4920
5022
|
};
|
|
4921
|
-
class
|
|
5023
|
+
class bn {
|
|
4922
5024
|
constructor(e, t, n, s) {
|
|
4923
5025
|
m(this, "container");
|
|
4924
5026
|
m(this, "toolbar");
|
|
@@ -5133,7 +5235,7 @@ class gn {
|
|
|
5133
5235
|
this.container.remove();
|
|
5134
5236
|
}
|
|
5135
5237
|
}
|
|
5136
|
-
class
|
|
5238
|
+
class vn {
|
|
5137
5239
|
constructor(e, t, n, s) {
|
|
5138
5240
|
m(this, "container");
|
|
5139
5241
|
m(this, "visualContainer");
|
|
@@ -5312,8 +5414,8 @@ class yn {
|
|
|
5312
5414
|
else if (b)
|
|
5313
5415
|
r.globalAlpha = 0.6, r.fillRect(0, o * 0.2, o, o * 0.6), r.globalAlpha = 1, r.strokeRect(0, o * 0.2, o, o * 0.6);
|
|
5314
5416
|
else if (g === "candlestick") {
|
|
5315
|
-
const
|
|
5316
|
-
r.fillStyle =
|
|
5417
|
+
const w = a.bullishColor || "#26a69a";
|
|
5418
|
+
r.fillStyle = w, r.fillRect(o * 0.3, o * 0.2, o * 0.4, o * 0.6), r.beginPath(), r.moveTo(o * 0.5, 0), r.lineTo(o * 0.5, o), r.strokeStyle = w, r.stroke();
|
|
5317
5419
|
} else
|
|
5318
5420
|
r.beginPath(), r.moveTo(0, u), r.lineTo(o, u), r.stroke();
|
|
5319
5421
|
}
|
|
@@ -5366,10 +5468,10 @@ class yn {
|
|
|
5366
5468
|
e.fillStyle = f ? n.backgroundColor : "rgba(255, 255, 255, 0.85)", e.strokeStyle = n.borderColor, e.lineWidth = 1 * t;
|
|
5367
5469
|
const u = n.borderRadius * t;
|
|
5368
5470
|
e.beginPath(), e.moveTo(l + u, h), e.lineTo(l + d - u, h), e.arcTo(l + d, h, l + d, h + u, u), e.lineTo(l + d, h + c - u), e.arcTo(l + d, h + c, l + d - u, h + c, u), e.lineTo(l + u, h + c), e.arcTo(l, h + c, l, h + c - u, u), e.lineTo(l, h + u), e.arcTo(l, h, l + u, h, u), e.closePath(), e.fill(), e.stroke(), e.textAlign = "left", e.textBaseline = "middle", e.font = `${n.fontSize * t}px ${n.fontFamily}`, this.series.forEach((g, y) => {
|
|
5369
|
-
const x = h + a + s + y * (r + o) + r / 2, b = l + s + r / 2,
|
|
5471
|
+
const x = h + a + s + y * (r + o) + r / 2, b = l + s + r / 2, w = x, p = g.getStyle(), v = g.getType(), M = p.symbol || "circle";
|
|
5370
5472
|
e.fillStyle = p.color || "#ff0055", e.strokeStyle = p.color || "#ff0055", e.lineWidth = 2 * t;
|
|
5371
|
-
const
|
|
5372
|
-
A ? this.drawSymbol(e,
|
|
5473
|
+
const S = String(v).toLowerCase(), A = S === "scatter" || S === "1" || S === "line" && !!p.symbol, P = S.includes("scatter") || S === "2";
|
|
5474
|
+
A ? this.drawSymbol(e, M, b, w, r * 0.9) : P ? (e.beginPath(), e.moveTo(l + s, w), e.lineTo(l + s + r, w), e.stroke(), this.drawSymbol(e, M, b, w, r * 0.6)) : (e.beginPath(), e.moveTo(l + s, w), e.lineTo(l + s + r, w), e.stroke()), e.fillStyle = n.textColor, e.fillText(g.getName(), l + s + r + 8 * t, x);
|
|
5373
5475
|
}), e.restore();
|
|
5374
5476
|
}
|
|
5375
5477
|
updateTheme(e) {
|
|
@@ -5385,8 +5487,8 @@ class yn {
|
|
|
5385
5487
|
this.container.remove();
|
|
5386
5488
|
}
|
|
5387
5489
|
}
|
|
5388
|
-
function
|
|
5389
|
-
return i.showControls ? new
|
|
5490
|
+
function wn(i) {
|
|
5491
|
+
return i.showControls ? new bn(i.container, i.theme, {
|
|
5390
5492
|
onResetZoom: () => i.resetZoom(),
|
|
5391
5493
|
onSetType: (e) => {
|
|
5392
5494
|
i.series.forEach((t) => {
|
|
@@ -5425,14 +5527,14 @@ function mn(i) {
|
|
|
5425
5527
|
}
|
|
5426
5528
|
}, i.toolbar) : null;
|
|
5427
5529
|
}
|
|
5428
|
-
function
|
|
5530
|
+
function Mn(i, e) {
|
|
5429
5531
|
var s, o, r, a, l, h;
|
|
5430
5532
|
if (!i.showLegend) return null;
|
|
5431
5533
|
const t = {
|
|
5432
5534
|
...e.legendPosition,
|
|
5433
5535
|
highlightOnHover: ((s = i.legendOptions) == null ? void 0 : s.highlightOnHover) ?? ((r = (o = e.layout) == null ? void 0 : o.legend) == null ? void 0 : r.highlightOnHover) ?? !1,
|
|
5434
5536
|
bringToFrontOnHover: ((a = i.legendOptions) == null ? void 0 : a.bringToFrontOnHover) ?? ((h = (l = e.layout) == null ? void 0 : l.legend) == null ? void 0 : h.bringToFrontOnHover) ?? !0
|
|
5435
|
-
}, n = new
|
|
5537
|
+
}, n = new vn(
|
|
5436
5538
|
i.container,
|
|
5437
5539
|
i.theme,
|
|
5438
5540
|
t,
|
|
@@ -5470,7 +5572,7 @@ function pn(i, e) {
|
|
|
5470
5572
|
);
|
|
5471
5573
|
return n.update(Array.from(i.series.values())), n;
|
|
5472
5574
|
}
|
|
5473
|
-
class
|
|
5575
|
+
class Sn {
|
|
5474
5576
|
constructor() {
|
|
5475
5577
|
m(this, "queue", []);
|
|
5476
5578
|
m(this, "isProcessing", !1);
|
|
@@ -5542,17 +5644,17 @@ class xn {
|
|
|
5542
5644
|
this.clear(), this.completedCount = 0, this.idCounter = 0;
|
|
5543
5645
|
}
|
|
5544
5646
|
}
|
|
5545
|
-
const
|
|
5546
|
-
function
|
|
5547
|
-
return
|
|
5647
|
+
const Q = new Sn();
|
|
5648
|
+
function Cn() {
|
|
5649
|
+
return Q.enqueue();
|
|
5548
5650
|
}
|
|
5549
|
-
function
|
|
5550
|
-
|
|
5651
|
+
function Ee(i) {
|
|
5652
|
+
Q.markComplete(i);
|
|
5551
5653
|
}
|
|
5552
|
-
function
|
|
5553
|
-
return
|
|
5654
|
+
function ys() {
|
|
5655
|
+
return Q.getStatus();
|
|
5554
5656
|
}
|
|
5555
|
-
class
|
|
5657
|
+
class An {
|
|
5556
5658
|
static getStatus() {
|
|
5557
5659
|
return this.instance.getStatus();
|
|
5558
5660
|
}
|
|
@@ -5560,23 +5662,23 @@ class vn {
|
|
|
5560
5662
|
this.instance.reset();
|
|
5561
5663
|
}
|
|
5562
5664
|
}
|
|
5563
|
-
m(
|
|
5564
|
-
function
|
|
5665
|
+
m(An, "instance", Q);
|
|
5666
|
+
function ms() {
|
|
5565
5667
|
return {
|
|
5566
|
-
getStatus: () =>
|
|
5567
|
-
reset: () =>
|
|
5668
|
+
getStatus: () => Q.getStatus(),
|
|
5669
|
+
reset: () => Q.reset()
|
|
5568
5670
|
};
|
|
5569
5671
|
}
|
|
5570
|
-
async function
|
|
5672
|
+
async function ps(i, e) {
|
|
5571
5673
|
await e();
|
|
5572
5674
|
}
|
|
5573
|
-
function
|
|
5675
|
+
function xs(i = 200) {
|
|
5574
5676
|
return new Promise((e) => setTimeout(e, i));
|
|
5575
5677
|
}
|
|
5576
|
-
function
|
|
5577
|
-
|
|
5678
|
+
function bs() {
|
|
5679
|
+
Q.reset();
|
|
5578
5680
|
}
|
|
5579
|
-
class
|
|
5681
|
+
class kn {
|
|
5580
5682
|
constructor(e) {
|
|
5581
5683
|
this.pluginManager = e;
|
|
5582
5684
|
}
|
|
@@ -5710,7 +5812,7 @@ class Sn {
|
|
|
5710
5812
|
return this.pluginManager.getNames();
|
|
5711
5813
|
}
|
|
5712
5814
|
}
|
|
5713
|
-
class
|
|
5815
|
+
class Pn {
|
|
5714
5816
|
constructor(e) {
|
|
5715
5817
|
this.ctx = e;
|
|
5716
5818
|
}
|
|
@@ -5724,7 +5826,7 @@ class wn {
|
|
|
5724
5826
|
addYAxis(e) {
|
|
5725
5827
|
const t = Array.from(this.ctx.yAxisOptionsMap.keys()), n = e.id || `y${t.length}`;
|
|
5726
5828
|
if (this.ctx.yAxisOptionsMap.has(n))
|
|
5727
|
-
return console.warn(`[
|
|
5829
|
+
return console.warn(`[VeloPlot] Y axis with id '${n}' already exists`), n;
|
|
5728
5830
|
const o = {
|
|
5729
5831
|
scale: "linear",
|
|
5730
5832
|
auto: !0,
|
|
@@ -5740,7 +5842,7 @@ class wn {
|
|
|
5740
5842
|
* Remove a Y axis by ID
|
|
5741
5843
|
*/
|
|
5742
5844
|
removeYAxis(e) {
|
|
5743
|
-
return e === this.ctx.primaryYAxisId ? (console.warn(`[
|
|
5845
|
+
return e === this.ctx.primaryYAxisId ? (console.warn(`[VeloPlot] Cannot remove primary Y axis '${e}'`), !1) : this.ctx.yAxisOptionsMap.has(e) ? (this.ctx.yAxisOptionsMap.delete(e), this.ctx.yScales.delete(e), this.ctx.series.forEach((t) => {
|
|
5744
5846
|
t.getYAxisId() === e && t.setYAxisId(this.ctx.primaryYAxisId);
|
|
5745
5847
|
}), this.ctx.requestRender(), !0) : !1;
|
|
5746
5848
|
}
|
|
@@ -5750,7 +5852,7 @@ class wn {
|
|
|
5750
5852
|
updateYAxis(e, t) {
|
|
5751
5853
|
const n = this.ctx.yAxisOptionsMap.get(e);
|
|
5752
5854
|
if (!n) {
|
|
5753
|
-
console.warn(`[
|
|
5855
|
+
console.warn(`[VeloPlot] Y axis '${e}' not found`);
|
|
5754
5856
|
return;
|
|
5755
5857
|
}
|
|
5756
5858
|
const s = { ...n, ...t, id: e };
|
|
@@ -5815,21 +5917,21 @@ class wn {
|
|
|
5815
5917
|
return this.ctx.yScales;
|
|
5816
5918
|
}
|
|
5817
5919
|
}
|
|
5818
|
-
const
|
|
5819
|
-
function
|
|
5920
|
+
const lt = 1;
|
|
5921
|
+
function Ne(i) {
|
|
5820
5922
|
const e = i instanceof Float32Array ? i : new Float32Array(i), t = new Uint8Array(e.buffer);
|
|
5821
5923
|
let n = "";
|
|
5822
5924
|
for (let s = 0; s < t.length; s++)
|
|
5823
5925
|
n += String.fromCharCode(t[s]);
|
|
5824
5926
|
return btoa(n);
|
|
5825
5927
|
}
|
|
5826
|
-
function
|
|
5928
|
+
function He(i) {
|
|
5827
5929
|
const e = atob(i), t = new Uint8Array(e.length);
|
|
5828
5930
|
for (let n = 0; n < e.length; n++)
|
|
5829
5931
|
t[n] = e.charCodeAt(n);
|
|
5830
5932
|
return new Float32Array(t.buffer);
|
|
5831
5933
|
}
|
|
5832
|
-
function
|
|
5934
|
+
function Tn(i) {
|
|
5833
5935
|
try {
|
|
5834
5936
|
new TextEncoder().encode(i);
|
|
5835
5937
|
let t = "";
|
|
@@ -5844,7 +5946,7 @@ function Mn(i) {
|
|
|
5844
5946
|
return btoa(i);
|
|
5845
5947
|
}
|
|
5846
5948
|
}
|
|
5847
|
-
function
|
|
5949
|
+
function Bn(i) {
|
|
5848
5950
|
try {
|
|
5849
5951
|
const e = atob(i);
|
|
5850
5952
|
let t = "";
|
|
@@ -5859,24 +5961,24 @@ function Cn(i) {
|
|
|
5859
5961
|
return atob(i);
|
|
5860
5962
|
}
|
|
5861
5963
|
}
|
|
5862
|
-
function
|
|
5964
|
+
function In(i, e = !0) {
|
|
5863
5965
|
const t = JSON.stringify(i);
|
|
5864
|
-
return e ?
|
|
5966
|
+
return e ? Tn(t) : btoa(t);
|
|
5865
5967
|
}
|
|
5866
|
-
function
|
|
5968
|
+
function En(i, e = !0) {
|
|
5867
5969
|
try {
|
|
5868
|
-
const t = e ?
|
|
5869
|
-
return typeof n.version != "number" ? (console.warn("[
|
|
5970
|
+
const t = e ? Bn(i) : atob(i), n = JSON.parse(t);
|
|
5971
|
+
return typeof n.version != "number" ? (console.warn("[VeloPlot] Invalid state: missing version"), null) : (n.version > lt && console.warn("[VeloPlot] State version is newer than supported"), n);
|
|
5870
5972
|
} catch (t) {
|
|
5871
|
-
return console.error("[
|
|
5973
|
+
return console.error("[VeloPlot] Failed to parse URL hash:", t), null;
|
|
5872
5974
|
}
|
|
5873
5975
|
}
|
|
5874
|
-
function
|
|
5976
|
+
function vs(i) {
|
|
5875
5977
|
if (!i || typeof i != "object") return !1;
|
|
5876
5978
|
const e = i;
|
|
5877
5979
|
return !(typeof e.version != "number" || !e.viewBounds || typeof e.viewBounds != "object" || !Array.isArray(e.series));
|
|
5878
5980
|
}
|
|
5879
|
-
class
|
|
5981
|
+
class ws {
|
|
5880
5982
|
constructor(e = 50) {
|
|
5881
5983
|
m(this, "history", []);
|
|
5882
5984
|
m(this, "currentIndex", -1);
|
|
@@ -5932,7 +6034,7 @@ class ms {
|
|
|
5932
6034
|
return this.history.length;
|
|
5933
6035
|
}
|
|
5934
6036
|
}
|
|
5935
|
-
class
|
|
6037
|
+
class Rn {
|
|
5936
6038
|
constructor(e) {
|
|
5937
6039
|
this.ctx = e;
|
|
5938
6040
|
}
|
|
@@ -5946,7 +6048,7 @@ class kn {
|
|
|
5946
6048
|
serialize(e = {}) {
|
|
5947
6049
|
const { includeData: t = !0, includeAnnotations: n = !0 } = e;
|
|
5948
6050
|
return {
|
|
5949
|
-
version:
|
|
6051
|
+
version: lt,
|
|
5950
6052
|
timestamp: Date.now(),
|
|
5951
6053
|
viewBounds: { ...this.ctx.viewBounds },
|
|
5952
6054
|
xAxis: {
|
|
@@ -5981,8 +6083,8 @@ class kn {
|
|
|
5981
6083
|
style: o.getStyle(),
|
|
5982
6084
|
visible: o.isVisible(),
|
|
5983
6085
|
data: t ? {
|
|
5984
|
-
x:
|
|
5985
|
-
y:
|
|
6086
|
+
x: Ne(o.getData().x),
|
|
6087
|
+
y: Ne(o.getData().y)
|
|
5986
6088
|
} : { x: "", y: "" }
|
|
5987
6089
|
})),
|
|
5988
6090
|
annotations: n ? this.ctx.getAnnotations() : [],
|
|
@@ -6025,8 +6127,8 @@ class kn {
|
|
|
6025
6127
|
type: r.type,
|
|
6026
6128
|
yAxisId: r.yAxisId,
|
|
6027
6129
|
data: {
|
|
6028
|
-
x:
|
|
6029
|
-
y:
|
|
6130
|
+
x: He(r.data.x),
|
|
6131
|
+
y: He(r.data.y)
|
|
6030
6132
|
},
|
|
6031
6133
|
style: r.style
|
|
6032
6134
|
});
|
|
@@ -6036,17 +6138,17 @@ class kn {
|
|
|
6036
6138
|
* Convert current state to URL-safe hash
|
|
6037
6139
|
*/
|
|
6038
6140
|
toUrlHash(e = !0) {
|
|
6039
|
-
return
|
|
6141
|
+
return In(this.serialize({ includeData: !0 }), e);
|
|
6040
6142
|
}
|
|
6041
6143
|
/**
|
|
6042
6144
|
* Load state from URL hash
|
|
6043
6145
|
*/
|
|
6044
6146
|
fromUrlHash(e, t = !0) {
|
|
6045
|
-
const n =
|
|
6147
|
+
const n = En(e, t);
|
|
6046
6148
|
n && this.deserialize(n);
|
|
6047
6149
|
}
|
|
6048
6150
|
}
|
|
6049
|
-
function
|
|
6151
|
+
function Dn(i, e, t, n) {
|
|
6050
6152
|
const { value: s, min: o, max: r } = e, {
|
|
6051
6153
|
needleColor: a = "#333",
|
|
6052
6154
|
needleWidth: l = 3,
|
|
@@ -6058,26 +6160,26 @@ function Bn(i, e, t, n) {
|
|
|
6058
6160
|
valueColor: g = "#fff",
|
|
6059
6161
|
valueSize: y = 24,
|
|
6060
6162
|
label: x
|
|
6061
|
-
} = t, b = n.x + n.width / 2,
|
|
6062
|
-
i.save(), i.beginPath(), i.arc(b,
|
|
6063
|
-
for (const
|
|
6064
|
-
const
|
|
6163
|
+
} = t, b = n.x + n.width / 2, w = n.y + n.height / 2, p = Math.min(n.width, n.height) / 2 * d, v = f - c, M = Math.max(0, Math.min(1, (s - o) / (r - o))), S = (c + M * v) * (Math.PI / 180);
|
|
6164
|
+
i.save(), i.beginPath(), i.arc(b, w, p, c * (Math.PI / 180), f * (Math.PI / 180)), i.strokeStyle = "rgba(255, 255, 255, 0.1)", i.lineWidth = p * 0.2, i.lineCap = "round", i.stroke();
|
|
6165
|
+
for (const P of h) {
|
|
6166
|
+
const T = Math.max(0, Math.min(1, (P.from - o) / (r - o))), D = Math.max(0, Math.min(1, (P.to - o) / (r - o)));
|
|
6065
6167
|
i.beginPath(), i.arc(
|
|
6066
6168
|
b,
|
|
6067
|
-
|
|
6169
|
+
w,
|
|
6068
6170
|
p,
|
|
6069
|
-
(c +
|
|
6070
|
-
(c +
|
|
6071
|
-
), i.strokeStyle =
|
|
6171
|
+
(c + T * v) * (Math.PI / 180),
|
|
6172
|
+
(c + D * v) * (Math.PI / 180)
|
|
6173
|
+
), i.strokeStyle = P.color, i.lineWidth = p * 0.2, i.stroke();
|
|
6072
6174
|
}
|
|
6073
6175
|
const A = 11;
|
|
6074
|
-
for (let
|
|
6075
|
-
const
|
|
6076
|
-
i.beginPath(), i.moveTo(b +
|
|
6176
|
+
for (let P = 0; P < A; P++) {
|
|
6177
|
+
const T = (c + P / (A - 1) * v) * (Math.PI / 180), D = p * 0.85, I = p * 0.95;
|
|
6178
|
+
i.beginPath(), i.moveTo(b + D * Math.cos(T), w + D * Math.sin(T)), i.lineTo(b + I * Math.cos(T), w + I * Math.sin(T)), i.strokeStyle = "rgba(255, 255, 255, 0.5)", i.lineWidth = 2, i.stroke();
|
|
6077
6179
|
}
|
|
6078
|
-
i.beginPath(), i.moveTo(b,
|
|
6180
|
+
i.beginPath(), i.moveTo(b, w), i.lineTo(b + p * 0.9 * Math.cos(S), w + p * 0.9 * Math.sin(S)), i.strokeStyle = a, i.lineWidth = l, i.lineCap = "round", i.shadowColor = a, i.shadowBlur = 10, i.stroke(), i.shadowBlur = 0, i.beginPath(), i.arc(b, w, 8, 0, Math.PI * 2), i.fillStyle = a, i.fill(), i.strokeStyle = "#fff", i.lineWidth = 2, i.stroke(), u && (i.textAlign = "center", i.textBaseline = "middle", i.font = `bold ${y}px Inter, sans-serif`, i.fillStyle = g, i.fillText(s.toFixed(1), b, w + p * 0.4), x && (i.font = `${y * 0.5}px Inter, sans-serif`, i.fillStyle = "rgba(255, 255, 255, 0.6)", i.fillText(x, b, w + p * 0.6))), i.restore();
|
|
6079
6181
|
}
|
|
6080
|
-
function
|
|
6182
|
+
function Fn(i, e, t, n) {
|
|
6081
6183
|
const { nodes: s, links: o } = e, {
|
|
6082
6184
|
nodeWidth: r = 18,
|
|
6083
6185
|
nodePadding: a = 12,
|
|
@@ -6091,75 +6193,75 @@ function Tn(i, e, t, n) {
|
|
|
6091
6193
|
y: n.y + y,
|
|
6092
6194
|
width: f,
|
|
6093
6195
|
height: u
|
|
6094
|
-
},
|
|
6196
|
+
}, w = /* @__PURE__ */ new Set();
|
|
6095
6197
|
o.forEach((C) => {
|
|
6096
|
-
|
|
6198
|
+
w.add(C.source), w.add(C.target);
|
|
6097
6199
|
});
|
|
6098
|
-
const p = Array.from(
|
|
6099
|
-
p.filter((C) => !
|
|
6200
|
+
const p = Array.from(w), v = /* @__PURE__ */ new Map(), M = new Set(o.map((C) => C.target));
|
|
6201
|
+
p.filter((C) => !M.has(C)).forEach((C) => v.set(C, 0));
|
|
6100
6202
|
let A = !0;
|
|
6101
6203
|
for (; A; )
|
|
6102
6204
|
A = !1, o.forEach((C) => {
|
|
6103
|
-
const
|
|
6104
|
-
if (
|
|
6105
|
-
const R = v.get(C.target),
|
|
6106
|
-
(R === void 0 ||
|
|
6205
|
+
const B = v.get(C.source);
|
|
6206
|
+
if (B !== void 0) {
|
|
6207
|
+
const R = v.get(C.target), F = B + 1;
|
|
6208
|
+
(R === void 0 || F > R) && (v.set(C.target, F), A = !0);
|
|
6107
6209
|
}
|
|
6108
6210
|
});
|
|
6109
6211
|
p.forEach((C) => {
|
|
6110
6212
|
v.get(C) === void 0 && v.set(C, 0);
|
|
6111
6213
|
});
|
|
6112
|
-
const
|
|
6113
|
-
p.forEach((C) =>
|
|
6114
|
-
const
|
|
6214
|
+
const P = Math.max(...Array.from(v.values())), T = Array.from({ length: P + 1 }, () => []);
|
|
6215
|
+
p.forEach((C) => T[v.get(C)].push(C));
|
|
6216
|
+
const D = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map();
|
|
6115
6217
|
o.forEach((C) => {
|
|
6116
|
-
I.set(C.source, (I.get(C.source) || 0) + C.value),
|
|
6218
|
+
I.set(C.source, (I.get(C.source) || 0) + C.value), D.set(C.target, (D.get(C.target) || 0) + C.value);
|
|
6117
6219
|
});
|
|
6118
|
-
const
|
|
6220
|
+
const me = (C) => Math.max(D.get(C) || 0, I.get(C) || 0);
|
|
6119
6221
|
let U = 0;
|
|
6120
|
-
|
|
6121
|
-
let
|
|
6122
|
-
C.forEach((R) =>
|
|
6222
|
+
T.forEach((C) => {
|
|
6223
|
+
let B = 0;
|
|
6224
|
+
C.forEach((R) => B += me(R)), B > U && (U = B);
|
|
6123
6225
|
});
|
|
6124
|
-
const ne = /* @__PURE__ */ new Map(),
|
|
6125
|
-
|
|
6126
|
-
const R = b.x +
|
|
6226
|
+
const ne = /* @__PURE__ */ new Map(), dt = T.length, ft = (b.width - r) / Math.max(1, dt - 1);
|
|
6227
|
+
T.forEach((C, B) => {
|
|
6228
|
+
const R = b.x + B * ft, F = [];
|
|
6127
6229
|
let q = 0;
|
|
6128
|
-
C.forEach((
|
|
6129
|
-
const L =
|
|
6130
|
-
|
|
6230
|
+
C.forEach((X) => {
|
|
6231
|
+
const L = me(X), Y = U > 0 ? L / U * (b.height * 0.9) : 20;
|
|
6232
|
+
F.push(Y), q += Y;
|
|
6131
6233
|
});
|
|
6132
6234
|
const se = (C.length - 1) * a, oe = q + se;
|
|
6133
6235
|
let re = b.y + (b.height - oe) / 2;
|
|
6134
|
-
C.forEach((
|
|
6135
|
-
const
|
|
6236
|
+
C.forEach((X, L) => {
|
|
6237
|
+
const Y = F[L];
|
|
6136
6238
|
let J = l[L % l.length];
|
|
6137
6239
|
if (s.length > 0) {
|
|
6138
|
-
const z = s.find((K) => K.id ===
|
|
6240
|
+
const z = s.find((K) => K.id === X);
|
|
6139
6241
|
z != null && z.color && (J = z.color);
|
|
6140
6242
|
}
|
|
6141
|
-
ne.set(
|
|
6243
|
+
ne.set(X, { x: R, y: re, width: r, height: Y, color: J, value: me(X) }), re += Y + a;
|
|
6142
6244
|
});
|
|
6143
6245
|
}), i.save();
|
|
6144
|
-
const Fe = /* @__PURE__ */ new Map(),
|
|
6246
|
+
const Fe = /* @__PURE__ */ new Map(), Le = /* @__PURE__ */ new Map();
|
|
6145
6247
|
o.forEach((C) => {
|
|
6146
|
-
const
|
|
6147
|
-
if (!
|
|
6148
|
-
const
|
|
6149
|
-
|
|
6248
|
+
const B = ne.get(C.source), R = ne.get(C.target);
|
|
6249
|
+
if (!B || !R) return;
|
|
6250
|
+
const F = Fe.get(C.source) || 0, q = Le.get(C.target) || 0, se = I.get(C.source) || 1, oe = D.get(C.target) || 1, re = C.value / se * B.height, X = C.value / oe * R.height, L = B.x + B.width, Y = B.y + F, J = Y + re, z = R.x, K = R.y + q, Se = K + X, pe = (z - L) * 0.5, Ce = i.createLinearGradient(L, (Y + J) / 2, z, (K + Se) / 2);
|
|
6251
|
+
Ce.addColorStop(0, B.color), Ce.addColorStop(1, R.color), i.beginPath(), i.moveTo(L, Y), i.bezierCurveTo(L + pe, Y, z - pe, K, z, K), i.lineTo(z, Se), i.bezierCurveTo(z - pe, Se, L + pe, J, L, J), i.closePath(), i.fillStyle = Ce, i.globalAlpha = h, i.fill(), i.strokeStyle = B.color, i.globalAlpha = h * 0.3, i.lineWidth = 0.5, i.stroke(), Fe.set(C.source, F + re), Le.set(C.target, q + X);
|
|
6150
6252
|
}), i.restore(), i.save(), i.globalAlpha = 1, ne.forEach((C) => {
|
|
6151
6253
|
i.fillStyle = C.color, i.fillRect(C.x, C.y, C.width, C.height);
|
|
6152
|
-
const
|
|
6153
|
-
|
|
6154
|
-
}), i.restore(), d && (i.save(), i.font = "bold 11px Inter, -apple-system, sans-serif", i.textBaseline = "middle", ne.forEach((C,
|
|
6155
|
-
let R = String(
|
|
6156
|
-
const
|
|
6157
|
-
|
|
6254
|
+
const B = i.createLinearGradient(C.x, C.y, C.x + C.width, C.y);
|
|
6255
|
+
B.addColorStop(0, "rgba(255, 255, 255, 0.15)"), B.addColorStop(1, "rgba(0, 0, 0, 0.15)"), i.fillStyle = B, i.fillRect(C.x, C.y, C.width, C.height);
|
|
6256
|
+
}), i.restore(), d && (i.save(), i.font = "bold 11px Inter, -apple-system, sans-serif", i.textBaseline = "middle", ne.forEach((C, B) => {
|
|
6257
|
+
let R = String(B);
|
|
6258
|
+
const F = s.find((oe) => oe.id === B);
|
|
6259
|
+
F != null && F.name && (R = F.name);
|
|
6158
6260
|
const q = C.x <= b.x + 5, se = C.x >= b.x + b.width - r - 5;
|
|
6159
6261
|
i.shadowBlur = 3, i.shadowColor = "rgba(0, 0, 0, 0.7)", i.fillStyle = "#ffffff", q ? (i.textAlign = "right", i.fillText(R, C.x - 10, C.y + C.height / 2)) : se ? (i.textAlign = "left", i.fillText(R, C.x + C.width + 10, C.y + C.height / 2)) : (i.textAlign = "center", i.fillText(R, C.x + C.width / 2, C.y - 10));
|
|
6160
6262
|
}), i.restore());
|
|
6161
6263
|
}
|
|
6162
|
-
function
|
|
6264
|
+
function Ue(i, e, t, n, s) {
|
|
6163
6265
|
const o = (s == null ? void 0 : s.left) ?? 0, r = (s == null ? void 0 : s.right) ?? 0, a = (s == null ? void 0 : s.top) ?? 0, l = (s == null ? void 0 : s.bottom) ?? 0;
|
|
6164
6266
|
if (n === "x") {
|
|
6165
6267
|
const f = e.x + o, u = e.x + e.width - r, g = (t == null ? void 0 : t.invertAxis) ?? !1;
|
|
@@ -6169,9 +6271,9 @@ function He(i, e, t, n, s) {
|
|
|
6169
6271
|
const h = e.y + a, d = e.y + e.height - l, c = (t == null ? void 0 : t.invertAxis) ?? !1;
|
|
6170
6272
|
i.setRange(c ? h : d, c ? d : h);
|
|
6171
6273
|
}
|
|
6172
|
-
function
|
|
6274
|
+
function Ln(i, e) {
|
|
6173
6275
|
const t = [], n = i.layout.plotPadding;
|
|
6174
|
-
if (
|
|
6276
|
+
if (Ue(
|
|
6175
6277
|
i.xScale,
|
|
6176
6278
|
e,
|
|
6177
6279
|
i.xAxisOptions,
|
|
@@ -6179,7 +6281,7 @@ function In(i, e) {
|
|
|
6179
6281
|
n
|
|
6180
6282
|
), i.xScale.setDomain(i.viewBounds.xMin, i.viewBounds.xMax), i.yScales.forEach((s, o) => {
|
|
6181
6283
|
const r = i.yAxisOptionsMap.get(o);
|
|
6182
|
-
|
|
6284
|
+
Ue(s, e, r, "y", n), o === i.primaryYAxisId && s.setDomain(i.viewBounds.yMin, i.viewBounds.yMax);
|
|
6183
6285
|
}), i.series.forEach((s) => {
|
|
6184
6286
|
var a, l;
|
|
6185
6287
|
s.needsBufferUpdate && (i.updateSeriesBuffer(s), s.needsBufferUpdate = !1);
|
|
@@ -6233,8 +6335,8 @@ function In(i, e) {
|
|
|
6233
6335
|
const g = i.renderer.getBuffer(`${s.getId()}_box_lines`), y = i.renderer.getBuffer(`${s.getId()}_box_faces`);
|
|
6234
6336
|
if (g && y) {
|
|
6235
6337
|
const x = s.getYAxisId() || i.primaryYAxisId, b = i.yScales.get(x);
|
|
6236
|
-
let
|
|
6237
|
-
b && (
|
|
6338
|
+
let w;
|
|
6339
|
+
b && (w = { min: b.domain[0], max: b.domain[1] }), u = {
|
|
6238
6340
|
id: s.getId(),
|
|
6239
6341
|
buffer: g,
|
|
6240
6342
|
// Use lines buffer as main buffer for reference
|
|
@@ -6243,7 +6345,7 @@ function In(i, e) {
|
|
|
6243
6345
|
style: s.getStyle(),
|
|
6244
6346
|
visible: s.isVisible(),
|
|
6245
6347
|
type: "boxplot",
|
|
6246
|
-
yBounds:
|
|
6348
|
+
yBounds: w,
|
|
6247
6349
|
boxLinesBuffer: g,
|
|
6248
6350
|
boxLinesCount: s.getPointCount() * 10,
|
|
6249
6351
|
boxBuffer: y,
|
|
@@ -6254,10 +6356,10 @@ function In(i, e) {
|
|
|
6254
6356
|
if (r === "waterfall" && !u) {
|
|
6255
6357
|
const g = i.renderer.getBuffer(`${s.getId()}_wf_positive`), y = i.renderer.getBuffer(`${s.getId()}_wf_negative`), x = i.renderer.getBuffer(`${s.getId()}_wf_subtotal`), b = i.renderer.getBuffer(`${s.getId()}_wf_connectors`);
|
|
6256
6358
|
if (g || y || x) {
|
|
6257
|
-
const
|
|
6359
|
+
const w = s.getYAxisId() || i.primaryYAxisId, p = i.yScales.get(w);
|
|
6258
6360
|
let v;
|
|
6259
6361
|
p && (v = { min: p.domain[0], max: p.domain[1] });
|
|
6260
|
-
const
|
|
6362
|
+
const M = s.waterfallCounts || { positive: 0, negative: 0, subtotal: 0, connectors: 0 };
|
|
6261
6363
|
u = {
|
|
6262
6364
|
id: s.getId(),
|
|
6263
6365
|
buffer: g || y || x,
|
|
@@ -6269,13 +6371,13 @@ function In(i, e) {
|
|
|
6269
6371
|
type: "waterfall",
|
|
6270
6372
|
yBounds: v,
|
|
6271
6373
|
wfPositiveBuffer: g,
|
|
6272
|
-
wfPositiveCount:
|
|
6374
|
+
wfPositiveCount: M.positive,
|
|
6273
6375
|
wfNegativeBuffer: y,
|
|
6274
|
-
wfNegativeCount:
|
|
6376
|
+
wfNegativeCount: M.negative,
|
|
6275
6377
|
wfSubtotalBuffer: x,
|
|
6276
|
-
wfSubtotalCount:
|
|
6378
|
+
wfSubtotalCount: M.subtotal,
|
|
6277
6379
|
wfConnectorBuffer: b,
|
|
6278
|
-
wfConnectorCount:
|
|
6380
|
+
wfConnectorCount: M.connectors
|
|
6279
6381
|
};
|
|
6280
6382
|
}
|
|
6281
6383
|
}
|
|
@@ -6290,19 +6392,19 @@ function In(i, e) {
|
|
|
6290
6392
|
if (r === "heatmap") {
|
|
6291
6393
|
const y = s.getHeatmapData(), x = s.getHeatmapStyle();
|
|
6292
6394
|
if (y) {
|
|
6293
|
-
const b = y.xValues.length,
|
|
6294
|
-
u.count = (b - 1) * (
|
|
6395
|
+
const b = y.xValues.length, w = y.yValues.length;
|
|
6396
|
+
u.count = (b - 1) * (w - 1) * 6;
|
|
6295
6397
|
let p = 1 / 0, v = -1 / 0;
|
|
6296
|
-
for (let
|
|
6297
|
-
const A = y.zValues[
|
|
6398
|
+
for (let S = 0; S < y.zValues.length; S++) {
|
|
6399
|
+
const A = y.zValues[S];
|
|
6298
6400
|
A < p && (p = A), A > v && (v = A);
|
|
6299
6401
|
}
|
|
6300
6402
|
p === v && (p -= 1, v += 1), u.zBounds = {
|
|
6301
6403
|
min: ((a = x == null ? void 0 : x.colorScale) == null ? void 0 : a.min) ?? (p === 1 / 0 ? 0 : p),
|
|
6302
6404
|
max: ((l = x == null ? void 0 : x.colorScale) == null ? void 0 : l.max) ?? (v === -1 / 0 ? 1 : v)
|
|
6303
6405
|
}, u.zBounds.min === u.zBounds.max && (u.zBounds.max = u.zBounds.min + 1);
|
|
6304
|
-
const
|
|
6305
|
-
u.colormapTexture = i.renderer.getTexture(
|
|
6406
|
+
const M = `${s.getId()}_colormap`;
|
|
6407
|
+
u.colormapTexture = i.renderer.getTexture(M);
|
|
6306
6408
|
}
|
|
6307
6409
|
}
|
|
6308
6410
|
}
|
|
@@ -6347,12 +6449,12 @@ function In(i, e) {
|
|
|
6347
6449
|
}
|
|
6348
6450
|
return t;
|
|
6349
6451
|
}
|
|
6350
|
-
function
|
|
6351
|
-
var y, x, b,
|
|
6452
|
+
function qe(i, e, t) {
|
|
6453
|
+
var y, x, b, w;
|
|
6352
6454
|
const n = i.container.getBoundingClientRect();
|
|
6353
6455
|
if (n.width === 0 || n.height === 0) {
|
|
6354
6456
|
console.warn(
|
|
6355
|
-
"[
|
|
6457
|
+
"[VeloPlot] Container has zero size in render, skipping overlay"
|
|
6356
6458
|
);
|
|
6357
6459
|
return;
|
|
6358
6460
|
}
|
|
@@ -6363,12 +6465,12 @@ function Ue(i, e, t) {
|
|
|
6363
6465
|
if (p.isVisible())
|
|
6364
6466
|
if (v === "polar") {
|
|
6365
6467
|
s = !0;
|
|
6366
|
-
const
|
|
6367
|
-
if (
|
|
6368
|
-
for (let A = 0; A <
|
|
6369
|
-
a = Math.max(a, Math.abs(
|
|
6370
|
-
const
|
|
6371
|
-
|
|
6468
|
+
const M = p.getPolarData();
|
|
6469
|
+
if (M) {
|
|
6470
|
+
for (let A = 0; A < M.r.length; A++)
|
|
6471
|
+
a = Math.max(a, Math.abs(M.r[A]));
|
|
6472
|
+
const S = p.getStyle();
|
|
6473
|
+
S.angleMode && (l = S.angleMode), S.radialDivisions && (h = S.radialDivisions), S.angularDivisions && (d = S.angularDivisions);
|
|
6372
6474
|
}
|
|
6373
6475
|
} else v === "gauge" ? o = !0 : v === "sankey" && (r = !0);
|
|
6374
6476
|
});
|
|
@@ -6396,40 +6498,40 @@ function Ue(i, e, t) {
|
|
|
6396
6498
|
if (!p.isVisible()) return;
|
|
6397
6499
|
const v = p.getType();
|
|
6398
6500
|
if (v === "gauge") {
|
|
6399
|
-
const
|
|
6400
|
-
|
|
6501
|
+
const M = p.getGaugeData(), S = p.getGaugeStyle();
|
|
6502
|
+
M && S && Dn(i.overlayCtx, M, S, e);
|
|
6401
6503
|
} else if (v === "sankey") {
|
|
6402
|
-
const
|
|
6403
|
-
|
|
6504
|
+
const M = p.getSankeyData(), S = p.getSankeyStyle();
|
|
6505
|
+
M && S && Fn(i.overlayCtx, M, S, e);
|
|
6404
6506
|
}
|
|
6405
6507
|
}), c || i.overlay.drawXAxis(e, i.xScale, i.xAxisOptions, i.layout.xAxisLayout);
|
|
6406
6508
|
const f = [], u = [];
|
|
6407
6509
|
i.yAxisOptionsMap.forEach((p, v) => {
|
|
6408
6510
|
p.position === "right" ? u.push(v) : f.push(v);
|
|
6409
6511
|
}), c || (f.forEach((p, v) => {
|
|
6410
|
-
const
|
|
6411
|
-
if (
|
|
6512
|
+
const M = i.yScales.get(p), S = i.yAxisOptionsMap.get(p);
|
|
6513
|
+
if (M && S) {
|
|
6412
6514
|
const A = v * 65;
|
|
6413
|
-
i.overlay.drawYAxis(e,
|
|
6515
|
+
i.overlay.drawYAxis(e, M, S, "left", A, i.layout.yAxisLayout);
|
|
6414
6516
|
}
|
|
6415
6517
|
}), u.forEach((p, v) => {
|
|
6416
|
-
const
|
|
6417
|
-
if (
|
|
6518
|
+
const M = i.yScales.get(p), S = i.yAxisOptionsMap.get(p);
|
|
6519
|
+
if (M && S) {
|
|
6418
6520
|
const A = v * 65;
|
|
6419
|
-
i.overlay.drawYAxis(e,
|
|
6521
|
+
i.overlay.drawYAxis(e, M, S, "right", A, i.layout.yAxisLayout);
|
|
6420
6522
|
}
|
|
6421
6523
|
})), i.overlay.drawPlotBorder(e), i.series.forEach((p) => {
|
|
6422
6524
|
if (p.isVisible() && p.hasErrorData()) {
|
|
6423
|
-
const v = p.getYAxisId() || i.primaryYAxisId,
|
|
6424
|
-
i.overlay.drawErrorBars(e, p, i.xScale,
|
|
6525
|
+
const v = p.getYAxisId() || i.primaryYAxisId, S = i.yScales.get(v) || t;
|
|
6526
|
+
i.overlay.drawErrorBars(e, p, i.xScale, S);
|
|
6425
6527
|
}
|
|
6426
6528
|
}), i.series.forEach((p) => {
|
|
6427
6529
|
if (!p.isVisible() || p.getType() !== "candlestick") return;
|
|
6428
|
-
const v = p.getYAxisId() || i.primaryYAxisId,
|
|
6429
|
-
i.overlay.drawCandlestickMarkers(e, p, i.xScale,
|
|
6530
|
+
const v = p.getYAxisId() || i.primaryYAxisId, M = i.yScales.get(v) || t;
|
|
6531
|
+
i.overlay.drawCandlestickMarkers(e, p, i.xScale, M);
|
|
6430
6532
|
});
|
|
6431
6533
|
const g = ((b = i.getAlerts) == null ? void 0 : b.call(i)) ?? [];
|
|
6432
|
-
if (g.length && i.overlay.drawPriceAlertLines(e, g, t), i.selectionRect && i.overlay.drawSelectionRect(i.selectionRect), i.selectionManager.render(i.overlayCtx, e), (
|
|
6534
|
+
if (g.length && i.overlay.drawPriceAlertLines(e, g, t), i.selectionRect && i.overlay.drawSelectionRect(i.selectionRect), i.selectionManager.render(i.overlayCtx, e), (w = i.cursorOptions) != null && w.enabled && i.cursorPosition) {
|
|
6433
6535
|
const p = i.cursorOptions.valueDisplayMode ?? "floating";
|
|
6434
6536
|
let v;
|
|
6435
6537
|
p !== "disabled" && (v = i.cursorOptions.formatter ? i.cursorOptions.formatter(
|
|
@@ -6438,7 +6540,7 @@ function Ue(i, e, t) {
|
|
|
6438
6540
|
""
|
|
6439
6541
|
) : `X: ${i.pixelToDataX(i.cursorPosition.x).toFixed(3)}
|
|
6440
6542
|
Y: ${i.pixelToDataY(i.cursorPosition.y).toExponential(2)}`);
|
|
6441
|
-
const
|
|
6543
|
+
const M = {
|
|
6442
6544
|
enabled: !0,
|
|
6443
6545
|
x: i.cursorPosition.x,
|
|
6444
6546
|
y: i.cursorPosition.y,
|
|
@@ -6447,10 +6549,10 @@ Y: ${i.pixelToDataY(i.cursorPosition.y).toExponential(2)}`);
|
|
|
6447
6549
|
valueDisplayMode: p,
|
|
6448
6550
|
cornerPosition: i.cursorOptions.cornerPosition ?? "top-left"
|
|
6449
6551
|
};
|
|
6450
|
-
i.overlay.drawCursor(e,
|
|
6552
|
+
i.overlay.drawCursor(e, M, i.cursorOptions.lineStyle);
|
|
6451
6553
|
}
|
|
6452
6554
|
}
|
|
6453
|
-
class
|
|
6555
|
+
class zn {
|
|
6454
6556
|
constructor(e) {
|
|
6455
6557
|
m(this, "animationFrameId", null);
|
|
6456
6558
|
m(this, "needsFullRender", !1);
|
|
@@ -6559,7 +6661,7 @@ class En {
|
|
|
6559
6661
|
if (this.lastRenderTime = o, !this.ctx.pluginManager.notifyBeforeRender(r))
|
|
6560
6662
|
return;
|
|
6561
6663
|
if (e) {
|
|
6562
|
-
const h =
|
|
6664
|
+
const h = Ln(s, n);
|
|
6563
6665
|
this.ctx.renderer.render(h, {
|
|
6564
6666
|
bounds: this.ctx.viewBounds,
|
|
6565
6667
|
invertX: !!this.ctx.xAxisOptions.invertAxis,
|
|
@@ -6571,9 +6673,9 @@ class En {
|
|
|
6571
6673
|
...r,
|
|
6572
6674
|
renderTime: performance.now() - t
|
|
6573
6675
|
};
|
|
6574
|
-
this.ctx.pluginManager.notifyRenderWebGL(d),
|
|
6676
|
+
this.ctx.pluginManager.notifyRenderWebGL(d), qe(s, n, this.ctx.yScale);
|
|
6575
6677
|
} else
|
|
6576
|
-
|
|
6678
|
+
qe(s, n, this.ctx.yScale);
|
|
6577
6679
|
const a = performance.now() - t, l = { ...r, renderTime: a };
|
|
6578
6680
|
this.ctx.pluginManager.notifyRenderOverlay(l), this.ctx.pluginManager.notifyAfterRender(l), this.ctx.events.emit("render", {
|
|
6579
6681
|
fps: 1e3 / a,
|
|
@@ -6599,13 +6701,13 @@ class En {
|
|
|
6599
6701
|
this.frameCount = 0;
|
|
6600
6702
|
}
|
|
6601
6703
|
}
|
|
6602
|
-
function
|
|
6704
|
+
function On(i) {
|
|
6603
6705
|
const t = {
|
|
6604
6706
|
id: i.seriesId ?? `${i.id}-indicator`,
|
|
6605
6707
|
data: i.data,
|
|
6606
6708
|
style: i.style,
|
|
6607
6709
|
name: i.label
|
|
6608
|
-
}, n =
|
|
6710
|
+
}, n = Me(t);
|
|
6609
6711
|
return {
|
|
6610
6712
|
id: i.id,
|
|
6611
6713
|
height: i.height ?? 0.25,
|
|
@@ -6618,7 +6720,8 @@ function Rn(i) {
|
|
|
6618
6720
|
tickCount: i.tickCount ?? 5,
|
|
6619
6721
|
scientific: !1
|
|
6620
6722
|
},
|
|
6621
|
-
|
|
6723
|
+
// X-axis visibility is owned by createStackedChart (sharedXAxis / showXAxis).
|
|
6724
|
+
// Do not force labels off here — the new bottom pane must show dates.
|
|
6622
6725
|
animations: !1,
|
|
6623
6726
|
loading: !1,
|
|
6624
6727
|
showLegend: !1
|
|
@@ -6626,8 +6729,9 @@ function Rn(i) {
|
|
|
6626
6729
|
series: n
|
|
6627
6730
|
};
|
|
6628
6731
|
}
|
|
6629
|
-
|
|
6630
|
-
|
|
6732
|
+
const Yn = 5e3;
|
|
6733
|
+
let Z = null, Re = !1;
|
|
6734
|
+
function ht(i) {
|
|
6631
6735
|
const e = performance.now();
|
|
6632
6736
|
switch (i.indicator) {
|
|
6633
6737
|
case "rsi":
|
|
@@ -6635,7 +6739,7 @@ function Fn(i) {
|
|
|
6635
6739
|
id: i.id,
|
|
6636
6740
|
type: "indicator-result",
|
|
6637
6741
|
indicator: "rsi",
|
|
6638
|
-
values:
|
|
6742
|
+
values: St(i.data, i.period ?? 14),
|
|
6639
6743
|
duration: performance.now() - e
|
|
6640
6744
|
};
|
|
6641
6745
|
case "sma":
|
|
@@ -6643,7 +6747,7 @@ function Fn(i) {
|
|
|
6643
6747
|
id: i.id,
|
|
6644
6748
|
type: "indicator-result",
|
|
6645
6749
|
indicator: "sma",
|
|
6646
|
-
values:
|
|
6750
|
+
values: Mt(i.data, i.period ?? 14),
|
|
6647
6751
|
duration: performance.now() - e
|
|
6648
6752
|
};
|
|
6649
6753
|
case "ema":
|
|
@@ -6651,11 +6755,11 @@ function Fn(i) {
|
|
|
6651
6755
|
id: i.id,
|
|
6652
6756
|
type: "indicator-result",
|
|
6653
6757
|
indicator: "ema",
|
|
6654
|
-
values:
|
|
6758
|
+
values: wt(i.data, i.period ?? 14),
|
|
6655
6759
|
duration: performance.now() - e
|
|
6656
6760
|
};
|
|
6657
6761
|
case "macd": {
|
|
6658
|
-
const t =
|
|
6762
|
+
const t = vt(
|
|
6659
6763
|
i.data,
|
|
6660
6764
|
i.fastPeriod ?? 12,
|
|
6661
6765
|
i.slowPeriod ?? 26,
|
|
@@ -6670,7 +6774,7 @@ function Fn(i) {
|
|
|
6670
6774
|
};
|
|
6671
6775
|
}
|
|
6672
6776
|
case "bollingerBands": {
|
|
6673
|
-
const t =
|
|
6777
|
+
const t = bt(i.data, i.period ?? 20, i.stdDev ?? 2);
|
|
6674
6778
|
return {
|
|
6675
6779
|
id: i.id,
|
|
6676
6780
|
type: "indicator-result",
|
|
@@ -6683,8 +6787,8 @@ function Fn(i) {
|
|
|
6683
6787
|
throw new Error(`Unknown indicator: ${i.indicator}`);
|
|
6684
6788
|
}
|
|
6685
6789
|
}
|
|
6686
|
-
function
|
|
6687
|
-
return
|
|
6790
|
+
function $n() {
|
|
6791
|
+
return Z || (Z = new kt(
|
|
6688
6792
|
() => new Worker(new URL(
|
|
6689
6793
|
/* @vite-ignore */
|
|
6690
6794
|
"/assets/indicator.worker-bv0zC4EX.js",
|
|
@@ -6693,52 +6797,60 @@ function Dn() {
|
|
|
6693
6797
|
{
|
|
6694
6798
|
poolSize: 2,
|
|
6695
6799
|
syncFallback: !0,
|
|
6696
|
-
|
|
6800
|
+
// Short timeout — if the worker is silent (broken Vite URL), don't stall UI.
|
|
6801
|
+
timeoutMs: 250,
|
|
6802
|
+
syncHandler: ht
|
|
6697
6803
|
}
|
|
6698
|
-
)),
|
|
6804
|
+
)), Z;
|
|
6699
6805
|
}
|
|
6700
|
-
function
|
|
6806
|
+
function ge(i) {
|
|
6701
6807
|
return i instanceof Float32Array || i instanceof Float64Array ? i : Float32Array.from(i);
|
|
6702
6808
|
}
|
|
6703
|
-
|
|
6704
|
-
const e = St(i.indicator), t = await Dn().run({ id: e, type: "indicator", ...i });
|
|
6809
|
+
function Ge(i) {
|
|
6705
6810
|
return {
|
|
6706
|
-
values:
|
|
6707
|
-
signal:
|
|
6708
|
-
upper:
|
|
6709
|
-
lower:
|
|
6710
|
-
histogram:
|
|
6711
|
-
duration:
|
|
6811
|
+
values: i.values,
|
|
6812
|
+
signal: i.signal,
|
|
6813
|
+
upper: i.upper,
|
|
6814
|
+
lower: i.lower,
|
|
6815
|
+
histogram: i.histogram,
|
|
6816
|
+
duration: i.duration
|
|
6712
6817
|
};
|
|
6713
6818
|
}
|
|
6714
|
-
async function
|
|
6715
|
-
|
|
6819
|
+
async function ye(i) {
|
|
6820
|
+
const t = { id: At(i.indicator), type: "indicator", ...i };
|
|
6821
|
+
if (Re || i.data.length < Yn)
|
|
6822
|
+
return Ge(ht(t));
|
|
6823
|
+
const n = performance.now(), s = await $n().run(t);
|
|
6824
|
+
return performance.now() - n >= 200 && (Re = !0), Ge(s);
|
|
6825
|
+
}
|
|
6826
|
+
async function _n(i, e = 14) {
|
|
6827
|
+
return ye({ indicator: "rsi", data: ge(i), period: e });
|
|
6716
6828
|
}
|
|
6717
|
-
async function
|
|
6718
|
-
return
|
|
6829
|
+
async function Vn(i, e = 14) {
|
|
6830
|
+
return ye({ indicator: "sma", data: ge(i), period: e });
|
|
6719
6831
|
}
|
|
6720
|
-
async function
|
|
6721
|
-
return
|
|
6832
|
+
async function Xn(i, e = 14) {
|
|
6833
|
+
return ye({ indicator: "ema", data: ge(i), period: e });
|
|
6722
6834
|
}
|
|
6723
|
-
async function
|
|
6724
|
-
return
|
|
6835
|
+
async function Wn(i, e = 12, t = 26, n = 9) {
|
|
6836
|
+
return ye({
|
|
6725
6837
|
indicator: "macd",
|
|
6726
|
-
data:
|
|
6838
|
+
data: ge(i),
|
|
6727
6839
|
fastPeriod: e,
|
|
6728
6840
|
slowPeriod: t,
|
|
6729
6841
|
signalPeriod: n
|
|
6730
6842
|
});
|
|
6731
6843
|
}
|
|
6732
|
-
async function
|
|
6733
|
-
return
|
|
6844
|
+
async function Nn(i, e = 20, t = 2) {
|
|
6845
|
+
return ye({ indicator: "bollingerBands", data: ge(i), period: e, stdDev: t });
|
|
6734
6846
|
}
|
|
6735
|
-
function
|
|
6736
|
-
|
|
6847
|
+
function Ms() {
|
|
6848
|
+
Z == null || Z.destroy(), Z = null, Re = !1;
|
|
6737
6849
|
}
|
|
6738
|
-
function
|
|
6850
|
+
function Hn(i) {
|
|
6739
6851
|
return i === "bollingerBands" ? "bollinger" : i;
|
|
6740
6852
|
}
|
|
6741
|
-
function
|
|
6853
|
+
function Un(i) {
|
|
6742
6854
|
const e = i.getData(), t = e.x;
|
|
6743
6855
|
if (!(t != null && t.length))
|
|
6744
6856
|
throw new Error("[addIndicator] Source series has no X data");
|
|
@@ -6748,7 +6860,7 @@ function Vn(i) {
|
|
|
6748
6860
|
throw new Error("[addIndicator] Source series has no price/Y data");
|
|
6749
6861
|
return { x: t, prices: s };
|
|
6750
6862
|
}
|
|
6751
|
-
function
|
|
6863
|
+
function qn(i) {
|
|
6752
6864
|
const e = i.getData(), t = e.x;
|
|
6753
6865
|
if (!(t != null && t.length))
|
|
6754
6866
|
throw new Error("[addIndicator] Source series has no X data");
|
|
@@ -6757,7 +6869,7 @@ function Xn(i) {
|
|
|
6757
6869
|
throw new Error("[addIndicator] Source series has no OHLC data — use candlestick");
|
|
6758
6870
|
return { x: t, open: n, high: s, low: o, close: r };
|
|
6759
6871
|
}
|
|
6760
|
-
function
|
|
6872
|
+
function ct(i, e) {
|
|
6761
6873
|
if (e) {
|
|
6762
6874
|
const s = i.getSeries(e);
|
|
6763
6875
|
if (!s) throw new Error(`[addIndicator] Source series "${e}" not found`);
|
|
@@ -6771,11 +6883,11 @@ function rt(i, e) {
|
|
|
6771
6883
|
throw new Error("[addIndicator] No line/candlestick/bar series found — pass sourceSeriesId");
|
|
6772
6884
|
return n;
|
|
6773
6885
|
}
|
|
6774
|
-
async function
|
|
6775
|
-
const o =
|
|
6886
|
+
async function ut(i, e, t, n = {}, s) {
|
|
6887
|
+
const o = Hn(i), r = n.id ?? o, a = e instanceof Float32Array || e instanceof Float64Array ? e : Float32Array.from(e);
|
|
6776
6888
|
switch (o) {
|
|
6777
6889
|
case "rsi": {
|
|
6778
|
-
const l = n.period ?? 14, { values: h } = await
|
|
6890
|
+
const l = n.period ?? 14, { values: h } = await _n(t, l);
|
|
6779
6891
|
return {
|
|
6780
6892
|
id: r,
|
|
6781
6893
|
preset: "rsi",
|
|
@@ -6792,7 +6904,7 @@ async function at(i, e, t, n = {}, s) {
|
|
|
6792
6904
|
};
|
|
6793
6905
|
}
|
|
6794
6906
|
case "macd": {
|
|
6795
|
-
const l = n.fastPeriod ?? 12, h = n.slowPeriod ?? 26, d = n.signalPeriod ?? 9, c = await
|
|
6907
|
+
const l = n.fastPeriod ?? 12, h = n.slowPeriod ?? 26, d = n.signalPeriod ?? 9, c = await Wn(t, l, h, d);
|
|
6796
6908
|
return {
|
|
6797
6909
|
id: r,
|
|
6798
6910
|
preset: "macd",
|
|
@@ -6813,7 +6925,7 @@ async function at(i, e, t, n = {}, s) {
|
|
|
6813
6925
|
};
|
|
6814
6926
|
}
|
|
6815
6927
|
case "bollinger": {
|
|
6816
|
-
const l = n.period ?? 20, h = n.stdDev ?? 2, d = await
|
|
6928
|
+
const l = n.period ?? 20, h = n.stdDev ?? 2, d = await Nn(t, l, h), c = d.upper ?? d.values, f = d.lower ?? d.values;
|
|
6817
6929
|
return {
|
|
6818
6930
|
id: r,
|
|
6819
6931
|
preset: "bollinger",
|
|
@@ -6833,7 +6945,7 @@ async function at(i, e, t, n = {}, s) {
|
|
|
6833
6945
|
};
|
|
6834
6946
|
}
|
|
6835
6947
|
case "ema": {
|
|
6836
|
-
const l = n.period ?? 14, { values: h } = await
|
|
6948
|
+
const l = n.period ?? 14, { values: h } = await Xn(t, l);
|
|
6837
6949
|
return {
|
|
6838
6950
|
id: r,
|
|
6839
6951
|
preset: "ema",
|
|
@@ -6845,7 +6957,7 @@ async function at(i, e, t, n = {}, s) {
|
|
|
6845
6957
|
};
|
|
6846
6958
|
}
|
|
6847
6959
|
case "sma": {
|
|
6848
|
-
const l = n.period ?? 14, { values: h } = await
|
|
6960
|
+
const l = n.period ?? 14, { values: h } = await Vn(t, l);
|
|
6849
6961
|
return {
|
|
6850
6962
|
id: r,
|
|
6851
6963
|
preset: "sma",
|
|
@@ -6859,7 +6971,7 @@ async function at(i, e, t, n = {}, s) {
|
|
|
6859
6971
|
case "stochastic": {
|
|
6860
6972
|
if (!s)
|
|
6861
6973
|
throw new Error("[addIndicator] stochastic requires a candlestick source series");
|
|
6862
|
-
const l =
|
|
6974
|
+
const l = qn(s), h = n.period ?? 14, d = n.signalPeriod ?? 3, c = Ct(l, h, d);
|
|
6863
6975
|
return {
|
|
6864
6976
|
id: r,
|
|
6865
6977
|
preset: "stochastic",
|
|
@@ -6882,25 +6994,25 @@ async function at(i, e, t, n = {}, s) {
|
|
|
6882
6994
|
throw new Error(`[addIndicator] Unknown preset: ${i}`);
|
|
6883
6995
|
}
|
|
6884
6996
|
}
|
|
6885
|
-
function
|
|
6997
|
+
function Gn(i, e) {
|
|
6886
6998
|
for (const t of [...i.getAllSeries()]) {
|
|
6887
6999
|
const n = t.getId();
|
|
6888
7000
|
(n === e || n.startsWith(`${e}-`)) && i.removeSeries(n);
|
|
6889
7001
|
}
|
|
6890
7002
|
}
|
|
6891
|
-
async function
|
|
6892
|
-
const n =
|
|
6893
|
-
return
|
|
7003
|
+
async function jn(i, e, t = {}) {
|
|
7004
|
+
const n = ct(i, t.sourceSeriesId), { x: s, prices: o } = Un(n);
|
|
7005
|
+
return ut(e, s, o, t, n);
|
|
6894
7006
|
}
|
|
6895
|
-
async function
|
|
7007
|
+
async function Zn(i, e, t = {}) {
|
|
6896
7008
|
var l;
|
|
6897
7009
|
if (t.pane === "new")
|
|
6898
7010
|
throw new Error(
|
|
6899
7011
|
"[addIndicator] pane: 'new' requires createStackedChart — use buildIndicatorPaneFromPreset() instead"
|
|
6900
7012
|
);
|
|
6901
|
-
const n =
|
|
6902
|
-
|
|
6903
|
-
const r =
|
|
7013
|
+
const n = ct(i, t.sourceSeriesId), s = t.yAxisId ?? ((l = n.getYAxisId) == null ? void 0 : l.call(n)), o = await jn(i, e, t);
|
|
7014
|
+
Gn(i, o.id);
|
|
7015
|
+
const r = Me({
|
|
6904
7016
|
id: o.id,
|
|
6905
7017
|
data: o.data,
|
|
6906
7018
|
name: t.label ?? o.id.toUpperCase()
|
|
@@ -6917,9 +7029,9 @@ async function Hn(i, e, t = {}) {
|
|
|
6917
7029
|
seriesIds: a
|
|
6918
7030
|
};
|
|
6919
7031
|
}
|
|
6920
|
-
async function
|
|
6921
|
-
const o = await
|
|
6922
|
-
return
|
|
7032
|
+
async function Ss(i, e, t, n, s) {
|
|
7033
|
+
const o = await ut(i, e, t, n, s);
|
|
7034
|
+
return On({
|
|
6923
7035
|
id: n.id ?? o.id,
|
|
6924
7036
|
height: n.height ?? 0.25,
|
|
6925
7037
|
label: n.label ?? o.id.toUpperCase(),
|
|
@@ -6931,7 +7043,7 @@ async function xs(i, e, t, n, s) {
|
|
|
6931
7043
|
data: o.data
|
|
6932
7044
|
});
|
|
6933
7045
|
}
|
|
6934
|
-
class
|
|
7046
|
+
class Qn {
|
|
6935
7047
|
constructor(e, t) {
|
|
6936
7048
|
m(this, "alerts", /* @__PURE__ */ new Map());
|
|
6937
7049
|
m(this, "idCounter", 0);
|
|
@@ -6988,36 +7100,36 @@ class Un {
|
|
|
6988
7100
|
this.alerts.clear();
|
|
6989
7101
|
}
|
|
6990
7102
|
}
|
|
6991
|
-
const
|
|
7103
|
+
const Jn = {
|
|
6992
7104
|
entry: "#38bdf8",
|
|
6993
7105
|
sl: "#ef4444",
|
|
6994
7106
|
tp: "#22c55e"
|
|
6995
|
-
},
|
|
7107
|
+
}, Kn = {
|
|
6996
7108
|
entry: "Entry",
|
|
6997
7109
|
sl: "SL",
|
|
6998
7110
|
tp: "TP"
|
|
6999
7111
|
};
|
|
7000
|
-
function
|
|
7112
|
+
function es(i, e) {
|
|
7001
7113
|
const t = i.style ?? "entry";
|
|
7002
7114
|
return {
|
|
7003
7115
|
id: e,
|
|
7004
7116
|
type: "horizontal-line",
|
|
7005
7117
|
y: i.price,
|
|
7006
|
-
color: i.color ??
|
|
7007
|
-
label: i.label ??
|
|
7118
|
+
color: i.color ?? Jn[t],
|
|
7119
|
+
label: i.label ?? Kn[t],
|
|
7008
7120
|
labelPosition: "right",
|
|
7009
7121
|
lineDash: t === "sl" ? [6, 4] : t === "tp" ? [4, 4] : void 0,
|
|
7010
7122
|
interactive: i.interactive ?? !1
|
|
7011
7123
|
};
|
|
7012
7124
|
}
|
|
7013
|
-
class
|
|
7125
|
+
class ts {
|
|
7014
7126
|
constructor(e) {
|
|
7015
7127
|
m(this, "container");
|
|
7016
7128
|
m(this, "webglCanvas");
|
|
7017
7129
|
m(this, "overlayCanvas");
|
|
7018
7130
|
m(this, "overlayCtx");
|
|
7019
7131
|
m(this, "series", /* @__PURE__ */ new Map());
|
|
7020
|
-
m(this, "events", new
|
|
7132
|
+
m(this, "events", new mt());
|
|
7021
7133
|
m(this, "viewBounds", {
|
|
7022
7134
|
xMin: -0.5,
|
|
7023
7135
|
xMax: 0.5,
|
|
@@ -7085,14 +7197,14 @@ class Qn {
|
|
|
7085
7197
|
m(this, "timeScaleMapping", null);
|
|
7086
7198
|
m(this, "positionLineCounter", 0);
|
|
7087
7199
|
this.initialOptions = e, this.container = e.container, this.chartId = e.id ?? `chart_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
|
|
7088
|
-
const t =
|
|
7089
|
-
if (this.baseTheme = t.theme, this.theme = t.theme, this.colorScheme = e.colorScheme ?
|
|
7200
|
+
const t = hn(this.container, e);
|
|
7201
|
+
if (this.baseTheme = t.theme, this.theme = t.theme, this.colorScheme = e.colorScheme ? Ye(e.colorScheme) : $e(t.theme.isDark), this.backgroundColor = t.backgroundColor, this.plotAreaBackground = t.plotAreaColor, this.showLegend = t.showLegend, this.showControls = t.showControls, this.toolbarOptions = e.toolbar, this.autoScroll = t.autoScroll, this.showStatistics = t.showStatistics, this.dpr = t.dpr, this.xAxisOptions = t.xAxisOptions, this.xScale = t.xScale, this.yAxisOptionsMap = t.yAxisOptionsMap, this.yScales = t.yScales, this.primaryYAxisId = t.primaryYAxisId, this.webglCanvas = t.webglCanvas, this.overlayCanvas = t.overlayCanvas, this.overlayCtx = t.overlayCtx, this.layout = t.layout, this.layout.crosshair && this.enableCursor({
|
|
7090
7202
|
enabled: this.layout.crosshair.enabled !== !1,
|
|
7091
7203
|
crosshair: !0,
|
|
7092
7204
|
snap: this.layout.crosshair.snapToData,
|
|
7093
7205
|
valueDisplayMode: this.layout.crosshair.valueDisplayMode,
|
|
7094
7206
|
cornerPosition: this.layout.crosshair.cornerPosition
|
|
7095
|
-
}), this.pluginManager = new
|
|
7207
|
+
}), this.pluginManager = new xn({
|
|
7096
7208
|
chart: this,
|
|
7097
7209
|
container: this.container,
|
|
7098
7210
|
theme: this.theme,
|
|
@@ -7131,18 +7243,18 @@ class Qn {
|
|
|
7131
7243
|
var r;
|
|
7132
7244
|
return (r = this.pluginManager) == null ? void 0 : r.get(o);
|
|
7133
7245
|
}
|
|
7134
|
-
}), this.pluginBridge = new
|
|
7246
|
+
}), this.pluginBridge = new kn(this.pluginManager), e.loading !== !1) {
|
|
7135
7247
|
const o = typeof e.loading == "object" ? e.loading : {
|
|
7136
|
-
message: "Loading
|
|
7248
|
+
message: "Loading VeloPlot...",
|
|
7137
7249
|
overlayOpacity: 0.1
|
|
7138
7250
|
};
|
|
7139
|
-
this.use(
|
|
7251
|
+
this.use(xt({
|
|
7140
7252
|
...o,
|
|
7141
7253
|
autoShow: !0
|
|
7142
7254
|
// Ensure it shows immediately
|
|
7143
7255
|
}));
|
|
7144
7256
|
}
|
|
7145
|
-
e.plugins && e.plugins.forEach((o) => this.use(o)), (e.renderer ?? "webgl") === "webgpu" ? this.rendererInitPromise = this.initGpuRenderer() : (this.renderer = new Pe(this.webglCanvas), this.activeRendererType = "webgl", this.renderer.setDPR(this.dpr)), this.overlay = new
|
|
7257
|
+
e.plugins && e.plugins.forEach((o) => this.use(o)), (e.renderer ?? "webgl") === "webgpu" ? this.rendererInitPromise = this.initGpuRenderer() : (this.renderer = new Pe(this.webglCanvas), this.activeRendererType = "webgl", this.renderer.setDPR(this.dpr)), this.overlay = new ai(this.overlayCtx, this.theme), this.selectionManager = new ci({
|
|
7146
7258
|
getSeries: () => this.series,
|
|
7147
7259
|
getPlotArea: () => this.getPlotArea(),
|
|
7148
7260
|
getXScale: () => this.xScale,
|
|
@@ -7153,18 +7265,18 @@ class Qn {
|
|
|
7153
7265
|
requestRender: () => this.requestRender()
|
|
7154
7266
|
}), this.events.on("selectionChange", (o) => {
|
|
7155
7267
|
this.pluginManager.notifySelectionChange(o.selected);
|
|
7156
|
-
}), this.animationEngine = new
|
|
7268
|
+
}), this.animationEngine = new st(), this.animationConfig = typeof e.animations == "boolean" ? { ...N, enabled: e.animations } : Ve(e.animations);
|
|
7157
7269
|
const s = typeof e.responsive == "boolean" ? { enabled: e.responsive } : e.responsive;
|
|
7158
|
-
this.responsiveManager = new
|
|
7270
|
+
this.responsiveManager = new ui(
|
|
7159
7271
|
{
|
|
7160
7272
|
container: this.container,
|
|
7161
7273
|
onStateChange: (o) => this.handleResponsiveChange(o)
|
|
7162
7274
|
},
|
|
7163
7275
|
s
|
|
7164
|
-
), this.alertManager = new
|
|
7276
|
+
), this.alertManager = new Qn(this.events, (o) => {
|
|
7165
7277
|
const r = o ? this.series.get(o) : void 0;
|
|
7166
7278
|
return r || this.series.values().next().value;
|
|
7167
|
-
}), this.axisManager = new
|
|
7279
|
+
}), this.axisManager = new Pn({
|
|
7168
7280
|
xAxisOptions: this.xAxisOptions,
|
|
7169
7281
|
xScale: this.xScale,
|
|
7170
7282
|
yAxisOptionsMap: this.yAxisOptionsMap,
|
|
@@ -7172,7 +7284,7 @@ class Qn {
|
|
|
7172
7284
|
primaryYAxisId: this.primaryYAxisId,
|
|
7173
7285
|
series: this.series,
|
|
7174
7286
|
requestRender: () => this.requestRender()
|
|
7175
|
-
}), this.stateManager = new
|
|
7287
|
+
}), this.stateManager = new Rn({
|
|
7176
7288
|
viewBounds: this.viewBounds,
|
|
7177
7289
|
xAxisOptions: this.xAxisOptions,
|
|
7178
7290
|
xScale: this.xScale,
|
|
@@ -7193,7 +7305,7 @@ class Qn {
|
|
|
7193
7305
|
removeSeries: (o) => this.removeSeries(o),
|
|
7194
7306
|
addSeries: (o) => this.addSeries(o),
|
|
7195
7307
|
requestRender: () => this.requestRender()
|
|
7196
|
-
}), this.renderLoop = new
|
|
7308
|
+
}), this.renderLoop = new zn({
|
|
7197
7309
|
webglCanvas: this.webglCanvas,
|
|
7198
7310
|
overlayCanvas: this.overlayCanvas,
|
|
7199
7311
|
overlayCtx: this.overlayCtx,
|
|
@@ -7227,7 +7339,7 @@ class Qn {
|
|
|
7227
7339
|
get yScale() {
|
|
7228
7340
|
return this.yScales.get(this.primaryYAxisId) || this.yScales.values().next().value;
|
|
7229
7341
|
}
|
|
7230
|
-
}), this.interaction = new
|
|
7342
|
+
}), this.interaction = new li(
|
|
7231
7343
|
this.container,
|
|
7232
7344
|
{
|
|
7233
7345
|
onZoom: (o, r) => {
|
|
@@ -7264,6 +7376,7 @@ class Qn {
|
|
|
7264
7376
|
var o;
|
|
7265
7377
|
this.cursorPosition = null, (o = this.cursorOptions) != null && o.enabled && (this.container.style.cursor = "default"), this.hoveredSeriesId && (this.hoveredSeriesId = null, this.requestRender()), this.tooltip && this.tooltip.handleCursorLeave(), this.requestOverlayRender();
|
|
7266
7378
|
},
|
|
7379
|
+
onDoubleTap: () => this.resetZoom(),
|
|
7267
7380
|
onBoxSelect: (o, r) => {
|
|
7268
7381
|
if (o) {
|
|
7269
7382
|
const a = this.xScale, h = this.yScales.get(this.primaryYAxisId);
|
|
@@ -7323,7 +7436,7 @@ class Qn {
|
|
|
7323
7436
|
},
|
|
7324
7437
|
() => this.getPlotArea(),
|
|
7325
7438
|
(o) => this.getInteractedBounds(o),
|
|
7326
|
-
() =>
|
|
7439
|
+
() => un(this.yAxisOptionsMap)
|
|
7327
7440
|
), this.resizeObserver = new ResizeObserver(() => {
|
|
7328
7441
|
!this.isDestroyed && !this.resizeSuspended && this.resize();
|
|
7329
7442
|
}), this.resizeObserver.observe(this.container), this.initControls(), this.initLegend(e);
|
|
@@ -7421,7 +7534,7 @@ class Qn {
|
|
|
7421
7534
|
e.fn();
|
|
7422
7535
|
} catch (t) {
|
|
7423
7536
|
console.error(
|
|
7424
|
-
`[
|
|
7537
|
+
`[VeloPlot] Error executing queued command '${e.name}':`,
|
|
7425
7538
|
t
|
|
7426
7539
|
);
|
|
7427
7540
|
}
|
|
@@ -7432,7 +7545,7 @@ class Qn {
|
|
|
7432
7545
|
* Mark this chart's initialization as complete in the queue
|
|
7433
7546
|
*/
|
|
7434
7547
|
async completeInit() {
|
|
7435
|
-
this.initQueueId && (this._isDestroyed || (await this.animationEngine.waitForIdle(), await new Promise((e) => setTimeout(e, 60))), this.initQueueId && (
|
|
7548
|
+
this.initQueueId && (this._isDestroyed || (await this.animationEngine.waitForIdle(), await new Promise((e) => setTimeout(e, 60))), this.initQueueId && (Ee(this.initQueueId), this.initQueueId = null));
|
|
7436
7549
|
}
|
|
7437
7550
|
executeOrQueue(e, t) {
|
|
7438
7551
|
this.renderLoop.isInitStarted() ? t() : this.commandQueue.push({ fn: t, name: e });
|
|
@@ -7444,7 +7557,7 @@ class Qn {
|
|
|
7444
7557
|
this.initQueueId = e;
|
|
7445
7558
|
}
|
|
7446
7559
|
initControls() {
|
|
7447
|
-
this.controls =
|
|
7560
|
+
this.controls = wn({
|
|
7448
7561
|
container: this.container,
|
|
7449
7562
|
theme: this.theme,
|
|
7450
7563
|
showControls: this.showControls,
|
|
@@ -7480,7 +7593,7 @@ class Qn {
|
|
|
7480
7593
|
initLegend(e) {
|
|
7481
7594
|
var n;
|
|
7482
7595
|
const t = (n = e.layout) == null ? void 0 : n.legend;
|
|
7483
|
-
this.legend =
|
|
7596
|
+
this.legend = Mn(
|
|
7484
7597
|
{
|
|
7485
7598
|
container: this.container,
|
|
7486
7599
|
theme: this.theme,
|
|
@@ -7517,7 +7630,7 @@ class Qn {
|
|
|
7517
7630
|
if (this.hoveredSeriesId = s.getId(), o) {
|
|
7518
7631
|
const l = s.getStyle();
|
|
7519
7632
|
this.originalSeriesStyles.set(s.getId(), { ...l });
|
|
7520
|
-
const h = ((r = this.colorScheme) == null ? void 0 : r.highlightColor) ||
|
|
7633
|
+
const h = ((r = this.colorScheme) == null ? void 0 : r.highlightColor) || Lt(l.color || "#ff0055", this.theme.isDark);
|
|
7521
7634
|
s.setStyle({
|
|
7522
7635
|
color: h
|
|
7523
7636
|
}), (a = this.legend) == null || a.updateSeriesStyle(s);
|
|
@@ -7541,14 +7654,14 @@ class Qn {
|
|
|
7541
7654
|
);
|
|
7542
7655
|
}
|
|
7543
7656
|
setTheme(e) {
|
|
7544
|
-
this.baseTheme = typeof e == "string" ?
|
|
7657
|
+
this.baseTheme = typeof e == "string" ? it(e) : e, this.theme = this.responsiveManager.scaleTheme(this.baseTheme), this.backgroundColor = _(this.theme.backgroundColor), this.plotAreaBackground = _(this.theme.plotAreaBackground || this.theme.backgroundColor), this.container.style.backgroundColor = this.theme.backgroundColor, this.overlay.setTheme(this.theme), this.tooltip.updateChartTheme(this.theme), this.controls && this.controls.updateTheme(this.theme), this.legend && this.legend.updateTheme(this.theme), this.initialOptions.colorScheme || (this.colorScheme = $e(this.theme.isDark)), this.requestRender();
|
|
7545
7658
|
}
|
|
7546
7659
|
/**
|
|
7547
7660
|
* Set the color scheme for multi-series charts
|
|
7548
7661
|
* @param scheme - Color scheme name ('vibrant', 'pastel', 'neon', 'earth', 'ocean') or ColorScheme object
|
|
7549
7662
|
*/
|
|
7550
7663
|
setColorScheme(e) {
|
|
7551
|
-
this.colorScheme = typeof e == "string" ?
|
|
7664
|
+
this.colorScheme = typeof e == "string" ? Ye(e) : e, this.requestRender();
|
|
7552
7665
|
}
|
|
7553
7666
|
/**
|
|
7554
7667
|
* Get the current color scheme
|
|
@@ -7557,7 +7670,7 @@ class Qn {
|
|
|
7557
7670
|
return this.colorScheme;
|
|
7558
7671
|
}
|
|
7559
7672
|
getPlotArea() {
|
|
7560
|
-
return
|
|
7673
|
+
return cn(this.container, this.yAxisOptionsMap, this.layout);
|
|
7561
7674
|
}
|
|
7562
7675
|
getInteractedBounds(e) {
|
|
7563
7676
|
if (e) {
|
|
@@ -7572,7 +7685,7 @@ class Qn {
|
|
|
7572
7685
|
return this.viewBounds;
|
|
7573
7686
|
}
|
|
7574
7687
|
exportImage(e = "png") {
|
|
7575
|
-
return
|
|
7688
|
+
return gi(
|
|
7576
7689
|
this.webglCanvas,
|
|
7577
7690
|
this.overlayCanvas,
|
|
7578
7691
|
this.backgroundColor,
|
|
@@ -7584,7 +7697,7 @@ class Qn {
|
|
|
7584
7697
|
}
|
|
7585
7698
|
exportSVG() {
|
|
7586
7699
|
const e = this.container.getBoundingClientRect();
|
|
7587
|
-
return
|
|
7700
|
+
return yi(
|
|
7588
7701
|
this.getAllSeries(),
|
|
7589
7702
|
this.viewBounds,
|
|
7590
7703
|
this.getPlotArea(),
|
|
@@ -7627,7 +7740,7 @@ class Qn {
|
|
|
7627
7740
|
};
|
|
7628
7741
|
}
|
|
7629
7742
|
addSeries(e) {
|
|
7630
|
-
|
|
7743
|
+
tn(this.getSeriesContext(), e);
|
|
7631
7744
|
const t = this.series.get(e.id);
|
|
7632
7745
|
t && this.pluginManager.notifySeriesAdd({ series: t, changeType: "add" });
|
|
7633
7746
|
}
|
|
@@ -7639,11 +7752,11 @@ class Qn {
|
|
|
7639
7752
|
}
|
|
7640
7753
|
removeSeries(e) {
|
|
7641
7754
|
const t = this.series.get(e);
|
|
7642
|
-
|
|
7755
|
+
sn(this.getSeriesContext(), e), t && this.pluginManager.notifySeriesRemove({ series: t, changeType: "remove" });
|
|
7643
7756
|
}
|
|
7644
7757
|
updateSeries(e, t) {
|
|
7645
7758
|
var s, o;
|
|
7646
|
-
|
|
7759
|
+
on(this.getSeriesContext(), e, t), this.recalculateTools();
|
|
7647
7760
|
const n = this.series.get(e);
|
|
7648
7761
|
n && this.pluginManager.notifyDataUpdate({
|
|
7649
7762
|
seriesId: e,
|
|
@@ -7653,7 +7766,7 @@ class Qn {
|
|
|
7653
7766
|
}), this.alertManager.evaluate();
|
|
7654
7767
|
}
|
|
7655
7768
|
appendData(e, t, n) {
|
|
7656
|
-
|
|
7769
|
+
rn(this.getSeriesContext(), e, t, n), this.recalculateTools();
|
|
7657
7770
|
const s = this.series.get(e);
|
|
7658
7771
|
s && this.pluginManager.notifyDataUpdate({
|
|
7659
7772
|
seriesId: e,
|
|
@@ -7666,7 +7779,7 @@ class Qn {
|
|
|
7666
7779
|
this.autoScroll = e;
|
|
7667
7780
|
}
|
|
7668
7781
|
setMaxPoints(e, t) {
|
|
7669
|
-
|
|
7782
|
+
an(this.getSeriesContext(), e, t);
|
|
7670
7783
|
}
|
|
7671
7784
|
/**
|
|
7672
7785
|
* Add a line of best fit to a series
|
|
@@ -7683,7 +7796,7 @@ class Qn {
|
|
|
7683
7796
|
* For stacked layouts use buildIndicatorPaneFromPreset() when creating panes.
|
|
7684
7797
|
*/
|
|
7685
7798
|
async addIndicator(e, t) {
|
|
7686
|
-
return
|
|
7799
|
+
return Zn(this, e, t);
|
|
7687
7800
|
}
|
|
7688
7801
|
addAlert(e) {
|
|
7689
7802
|
return this.alertManager.addAlert(e);
|
|
@@ -7699,7 +7812,7 @@ class Qn {
|
|
|
7699
7812
|
}
|
|
7700
7813
|
addPositionLine(e) {
|
|
7701
7814
|
const t = e.id ?? `position-${++this.positionLineCounter}`;
|
|
7702
|
-
return this.addAnnotation(
|
|
7815
|
+
return this.addAnnotation(es(e, t)), t;
|
|
7703
7816
|
}
|
|
7704
7817
|
setDrawingMode(e) {
|
|
7705
7818
|
var n;
|
|
@@ -7736,15 +7849,15 @@ class Qn {
|
|
|
7736
7849
|
zoom(e) {
|
|
7737
7850
|
const t = { ...this.viewBounds };
|
|
7738
7851
|
if (this.animationConfig.enabled && e.animate !== !1) {
|
|
7739
|
-
const n =
|
|
7852
|
+
const n = Ti(
|
|
7740
7853
|
this.getAnimatedNavContext(),
|
|
7741
7854
|
e
|
|
7742
7855
|
);
|
|
7743
7856
|
n && n.promise.catch((s) => {
|
|
7744
|
-
s.message !== "Animation cancelled" && console.error("[
|
|
7857
|
+
s.message !== "Animation cancelled" && console.error("[VeloPlot] Animation error:", s);
|
|
7745
7858
|
});
|
|
7746
7859
|
} else
|
|
7747
|
-
|
|
7860
|
+
wi(this.getNavContext(), e);
|
|
7748
7861
|
this.pluginManager.notifyViewChange({
|
|
7749
7862
|
previous: t,
|
|
7750
7863
|
current: { ...this.viewBounds },
|
|
@@ -7754,7 +7867,7 @@ class Qn {
|
|
|
7754
7867
|
}
|
|
7755
7868
|
pan(e, t, n) {
|
|
7756
7869
|
const s = { ...this.viewBounds };
|
|
7757
|
-
|
|
7870
|
+
Mi(this.getNavContext(), e, t, n), this.pluginManager.notifyViewChange({
|
|
7758
7871
|
previous: s,
|
|
7759
7872
|
current: { ...this.viewBounds },
|
|
7760
7873
|
trigger: "pan",
|
|
@@ -7767,7 +7880,7 @@ class Qn {
|
|
|
7767
7880
|
fit(e) {
|
|
7768
7881
|
this.executeOrQueue("fit", () => {
|
|
7769
7882
|
const t = { ...this.viewBounds }, n = e == null ? void 0 : e.padding;
|
|
7770
|
-
|
|
7883
|
+
Ci(this.getNavContext(), {
|
|
7771
7884
|
x: e == null ? void 0 : e.x,
|
|
7772
7885
|
y: e == null ? void 0 : e.y,
|
|
7773
7886
|
padding: n
|
|
@@ -7789,15 +7902,15 @@ class Qn {
|
|
|
7789
7902
|
this.executeOrQueue("autoScale", () => {
|
|
7790
7903
|
const t = { ...this.viewBounds };
|
|
7791
7904
|
if (this.animationConfig.enabled && e) {
|
|
7792
|
-
const n =
|
|
7905
|
+
const n = Bi(
|
|
7793
7906
|
this.getAnimatedNavContext(),
|
|
7794
7907
|
!0
|
|
7795
7908
|
);
|
|
7796
7909
|
n && n.promise.catch((s) => {
|
|
7797
|
-
s.message !== "Animation cancelled" && console.error("[
|
|
7910
|
+
s.message !== "Animation cancelled" && console.error("[VeloPlot] Animation error:", s);
|
|
7798
7911
|
});
|
|
7799
7912
|
} else
|
|
7800
|
-
|
|
7913
|
+
Si(this.getNavContext());
|
|
7801
7914
|
this.pluginManager.notifyViewChange({
|
|
7802
7915
|
previous: t,
|
|
7803
7916
|
current: { ...this.viewBounds },
|
|
@@ -7811,14 +7924,14 @@ class Qn {
|
|
|
7811
7924
|
* Used during streaming to prevent X-axis shifting
|
|
7812
7925
|
*/
|
|
7813
7926
|
autoScaleYOnly() {
|
|
7814
|
-
|
|
7927
|
+
Ai(this.getNavContext()), this.requestRender();
|
|
7815
7928
|
}
|
|
7816
7929
|
/**
|
|
7817
7930
|
* Animate view bounds to specific target
|
|
7818
7931
|
*/
|
|
7819
7932
|
animateTo(e) {
|
|
7820
7933
|
var n, s, o, r;
|
|
7821
|
-
const t =
|
|
7934
|
+
const t = Ii(
|
|
7822
7935
|
this.getAnimatedNavContext(),
|
|
7823
7936
|
{
|
|
7824
7937
|
xMin: (n = e.xRange) == null ? void 0 : n[0],
|
|
@@ -7832,7 +7945,7 @@ class Qn {
|
|
|
7832
7945
|
}
|
|
7833
7946
|
);
|
|
7834
7947
|
t && t.promise.catch((a) => {
|
|
7835
|
-
a.message !== "Animation cancelled" && console.error("[
|
|
7948
|
+
a.message !== "Animation cancelled" && console.error("[VeloPlot] Animation error:", a);
|
|
7836
7949
|
});
|
|
7837
7950
|
}
|
|
7838
7951
|
/**
|
|
@@ -7845,7 +7958,7 @@ class Qn {
|
|
|
7845
7958
|
* Set animation configuration
|
|
7846
7959
|
*/
|
|
7847
7960
|
setAnimationConfig(e) {
|
|
7848
|
-
this.animationConfig =
|
|
7961
|
+
this.animationConfig = Ve({
|
|
7849
7962
|
...this.animationConfig,
|
|
7850
7963
|
...e
|
|
7851
7964
|
});
|
|
@@ -7858,7 +7971,7 @@ class Qn {
|
|
|
7858
7971
|
}
|
|
7859
7972
|
handleBoxZoom(e) {
|
|
7860
7973
|
const t = e === null;
|
|
7861
|
-
this.selectionRect =
|
|
7974
|
+
this.selectionRect = ki(
|
|
7862
7975
|
this.getNavContext(),
|
|
7863
7976
|
e,
|
|
7864
7977
|
this.selectionRect,
|
|
@@ -7917,10 +8030,10 @@ class Qn {
|
|
|
7917
8030
|
}
|
|
7918
8031
|
// Export
|
|
7919
8032
|
exportCSV(e) {
|
|
7920
|
-
return
|
|
8033
|
+
return di(this.getAllSeries(), e);
|
|
7921
8034
|
}
|
|
7922
8035
|
exportJSON(e) {
|
|
7923
|
-
return
|
|
8036
|
+
return fi(this.getAllSeries(), this.viewBounds, e);
|
|
7924
8037
|
}
|
|
7925
8038
|
// ============================================
|
|
7926
8039
|
// Axis Management
|
|
@@ -7955,7 +8068,7 @@ class Qn {
|
|
|
7955
8068
|
}
|
|
7956
8069
|
async initGpuRenderer() {
|
|
7957
8070
|
var t, n;
|
|
7958
|
-
const e = await
|
|
8071
|
+
const e = await Qt(this.webglCanvas, {
|
|
7959
8072
|
backend: "webgpu",
|
|
7960
8073
|
powerPreference: "high-performance"
|
|
7961
8074
|
});
|
|
@@ -7964,7 +8077,7 @@ class Qn {
|
|
|
7964
8077
|
return;
|
|
7965
8078
|
}
|
|
7966
8079
|
console.warn(
|
|
7967
|
-
"[
|
|
8080
|
+
"[VeloPlot] WebGPU unavailable — falling back to WebGL2. See docs/adr/001-webgpu-renderer-strategy.md."
|
|
7968
8081
|
), this.renderer = new Pe(this.webglCanvas), this.activeRendererType = "webgl", this.renderer.setDPR(this.dpr), (n = this.renderLoop) == null || n.setRenderer(this.renderer);
|
|
7969
8082
|
}
|
|
7970
8083
|
/**
|
|
@@ -7990,9 +8103,13 @@ class Qn {
|
|
|
7990
8103
|
this.axisManager.updateXAxis(e), this.requestRender();
|
|
7991
8104
|
}
|
|
7992
8105
|
updateLayout(e) {
|
|
7993
|
-
this.layout =
|
|
8106
|
+
this.layout = at({
|
|
7994
8107
|
...this.layout,
|
|
7995
|
-
...e
|
|
8108
|
+
...e,
|
|
8109
|
+
margins: {
|
|
8110
|
+
...this.layout.margins,
|
|
8111
|
+
...e.margins
|
|
8112
|
+
}
|
|
7996
8113
|
}), this.requestRender();
|
|
7997
8114
|
}
|
|
7998
8115
|
/**
|
|
@@ -8066,7 +8183,7 @@ class Qn {
|
|
|
8066
8183
|
}
|
|
8067
8184
|
/**
|
|
8068
8185
|
* Set pan mode (true = pan, false = selection)
|
|
8069
|
-
* @deprecated Use setMode('pan') or setMode('select') instead
|
|
8186
|
+
* @deprecated Use setMode('pan') or setMode('select') instead. **Removed in v4.0.**
|
|
8070
8187
|
*/
|
|
8071
8188
|
setPanMode(e) {
|
|
8072
8189
|
this.interaction.setPanMode(e);
|
|
@@ -8079,9 +8196,9 @@ class Qn {
|
|
|
8079
8196
|
if (this.getMode() === e) return;
|
|
8080
8197
|
this.selectionManager.clearSelection();
|
|
8081
8198
|
const n = this.getPluginAPI("velo-plot-tools");
|
|
8082
|
-
e === "delta" || e === "peak" ? n ? n.setMode(e) : (console.info(`[
|
|
8199
|
+
e === "delta" || e === "peak" ? n ? n.setMode(e) : (console.info(`[VeloPlot] Tools plugin not ready, retrying setMode('${e}')...`), setTimeout(() => {
|
|
8083
8200
|
const s = this.getPluginAPI("velo-plot-tools");
|
|
8084
|
-
s ? s.setMode(e) : console.warn(`[
|
|
8201
|
+
s ? s.setMode(e) : console.warn(`[VeloPlot] Tools plugin still not available for mode '${e}'`);
|
|
8085
8202
|
}, 100)) : n && n.setMode("none"), this.interaction.setMode(e);
|
|
8086
8203
|
}
|
|
8087
8204
|
/**
|
|
@@ -8193,7 +8310,7 @@ class Qn {
|
|
|
8193
8310
|
this.resizeSuspended && (this.resizeSuspended = !1);
|
|
8194
8311
|
}
|
|
8195
8312
|
}
|
|
8196
|
-
/** @deprecated Use CSS transform on pane wrapper during drag; canvas stays untouched. */
|
|
8313
|
+
/** @deprecated Use CSS transform on pane wrapper during drag; canvas stays untouched. **Removed in v4.0.** */
|
|
8197
8314
|
syncDragLayout(e, t) {
|
|
8198
8315
|
if (!this.resizeSuspended) return;
|
|
8199
8316
|
const n = this.container.parentElement, s = Math.max(
|
|
@@ -8213,7 +8330,7 @@ class Qn {
|
|
|
8213
8330
|
resize() {
|
|
8214
8331
|
if (this.isDestroyed || this.resizeSuspended || !this.renderer) return;
|
|
8215
8332
|
const e = this.dprOverride ?? this.initialOptions.devicePixelRatio ?? window.devicePixelRatio;
|
|
8216
|
-
Math.abs(e - this.dpr) > 1e-3 && (this.dpr = e, this.renderer.setDPR(this.dpr)),
|
|
8333
|
+
Math.abs(e - this.dpr) > 1e-3 && (this.dpr = e, this.renderer.setDPR(this.dpr)), dn(
|
|
8217
8334
|
this.container,
|
|
8218
8335
|
this.webglCanvas,
|
|
8219
8336
|
this.overlayCanvas,
|
|
@@ -8257,7 +8374,7 @@ class Qn {
|
|
|
8257
8374
|
}
|
|
8258
8375
|
destroy() {
|
|
8259
8376
|
var e, t;
|
|
8260
|
-
for (this._isDestroyed = !0, this.renderLoop.cancelPendingRender(), (e = this.resizeObserver) == null || e.disconnect(), this.resizeObserver = null, this.initQueueId && (
|
|
8377
|
+
for (this._isDestroyed = !0, this.renderLoop.cancelPendingRender(), (e = this.resizeObserver) == null || e.disconnect(), this.resizeObserver = null, this.initQueueId && (Ee(this.initQueueId), this.initQueueId = null), this.animationEngine.destroy(), this.selectionManager.destroy(), this.alertManager.destroy(), this.responsiveManager.destroy(), this.interaction.destroy(), this.series.forEach((n) => {
|
|
8261
8378
|
var s;
|
|
8262
8379
|
(s = this.renderer) == null || s.deleteBuffer(n.getId()), n.destroy();
|
|
8263
8380
|
}), this.series.clear(), (t = this.renderer) == null || t.destroy(), this.controls && this.controls.destroy(), this.legend && this.legend.destroy(), this.pluginManager.destroy(); this.container.firstChild; )
|
|
@@ -8273,11 +8390,11 @@ class Qn {
|
|
|
8273
8390
|
this.selectionManager.clearSelection(), await new Promise((e) => requestAnimationFrame(() => requestAnimationFrame(e))), this.animationEngine.isAnimating() && await this.animationEngine.waitForIdle(), this.deltaTool && this.deltaTool.recalculate(), this.peakTool && this.peakTool.recalculate(), this.requestOverlayRender();
|
|
8274
8391
|
}
|
|
8275
8392
|
}
|
|
8276
|
-
function
|
|
8277
|
-
const e = new
|
|
8278
|
-
return
|
|
8393
|
+
function Cs(i) {
|
|
8394
|
+
const e = new ts(i);
|
|
8395
|
+
return Cn().then((t) => {
|
|
8279
8396
|
if (e.setInitQueueId(t), e.isDestroyed) {
|
|
8280
|
-
|
|
8397
|
+
Ee(t);
|
|
8281
8398
|
return;
|
|
8282
8399
|
}
|
|
8283
8400
|
e.startInit().then(() => {
|
|
@@ -8286,65 +8403,65 @@ function bs(i) {
|
|
|
8286
8403
|
}), e;
|
|
8287
8404
|
}
|
|
8288
8405
|
export {
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8406
|
+
ds as $,
|
|
8407
|
+
st as A,
|
|
8408
|
+
Ve as B,
|
|
8409
|
+
us as C,
|
|
8410
|
+
Ie as D,
|
|
8411
|
+
oi as E,
|
|
8412
|
+
An as F,
|
|
8413
|
+
ms as G,
|
|
8414
|
+
ps as H,
|
|
8415
|
+
xs as I,
|
|
8416
|
+
bs as J,
|
|
8417
|
+
Ke as K,
|
|
8418
|
+
te as L,
|
|
8419
|
+
ii as M,
|
|
8303
8420
|
Pe as N,
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
|
|
8318
|
-
|
|
8319
|
-
|
|
8320
|
-
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8421
|
+
ai as O,
|
|
8422
|
+
_ as P,
|
|
8423
|
+
O as Q,
|
|
8424
|
+
lt as R,
|
|
8425
|
+
$i as S,
|
|
8426
|
+
Ne as T,
|
|
8427
|
+
He as U,
|
|
8428
|
+
Tn as V,
|
|
8429
|
+
Bn as W,
|
|
8430
|
+
In as X,
|
|
8431
|
+
En as Y,
|
|
8432
|
+
vs as Z,
|
|
8433
|
+
ws as _,
|
|
8434
|
+
ie as a,
|
|
8435
|
+
On as a0,
|
|
8436
|
+
ut as a1,
|
|
8437
|
+
fs as a2,
|
|
8438
|
+
es as a3,
|
|
8439
|
+
pn as a4,
|
|
8440
|
+
xn as a5,
|
|
8441
|
+
gs as b,
|
|
8442
|
+
Cs as c,
|
|
8443
|
+
ni as d,
|
|
8444
|
+
ri as e,
|
|
8445
|
+
cs as f,
|
|
8446
|
+
it as g,
|
|
8447
|
+
Xn as h,
|
|
8448
|
+
Nn as i,
|
|
8449
|
+
Ms as j,
|
|
8450
|
+
Zn as k,
|
|
8451
|
+
Ss as l,
|
|
8452
|
+
Wn as m,
|
|
8453
|
+
jn as n,
|
|
8454
|
+
Ji as o,
|
|
8455
|
+
at as p,
|
|
8456
|
+
ae as q,
|
|
8457
|
+
_n as r,
|
|
8458
|
+
Vn as s,
|
|
8459
|
+
Me as t,
|
|
8460
|
+
ct as u,
|
|
8461
|
+
Un as v,
|
|
8462
|
+
ys as w,
|
|
8463
|
+
$ as x,
|
|
8464
|
+
Pi as y,
|
|
8465
|
+
N as z
|
|
8349
8466
|
};
|
|
8350
|
-
//# sourceMappingURL=ChartCore-
|
|
8467
|
+
//# sourceMappingURL=ChartCore-BpzRvN4Y.js.map
|