velo-plot 2.0.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-BhQ4j7f5.js → ChartCore-BpzRvN4Y.js} +998 -855
- 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/{axisFormat-SPX-CD5s.js → axisFormat-CzumxpCL.js} +3 -3
- package/dist/axisFormat-CzumxpCL.js.map +1 -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/ChartAxisManager.d.ts +2 -0
- package/dist/core/chart/ChartCore.d.ts +17 -2
- package/dist/core/chart/ChartPluginBridge.d.ts +1 -0
- package/dist/core/chart/ChartRenderLoop.d.ts +2 -0
- package/dist/core/chart/ChartStateManager.d.ts +2 -0
- package/dist/core/chart/types.d.ts +6 -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/sync/index.d.ts +0 -1
- 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-D7dTq6VB.js → index-0InEyj0q.js} +130 -134
- 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-CUGS98p4.js → index-CaXWSOTk.js} +3 -6
- package/dist/index-CaXWSOTk.js.map +1 -0
- package/dist/index-Dag88bW4.js.map +1 -1
- package/dist/index-qhscKTDy.js.map +1 -1
- package/dist/{index-CWipqOLP.js → index-qunX30Xu.js} +2 -2
- package/dist/index-qunX30Xu.js.map +1 -0
- package/dist/index-x4stH3jD.js.map +1 -1
- package/dist/{index.core-fpZ1dYN0.js → index.core-BmZe2jRQ.js} +30 -29
- package/dist/index.core-BmZe2jRQ.js.map +1 -0
- package/dist/index.core.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/indicators--eJGmVox.js.map +1 -1
- package/dist/{mockDatafeed-Cdg5hKEo.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/contours.d.ts +31 -0
- 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 +495 -408
- 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/broken-axis.js +170 -181
- package/dist/plugins/broken-axis.js.map +1 -1
- 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/algorithms.d.ts +7 -2
- package/dist/plugins/forecasting/index.d.ts +1 -1
- package/dist/plugins/forecasting/types.d.ts +13 -3
- package/dist/plugins/forecasting.js +355 -175
- 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/symbols.d.ts +50 -0
- package/dist/plugins/latex/types.d.ts +13 -1
- package/dist/plugins/latex.js +351 -331
- 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/native-algorithms.d.ts +24 -4
- package/dist/plugins/ml-integration/types.d.ts +19 -0
- package/dist/plugins/ml-integration.d.ts +2 -2
- package/dist/plugins/ml-integration.js +190 -139
- package/dist/plugins/ml-integration.js.map +1 -1
- package/dist/plugins/offscreen.d.ts +2 -2
- package/dist/plugins/pattern-recognition/types.d.ts +28 -1
- package/dist/plugins/pattern-recognition.d.ts +2 -2
- package/dist/plugins/pattern-recognition.js +417 -344
- 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 +36 -36
- 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 +1 -1
- 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/tools.js +1 -1
- 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/symbols-DT0eLlpW.js +568 -0
- package/dist/symbols-DT0eLlpW.js.map +1 -0
- package/dist/testing/index.d.ts +1 -1
- package/dist/theme/index.d.ts +2 -1
- package/dist/trading.js +7 -7
- 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 +444 -433
- 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 +26 -0
- package/dist/workers/pool.d.ts +9 -0
- package/package.json +88 -10
- package/dist/ChartCore-BhQ4j7f5.js.map +0 -1
- package/dist/SciPlot-GJvw7GJo.js +0 -463
- package/dist/SciPlot-GJvw7GJo.js.map +0 -1
- package/dist/axisFormat-SPX-CD5s.js.map +0 -1
- package/dist/createStackedChart-DJSmqerD.js +0 -706
- package/dist/createStackedChart-DJSmqerD.js.map +0 -1
- package/dist/index-CUGS98p4.js.map +0 -1
- package/dist/index-CWipqOLP.js.map +0 -1
- package/dist/index-D7dTq6VB.js.map +0 -1
- package/dist/index-DoYxf1cV.js.map +0 -1
- package/dist/index.core-fpZ1dYN0.js.map +0 -1
- package/dist/mockDatafeed-Cdg5hKEo.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
|
@@ -0,0 +1,756 @@
|
|
|
1
|
+
import { p as It, q as J, c as Ct, t as Ut, k as Kt, u as Qt, v as Zt, l as Vt, w as Jt } from "./ChartCore-BpzRvN4Y.js";
|
|
2
|
+
import { c as te } from "./index-CaXWSOTk.js";
|
|
3
|
+
const rt = 5, ct = 1 / 6, Ft = { top: 4, bottom: 8, left: 4 }, Ht = { bottom: 55 };
|
|
4
|
+
function ee(t) {
|
|
5
|
+
if (typeof t == "number") return t;
|
|
6
|
+
switch (t) {
|
|
7
|
+
case "8k":
|
|
8
|
+
return 8;
|
|
9
|
+
case "4k":
|
|
10
|
+
return 4;
|
|
11
|
+
case "2k":
|
|
12
|
+
return 2;
|
|
13
|
+
default:
|
|
14
|
+
return 1;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function ne(t) {
|
|
18
|
+
return new Promise((e, o) => {
|
|
19
|
+
const r = new Image();
|
|
20
|
+
r.onload = () => e(r), r.onerror = o, r.src = t;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function Mt(t, e) {
|
|
24
|
+
const o = t.getBoundingClientRect();
|
|
25
|
+
return {
|
|
26
|
+
x: o.left - e.left,
|
|
27
|
+
y: o.top - e.top,
|
|
28
|
+
width: o.width,
|
|
29
|
+
height: o.height
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
async function oe(t, e, o, r, a, u = {}) {
|
|
33
|
+
var g;
|
|
34
|
+
const {
|
|
35
|
+
format: x = "png",
|
|
36
|
+
quality: $ = 0.92,
|
|
37
|
+
resolution: y = "standard",
|
|
38
|
+
includeBackground: P = !0,
|
|
39
|
+
includeDividers: X = !0,
|
|
40
|
+
transparent: O = !1
|
|
41
|
+
} = u, L = ee(y), C = (((g = o[0]) == null ? void 0 : g.getDPR()) ?? (typeof window < "u" ? window.devicePixelRatio : 1)) * L, j = o.map((d) => d.getDPR());
|
|
42
|
+
try {
|
|
43
|
+
if (L > 1) {
|
|
44
|
+
for (const c of o)
|
|
45
|
+
typeof c.setDevicePixelRatioOverride == "function" ? c.setDevicePixelRatioOverride(C) : c.setDPR(C), c.render();
|
|
46
|
+
await new Promise((c) => requestAnimationFrame(c)), await new Promise((c) => requestAnimationFrame(c)), await new Promise((c) => setTimeout(c, 50));
|
|
47
|
+
}
|
|
48
|
+
const d = t.getBoundingClientRect(), I = Math.max(1, Math.round(d.width * C)), z = Math.max(1, Math.round(d.height * C)), A = document.createElement("canvas");
|
|
49
|
+
A.width = I, A.height = z;
|
|
50
|
+
const R = A.getContext("2d");
|
|
51
|
+
if (!R) throw new Error("Failed to create export canvas");
|
|
52
|
+
!O && P && (R.fillStyle = a || "#ffffff", R.fillRect(0, 0, I, z));
|
|
53
|
+
const Y = x === "jpeg" ? "jpeg" : "png";
|
|
54
|
+
for (let c = 0; c < e.length; c++) {
|
|
55
|
+
const h = Mt(e[c], d), f = o[c].exportImage(Y), m = await ne(f);
|
|
56
|
+
R.drawImage(
|
|
57
|
+
m,
|
|
58
|
+
Math.round(h.x * C),
|
|
59
|
+
Math.round(h.y * C),
|
|
60
|
+
Math.round(h.width * C),
|
|
61
|
+
Math.round(h.height * C)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
if (X && r.length) {
|
|
65
|
+
R.fillStyle = "rgba(128, 128, 128, 0.35)";
|
|
66
|
+
for (const c of r) {
|
|
67
|
+
const h = Mt(c, d);
|
|
68
|
+
R.fillRect(
|
|
69
|
+
Math.round(h.x * C),
|
|
70
|
+
Math.round(h.y * C),
|
|
71
|
+
Math.max(1, Math.round(h.width * C)),
|
|
72
|
+
Math.max(1, Math.round(h.height * C))
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const E = x === "jpeg" ? "image/jpeg" : x === "webp" ? "image/webp" : "image/png";
|
|
77
|
+
return A.toDataURL(E, $);
|
|
78
|
+
} finally {
|
|
79
|
+
if (L > 1)
|
|
80
|
+
for (let d = 0; d < o.length; d++)
|
|
81
|
+
typeof o[d].setDevicePixelRatioOverride == "function" ? o[d].setDevicePixelRatioOverride(null) : o[d].setDPR(j[d]), o[d].render();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const D = "velo-pane-divider", H = "velo-pane-resizing";
|
|
85
|
+
function ie(t) {
|
|
86
|
+
if (typeof document > "u") return;
|
|
87
|
+
let e = document.getElementById("velo-pane-divider-styles");
|
|
88
|
+
e || (e = document.createElement("style"), e.id = "velo-pane-divider-styles", document.head.appendChild(e));
|
|
89
|
+
const r = t === "horizontal" ? "ew-resize" : "ns-resize";
|
|
90
|
+
e.textContent = `
|
|
91
|
+
.${D} {
|
|
92
|
+
flex: 0 0 var(--velo-divider-size, 6px);
|
|
93
|
+
position: relative;
|
|
94
|
+
cursor: ${r};
|
|
95
|
+
touch-action: none;
|
|
96
|
+
z-index: 20;
|
|
97
|
+
background: transparent;
|
|
98
|
+
user-select: none;
|
|
99
|
+
}
|
|
100
|
+
.${D}::after {
|
|
101
|
+
content: "";
|
|
102
|
+
position: absolute;
|
|
103
|
+
background: rgba(128, 128, 128, 0.35);
|
|
104
|
+
transition: background 0.15s;
|
|
105
|
+
}
|
|
106
|
+
.${D}[data-direction="vertical"]::after {
|
|
107
|
+
left: 0;
|
|
108
|
+
right: 0;
|
|
109
|
+
top: 50%;
|
|
110
|
+
transform: translateY(-50%);
|
|
111
|
+
height: 1px;
|
|
112
|
+
}
|
|
113
|
+
.${D}[data-direction="horizontal"]::after {
|
|
114
|
+
top: 0;
|
|
115
|
+
bottom: 0;
|
|
116
|
+
left: 50%;
|
|
117
|
+
transform: translateX(-50%);
|
|
118
|
+
width: 1px;
|
|
119
|
+
}
|
|
120
|
+
.${D}:hover::after,
|
|
121
|
+
.${H} .${D}::after {
|
|
122
|
+
background: rgba(0, 242, 255, 0.65);
|
|
123
|
+
}
|
|
124
|
+
.${D}[data-direction="vertical"]:hover::after,
|
|
125
|
+
.${H} .${D}[data-direction="vertical"]::after {
|
|
126
|
+
height: 2px;
|
|
127
|
+
}
|
|
128
|
+
.${D}[data-direction="horizontal"]:hover::after,
|
|
129
|
+
.${H} .${D}[data-direction="horizontal"]::after {
|
|
130
|
+
width: 2px;
|
|
131
|
+
}
|
|
132
|
+
.${D}-handle {
|
|
133
|
+
position: absolute;
|
|
134
|
+
left: 50%;
|
|
135
|
+
top: 50%;
|
|
136
|
+
transform: translate(-50%, -50%);
|
|
137
|
+
width: 32px;
|
|
138
|
+
height: 12px;
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
opacity: 0;
|
|
143
|
+
transition: opacity 0.15s;
|
|
144
|
+
pointer-events: none;
|
|
145
|
+
color: rgba(0, 242, 255, 0.9);
|
|
146
|
+
font-size: 10px;
|
|
147
|
+
line-height: 1;
|
|
148
|
+
}
|
|
149
|
+
.${D}:hover .${D}-handle,
|
|
150
|
+
.${H} .${D}-handle {
|
|
151
|
+
opacity: 1;
|
|
152
|
+
}
|
|
153
|
+
.${H} {
|
|
154
|
+
cursor: ${r} !important;
|
|
155
|
+
}
|
|
156
|
+
.${H} * {
|
|
157
|
+
cursor: ${r} !important;
|
|
158
|
+
}
|
|
159
|
+
.${H} [data-pane-id] {
|
|
160
|
+
position: relative !important;
|
|
161
|
+
overflow: hidden !important;
|
|
162
|
+
}
|
|
163
|
+
`;
|
|
164
|
+
}
|
|
165
|
+
function re(t, e) {
|
|
166
|
+
return t.map(
|
|
167
|
+
(o) => e ? o.getBoundingClientRect().width : o.getBoundingClientRect().height
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
function se(t, e, o, r, a) {
|
|
171
|
+
return (t == null ? void 0 : t(e, o)) ?? re(r, a);
|
|
172
|
+
}
|
|
173
|
+
function ae(t, e, o) {
|
|
174
|
+
const r = document.createElement("div");
|
|
175
|
+
r.className = D, r.dataset.dividerIndex = String(t), r.dataset.direction = o, r.style.setProperty("--velo-divider-size", `${e}px`);
|
|
176
|
+
const a = document.createElement("div");
|
|
177
|
+
return a.className = `${D}-handle`, a.textContent = o === "horizontal" ? "⇔" : "⇕", r.appendChild(a), r;
|
|
178
|
+
}
|
|
179
|
+
function ce(t, e) {
|
|
180
|
+
const o = e === "horizontal" ? "min-width:0;" : "min-height:0;";
|
|
181
|
+
return typeof t == "number" ? `flex:${t} 1 0;${o}` : `flex:1 1 ${t};${o}`;
|
|
182
|
+
}
|
|
183
|
+
function Xt(t, e, o = ct, r = 0) {
|
|
184
|
+
if (e < 1 || t <= 0) return 1;
|
|
185
|
+
const a = t * o, u = Math.max(r, a);
|
|
186
|
+
return Math.min(u, t / e);
|
|
187
|
+
}
|
|
188
|
+
function le(t, e, o = ct, r = 0) {
|
|
189
|
+
return Xt(t, e, o, r);
|
|
190
|
+
}
|
|
191
|
+
function st(t, e) {
|
|
192
|
+
const o = t.length;
|
|
193
|
+
if (o === 0) return t;
|
|
194
|
+
const r = Math.max(1, Math.round(e)), a = t.reduce((y, P) => y + P, 0);
|
|
195
|
+
if (a <= 0) {
|
|
196
|
+
const y = Math.floor(r / o), P = t.map(() => y);
|
|
197
|
+
return P[o - 1] = r - y * (o - 1), P;
|
|
198
|
+
}
|
|
199
|
+
const u = t.map((y) => y / a * r), x = [];
|
|
200
|
+
let $ = 0;
|
|
201
|
+
for (let y = 0; y < o - 1; y++)
|
|
202
|
+
x.push(Math.max(1, Math.round(u[y]))), $ += x[y];
|
|
203
|
+
return x.push(Math.max(1, r - $)), x;
|
|
204
|
+
}
|
|
205
|
+
function de(t, e, o, r, a = {}) {
|
|
206
|
+
const u = a.direction ?? "vertical", x = u === "horizontal";
|
|
207
|
+
ie(u);
|
|
208
|
+
const $ = a.minPaneRatio ?? ct, y = a.minPanePx ?? 0, P = a.dividerSize ?? 6, X = e.length, O = (g) => x ? le(g, X, $, y) : Xt(g, X, $, y), L = [], K = [];
|
|
209
|
+
if (e.length < 2)
|
|
210
|
+
return { dividers: L, destroy: () => {
|
|
211
|
+
} };
|
|
212
|
+
const C = () => {
|
|
213
|
+
const g = L.length * P, d = x ? t.clientWidth : t.clientHeight;
|
|
214
|
+
return Math.max(1, d - g);
|
|
215
|
+
}, j = (g, d, I, z) => {
|
|
216
|
+
var m;
|
|
217
|
+
const A = C(), R = O(A), Y = z.reduce(
|
|
218
|
+
(S, w, k) => k === g || k === d ? S : S + w,
|
|
219
|
+
0
|
|
220
|
+
), E = A - Y;
|
|
221
|
+
let c = z[g] + I;
|
|
222
|
+
c = Math.max(R, Math.min(E - R, c));
|
|
223
|
+
const h = E - c;
|
|
224
|
+
z[g] = c, z[d] = h;
|
|
225
|
+
const f = r.reduce((S, w) => S + w, 0);
|
|
226
|
+
if (r[g] = c / A * f, r[d] = h / A * f, (m = a.onDragMove) == null || m.call(a, z, g, d), a.onResize) {
|
|
227
|
+
const S = {};
|
|
228
|
+
for (let w = 0; w < o.length; w++)
|
|
229
|
+
S[o[w]] = r[w];
|
|
230
|
+
a.onResize(S);
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
for (let g = 0; g < e.length - 1; g++) {
|
|
234
|
+
const d = ae(g, P, u);
|
|
235
|
+
e[g].after(d), L.push(d);
|
|
236
|
+
const z = (A) => {
|
|
237
|
+
var h;
|
|
238
|
+
A.preventDefault(), d.setPointerCapture(A.pointerId), t.classList.add(H);
|
|
239
|
+
const R = se(
|
|
240
|
+
a.onDragStart,
|
|
241
|
+
g,
|
|
242
|
+
g + 1,
|
|
243
|
+
e,
|
|
244
|
+
x
|
|
245
|
+
);
|
|
246
|
+
(h = a.onDragMove) == null || h.call(a, R, g, g + 1);
|
|
247
|
+
let Y = x ? A.clientX : A.clientY;
|
|
248
|
+
const E = (f) => {
|
|
249
|
+
const m = x ? f.clientX : f.clientY, S = m - Y;
|
|
250
|
+
Y = m, S !== 0 && j(g, g + 1, S, R);
|
|
251
|
+
}, c = (f) => {
|
|
252
|
+
var m;
|
|
253
|
+
d.releasePointerCapture(f.pointerId), t.classList.remove(H), d.removeEventListener("pointermove", E), d.removeEventListener("pointerup", c), d.removeEventListener("pointercancel", c), (m = a.onDragEnd) == null || m.call(a, R);
|
|
254
|
+
};
|
|
255
|
+
d.addEventListener("pointermove", E), d.addEventListener("pointerup", c), d.addEventListener("pointercancel", c);
|
|
256
|
+
};
|
|
257
|
+
d.addEventListener("pointerdown", z), K.push(() => d.removeEventListener("pointerdown", z));
|
|
258
|
+
}
|
|
259
|
+
return {
|
|
260
|
+
dividers: L,
|
|
261
|
+
destroy: () => {
|
|
262
|
+
for (const g of K) g();
|
|
263
|
+
for (const g of L) g.remove();
|
|
264
|
+
t.classList.remove(H);
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
function ue(t, e, o = "vertical") {
|
|
269
|
+
for (let r = 0; r < t.length; r++)
|
|
270
|
+
t[r].style.cssText = `${ce(e[r], o)}position:relative;overflow:hidden;`;
|
|
271
|
+
}
|
|
272
|
+
function Dt(t) {
|
|
273
|
+
return typeof t == "number" ? t : 1;
|
|
274
|
+
}
|
|
275
|
+
function he(t, e = 6) {
|
|
276
|
+
if (!Number.isFinite(t) || t <= 0) return e;
|
|
277
|
+
const o = Math.floor(t / 36);
|
|
278
|
+
return Math.max(2, Math.min(e, o));
|
|
279
|
+
}
|
|
280
|
+
function fe(t, e = 8) {
|
|
281
|
+
if (!Number.isFinite(t) || t <= 0) return e;
|
|
282
|
+
const o = Math.floor(t / 72);
|
|
283
|
+
return Math.max(2, Math.min(e, o));
|
|
284
|
+
}
|
|
285
|
+
function $t(t) {
|
|
286
|
+
var o;
|
|
287
|
+
return t ? ((o = (Array.isArray(t) ? t : [t])[0]) == null ? void 0 : o.tickCount) ?? 6 : 6;
|
|
288
|
+
}
|
|
289
|
+
function me(t) {
|
|
290
|
+
const e = t.wrapper.clientHeight, o = t.wrapper.clientWidth, r = he(e, t.baseYTickCount);
|
|
291
|
+
if (t.chart.updateYAxis("default", { tickCount: r }), t.showXAxis) {
|
|
292
|
+
const a = fe(o, t.baseXTickCount);
|
|
293
|
+
t.chart.updateXAxis({ tickCount: a });
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
function Lt(t) {
|
|
297
|
+
for (const e of t) me(e);
|
|
298
|
+
}
|
|
299
|
+
function Ot(t) {
|
|
300
|
+
const e = t ? Array.isArray(t) ? t : [t] : [{}];
|
|
301
|
+
let o = 0, r = 0;
|
|
302
|
+
for (const a of e)
|
|
303
|
+
a.position === "right" ? r++ : o++;
|
|
304
|
+
return { left: Math.max(1, o), right: r };
|
|
305
|
+
}
|
|
306
|
+
function ge(t, e) {
|
|
307
|
+
var r;
|
|
308
|
+
let o = 0;
|
|
309
|
+
for (const a of t) {
|
|
310
|
+
const { left: u } = Ot((r = a.chart) == null ? void 0 : r.yAxis);
|
|
311
|
+
o = Math.max(o, (u - 1) * 65);
|
|
312
|
+
}
|
|
313
|
+
return e + o;
|
|
314
|
+
}
|
|
315
|
+
function pe(t, e) {
|
|
316
|
+
var r;
|
|
317
|
+
let o = 0;
|
|
318
|
+
for (const a of t) {
|
|
319
|
+
const { right: u } = Ot((r = a.chart) == null ? void 0 : r.yAxis);
|
|
320
|
+
o = Math.max(o, u * 65);
|
|
321
|
+
}
|
|
322
|
+
return e + o;
|
|
323
|
+
}
|
|
324
|
+
function ye(t, e) {
|
|
325
|
+
return `flex:${t} 1 0;${e === "horizontal" ? "min-width:0;" : "min-height:0;"}`;
|
|
326
|
+
}
|
|
327
|
+
function Et(t) {
|
|
328
|
+
const e = t.reduce((o, r) => o + r, 0);
|
|
329
|
+
if (e <= 0) {
|
|
330
|
+
const o = 1 / Math.max(1, t.length);
|
|
331
|
+
for (let r = 0; r < t.length; r++) t[r] = o;
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
for (let o = 0; o < t.length; o++) t[o] /= e;
|
|
335
|
+
}
|
|
336
|
+
function kt(t) {
|
|
337
|
+
if (!(t != null && t.length)) return [];
|
|
338
|
+
const e = [];
|
|
339
|
+
for (const o of t)
|
|
340
|
+
o.type === "indicator" ? e.push(...Ut(o)) : e.push(o);
|
|
341
|
+
return e;
|
|
342
|
+
}
|
|
343
|
+
function Tt(t, e, o, r, a, u, x, $, y) {
|
|
344
|
+
var f, m, S, w, k, N, T, Q, _, it, et, nt, Z;
|
|
345
|
+
const P = r === 0, X = r === a - 1, O = y === "horizontal", K = !O && o.sharedXAxis !== "none" && !x, j = O && (o.sharedYAxis ?? "left") !== "none" && !$, d = (o.gap ?? 0) > 0 ? Ft : { top: 0, bottom: 0, left: 0 }, I = O ? {
|
|
346
|
+
top: u.top,
|
|
347
|
+
right: X ? u.right : d.left,
|
|
348
|
+
left: j ? d.left : u.left,
|
|
349
|
+
bottom: u.bottom
|
|
350
|
+
} : {
|
|
351
|
+
top: P ? u.top : d.top,
|
|
352
|
+
right: u.right,
|
|
353
|
+
left: u.left,
|
|
354
|
+
bottom: K ? d.bottom : X ? ((m = (f = o.layout) == null ? void 0 : f.margins) == null ? void 0 : m.bottom) ?? Ht.bottom : u.bottom
|
|
355
|
+
}, z = {
|
|
356
|
+
...o.xAxis ?? {},
|
|
357
|
+
...((S = t.chart) == null ? void 0 : S.xAxis) ?? {}
|
|
358
|
+
}, A = {
|
|
359
|
+
...z,
|
|
360
|
+
showLine: x ? z.showLine ?? !0 : !1,
|
|
361
|
+
showTicks: x ? z.showTicks ?? !0 : !1,
|
|
362
|
+
showLabels: x ? z.showLabels ?? !0 : !1
|
|
363
|
+
}, R = ((w = t.chart) == null ? void 0 : w.yAxis) ?? {}, E = (Array.isArray(R) ? R : [R]).map((V) => ({
|
|
364
|
+
...V,
|
|
365
|
+
showLine: $ ? V.showLine ?? !0 : !1,
|
|
366
|
+
showTicks: $ ? V.showTicks ?? !0 : !1,
|
|
367
|
+
showLabels: $ ? V.showLabels ?? !0 : !1
|
|
368
|
+
})), c = Array.isArray((k = t.chart) == null ? void 0 : k.yAxis) ? E : E[0];
|
|
369
|
+
return (t.interactive ?? !0) || (e.style.pointerEvents = "none"), {
|
|
370
|
+
...t.chart,
|
|
371
|
+
id: t.id,
|
|
372
|
+
container: e,
|
|
373
|
+
showLegend: ((N = t.chart) == null ? void 0 : N.showLegend) ?? o.showLegend ?? !1,
|
|
374
|
+
theme: ((T = t.chart) == null ? void 0 : T.theme) ?? o.theme,
|
|
375
|
+
devicePixelRatio: o.devicePixelRatio ?? ((Q = t.chart) == null ? void 0 : Q.devicePixelRatio),
|
|
376
|
+
loading: ((_ = t.chart) == null ? void 0 : _.loading) ?? !1,
|
|
377
|
+
xAxis: A,
|
|
378
|
+
yAxis: c,
|
|
379
|
+
layout: It({
|
|
380
|
+
...o.layout,
|
|
381
|
+
...(it = t.chart) == null ? void 0 : it.layout,
|
|
382
|
+
margins: { ...I, ...(et = o.layout) == null ? void 0 : et.margins, ...(Z = (nt = t.chart) == null ? void 0 : nt.layout) == null ? void 0 : Z.margins }
|
|
383
|
+
})
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
function tt() {
|
|
387
|
+
return "position:absolute;inset:0;width:100%;height:100%;min-width:0;min-height:0;";
|
|
388
|
+
}
|
|
389
|
+
function at(t, e, o, r) {
|
|
390
|
+
const a = e > 0 && o > 0 ? r === "horizontal" ? `margin-left:${e}px;` : `margin-top:${e}px;` : "";
|
|
391
|
+
return `${ye(t, r)}position:relative;overflow:hidden;${a}`;
|
|
392
|
+
}
|
|
393
|
+
function ve(t, e, o) {
|
|
394
|
+
return t === !1 ? {
|
|
395
|
+
axis: "none",
|
|
396
|
+
syncCursor: !1,
|
|
397
|
+
syncZoom: !1,
|
|
398
|
+
syncPan: !1,
|
|
399
|
+
bidirectional: !0,
|
|
400
|
+
masterId: void 0
|
|
401
|
+
} : {
|
|
402
|
+
axis: o === "horizontal" ? "y" : "x",
|
|
403
|
+
bidirectional: !0,
|
|
404
|
+
masterId: e,
|
|
405
|
+
syncCursor: !0,
|
|
406
|
+
syncZoom: !0,
|
|
407
|
+
syncPan: !0,
|
|
408
|
+
...typeof t == "object" ? t : {}
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
function Ae(t) {
|
|
412
|
+
var gt, pt, yt, vt, xt, wt, bt, At;
|
|
413
|
+
const { container: e, panes: o } = t;
|
|
414
|
+
if (!e) throw new Error("[StackedChart] container is required");
|
|
415
|
+
if (o.length < 1 || o.length > rt)
|
|
416
|
+
throw new Error(`[StackedChart] panes must be 1–${rt}`);
|
|
417
|
+
const r = t.masterPaneId ?? o[0].id, a = t.direction ?? "vertical", u = a === "horizontal", x = t.sharedXAxis ?? "bottom", $ = t.sharedYAxis ?? "left", y = t.gap ?? 0, P = t.resizable, X = !!P, O = typeof P == "object" ? P.dividerSize ?? 6 : 6, L = It(t.layout), K = ((gt = L.margins) == null ? void 0 : gt.left) ?? J.left, C = ((pt = L.margins) == null ? void 0 : pt.right) ?? J.right, j = ((yt = L.margins) == null ? void 0 : yt.top) ?? J.top, g = ge(o, K), d = pe(o, C), I = e.style.height, z = e.style.width, A = e.style.minHeight, R = e.style.minWidth, Y = getComputedStyle(e), E = e.offsetHeight || parseInt(Y.height, 10) || 0;
|
|
418
|
+
e.replaceChildren(), e.style.display = "flex", e.style.flexDirection = u ? "row" : "column", e.style.boxSizing = "border-box", e.style.overflow = "hidden", e.style.position = "relative", e.style.maxWidth = "none", e.style.maxHeight = "none", e.style.width = z || "100%", e.style.minWidth = R || "0", I ? e.style.height = I : E > 0 ? e.style.height = `${E}px` : (e.style.height = "100%", e.style.minHeight = A || "320px"), A ? e.style.minHeight = A : e.style.minHeight || (e.style.minHeight = "0");
|
|
419
|
+
const c = o.map((n) => n.id), h = o.map((n) => Dt(n.height));
|
|
420
|
+
Et(h);
|
|
421
|
+
const f = /* @__PURE__ */ new Map(), m = [], S = [];
|
|
422
|
+
let w = null, k = !1, N = 0, T = 0, Q = null;
|
|
423
|
+
const _ = (n) => {
|
|
424
|
+
const i = Array.from({ length: m.length }, (s, l) => l);
|
|
425
|
+
for (const s of i) {
|
|
426
|
+
const l = f.get(c[s]);
|
|
427
|
+
l && l.resize();
|
|
428
|
+
}
|
|
429
|
+
Lt(
|
|
430
|
+
i.map((s) => S[s]).filter(Boolean)
|
|
431
|
+
);
|
|
432
|
+
}, it = () => {
|
|
433
|
+
N || (N = requestAnimationFrame(() => {
|
|
434
|
+
N = 0, !k && _();
|
|
435
|
+
}));
|
|
436
|
+
}, et = new ResizeObserver(() => {
|
|
437
|
+
k || it();
|
|
438
|
+
});
|
|
439
|
+
et.observe(e);
|
|
440
|
+
const nt = () => {
|
|
441
|
+
for (let n = 0; n < m.length; n++)
|
|
442
|
+
m[n].style.cssText = at(h[n], y, n, a);
|
|
443
|
+
}, Z = () => {
|
|
444
|
+
const n = (m.length - 1) * O;
|
|
445
|
+
return u ? Math.max(1, e.clientWidth - n) : Math.max(1, e.clientHeight - n);
|
|
446
|
+
}, V = () => {
|
|
447
|
+
for (const n of m) {
|
|
448
|
+
const i = n.firstElementChild;
|
|
449
|
+
i && (i.style.cssText = tt());
|
|
450
|
+
}
|
|
451
|
+
}, Yt = () => {
|
|
452
|
+
const n = Z(), i = m.map(
|
|
453
|
+
(l) => u ? l.getBoundingClientRect().width : l.getBoundingClientRect().height
|
|
454
|
+
);
|
|
455
|
+
if (i.reduce((l, p) => l + p, 0) <= 0) {
|
|
456
|
+
const l = Math.floor(n / Math.max(1, m.length));
|
|
457
|
+
return m.map(
|
|
458
|
+
(p, b) => b === m.length - 1 ? n - l * (m.length - 1) : l
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
return st(i, n);
|
|
462
|
+
}, _t = (n) => {
|
|
463
|
+
const i = st(n, Z());
|
|
464
|
+
for (let s = 0; s < m.length; s++) {
|
|
465
|
+
const l = Math.max(1, i[s]), p = y > 0 && s > 0 ? u ? `margin-left:${y}px;` : `margin-top:${y}px;` : "", b = u ? "width" : "height";
|
|
466
|
+
m[s].style.cssText = `${b}:${l}px;flex:0 0 auto;min-height:0;min-width:0;position:relative;overflow:hidden;${p}`;
|
|
467
|
+
const v = m[s].firstElementChild;
|
|
468
|
+
v && (v.style.cssText = tt());
|
|
469
|
+
}
|
|
470
|
+
for (let s = 0; s < n.length; s++) n[s] = i[s];
|
|
471
|
+
}, Bt = () => {
|
|
472
|
+
if (T = 0, !k || !Q) return;
|
|
473
|
+
const { sizes: n, leadingIdx: i, trailingIdx: s } = Q;
|
|
474
|
+
_t(n);
|
|
475
|
+
for (const l of [i, s]) {
|
|
476
|
+
const p = f.get(c[l]);
|
|
477
|
+
p && (p.resize(), Lt([S[l]]));
|
|
478
|
+
}
|
|
479
|
+
}, jt = (n, i, s) => {
|
|
480
|
+
Q = { sizes: n, leadingIdx: i, trailingIdx: s }, !T && (T = requestAnimationFrame(Bt));
|
|
481
|
+
}, Nt = (n) => {
|
|
482
|
+
const i = n.reduce((l, p) => l + p, 0);
|
|
483
|
+
if (i <= 0) return;
|
|
484
|
+
const s = h.reduce((l, p) => l + p, 0);
|
|
485
|
+
for (let l = 0; l < h.length; l++)
|
|
486
|
+
h[l] = n[l] / i * s;
|
|
487
|
+
}, lt = (n) => {
|
|
488
|
+
var i;
|
|
489
|
+
for (const s of f.values())
|
|
490
|
+
(i = s.setResizeSuspended) == null || i.call(s, n);
|
|
491
|
+
}, qt = (n, i) => {
|
|
492
|
+
var s, l, p, b, v, F;
|
|
493
|
+
for (let M = 0; M < c.length; M++)
|
|
494
|
+
M === n || M === i || (l = (s = f.get(c[M])) == null ? void 0 : s.setResizeSuspended) == null || l.call(s, !0);
|
|
495
|
+
(b = (p = f.get(c[n])) == null ? void 0 : p.setResizeSuspended) == null || b.call(p, !1), (F = (v = f.get(c[i])) == null ? void 0 : v.setResizeSuspended) == null || F.call(v, !1);
|
|
496
|
+
}, dt = u ? ((xt = (vt = t.layout) == null ? void 0 : vt.margins) == null ? void 0 : xt.bottom) ?? Ht.bottom : J.bottom;
|
|
497
|
+
for (let n = 0; n < o.length; n++) {
|
|
498
|
+
const i = o[n], s = n === 0, l = n === o.length - 1, p = u ? i.showXAxis ?? !0 : i.showXAxis ?? (x === "bottom" ? l : !0), b = u ? i.showYAxis ?? ($ === "left" ? s : !0) : i.showYAxis ?? !0, v = document.createElement("div");
|
|
499
|
+
v.dataset.paneId = i.id, v.style.cssText = at(h[n], y, n, a);
|
|
500
|
+
const F = document.createElement("div");
|
|
501
|
+
F.style.cssText = tt(), v.appendChild(F), e.appendChild(v), m.push(v);
|
|
502
|
+
const M = Ct(
|
|
503
|
+
Tt(
|
|
504
|
+
i,
|
|
505
|
+
F,
|
|
506
|
+
t,
|
|
507
|
+
n,
|
|
508
|
+
o.length,
|
|
509
|
+
{
|
|
510
|
+
left: u && !b ? J.left : g,
|
|
511
|
+
right: d,
|
|
512
|
+
top: j,
|
|
513
|
+
bottom: dt
|
|
514
|
+
},
|
|
515
|
+
p,
|
|
516
|
+
b,
|
|
517
|
+
a
|
|
518
|
+
)
|
|
519
|
+
);
|
|
520
|
+
F.style.cssText = tt();
|
|
521
|
+
const W = kt(i.series);
|
|
522
|
+
if (W.length)
|
|
523
|
+
for (const G of W) M.addSeries(G);
|
|
524
|
+
i.yRange && i.yRange !== "auto" && M.zoom({ y: i.yRange, animate: !1 }), f.set(i.id, M), S.push({
|
|
525
|
+
chart: M,
|
|
526
|
+
wrapper: v,
|
|
527
|
+
baseYTickCount: $t((wt = i.chart) == null ? void 0 : wt.yAxis),
|
|
528
|
+
baseXTickCount: ((At = (bt = i.chart) == null ? void 0 : bt.xAxis) == null ? void 0 : At.tickCount) ?? 8,
|
|
529
|
+
showXAxis: p
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
const ut = () => {
|
|
533
|
+
if (w == null || w.destroy(), w = null, !X || m.length < 2) return;
|
|
534
|
+
const n = typeof P == "object" ? {
|
|
535
|
+
minPaneRatio: P.minPaneRatio,
|
|
536
|
+
minPanePx: P.minPanePx,
|
|
537
|
+
dividerSize: P.dividerSize
|
|
538
|
+
} : {};
|
|
539
|
+
w = de(
|
|
540
|
+
e,
|
|
541
|
+
m,
|
|
542
|
+
c,
|
|
543
|
+
h,
|
|
544
|
+
{
|
|
545
|
+
direction: a,
|
|
546
|
+
...n,
|
|
547
|
+
onDragStart: (i, s) => (k = !0, lt(!0), qt(i, s), Yt()),
|
|
548
|
+
onDragMove: (i, s, l) => {
|
|
549
|
+
jt(i, s, l);
|
|
550
|
+
},
|
|
551
|
+
onDragEnd: (i) => {
|
|
552
|
+
T && (cancelAnimationFrame(T), T = 0), Q = null, k = !1;
|
|
553
|
+
const s = st(i, Z());
|
|
554
|
+
Nt(s), V(), nt(), lt(!1), _();
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
);
|
|
558
|
+
};
|
|
559
|
+
ut();
|
|
560
|
+
const ot = f.get(r);
|
|
561
|
+
if (!ot)
|
|
562
|
+
throw new Error(`[StackedChart] masterPaneId "${r}" not found in panes`);
|
|
563
|
+
const q = te(
|
|
564
|
+
Array.from(f.values()),
|
|
565
|
+
ve(t.sync, r, a)
|
|
566
|
+
), Wt = () => {
|
|
567
|
+
const n = ot.theme ?? ot.baseTheme;
|
|
568
|
+
return (n == null ? void 0 : n.backgroundColor) ?? "#ffffff";
|
|
569
|
+
}, ht = () => {
|
|
570
|
+
const i = Date.now();
|
|
571
|
+
return new Promise((l) => {
|
|
572
|
+
const p = () => {
|
|
573
|
+
const b = Jt();
|
|
574
|
+
if (b.pending === 0 && !b.isProcessing || Date.now() - i > 8e3) {
|
|
575
|
+
l();
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
setTimeout(p, 50);
|
|
579
|
+
};
|
|
580
|
+
p();
|
|
581
|
+
}).then(() => new Promise((l) => {
|
|
582
|
+
requestAnimationFrame(() => {
|
|
583
|
+
_(), l();
|
|
584
|
+
});
|
|
585
|
+
}));
|
|
586
|
+
}, ft = async (n = {}) => {
|
|
587
|
+
await ht();
|
|
588
|
+
for (const s of f.values()) s.render();
|
|
589
|
+
await new Promise((s) => requestAnimationFrame(s));
|
|
590
|
+
const i = await oe(
|
|
591
|
+
e,
|
|
592
|
+
m,
|
|
593
|
+
Array.from(f.values()),
|
|
594
|
+
(w == null ? void 0 : w.dividers) ?? [],
|
|
595
|
+
Wt(),
|
|
596
|
+
n
|
|
597
|
+
);
|
|
598
|
+
if (n.download) {
|
|
599
|
+
const s = n.format === "jpeg" ? "jpg" : n.format ?? "png", l = document.createElement("a");
|
|
600
|
+
l.download = `${n.fileName ?? "velo-plot-stack"}.${s}`, l.href = i, document.body.appendChild(l), l.click(), document.body.removeChild(l);
|
|
601
|
+
}
|
|
602
|
+
return i;
|
|
603
|
+
}, mt = (n) => {
|
|
604
|
+
var St, Pt, Rt;
|
|
605
|
+
if (f.size >= rt)
|
|
606
|
+
throw new Error(`[StackedChart] Cannot exceed ${rt} panes`);
|
|
607
|
+
if (f.has(n.id))
|
|
608
|
+
throw new Error(`[StackedChart] Pane "${n.id}" already exists`);
|
|
609
|
+
if (!u && x === "bottom" && c.length > 0) {
|
|
610
|
+
const B = c[c.length - 1], U = f.get(B), zt = S[S.length - 1];
|
|
611
|
+
U == null || U.updateXAxis({
|
|
612
|
+
showLabels: !1,
|
|
613
|
+
showTicks: !1,
|
|
614
|
+
showLine: !1
|
|
615
|
+
}), U == null || U.updateLayout({
|
|
616
|
+
margins: {
|
|
617
|
+
bottom: y > 0 ? Ft.bottom : 0
|
|
618
|
+
}
|
|
619
|
+
}), zt && (zt.showXAxis = !1);
|
|
620
|
+
}
|
|
621
|
+
const i = Dt(n.height ?? 0.25), s = h.reduce((B, U) => B + U, 0), l = s > 0 ? (1 - i) / s : 1;
|
|
622
|
+
for (let B = 0; B < h.length; B++) h[B] *= l;
|
|
623
|
+
const p = c.length;
|
|
624
|
+
c.push(n.id), h.push(i), Et(h);
|
|
625
|
+
const b = document.createElement("div");
|
|
626
|
+
b.dataset.paneId = n.id, b.style.cssText = at(h[p], y, p, a);
|
|
627
|
+
const v = document.createElement("div");
|
|
628
|
+
v.style.cssText = tt(), b.appendChild(v), e.appendChild(b), m.push(b), nt();
|
|
629
|
+
const M = u ? n.showXAxis ?? !0 : n.showXAxis ?? (x === "bottom" ? !0 : !0), W = u ? n.showYAxis ?? ($ === "left" ? p === 0 : !0) : n.showYAxis ?? !0, G = Ct(
|
|
630
|
+
Tt(
|
|
631
|
+
n,
|
|
632
|
+
v,
|
|
633
|
+
t,
|
|
634
|
+
p,
|
|
635
|
+
c.length,
|
|
636
|
+
{
|
|
637
|
+
left: u && !W ? J.left : g,
|
|
638
|
+
right: d,
|
|
639
|
+
top: j,
|
|
640
|
+
bottom: dt
|
|
641
|
+
},
|
|
642
|
+
M,
|
|
643
|
+
W,
|
|
644
|
+
a
|
|
645
|
+
)
|
|
646
|
+
);
|
|
647
|
+
v.style.cssText = tt();
|
|
648
|
+
const Gt = kt(n.series);
|
|
649
|
+
for (const B of Gt) G.addSeries(B);
|
|
650
|
+
return n.yRange && n.yRange !== "auto" && G.zoom({ y: n.yRange, animate: !1 }), f.set(n.id, G), S.push({
|
|
651
|
+
chart: G,
|
|
652
|
+
wrapper: b,
|
|
653
|
+
baseYTickCount: $t((St = n.chart) == null ? void 0 : St.yAxis),
|
|
654
|
+
baseXTickCount: ((Rt = (Pt = n.chart) == null ? void 0 : Pt.xAxis) == null ? void 0 : Rt.tickCount) ?? 8,
|
|
655
|
+
showXAxis: M
|
|
656
|
+
}), q.add(G), ut(), _(), G;
|
|
657
|
+
};
|
|
658
|
+
return {
|
|
659
|
+
container: e,
|
|
660
|
+
getPane(n) {
|
|
661
|
+
return f.get(n);
|
|
662
|
+
},
|
|
663
|
+
/** @deprecated Prefer `getPane(id)`. **Removed in v4.0.** */
|
|
664
|
+
getChart(n) {
|
|
665
|
+
return f.get(n);
|
|
666
|
+
},
|
|
667
|
+
getPanes() {
|
|
668
|
+
return Array.from(f.values());
|
|
669
|
+
},
|
|
670
|
+
getMaster() {
|
|
671
|
+
return ot;
|
|
672
|
+
},
|
|
673
|
+
getGroup() {
|
|
674
|
+
return q;
|
|
675
|
+
},
|
|
676
|
+
fitAll(n) {
|
|
677
|
+
q.fitAll(n);
|
|
678
|
+
},
|
|
679
|
+
resetAll() {
|
|
680
|
+
q.resetAll();
|
|
681
|
+
},
|
|
682
|
+
resize() {
|
|
683
|
+
_();
|
|
684
|
+
},
|
|
685
|
+
getPaneRatios() {
|
|
686
|
+
const n = {};
|
|
687
|
+
for (let i = 0; i < c.length; i++)
|
|
688
|
+
n[c[i]] = h[i];
|
|
689
|
+
return n;
|
|
690
|
+
},
|
|
691
|
+
setPaneRatios(n) {
|
|
692
|
+
for (let i = 0; i < c.length; i++) {
|
|
693
|
+
const s = c[i];
|
|
694
|
+
n[s] !== void 0 && (h[i] = n[s]);
|
|
695
|
+
}
|
|
696
|
+
ue(m, h, a), _();
|
|
697
|
+
},
|
|
698
|
+
setSyncAxis(n) {
|
|
699
|
+
q.syncAxis(n);
|
|
700
|
+
},
|
|
701
|
+
getSyncAxis() {
|
|
702
|
+
return q.getOptions().axis ?? "x";
|
|
703
|
+
},
|
|
704
|
+
setSyncOptions(n) {
|
|
705
|
+
q.updateOptions(n);
|
|
706
|
+
},
|
|
707
|
+
whenReady() {
|
|
708
|
+
return ht();
|
|
709
|
+
},
|
|
710
|
+
exportImage(n) {
|
|
711
|
+
return ft(n);
|
|
712
|
+
},
|
|
713
|
+
snapshot(n) {
|
|
714
|
+
return ft(n);
|
|
715
|
+
},
|
|
716
|
+
addPane(n) {
|
|
717
|
+
return mt(n);
|
|
718
|
+
},
|
|
719
|
+
async addIndicator(n, i = {}) {
|
|
720
|
+
var M;
|
|
721
|
+
const s = ot;
|
|
722
|
+
if (i.pane !== "new")
|
|
723
|
+
return { ...await Kt(s, n, i), chart: s };
|
|
724
|
+
const l = Qt(s, i.sourceSeriesId), { x: p, prices: b } = Zt(l), v = await Vt(n, p, b, {
|
|
725
|
+
id: i.id ?? n,
|
|
726
|
+
label: i.label ?? n.toUpperCase(),
|
|
727
|
+
height: i.paneHeight ?? 0.25,
|
|
728
|
+
showXAxis: i.showXAxis,
|
|
729
|
+
period: i.period,
|
|
730
|
+
fastPeriod: i.fastPeriod,
|
|
731
|
+
slowPeriod: i.slowPeriod,
|
|
732
|
+
signalPeriod: i.signalPeriod,
|
|
733
|
+
stdDev: i.stdDev
|
|
734
|
+
}, l), F = mt(v);
|
|
735
|
+
return {
|
|
736
|
+
id: v.id,
|
|
737
|
+
preset: n,
|
|
738
|
+
placement: "oscillator",
|
|
739
|
+
seriesIds: ((M = v.series) == null ? void 0 : M.map((W) => W.id)) ?? [],
|
|
740
|
+
paneId: v.id,
|
|
741
|
+
chart: F
|
|
742
|
+
};
|
|
743
|
+
},
|
|
744
|
+
destroy() {
|
|
745
|
+
N && cancelAnimationFrame(N), T && cancelAnimationFrame(T), et.disconnect(), w == null || w.destroy(), q.destroy();
|
|
746
|
+
for (const n of f.values()) n.destroy();
|
|
747
|
+
f.clear(), e.replaceChildren();
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
export {
|
|
752
|
+
rt as S,
|
|
753
|
+
ct as a,
|
|
754
|
+
Ae as c
|
|
755
|
+
};
|
|
756
|
+
//# sourceMappingURL=createStackedChart-Dm-YqUT7.js.map
|