velo-plot 1.12.0 → 1.15.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 +14 -0
- package/dist/{index.core-xiNcuFfJ.js → ChartCore-BimVvUEg.js} +922 -929
- package/dist/ChartCore-BimVvUEg.js.map +1 -0
- package/dist/core/chart/ChartCore.d.ts +1 -0
- package/dist/core/chart/exporter/SVGExporter.d.ts +7 -2
- package/dist/core/chart/types.d.ts +2 -0
- package/dist/core/render/pixelSnap.d.ts +8 -0
- package/dist/core/stacked/index.d.ts +3 -1
- package/dist/core/stacked/paneResize.d.ts +15 -18
- package/dist/core/stacked/stackExport.d.ts +18 -0
- package/dist/core/stacked/types.d.ts +34 -5
- package/dist/createStackedChart-CjsKcOvX.js +1088 -0
- package/dist/createStackedChart-CjsKcOvX.js.map +1 -0
- package/dist/index-CUGS98p4.js +277 -0
- package/dist/index-CUGS98p4.js.map +1 -0
- package/dist/index-ChgIdk3N.js +229 -0
- package/dist/index-ChgIdk3N.js.map +1 -0
- package/dist/index.core-C_-CFftD.js +167 -0
- package/dist/index.core-C_-CFftD.js.map +1 -0
- package/dist/math-Ddm2EZjj.js +85 -0
- package/dist/math-Ddm2EZjj.js.map +1 -0
- package/dist/plugins/analysis.js +132 -130
- package/dist/plugins/analysis.js.map +1 -1
- package/dist/plugins/anomaly-detection.d.ts +1 -0
- package/dist/plugins/anomaly-detection.js +221 -0
- package/dist/plugins/anomaly-detection.js.map +1 -0
- package/dist/plugins/broken-axis.d.ts +3 -0
- package/dist/plugins/broken-axis.js +262 -0
- package/dist/plugins/broken-axis.js.map +1 -0
- package/dist/plugins/caching.d.ts +3 -0
- package/dist/plugins/caching.js +182 -0
- package/dist/plugins/caching.js.map +1 -0
- package/dist/plugins/data-transform.d.ts +3 -0
- package/dist/plugins/data-transform.js +146 -0
- package/dist/plugins/data-transform.js.map +1 -0
- package/dist/plugins/debug.js +12 -11
- package/dist/plugins/debug.js.map +1 -1
- package/dist/plugins/forecasting.d.ts +1 -0
- package/dist/plugins/forecasting.js +236 -0
- package/dist/plugins/forecasting.js.map +1 -0
- package/dist/plugins/latex.d.ts +1 -0
- package/dist/plugins/latex.js +454 -0
- package/dist/plugins/latex.js.map +1 -0
- package/dist/plugins/lazy-load.d.ts +3 -0
- package/dist/plugins/lazy-load.js +189 -0
- package/dist/plugins/lazy-load.js.map +1 -0
- package/dist/plugins/ml-integration.d.ts +3 -0
- package/dist/plugins/ml-integration.js +355 -0
- package/dist/plugins/ml-integration.js.map +1 -0
- package/dist/plugins/offscreen.d.ts +3 -0
- package/dist/plugins/offscreen.js +169 -0
- package/dist/plugins/offscreen.js.map +1 -0
- package/dist/plugins/pattern-recognition.d.ts +3 -0
- package/dist/plugins/pattern-recognition.js +690 -0
- package/dist/plugins/pattern-recognition.js.map +1 -0
- package/dist/plugins/radar.d.ts +3 -0
- package/dist/plugins/radar.js +103 -0
- package/dist/plugins/radar.js.map +1 -0
- package/dist/plugins/regression.d.ts +3 -0
- package/dist/plugins/regression.js +634 -0
- package/dist/plugins/regression.js.map +1 -0
- package/dist/plugins/roi.d.ts +1 -0
- package/dist/plugins/roi.js +223 -0
- package/dist/plugins/roi.js.map +1 -0
- package/dist/plugins/snapshot/types.d.ts +1 -1
- package/dist/plugins/snapshot.d.ts +3 -0
- package/dist/plugins/snapshot.js +90 -0
- package/dist/plugins/snapshot.js.map +1 -0
- package/dist/plugins/sync/index.d.ts +2 -1
- package/dist/plugins/sync.js +13 -269
- package/dist/plugins/sync.js.map +1 -1
- package/dist/plugins/video-recorder.d.ts +3 -0
- package/dist/plugins/video-recorder.js +104 -0
- package/dist/plugins/video-recorder.js.map +1 -0
- package/dist/plugins/virtualization.d.ts +3 -0
- package/dist/plugins/virtualization.js +6 -0
- package/dist/plugins/virtualization.js.map +1 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.js +31 -0
- package/dist/react.js.map +1 -0
- package/dist/utils-BK5UUXxj.js +172 -0
- package/dist/utils-BK5UUXxj.js.map +1 -0
- package/dist/velo-plot.full.js +920 -6003
- package/dist/velo-plot.full.js.map +1 -1
- package/dist/velo-plot.js +23 -22
- package/dist/velo-plot.js.map +1 -1
- package/package.json +9 -2
- package/dist/core/OverlayRenderer.test.d.ts +0 -1
- package/dist/core/chart/ChartScaling.test.d.ts +0 -1
- package/dist/core/chart/NavigationUtils.test.d.ts +0 -1
- package/dist/core/format/axisFormat.test.d.ts +0 -1
- package/dist/core/indicator/buildIndicatorSeries.test.d.ts +0 -1
- package/dist/core/series/SeriesBounds.test.d.ts +0 -1
- package/dist/core/stacked/createStackedChart.test.d.ts +0 -1
- package/dist/core/stacked/paneAxis.test.d.ts +0 -1
- package/dist/core/stacked/paneResize.test.d.ts +0 -1
- package/dist/core/sync/index.test.d.ts +0 -1
- package/dist/index.core-xiNcuFfJ.js.map +0 -1
- package/dist/plugins/tools/tooltip/format.test.d.ts +0 -1
- package/dist/utils-Dbro9-qM.js +0 -254
- package/dist/utils-Dbro9-qM.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var p = (i, e, t) =>
|
|
4
|
-
import { b as
|
|
1
|
+
var tt = Object.defineProperty;
|
|
2
|
+
var it = (i, e, t) => e in i ? tt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var p = (i, e, t) => it(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { b as _e, c as Ve, E as nt } from "./axisFormat-B7o_uIEA.js";
|
|
5
5
|
import "./index-x4stH3jD.js";
|
|
6
|
-
import { P as
|
|
7
|
-
const
|
|
8
|
-
class
|
|
6
|
+
import { P as st } from "./index-qhscKTDy.js";
|
|
7
|
+
const re = { top: 20, right: 30, bottom: 55, left: 75 };
|
|
8
|
+
class ot {
|
|
9
9
|
constructor(e) {
|
|
10
10
|
p(this, "buffers", /* @__PURE__ */ new Map());
|
|
11
11
|
p(this, "bufferSizes", /* @__PURE__ */ new Map());
|
|
@@ -37,7 +37,7 @@ class st {
|
|
|
37
37
|
this.buffers.forEach((e) => this.gl.deleteBuffer(e)), this.buffers.clear(), this.bufferSizes.clear();
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const rt = `
|
|
41
41
|
precision highp float;
|
|
42
42
|
attribute vec2 position;
|
|
43
43
|
uniform vec2 uScale;
|
|
@@ -47,14 +47,14 @@ void main() {
|
|
|
47
47
|
vec2 pos = position * uScale + uTranslate;
|
|
48
48
|
gl_Position = vec4(pos, 0.0, 1.0);
|
|
49
49
|
}
|
|
50
|
-
`,
|
|
50
|
+
`, at = `
|
|
51
51
|
precision highp float;
|
|
52
52
|
uniform vec4 uColor;
|
|
53
53
|
|
|
54
54
|
void main() {
|
|
55
55
|
gl_FragColor = uColor;
|
|
56
56
|
}
|
|
57
|
-
`,
|
|
57
|
+
`, lt = `
|
|
58
58
|
precision highp float;
|
|
59
59
|
attribute vec2 position;
|
|
60
60
|
uniform vec2 uScale;
|
|
@@ -66,7 +66,7 @@ void main() {
|
|
|
66
66
|
gl_Position = vec4(pos, 0.0, 1.0);
|
|
67
67
|
gl_PointSize = uPointSize;
|
|
68
68
|
}
|
|
69
|
-
`,
|
|
69
|
+
`, ht = `
|
|
70
70
|
precision highp float;
|
|
71
71
|
uniform vec4 uColor;
|
|
72
72
|
uniform int uSymbol;
|
|
@@ -147,7 +147,7 @@ void main() {
|
|
|
147
147
|
float alpha = 1.0 - smoothstep(0.0, 0.02, d);
|
|
148
148
|
gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);
|
|
149
149
|
}
|
|
150
|
-
`,
|
|
150
|
+
`, ct = `
|
|
151
151
|
precision highp float;
|
|
152
152
|
attribute vec2 aPosition;
|
|
153
153
|
attribute float aValue;
|
|
@@ -159,7 +159,7 @@ void main() {
|
|
|
159
159
|
gl_Position = vec4(aPosition * uScale + uTranslate, 0.0, 1.0);
|
|
160
160
|
vValue = aValue;
|
|
161
161
|
}
|
|
162
|
-
`,
|
|
162
|
+
`, ut = `
|
|
163
163
|
precision highp float;
|
|
164
164
|
varying float vValue;
|
|
165
165
|
uniform float uMinValue;
|
|
@@ -173,7 +173,7 @@ void main() {
|
|
|
173
173
|
gl_FragColor = texture2D(uColormap, vec2(t, 0.5));
|
|
174
174
|
}
|
|
175
175
|
`;
|
|
176
|
-
function
|
|
176
|
+
function Te(i, e, t) {
|
|
177
177
|
const n = i.createShader(t);
|
|
178
178
|
if (!n) throw new Error("Failed to create shader");
|
|
179
179
|
if (i.shaderSource(n, e), i.compileShader(n), !i.getShaderParameter(n, i.COMPILE_STATUS)) {
|
|
@@ -182,8 +182,8 @@ function ke(i, e, t) {
|
|
|
182
182
|
}
|
|
183
183
|
return n;
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
const s =
|
|
185
|
+
function ve(i, e, t, n) {
|
|
186
|
+
const s = Te(i, e, i.VERTEX_SHADER), o = Te(i, t, i.FRAGMENT_SHADER), r = i.createProgram();
|
|
187
187
|
if (!r) throw new Error("Failed to create program");
|
|
188
188
|
if (i.attachShader(r, s), i.attachShader(r, o), i.linkProgram(r), !i.getProgramParameter(r, i.LINK_STATUS)) {
|
|
189
189
|
const a = i.getProgramInfoLog(r);
|
|
@@ -210,11 +210,11 @@ function xe(i, e, t, n) {
|
|
|
210
210
|
}
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function dt(i) {
|
|
214
214
|
return {
|
|
215
|
-
lineProgram:
|
|
216
|
-
pointProgram:
|
|
217
|
-
heatmapProgram:
|
|
215
|
+
lineProgram: ve(i, rt, at, "line"),
|
|
216
|
+
pointProgram: ve(i, lt, ht, "point"),
|
|
217
|
+
heatmapProgram: ve(i, ct, ut, "heatmap")
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
220
|
function _(i) {
|
|
@@ -241,14 +241,14 @@ function _(i) {
|
|
|
241
241
|
}
|
|
242
242
|
return [1, 0, 1, 1];
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
const [t, n, s, o] = _(i), [r, a, l] =
|
|
244
|
+
function ft(i, e = !0) {
|
|
245
|
+
const [t, n, s, o] = _(i), [r, a, l] = gt(t, n, s), c = (r + 0.12) % 1, d = Math.min(1, a + 0.4);
|
|
246
246
|
let h;
|
|
247
247
|
e ? h = l < 0.4 ? 0.8 : Math.min(0.95, l + 0.2) : h = l > 0.6 ? 0.25 : Math.max(0.1, l - 0.2), h = Math.max(0.15, Math.min(0.9, h));
|
|
248
|
-
const [f, u,
|
|
249
|
-
return o < 1 ? `rgba(${
|
|
248
|
+
const [f, u, g] = yt(c, d, h), y = Math.round(f * 255), m = Math.round(u * 255), b = Math.round(g * 255);
|
|
249
|
+
return o < 1 ? `rgba(${y}, ${m}, ${b}, ${o})` : `rgb(${y}, ${m}, ${b})`;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function gt(i, e, t) {
|
|
252
252
|
const n = Math.max(i, e, t), s = Math.min(i, e, t);
|
|
253
253
|
let o = 0, r = 0, a = (n + s) / 2;
|
|
254
254
|
if (n !== s) {
|
|
@@ -268,7 +268,7 @@ function ft(i, e, t) {
|
|
|
268
268
|
}
|
|
269
269
|
return [o, r, a];
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function yt(i, e, t) {
|
|
272
272
|
let n, s, o;
|
|
273
273
|
if (e === 0)
|
|
274
274
|
n = s = o = t;
|
|
@@ -278,16 +278,16 @@ function gt(i, e, t) {
|
|
|
278
278
|
}
|
|
279
279
|
return [n, s, o];
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function We(i, e) {
|
|
282
282
|
const t = Math.min(i.length, e.length), n = new Float32Array(t * 2);
|
|
283
283
|
for (let s = 0; s < t; s++)
|
|
284
284
|
n[s * 2] = i[s], n[s * 2 + 1] = e[s];
|
|
285
285
|
return n;
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function mt(i, e, t = "after") {
|
|
288
288
|
const n = Math.min(i.length, e.length);
|
|
289
289
|
if (n < 2)
|
|
290
|
-
return
|
|
290
|
+
return We(i, e);
|
|
291
291
|
const s = t === "center" ? 1 + (n - 1) * 3 : n * 2 - 1, o = new Float32Array(s * 2);
|
|
292
292
|
let r = 0;
|
|
293
293
|
for (let a = 0; a < n; a++)
|
|
@@ -306,7 +306,7 @@ function yt(i, e, t = "after") {
|
|
|
306
306
|
}
|
|
307
307
|
return o.subarray(0, r);
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function Ne(i, e, t) {
|
|
310
310
|
const n = Math.min(i.length, e.length, t.length), s = new Float32Array(n * 2 * 2);
|
|
311
311
|
for (let o = 0; o < n; o++) {
|
|
312
312
|
const r = o * 4, a = i[o];
|
|
@@ -314,7 +314,7 @@ function Ve(i, e, t) {
|
|
|
314
314
|
}
|
|
315
315
|
return s;
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function pt(i, e, t, n) {
|
|
318
318
|
const s = i.length;
|
|
319
319
|
let o = 0;
|
|
320
320
|
t && o++, n && o++;
|
|
@@ -333,23 +333,23 @@ function mt(i, e, t, n) {
|
|
|
333
333
|
}
|
|
334
334
|
return r.subarray(0, a);
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function xt(i, e, t, n, s, o, r) {
|
|
337
337
|
const a = i.length, l = r / 2, c = new Float32Array(a * 20), d = new Float32Array(a * 12);
|
|
338
338
|
let h = 0, f = 0;
|
|
339
339
|
for (let u = 0; u < a; u++) {
|
|
340
|
-
const
|
|
341
|
-
c[h++] =
|
|
340
|
+
const g = i[u], y = e[u], m = t[u], b = n[u], v = s[u], x = o[u];
|
|
341
|
+
c[h++] = g, c[h++] = y, c[h++] = g, c[h++] = m, c[h++] = g, c[h++] = v, c[h++] = g, c[h++] = x, c[h++] = g - l, c[h++] = b, c[h++] = g + l, c[h++] = b, c[h++] = g - l, c[h++] = m, c[h++] = g + l, c[h++] = m, c[h++] = g - l, c[h++] = v, c[h++] = g + l, c[h++] = v, d[f++] = g - l, d[f++] = m, d[f++] = g + l, d[f++] = m, d[f++] = g + l, d[f++] = v, d[f++] = g - l, d[f++] = m, d[f++] = g + l, d[f++] = v, d[f++] = g - l, d[f++] = v;
|
|
342
342
|
}
|
|
343
343
|
return { lines: c, boxes: d };
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function bt(i, e, t, n) {
|
|
346
346
|
const s = i.length, o = t / 2, r = new Float32Array(s * 12), a = new Float32Array(s * 12), l = new Float32Array(s * 12), c = new Float32Array((s - 1) * 4);
|
|
347
|
-
let d = 0, h = 0, f = 0, u = 0,
|
|
348
|
-
for (let
|
|
349
|
-
const m = i[
|
|
347
|
+
let d = 0, h = 0, f = 0, u = 0, g = 0;
|
|
348
|
+
for (let y = 0; y < s; y++) {
|
|
349
|
+
const m = i[y], b = e[y], v = (n == null ? void 0 : n[y]) ?? !1;
|
|
350
350
|
let x, S;
|
|
351
|
-
if (v ? (x = 0, S =
|
|
352
|
-
const M = i[
|
|
351
|
+
if (v ? (x = 0, S = g, l[f++] = m - o, l[f++] = x, l[f++] = m + o, l[f++] = x, l[f++] = m + o, l[f++] = S, l[f++] = m - o, l[f++] = x, l[f++] = m + o, l[f++] = S, l[f++] = m - o, l[f++] = S) : (x = g, S = g + b, g = S, b >= 0 ? (r[d++] = m - o, r[d++] = x, r[d++] = m + o, r[d++] = x, r[d++] = m + o, r[d++] = S, r[d++] = m - o, r[d++] = x, r[d++] = m + o, r[d++] = S, r[d++] = m - o, r[d++] = S) : (a[h++] = m - o, a[h++] = S, a[h++] = m + o, a[h++] = S, a[h++] = m + o, a[h++] = x, a[h++] = m - o, a[h++] = S, a[h++] = m + o, a[h++] = x, a[h++] = m - o, a[h++] = x)), y < s - 1) {
|
|
352
|
+
const M = i[y + 1];
|
|
353
353
|
c[u++] = m + o, c[u++] = S, c[u++] = M - o, c[u++] = S;
|
|
354
354
|
}
|
|
355
355
|
}
|
|
@@ -363,21 +363,21 @@ function xt(i, e, t, n) {
|
|
|
363
363
|
subtotalCount: f / 2
|
|
364
364
|
};
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function vt(i, e = !1) {
|
|
367
367
|
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;
|
|
368
368
|
return {
|
|
369
369
|
scale: [s, o],
|
|
370
370
|
translate: [r, a]
|
|
371
371
|
};
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function ce(i, e, t, n, s, o, r = 1) {
|
|
374
374
|
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(
|
|
375
375
|
e.uniforms.uTranslate,
|
|
376
376
|
s.translate[0],
|
|
377
377
|
s.translate[1]
|
|
378
378
|
), 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);
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function St(i, e, t, n, s, o) {
|
|
381
381
|
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(
|
|
382
382
|
e.uniforms.uTranslate,
|
|
383
383
|
s.translate[0],
|
|
@@ -386,7 +386,7 @@ function vt(i, e, t, n, s, o) {
|
|
|
386
386
|
const r = o[3] * 0.4;
|
|
387
387
|
i.uniform4f(e.uniforms.uColor, o[0], o[1], o[2], r), i.drawArrays(i.TRIANGLE_STRIP, 0, n), i.disableVertexAttribArray(e.attributes.position);
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function Se(i, e, t, n, s, o, r, a = "circle") {
|
|
390
390
|
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(
|
|
391
391
|
e.uniforms.uTranslate,
|
|
392
392
|
s.translate[0],
|
|
@@ -406,29 +406,29 @@ function be(i, e, t, n, s, o, r, a = "circle") {
|
|
|
406
406
|
}
|
|
407
407
|
i.drawArrays(i.POINTS, 0, n), i.disableVertexAttribArray(e.attributes.position);
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function Mt(i, e, t, n, s, o = { min: 0, max: 1 }, r) {
|
|
410
410
|
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(
|
|
411
411
|
e.uniforms.uTranslate,
|
|
412
412
|
s.translate[0],
|
|
413
413
|
s.translate[1]
|
|
414
414
|
), 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);
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function wt(i, e, t, n, s, o) {
|
|
417
417
|
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(
|
|
418
418
|
e.uniforms.uTranslate,
|
|
419
419
|
s.translate[0],
|
|
420
420
|
s.translate[1]
|
|
421
421
|
), i.uniform4f(e.uniforms.uColor, o[0], o[1], o[2], o[3]), i.drawArrays(i.TRIANGLES, 0, n), i.disableVertexAttribArray(e.attributes.position);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function Ct(i, e, t, n, s, o, r = 1) {
|
|
424
424
|
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(
|
|
425
425
|
e.uniforms.uTranslate,
|
|
426
426
|
s.translate[0],
|
|
427
427
|
s.translate[1]
|
|
428
428
|
), i.uniform4f(e.uniforms.uColor, o[0], o[1], o[2], o[3]), i.drawArrays(i.LINES, 0, n), i.disableVertexAttribArray(e.attributes.position);
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
const o =
|
|
430
|
+
function At(i, e, t, n, s) {
|
|
431
|
+
const o = we(s);
|
|
432
432
|
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(
|
|
433
433
|
e.line.uniforms.uTranslate,
|
|
434
434
|
n.translate[0],
|
|
@@ -437,11 +437,11 @@ function Ct(i, e, t, n, s) {
|
|
|
437
437
|
const r = [...o];
|
|
438
438
|
r[3] *= 0.5, i.uniform4f(e.line.uniforms.uColor, r[0], r[1], r[2], r[3]), i.drawArrays(i.TRIANGLES, 0, t.boxCount), i.uniform4f(e.line.uniforms.uColor, o[0], o[1], o[2], o[3]), i.lineWidth(s.width || 1), i.bindBuffer(i.ARRAY_BUFFER, t.linesBuffer), i.vertexAttribPointer(e.line.attributes.position, 2, i.FLOAT, !1, 0, 0), i.drawArrays(i.LINES, 0, t.linesCount), i.disableVertexAttribArray(e.line.attributes.position);
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function we(i) {
|
|
441
441
|
const e = _(i.color ?? "#ff0055");
|
|
442
442
|
return e[3] = i.opacity ?? 1, e;
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function kt(i, e, t, n, s, o) {
|
|
445
445
|
const { bounds: r, backgroundColor: a = [0.1, 0.1, 0.18, 1], plotArea: l } = o, c = e.height, d = e.width, h = l ? {
|
|
446
446
|
x: l.x * t,
|
|
447
447
|
y: c - (l.y + l.height) * t,
|
|
@@ -464,15 +464,15 @@ function At(i, e, t, n, s, o) {
|
|
|
464
464
|
o.plotAreaBackground[2],
|
|
465
465
|
o.plotAreaBackground[3]
|
|
466
466
|
), i.clear(i.COLOR_BUFFER_BIT));
|
|
467
|
-
const f =
|
|
467
|
+
const f = vt(r, o.invertX);
|
|
468
468
|
for (const u of s) {
|
|
469
469
|
if (!u.visible || u.count === 0 && u.type !== "boxplot" && u.type !== "waterfall") continue;
|
|
470
|
-
const
|
|
470
|
+
const g = u.yBounds ? u.yBounds.min : r.yMin, m = (u.yBounds ? u.yBounds.max : r.yMax) - g, b = m > 0 ? 2 / m : 1, v = -1 - g * b, x = {
|
|
471
471
|
scale: [f.scale[0], b],
|
|
472
472
|
translate: [f.translate[0], v]
|
|
473
|
-
}, S =
|
|
473
|
+
}, S = we(u.style);
|
|
474
474
|
if (u.type === "scatter")
|
|
475
|
-
|
|
475
|
+
Se(
|
|
476
476
|
i,
|
|
477
477
|
n.pointProgram,
|
|
478
478
|
u.buffer,
|
|
@@ -483,7 +483,7 @@ function At(i, e, t, n, s, o) {
|
|
|
483
483
|
u.style.symbol
|
|
484
484
|
);
|
|
485
485
|
else if (u.type === "line")
|
|
486
|
-
|
|
486
|
+
ce(
|
|
487
487
|
i,
|
|
488
488
|
n.lineProgram,
|
|
489
489
|
u.buffer,
|
|
@@ -493,7 +493,7 @@ function At(i, e, t, n, s, o) {
|
|
|
493
493
|
(u.style.width ?? 1) * t
|
|
494
494
|
);
|
|
495
495
|
else if (u.type === "line+scatter")
|
|
496
|
-
|
|
496
|
+
ce(
|
|
497
497
|
i,
|
|
498
498
|
n.lineProgram,
|
|
499
499
|
u.buffer,
|
|
@@ -501,7 +501,7 @@ function At(i, e, t, n, s, o) {
|
|
|
501
501
|
x,
|
|
502
502
|
S,
|
|
503
503
|
(u.style.width ?? 1) * t
|
|
504
|
-
),
|
|
504
|
+
), Se(
|
|
505
505
|
i,
|
|
506
506
|
n.pointProgram,
|
|
507
507
|
u.buffer,
|
|
@@ -512,7 +512,7 @@ function At(i, e, t, n, s, o) {
|
|
|
512
512
|
u.style.symbol
|
|
513
513
|
);
|
|
514
514
|
else if (u.type === "step" || u.type === "step+scatter")
|
|
515
|
-
u.stepBuffer && u.stepCount ?
|
|
515
|
+
u.stepBuffer && u.stepCount ? ce(
|
|
516
516
|
i,
|
|
517
517
|
n.lineProgram,
|
|
518
518
|
u.stepBuffer,
|
|
@@ -520,7 +520,7 @@ function At(i, e, t, n, s, o) {
|
|
|
520
520
|
x,
|
|
521
521
|
S,
|
|
522
522
|
(u.style.width ?? 1) * t
|
|
523
|
-
) :
|
|
523
|
+
) : ce(
|
|
524
524
|
i,
|
|
525
525
|
n.lineProgram,
|
|
526
526
|
u.buffer,
|
|
@@ -528,7 +528,7 @@ function At(i, e, t, n, s, o) {
|
|
|
528
528
|
x,
|
|
529
529
|
S,
|
|
530
530
|
(u.style.width ?? 1) * t
|
|
531
|
-
), u.type === "step+scatter" &&
|
|
531
|
+
), u.type === "step+scatter" && Se(
|
|
532
532
|
i,
|
|
533
533
|
n.pointProgram,
|
|
534
534
|
u.buffer,
|
|
@@ -539,7 +539,7 @@ function At(i, e, t, n, s, o) {
|
|
|
539
539
|
u.style.symbol
|
|
540
540
|
);
|
|
541
541
|
else if (u.type === "band")
|
|
542
|
-
|
|
542
|
+
St(
|
|
543
543
|
i,
|
|
544
544
|
n.lineProgram,
|
|
545
545
|
u.buffer,
|
|
@@ -548,7 +548,7 @@ function At(i, e, t, n, s, o) {
|
|
|
548
548
|
S
|
|
549
549
|
);
|
|
550
550
|
else if (u.type === "heatmap")
|
|
551
|
-
|
|
551
|
+
Mt(
|
|
552
552
|
i,
|
|
553
553
|
n.heatmapProgram,
|
|
554
554
|
u.buffer,
|
|
@@ -558,7 +558,7 @@ function At(i, e, t, n, s, o) {
|
|
|
558
558
|
u.colormapTexture
|
|
559
559
|
);
|
|
560
560
|
else if (u.type === "bar")
|
|
561
|
-
|
|
561
|
+
wt(
|
|
562
562
|
i,
|
|
563
563
|
n.lineProgram,
|
|
564
564
|
u.buffer,
|
|
@@ -567,7 +567,7 @@ function At(i, e, t, n, s, o) {
|
|
|
567
567
|
S
|
|
568
568
|
);
|
|
569
569
|
else if (u.type === "boxplot")
|
|
570
|
-
u.boxBuffer && u.boxLinesBuffer &&
|
|
570
|
+
u.boxBuffer && u.boxLinesBuffer && At(
|
|
571
571
|
i,
|
|
572
572
|
{ line: n.lineProgram, point: n.pointProgram },
|
|
573
573
|
{
|
|
@@ -580,18 +580,18 @@ function At(i, e, t, n, s, o) {
|
|
|
580
580
|
u.style
|
|
581
581
|
);
|
|
582
582
|
else if (u.type === "waterfall") {
|
|
583
|
-
const M = _(u.style.positiveColor || "#22c55e"),
|
|
584
|
-
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, x.scale[0], x.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, x.translate[0], x.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, x.scale[0], x.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, x.translate[0], x.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor,
|
|
583
|
+
const M = _(u.style.positiveColor || "#22c55e"), w = _(u.style.negativeColor || "#ef4444"), A = _(u.style.subtotalColor || "#3b82f6"), P = _(u.style.connectorColor || "#64748b");
|
|
584
|
+
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, x.scale[0], x.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, x.translate[0], x.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, x.scale[0], x.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, x.translate[0], x.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor, w[0], w[1], w[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, x.scale[0], x.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, x.translate[0], x.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, x.scale[0], x.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, x.translate[0], x.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);
|
|
585
585
|
}
|
|
586
586
|
if (u.errorBuffer && u.errorCount) {
|
|
587
|
-
const M = u.style.errorBars || {},
|
|
588
|
-
|
|
587
|
+
const M = u.style.errorBars || {}, w = M.color ? we({ color: M.color, opacity: M.opacity ?? 0.7 }) : S;
|
|
588
|
+
Ct(
|
|
589
589
|
i,
|
|
590
590
|
n.lineProgram,
|
|
591
591
|
u.errorBuffer,
|
|
592
592
|
u.errorCount,
|
|
593
593
|
x,
|
|
594
|
-
|
|
594
|
+
w,
|
|
595
595
|
M.width ?? 1
|
|
596
596
|
);
|
|
597
597
|
}
|
|
@@ -624,7 +624,7 @@ class Pt {
|
|
|
624
624
|
this.textures.forEach((e) => this.gl.deleteTexture(e)), this.textures.clear();
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
class
|
|
627
|
+
class Bt {
|
|
628
628
|
constructor(e) {
|
|
629
629
|
p(this, "canvas");
|
|
630
630
|
p(this, "gl");
|
|
@@ -641,7 +641,7 @@ class $e {
|
|
|
641
641
|
powerPreference: "high-performance"
|
|
642
642
|
});
|
|
643
643
|
if (!t) throw new Error("WebGL not supported");
|
|
644
|
-
this.gl = t, this.programs =
|
|
644
|
+
this.gl = t, this.programs = dt(t), this.buffers = new ot(t), this.textures = new Pt(t), t.enable(t.BLEND), t.blendFunc(t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA), this.isInitialized = !0;
|
|
645
645
|
}
|
|
646
646
|
setDPR(e) {
|
|
647
647
|
this.dpr = e, this.resize();
|
|
@@ -671,10 +671,10 @@ class $e {
|
|
|
671
671
|
return this.textures.getTexture(e);
|
|
672
672
|
}
|
|
673
673
|
render(e, t) {
|
|
674
|
-
this.isInitialized &&
|
|
674
|
+
this.isInitialized && kt(this.gl, this.canvas, this.dpr, this.programs, e, t);
|
|
675
675
|
}
|
|
676
676
|
resize() {
|
|
677
|
-
const e = this.canvas.getBoundingClientRect(), t = e.width * this.dpr, n = e.height * this.dpr;
|
|
677
|
+
const e = this.canvas.getBoundingClientRect(), t = Math.round(e.width * this.dpr), n = Math.round(e.height * this.dpr);
|
|
678
678
|
(this.canvas.width !== t || this.canvas.height !== n) && (this.canvas.width = t, this.canvas.height = n, this.gl.viewport(0, 0, t, n));
|
|
679
679
|
}
|
|
680
680
|
getLimits() {
|
|
@@ -691,7 +691,7 @@ class $e {
|
|
|
691
691
|
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;
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
|
-
const
|
|
694
|
+
const Ae = {
|
|
695
695
|
name: "vibrant",
|
|
696
696
|
isDark: !0,
|
|
697
697
|
colors: [
|
|
@@ -738,7 +738,7 @@ const Ce = {
|
|
|
738
738
|
],
|
|
739
739
|
highlightColor: "#FFFFFF"
|
|
740
740
|
// Pure White
|
|
741
|
-
},
|
|
741
|
+
}, Xe = {
|
|
742
742
|
name: "pastel",
|
|
743
743
|
isDark: !1,
|
|
744
744
|
colors: [
|
|
@@ -785,7 +785,7 @@ const Ce = {
|
|
|
785
785
|
],
|
|
786
786
|
highlightColor: "#1A1A1A"
|
|
787
787
|
// Near Black
|
|
788
|
-
},
|
|
788
|
+
}, Tt = {
|
|
789
789
|
name: "neon",
|
|
790
790
|
isDark: !0,
|
|
791
791
|
colors: [
|
|
@@ -832,7 +832,7 @@ const Ce = {
|
|
|
832
832
|
],
|
|
833
833
|
highlightColor: "#FFFFFF"
|
|
834
834
|
// Pure White
|
|
835
|
-
},
|
|
835
|
+
}, Et = {
|
|
836
836
|
name: "earth",
|
|
837
837
|
isDark: !1,
|
|
838
838
|
colors: [
|
|
@@ -879,7 +879,7 @@ const Ce = {
|
|
|
879
879
|
],
|
|
880
880
|
highlightColor: "#000000"
|
|
881
881
|
// Pure Black
|
|
882
|
-
},
|
|
882
|
+
}, It = {
|
|
883
883
|
name: "ocean",
|
|
884
884
|
isDark: !0,
|
|
885
885
|
colors: [
|
|
@@ -926,21 +926,21 @@ const Ce = {
|
|
|
926
926
|
],
|
|
927
927
|
highlightColor: "#FFD700"
|
|
928
928
|
// Gold
|
|
929
|
-
},
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
Bt,
|
|
929
|
+
}, Rt = [
|
|
930
|
+
Ae,
|
|
931
|
+
Xe,
|
|
933
932
|
Tt,
|
|
934
|
-
|
|
933
|
+
Et,
|
|
934
|
+
It
|
|
935
935
|
];
|
|
936
936
|
function Ee(i) {
|
|
937
|
-
const e =
|
|
938
|
-
return e || (console.warn(`[ColorScheme] Unknown scheme "${i}", using vibrant`),
|
|
937
|
+
const e = Rt.find((t) => t.name === i);
|
|
938
|
+
return e || (console.warn(`[ColorScheme] Unknown scheme "${i}", using vibrant`), Ae);
|
|
939
939
|
}
|
|
940
940
|
function Ie(i) {
|
|
941
|
-
return i ?
|
|
941
|
+
return i ? Ae : Xe;
|
|
942
942
|
}
|
|
943
|
-
const
|
|
943
|
+
const H = {
|
|
944
944
|
lineColor: "#666666",
|
|
945
945
|
// Brighter
|
|
946
946
|
lineWidth: 1,
|
|
@@ -956,7 +956,7 @@ const X = {
|
|
|
956
956
|
titleSize: 14,
|
|
957
957
|
// Larger
|
|
958
958
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
959
|
-
},
|
|
959
|
+
}, ge = {
|
|
960
960
|
visible: !0,
|
|
961
961
|
majorColor: "rgba(255, 255, 255, 0.12)",
|
|
962
962
|
// Higher opacity
|
|
@@ -968,7 +968,7 @@ const X = {
|
|
|
968
968
|
showMinor: !0,
|
|
969
969
|
// Default to show minor
|
|
970
970
|
minorDivisions: 5
|
|
971
|
-
},
|
|
971
|
+
}, ye = {
|
|
972
972
|
visible: !0,
|
|
973
973
|
position: "top-right",
|
|
974
974
|
backgroundColor: "rgba(15, 23, 42, 0.2)",
|
|
@@ -980,11 +980,11 @@ const X = {
|
|
|
980
980
|
padding: 5,
|
|
981
981
|
itemGap: 3,
|
|
982
982
|
swatchSize: 12
|
|
983
|
-
},
|
|
983
|
+
}, ke = {
|
|
984
984
|
backgroundColor: "rgba(15, 23, 42, 0.2)",
|
|
985
985
|
borderColor: "rgba(255, 255, 255, 0.08)",
|
|
986
986
|
borderRadius: 8
|
|
987
|
-
},
|
|
987
|
+
}, me = {
|
|
988
988
|
lineColor: "rgba(255, 255, 255, 0.5)",
|
|
989
989
|
lineWidth: 1,
|
|
990
990
|
lineDash: [5, 5],
|
|
@@ -992,100 +992,100 @@ const X = {
|
|
|
992
992
|
tooltipBorder: "rgba(255, 255, 255, 0.2)",
|
|
993
993
|
tooltipColor: "#ffffff",
|
|
994
994
|
tooltipSize: 11
|
|
995
|
-
},
|
|
995
|
+
}, Ce = {
|
|
996
996
|
name: "dark",
|
|
997
997
|
isDark: !0,
|
|
998
998
|
backgroundColor: "#0b0e14",
|
|
999
999
|
plotAreaBackground: "#0b0e14",
|
|
1000
1000
|
plotBorderColor: "#444c56",
|
|
1001
1001
|
grid: {
|
|
1002
|
-
...
|
|
1002
|
+
...ge,
|
|
1003
1003
|
majorColor: "rgba(255, 255, 255, 0.12)",
|
|
1004
1004
|
minorColor: "rgba(255, 255, 255, 0.04)"
|
|
1005
1005
|
},
|
|
1006
1006
|
xAxis: {
|
|
1007
|
-
...
|
|
1007
|
+
...H,
|
|
1008
1008
|
labelColor: "#adbac7",
|
|
1009
1009
|
titleColor: "#cdd9e5",
|
|
1010
1010
|
lineColor: "#444c56",
|
|
1011
1011
|
tickColor: "#444c56"
|
|
1012
1012
|
},
|
|
1013
1013
|
yAxis: {
|
|
1014
|
-
...
|
|
1014
|
+
...H,
|
|
1015
1015
|
labelColor: "#adbac7",
|
|
1016
1016
|
titleColor: "#cdd9e5",
|
|
1017
1017
|
lineColor: "#444c56",
|
|
1018
1018
|
tickColor: "#444c56"
|
|
1019
1019
|
},
|
|
1020
|
-
legend:
|
|
1021
|
-
cursor:
|
|
1022
|
-
toolbar:
|
|
1023
|
-
},
|
|
1020
|
+
legend: ye,
|
|
1021
|
+
cursor: me,
|
|
1022
|
+
toolbar: ke
|
|
1023
|
+
}, Ft = {
|
|
1024
1024
|
name: "midnight",
|
|
1025
1025
|
isDark: !0,
|
|
1026
1026
|
backgroundColor: "#05050a",
|
|
1027
1027
|
plotAreaBackground: "#070715",
|
|
1028
1028
|
plotBorderColor: "#3a3a5a",
|
|
1029
1029
|
grid: {
|
|
1030
|
-
...
|
|
1030
|
+
...ge,
|
|
1031
1031
|
majorColor: "rgba(150, 150, 255, 0.2)",
|
|
1032
1032
|
minorColor: "rgba(150, 150, 255, 0.08)"
|
|
1033
1033
|
},
|
|
1034
1034
|
xAxis: {
|
|
1035
|
-
...
|
|
1035
|
+
...H,
|
|
1036
1036
|
lineColor: "#5a5a8a",
|
|
1037
1037
|
labelColor: "#b0b0e0",
|
|
1038
1038
|
titleColor: "#d0d0f0",
|
|
1039
1039
|
tickColor: "#5a5a8a"
|
|
1040
1040
|
},
|
|
1041
1041
|
yAxis: {
|
|
1042
|
-
...
|
|
1042
|
+
...H,
|
|
1043
1043
|
lineColor: "#5a5a8a",
|
|
1044
1044
|
labelColor: "#b0b0e0",
|
|
1045
1045
|
titleColor: "#d0d0f0",
|
|
1046
1046
|
tickColor: "#5a5a8a"
|
|
1047
1047
|
},
|
|
1048
1048
|
legend: {
|
|
1049
|
-
...
|
|
1049
|
+
...ye,
|
|
1050
1050
|
backgroundColor: "rgba(5, 5, 15, 0.2)",
|
|
1051
1051
|
borderColor: "rgba(100, 100, 255, 0.4)"
|
|
1052
1052
|
},
|
|
1053
1053
|
toolbar: {
|
|
1054
|
-
...
|
|
1054
|
+
...ke,
|
|
1055
1055
|
backgroundColor: "rgba(5, 5, 15, 0.2)",
|
|
1056
1056
|
borderColor: "rgba(100, 100, 255, 0.2)"
|
|
1057
1057
|
},
|
|
1058
1058
|
cursor: {
|
|
1059
|
-
...
|
|
1059
|
+
...me,
|
|
1060
1060
|
lineColor: "rgba(150, 150, 255, 0.7)"
|
|
1061
1061
|
}
|
|
1062
|
-
},
|
|
1062
|
+
}, Dt = {
|
|
1063
1063
|
name: "light",
|
|
1064
1064
|
isDark: !1,
|
|
1065
1065
|
backgroundColor: "#ffffff",
|
|
1066
1066
|
plotAreaBackground: "#ffffff",
|
|
1067
1067
|
plotBorderColor: "#cccccc",
|
|
1068
1068
|
grid: {
|
|
1069
|
-
...
|
|
1069
|
+
...ge,
|
|
1070
1070
|
majorColor: "rgba(0, 0, 0, 0.1)",
|
|
1071
1071
|
minorColor: "rgba(0, 0, 0, 0.04)"
|
|
1072
1072
|
},
|
|
1073
1073
|
xAxis: {
|
|
1074
|
-
...
|
|
1074
|
+
...H,
|
|
1075
1075
|
lineColor: "#888888",
|
|
1076
1076
|
tickColor: "#888888",
|
|
1077
1077
|
labelColor: "#444444",
|
|
1078
1078
|
titleColor: "#222222"
|
|
1079
1079
|
},
|
|
1080
1080
|
yAxis: {
|
|
1081
|
-
...
|
|
1081
|
+
...H,
|
|
1082
1082
|
lineColor: "#888888",
|
|
1083
1083
|
tickColor: "#888888",
|
|
1084
1084
|
labelColor: "#444444",
|
|
1085
1085
|
titleColor: "#222222"
|
|
1086
1086
|
},
|
|
1087
1087
|
legend: {
|
|
1088
|
-
...
|
|
1088
|
+
...ye,
|
|
1089
1089
|
backgroundColor: "rgba(255, 255, 255, 0.2)",
|
|
1090
1090
|
borderColor: "rgba(0, 0, 0, 0.15)",
|
|
1091
1091
|
textColor: "#222222"
|
|
@@ -1096,53 +1096,53 @@ const X = {
|
|
|
1096
1096
|
borderRadius: 8
|
|
1097
1097
|
},
|
|
1098
1098
|
cursor: {
|
|
1099
|
-
...
|
|
1099
|
+
...me,
|
|
1100
1100
|
lineColor: "rgba(0, 0, 0, 0.4)",
|
|
1101
1101
|
tooltipBackground: "rgba(50, 50, 60, 0.95)"
|
|
1102
1102
|
}
|
|
1103
|
-
},
|
|
1103
|
+
}, Lt = {
|
|
1104
1104
|
name: "electrochemistry",
|
|
1105
1105
|
isDark: !0,
|
|
1106
1106
|
backgroundColor: "#0a1628",
|
|
1107
1107
|
plotAreaBackground: "#0d1b2e",
|
|
1108
1108
|
plotBorderColor: "#1e3a5f",
|
|
1109
1109
|
grid: {
|
|
1110
|
-
...
|
|
1110
|
+
...ge,
|
|
1111
1111
|
majorColor: "rgba(30, 136, 229, 0.15)",
|
|
1112
1112
|
minorColor: "rgba(30, 136, 229, 0.06)",
|
|
1113
1113
|
showMinor: !0,
|
|
1114
1114
|
minorDivisions: 2
|
|
1115
1115
|
},
|
|
1116
1116
|
xAxis: {
|
|
1117
|
-
...
|
|
1117
|
+
...H,
|
|
1118
1118
|
lineColor: "#1e88e5",
|
|
1119
1119
|
tickColor: "#42a5f5",
|
|
1120
1120
|
labelColor: "#90caf9",
|
|
1121
1121
|
titleColor: "#bbdefb"
|
|
1122
1122
|
},
|
|
1123
1123
|
yAxis: {
|
|
1124
|
-
...
|
|
1124
|
+
...H,
|
|
1125
1125
|
lineColor: "#1e88e5",
|
|
1126
1126
|
tickColor: "#42a5f5",
|
|
1127
1127
|
labelColor: "#90caf9",
|
|
1128
1128
|
titleColor: "#bbdefb"
|
|
1129
1129
|
},
|
|
1130
1130
|
legend: {
|
|
1131
|
-
...
|
|
1131
|
+
...ye,
|
|
1132
1132
|
backgroundColor: "rgba(10, 22, 40, 0.2)",
|
|
1133
1133
|
borderColor: "rgba(30, 136, 229, 0.3)"
|
|
1134
1134
|
},
|
|
1135
1135
|
toolbar: {
|
|
1136
|
-
...
|
|
1136
|
+
...ke,
|
|
1137
1137
|
backgroundColor: "rgba(10, 22, 40, 0.2)",
|
|
1138
1138
|
borderColor: "rgba(30, 136, 229, 0.15)"
|
|
1139
1139
|
},
|
|
1140
1140
|
cursor: {
|
|
1141
|
-
...
|
|
1141
|
+
...me,
|
|
1142
1142
|
lineColor: "rgba(100, 180, 255, 0.6)"
|
|
1143
1143
|
}
|
|
1144
1144
|
};
|
|
1145
|
-
function
|
|
1145
|
+
function mn(i, e) {
|
|
1146
1146
|
return {
|
|
1147
1147
|
...i,
|
|
1148
1148
|
...e,
|
|
@@ -1154,23 +1154,29 @@ function dn(i, e) {
|
|
|
1154
1154
|
toolbar: { ...i.toolbar, ...e.toolbar }
|
|
1155
1155
|
};
|
|
1156
1156
|
}
|
|
1157
|
-
function
|
|
1157
|
+
function He(i) {
|
|
1158
1158
|
switch (i) {
|
|
1159
1159
|
case "dark":
|
|
1160
|
-
return
|
|
1160
|
+
return Ce;
|
|
1161
1161
|
case "midnight":
|
|
1162
|
-
return
|
|
1162
|
+
return Ft;
|
|
1163
1163
|
case "light":
|
|
1164
|
-
return
|
|
1164
|
+
return Dt;
|
|
1165
1165
|
case "electrochemistry":
|
|
1166
1166
|
case "electrochem":
|
|
1167
|
-
return
|
|
1167
|
+
return Lt;
|
|
1168
1168
|
default:
|
|
1169
|
-
return console.warn(`[Theme] Unknown theme "${i}", using dark`),
|
|
1169
|
+
return console.warn(`[Theme] Unknown theme "${i}", using dark`), Ce;
|
|
1170
1170
|
}
|
|
1171
1171
|
}
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1172
|
+
const zt = Ce;
|
|
1173
|
+
function Y(i) {
|
|
1174
|
+
return Math.floor(i) + 0.5;
|
|
1175
|
+
}
|
|
1176
|
+
function de(i) {
|
|
1177
|
+
return Math.round(i);
|
|
1178
|
+
}
|
|
1179
|
+
class Ot {
|
|
1174
1180
|
constructor(e, t) {
|
|
1175
1181
|
p(this, "ctx");
|
|
1176
1182
|
p(this, "theme");
|
|
@@ -1227,20 +1233,20 @@ class Lt {
|
|
|
1227
1233
|
if (!this.theme.grid.visible) return;
|
|
1228
1234
|
const { ctx: r } = this, a = this.theme.grid, l = (s == null ? void 0 : s.tickCount) ?? 8, c = (o == null ? void 0 : o.tickCount) ?? 6, d = t.ticks(l), h = n.ticks(c);
|
|
1229
1235
|
if (r.strokeStyle = a.majorColor, r.lineWidth = a.majorWidth, r.setLineDash(a.majorDash), d.forEach((f) => {
|
|
1230
|
-
const u = t.transform(f);
|
|
1236
|
+
const u = Y(t.transform(f));
|
|
1231
1237
|
u >= e.x && u <= e.x + e.width && (r.beginPath(), r.moveTo(u, e.y), r.lineTo(u, e.y + e.height), r.stroke());
|
|
1232
1238
|
}), h.forEach((f) => {
|
|
1233
|
-
const u = n.transform(f);
|
|
1239
|
+
const u = Y(n.transform(f));
|
|
1234
1240
|
u >= e.y && u <= e.y + e.height && (r.beginPath(), r.moveTo(e.x, u), r.lineTo(e.x + e.width, u), r.stroke());
|
|
1235
1241
|
}), a.showMinor) {
|
|
1236
1242
|
r.strokeStyle = a.minorColor, r.lineWidth = a.minorWidth, r.setLineDash(a.minorDash);
|
|
1237
1243
|
const f = this.generateMinorTicks(d, a.minorDivisions), u = this.generateMinorTicks(h, a.minorDivisions);
|
|
1238
|
-
f.forEach((
|
|
1239
|
-
const
|
|
1240
|
-
|
|
1241
|
-
}), u.forEach((
|
|
1242
|
-
const
|
|
1243
|
-
|
|
1244
|
+
f.forEach((g) => {
|
|
1245
|
+
const y = Y(t.transform(g));
|
|
1246
|
+
y >= e.x && y <= e.x + e.width && (r.beginPath(), r.moveTo(y, e.y), r.lineTo(y, e.y + e.height), r.stroke());
|
|
1247
|
+
}), u.forEach((g) => {
|
|
1248
|
+
const y = Y(n.transform(g));
|
|
1249
|
+
y >= e.y && y <= e.y + e.height && (r.beginPath(), r.moveTo(e.x, y), r.lineTo(e.x + e.width, y), r.stroke());
|
|
1244
1250
|
});
|
|
1245
1251
|
}
|
|
1246
1252
|
r.setLineDash([]);
|
|
@@ -1257,21 +1263,21 @@ class Lt {
|
|
|
1257
1263
|
{ x: e.x + e.width, y: e.y + e.height }
|
|
1258
1264
|
];
|
|
1259
1265
|
let f = 0;
|
|
1260
|
-
for (const
|
|
1261
|
-
const
|
|
1262
|
-
f = Math.max(f,
|
|
1266
|
+
for (const g of h) {
|
|
1267
|
+
const y = Math.sqrt(Math.pow(g.x - c, 2) + Math.pow(g.y - d, 2));
|
|
1268
|
+
f = Math.max(f, y);
|
|
1263
1269
|
}
|
|
1264
1270
|
a.save(), a.beginPath(), a.rect(e.x, e.y, e.width, e.height), a.clip(), a.strokeStyle = l.majorColor, a.lineWidth = l.majorWidth, a.setLineDash(l.majorDash);
|
|
1265
|
-
for (let
|
|
1266
|
-
const
|
|
1267
|
-
a.beginPath(), a.arc(c, d,
|
|
1271
|
+
for (let g = 1; g <= s; g++) {
|
|
1272
|
+
const y = g / s * f;
|
|
1273
|
+
a.beginPath(), a.arc(c, d, y, 0, 2 * Math.PI), a.stroke();
|
|
1268
1274
|
}
|
|
1269
1275
|
const u = r === "degrees" ? 360 / o * (Math.PI / 180) : 2 * Math.PI / o;
|
|
1270
|
-
for (let
|
|
1271
|
-
const
|
|
1276
|
+
for (let g = 0; g < o; g++) {
|
|
1277
|
+
const y = g * u;
|
|
1272
1278
|
a.beginPath(), a.moveTo(c, d), a.lineTo(
|
|
1273
|
-
c + f * Math.cos(
|
|
1274
|
-
d - f * Math.sin(
|
|
1279
|
+
c + f * Math.cos(y),
|
|
1280
|
+
d - f * Math.sin(y)
|
|
1275
1281
|
// Subtract because Canvas Y is inverted
|
|
1276
1282
|
), a.stroke();
|
|
1277
1283
|
}
|
|
@@ -1281,11 +1287,11 @@ class Lt {
|
|
|
1281
1287
|
* Draw X axis with ticks and labels
|
|
1282
1288
|
*/
|
|
1283
1289
|
drawXAxis(e, t, n, s) {
|
|
1284
|
-
const { ctx: o } = this, r = this.theme.xAxis, a = (n == null ? void 0 : n.tickCount) ?? 8, l = t.ticks(a), c = e.y + e.height, d = n == null ? void 0 : n.label, h = (n == null ? void 0 : n.showLine) !== !1, f = (n == null ? void 0 : n.showTicks) !== !1, u = (n == null ? void 0 : n.showLabels) !== !1,
|
|
1285
|
-
if (h && (o.strokeStyle = r.lineColor, o.lineWidth = r.lineWidth, o.beginPath(), o.moveTo(e.x, c), o.lineTo(e.x + e.width, c), o.stroke()), (f || u) && (o.fillStyle = r.labelColor, o.font = `${r.labelSize}px ${r.fontFamily}`, o.textAlign = "center", o.textBaseline = "top", l.forEach((
|
|
1286
|
-
const m = t.transform(
|
|
1290
|
+
const { ctx: o } = this, r = this.theme.xAxis, a = (n == null ? void 0 : n.tickCount) ?? 8, l = t.ticks(a), c = Y(e.y + e.height), d = n == null ? void 0 : n.label, h = (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];
|
|
1291
|
+
if (h && (o.strokeStyle = r.lineColor, o.lineWidth = r.lineWidth, o.beginPath(), o.moveTo(e.x, c), o.lineTo(e.x + e.width, c), o.stroke()), (f || u) && (o.fillStyle = r.labelColor, o.font = `${r.labelSize}px ${r.fontFamily}`, o.textAlign = "center", o.textBaseline = "top", l.forEach((y) => {
|
|
1292
|
+
const m = de(t.transform(y));
|
|
1287
1293
|
m >= e.x && m <= e.x + e.width && (f && (o.strokeStyle = r.tickColor, o.beginPath(), o.moveTo(m, c), o.lineTo(m, c + r.tickLength), o.stroke()), u && this.drawLatexOrText(
|
|
1288
|
-
this.formatXTick(
|
|
1294
|
+
this.formatXTick(y, n, g),
|
|
1289
1295
|
m,
|
|
1290
1296
|
c + r.tickLength + 3,
|
|
1291
1297
|
{
|
|
@@ -1297,8 +1303,8 @@ class Lt {
|
|
|
1297
1303
|
}
|
|
1298
1304
|
));
|
|
1299
1305
|
})), d) {
|
|
1300
|
-
const
|
|
1301
|
-
this.drawLatexOrText(d, e.x + e.width / 2, e.y + e.height +
|
|
1306
|
+
const y = (s == null ? void 0 : s.titleGap) ?? 45;
|
|
1307
|
+
this.drawLatexOrText(d, e.x + e.width / 2, e.y + e.height + y, {
|
|
1302
1308
|
fontSize: r.titleSize,
|
|
1303
1309
|
fontFamily: r.fontFamily,
|
|
1304
1310
|
color: r.titleColor,
|
|
@@ -1311,11 +1317,11 @@ class Lt {
|
|
|
1311
1317
|
* Draw Y axis with ticks and labels
|
|
1312
1318
|
*/
|
|
1313
1319
|
drawYAxis(e, t, n, s = "left", o = 0, r) {
|
|
1314
|
-
const { ctx: a } = this, l = this.theme.yAxis, c = (n == null ? void 0 : n.tickCount) ?? 6, d = t.ticks(c), h = n == null ? void 0 : n.label, f = (n == null ? void 0 : n.showLine) !== !1, u = (n == null ? void 0 : n.showTicks) !== !1,
|
|
1315
|
-
if (f && (a.strokeStyle = l.lineColor, a.lineWidth = l.lineWidth, a.beginPath(), a.moveTo(
|
|
1316
|
-
const v = t.transform(b);
|
|
1317
|
-
if (v >= e.y && v <= e.y + e.height && (u && (a.strokeStyle = l.tickColor, a.beginPath(), a.moveTo(
|
|
1318
|
-
const x =
|
|
1320
|
+
const { ctx: a } = this, l = this.theme.yAxis, c = (n == null ? void 0 : n.tickCount) ?? 6, d = t.ticks(c), h = 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 = Y(s === "left" ? e.x - o : e.x + e.width + o), m = s === "left" ? -1 : 1;
|
|
1321
|
+
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) => {
|
|
1322
|
+
const v = de(t.transform(b));
|
|
1323
|
+
if (v >= e.y && v <= e.y + e.height && (u && (a.strokeStyle = l.tickColor, a.beginPath(), a.moveTo(y, v), a.lineTo(y + l.tickLength * m, v), a.stroke()), g)) {
|
|
1324
|
+
const x = y + (l.tickLength + 3) * m;
|
|
1319
1325
|
this.drawLatexOrText(this.formatYTick(b, n), x, v, {
|
|
1320
1326
|
fontSize: l.labelSize,
|
|
1321
1327
|
fontFamily: l.fontFamily,
|
|
@@ -1325,7 +1331,7 @@ class Lt {
|
|
|
1325
1331
|
});
|
|
1326
1332
|
}
|
|
1327
1333
|
})), h) {
|
|
1328
|
-
const b = (r == null ? void 0 : r.titleGap) ?? 50, v = s === "left" ?
|
|
1334
|
+
const b = (r == null ? void 0 : r.titleGap) ?? 50, v = s === "left" ? y - b : y + b, x = e.y + e.height / 2;
|
|
1329
1335
|
this.drawLatexOrText(h, v, x, {
|
|
1330
1336
|
fontSize: l.titleSize,
|
|
1331
1337
|
fontFamily: l.fontFamily,
|
|
@@ -1347,13 +1353,13 @@ class Lt {
|
|
|
1347
1353
|
* Draw chart title
|
|
1348
1354
|
*/
|
|
1349
1355
|
drawChartTitle(e, t) {
|
|
1350
|
-
var u,
|
|
1356
|
+
var u, g;
|
|
1351
1357
|
if (!t.visible || !t.text) return;
|
|
1352
1358
|
const { ctx: n } = this, s = t.fontSize ?? 16, o = t.fontFamily ?? "Inter, system-ui, sans-serif", r = t.fontWeight ?? 600, a = t.color ?? "#ffffff";
|
|
1353
1359
|
n.save(), n.font = `${r} ${s}px ${o}`, n.fillStyle = a, n.textAlign = t.align ?? "center", n.textBaseline = t.position === "bottom" ? "top" : "bottom";
|
|
1354
1360
|
let l, c;
|
|
1355
1361
|
t.align === "left" ? l = e.x : t.align === "right" ? l = e.x + e.width : l = e.x + e.width / 2;
|
|
1356
|
-
const d = typeof t.padding == "number" ? t.padding : 10, h = ((u = t.padding) == null ? void 0 : u.top) ?? d, f = ((
|
|
1362
|
+
const d = typeof t.padding == "number" ? t.padding : 10, h = ((u = t.padding) == null ? void 0 : u.top) ?? d, f = ((g = t.padding) == null ? void 0 : g.bottom) ?? d;
|
|
1357
1363
|
t.position === "bottom" ? c = e.y + e.height + 45 + h : c = e.y - f, this.drawLatexOrText(t.text, l, c, {
|
|
1358
1364
|
fontSize: s,
|
|
1359
1365
|
fontFamily: o,
|
|
@@ -1372,15 +1378,15 @@ class Lt {
|
|
|
1372
1378
|
n.font = `${s.fontSize}px ${s.fontFamily}`;
|
|
1373
1379
|
let o = 0;
|
|
1374
1380
|
const r = t.map((f) => {
|
|
1375
|
-
const u = f.getId(),
|
|
1381
|
+
const u = f.getId(), g = f.getStyle(), y = this.latexAPI && (u.includes("\\") || u.includes("^") || u.includes("_"));
|
|
1376
1382
|
let m = 0;
|
|
1377
|
-
return
|
|
1383
|
+
return y ? m = this.latexAPI.measure(u, { fontSize: s.fontSize }).width : m = n.measureText(u).width, o = Math.max(o, m), {
|
|
1378
1384
|
id: f.getId(),
|
|
1379
|
-
color:
|
|
1385
|
+
color: g.color ?? "#ff0055",
|
|
1380
1386
|
label: u,
|
|
1381
1387
|
type: f.getType(),
|
|
1382
|
-
symbol:
|
|
1383
|
-
opacity:
|
|
1388
|
+
symbol: g.symbol,
|
|
1389
|
+
opacity: g.opacity ?? 1
|
|
1384
1390
|
};
|
|
1385
1391
|
}), a = s.swatchSize + 8 + o + s.padding * 2, l = r.length * (s.swatchSize + s.itemGap) - s.itemGap + s.padding * 2;
|
|
1386
1392
|
let c, d;
|
|
@@ -1402,10 +1408,10 @@ class Lt {
|
|
|
1402
1408
|
n.fillStyle = s.backgroundColor, n.strokeStyle = s.borderColor, n.lineWidth = 1, n.beginPath();
|
|
1403
1409
|
const h = s.borderRadius;
|
|
1404
1410
|
n.moveTo(c + h, d), n.lineTo(c + a - h, d), n.arcTo(c + a, d, c + a, d + h, h), n.lineTo(c + a, d + l - h), n.arcTo(c + a, d + l, c + a - h, d + l, h), n.lineTo(c + h, d + l), n.arcTo(c, d + l, c, d + l - h, h), n.lineTo(c, d + h), n.arcTo(c, d, c + h, d, h), n.closePath(), n.fill(), n.stroke(), n.textAlign = "left", n.textBaseline = "middle", r.forEach((f, u) => {
|
|
1405
|
-
const
|
|
1411
|
+
const g = d + s.padding + u * (s.swatchSize + s.itemGap), y = c + s.padding, m = g + s.swatchSize / 2, b = y + s.swatchSize / 2;
|
|
1406
1412
|
n.save(), n.globalAlpha = f.opacity, n.fillStyle = f.color, n.strokeStyle = f.color, n.lineWidth = 2;
|
|
1407
|
-
const v = s.swatchSize, x = String(f.type).toLowerCase(), S = !!f.symbol && f.symbol !== "circle", M = x === "scatter" || x === "1" || x === "line" && S,
|
|
1408
|
-
M ? this.drawLegendSymbol(n, f.symbol ?? "circle", b, m, v * 0.9) :
|
|
1413
|
+
const v = s.swatchSize, x = String(f.type).toLowerCase(), S = !!f.symbol && f.symbol !== "circle", M = x === "scatter" || x === "1" || x === "line" && S, w = x.includes("scatter") || x === "2";
|
|
1414
|
+
M ? this.drawLegendSymbol(n, f.symbol ?? "circle", b, m, v * 0.9) : w ? (n.beginPath(), n.moveTo(y, m), n.lineTo(y + v, m), n.stroke(), this.drawLegendSymbol(n, f.symbol ?? "circle", b, m, v * 0.6)) : (n.beginPath(), n.moveTo(y, m), n.lineTo(y + v, m), n.stroke()), n.restore(), this.drawLatexOrText(f.label, c + s.padding + s.swatchSize + 8, m, {
|
|
1409
1415
|
fontSize: s.fontSize,
|
|
1410
1416
|
fontFamily: s.fontFamily,
|
|
1411
1417
|
color: s.textColor,
|
|
@@ -1483,19 +1489,19 @@ class Lt {
|
|
|
1483
1489
|
if (!!this.latexAPI && (x.includes("\\") || x.includes("^") || x.includes("_") || x.includes("{") && x.includes("}"))) {
|
|
1484
1490
|
const M = this.latexAPI.measure(x, { fontSize: r.tooltipSize });
|
|
1485
1491
|
d = Math.max(d, M.width);
|
|
1486
|
-
const
|
|
1487
|
-
h.push(
|
|
1492
|
+
const w = Math.max(l, M.height);
|
|
1493
|
+
h.push(w), f += w;
|
|
1488
1494
|
} else
|
|
1489
1495
|
d = Math.max(d, o.measureText(x).width), h.push(l), f += l;
|
|
1490
1496
|
});
|
|
1491
|
-
const u = d + c * 2,
|
|
1492
|
-
let
|
|
1493
|
-
|
|
1497
|
+
const u = d + c * 2, g = f + c * 2 - 4;
|
|
1498
|
+
let y = e + 15, m = t - g - 10;
|
|
1499
|
+
y + u > s.x + s.width && (y = e - u - 15), m < s.y && (m = t + 15), o.fillStyle = r.tooltipBackground, o.strokeStyle = r.tooltipBorder, o.lineWidth = 1, o.beginPath();
|
|
1494
1500
|
const b = 4;
|
|
1495
|
-
o.moveTo(
|
|
1501
|
+
o.moveTo(y + b, m), o.lineTo(y + u - b, m), o.arcTo(y + u, m, y + u, m + b, b), o.lineTo(y + u, m + g - b), o.arcTo(y + u, m + g, y + u - b, m + g, b), o.lineTo(y + b, m + g), o.arcTo(y, m + g, y, m + g - b, b), o.lineTo(y, m + b), o.arcTo(y, m, y + b, m, b), o.closePath(), o.fill(), o.stroke();
|
|
1496
1502
|
let v = m + c;
|
|
1497
1503
|
a.forEach((x, S) => {
|
|
1498
|
-
this.drawLatexOrText(x,
|
|
1504
|
+
this.drawLatexOrText(x, y + c, v, {
|
|
1499
1505
|
fontSize: r.tooltipSize,
|
|
1500
1506
|
fontFamily: this.theme.xAxis.fontFamily,
|
|
1501
1507
|
color: r.tooltipColor,
|
|
@@ -1517,33 +1523,33 @@ class Lt {
|
|
|
1517
1523
|
if (!!this.latexAPI && (x.includes("\\") || x.includes("^") || x.includes("_") || x.includes("{") && x.includes("}"))) {
|
|
1518
1524
|
const M = this.latexAPI.measure(x, { fontSize: o.tooltipSize });
|
|
1519
1525
|
d = Math.max(d, M.width);
|
|
1520
|
-
const
|
|
1521
|
-
h.push(
|
|
1526
|
+
const w = Math.max(a, M.height);
|
|
1527
|
+
h.push(w), f += w;
|
|
1522
1528
|
} else
|
|
1523
1529
|
d = Math.max(d, s.measureText(x).width), h.push(a), f += a;
|
|
1524
1530
|
});
|
|
1525
|
-
const u = d + l * 2,
|
|
1526
|
-
let
|
|
1531
|
+
const u = d + l * 2, g = f + l * 2 - 4;
|
|
1532
|
+
let y, m;
|
|
1527
1533
|
switch (n) {
|
|
1528
1534
|
case "top-left":
|
|
1529
|
-
|
|
1535
|
+
y = t.x + c, m = t.y + c;
|
|
1530
1536
|
break;
|
|
1531
1537
|
case "top-right":
|
|
1532
|
-
|
|
1538
|
+
y = t.x + t.width - u - c, m = t.y + c;
|
|
1533
1539
|
break;
|
|
1534
1540
|
case "bottom-left":
|
|
1535
|
-
|
|
1541
|
+
y = t.x + c, m = t.y + t.height - g - c;
|
|
1536
1542
|
break;
|
|
1537
1543
|
case "bottom-right":
|
|
1538
|
-
|
|
1544
|
+
y = t.x + t.width - u - c, m = t.y + t.height - g - c;
|
|
1539
1545
|
break;
|
|
1540
1546
|
}
|
|
1541
1547
|
s.fillStyle = o.tooltipBackground, s.strokeStyle = o.tooltipBorder, s.lineWidth = 1, s.beginPath();
|
|
1542
1548
|
const b = 4;
|
|
1543
|
-
s.moveTo(
|
|
1549
|
+
s.moveTo(y + b, m), s.lineTo(y + u - b, m), s.arcTo(y + u, m, y + u, m + b, b), s.lineTo(y + u, m + g - b), s.arcTo(y + u, m + g, y + u - b, m + g, b), s.lineTo(y + b, m + g), s.arcTo(y, m + g, y, m + g - b, b), s.lineTo(y, m + b), s.arcTo(y, m, y + b, m, b), s.closePath(), s.fill(), s.stroke();
|
|
1544
1550
|
let v = m + l;
|
|
1545
1551
|
r.forEach((x, S) => {
|
|
1546
|
-
this.drawLatexOrText(x,
|
|
1552
|
+
this.drawLatexOrText(x, y + l, v, {
|
|
1547
1553
|
fontSize: o.tooltipSize,
|
|
1548
1554
|
fontFamily: this.theme.xAxis.fontFamily,
|
|
1549
1555
|
color: o.tooltipColor,
|
|
@@ -1566,20 +1572,20 @@ class Lt {
|
|
|
1566
1572
|
if (!t.hasErrorData()) return;
|
|
1567
1573
|
const { ctx: o } = this, r = t.getData(), a = t.getStyle(), l = a.errorBars ?? {};
|
|
1568
1574
|
if (l.visible === !1) return;
|
|
1569
|
-
const c = l.color ?? a.color ?? "#ff0055", d = l.width ?? 1, h = l.capWidth ?? 6, f = l.showCaps !== !1, u = l.opacity ?? 0.7,
|
|
1575
|
+
const c = l.color ?? a.color ?? "#ff0055", d = l.width ?? 1, h = l.capWidth ?? 6, f = l.showCaps !== !1, u = l.opacity ?? 0.7, g = l.direction ?? "both";
|
|
1570
1576
|
o.save(), o.beginPath(), o.rect(e.x, e.y, e.width, e.height), o.clip(), o.strokeStyle = c, o.lineWidth = d, o.globalAlpha = u;
|
|
1571
|
-
for (let
|
|
1572
|
-
const m = n.transform(r.x[
|
|
1577
|
+
for (let y = 0; y < r.x.length; y++) {
|
|
1578
|
+
const m = n.transform(r.x[y]), b = s.transform(r.y[y]);
|
|
1573
1579
|
if (m < e.x || m > e.x + e.width || b < e.y || b > e.y + e.height) continue;
|
|
1574
|
-
const v = t.getYError(
|
|
1580
|
+
const v = t.getYError(y);
|
|
1575
1581
|
if (v) {
|
|
1576
|
-
const [S, M] = v,
|
|
1577
|
-
o.beginPath(), (
|
|
1582
|
+
const [S, M] = v, w = r.y[y], A = s.transform(w + M), P = s.transform(w - S);
|
|
1583
|
+
o.beginPath(), (g === "both" || g === "positive") && (o.moveTo(m, b), o.lineTo(m, A), f && (o.moveTo(m - h / 2, A), o.lineTo(m + h / 2, A))), (g === "both" || g === "negative") && (o.moveTo(m, b), o.lineTo(m, P), f && (o.moveTo(m - h / 2, P), o.lineTo(m + h / 2, P))), o.stroke();
|
|
1578
1584
|
}
|
|
1579
|
-
const x = t.getXError(
|
|
1585
|
+
const x = t.getXError(y);
|
|
1580
1586
|
if (x) {
|
|
1581
|
-
const [S, M] = x,
|
|
1582
|
-
o.beginPath(), (
|
|
1587
|
+
const [S, M] = x, w = r.x[y], A = n.transform(w + M), P = n.transform(w - S);
|
|
1588
|
+
o.beginPath(), (g === "both" || g === "positive") && (o.moveTo(m, b), o.lineTo(A, b), f && (o.moveTo(A, b - h / 2), o.lineTo(A, b + h / 2))), (g === "both" || g === "negative") && (o.moveTo(m, b), o.lineTo(P, b), f && (o.moveTo(P, b - h / 2), o.lineTo(P, b + h / 2))), o.stroke();
|
|
1583
1589
|
}
|
|
1584
1590
|
}
|
|
1585
1591
|
o.restore();
|
|
@@ -1598,13 +1604,13 @@ class Lt {
|
|
|
1598
1604
|
return n;
|
|
1599
1605
|
}
|
|
1600
1606
|
formatXTick(e, t, n) {
|
|
1601
|
-
return
|
|
1607
|
+
return _e(e, t, n);
|
|
1602
1608
|
}
|
|
1603
1609
|
formatYTick(e, t) {
|
|
1604
|
-
return
|
|
1610
|
+
return Ve(e, t);
|
|
1605
1611
|
}
|
|
1606
1612
|
}
|
|
1607
|
-
class
|
|
1613
|
+
class $t {
|
|
1608
1614
|
constructor(e, t, n, s, o) {
|
|
1609
1615
|
p(this, "container");
|
|
1610
1616
|
p(this, "callbacks");
|
|
@@ -1665,10 +1671,10 @@ class zt {
|
|
|
1665
1671
|
e.preventDefault();
|
|
1666
1672
|
const n = this.container.getBoundingClientRect(), s = e.clientX - n.left, o = e.clientY - n.top, r = this.getAxesLayout();
|
|
1667
1673
|
let a = !1, l = !1, c;
|
|
1668
|
-
for (const
|
|
1674
|
+
for (const B of r) {
|
|
1669
1675
|
let E;
|
|
1670
|
-
if (
|
|
1671
|
-
c =
|
|
1676
|
+
if (B.position === "left" ? E = t.x - 65 - B.offset : E = t.x + t.width + B.offset, s >= E && s <= E + 65 && o >= t.y && o <= t.y + t.height) {
|
|
1677
|
+
c = B.id, l = !0, a = !1;
|
|
1672
1678
|
break;
|
|
1673
1679
|
}
|
|
1674
1680
|
}
|
|
@@ -1679,20 +1685,20 @@ class zt {
|
|
|
1679
1685
|
a = !0, l = !0;
|
|
1680
1686
|
else
|
|
1681
1687
|
return;
|
|
1682
|
-
const d = this.getBounds(c), h = e.deltaY > 0 ? 1.1 : 0.9, f = (s - t.x) / t.width, u = 1 - (o - t.y) / t.height,
|
|
1683
|
-
let v = a ?
|
|
1684
|
-
const
|
|
1685
|
-
(
|
|
1686
|
-
const
|
|
1688
|
+
const d = this.getBounds(c), h = 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), m = 1e-12, b = 1e15;
|
|
1689
|
+
let v = a ? g - (g - d.xMin) * h : d.xMin, x = a ? g + (d.xMax - g) * h : d.xMax, S = l ? y - (y - d.yMin) * h : d.yMin, M = l ? y + (d.yMax - y) * h : d.yMax;
|
|
1690
|
+
const w = x - v, A = M - S;
|
|
1691
|
+
(w < m || w > b) && (v = d.xMin, x = d.xMax), (A < m || A > b) && (S = d.yMin, M = d.yMax);
|
|
1692
|
+
const P = {
|
|
1687
1693
|
xMin: v,
|
|
1688
1694
|
xMax: x,
|
|
1689
1695
|
yMin: S,
|
|
1690
1696
|
yMax: M
|
|
1691
1697
|
};
|
|
1692
|
-
this.callbacks.onZoom(
|
|
1698
|
+
this.callbacks.onZoom(P, c);
|
|
1693
1699
|
}
|
|
1694
1700
|
handleMouseDown(e) {
|
|
1695
|
-
var l, c, d, h, f, u,
|
|
1701
|
+
var l, c, d, h, f, u, g, y, m, b;
|
|
1696
1702
|
const t = this.getPlotArea();
|
|
1697
1703
|
if (t.width <= 1 || t.height <= 1) return;
|
|
1698
1704
|
const n = this.container.getBoundingClientRect(), s = e.clientX - n.left, o = e.clientY - n.top, r = s >= t.x && s <= t.x + t.width && o >= t.y && o <= t.y + t.height;
|
|
@@ -1719,7 +1725,7 @@ class zt {
|
|
|
1719
1725
|
this.isDragging = !0, this.panningAxisId = void 0, this.lastMousePos = { x: e.clientX, y: e.clientY }, this.container.style.cursor = "grabbing", (u = (f = this.callbacks).onDragStart) == null || u.call(f);
|
|
1720
1726
|
break;
|
|
1721
1727
|
case "boxZoom":
|
|
1722
|
-
this.isBoxZooming = !0, this.selectionStart = { x: s, y: o }, this.container.style.cursor = "crosshair", this.callbacks.onBoxZoom({ x: s, y: o, width: 0, height: 0 }), (
|
|
1728
|
+
this.isBoxZooming = !0, this.selectionStart = { x: s, y: o }, this.container.style.cursor = "crosshair", this.callbacks.onBoxZoom({ x: s, y: o, width: 0, height: 0 }), (y = (g = this.callbacks).onDragStart) == null || y.call(g);
|
|
1723
1729
|
break;
|
|
1724
1730
|
case "select":
|
|
1725
1731
|
this.isBoxSelecting = !0, this.selectionStart = { x: s, y: o }, this.container.style.cursor = "crosshair", this.callbacks.onBoxSelectStart && this.callbacks.onBoxSelectStart(s, o), (b = (m = this.callbacks).onDragStart) == null || b.call(m);
|
|
@@ -1805,7 +1811,7 @@ class zt {
|
|
|
1805
1811
|
this.detachListeners();
|
|
1806
1812
|
}
|
|
1807
1813
|
}
|
|
1808
|
-
const
|
|
1814
|
+
const Yt = {
|
|
1809
1815
|
enabled: !0,
|
|
1810
1816
|
hitRadius: 20,
|
|
1811
1817
|
multiSelect: !0,
|
|
@@ -1816,7 +1822,7 @@ const Ot = {
|
|
|
1816
1822
|
ringWidth: 3
|
|
1817
1823
|
}
|
|
1818
1824
|
};
|
|
1819
|
-
class
|
|
1825
|
+
class _t {
|
|
1820
1826
|
constructor(e, t) {
|
|
1821
1827
|
p(this, "ctx");
|
|
1822
1828
|
p(this, "config");
|
|
@@ -1825,7 +1831,7 @@ class Yt {
|
|
|
1825
1831
|
p(this, "isBoxSelecting", !1);
|
|
1826
1832
|
p(this, "boxStart", null);
|
|
1827
1833
|
p(this, "boxEnd", null);
|
|
1828
|
-
this.ctx = e, this.config = { ...
|
|
1834
|
+
this.ctx = e, this.config = { ...Yt, ...t };
|
|
1829
1835
|
}
|
|
1830
1836
|
// ============================================
|
|
1831
1837
|
// Configuration
|
|
@@ -1857,21 +1863,21 @@ class Yt {
|
|
|
1857
1863
|
let d = null, h = 1 / 0;
|
|
1858
1864
|
return a.forEach((f, u) => {
|
|
1859
1865
|
if (!f.isVisible()) return;
|
|
1860
|
-
const
|
|
1861
|
-
if (
|
|
1862
|
-
const
|
|
1866
|
+
const g = f.getData();
|
|
1867
|
+
if (g.x.length === 0) return;
|
|
1868
|
+
const y = f.getYAxisId() || this.ctx.getPrimaryYAxisId(), m = r.get(y);
|
|
1863
1869
|
if (!m) return;
|
|
1864
|
-
const b = o.invert(e), v = this.findNearestIndex(
|
|
1865
|
-
for (let
|
|
1866
|
-
const A = o.transform(
|
|
1870
|
+
const b = o.invert(e), v = this.findNearestIndex(g.x, b), x = 50, S = Math.max(0, v - x), M = Math.min(g.x.length, v + x);
|
|
1871
|
+
for (let w = S; w < M; w++) {
|
|
1872
|
+
const A = o.transform(g.x[w]), P = m.transform(g.y[w]), B = A - e, F = P - t, E = B * B + F * F;
|
|
1867
1873
|
E < h && E <= c && (h = E, d = {
|
|
1868
1874
|
seriesId: u,
|
|
1869
|
-
index:
|
|
1870
|
-
x:
|
|
1871
|
-
y:
|
|
1875
|
+
index: w,
|
|
1876
|
+
x: g.x[w],
|
|
1877
|
+
y: g.y[w],
|
|
1872
1878
|
distance: Math.sqrt(E),
|
|
1873
1879
|
pixelX: A,
|
|
1874
|
-
pixelY:
|
|
1880
|
+
pixelY: P
|
|
1875
1881
|
});
|
|
1876
1882
|
}
|
|
1877
1883
|
}), d;
|
|
@@ -2043,16 +2049,16 @@ class Yt {
|
|
|
2043
2049
|
this.cancelBoxSelection();
|
|
2044
2050
|
return;
|
|
2045
2051
|
}
|
|
2046
|
-
const r = Math.min(this.boxStart.x, this.boxEnd.x), a = Math.max(this.boxStart.x, this.boxEnd.x), l = Math.min(this.boxStart.y, this.boxEnd.y), c = Math.max(this.boxStart.y, this.boxEnd.y), d = Math.max(r, t.x), h = Math.min(a, t.x + t.width), f = Math.max(l, t.y), u = Math.min(c, t.y + t.height),
|
|
2052
|
+
const r = Math.min(this.boxStart.x, this.boxEnd.x), a = Math.max(this.boxStart.x, this.boxEnd.x), l = Math.min(this.boxStart.y, this.boxEnd.y), c = Math.max(this.boxStart.y, this.boxEnd.y), d = Math.max(r, t.x), h = Math.min(a, t.x + t.width), f = Math.max(l, t.y), u = Math.min(c, t.y + t.height), g = {
|
|
2047
2053
|
xMin: n.invert(d),
|
|
2048
2054
|
xMax: n.invert(h),
|
|
2049
2055
|
yMin: o.invert(u),
|
|
2050
2056
|
// Y is inverted
|
|
2051
2057
|
yMax: o.invert(f)
|
|
2052
|
-
},
|
|
2053
|
-
if (
|
|
2058
|
+
}, y = this.hitTestRegion(g);
|
|
2059
|
+
if (y.length > 0) {
|
|
2054
2060
|
const m = /* @__PURE__ */ new Map();
|
|
2055
|
-
|
|
2061
|
+
y.forEach((x) => {
|
|
2056
2062
|
let S = m.get(x.seriesId);
|
|
2057
2063
|
S || (S = [], m.set(x.seriesId, S)), S.push(x.index);
|
|
2058
2064
|
});
|
|
@@ -2063,7 +2069,7 @@ class Yt {
|
|
|
2063
2069
|
this.selectPoints(b, e ? "add" : "single");
|
|
2064
2070
|
const v = this.getSelectedPoints();
|
|
2065
2071
|
this.ctx.events.emit("regionSelect", {
|
|
2066
|
-
bounds:
|
|
2072
|
+
bounds: g,
|
|
2067
2073
|
containedPoints: v
|
|
2068
2074
|
});
|
|
2069
2075
|
} else e || this.clearSelection();
|
|
@@ -2106,11 +2112,11 @@ class Yt {
|
|
|
2106
2112
|
if (!d || !d.isVisible()) return;
|
|
2107
2113
|
const h = d.getData(), f = d.getYAxisId() || this.ctx.getPrimaryYAxisId(), u = s.get(f);
|
|
2108
2114
|
if (!u) return;
|
|
2109
|
-
const
|
|
2110
|
-
l.forEach((
|
|
2111
|
-
if (
|
|
2112
|
-
const m = n.transform(h.x[
|
|
2113
|
-
m < t.x || m > t.x + t.width || b < t.y || b > t.y + t.height || (e.beginPath(), e.arc(m, b, r.size / 2, 0, Math.PI * 2), e.strokeStyle = r.color, e.lineWidth = r.ringWidth, e.stroke(), e.beginPath(), e.arc(m, b, r.size / 2 - r.ringWidth, 0, Math.PI * 2), e.fillStyle =
|
|
2115
|
+
const g = d.getStyle().color || "#ff0055";
|
|
2116
|
+
l.forEach((y) => {
|
|
2117
|
+
if (y >= h.x.length) return;
|
|
2118
|
+
const m = n.transform(h.x[y]), b = u.transform(h.y[y]);
|
|
2119
|
+
m < t.x || m > t.x + t.width || b < t.y || b > t.y + t.height || (e.beginPath(), e.arc(m, b, r.size / 2, 0, Math.PI * 2), e.strokeStyle = r.color, e.lineWidth = r.ringWidth, e.stroke(), e.beginPath(), e.arc(m, b, r.size / 2 - r.ringWidth, 0, Math.PI * 2), e.fillStyle = g, e.fill());
|
|
2114
2120
|
});
|
|
2115
2121
|
});
|
|
2116
2122
|
const a = this.getBoxSelectionRect();
|
|
@@ -2138,7 +2144,7 @@ class Yt {
|
|
|
2138
2144
|
this.selected.clear(), this.cancelBoxSelection();
|
|
2139
2145
|
}
|
|
2140
2146
|
}
|
|
2141
|
-
const
|
|
2147
|
+
const K = {
|
|
2142
2148
|
smallMobile: {
|
|
2143
2149
|
maxWidth: 360,
|
|
2144
2150
|
fontScale: 0.7,
|
|
@@ -2185,14 +2191,14 @@ const J = {
|
|
|
2185
2191
|
showLegend: !0,
|
|
2186
2192
|
legendPosition: "top-right"
|
|
2187
2193
|
}
|
|
2188
|
-
},
|
|
2194
|
+
}, ae = {
|
|
2189
2195
|
enabled: !0,
|
|
2190
|
-
breakpoints:
|
|
2196
|
+
breakpoints: K,
|
|
2191
2197
|
touchOptimized: "auto",
|
|
2192
2198
|
reducedMotion: "auto",
|
|
2193
2199
|
resizeDebounce: 100
|
|
2194
2200
|
};
|
|
2195
|
-
class
|
|
2201
|
+
class Vt {
|
|
2196
2202
|
constructor(e, t) {
|
|
2197
2203
|
p(this, "ctx");
|
|
2198
2204
|
p(this, "config");
|
|
@@ -2213,17 +2219,17 @@ class _t {
|
|
|
2213
2219
|
mergeConfig(e) {
|
|
2214
2220
|
var t, n, s, o;
|
|
2215
2221
|
return e ? {
|
|
2216
|
-
enabled: e.enabled ??
|
|
2222
|
+
enabled: e.enabled ?? ae.enabled,
|
|
2217
2223
|
breakpoints: {
|
|
2218
|
-
smallMobile: { ...
|
|
2219
|
-
mobile: { ...
|
|
2220
|
-
tablet: { ...
|
|
2221
|
-
desktop: { ...
|
|
2224
|
+
smallMobile: { ...K.smallMobile, ...(t = e.breakpoints) == null ? void 0 : t.smallMobile },
|
|
2225
|
+
mobile: { ...K.mobile, ...(n = e.breakpoints) == null ? void 0 : n.mobile },
|
|
2226
|
+
tablet: { ...K.tablet, ...(s = e.breakpoints) == null ? void 0 : s.tablet },
|
|
2227
|
+
desktop: { ...K.desktop, ...(o = e.breakpoints) == null ? void 0 : o.desktop }
|
|
2222
2228
|
},
|
|
2223
|
-
touchOptimized: e.touchOptimized ??
|
|
2224
|
-
reducedMotion: e.reducedMotion ??
|
|
2225
|
-
resizeDebounce: e.resizeDebounce ??
|
|
2226
|
-
} : { ...
|
|
2229
|
+
touchOptimized: e.touchOptimized ?? ae.touchOptimized,
|
|
2230
|
+
reducedMotion: e.reducedMotion ?? ae.reducedMotion,
|
|
2231
|
+
resizeDebounce: e.resizeDebounce ?? ae.resizeDebounce
|
|
2232
|
+
} : { ...ae };
|
|
2227
2233
|
}
|
|
2228
2234
|
configure(e) {
|
|
2229
2235
|
this.config = this.mergeConfig({ ...this.config, ...e }), this.update();
|
|
@@ -2251,7 +2257,7 @@ class _t {
|
|
|
2251
2257
|
this.hasStateChanged(e) && (this.state = e, this.ctx.onStateChange(this.state));
|
|
2252
2258
|
}
|
|
2253
2259
|
computeState() {
|
|
2254
|
-
const e = this.ctx.container.getBoundingClientRect(), t = e.width || 800, n = e.height || 600, s = this.getActiveBreakpoint(t), o = this.config.breakpoints[s] ||
|
|
2260
|
+
const e = this.ctx.container.getBoundingClientRect(), t = e.width || 800, n = e.height || 600, s = this.getActiveBreakpoint(t), o = this.config.breakpoints[s] || K.desktop, r = this.detectTouchOptimization(), a = this.detectReducedMotion(), l = r ? 1.2 : 1;
|
|
2255
2261
|
return {
|
|
2256
2262
|
width: t,
|
|
2257
2263
|
height: n,
|
|
@@ -2373,7 +2379,7 @@ class _t {
|
|
|
2373
2379
|
this.destroyed = !0, this.debounceTimer !== null && window.clearTimeout(this.debounceTimer), this.resizeObserver ? (this.resizeObserver.disconnect(), this.resizeObserver = null) : window.removeEventListener("resize", this.handleResize);
|
|
2374
2380
|
}
|
|
2375
2381
|
}
|
|
2376
|
-
function
|
|
2382
|
+
function Wt(i, e) {
|
|
2377
2383
|
const {
|
|
2378
2384
|
seriesIds: t,
|
|
2379
2385
|
includeHeaders: n = !0,
|
|
@@ -2399,7 +2405,7 @@ function Vt(i, e) {
|
|
|
2399
2405
|
return a.join(`
|
|
2400
2406
|
`);
|
|
2401
2407
|
}
|
|
2402
|
-
function
|
|
2408
|
+
function Nt(i, e, t) {
|
|
2403
2409
|
const { seriesIds: n, precision: s = 6 } = t ?? {}, o = n ? i.filter((a) => n.includes(a.getId())) : i, r = {};
|
|
2404
2410
|
return o.forEach((a) => {
|
|
2405
2411
|
const l = a.getData();
|
|
@@ -2419,7 +2425,7 @@ function $t(i, e, t) {
|
|
|
2419
2425
|
series: r
|
|
2420
2426
|
}, null, 2);
|
|
2421
2427
|
}
|
|
2422
|
-
function
|
|
2428
|
+
function Xt(i, e, t, n, s, o, r = "png") {
|
|
2423
2429
|
const a = document.createElement("canvas");
|
|
2424
2430
|
a.width = e.width, a.height = e.height;
|
|
2425
2431
|
const l = a.getContext("2d");
|
|
@@ -2429,7 +2435,134 @@ function Wt(i, e, t, n, s, o, r = "png") {
|
|
|
2429
2435
|
c[1] * 255
|
|
2430
2436
|
)}, ${Math.round(c[2] * 255)}, ${c[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}`);
|
|
2431
2437
|
}
|
|
2432
|
-
|
|
2438
|
+
function Re(i) {
|
|
2439
|
+
return i.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
2440
|
+
}
|
|
2441
|
+
function Ue(i, e) {
|
|
2442
|
+
return e && i.has(e) ? i.get(e) : i.get("default") ?? i.values().next().value;
|
|
2443
|
+
}
|
|
2444
|
+
function Ht(i, e, t, n, s, o, r, a, l = {}) {
|
|
2445
|
+
const c = Ue(s, l.primaryYAxisId);
|
|
2446
|
+
if (!c)
|
|
2447
|
+
throw new Error("SVG export requires at least one Y scale");
|
|
2448
|
+
const d = [
|
|
2449
|
+
`<svg width="${r}" height="${a}" viewBox="0 0 ${r} ${a}" xmlns="http://www.w3.org/2000/svg" font-family="${o.xAxis.fontFamily || "sans-serif"}">`,
|
|
2450
|
+
`<rect width="100%" height="100%" fill="${o.backgroundColor}" />`,
|
|
2451
|
+
'<g transform="translate(0,0)">'
|
|
2452
|
+
];
|
|
2453
|
+
return jt(d, t, n, c, o), Ut(d, i, t, n, s, l.primaryYAxisId), qt(d, t, n, c, o), Gt(d, t, n, c, o, l), d.push("</g>"), d.push("</svg>"), d.join(`
|
|
2454
|
+
`);
|
|
2455
|
+
}
|
|
2456
|
+
function Ut(i, e, t, n, s, o) {
|
|
2457
|
+
for (const r of e) {
|
|
2458
|
+
if (!r.isVisible()) continue;
|
|
2459
|
+
const a = s.get(r.getYAxisId() || o || "default") ?? Ue(s, o);
|
|
2460
|
+
if (!a) continue;
|
|
2461
|
+
const l = r.getData();
|
|
2462
|
+
if (!l || l.x.length === 0) continue;
|
|
2463
|
+
const c = r.getStyle(), d = r.getType();
|
|
2464
|
+
if (d === "line" || d === "step") {
|
|
2465
|
+
const h = [], f = c.stepMode || "after";
|
|
2466
|
+
for (let u = 0; u < l.x.length; u++) {
|
|
2467
|
+
const g = n.transform(l.x[u]), y = a.transform(l.y[u]);
|
|
2468
|
+
if (u > 0 && d === "step") {
|
|
2469
|
+
const m = n.transform(l.x[u - 1]), b = a.transform(l.y[u - 1]);
|
|
2470
|
+
if (f === "after") h.push(`${g.toFixed(1)},${b.toFixed(1)}`);
|
|
2471
|
+
else if (f === "before") h.push(`${m.toFixed(1)},${y.toFixed(1)}`);
|
|
2472
|
+
else if (f === "center") {
|
|
2473
|
+
const v = (m + g) / 2;
|
|
2474
|
+
h.push(`${v.toFixed(1)},${b.toFixed(1)}`), h.push(`${v.toFixed(1)},${y.toFixed(1)}`);
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
h.push(`${g.toFixed(1)},${y.toFixed(1)}`);
|
|
2478
|
+
}
|
|
2479
|
+
i.push(
|
|
2480
|
+
`<polyline points="${h.join(" ")}" fill="none" stroke="${c.color}" stroke-width="${c.width || 1.5}" stroke-opacity="${c.opacity || 1}" stroke-linejoin="round" />`
|
|
2481
|
+
);
|
|
2482
|
+
} else if (d === "scatter")
|
|
2483
|
+
for (let h = 0; h < l.x.length; h++) {
|
|
2484
|
+
const f = n.transform(l.x[h]), u = a.transform(l.y[h]);
|
|
2485
|
+
i.push(
|
|
2486
|
+
`<circle cx="${f.toFixed(1)}" cy="${u.toFixed(1)}" r="${((c.pointSize || 4) / 2).toFixed(1)}" fill="${c.color}" fill-opacity="${c.opacity || 1}" />`
|
|
2487
|
+
);
|
|
2488
|
+
}
|
|
2489
|
+
else if (d === "bar") {
|
|
2490
|
+
const h = (c.barWidth || 5) * (t.width / (n.domain[1] - n.domain[0]));
|
|
2491
|
+
for (let f = 0; f < l.x.length; f++) {
|
|
2492
|
+
const u = n.transform(l.x[f]), g = a.transform(l.y[f]), y = a.transform(0), m = Math.min(g, y), b = Math.abs(g - y);
|
|
2493
|
+
i.push(
|
|
2494
|
+
`<rect x="${(u - h / 2).toFixed(1)}" y="${m.toFixed(1)}" width="${h.toFixed(1)}" height="${b.toFixed(1)}" fill="${c.color}" fill-opacity="${c.opacity || 1}" />`
|
|
2495
|
+
);
|
|
2496
|
+
}
|
|
2497
|
+
} else if (d === "band" || d === "area") {
|
|
2498
|
+
const h = d === "area" ? new Float32Array(l.x.length).fill(0) : l.y2 || new Float32Array(l.x.length).fill(0), f = [];
|
|
2499
|
+
for (let u = 0; u < l.x.length; u++)
|
|
2500
|
+
f.push(
|
|
2501
|
+
`${n.transform(l.x[u]).toFixed(1)},${a.transform(l.y[u]).toFixed(1)}`
|
|
2502
|
+
);
|
|
2503
|
+
for (let u = l.x.length - 1; u >= 0; u--)
|
|
2504
|
+
f.push(
|
|
2505
|
+
`${n.transform(l.x[u]).toFixed(1)},${a.transform(h[u]).toFixed(1)}`
|
|
2506
|
+
);
|
|
2507
|
+
i.push(
|
|
2508
|
+
`<polygon points="${f.join(" ")}" fill="${c.color}" fill-opacity="${(Number(c.opacity) || 1) * 0.3}" stroke="${c.color}" stroke-width="${c.width || 1}" />`
|
|
2509
|
+
);
|
|
2510
|
+
} else if (d === "candlestick") {
|
|
2511
|
+
const h = (c.barWidth || 5) * (t.width / (n.domain[1] - n.domain[0])), f = c.bullishColor || "#26a69a", u = c.bearishColor || "#ef5350";
|
|
2512
|
+
if (l.open && l.high && l.low && l.close)
|
|
2513
|
+
for (let g = 0; g < l.x.length; g++) {
|
|
2514
|
+
const y = l.close[g] >= l.open[g], m = n.transform(l.x[g]), b = a.transform(l.open[g]), v = a.transform(l.close[g]), x = a.transform(l.high[g]), S = a.transform(l.low[g]), M = y ? f : u;
|
|
2515
|
+
i.push(
|
|
2516
|
+
`<line x1="${m.toFixed(1)}" y1="${x.toFixed(1)}" x2="${m.toFixed(1)}" y2="${S.toFixed(1)}" stroke="${M}" stroke-width="1" />`
|
|
2517
|
+
);
|
|
2518
|
+
const w = Math.min(b, v), A = Math.max(1, Math.abs(b - v));
|
|
2519
|
+
i.push(
|
|
2520
|
+
`<rect x="${(m - h / 2).toFixed(1)}" y="${w.toFixed(1)}" width="${h.toFixed(1)}" height="${A.toFixed(1)}" fill="${M}" />`
|
|
2521
|
+
);
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
function qt(i, e, t, n, s) {
|
|
2527
|
+
const o = Y(e.y + e.height), r = Y(e.x);
|
|
2528
|
+
i.push(
|
|
2529
|
+
`<line x1="${e.x}" y1="${o}" x2="${e.x + e.width}" y2="${o}" stroke="${s.xAxis.lineColor}" stroke-width="${s.xAxis.lineWidth || 2}" />`
|
|
2530
|
+
), i.push(
|
|
2531
|
+
`<line x1="${r}" y1="${e.y}" x2="${r}" y2="${e.y + e.height}" stroke="${s.yAxis.lineColor}" stroke-width="${s.yAxis.lineWidth || 2}" />`
|
|
2532
|
+
);
|
|
2533
|
+
}
|
|
2534
|
+
function Gt(i, e, t, n, s, o) {
|
|
2535
|
+
const r = o.xAxis, a = o.yAxis, l = (r == null ? void 0 : r.tickCount) ?? 8, c = (a == null ? void 0 : a.tickCount) ?? 6, d = t.domain[1] - t.domain[0], h = e.y + e.height, f = e.x, u = s.xAxis, g = s.yAxis;
|
|
2536
|
+
(r == null ? void 0 : r.showLabels) !== !1 && t.ticks(l).forEach((y) => {
|
|
2537
|
+
const m = de(t.transform(y));
|
|
2538
|
+
if (m < e.x || m > e.x + e.width) return;
|
|
2539
|
+
const b = _e(y, r, d), v = h + (u.tickLength ?? 4) + u.labelSize * 0.75;
|
|
2540
|
+
i.push(
|
|
2541
|
+
`<text x="${m.toFixed(1)}" y="${v.toFixed(1)}" fill="${u.labelColor}" font-size="${u.labelSize}" text-anchor="middle">${Re(b)}</text>`
|
|
2542
|
+
);
|
|
2543
|
+
}), (a == null ? void 0 : a.showLabels) !== !1 && n.ticks(c).forEach((y) => {
|
|
2544
|
+
const m = de(n.transform(y));
|
|
2545
|
+
if (m < e.y || m > e.y + e.height) return;
|
|
2546
|
+
const b = Ve(y, a), v = f - (g.tickLength ?? 4) - 4;
|
|
2547
|
+
i.push(
|
|
2548
|
+
`<text x="${v.toFixed(1)}" y="${(m + g.labelSize * 0.35).toFixed(1)}" fill="${g.labelColor}" font-size="${g.labelSize}" text-anchor="end">${Re(b)}</text>`
|
|
2549
|
+
);
|
|
2550
|
+
});
|
|
2551
|
+
}
|
|
2552
|
+
function jt(i, e, t, n, s) {
|
|
2553
|
+
s.grid.visible && (t.ticks(10).forEach((o) => {
|
|
2554
|
+
const r = Y(t.transform(o));
|
|
2555
|
+
r >= e.x && r <= e.x + e.width && i.push(
|
|
2556
|
+
`<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" />`
|
|
2557
|
+
);
|
|
2558
|
+
}), n.ticks(10).forEach((o) => {
|
|
2559
|
+
const r = Y(n.transform(o));
|
|
2560
|
+
r >= e.y && r <= e.y + e.height && i.push(
|
|
2561
|
+
`<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" />`
|
|
2562
|
+
);
|
|
2563
|
+
}));
|
|
2564
|
+
}
|
|
2565
|
+
const Zt = /* @__PURE__ */ new Set([
|
|
2433
2566
|
"line",
|
|
2434
2567
|
"band",
|
|
2435
2568
|
"scatter",
|
|
@@ -2438,13 +2571,13 @@ const Nt = /* @__PURE__ */ new Set([
|
|
|
2438
2571
|
"candlestick",
|
|
2439
2572
|
"ohlc"
|
|
2440
2573
|
]);
|
|
2441
|
-
function
|
|
2574
|
+
function fe(i) {
|
|
2442
2575
|
const e = Array.from(i).filter((n) => n.isVisible());
|
|
2443
|
-
return e.some((n) => n.getType() === "bar") ? !e.some((n) =>
|
|
2576
|
+
return e.some((n) => n.getType() === "bar") ? !e.some((n) => Zt.has(n.getType())) : !1;
|
|
2444
2577
|
}
|
|
2445
|
-
function
|
|
2578
|
+
function Qt(i, e) {
|
|
2446
2579
|
e.x && (i.viewBounds.xMin = e.x[0], i.viewBounds.xMax = e.x[1]);
|
|
2447
|
-
const t =
|
|
2580
|
+
const t = fe(i.series.values()), n = e.y ? [...e.y] : null;
|
|
2448
2581
|
if (n && t && (n[0] = 0), n)
|
|
2449
2582
|
if (e.axisId) {
|
|
2450
2583
|
const s = i.yScales.get(e.axisId);
|
|
@@ -2462,17 +2595,17 @@ function Xt(i, e) {
|
|
|
2462
2595
|
y: [i.viewBounds.yMin, i.viewBounds.yMax]
|
|
2463
2596
|
}), i.requestRender();
|
|
2464
2597
|
}
|
|
2465
|
-
function
|
|
2598
|
+
function Jt(i, e, t, n) {
|
|
2466
2599
|
const s = i.getPlotArea(), o = e / s.width * (i.viewBounds.xMax - i.viewBounds.xMin);
|
|
2467
2600
|
if (i.viewBounds.xMin -= o, i.viewBounds.xMax -= o, n) {
|
|
2468
2601
|
const a = i.yScales.get(n);
|
|
2469
2602
|
if (a) {
|
|
2470
|
-
const l =
|
|
2603
|
+
const l = fe(i.series.values()), c = a.domain[1] - a.domain[0], d = t / s.height * c;
|
|
2471
2604
|
let h = a.domain[0] + d, f = a.domain[1] + d;
|
|
2472
2605
|
l && (h = 0, f = a.domain[1] + d), a.setDomain(h, f), n === i.primaryYAxisId && (i.viewBounds.yMin = h, i.viewBounds.yMax = f);
|
|
2473
2606
|
}
|
|
2474
2607
|
} else {
|
|
2475
|
-
const a =
|
|
2608
|
+
const a = fe(i.series.values());
|
|
2476
2609
|
i.yScales.forEach((l, c) => {
|
|
2477
2610
|
const d = l.domain[1] - l.domain[0], h = t / s.height * d;
|
|
2478
2611
|
let f = l.domain[0] + h, u = l.domain[1] + h;
|
|
@@ -2482,7 +2615,7 @@ function Ut(i, e, t, n) {
|
|
|
2482
2615
|
const r = t / s.height * (i.viewBounds.yMax - i.viewBounds.yMin);
|
|
2483
2616
|
i.events.emit("pan", { deltaX: o, deltaY: r }), i.requestRender();
|
|
2484
2617
|
}
|
|
2485
|
-
function
|
|
2618
|
+
function Kt(i) {
|
|
2486
2619
|
if (i.series.size === 0) return;
|
|
2487
2620
|
let e = 1 / 0, t = -1 / 0;
|
|
2488
2621
|
const n = /* @__PURE__ */ new Map();
|
|
@@ -2514,12 +2647,12 @@ function Ht(i) {
|
|
|
2514
2647
|
(h <= 0 || !isFinite(h)) && (h = Math.abs(a.min) * 0.1 || 1);
|
|
2515
2648
|
const f = Math.min(h * 5e-3, 1e10);
|
|
2516
2649
|
let u = Math.max(r, a.min - f);
|
|
2517
|
-
const
|
|
2518
|
-
d.setDomain(u,
|
|
2650
|
+
const g = Math.min(o, a.max + f);
|
|
2651
|
+
d.setDomain(u, g), l === i.primaryYAxisId && (i.viewBounds.yMin = u, i.viewBounds.yMax = g);
|
|
2519
2652
|
}
|
|
2520
2653
|
}), i.requestRender();
|
|
2521
2654
|
}
|
|
2522
|
-
function
|
|
2655
|
+
function ei(i, e = {}) {
|
|
2523
2656
|
var l, c;
|
|
2524
2657
|
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;
|
|
2525
2658
|
let s = (l = e.x) == null ? void 0 : l[0], o = (c = e.x) == null ? void 0 : c[1], r = s !== void 0 && o !== void 0;
|
|
@@ -2534,8 +2667,8 @@ function qt(i, e = {}) {
|
|
|
2534
2667
|
if (!f || !isFinite(f.xMin) || !isFinite(f.xMax) || !isFinite(f.yMin) || !isFinite(f.yMax))
|
|
2535
2668
|
return;
|
|
2536
2669
|
r || (s = s === void 0 ? f.xMin : Math.min(s, f.xMin), o = o === void 0 ? f.xMax : Math.max(o, f.xMax));
|
|
2537
|
-
const u = h.getYAxisId() || i.primaryYAxisId,
|
|
2538
|
-
|
|
2670
|
+
const u = h.getYAxisId() || i.primaryYAxisId, g = a.get(u);
|
|
2671
|
+
g && (g.min = Math.min(g.min, f.yMin), g.max = Math.max(g.max, f.yMax)), d = !0;
|
|
2539
2672
|
}), !r && !d) return !1;
|
|
2540
2673
|
r = s !== void 0 && o !== void 0;
|
|
2541
2674
|
}
|
|
@@ -2544,15 +2677,15 @@ function qt(i, e = {}) {
|
|
|
2544
2677
|
d && d.setDomain(e.y[0], e.y[1]), i.viewBounds.yMin = e.y[0], i.viewBounds.yMax = e.y[1];
|
|
2545
2678
|
} else {
|
|
2546
2679
|
let f = !1;
|
|
2547
|
-
if (a.forEach((u,
|
|
2680
|
+
if (a.forEach((u, g) => {
|
|
2548
2681
|
if (u.min === 1 / 0) return;
|
|
2549
2682
|
f = !0;
|
|
2550
|
-
const
|
|
2551
|
-
if (!
|
|
2683
|
+
const y = i.yAxisOptionsMap.get(g), m = i.yScales.get(g);
|
|
2684
|
+
if (!y || !m) return;
|
|
2552
2685
|
let b = u.max - u.min;
|
|
2553
2686
|
(b <= 0 || !isFinite(b)) && (b = Math.abs(u.min) * 0.1 || 1);
|
|
2554
2687
|
const v = b * n, x = Math.max(-1e15, u.min - v), S = Math.min(1e15, u.max + v);
|
|
2555
|
-
m.setDomain(x, S),
|
|
2688
|
+
m.setDomain(x, S), g === i.primaryYAxisId && (i.viewBounds.yMin = x, i.viewBounds.yMax = S);
|
|
2556
2689
|
}), !e.y && !f && !r) return !1;
|
|
2557
2690
|
}
|
|
2558
2691
|
if (r && s !== void 0 && o !== void 0) {
|
|
@@ -2563,7 +2696,7 @@ function qt(i, e = {}) {
|
|
|
2563
2696
|
}
|
|
2564
2697
|
return i.requestRender(), !0;
|
|
2565
2698
|
}
|
|
2566
|
-
function
|
|
2699
|
+
function ti(i) {
|
|
2567
2700
|
if (i.series.size === 0) return;
|
|
2568
2701
|
const e = /* @__PURE__ */ new Map();
|
|
2569
2702
|
i.yScales.forEach((o, r) => {
|
|
@@ -2592,7 +2725,7 @@ function Gt(i) {
|
|
|
2592
2725
|
}
|
|
2593
2726
|
}), i.requestRender();
|
|
2594
2727
|
}
|
|
2595
|
-
function
|
|
2728
|
+
function ii(i, e, t, n) {
|
|
2596
2729
|
if (e === null) {
|
|
2597
2730
|
if (t && t.width > 5 && t.height > 5) {
|
|
2598
2731
|
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, c = 1 - (t.y + t.height - s.y) / s.height, d = o.xMin + r * (o.xMax - o.xMin), h = o.xMin + a * (o.xMax - o.xMin), f = o.yMin + c * (o.yMax - o.yMin), u = o.yMin + l * (o.yMax - o.yMin);
|
|
@@ -2602,7 +2735,7 @@ function jt(i, e, t, n) {
|
|
|
2602
2735
|
}
|
|
2603
2736
|
return e;
|
|
2604
2737
|
}
|
|
2605
|
-
const
|
|
2738
|
+
const ni = {
|
|
2606
2739
|
/** Linear easing - constant speed */
|
|
2607
2740
|
linear: (i) => i,
|
|
2608
2741
|
/** Ease in - starts slow, accelerates */
|
|
@@ -2628,7 +2761,7 @@ const Zt = {
|
|
|
2628
2761
|
/** Bounce effect */
|
|
2629
2762
|
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
|
|
2630
2763
|
};
|
|
2631
|
-
class
|
|
2764
|
+
class qe {
|
|
2632
2765
|
constructor() {
|
|
2633
2766
|
p(this, "animations", /* @__PURE__ */ new Map());
|
|
2634
2767
|
p(this, "frameId", null);
|
|
@@ -2639,7 +2772,7 @@ class Xe {
|
|
|
2639
2772
|
* Start a new animation
|
|
2640
2773
|
*/
|
|
2641
2774
|
animate(e) {
|
|
2642
|
-
const t = `anim_${++this.idCounter}`, n = typeof e.easing == "function" ? e.easing :
|
|
2775
|
+
const t = `anim_${++this.idCounter}`, n = typeof e.easing == "function" ? e.easing : ni[e.easing || "easeOutCubic"];
|
|
2643
2776
|
let s, o;
|
|
2644
2777
|
const r = new Promise((a, l) => {
|
|
2645
2778
|
s = a, o = l;
|
|
@@ -2770,7 +2903,7 @@ class Xe {
|
|
|
2770
2903
|
}), this.animations.size > 0 ? this.frameId = requestAnimationFrame(() => this.tick()) : this.frameId = null;
|
|
2771
2904
|
}
|
|
2772
2905
|
}
|
|
2773
|
-
const
|
|
2906
|
+
const N = {
|
|
2774
2907
|
enabled: !0,
|
|
2775
2908
|
zoom: {
|
|
2776
2909
|
enabled: !1,
|
|
@@ -2804,25 +2937,25 @@ const W = {
|
|
|
2804
2937
|
easing: "easeOutCubic"
|
|
2805
2938
|
}
|
|
2806
2939
|
};
|
|
2807
|
-
function
|
|
2940
|
+
function Fe(i) {
|
|
2808
2941
|
return i ? {
|
|
2809
|
-
enabled: i.enabled ??
|
|
2810
|
-
zoom: { ...
|
|
2811
|
-
pan: { ...
|
|
2812
|
-
dataUpdate: { ...
|
|
2813
|
-
seriesEntry: { ...
|
|
2814
|
-
autoScale: { ...
|
|
2815
|
-
} : { ...
|
|
2816
|
-
}
|
|
2817
|
-
let
|
|
2818
|
-
function
|
|
2819
|
-
return
|
|
2820
|
-
}
|
|
2821
|
-
let
|
|
2822
|
-
function
|
|
2942
|
+
enabled: i.enabled ?? N.enabled,
|
|
2943
|
+
zoom: { ...N.zoom, ...i.zoom },
|
|
2944
|
+
pan: { ...N.pan, ...i.pan },
|
|
2945
|
+
dataUpdate: { ...N.dataUpdate, ...i.dataUpdate },
|
|
2946
|
+
seriesEntry: { ...N.seriesEntry, ...i.seriesEntry },
|
|
2947
|
+
autoScale: { ...N.autoScale, ...i.autoScale }
|
|
2948
|
+
} : { ...N };
|
|
2949
|
+
}
|
|
2950
|
+
let Me = null;
|
|
2951
|
+
function pn() {
|
|
2952
|
+
return Me || (Me = new qe()), Me;
|
|
2953
|
+
}
|
|
2954
|
+
let G = null, j = null;
|
|
2955
|
+
function si(i, e) {
|
|
2823
2956
|
const t = e.animate !== !1 && i.animationConfig.enabled && i.animationConfig.zoom.enabled;
|
|
2824
|
-
|
|
2825
|
-
const n =
|
|
2957
|
+
G != null && G.isRunning() && G.cancel();
|
|
2958
|
+
const n = fe(i.series.values()), s = e.x ? e.x[0] : i.viewBounds.xMin, o = e.x ? e.x[1] : i.viewBounds.xMax;
|
|
2826
2959
|
let r = e.y ? e.y[0] : i.viewBounds.yMin, a = e.y ? e.y[1] : i.viewBounds.yMax;
|
|
2827
2960
|
n && e.y && (r = 0);
|
|
2828
2961
|
const l = e.axisId;
|
|
@@ -2832,14 +2965,14 @@ function Qt(i, e) {
|
|
|
2832
2965
|
const h = i.yScales.get(l);
|
|
2833
2966
|
h && (h.setDomain(r, a), l === i.primaryYAxisId && (i.viewBounds.yMin = r, i.viewBounds.yMax = a));
|
|
2834
2967
|
} else {
|
|
2835
|
-
const h = i.viewBounds.yMax - i.viewBounds.yMin, f = a - r, u = h > 0 ? f / h : 1,
|
|
2968
|
+
const h = i.viewBounds.yMax - i.viewBounds.yMin, f = a - r, u = h > 0 ? f / h : 1, g = h > 0 ? (r - i.viewBounds.yMin) / h : 0;
|
|
2836
2969
|
i.yScales.forEach((m, b) => {
|
|
2837
2970
|
if (b === i.primaryYAxisId) return;
|
|
2838
|
-
const v = m.domain[1] - m.domain[0], x = n ? 0 : m.domain[0] +
|
|
2971
|
+
const v = m.domain[1] - m.domain[0], x = n ? 0 : m.domain[0] + g * v, S = n ? m.domain[0] + u * v : x + u * v;
|
|
2839
2972
|
m.setDomain(x, S);
|
|
2840
2973
|
}), i.viewBounds.yMin = r, i.viewBounds.yMax = a;
|
|
2841
|
-
const
|
|
2842
|
-
|
|
2974
|
+
const y = i.yScales.get(i.primaryYAxisId);
|
|
2975
|
+
y && y.setDomain(r, a);
|
|
2843
2976
|
}
|
|
2844
2977
|
return i.events.emit("zoom", {
|
|
2845
2978
|
x: [i.viewBounds.xMin, i.viewBounds.xMax],
|
|
@@ -2849,7 +2982,7 @@ function Qt(i, e) {
|
|
|
2849
2982
|
const c = { ...i.viewBounds }, d = /* @__PURE__ */ new Map();
|
|
2850
2983
|
return i.yScales.forEach((h, f) => {
|
|
2851
2984
|
d.set(f, [...h.domain]);
|
|
2852
|
-
}),
|
|
2985
|
+
}), G = i.animationEngine.animate({
|
|
2853
2986
|
duration: i.animationConfig.zoom.duration,
|
|
2854
2987
|
easing: i.animationConfig.zoom.easing,
|
|
2855
2988
|
onUpdate: (h) => {
|
|
@@ -2857,15 +2990,15 @@ function Qt(i, e) {
|
|
|
2857
2990
|
if (l) {
|
|
2858
2991
|
const f = i.yScales.get(l), u = d.get(l);
|
|
2859
2992
|
if (f && u) {
|
|
2860
|
-
const
|
|
2861
|
-
f.setDomain(
|
|
2993
|
+
const g = u[0] + (r - u[0]) * h, y = u[1] + (a - u[1]) * h;
|
|
2994
|
+
f.setDomain(g, y), l === i.primaryYAxisId && (i.viewBounds.yMin = g, i.viewBounds.yMax = y);
|
|
2862
2995
|
}
|
|
2863
2996
|
} else
|
|
2864
2997
|
i.viewBounds.yMin = c.yMin + (r - c.yMin) * h, i.viewBounds.yMax = c.yMax + (a - c.yMax) * h, i.yScales.forEach((f, u) => {
|
|
2865
2998
|
if (u === i.primaryYAxisId)
|
|
2866
2999
|
f.setDomain(i.viewBounds.yMin, i.viewBounds.yMax);
|
|
2867
3000
|
else {
|
|
2868
|
-
const
|
|
3001
|
+
const g = d.get(u), y = c.yMax - c.yMin, m = i.viewBounds.yMax - i.viewBounds.yMin, b = y > 0 ? m / y : 1, v = y > 0 ? (i.viewBounds.yMin - c.yMin) / y : 0, x = g[1] - g[0], S = g[0] + v * x, M = S + b * x;
|
|
2869
3002
|
f.setDomain(S, M);
|
|
2870
3003
|
}
|
|
2871
3004
|
});
|
|
@@ -2875,11 +3008,11 @@ function Qt(i, e) {
|
|
|
2875
3008
|
i.events.emit("zoom", {
|
|
2876
3009
|
x: [i.viewBounds.xMin, i.viewBounds.xMax],
|
|
2877
3010
|
y: [i.viewBounds.yMin, i.viewBounds.yMax]
|
|
2878
|
-
}),
|
|
3011
|
+
}), G = null;
|
|
2879
3012
|
}
|
|
2880
|
-
}),
|
|
3013
|
+
}), G;
|
|
2881
3014
|
}
|
|
2882
|
-
function
|
|
3015
|
+
function oi(i, e = !0) {
|
|
2883
3016
|
if (i.series.size === 0) return null;
|
|
2884
3017
|
let t = 1 / 0, n = -1 / 0;
|
|
2885
3018
|
const s = /* @__PURE__ */ new Map();
|
|
@@ -2911,21 +3044,21 @@ function Jt(i, e = !0) {
|
|
|
2911
3044
|
const x = Math.min(v * 5e-3, 1e10);
|
|
2912
3045
|
d = Math.max(a, f.min - x), h = Math.min(r, f.max + x);
|
|
2913
3046
|
}
|
|
2914
|
-
const
|
|
2915
|
-
if (
|
|
3047
|
+
const g = e && i.animationConfig.enabled && i.animationConfig.autoScale.enabled;
|
|
3048
|
+
if (j != null && j.isRunning() && j.cancel(), !g)
|
|
2916
3049
|
return i.viewBounds.xMin = l, i.viewBounds.xMax = c, i.viewBounds.yMin = d, i.viewBounds.yMax = h, i.yScales.forEach((v, x) => {
|
|
2917
3050
|
const S = s.get(x), M = i.yAxisOptionsMap.get(x);
|
|
2918
3051
|
if (S && (M != null && M.auto) && S.min !== 1 / 0) {
|
|
2919
|
-
let
|
|
2920
|
-
(
|
|
2921
|
-
const A = Math.min(
|
|
3052
|
+
let w = S.max - S.min;
|
|
3053
|
+
(w <= 0 || !isFinite(w)) && (w = Math.abs(S.min) * 0.1 || 1);
|
|
3054
|
+
const A = Math.min(w * 5e-3, 1e10);
|
|
2922
3055
|
v.setDomain(
|
|
2923
3056
|
Math.max(a, S.min - A),
|
|
2924
3057
|
Math.min(r, S.max + A)
|
|
2925
3058
|
);
|
|
2926
3059
|
}
|
|
2927
3060
|
}), i.events.emit("autoScale", void 0), i.requestRender(), null;
|
|
2928
|
-
const
|
|
3061
|
+
const y = { ...i.viewBounds }, m = /* @__PURE__ */ new Map();
|
|
2929
3062
|
i.yScales.forEach((v, x) => {
|
|
2930
3063
|
m.set(x, [...v.domain]);
|
|
2931
3064
|
});
|
|
@@ -2933,33 +3066,33 @@ function Jt(i, e = !0) {
|
|
|
2933
3066
|
return i.yScales.forEach((v, x) => {
|
|
2934
3067
|
const S = s.get(x), M = i.yAxisOptionsMap.get(x);
|
|
2935
3068
|
if (S && (M != null && M.auto) && S.min !== 1 / 0) {
|
|
2936
|
-
let
|
|
2937
|
-
(
|
|
2938
|
-
const A = Math.min(
|
|
3069
|
+
let w = S.max - S.min;
|
|
3070
|
+
(w <= 0 || !isFinite(w)) && (w = Math.abs(S.min) * 0.1 || 1);
|
|
3071
|
+
const A = Math.min(w * 5e-3, 1e10);
|
|
2939
3072
|
b.set(x, [
|
|
2940
3073
|
Math.max(a, S.min - A),
|
|
2941
3074
|
Math.min(r, S.max + A)
|
|
2942
3075
|
]);
|
|
2943
3076
|
} else
|
|
2944
3077
|
b.set(x, [...v.domain]);
|
|
2945
|
-
}),
|
|
3078
|
+
}), j = i.animationEngine.animate({
|
|
2946
3079
|
duration: i.animationConfig.autoScale.duration,
|
|
2947
3080
|
easing: i.animationConfig.autoScale.easing,
|
|
2948
3081
|
onUpdate: (v) => {
|
|
2949
|
-
i.viewBounds.xMin =
|
|
2950
|
-
const M = m.get(S),
|
|
3082
|
+
i.viewBounds.xMin = y.xMin + (l - y.xMin) * v, i.viewBounds.xMax = y.xMax + (c - y.xMax) * v, i.viewBounds.yMin = y.yMin + (d - y.yMin) * v, i.viewBounds.yMax = y.yMax + (h - y.yMax) * v, i.yScales.forEach((x, S) => {
|
|
3083
|
+
const M = m.get(S), w = b.get(S);
|
|
2951
3084
|
x.setDomain(
|
|
2952
|
-
M[0] + (
|
|
2953
|
-
M[1] + (
|
|
3085
|
+
M[0] + (w[0] - M[0]) * v,
|
|
3086
|
+
M[1] + (w[1] - M[1]) * v
|
|
2954
3087
|
);
|
|
2955
3088
|
}), i.requestRender();
|
|
2956
3089
|
},
|
|
2957
3090
|
onComplete: () => {
|
|
2958
|
-
i.events.emit("autoScale", void 0),
|
|
3091
|
+
i.events.emit("autoScale", void 0), j = null;
|
|
2959
3092
|
}
|
|
2960
|
-
}),
|
|
3093
|
+
}), j;
|
|
2961
3094
|
}
|
|
2962
|
-
function
|
|
3095
|
+
function ri(i, e, t) {
|
|
2963
3096
|
const n = { ...i.viewBounds }, s = {
|
|
2964
3097
|
xMin: e.xMin ?? i.viewBounds.xMin,
|
|
2965
3098
|
xMax: e.xMax ?? i.viewBounds.xMax,
|
|
@@ -2982,7 +3115,7 @@ function Kt(i, e, t) {
|
|
|
2982
3115
|
}
|
|
2983
3116
|
});
|
|
2984
3117
|
}
|
|
2985
|
-
function
|
|
3118
|
+
function Ge(i, e, t = "degrees") {
|
|
2986
3119
|
const n = Math.min(i.length, e.length), s = new Float32Array(n * 2), o = t === "degrees" ? Math.PI / 180 : 1;
|
|
2987
3120
|
for (let r = 0; r < n; r++) {
|
|
2988
3121
|
const a = i[r], l = e[r] * o;
|
|
@@ -2990,22 +3123,22 @@ function Ue(i, e, t = "degrees") {
|
|
|
2990
3123
|
}
|
|
2991
3124
|
return s;
|
|
2992
3125
|
}
|
|
2993
|
-
function
|
|
2994
|
-
const n =
|
|
3126
|
+
function ai(i, e = "degrees", t = !1) {
|
|
3127
|
+
const n = Ge(i.r, i.theta, e);
|
|
2995
3128
|
if (!t)
|
|
2996
3129
|
return n;
|
|
2997
3130
|
const s = n.length / 2, o = new Float32Array((s + 1) * 2);
|
|
2998
3131
|
return o.set(n), o[s * 2] = n[0], o[s * 2 + 1] = n[1], o;
|
|
2999
3132
|
}
|
|
3000
|
-
function
|
|
3001
|
-
const n =
|
|
3133
|
+
function li(i, e = "degrees", t = !0) {
|
|
3134
|
+
const n = Ge(i.r, i.theta, e), s = n.length / 2, o = t ? s : s - 1, r = new Float32Array(o * 3 * 2);
|
|
3002
3135
|
for (let a = 0; a < o; a++) {
|
|
3003
3136
|
const l = a * 6, c = a, d = (a + 1) % s;
|
|
3004
3137
|
r[l + 0] = 0, r[l + 1] = 0, r[l + 2] = n[c * 2], r[l + 3] = n[c * 2 + 1], r[l + 4] = n[d * 2], r[l + 5] = n[d * 2 + 1];
|
|
3005
3138
|
}
|
|
3006
3139
|
return r;
|
|
3007
3140
|
}
|
|
3008
|
-
function
|
|
3141
|
+
function hi(i) {
|
|
3009
3142
|
const e = Math.min(i.r.length, i.theta.length);
|
|
3010
3143
|
let t = 0;
|
|
3011
3144
|
for (let n = 0; n < e; n++)
|
|
@@ -3018,44 +3151,44 @@ function ii(i) {
|
|
|
3018
3151
|
maxRadius: t
|
|
3019
3152
|
};
|
|
3020
3153
|
}
|
|
3021
|
-
function
|
|
3154
|
+
function ci(i, e, t, n) {
|
|
3022
3155
|
if (i === "heatmap" && t) {
|
|
3023
|
-
const { xValues:
|
|
3156
|
+
const { xValues: y, yValues: m } = t;
|
|
3024
3157
|
let b = 1 / 0, v = -1 / 0, x = 1 / 0, S = -1 / 0;
|
|
3025
|
-
for (let M = 0; M <
|
|
3026
|
-
const
|
|
3027
|
-
|
|
3158
|
+
for (let M = 0; M < y.length; M++) {
|
|
3159
|
+
const w = y[M];
|
|
3160
|
+
w < b && (b = w), w > v && (v = w);
|
|
3028
3161
|
}
|
|
3029
3162
|
for (let M = 0; M < m.length; M++) {
|
|
3030
|
-
const
|
|
3031
|
-
|
|
3163
|
+
const w = m[M];
|
|
3164
|
+
w < x && (x = w), w > S && (S = w);
|
|
3032
3165
|
}
|
|
3033
3166
|
return b === 1 / 0 || x === 1 / 0 ? null : { xMin: b, xMax: v, yMin: x, yMax: S };
|
|
3034
3167
|
}
|
|
3035
3168
|
if (i === "polar" && n)
|
|
3036
|
-
return
|
|
3169
|
+
return hi(n);
|
|
3037
3170
|
const { x: s, y: o, y2: r, open: a, high: l, low: c, close: d } = e;
|
|
3038
3171
|
if (s.length === 0) return null;
|
|
3039
|
-
let h = 1 / 0, f = -1 / 0, u = 1 / 0,
|
|
3040
|
-
for (let
|
|
3041
|
-
const m = s[
|
|
3172
|
+
let h = 1 / 0, f = -1 / 0, u = 1 / 0, g = -1 / 0;
|
|
3173
|
+
for (let y = 0; y < s.length; y++) {
|
|
3174
|
+
const m = s[y];
|
|
3042
3175
|
if (!isFinite(m)) continue;
|
|
3043
3176
|
m < h && (h = m), m > f && (f = m);
|
|
3044
3177
|
const b = [];
|
|
3045
|
-
o.length >
|
|
3178
|
+
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]), c && isFinite(c[y]) && b.push(c[y]), d && isFinite(d[y]) && b.push(d[y]);
|
|
3046
3179
|
for (const v of b)
|
|
3047
|
-
v < u && (u = v), v >
|
|
3180
|
+
v < u && (u = v), v > g && (g = v);
|
|
3048
3181
|
}
|
|
3049
|
-
return h === 1 / 0 || u === 1 / 0 ? null : { xMin: h, xMax: f, yMin: u, yMax:
|
|
3182
|
+
return h === 1 / 0 || u === 1 / 0 ? null : { xMin: h, xMax: f, yMin: u, yMax: g };
|
|
3050
3183
|
}
|
|
3051
|
-
function
|
|
3184
|
+
function k(i) {
|
|
3052
3185
|
return i ? i instanceof Float32Array || i instanceof Float64Array ? i : new Float32Array(i) : new Float32Array(0);
|
|
3053
3186
|
}
|
|
3054
|
-
function
|
|
3187
|
+
function W(i, e) {
|
|
3055
3188
|
const t = new i.constructor(i.length + e.length);
|
|
3056
3189
|
return t.set(i, 0), t.set(e, i.length), t;
|
|
3057
3190
|
}
|
|
3058
|
-
function
|
|
3191
|
+
function ui(i, e) {
|
|
3059
3192
|
const { x: t, y: n } = i, s = t.length;
|
|
3060
3193
|
if (s < e) return { ...i };
|
|
3061
3194
|
const o = new Float32Array(s), r = Math.floor(e / 2);
|
|
@@ -3067,7 +3200,7 @@ function si(i, e) {
|
|
|
3067
3200
|
}
|
|
3068
3201
|
return { x: t, y: o };
|
|
3069
3202
|
}
|
|
3070
|
-
function
|
|
3203
|
+
function di(i, e) {
|
|
3071
3204
|
var s, o;
|
|
3072
3205
|
if (e < 0 || e >= i.x.length) return null;
|
|
3073
3206
|
if (i.yError && e < i.yError.length) {
|
|
@@ -3077,7 +3210,7 @@ function oi(i, e) {
|
|
|
3077
3210
|
const t = ((s = i.yErrorMinus) == null ? void 0 : s[e]) ?? 0, n = ((o = i.yErrorPlus) == null ? void 0 : o[e]) ?? 0;
|
|
3078
3211
|
return t > 0 || n > 0 ? [t, n] : null;
|
|
3079
3212
|
}
|
|
3080
|
-
function
|
|
3213
|
+
function fi(i, e) {
|
|
3081
3214
|
var s, o;
|
|
3082
3215
|
if (e < 0 || e >= i.x.length) return null;
|
|
3083
3216
|
if (i.xError && e < i.xError.length) {
|
|
@@ -3087,13 +3220,13 @@ function ri(i, e) {
|
|
|
3087
3220
|
const t = ((s = i.xErrorMinus) == null ? void 0 : s[e]) ?? 0, n = ((o = i.xErrorPlus) == null ? void 0 : o[e]) ?? 0;
|
|
3088
3221
|
return t > 0 || n > 0 ? [t, n] : null;
|
|
3089
3222
|
}
|
|
3090
|
-
const
|
|
3223
|
+
const gi = {
|
|
3091
3224
|
color: "#ff0055",
|
|
3092
3225
|
width: 1.5,
|
|
3093
3226
|
opacity: 1,
|
|
3094
3227
|
pointSize: 4
|
|
3095
3228
|
};
|
|
3096
|
-
class
|
|
3229
|
+
class yi {
|
|
3097
3230
|
constructor(e) {
|
|
3098
3231
|
p(this, "id");
|
|
3099
3232
|
p(this, "type");
|
|
@@ -3146,20 +3279,20 @@ class li {
|
|
|
3146
3279
|
this.lastAppendCount = 0;
|
|
3147
3280
|
});
|
|
3148
3281
|
p(this, "hasErrorData", () => !!(this.data.yError || this.data.yErrorPlus || this.data.yErrorMinus || this.data.xError || this.data.xErrorPlus || this.data.xErrorMinus));
|
|
3149
|
-
p(this, "getYError", (e) =>
|
|
3150
|
-
p(this, "getXError", (e) =>
|
|
3282
|
+
p(this, "getYError", (e) => di(this.data, e));
|
|
3283
|
+
p(this, "getXError", (e) => fi(this.data, e));
|
|
3151
3284
|
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.type === "heatmap") {
|
|
3152
3285
|
const t = e;
|
|
3153
3286
|
this.data = { x: new Float32Array(0), y: new Float32Array(0) }, this.heatmapData = {
|
|
3154
|
-
xValues:
|
|
3155
|
-
yValues:
|
|
3156
|
-
zValues:
|
|
3287
|
+
xValues: k(t.data.xValues),
|
|
3288
|
+
yValues: k(t.data.yValues),
|
|
3289
|
+
zValues: k(t.data.zValues)
|
|
3157
3290
|
}, this.heatmapStyle = t.style;
|
|
3158
3291
|
} else if (this.type === "polar") {
|
|
3159
3292
|
const t = e;
|
|
3160
3293
|
this.polarData = {
|
|
3161
|
-
r:
|
|
3162
|
-
theta:
|
|
3294
|
+
r: k(t.data.r),
|
|
3295
|
+
theta: k(t.data.theta)
|
|
3163
3296
|
}, this.data = { x: new Float32Array(0), y: new Float32Array(0) };
|
|
3164
3297
|
} else if (this.type === "gauge") {
|
|
3165
3298
|
const t = e;
|
|
@@ -3170,40 +3303,40 @@ class li {
|
|
|
3170
3303
|
} else {
|
|
3171
3304
|
const t = e.data;
|
|
3172
3305
|
this.data = {
|
|
3173
|
-
x:
|
|
3174
|
-
y:
|
|
3175
|
-
yError: t != null && t.yError ?
|
|
3176
|
-
yErrorPlus: t != null && t.yErrorPlus ?
|
|
3177
|
-
yErrorMinus: t != null && t.yErrorMinus ?
|
|
3178
|
-
xError: t != null && t.xError ?
|
|
3179
|
-
xErrorPlus: t != null && t.xErrorPlus ?
|
|
3180
|
-
xErrorMinus: t != null && t.xErrorMinus ?
|
|
3181
|
-
y2: t != null && t.y2 ?
|
|
3182
|
-
open: t != null && t.open ?
|
|
3183
|
-
high: t != null && t.high ?
|
|
3184
|
-
low: t != null && t.low ?
|
|
3185
|
-
close: t != null && t.close ?
|
|
3186
|
-
median: t != null && t.median ?
|
|
3306
|
+
x: k(t == null ? void 0 : t.x),
|
|
3307
|
+
y: k(t == null ? void 0 : t.y),
|
|
3308
|
+
yError: t != null && t.yError ? k(t.yError) : void 0,
|
|
3309
|
+
yErrorPlus: t != null && t.yErrorPlus ? k(t.yErrorPlus) : void 0,
|
|
3310
|
+
yErrorMinus: t != null && t.yErrorMinus ? k(t.yErrorMinus) : void 0,
|
|
3311
|
+
xError: t != null && t.xError ? k(t.xError) : void 0,
|
|
3312
|
+
xErrorPlus: t != null && t.xErrorPlus ? k(t.xErrorPlus) : void 0,
|
|
3313
|
+
xErrorMinus: t != null && t.xErrorMinus ? k(t.xErrorMinus) : void 0,
|
|
3314
|
+
y2: t != null && t.y2 ? k(t.y2) : void 0,
|
|
3315
|
+
open: t != null && t.open ? k(t.open) : void 0,
|
|
3316
|
+
high: t != null && t.high ? k(t.high) : void 0,
|
|
3317
|
+
low: t != null && t.low ? k(t.low) : void 0,
|
|
3318
|
+
close: t != null && t.close ? k(t.close) : void 0,
|
|
3319
|
+
median: t != null && t.median ? k(t.median) : void 0
|
|
3187
3320
|
}, this.type === "candlestick" && this.data.close && this.data.y.length !== this.data.x.length && (this.data.y = this.data.close);
|
|
3188
3321
|
}
|
|
3189
|
-
this.style = { ...
|
|
3322
|
+
this.style = { ...gi, ...e.style }, e.color && (this.style.color = e.color), e.width && (this.style.width = e.width), e.pointSize && (this.style.pointSize = e.pointSize);
|
|
3190
3323
|
}
|
|
3191
3324
|
getData() {
|
|
3192
|
-
return this.style.smoothing && this.style.smoothing > 0 ? ((this.smoothingNeedsUpdate || !this.smoothedData) && (this.smoothedData =
|
|
3325
|
+
return this.style.smoothing && this.style.smoothing > 0 ? ((this.smoothingNeedsUpdate || !this.smoothedData) && (this.smoothedData = ui(this.data, 5), this.smoothingNeedsUpdate = !1), this.smoothedData) : this.data;
|
|
3193
3326
|
}
|
|
3194
3327
|
getBounds() {
|
|
3195
|
-
return this.data.x.length === 0 && this.type !== "heatmap" && this.type !== "polar" && this.type !== "gauge" && this.type !== "sankey" ? null : (this.boundsNeedsUpdate && (this.cachedBounds =
|
|
3328
|
+
return this.data.x.length === 0 && this.type !== "heatmap" && this.type !== "polar" && this.type !== "gauge" && this.type !== "sankey" ? null : (this.boundsNeedsUpdate && (this.cachedBounds = ci(this.type, this.data, this.heatmapData, this.polarData), this.boundsNeedsUpdate = !1), this.cachedBounds);
|
|
3196
3329
|
}
|
|
3197
3330
|
updateData(e) {
|
|
3198
3331
|
if (e) {
|
|
3199
3332
|
if (e.append) {
|
|
3200
|
-
const t =
|
|
3201
|
-
if (t.length > 0 && (this.data.x =
|
|
3333
|
+
const t = k(e.x), n = k(e.y);
|
|
3334
|
+
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)) {
|
|
3202
3335
|
const s = this.data.x.length - this.maxPoints;
|
|
3203
3336
|
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;
|
|
3204
3337
|
}
|
|
3205
3338
|
} else
|
|
3206
|
-
e.x && (this.data.x =
|
|
3339
|
+
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;
|
|
3207
3340
|
this.boundsNeedsUpdate = !0, this.smoothingNeedsUpdate = !0, this._needsBufferUpdate = !0;
|
|
3208
3341
|
}
|
|
3209
3342
|
}
|
|
@@ -3239,10 +3372,7 @@ class li {
|
|
|
3239
3372
|
this.data = { x: new Float32Array(0), y: new Float32Array(0) }, this.cachedBounds = null;
|
|
3240
3373
|
}
|
|
3241
3374
|
}
|
|
3242
|
-
function
|
|
3243
|
-
return new $e(i);
|
|
3244
|
-
}
|
|
3245
|
-
function hi(i, e, t) {
|
|
3375
|
+
function mi(i, e, t) {
|
|
3246
3376
|
const n = Math.min(i.length, e.length), s = new Float32Array(n * 6 * 2), o = t * 0.5;
|
|
3247
3377
|
for (let r = 0; r < n; r++) {
|
|
3248
3378
|
const a = i[r], l = e[r], c = r * 12, d = a - o, h = a + o, f = 0, u = l;
|
|
@@ -3250,7 +3380,7 @@ function hi(i, e, t) {
|
|
|
3250
3380
|
}
|
|
3251
3381
|
return s;
|
|
3252
3382
|
}
|
|
3253
|
-
function
|
|
3383
|
+
function ue(i) {
|
|
3254
3384
|
if (i.length < 2) return 1;
|
|
3255
3385
|
let e = 1 / 0;
|
|
3256
3386
|
for (let t = 1; t < i.length; t++) {
|
|
@@ -3259,19 +3389,19 @@ function ce(i) {
|
|
|
3259
3389
|
}
|
|
3260
3390
|
return e === 1 / 0 ? 1 : e * 0.8;
|
|
3261
3391
|
}
|
|
3262
|
-
function
|
|
3392
|
+
function pi(i, e, t) {
|
|
3263
3393
|
const n = i.length, s = e.length;
|
|
3264
3394
|
n * s > t.length && console.warn("[Heatmap] Z array is too small for the specified grid dimensions");
|
|
3265
3395
|
const o = (n - 1) * (s - 1), r = new Float32Array(o * 6 * 3);
|
|
3266
3396
|
let a = 0;
|
|
3267
3397
|
for (let l = 0; l < s - 1; l++)
|
|
3268
3398
|
for (let c = 0; c < n - 1; c++) {
|
|
3269
|
-
const d = i[c], h = i[c + 1], f = e[l], u = e[l + 1],
|
|
3270
|
-
r[a++] = d, r[a++] = f, r[a++] =
|
|
3399
|
+
const d = i[c], h = i[c + 1], f = e[l], u = e[l + 1], g = t[l * n + c], y = t[l * n + (c + 1)], m = t[(l + 1) * n + c], b = t[(l + 1) * n + (c + 1)];
|
|
3400
|
+
r[a++] = d, r[a++] = f, r[a++] = g, r[a++] = h, r[a++] = f, r[a++] = y, r[a++] = d, r[a++] = u, r[a++] = m, r[a++] = d, r[a++] = u, r[a++] = m, r[a++] = h, r[a++] = f, r[a++] = y, r[a++] = h, r[a++] = u, r[a++] = b;
|
|
3271
3401
|
}
|
|
3272
3402
|
return r;
|
|
3273
3403
|
}
|
|
3274
|
-
function
|
|
3404
|
+
function xi(i = "viridis") {
|
|
3275
3405
|
const t = new Uint8Array(1024);
|
|
3276
3406
|
for (let n = 0; n < 256; n++) {
|
|
3277
3407
|
const s = n / 255;
|
|
@@ -3280,11 +3410,11 @@ function ui(i = "viridis") {
|
|
|
3280
3410
|
}
|
|
3281
3411
|
return t;
|
|
3282
3412
|
}
|
|
3283
|
-
function
|
|
3413
|
+
function bi(i, e, t, n, s, o) {
|
|
3284
3414
|
const r = i.length, a = [], l = [], c = o / 2, h = o / 10 / 2;
|
|
3285
3415
|
for (let f = 0; f < r; f++) {
|
|
3286
|
-
const
|
|
3287
|
-
De(
|
|
3416
|
+
const g = s[f] >= e[f] ? a : l, y = Math.max(e[f], s[f]), m = Math.min(e[f], s[f]);
|
|
3417
|
+
De(g, i[f] - c, m, i[f] + c, y), De(g, i[f] - h, n[f], i[f] + h, t[f]);
|
|
3288
3418
|
}
|
|
3289
3419
|
return {
|
|
3290
3420
|
bullish: new Float32Array(a),
|
|
@@ -3294,10 +3424,10 @@ function di(i, e, t, n, s, o) {
|
|
|
3294
3424
|
function De(i, e, t, n, s) {
|
|
3295
3425
|
i.push(e, t, n, t, e, s), i.push(n, t, n, s, e, s);
|
|
3296
3426
|
}
|
|
3297
|
-
function
|
|
3427
|
+
function pe(i, e) {
|
|
3298
3428
|
const t = e.getStackId();
|
|
3299
3429
|
if (t) {
|
|
3300
|
-
|
|
3430
|
+
Mi(i, t);
|
|
3301
3431
|
return;
|
|
3302
3432
|
}
|
|
3303
3433
|
const n = e.getData(), s = e.getType();
|
|
@@ -3305,35 +3435,35 @@ function ye(i, e) {
|
|
|
3305
3435
|
const o = e.getId();
|
|
3306
3436
|
if (s === "band" || s === "area") {
|
|
3307
3437
|
const r = s === "area" ? new Float32Array(n.x.length).fill(0) : n.y2 || new Float32Array(n.x.length).fill(0);
|
|
3308
|
-
i.renderer.createBuffer(o,
|
|
3438
|
+
i.renderer.createBuffer(o, Ne(n.x, n.y, r));
|
|
3309
3439
|
} else if (s === "bar") {
|
|
3310
|
-
const r = e.getStyle().barWidth ??
|
|
3311
|
-
i.renderer.createBuffer(o,
|
|
3440
|
+
const r = e.getStyle().barWidth ?? ue(n.x);
|
|
3441
|
+
i.renderer.createBuffer(o, mi(n.x, n.y, r));
|
|
3312
3442
|
} else if (s === "heatmap")
|
|
3313
|
-
|
|
3443
|
+
Si(i, e);
|
|
3314
3444
|
else if (s === "candlestick") {
|
|
3315
3445
|
const r = e.getData();
|
|
3316
3446
|
if (r.open && r.high && r.low && r.close) {
|
|
3317
|
-
const a = e.getStyle().barWidth ??
|
|
3447
|
+
const a = e.getStyle().barWidth ?? ue(r.x), { bullish: l, bearish: c } = bi(r.x, r.open, r.high, r.low, r.close, a);
|
|
3318
3448
|
i.renderer.createBuffer(`${o}_bullish`, l), i.renderer.createBuffer(`${o}_bearish`, c), e.bullishCount = l.length / 2, e.bearishCount = c.length / 2;
|
|
3319
3449
|
}
|
|
3320
3450
|
} else if (s === "boxplot") {
|
|
3321
3451
|
const r = e.getData();
|
|
3322
3452
|
if (r.low && r.open && r.median && r.close && r.high) {
|
|
3323
|
-
const a = e.getStyle().barWidth ??
|
|
3453
|
+
const a = e.getStyle().barWidth ?? ue(r.x), { lines: l, boxes: c } = xt(r.x, r.low, r.open, r.median, r.close, r.high, a);
|
|
3324
3454
|
i.renderer.createBuffer(`${o}_box_lines`, l), i.renderer.createBuffer(`${o}_box_faces`, c);
|
|
3325
3455
|
}
|
|
3326
3456
|
} else if (s === "waterfall") {
|
|
3327
|
-
const r = e.getData(), a = e.getStyle().barWidth ??
|
|
3457
|
+
const r = e.getData(), a = e.getStyle().barWidth ?? ue(r.x), l = e.getStyle().isSubtotal, c = bt(r.x, r.y, a, l);
|
|
3328
3458
|
i.renderer.createBuffer(`${o}_wf_positive`, c.positiveData), i.renderer.createBuffer(`${o}_wf_negative`, c.negativeData), i.renderer.createBuffer(`${o}_wf_subtotal`, c.subtotalData), i.renderer.createBuffer(`${o}_wf_connectors`, c.connectorData), e.waterfallCounts = {
|
|
3329
3459
|
positive: c.positiveCount,
|
|
3330
3460
|
negative: c.negativeCount,
|
|
3331
3461
|
subtotal: c.subtotalCount,
|
|
3332
3462
|
connectors: c.connectorData.length / 2
|
|
3333
3463
|
};
|
|
3334
|
-
} else s === "polar" ?
|
|
3464
|
+
} else s === "polar" ? vi(i, e) : i.renderer.createBuffer(o, We(n.x, n.y));
|
|
3335
3465
|
if (e.hasErrorData()) {
|
|
3336
|
-
const r = e.getData(), a =
|
|
3466
|
+
const r = e.getData(), a = pt(
|
|
3337
3467
|
r.x,
|
|
3338
3468
|
r.y,
|
|
3339
3469
|
{ yError: r.yError, yErrorMinus: r.yErrorMinus, yErrorPlus: r.yErrorPlus },
|
|
@@ -3343,31 +3473,31 @@ function ye(i, e) {
|
|
|
3343
3473
|
}
|
|
3344
3474
|
if (s === "step" || s === "step+scatter") {
|
|
3345
3475
|
const r = e.getStyle().stepMode ?? "after";
|
|
3346
|
-
i.renderer.createBuffer(`${o}_step`,
|
|
3476
|
+
i.renderer.createBuffer(`${o}_step`, mt(n.x, n.y, r));
|
|
3347
3477
|
}
|
|
3348
3478
|
e.resetLastAppendCount();
|
|
3349
3479
|
}
|
|
3350
|
-
function
|
|
3480
|
+
function vi(i, e) {
|
|
3351
3481
|
const t = e.getPolarData();
|
|
3352
3482
|
if (!t || t.r.length === 0) return;
|
|
3353
3483
|
const n = e.getStyle(), s = n.angleMode || "degrees", o = n.closePath !== !1;
|
|
3354
3484
|
if (n.fill || !1) {
|
|
3355
|
-
const a =
|
|
3485
|
+
const a = li(t, s, o);
|
|
3356
3486
|
i.renderer.createBuffer(e.getId(), a);
|
|
3357
3487
|
} else {
|
|
3358
|
-
const a =
|
|
3488
|
+
const a = ai(t, s, o);
|
|
3359
3489
|
i.renderer.createBuffer(e.getId(), a);
|
|
3360
3490
|
}
|
|
3361
3491
|
}
|
|
3362
|
-
function
|
|
3492
|
+
function Si(i, e) {
|
|
3363
3493
|
var o;
|
|
3364
3494
|
const t = e.getHeatmapData(), n = e.getHeatmapStyle();
|
|
3365
3495
|
if (!t || t.xValues.length < 2) return;
|
|
3366
|
-
i.renderer.createBuffer(e.getId(),
|
|
3496
|
+
i.renderer.createBuffer(e.getId(), pi(t.xValues, t.yValues, t.zValues));
|
|
3367
3497
|
const s = ((o = n == null ? void 0 : n.colorScale) == null ? void 0 : o.name) || "viridis";
|
|
3368
|
-
i.renderer.createColormapTexture(`${e.getId()}_colormap`,
|
|
3498
|
+
i.renderer.createColormapTexture(`${e.getId()}_colormap`, xi(s));
|
|
3369
3499
|
}
|
|
3370
|
-
function
|
|
3500
|
+
function Mi(i, e) {
|
|
3371
3501
|
const t = Array.from(i.series.values()).filter((s) => s.getStackId() === e);
|
|
3372
3502
|
let n = null;
|
|
3373
3503
|
for (const s of t) {
|
|
@@ -3376,13 +3506,13 @@ function yi(i, e) {
|
|
|
3376
3506
|
n || (n = new Float32Array(o.y.length).fill(0));
|
|
3377
3507
|
const r = new Float32Array(n);
|
|
3378
3508
|
for (let a = 0; a < o.y.length; a++) n[a] += o.y[a];
|
|
3379
|
-
i.renderer.createBuffer(s.getId(),
|
|
3509
|
+
i.renderer.createBuffer(s.getId(), Ne(o.x, n, r)), s.resetLastAppendCount();
|
|
3380
3510
|
}
|
|
3381
3511
|
}
|
|
3382
|
-
function
|
|
3512
|
+
function X(i) {
|
|
3383
3513
|
return i instanceof Float32Array || i instanceof Float64Array ? i : Float32Array.from(i);
|
|
3384
3514
|
}
|
|
3385
|
-
function
|
|
3515
|
+
function wi(i) {
|
|
3386
3516
|
const e = new Float32Array(i.length), t = new Float32Array(i.length);
|
|
3387
3517
|
for (let n = 0; n < i.length; n++) {
|
|
3388
3518
|
const s = i[n];
|
|
@@ -3390,13 +3520,13 @@ function mi(i) {
|
|
|
3390
3520
|
}
|
|
3391
3521
|
return { positive: e, negative: t };
|
|
3392
3522
|
}
|
|
3393
|
-
function
|
|
3523
|
+
function Ci(i, e, t) {
|
|
3394
3524
|
if (i === void 0 || i === "zero") return 0;
|
|
3395
3525
|
if (typeof i == "number") return i;
|
|
3396
3526
|
const n = t.find((o) => o.id === i);
|
|
3397
|
-
return n ?
|
|
3527
|
+
return n ? X(n.y)[e] ?? 0 : 0;
|
|
3398
3528
|
}
|
|
3399
|
-
function
|
|
3529
|
+
function Ai(i, e, t, n, s) {
|
|
3400
3530
|
const o = i.length;
|
|
3401
3531
|
if (o === 0) return [];
|
|
3402
3532
|
if (o === 1) {
|
|
@@ -3412,26 +3542,26 @@ function xi(i, e, t, n, s) {
|
|
|
3412
3542
|
};
|
|
3413
3543
|
c(i[0], e[0], l(0));
|
|
3414
3544
|
for (let h = 1; h < o; h++) {
|
|
3415
|
-
const f = e[h - 1], u = e[h],
|
|
3545
|
+
const f = e[h - 1], u = e[h], g = t(h - 1), y = t(h), m = f >= g, b = u >= y;
|
|
3416
3546
|
if (m === b) {
|
|
3417
3547
|
c(i[h], e[h], l(h));
|
|
3418
3548
|
continue;
|
|
3419
3549
|
}
|
|
3420
|
-
const v = u - f - (
|
|
3421
|
-
let x = v !== 0 ? (
|
|
3550
|
+
const v = u - f - (y - g);
|
|
3551
|
+
let x = v !== 0 ? (g - f) / v : 0.5;
|
|
3422
3552
|
x = Math.max(0, Math.min(1, x));
|
|
3423
|
-
const S = i[h - 1] + x * (i[h] - i[h - 1]), M = f + x * (u - f),
|
|
3424
|
-
c(S, M,
|
|
3553
|
+
const S = i[h - 1] + x * (i[h] - i[h - 1]), M = f + x * (u - f), w = m ? n : s, A = b ? n : s;
|
|
3554
|
+
c(S, M, w), d(), c(S, M, A), c(i[h], e[h], l(h));
|
|
3425
3555
|
}
|
|
3426
3556
|
return d(), r;
|
|
3427
3557
|
}
|
|
3428
|
-
function
|
|
3558
|
+
function ki(i, e, t, n, s, o, r, a) {
|
|
3429
3559
|
const l = s.colorZones;
|
|
3430
3560
|
if (!l) return;
|
|
3431
|
-
const d =
|
|
3561
|
+
const d = Ai(
|
|
3432
3562
|
t,
|
|
3433
3563
|
n,
|
|
3434
|
-
(h) =>
|
|
3564
|
+
(h) => Ci(l.ref, h, o),
|
|
3435
3565
|
l.aboveColor,
|
|
3436
3566
|
l.belowColor
|
|
3437
3567
|
);
|
|
@@ -3453,7 +3583,7 @@ function bi(i, e, t, n, s, o, r, a) {
|
|
|
3453
3583
|
});
|
|
3454
3584
|
}
|
|
3455
3585
|
}
|
|
3456
|
-
const
|
|
3586
|
+
const Pi = {
|
|
3457
3587
|
baselineColor: "rgba(255,255,255,0.35)",
|
|
3458
3588
|
baselineWidth: 1,
|
|
3459
3589
|
baselineDash: [4, 4],
|
|
@@ -3462,34 +3592,34 @@ const vi = {
|
|
|
3462
3592
|
peakSize: 6,
|
|
3463
3593
|
troughSize: 6
|
|
3464
3594
|
};
|
|
3465
|
-
function
|
|
3595
|
+
function je(i) {
|
|
3466
3596
|
var d, h, f, u;
|
|
3467
|
-
const { id: e, data: t, style: n = {}, visible: s = !0 } = i, o = { ...
|
|
3597
|
+
const { id: e, data: t, style: n = {}, visible: s = !0 } = i, o = { ...Pi, ...n }, r = X(t.x), a = r.length, l = [];
|
|
3468
3598
|
if ((d = t.fills) != null && d.length)
|
|
3469
|
-
for (let
|
|
3470
|
-
const
|
|
3599
|
+
for (let g = 0; g < t.fills.length; g++) {
|
|
3600
|
+
const y = t.fills[g], m = y.id ?? `${e}-fill-${g}`;
|
|
3471
3601
|
l.push({
|
|
3472
3602
|
id: m,
|
|
3473
3603
|
type: "band",
|
|
3474
3604
|
visible: s,
|
|
3475
3605
|
data: {
|
|
3476
3606
|
x: r,
|
|
3477
|
-
y:
|
|
3478
|
-
y2:
|
|
3607
|
+
y: X(y.upper),
|
|
3608
|
+
y2: X(y.lower)
|
|
3479
3609
|
},
|
|
3480
3610
|
style: {
|
|
3481
|
-
color:
|
|
3482
|
-
opacity:
|
|
3611
|
+
color: y.color ?? "rgba(100, 80, 180, 0.25)",
|
|
3612
|
+
opacity: y.opacity ?? 0.35
|
|
3483
3613
|
}
|
|
3484
3614
|
});
|
|
3485
3615
|
}
|
|
3486
3616
|
if (t.histogram) {
|
|
3487
|
-
const
|
|
3617
|
+
const g = X(t.histogram.y), { positive: y, negative: m } = wi(g), b = t.histogram.barWidth, v = b !== void 0 ? { barWidth: b } : {};
|
|
3488
3618
|
l.push({
|
|
3489
3619
|
id: `${e}-hist-pos`,
|
|
3490
3620
|
type: "bar",
|
|
3491
3621
|
visible: s,
|
|
3492
|
-
data: { x: r, y
|
|
3622
|
+
data: { x: r, y },
|
|
3493
3623
|
style: {
|
|
3494
3624
|
color: t.histogram.positiveColor ?? "#26a69a",
|
|
3495
3625
|
opacity: t.histogram.opacity ?? 0.85,
|
|
@@ -3508,10 +3638,10 @@ function He(i) {
|
|
|
3508
3638
|
});
|
|
3509
3639
|
}
|
|
3510
3640
|
if ((h = t.lines) != null && h.length)
|
|
3511
|
-
for (let
|
|
3512
|
-
const
|
|
3513
|
-
if (
|
|
3514
|
-
|
|
3641
|
+
for (let g = 0; g < t.lines.length; g++) {
|
|
3642
|
+
const y = t.lines[g], m = y.id ?? `${e}-line-${g}`, b = X(y.y);
|
|
3643
|
+
if (y.colorZones) {
|
|
3644
|
+
ki(l, m, r, b, y, t.lines, s, "zone");
|
|
3515
3645
|
continue;
|
|
3516
3646
|
}
|
|
3517
3647
|
l.push({
|
|
@@ -3520,9 +3650,9 @@ function He(i) {
|
|
|
3520
3650
|
visible: s,
|
|
3521
3651
|
data: { x: r, y: b },
|
|
3522
3652
|
style: {
|
|
3523
|
-
color:
|
|
3524
|
-
width:
|
|
3525
|
-
opacity:
|
|
3653
|
+
color: y.color ?? (g === 0 ? "#00e5ff" : "#e040fb"),
|
|
3654
|
+
width: y.width ?? 2,
|
|
3655
|
+
opacity: y.opacity ?? 1
|
|
3526
3656
|
}
|
|
3527
3657
|
});
|
|
3528
3658
|
}
|
|
@@ -3542,46 +3672,46 @@ function He(i) {
|
|
|
3542
3672
|
opacity: 1
|
|
3543
3673
|
}
|
|
3544
3674
|
}), (f = t.referenceLines) != null && f.length)
|
|
3545
|
-
for (let
|
|
3546
|
-
const
|
|
3675
|
+
for (let g = 0; g < t.referenceLines.length; g++) {
|
|
3676
|
+
const y = t.referenceLines[g];
|
|
3547
3677
|
l.push({
|
|
3548
|
-
id: `${e}-ref-${
|
|
3678
|
+
id: `${e}-ref-${g}`,
|
|
3549
3679
|
type: "line",
|
|
3550
3680
|
visible: s,
|
|
3551
3681
|
data: {
|
|
3552
3682
|
x: Float32Array.from([r[0], r[a - 1]]),
|
|
3553
|
-
y: Float32Array.from([
|
|
3683
|
+
y: Float32Array.from([y.y, y.y])
|
|
3554
3684
|
},
|
|
3555
3685
|
style: {
|
|
3556
|
-
color:
|
|
3557
|
-
width:
|
|
3558
|
-
lineDash:
|
|
3686
|
+
color: y.color ?? "rgba(255,255,255,0.2)",
|
|
3687
|
+
width: y.width ?? 1,
|
|
3688
|
+
lineDash: y.dash ?? [2, 4],
|
|
3559
3689
|
opacity: 0.8
|
|
3560
3690
|
}
|
|
3561
3691
|
});
|
|
3562
3692
|
}
|
|
3563
3693
|
if ((u = t.markers) != null && u.length) {
|
|
3564
|
-
const
|
|
3565
|
-
|
|
3694
|
+
const g = t.markers.filter((m) => m.kind === "peak"), y = t.markers.filter((m) => m.kind === "trough");
|
|
3695
|
+
g.length && l.push({
|
|
3566
3696
|
id: `${e}-peaks`,
|
|
3567
3697
|
type: "scatter",
|
|
3568
3698
|
visible: s,
|
|
3569
3699
|
data: {
|
|
3570
|
-
x: Float32Array.from(
|
|
3571
|
-
y: Float32Array.from(
|
|
3700
|
+
x: Float32Array.from(g.map((m) => m.x)),
|
|
3701
|
+
y: Float32Array.from(g.map((m) => m.y))
|
|
3572
3702
|
},
|
|
3573
3703
|
style: {
|
|
3574
3704
|
color: o.peakColor,
|
|
3575
3705
|
pointSize: o.peakSize,
|
|
3576
3706
|
opacity: 1
|
|
3577
3707
|
}
|
|
3578
|
-
}),
|
|
3708
|
+
}), y.length && l.push({
|
|
3579
3709
|
id: `${e}-troughs`,
|
|
3580
3710
|
type: "scatter",
|
|
3581
3711
|
visible: s,
|
|
3582
3712
|
data: {
|
|
3583
|
-
x: Float32Array.from(
|
|
3584
|
-
y: Float32Array.from(
|
|
3713
|
+
x: Float32Array.from(y.map((m) => m.x)),
|
|
3714
|
+
y: Float32Array.from(y.map((m) => m.y))
|
|
3585
3715
|
},
|
|
3586
3716
|
style: {
|
|
3587
3717
|
color: o.troughColor,
|
|
@@ -3592,11 +3722,11 @@ function He(i) {
|
|
|
3592
3722
|
}
|
|
3593
3723
|
return l;
|
|
3594
3724
|
}
|
|
3595
|
-
function
|
|
3596
|
-
return
|
|
3725
|
+
function xn(i) {
|
|
3726
|
+
return je(i);
|
|
3597
3727
|
}
|
|
3598
|
-
function
|
|
3599
|
-
const n =
|
|
3728
|
+
function bn(i, e, t = 3) {
|
|
3729
|
+
const n = X(i), s = X(e), o = [], r = Math.max(1, t);
|
|
3600
3730
|
for (let a = r; a < s.length - r; a++) {
|
|
3601
3731
|
let l = !0, c = !0;
|
|
3602
3732
|
for (let d = a - r; d <= a + r; d++)
|
|
@@ -3605,37 +3735,37 @@ function mn(i, e, t = 3) {
|
|
|
3605
3735
|
}
|
|
3606
3736
|
return o;
|
|
3607
3737
|
}
|
|
3608
|
-
function
|
|
3609
|
-
return i.type === "indicator" ?
|
|
3738
|
+
function Bi(i) {
|
|
3739
|
+
return i.type === "indicator" ? je(i) : [i];
|
|
3610
3740
|
}
|
|
3611
|
-
function
|
|
3612
|
-
for (const t of
|
|
3613
|
-
|
|
3741
|
+
function Ti(i, e) {
|
|
3742
|
+
for (const t of Bi(e))
|
|
3743
|
+
Ei(i, t);
|
|
3614
3744
|
}
|
|
3615
|
-
function
|
|
3745
|
+
function Ei(i, e) {
|
|
3616
3746
|
var n, s;
|
|
3617
3747
|
if (e.type !== "heatmap" && !((n = e.style) != null && n.color) && !e.color && i.colorScheme) {
|
|
3618
3748
|
const o = i.series.size, r = i.colorScheme.colors[o % i.colorScheme.colors.length];
|
|
3619
3749
|
e.style || (e.style = {}), e.style.color = r;
|
|
3620
3750
|
}
|
|
3621
|
-
const t = new
|
|
3622
|
-
i.series.set(t.getId(), t),
|
|
3751
|
+
const t = new yi(e);
|
|
3752
|
+
i.series.set(t.getId(), t), pe(i, t), (i.xAxisOptions.auto || Array.from(i.yAxisOptionsMap.values()).some((o) => o.auto)) && i.autoScale(!1), (s = i.updateLegend) == null || s.call(i), i.requestRender();
|
|
3623
3753
|
}
|
|
3624
|
-
function
|
|
3754
|
+
function Ii(i, e) {
|
|
3625
3755
|
var n;
|
|
3626
3756
|
const t = i.series.get(e);
|
|
3627
3757
|
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());
|
|
3628
3758
|
}
|
|
3629
|
-
function
|
|
3759
|
+
function Ri(i, e, t) {
|
|
3630
3760
|
const n = i.series.get(e);
|
|
3631
|
-
n && (n.updateData(t),
|
|
3761
|
+
n && (n.updateData(t), pe(i, n), i.requestRender());
|
|
3632
3762
|
}
|
|
3633
|
-
function
|
|
3763
|
+
function Fi(i, e, t, n) {
|
|
3634
3764
|
var r;
|
|
3635
3765
|
const s = i.series.get(e);
|
|
3636
3766
|
if (!s) return;
|
|
3637
3767
|
const o = ((r = s.getBounds()) == null ? void 0 : r.xMax) ?? -1 / 0;
|
|
3638
|
-
if (s.updateData({ x: t, y: n, append: !0 }),
|
|
3768
|
+
if (s.updateData({ x: t, y: n, append: !0 }), pe(i, s), i.autoScrollEnabled) {
|
|
3639
3769
|
const a = s.getBounds();
|
|
3640
3770
|
if (a) {
|
|
3641
3771
|
const l = i.viewBounds.xMax - i.viewBounds.xMin;
|
|
@@ -3654,11 +3784,11 @@ function Pi(i, e, t, n) {
|
|
|
3654
3784
|
}
|
|
3655
3785
|
i.requestRender();
|
|
3656
3786
|
}
|
|
3657
|
-
function
|
|
3787
|
+
function Di(i, e, t) {
|
|
3658
3788
|
const n = i.series.get(e);
|
|
3659
3789
|
n && (n.setMaxPoints(t), i.requestRender());
|
|
3660
3790
|
}
|
|
3661
|
-
class
|
|
3791
|
+
class ee {
|
|
3662
3792
|
constructor() {
|
|
3663
3793
|
p(this, "domain", [0, 1]);
|
|
3664
3794
|
p(this, "range", [0, 100]);
|
|
@@ -3689,14 +3819,14 @@ class K {
|
|
|
3689
3819
|
ticks(e = 10) {
|
|
3690
3820
|
const [t, n] = this.domain;
|
|
3691
3821
|
if (!isFinite(t) || !isFinite(n) || t === n) return [];
|
|
3692
|
-
const s =
|
|
3822
|
+
const s = Li(t, n, e), o = Math.ceil(t / s) * s, r = [], a = 100;
|
|
3693
3823
|
let l = o;
|
|
3694
3824
|
for (; l <= n + s * 0.5 && r.length < a; )
|
|
3695
3825
|
r.push(Math.round(l * 1e12) / 1e12), l += s;
|
|
3696
3826
|
return r;
|
|
3697
3827
|
}
|
|
3698
3828
|
}
|
|
3699
|
-
class
|
|
3829
|
+
class te {
|
|
3700
3830
|
constructor() {
|
|
3701
3831
|
p(this, "domain", [1, 1e3]);
|
|
3702
3832
|
p(this, "range", [0, 100]);
|
|
@@ -3733,15 +3863,15 @@ class ee {
|
|
|
3733
3863
|
return r;
|
|
3734
3864
|
}
|
|
3735
3865
|
}
|
|
3736
|
-
function
|
|
3866
|
+
function Li(i, e, t) {
|
|
3737
3867
|
const n = e - i;
|
|
3738
3868
|
if (n <= 0 || !isFinite(n)) return 1;
|
|
3739
3869
|
const s = n / t, o = Math.pow(10, Math.floor(Math.log10(s))), r = s / o;
|
|
3740
3870
|
let a;
|
|
3741
3871
|
return r < 1.5 ? a = 1 : r < 3 ? a = 2 : r < 7 ? a = 5 : a = 10, a * o;
|
|
3742
3872
|
}
|
|
3743
|
-
function
|
|
3744
|
-
return i === "log" ? new
|
|
3873
|
+
function vn(i) {
|
|
3874
|
+
return i === "log" ? new te() : new ee();
|
|
3745
3875
|
}
|
|
3746
3876
|
const O = {
|
|
3747
3877
|
title: {
|
|
@@ -3809,7 +3939,7 @@ const O = {
|
|
|
3809
3939
|
},
|
|
3810
3940
|
autoMargins: !0
|
|
3811
3941
|
};
|
|
3812
|
-
function
|
|
3942
|
+
function Ze(i) {
|
|
3813
3943
|
var e;
|
|
3814
3944
|
return i ? {
|
|
3815
3945
|
title: { ...O.title, ...i.title },
|
|
@@ -3830,18 +3960,18 @@ function qe(i) {
|
|
|
3830
3960
|
autoMargins: i.autoMargins ?? O.autoMargins
|
|
3831
3961
|
} : { ...O };
|
|
3832
3962
|
}
|
|
3833
|
-
function
|
|
3834
|
-
var
|
|
3963
|
+
function zi(i, e) {
|
|
3964
|
+
var w;
|
|
3835
3965
|
if (!i) throw new Error("[SciPlot] Container element is required");
|
|
3836
|
-
const t = e.devicePixelRatio ?? window.devicePixelRatio, n =
|
|
3966
|
+
const t = e.devicePixelRatio ?? window.devicePixelRatio, n = Ze(e.layout), s = typeof e.theme == "string" ? He(e.theme) : e.theme ?? zt, 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]], c = e.showLegend ?? s.legend.visible, d = ((w = e.toolbar) == null ? void 0 : w.show) ?? e.showControls ?? !1, h = e.autoScroll ?? !1, f = e.showStatistics ?? !1, u = { scale: "linear", auto: !0, ...e.xAxis }, g = u.scale === "log" ? new te() : new ee(), y = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
3837
3967
|
let b = "default";
|
|
3838
|
-
(e.yAxis ? Array.isArray(e.yAxis) ? e.yAxis : [e.yAxis] : [{}]).forEach((A,
|
|
3839
|
-
const
|
|
3840
|
-
|
|
3841
|
-
const U = { scale: "linear", auto: !0, position: A.position || (
|
|
3842
|
-
|
|
3968
|
+
(e.yAxis ? Array.isArray(e.yAxis) ? e.yAxis : [e.yAxis] : [{}]).forEach((A, P) => {
|
|
3969
|
+
const B = P === 0, F = B ? "default" : `y${P}`, E = A.id || F;
|
|
3970
|
+
B && (b = E);
|
|
3971
|
+
const U = { scale: "linear", auto: !0, position: A.position || (B ? "left" : "right"), ...A, id: E };
|
|
3972
|
+
y.set(E, U), m.set(E, U.scale === "log" ? new te() : new ee());
|
|
3843
3973
|
}), i.style.position = "relative", i.style.overflow = "hidden", i.style.backgroundColor = e.background ?? s.backgroundColor;
|
|
3844
|
-
const x =
|
|
3974
|
+
const x = Le("webgl"), S = Le("overlay");
|
|
3845
3975
|
for (; i.firstChild; )
|
|
3846
3976
|
i.removeChild(i.firstChild);
|
|
3847
3977
|
i.appendChild(x), i.appendChild(S);
|
|
@@ -3857,8 +3987,8 @@ function ki(i, e) {
|
|
|
3857
3987
|
showStatistics: f,
|
|
3858
3988
|
dpr: t,
|
|
3859
3989
|
xAxisOptions: u,
|
|
3860
|
-
xScale:
|
|
3861
|
-
yAxisOptionsMap:
|
|
3990
|
+
xScale: g,
|
|
3991
|
+
yAxisOptionsMap: y,
|
|
3862
3992
|
yScales: m,
|
|
3863
3993
|
primaryYAxisId: b,
|
|
3864
3994
|
webglCanvas: x,
|
|
@@ -3867,12 +3997,12 @@ function ki(i, e) {
|
|
|
3867
3997
|
layout: n
|
|
3868
3998
|
};
|
|
3869
3999
|
}
|
|
3870
|
-
function
|
|
4000
|
+
function Le(i) {
|
|
3871
4001
|
const e = document.createElement("canvas");
|
|
3872
4002
|
return e.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;", i === "overlay" && (e.style.pointerEvents = "none"), e;
|
|
3873
4003
|
}
|
|
3874
|
-
function
|
|
3875
|
-
const n = i.getBoundingClientRect(), s = Array.from(e.values()).filter((h) => h.position !== "right").length, o = Array.from(e.values()).filter((h) => h.position === "right").length, r = (t == null ? void 0 : t.margins) ||
|
|
4004
|
+
function Oi(i, e, t) {
|
|
4005
|
+
const n = i.getBoundingClientRect(), s = Array.from(e.values()).filter((h) => h.position !== "right").length, o = Array.from(e.values()).filter((h) => h.position === "right").length, r = (t == null ? void 0 : t.margins) || re, a = (r.left ?? re.left) + Math.max(0, s - 1) * 65, l = (r.right ?? re.right) + o * 65, c = r.top ?? re.top, d = r.bottom ?? re.bottom;
|
|
3876
4006
|
return {
|
|
3877
4007
|
x: a,
|
|
3878
4008
|
y: c,
|
|
@@ -3880,7 +4010,7 @@ function Ei(i, e, t) {
|
|
|
3880
4010
|
height: Math.max(1, n.height - c - d)
|
|
3881
4011
|
};
|
|
3882
4012
|
}
|
|
3883
|
-
function
|
|
4013
|
+
function $i(i) {
|
|
3884
4014
|
const e = [];
|
|
3885
4015
|
let t = 0, n = 0;
|
|
3886
4016
|
return i.forEach((s, o) => {
|
|
@@ -3888,7 +4018,7 @@ function Ii(i) {
|
|
|
3888
4018
|
r === "left" ? t++ : n++, e.push({ id: o, position: r, offset: a });
|
|
3889
4019
|
}), e;
|
|
3890
4020
|
}
|
|
3891
|
-
function
|
|
4021
|
+
function Yi(i, e, t, n, s) {
|
|
3892
4022
|
const o = i.getBoundingClientRect();
|
|
3893
4023
|
if (o.width === 0 || o.height === 0) return !1;
|
|
3894
4024
|
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`, c = `${Math.round(o.height)}px`;
|
|
@@ -3896,7 +4026,7 @@ function Ri(i, e, t, n, s) {
|
|
|
3896
4026
|
h.width = r, h.height = a, h.style.width = l, h.style.height = c;
|
|
3897
4027
|
}), n.setTransform(s, 0, 0, s, 0, 0), n.imageSmoothingEnabled = !0, "imageSmoothingQuality" in n && (n.imageSmoothingQuality = "high"), !0);
|
|
3898
4028
|
}
|
|
3899
|
-
class
|
|
4029
|
+
class _i {
|
|
3900
4030
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3901
4031
|
constructor(e) {
|
|
3902
4032
|
p(this, "data", /* @__PURE__ */ new Map());
|
|
@@ -3930,7 +4060,7 @@ class Di {
|
|
|
3930
4060
|
});
|
|
3931
4061
|
}
|
|
3932
4062
|
}
|
|
3933
|
-
class
|
|
4063
|
+
class Vi {
|
|
3934
4064
|
constructor(e, t = !0) {
|
|
3935
4065
|
p(this, "prefix");
|
|
3936
4066
|
p(this, "enabled");
|
|
@@ -3949,7 +4079,7 @@ class Fi {
|
|
|
3949
4079
|
console.error(this.prefix, e, ...t);
|
|
3950
4080
|
}
|
|
3951
4081
|
}
|
|
3952
|
-
class
|
|
4082
|
+
class Wi {
|
|
3953
4083
|
constructor(e) {
|
|
3954
4084
|
p(this, "chart");
|
|
3955
4085
|
p(this, "subscriptions", []);
|
|
@@ -3988,7 +4118,7 @@ class Li {
|
|
|
3988
4118
|
this.subscriptions.forEach((e) => e()), this.subscriptions = [], this.customListeners.clear();
|
|
3989
4119
|
}
|
|
3990
4120
|
}
|
|
3991
|
-
class
|
|
4121
|
+
class Ni {
|
|
3992
4122
|
constructor(e, t) {
|
|
3993
4123
|
p(this, "_container");
|
|
3994
4124
|
p(this, "_theme");
|
|
@@ -4075,8 +4205,8 @@ class zi {
|
|
|
4075
4205
|
this.overlays.forEach((t) => t.remove()), this.overlays.clear(), (e = this.notifications) == null || e.remove(), this.notifications = null;
|
|
4076
4206
|
}
|
|
4077
4207
|
}
|
|
4078
|
-
function
|
|
4079
|
-
const t = new
|
|
4208
|
+
function Xi(i, e) {
|
|
4209
|
+
const t = new _i(i), n = new Vi(i), s = new Wi(e.chart), o = new Ni(e.container, e.theme), r = {
|
|
4080
4210
|
get gl() {
|
|
4081
4211
|
var h;
|
|
4082
4212
|
return (h = e.getGL) == null ? void 0 : h.call(e);
|
|
@@ -4100,8 +4230,8 @@ function Oi(i, e) {
|
|
|
4100
4230
|
pixelToDataX: e.pixelToDataX,
|
|
4101
4231
|
pixelToDataY: e.pixelToDataY,
|
|
4102
4232
|
pickPoint: (h, f, u = 20) => {
|
|
4103
|
-
var
|
|
4104
|
-
return ((
|
|
4233
|
+
var g;
|
|
4234
|
+
return ((g = e.findNearestPoint) == null ? void 0 : g.call(e, h, f, u)) ?? null;
|
|
4105
4235
|
}
|
|
4106
4236
|
}, l = {
|
|
4107
4237
|
getAllSeries: () => e.chart.getAllSeries(),
|
|
@@ -4147,7 +4277,7 @@ function Oi(i, e) {
|
|
|
4147
4277
|
}
|
|
4148
4278
|
};
|
|
4149
4279
|
}
|
|
4150
|
-
class
|
|
4280
|
+
class Hi {
|
|
4151
4281
|
constructor(e) {
|
|
4152
4282
|
p(this, "plugins", /* @__PURE__ */ new Map());
|
|
4153
4283
|
p(this, "deps");
|
|
@@ -4190,7 +4320,7 @@ class Yi {
|
|
|
4190
4320
|
);
|
|
4191
4321
|
return;
|
|
4192
4322
|
}
|
|
4193
|
-
const r =
|
|
4323
|
+
const r = Xi(s, {
|
|
4194
4324
|
...this.deps,
|
|
4195
4325
|
getPlugin: (c) => this.get(c)
|
|
4196
4326
|
}), a = {
|
|
@@ -4569,150 +4699,6 @@ class Yi {
|
|
|
4569
4699
|
this.hooksBeforeRender = [], this.hooksAfterRender = [], this.hooksRenderWebGL = [], this.hooksRenderOverlay = [], this.hooksInteraction = [], this.hooksViewChange = [], this.hooksDataUpdate = [], this.hooksSeriesAdd = [], this.hooksSeriesRemove = [], this.hooksSeriesChange = [], this.hooksResize = [], this.hooksThemeChange = [], this.hooksSelectionChange = [], this.hooksSerialize = [];
|
|
4570
4700
|
}
|
|
4571
4701
|
}
|
|
4572
|
-
class _i {
|
|
4573
|
-
constructor() {
|
|
4574
|
-
p(this, "entries", /* @__PURE__ */ new Map());
|
|
4575
|
-
}
|
|
4576
|
-
/**
|
|
4577
|
-
* Register a plugin globally
|
|
4578
|
-
*/
|
|
4579
|
-
register(e) {
|
|
4580
|
-
const t = e.manifest.name;
|
|
4581
|
-
this.entries.has(t) && console.warn(
|
|
4582
|
-
`[SciPlot Registry] Plugin "${t}" is already registered, overwriting`
|
|
4583
|
-
), this.entries.set(t, e);
|
|
4584
|
-
}
|
|
4585
|
-
/**
|
|
4586
|
-
* Unregister a plugin
|
|
4587
|
-
*/
|
|
4588
|
-
unregister(e) {
|
|
4589
|
-
const t = this.entries.has(e);
|
|
4590
|
-
return this.entries.delete(e), t;
|
|
4591
|
-
}
|
|
4592
|
-
/**
|
|
4593
|
-
* Get a registered plugin factory by name
|
|
4594
|
-
*/
|
|
4595
|
-
get(e) {
|
|
4596
|
-
var t;
|
|
4597
|
-
return (t = this.entries.get(e)) == null ? void 0 : t.factory;
|
|
4598
|
-
}
|
|
4599
|
-
/**
|
|
4600
|
-
* List all registered plugins
|
|
4601
|
-
*/
|
|
4602
|
-
list() {
|
|
4603
|
-
return Array.from(this.entries.values()).map((e) => e.manifest);
|
|
4604
|
-
}
|
|
4605
|
-
/**
|
|
4606
|
-
* Search plugins by capability
|
|
4607
|
-
*/
|
|
4608
|
-
findByCapability(e) {
|
|
4609
|
-
const t = [];
|
|
4610
|
-
return this.entries.forEach((n) => {
|
|
4611
|
-
var s;
|
|
4612
|
-
(s = n.manifest.provides) != null && s.includes(e) && t.push(n.manifest);
|
|
4613
|
-
}), t;
|
|
4614
|
-
}
|
|
4615
|
-
/**
|
|
4616
|
-
* Search plugins by tag
|
|
4617
|
-
*/
|
|
4618
|
-
findByTag(e) {
|
|
4619
|
-
const t = [], n = e.toLowerCase();
|
|
4620
|
-
return this.entries.forEach((s) => {
|
|
4621
|
-
var o;
|
|
4622
|
-
(o = s.manifest.tags) != null && o.some((r) => r.toLowerCase().includes(n)) && t.push(s.manifest);
|
|
4623
|
-
}), t;
|
|
4624
|
-
}
|
|
4625
|
-
/**
|
|
4626
|
-
* Check if a plugin is registered
|
|
4627
|
-
*/
|
|
4628
|
-
has(e) {
|
|
4629
|
-
return this.entries.has(e);
|
|
4630
|
-
}
|
|
4631
|
-
/**
|
|
4632
|
-
* Get plugin count
|
|
4633
|
-
*/
|
|
4634
|
-
get size() {
|
|
4635
|
-
return this.entries.size;
|
|
4636
|
-
}
|
|
4637
|
-
/**
|
|
4638
|
-
* Clear all registrations
|
|
4639
|
-
*/
|
|
4640
|
-
clear() {
|
|
4641
|
-
this.entries.clear();
|
|
4642
|
-
}
|
|
4643
|
-
}
|
|
4644
|
-
let Se = null;
|
|
4645
|
-
function Pe() {
|
|
4646
|
-
return Se || (Se = new _i()), Se;
|
|
4647
|
-
}
|
|
4648
|
-
function Vi(i) {
|
|
4649
|
-
Pe().register(i);
|
|
4650
|
-
}
|
|
4651
|
-
function $i(i, e) {
|
|
4652
|
-
return (t) => ({
|
|
4653
|
-
...e(t),
|
|
4654
|
-
manifest: i
|
|
4655
|
-
});
|
|
4656
|
-
}
|
|
4657
|
-
function xn(i, e) {
|
|
4658
|
-
const t = $i(i, e);
|
|
4659
|
-
return Vi({ manifest: i, factory: t }), t;
|
|
4660
|
-
}
|
|
4661
|
-
async function bn(i, e) {
|
|
4662
|
-
const t = Pe().get(i);
|
|
4663
|
-
if (!t) {
|
|
4664
|
-
console.warn(`[SciPlot] Plugin "${i}" not found in registry`);
|
|
4665
|
-
return;
|
|
4666
|
-
}
|
|
4667
|
-
return t(e);
|
|
4668
|
-
}
|
|
4669
|
-
function vn() {
|
|
4670
|
-
const i = Pe(), e = [
|
|
4671
|
-
"analysis",
|
|
4672
|
-
"visualization",
|
|
4673
|
-
"interaction",
|
|
4674
|
-
"data-source",
|
|
4675
|
-
"export",
|
|
4676
|
-
"ui",
|
|
4677
|
-
"annotation",
|
|
4678
|
-
"theme"
|
|
4679
|
-
], t = {};
|
|
4680
|
-
return e.forEach((n) => {
|
|
4681
|
-
t[n] = i.findByCapability(n);
|
|
4682
|
-
}), t;
|
|
4683
|
-
}
|
|
4684
|
-
function Sn(i) {
|
|
4685
|
-
const e = [];
|
|
4686
|
-
return i.name ? /^[@a-z0-9-]+\/[a-z0-9-]+$|^[a-z0-9-]+$/.test(i.name) || e.push(
|
|
4687
|
-
'Invalid name format. Use lowercase with hyphens, optionally scoped (e.g., "@org/name")'
|
|
4688
|
-
) : e.push("Missing required field: name"), i.version ? /^\d+\.\d+\.\d+$/.test(i.version) || e.push("Invalid version format. Use semantic versioning (e.g., 1.0.0)") : e.push("Missing required field: version"), i.dependencies && (Array.isArray(i.dependencies) || e.push("dependencies must be an array")), i.provides && (Array.isArray(i.provides) || e.push("provides must be an array")), e;
|
|
4689
|
-
}
|
|
4690
|
-
function Mn(i, e) {
|
|
4691
|
-
const t = [];
|
|
4692
|
-
if (i.engineVersion) {
|
|
4693
|
-
const [n] = i.engineVersion.split(".").map(Number), [s] = e.split(".").map(Number);
|
|
4694
|
-
if (n > s)
|
|
4695
|
-
return {
|
|
4696
|
-
compatible: !1,
|
|
4697
|
-
warnings: [
|
|
4698
|
-
`Plugin requires engine v${i.engineVersion}, current is v${e}`
|
|
4699
|
-
]
|
|
4700
|
-
};
|
|
4701
|
-
n < s && t.push(
|
|
4702
|
-
`Plugin was built for engine v${i.engineVersion}, may have compatibility issues`
|
|
4703
|
-
);
|
|
4704
|
-
}
|
|
4705
|
-
return { compatible: !0, warnings: t };
|
|
4706
|
-
}
|
|
4707
|
-
function wn(i) {
|
|
4708
|
-
return i;
|
|
4709
|
-
}
|
|
4710
|
-
function Cn(i, e) {
|
|
4711
|
-
return (t) => ({
|
|
4712
|
-
...e(t),
|
|
4713
|
-
manifest: i
|
|
4714
|
-
});
|
|
4715
|
-
}
|
|
4716
4702
|
const I = {
|
|
4717
4703
|
PAN: '<svg viewBox="0 0 24 24" width="11" height="11" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M18 11V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v0"></path><path d="M14 10V4a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v0"></path><path d="M10 10.5V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v0"></path><path d="M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"></path></svg>',
|
|
4718
4704
|
BOX_ZOOM: '<svg viewBox="0 0 24 24" width="11" height="11" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" stroke-dasharray="4 2"></rect><circle cx="9" cy="9" r="3"></circle><line x1="21" y1="21" x2="15" y2="15"></line></svg>',
|
|
@@ -4730,7 +4716,7 @@ const I = {
|
|
|
4730
4716
|
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>',
|
|
4731
4717
|
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>'
|
|
4732
4718
|
};
|
|
4733
|
-
class
|
|
4719
|
+
class Ui {
|
|
4734
4720
|
constructor(e, t, n, s) {
|
|
4735
4721
|
p(this, "container");
|
|
4736
4722
|
p(this, "toolbar");
|
|
@@ -4945,7 +4931,7 @@ class Wi {
|
|
|
4945
4931
|
this.container.remove();
|
|
4946
4932
|
}
|
|
4947
4933
|
}
|
|
4948
|
-
class
|
|
4934
|
+
class qi {
|
|
4949
4935
|
constructor(e, t, n, s) {
|
|
4950
4936
|
p(this, "container");
|
|
4951
4937
|
p(this, "visualContainer");
|
|
@@ -5029,11 +5015,11 @@ class Ni {
|
|
|
5029
5015
|
const h = (f = this.container.parentElement) == null ? void 0 : f.getBoundingClientRect();
|
|
5030
5016
|
if (h) {
|
|
5031
5017
|
if (this.isDragging) {
|
|
5032
|
-
let u = n - h.left - this.dragOffsetX,
|
|
5033
|
-
u = Math.max(0, Math.min(u, h.width - this.container.clientWidth)),
|
|
5018
|
+
let u = n - h.left - this.dragOffsetX, g = s - h.top - this.dragOffsetY;
|
|
5019
|
+
u = Math.max(0, Math.min(u, h.width - this.container.clientWidth)), g = Math.max(0, Math.min(g, h.height - this.container.clientHeight)), this.container.style.left = `${u}px`, this.container.style.top = `${g}px`;
|
|
5034
5020
|
} else if (this.isResizing) {
|
|
5035
|
-
const u = n - this.dragOffsetX,
|
|
5036
|
-
this.visualContainer.style.width = `${
|
|
5021
|
+
const u = n - this.dragOffsetX, g = Math.max(80, Math.min(600, this.dragOffsetY + u));
|
|
5022
|
+
this.visualContainer.style.width = `${g}px`, this.callbacks.onResize && this.callbacks.onResize(g);
|
|
5037
5023
|
}
|
|
5038
5024
|
t = null;
|
|
5039
5025
|
}
|
|
@@ -5116,14 +5102,14 @@ class Ni {
|
|
|
5116
5102
|
r.clearRect(0, 0, e.width, e.height), r.scale(s, s);
|
|
5117
5103
|
const a = t.getStyle(), l = t.isVisible(), c = l ? a.color || "#ff0055" : "#888888", d = t.getType(), h = a.symbol || "circle";
|
|
5118
5104
|
r.fillStyle = c, r.strokeStyle = c, r.globalAlpha = l ? 1 : 0.6, r.lineWidth = 2;
|
|
5119
|
-
const f = o / 2, u = o / 2,
|
|
5120
|
-
if (
|
|
5105
|
+
const f = o / 2, u = o / 2, g = String(d).toLowerCase(), y = g === "scatter" || g === "1" || g === "line" && !!a.symbol, m = g.includes("scatter") || g === "2", b = g === "area" || g === "band";
|
|
5106
|
+
if (y)
|
|
5121
5107
|
this.drawSymbol(r, h, f, u, o * 0.8);
|
|
5122
5108
|
else if (m)
|
|
5123
5109
|
r.beginPath(), r.moveTo(0, u), r.lineTo(o, u), r.stroke(), this.drawSymbol(r, h, f, u, o * 0.6);
|
|
5124
5110
|
else if (b)
|
|
5125
5111
|
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);
|
|
5126
|
-
else if (
|
|
5112
|
+
else if (g === "candlestick") {
|
|
5127
5113
|
const v = a.bullishColor || "#26a69a";
|
|
5128
5114
|
r.fillStyle = v, 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 = v, r.stroke();
|
|
5129
5115
|
} else
|
|
@@ -5177,11 +5163,11 @@ class Ni {
|
|
|
5177
5163
|
const f = this.theme.name.toLowerCase().includes("dark") || this.theme.name.toLowerCase().includes("midnight");
|
|
5178
5164
|
e.fillStyle = f ? n.backgroundColor : "rgba(255, 255, 255, 0.85)", e.strokeStyle = n.borderColor, e.lineWidth = 1 * t;
|
|
5179
5165
|
const u = n.borderRadius * t;
|
|
5180
|
-
e.beginPath(), e.moveTo(l + u, c), e.lineTo(l + d - u, c), e.arcTo(l + d, c, l + d, c + u, u), e.lineTo(l + d, c + h - u), e.arcTo(l + d, c + h, l + d - u, c + h, u), e.lineTo(l + u, c + h), e.arcTo(l, c + h, l, c + h - u, u), e.lineTo(l, c + u), e.arcTo(l, c, l + u, c, u), e.closePath(), e.fill(), e.stroke(), e.textAlign = "left", e.textBaseline = "middle", e.font = `${n.fontSize * t}px ${n.fontFamily}`, this.series.forEach((
|
|
5181
|
-
const m = c + a + s +
|
|
5166
|
+
e.beginPath(), e.moveTo(l + u, c), e.lineTo(l + d - u, c), e.arcTo(l + d, c, l + d, c + u, u), e.lineTo(l + d, c + h - u), e.arcTo(l + d, c + h, l + d - u, c + h, u), e.lineTo(l + u, c + h), e.arcTo(l, c + h, l, c + h - u, u), e.lineTo(l, c + u), e.arcTo(l, c, l + u, c, 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) => {
|
|
5167
|
+
const m = c + a + s + y * (r + o) + r / 2, b = l + s + r / 2, v = m, x = g.getStyle(), S = g.getType(), M = x.symbol || "circle";
|
|
5182
5168
|
e.fillStyle = x.color || "#ff0055", e.strokeStyle = x.color || "#ff0055", e.lineWidth = 2 * t;
|
|
5183
|
-
const
|
|
5184
|
-
A ? this.drawSymbol(e, M, b, v, r * 0.9) :
|
|
5169
|
+
const w = String(S).toLowerCase(), A = w === "scatter" || w === "1" || w === "line" && !!x.symbol, P = w.includes("scatter") || w === "2";
|
|
5170
|
+
A ? this.drawSymbol(e, M, b, v, r * 0.9) : P ? (e.beginPath(), e.moveTo(l + s, v), e.lineTo(l + s + r, v), e.stroke(), this.drawSymbol(e, M, b, v, r * 0.6)) : (e.beginPath(), e.moveTo(l + s, v), e.lineTo(l + s + r, v), e.stroke()), e.fillStyle = n.textColor, e.fillText(g.getName(), l + s + r + 8 * t, m);
|
|
5185
5171
|
}), e.restore();
|
|
5186
5172
|
}
|
|
5187
5173
|
updateTheme(e) {
|
|
@@ -5197,8 +5183,8 @@ class Ni {
|
|
|
5197
5183
|
this.container.remove();
|
|
5198
5184
|
}
|
|
5199
5185
|
}
|
|
5200
|
-
function
|
|
5201
|
-
return i.showControls ? new
|
|
5186
|
+
function Gi(i) {
|
|
5187
|
+
return i.showControls ? new Ui(i.container, i.theme, {
|
|
5202
5188
|
onResetZoom: () => i.resetZoom(),
|
|
5203
5189
|
onSetType: (e) => {
|
|
5204
5190
|
i.series.forEach((t) => {
|
|
@@ -5237,14 +5223,14 @@ function Xi(i) {
|
|
|
5237
5223
|
}
|
|
5238
5224
|
}, i.toolbar) : null;
|
|
5239
5225
|
}
|
|
5240
|
-
function
|
|
5226
|
+
function ji(i, e) {
|
|
5241
5227
|
var s, o, r, a, l, c;
|
|
5242
5228
|
if (!i.showLegend) return null;
|
|
5243
5229
|
const t = {
|
|
5244
5230
|
...e.legendPosition,
|
|
5245
5231
|
highlightOnHover: ((s = i.legendOptions) == null ? void 0 : s.highlightOnHover) ?? ((r = (o = e.layout) == null ? void 0 : o.legend) == null ? void 0 : r.highlightOnHover) ?? !1,
|
|
5246
5232
|
bringToFrontOnHover: ((a = i.legendOptions) == null ? void 0 : a.bringToFrontOnHover) ?? ((c = (l = e.layout) == null ? void 0 : l.legend) == null ? void 0 : c.bringToFrontOnHover) ?? !0
|
|
5247
|
-
}, n = new
|
|
5233
|
+
}, n = new qi(
|
|
5248
5234
|
i.container,
|
|
5249
5235
|
i.theme,
|
|
5250
5236
|
t,
|
|
@@ -5282,7 +5268,7 @@ function Ui(i, e) {
|
|
|
5282
5268
|
);
|
|
5283
5269
|
return n.update(Array.from(i.series.values())), n;
|
|
5284
5270
|
}
|
|
5285
|
-
class
|
|
5271
|
+
class Zi {
|
|
5286
5272
|
constructor() {
|
|
5287
5273
|
p(this, "queue", []);
|
|
5288
5274
|
p(this, "isProcessing", !1);
|
|
@@ -5354,17 +5340,17 @@ class Hi {
|
|
|
5354
5340
|
this.clear(), this.completedCount = 0, this.idCounter = 0;
|
|
5355
5341
|
}
|
|
5356
5342
|
}
|
|
5357
|
-
const
|
|
5358
|
-
function
|
|
5359
|
-
return
|
|
5343
|
+
const Z = new Zi();
|
|
5344
|
+
function Qi() {
|
|
5345
|
+
return Z.enqueue();
|
|
5360
5346
|
}
|
|
5361
|
-
function
|
|
5362
|
-
|
|
5347
|
+
function Qe(i) {
|
|
5348
|
+
Z.markComplete(i);
|
|
5363
5349
|
}
|
|
5364
|
-
function
|
|
5365
|
-
return
|
|
5350
|
+
function Sn() {
|
|
5351
|
+
return Z.getStatus();
|
|
5366
5352
|
}
|
|
5367
|
-
class
|
|
5353
|
+
class Ji {
|
|
5368
5354
|
static getStatus() {
|
|
5369
5355
|
return this.instance.getStatus();
|
|
5370
5356
|
}
|
|
@@ -5372,23 +5358,23 @@ class Gi {
|
|
|
5372
5358
|
this.instance.reset();
|
|
5373
5359
|
}
|
|
5374
5360
|
}
|
|
5375
|
-
p(
|
|
5376
|
-
function
|
|
5361
|
+
p(Ji, "instance", Z);
|
|
5362
|
+
function Mn() {
|
|
5377
5363
|
return {
|
|
5378
|
-
getStatus: () =>
|
|
5379
|
-
reset: () =>
|
|
5364
|
+
getStatus: () => Z.getStatus(),
|
|
5365
|
+
reset: () => Z.reset()
|
|
5380
5366
|
};
|
|
5381
5367
|
}
|
|
5382
|
-
async function
|
|
5368
|
+
async function wn(i, e) {
|
|
5383
5369
|
await e();
|
|
5384
5370
|
}
|
|
5385
|
-
function
|
|
5371
|
+
function Cn(i = 200) {
|
|
5386
5372
|
return new Promise((e) => setTimeout(e, i));
|
|
5387
5373
|
}
|
|
5388
|
-
function
|
|
5389
|
-
|
|
5374
|
+
function An() {
|
|
5375
|
+
Z.reset();
|
|
5390
5376
|
}
|
|
5391
|
-
class
|
|
5377
|
+
class Ki {
|
|
5392
5378
|
constructor(e) {
|
|
5393
5379
|
this.pluginManager = e;
|
|
5394
5380
|
}
|
|
@@ -5519,7 +5505,7 @@ class ji {
|
|
|
5519
5505
|
return this.pluginManager.getNames();
|
|
5520
5506
|
}
|
|
5521
5507
|
}
|
|
5522
|
-
class
|
|
5508
|
+
class en {
|
|
5523
5509
|
constructor(e) {
|
|
5524
5510
|
this.ctx = e;
|
|
5525
5511
|
}
|
|
@@ -5538,7 +5524,7 @@ class Zi {
|
|
|
5538
5524
|
id: n
|
|
5539
5525
|
};
|
|
5540
5526
|
this.ctx.yAxisOptionsMap.set(n, o);
|
|
5541
|
-
const r = o.scale === "log" ? new
|
|
5527
|
+
const r = o.scale === "log" ? new te() : new ee();
|
|
5542
5528
|
return this.ctx.yScales.set(n, r), this.ctx.requestRender(), n;
|
|
5543
5529
|
}
|
|
5544
5530
|
/**
|
|
@@ -5560,7 +5546,7 @@ class Zi {
|
|
|
5560
5546
|
}
|
|
5561
5547
|
const s = { ...n, ...t, id: e };
|
|
5562
5548
|
if (this.ctx.yAxisOptionsMap.set(e, s), t.scale && t.scale !== n.scale) {
|
|
5563
|
-
const o = t.scale === "log" ? new
|
|
5549
|
+
const o = t.scale === "log" ? new te() : new ee(), r = this.ctx.yScales.get(e);
|
|
5564
5550
|
r && o.setDomain(r.domain[0], r.domain[1]), this.ctx.yScales.set(e, o);
|
|
5565
5551
|
}
|
|
5566
5552
|
this.ctx.requestRender();
|
|
@@ -5571,7 +5557,7 @@ class Zi {
|
|
|
5571
5557
|
updateXAxis(e) {
|
|
5572
5558
|
const t = this.ctx.xAxisOptions.scale;
|
|
5573
5559
|
if (Object.assign(this.ctx.xAxisOptions, e), e.scale && e.scale !== t) {
|
|
5574
|
-
const n = e.scale === "log" ? new
|
|
5560
|
+
const n = e.scale === "log" ? new te() : new ee();
|
|
5575
5561
|
n.setDomain(this.ctx.xScale.domain[0], this.ctx.xScale.domain[1]), Object.setPrototypeOf(this.ctx.xScale, Object.getPrototypeOf(n)), Object.assign(this.ctx.xScale, n);
|
|
5576
5562
|
}
|
|
5577
5563
|
this.ctx.requestRender();
|
|
@@ -5620,21 +5606,21 @@ class Zi {
|
|
|
5620
5606
|
return this.ctx.yScales;
|
|
5621
5607
|
}
|
|
5622
5608
|
}
|
|
5623
|
-
const
|
|
5624
|
-
function
|
|
5609
|
+
const Je = 1;
|
|
5610
|
+
function ze(i) {
|
|
5625
5611
|
const e = i instanceof Float32Array ? i : new Float32Array(i), t = new Uint8Array(e.buffer);
|
|
5626
5612
|
let n = "";
|
|
5627
5613
|
for (let s = 0; s < t.length; s++)
|
|
5628
5614
|
n += String.fromCharCode(t[s]);
|
|
5629
5615
|
return btoa(n);
|
|
5630
5616
|
}
|
|
5631
|
-
function
|
|
5617
|
+
function Oe(i) {
|
|
5632
5618
|
const e = atob(i), t = new Uint8Array(e.length);
|
|
5633
5619
|
for (let n = 0; n < e.length; n++)
|
|
5634
5620
|
t[n] = e.charCodeAt(n);
|
|
5635
5621
|
return new Float32Array(t.buffer);
|
|
5636
5622
|
}
|
|
5637
|
-
function
|
|
5623
|
+
function tn(i) {
|
|
5638
5624
|
try {
|
|
5639
5625
|
new TextEncoder().encode(i);
|
|
5640
5626
|
let t = "";
|
|
@@ -5649,7 +5635,7 @@ function Qi(i) {
|
|
|
5649
5635
|
return btoa(i);
|
|
5650
5636
|
}
|
|
5651
5637
|
}
|
|
5652
|
-
function
|
|
5638
|
+
function nn(i) {
|
|
5653
5639
|
try {
|
|
5654
5640
|
const e = atob(i);
|
|
5655
5641
|
let t = "";
|
|
@@ -5664,24 +5650,24 @@ function Ji(i) {
|
|
|
5664
5650
|
return atob(i);
|
|
5665
5651
|
}
|
|
5666
5652
|
}
|
|
5667
|
-
function
|
|
5653
|
+
function sn(i, e = !0) {
|
|
5668
5654
|
const t = JSON.stringify(i);
|
|
5669
|
-
return e ?
|
|
5655
|
+
return e ? tn(t) : btoa(t);
|
|
5670
5656
|
}
|
|
5671
|
-
function
|
|
5657
|
+
function on(i, e = !0) {
|
|
5672
5658
|
try {
|
|
5673
|
-
const t = e ?
|
|
5674
|
-
return typeof n.version != "number" ? (console.warn("[SciPlot] Invalid state: missing version"), null) : (n.version >
|
|
5659
|
+
const t = e ? nn(i) : atob(i), n = JSON.parse(t);
|
|
5660
|
+
return typeof n.version != "number" ? (console.warn("[SciPlot] Invalid state: missing version"), null) : (n.version > Je && console.warn("[SciPlot] State version is newer than supported"), n);
|
|
5675
5661
|
} catch (t) {
|
|
5676
5662
|
return console.error("[SciPlot] Failed to parse URL hash:", t), null;
|
|
5677
5663
|
}
|
|
5678
5664
|
}
|
|
5679
|
-
function
|
|
5665
|
+
function kn(i) {
|
|
5680
5666
|
if (!i || typeof i != "object") return !1;
|
|
5681
5667
|
const e = i;
|
|
5682
5668
|
return !(typeof e.version != "number" || !e.viewBounds || typeof e.viewBounds != "object" || !Array.isArray(e.series));
|
|
5683
5669
|
}
|
|
5684
|
-
class
|
|
5670
|
+
class Pn {
|
|
5685
5671
|
constructor(e = 50) {
|
|
5686
5672
|
p(this, "history", []);
|
|
5687
5673
|
p(this, "currentIndex", -1);
|
|
@@ -5737,7 +5723,7 @@ class In {
|
|
|
5737
5723
|
return this.history.length;
|
|
5738
5724
|
}
|
|
5739
5725
|
}
|
|
5740
|
-
class
|
|
5726
|
+
class rn {
|
|
5741
5727
|
constructor(e) {
|
|
5742
5728
|
this.ctx = e;
|
|
5743
5729
|
}
|
|
@@ -5747,7 +5733,7 @@ class tn {
|
|
|
5747
5733
|
serialize(e = {}) {
|
|
5748
5734
|
const { includeData: t = !0, includeAnnotations: n = !0 } = e;
|
|
5749
5735
|
return {
|
|
5750
|
-
version:
|
|
5736
|
+
version: Je,
|
|
5751
5737
|
timestamp: Date.now(),
|
|
5752
5738
|
viewBounds: { ...this.ctx.viewBounds },
|
|
5753
5739
|
xAxis: {
|
|
@@ -5782,8 +5768,8 @@ class tn {
|
|
|
5782
5768
|
style: o.getStyle(),
|
|
5783
5769
|
visible: o.isVisible(),
|
|
5784
5770
|
data: t ? {
|
|
5785
|
-
x:
|
|
5786
|
-
y:
|
|
5771
|
+
x: ze(o.getData().x),
|
|
5772
|
+
y: ze(o.getData().y)
|
|
5787
5773
|
} : { x: "", y: "" }
|
|
5788
5774
|
})),
|
|
5789
5775
|
annotations: n ? this.ctx.getAnnotations() : [],
|
|
@@ -5826,8 +5812,8 @@ class tn {
|
|
|
5826
5812
|
type: r.type,
|
|
5827
5813
|
yAxisId: r.yAxisId,
|
|
5828
5814
|
data: {
|
|
5829
|
-
x:
|
|
5830
|
-
y:
|
|
5815
|
+
x: Oe(r.data.x),
|
|
5816
|
+
y: Oe(r.data.y)
|
|
5831
5817
|
},
|
|
5832
5818
|
style: r.style
|
|
5833
5819
|
});
|
|
@@ -5837,17 +5823,17 @@ class tn {
|
|
|
5837
5823
|
* Convert current state to URL-safe hash
|
|
5838
5824
|
*/
|
|
5839
5825
|
toUrlHash(e = !0) {
|
|
5840
|
-
return
|
|
5826
|
+
return sn(this.serialize({ includeData: !0 }), e);
|
|
5841
5827
|
}
|
|
5842
5828
|
/**
|
|
5843
5829
|
* Load state from URL hash
|
|
5844
5830
|
*/
|
|
5845
5831
|
fromUrlHash(e, t = !0) {
|
|
5846
|
-
const n =
|
|
5832
|
+
const n = on(e, t);
|
|
5847
5833
|
n && this.deserialize(n);
|
|
5848
5834
|
}
|
|
5849
5835
|
}
|
|
5850
|
-
function
|
|
5836
|
+
function an(i, e, t, n) {
|
|
5851
5837
|
const { value: s, min: o, max: r } = e, {
|
|
5852
5838
|
needleColor: a = "#333",
|
|
5853
5839
|
needleWidth: l = 3,
|
|
@@ -5856,29 +5842,29 @@ function nn(i, e, t, n) {
|
|
|
5856
5842
|
startAngle: h = 135,
|
|
5857
5843
|
endAngle: f = 405,
|
|
5858
5844
|
showValue: u = !0,
|
|
5859
|
-
valueColor:
|
|
5860
|
-
valueSize:
|
|
5845
|
+
valueColor: g = "#fff",
|
|
5846
|
+
valueSize: y = 24,
|
|
5861
5847
|
label: m
|
|
5862
|
-
} = t, b = n.x + n.width / 2, v = n.y + n.height / 2, x = Math.min(n.width, n.height) / 2 * d, S = f - h, M = Math.max(0, Math.min(1, (s - o) / (r - o))),
|
|
5848
|
+
} = t, b = n.x + n.width / 2, v = n.y + n.height / 2, x = Math.min(n.width, n.height) / 2 * d, S = f - h, M = Math.max(0, Math.min(1, (s - o) / (r - o))), w = (h + M * S) * (Math.PI / 180);
|
|
5863
5849
|
i.save(), i.beginPath(), i.arc(b, v, x, h * (Math.PI / 180), f * (Math.PI / 180)), i.strokeStyle = "rgba(255, 255, 255, 0.1)", i.lineWidth = x * 0.2, i.lineCap = "round", i.stroke();
|
|
5864
|
-
for (const
|
|
5865
|
-
const
|
|
5850
|
+
for (const P of c) {
|
|
5851
|
+
const B = Math.max(0, Math.min(1, (P.from - o) / (r - o))), F = Math.max(0, Math.min(1, (P.to - o) / (r - o)));
|
|
5866
5852
|
i.beginPath(), i.arc(
|
|
5867
5853
|
b,
|
|
5868
5854
|
v,
|
|
5869
5855
|
x,
|
|
5870
|
-
(h +
|
|
5871
|
-
(h +
|
|
5872
|
-
), i.strokeStyle =
|
|
5856
|
+
(h + B * S) * (Math.PI / 180),
|
|
5857
|
+
(h + F * S) * (Math.PI / 180)
|
|
5858
|
+
), i.strokeStyle = P.color, i.lineWidth = x * 0.2, i.stroke();
|
|
5873
5859
|
}
|
|
5874
5860
|
const A = 11;
|
|
5875
|
-
for (let
|
|
5876
|
-
const
|
|
5877
|
-
i.beginPath(), i.moveTo(b +
|
|
5861
|
+
for (let P = 0; P < A; P++) {
|
|
5862
|
+
const B = (h + P / (A - 1) * S) * (Math.PI / 180), F = x * 0.85, E = x * 0.95;
|
|
5863
|
+
i.beginPath(), i.moveTo(b + F * Math.cos(B), v + F * Math.sin(B)), i.lineTo(b + E * Math.cos(B), v + E * Math.sin(B)), i.strokeStyle = "rgba(255, 255, 255, 0.5)", i.lineWidth = 2, i.stroke();
|
|
5878
5864
|
}
|
|
5879
|
-
i.beginPath(), i.moveTo(b, v), i.lineTo(b + x * 0.9 * Math.cos(
|
|
5865
|
+
i.beginPath(), i.moveTo(b, v), i.lineTo(b + x * 0.9 * Math.cos(w), v + x * 0.9 * Math.sin(w)), 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, v, 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, v + x * 0.4), m && (i.font = `${y * 0.5}px Inter, sans-serif`, i.fillStyle = "rgba(255, 255, 255, 0.6)", i.fillText(m, b, v + x * 0.6))), i.restore();
|
|
5880
5866
|
}
|
|
5881
|
-
function
|
|
5867
|
+
function ln(i, e, t, n) {
|
|
5882
5868
|
const { nodes: s, links: o } = e, {
|
|
5883
5869
|
nodeWidth: r = 18,
|
|
5884
5870
|
nodePadding: a = 12,
|
|
@@ -5887,92 +5873,92 @@ function sn(i, e, t, n) {
|
|
|
5887
5873
|
showLabels: d = !0
|
|
5888
5874
|
} = t;
|
|
5889
5875
|
if (!o.length) return;
|
|
5890
|
-
const h = 1.8, f = n.width / h, u = n.height / h,
|
|
5891
|
-
x: n.x +
|
|
5892
|
-
y: n.y +
|
|
5876
|
+
const h = 1.8, f = n.width / h, u = n.height / h, g = (n.width - f) / 2, y = (n.height - u) / 2, b = {
|
|
5877
|
+
x: n.x + g,
|
|
5878
|
+
y: n.y + y,
|
|
5893
5879
|
width: f,
|
|
5894
5880
|
height: u
|
|
5895
5881
|
}, v = /* @__PURE__ */ new Set();
|
|
5896
|
-
o.forEach((
|
|
5897
|
-
v.add(
|
|
5882
|
+
o.forEach((C) => {
|
|
5883
|
+
v.add(C.source), v.add(C.target);
|
|
5898
5884
|
});
|
|
5899
|
-
const x = Array.from(v), S = /* @__PURE__ */ new Map(), M = new Set(o.map((
|
|
5900
|
-
x.filter((
|
|
5885
|
+
const x = Array.from(v), S = /* @__PURE__ */ new Map(), M = new Set(o.map((C) => C.target));
|
|
5886
|
+
x.filter((C) => !M.has(C)).forEach((C) => S.set(C, 0));
|
|
5901
5887
|
let A = !0;
|
|
5902
5888
|
for (; A; )
|
|
5903
|
-
A = !1, o.forEach((
|
|
5904
|
-
const
|
|
5905
|
-
if (
|
|
5906
|
-
const R = S.get(
|
|
5907
|
-
(R === void 0 ||
|
|
5889
|
+
A = !1, o.forEach((C) => {
|
|
5890
|
+
const T = S.get(C.source);
|
|
5891
|
+
if (T !== void 0) {
|
|
5892
|
+
const R = S.get(C.target), D = T + 1;
|
|
5893
|
+
(R === void 0 || D > R) && (S.set(C.target, D), A = !0);
|
|
5908
5894
|
}
|
|
5909
5895
|
});
|
|
5910
|
-
x.forEach((
|
|
5911
|
-
S.get(
|
|
5896
|
+
x.forEach((C) => {
|
|
5897
|
+
S.get(C) === void 0 && S.set(C, 0);
|
|
5912
5898
|
});
|
|
5913
|
-
const
|
|
5914
|
-
x.forEach((
|
|
5915
|
-
const
|
|
5916
|
-
o.forEach((
|
|
5917
|
-
E.set(
|
|
5899
|
+
const P = Math.max(...Array.from(S.values())), B = Array.from({ length: P + 1 }, () => []);
|
|
5900
|
+
x.forEach((C) => B[S.get(C)].push(C));
|
|
5901
|
+
const F = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
|
|
5902
|
+
o.forEach((C) => {
|
|
5903
|
+
E.set(C.source, (E.get(C.source) || 0) + C.value), F.set(C.target, (F.get(C.target) || 0) + C.value);
|
|
5918
5904
|
});
|
|
5919
|
-
const
|
|
5905
|
+
const le = (C) => Math.max(F.get(C) || 0, E.get(C) || 0);
|
|
5920
5906
|
let U = 0;
|
|
5921
|
-
|
|
5922
|
-
let
|
|
5923
|
-
|
|
5907
|
+
B.forEach((C) => {
|
|
5908
|
+
let T = 0;
|
|
5909
|
+
C.forEach((R) => T += le(R)), T > U && (U = T);
|
|
5924
5910
|
});
|
|
5925
|
-
const
|
|
5926
|
-
|
|
5927
|
-
const R = b.x +
|
|
5928
|
-
let
|
|
5929
|
-
|
|
5930
|
-
const L =
|
|
5931
|
-
|
|
5911
|
+
const ie = /* @__PURE__ */ new Map(), Ke = B.length, et = (b.width - r) / Math.max(1, Ke - 1);
|
|
5912
|
+
B.forEach((C, T) => {
|
|
5913
|
+
const R = b.x + T * et, D = [];
|
|
5914
|
+
let q = 0;
|
|
5915
|
+
C.forEach((V) => {
|
|
5916
|
+
const L = le(V), $ = U > 0 ? L / U * (b.height * 0.9) : 20;
|
|
5917
|
+
D.push($), q += $;
|
|
5932
5918
|
});
|
|
5933
|
-
const
|
|
5934
|
-
let
|
|
5935
|
-
|
|
5936
|
-
const
|
|
5937
|
-
let
|
|
5919
|
+
const ne = (C.length - 1) * a, se = q + ne;
|
|
5920
|
+
let oe = b.y + (b.height - se) / 2;
|
|
5921
|
+
C.forEach((V, L) => {
|
|
5922
|
+
const $ = D[L];
|
|
5923
|
+
let Q = l[L % l.length];
|
|
5938
5924
|
if (s.length > 0) {
|
|
5939
|
-
const z = s.find((
|
|
5940
|
-
z != null && z.color && (
|
|
5925
|
+
const z = s.find((J) => J.id === V);
|
|
5926
|
+
z != null && z.color && (Q = z.color);
|
|
5941
5927
|
}
|
|
5942
|
-
|
|
5928
|
+
ie.set(V, { x: R, y: oe, width: r, height: $, color: Q, value: le(V) }), oe += $ + a;
|
|
5943
5929
|
});
|
|
5944
5930
|
}), i.save();
|
|
5945
|
-
const
|
|
5946
|
-
o.forEach((
|
|
5947
|
-
const
|
|
5948
|
-
if (!
|
|
5949
|
-
const
|
|
5950
|
-
|
|
5951
|
-
}), i.restore(), i.save(), i.globalAlpha = 1,
|
|
5952
|
-
i.fillStyle =
|
|
5953
|
-
const
|
|
5954
|
-
|
|
5955
|
-
}), i.restore(), d && (i.save(), i.font = "bold 11px Inter, -apple-system, sans-serif", i.textBaseline = "middle",
|
|
5956
|
-
let R = String(
|
|
5957
|
-
const
|
|
5958
|
-
|
|
5959
|
-
const
|
|
5960
|
-
i.shadowBlur = 3, i.shadowColor = "rgba(0, 0, 0, 0.7)", i.fillStyle = "#ffffff",
|
|
5931
|
+
const Pe = /* @__PURE__ */ new Map(), Be = /* @__PURE__ */ new Map();
|
|
5932
|
+
o.forEach((C) => {
|
|
5933
|
+
const T = ie.get(C.source), R = ie.get(C.target);
|
|
5934
|
+
if (!T || !R) return;
|
|
5935
|
+
const D = Pe.get(C.source) || 0, q = Be.get(C.target) || 0, ne = E.get(C.source) || 1, se = F.get(C.target) || 1, oe = C.value / ne * T.height, V = C.value / se * R.height, L = T.x + T.width, $ = T.y + D, Q = $ + oe, z = R.x, J = R.y + q, xe = J + V, he = (z - L) * 0.5, be = i.createLinearGradient(L, ($ + Q) / 2, z, (J + xe) / 2);
|
|
5936
|
+
be.addColorStop(0, T.color), be.addColorStop(1, R.color), i.beginPath(), i.moveTo(L, $), i.bezierCurveTo(L + he, $, z - he, J, z, J), i.lineTo(z, xe), i.bezierCurveTo(z - he, xe, L + he, Q, L, Q), i.closePath(), i.fillStyle = be, i.globalAlpha = c, i.fill(), i.strokeStyle = T.color, i.globalAlpha = c * 0.3, i.lineWidth = 0.5, i.stroke(), Pe.set(C.source, D + oe), Be.set(C.target, q + V);
|
|
5937
|
+
}), i.restore(), i.save(), i.globalAlpha = 1, ie.forEach((C) => {
|
|
5938
|
+
i.fillStyle = C.color, i.fillRect(C.x, C.y, C.width, C.height);
|
|
5939
|
+
const T = i.createLinearGradient(C.x, C.y, C.x + C.width, C.y);
|
|
5940
|
+
T.addColorStop(0, "rgba(255, 255, 255, 0.15)"), T.addColorStop(1, "rgba(0, 0, 0, 0.15)"), i.fillStyle = T, i.fillRect(C.x, C.y, C.width, C.height);
|
|
5941
|
+
}), i.restore(), d && (i.save(), i.font = "bold 11px Inter, -apple-system, sans-serif", i.textBaseline = "middle", ie.forEach((C, T) => {
|
|
5942
|
+
let R = String(T);
|
|
5943
|
+
const D = s.find((se) => se.id === T);
|
|
5944
|
+
D != null && D.name && (R = D.name);
|
|
5945
|
+
const q = C.x <= b.x + 5, ne = C.x >= b.x + b.width - r - 5;
|
|
5946
|
+
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)) : ne ? (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));
|
|
5961
5947
|
}), i.restore());
|
|
5962
5948
|
}
|
|
5963
|
-
function
|
|
5949
|
+
function $e(i, e, t, n, s) {
|
|
5964
5950
|
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;
|
|
5965
5951
|
if (n === "x") {
|
|
5966
|
-
const f = e.x + o, u = e.x + e.width - r,
|
|
5967
|
-
i.setRange(
|
|
5952
|
+
const f = e.x + o, u = e.x + e.width - r, g = (t == null ? void 0 : t.invertAxis) ?? !1;
|
|
5953
|
+
i.setRange(g ? u : f, g ? f : u);
|
|
5968
5954
|
return;
|
|
5969
5955
|
}
|
|
5970
5956
|
const c = e.y + a, d = e.y + e.height - l, h = (t == null ? void 0 : t.invertAxis) ?? !1;
|
|
5971
5957
|
i.setRange(h ? c : d, h ? d : c);
|
|
5972
5958
|
}
|
|
5973
|
-
function
|
|
5959
|
+
function hn(i, e) {
|
|
5974
5960
|
const t = [], n = i.layout.plotPadding;
|
|
5975
|
-
if (
|
|
5961
|
+
if ($e(
|
|
5976
5962
|
i.xScale,
|
|
5977
5963
|
e,
|
|
5978
5964
|
i.xAxisOptions,
|
|
@@ -5980,7 +5966,7 @@ function on(i, e) {
|
|
|
5980
5966
|
n
|
|
5981
5967
|
), i.xScale.setDomain(i.viewBounds.xMin, i.viewBounds.xMax), i.yScales.forEach((s, o) => {
|
|
5982
5968
|
const r = i.yAxisOptionsMap.get(o);
|
|
5983
|
-
|
|
5969
|
+
$e(s, e, r, "y", n), o === i.primaryYAxisId && s.setDomain(i.viewBounds.yMin, i.viewBounds.yMax);
|
|
5984
5970
|
}), i.series.forEach((s) => {
|
|
5985
5971
|
var a, l;
|
|
5986
5972
|
s.needsBufferUpdate && (i.updateSeriesBuffer(s), s.needsBufferUpdate = !1);
|
|
@@ -5993,8 +5979,8 @@ function on(i, e) {
|
|
|
5993
5979
|
if (r === "area")
|
|
5994
5980
|
f = "band";
|
|
5995
5981
|
else if (r === "polar") {
|
|
5996
|
-
const
|
|
5997
|
-
f =
|
|
5982
|
+
const g = s.getStyle();
|
|
5983
|
+
f = g != null && g.fill ? "band" : "line";
|
|
5998
5984
|
}
|
|
5999
5985
|
let u = null;
|
|
6000
5986
|
if (o && (u = {
|
|
@@ -6011,33 +5997,33 @@ function on(i, e) {
|
|
|
6011
5997
|
else if (r === "bar")
|
|
6012
5998
|
u.count = s.getPointCount() * 6;
|
|
6013
5999
|
else if (r === "polar") {
|
|
6014
|
-
const
|
|
6015
|
-
if (
|
|
6016
|
-
const
|
|
6017
|
-
u.count =
|
|
6018
|
-
} else
|
|
6000
|
+
const g = s.getStyle();
|
|
6001
|
+
if (g != null && g.fill) {
|
|
6002
|
+
const y = (g == null ? void 0 : g.closePath) !== !1;
|
|
6003
|
+
u.count = y ? s.getPointCount() * 3 : (s.getPointCount() - 1) * 3;
|
|
6004
|
+
} else g != null && g.closePath && (u.count = s.getPointCount() + 1);
|
|
6019
6005
|
}
|
|
6020
6006
|
if (r === "step" || r === "step+scatter") {
|
|
6021
|
-
const
|
|
6022
|
-
if (
|
|
6023
|
-
u.stepBuffer =
|
|
6024
|
-
const
|
|
6025
|
-
|
|
6007
|
+
const g = i.renderer.getBuffer(`${s.getId()}_step`);
|
|
6008
|
+
if (g) {
|
|
6009
|
+
u.stepBuffer = g;
|
|
6010
|
+
const y = s.getStyle().stepMode ?? "after", m = s.getPointCount();
|
|
6011
|
+
y === "center" ? u.stepCount = 1 + (m - 1) * 3 : u.stepCount = m * 2 - 1;
|
|
6026
6012
|
}
|
|
6027
6013
|
}
|
|
6028
6014
|
if (r === "boxplot") {
|
|
6029
|
-
const
|
|
6030
|
-
|
|
6015
|
+
const g = i.renderer.getBuffer(`${s.getId()}_box_lines`), y = i.renderer.getBuffer(`${s.getId()}_box_faces`);
|
|
6016
|
+
g && y && (u.boxLinesBuffer = g, u.boxLinesCount = s.getPointCount() * 10, u.boxBuffer = y, u.boxCount = s.getPointCount() * 6);
|
|
6031
6017
|
}
|
|
6032
6018
|
}
|
|
6033
6019
|
if (r === "boxplot" && !u) {
|
|
6034
|
-
const
|
|
6035
|
-
if (
|
|
6020
|
+
const g = i.renderer.getBuffer(`${s.getId()}_box_lines`), y = i.renderer.getBuffer(`${s.getId()}_box_faces`);
|
|
6021
|
+
if (g && y) {
|
|
6036
6022
|
const m = s.getYAxisId() || i.primaryYAxisId, b = i.yScales.get(m);
|
|
6037
6023
|
let v;
|
|
6038
6024
|
b && (v = { min: b.domain[0], max: b.domain[1] }), u = {
|
|
6039
6025
|
id: s.getId(),
|
|
6040
|
-
buffer:
|
|
6026
|
+
buffer: g,
|
|
6041
6027
|
// Use lines buffer as main buffer for reference
|
|
6042
6028
|
count: 0,
|
|
6043
6029
|
// No main buffer rendering
|
|
@@ -6045,23 +6031,23 @@ function on(i, e) {
|
|
|
6045
6031
|
visible: s.isVisible(),
|
|
6046
6032
|
type: "boxplot",
|
|
6047
6033
|
yBounds: v,
|
|
6048
|
-
boxLinesBuffer:
|
|
6034
|
+
boxLinesBuffer: g,
|
|
6049
6035
|
boxLinesCount: s.getPointCount() * 10,
|
|
6050
|
-
boxBuffer:
|
|
6036
|
+
boxBuffer: y,
|
|
6051
6037
|
boxCount: s.getPointCount() * 6
|
|
6052
6038
|
};
|
|
6053
6039
|
}
|
|
6054
6040
|
}
|
|
6055
6041
|
if (r === "waterfall" && !u) {
|
|
6056
|
-
const
|
|
6057
|
-
if (
|
|
6042
|
+
const g = i.renderer.getBuffer(`${s.getId()}_wf_positive`), y = i.renderer.getBuffer(`${s.getId()}_wf_negative`), m = i.renderer.getBuffer(`${s.getId()}_wf_subtotal`), b = i.renderer.getBuffer(`${s.getId()}_wf_connectors`);
|
|
6043
|
+
if (g || y || m) {
|
|
6058
6044
|
const v = s.getYAxisId() || i.primaryYAxisId, x = i.yScales.get(v);
|
|
6059
6045
|
let S;
|
|
6060
6046
|
x && (S = { min: x.domain[0], max: x.domain[1] });
|
|
6061
6047
|
const M = s.waterfallCounts || { positive: 0, negative: 0, subtotal: 0, connectors: 0 };
|
|
6062
6048
|
u = {
|
|
6063
6049
|
id: s.getId(),
|
|
6064
|
-
buffer:
|
|
6050
|
+
buffer: g || y || m,
|
|
6065
6051
|
// Use any available buffer as reference
|
|
6066
6052
|
count: 0,
|
|
6067
6053
|
// No main buffer rendering
|
|
@@ -6069,9 +6055,9 @@ function on(i, e) {
|
|
|
6069
6055
|
visible: s.isVisible(),
|
|
6070
6056
|
type: "waterfall",
|
|
6071
6057
|
yBounds: S,
|
|
6072
|
-
wfPositiveBuffer:
|
|
6058
|
+
wfPositiveBuffer: g,
|
|
6073
6059
|
wfPositiveCount: M.positive,
|
|
6074
|
-
wfNegativeBuffer:
|
|
6060
|
+
wfNegativeBuffer: y,
|
|
6075
6061
|
wfNegativeCount: M.negative,
|
|
6076
6062
|
wfSubtotalBuffer: m,
|
|
6077
6063
|
wfSubtotalCount: M.subtotal,
|
|
@@ -6081,21 +6067,21 @@ function on(i, e) {
|
|
|
6081
6067
|
}
|
|
6082
6068
|
}
|
|
6083
6069
|
if (u) {
|
|
6084
|
-
const
|
|
6085
|
-
if (
|
|
6086
|
-
u.errorBuffer =
|
|
6087
|
-
const
|
|
6070
|
+
const g = i.renderer.getBuffer(`${s.getId()}_errors`);
|
|
6071
|
+
if (g) {
|
|
6072
|
+
u.errorBuffer = g;
|
|
6073
|
+
const y = s.getData();
|
|
6088
6074
|
let m = 0;
|
|
6089
|
-
(
|
|
6075
|
+
(y.yError || y.yErrorMinus || y.yErrorPlus) && m++, (y.xError || y.xErrorMinus || y.xErrorPlus) && m++, u.errorCount = s.getPointCount() * m * 2;
|
|
6090
6076
|
}
|
|
6091
6077
|
if (r === "heatmap") {
|
|
6092
|
-
const
|
|
6093
|
-
if (
|
|
6094
|
-
const b =
|
|
6078
|
+
const y = s.getHeatmapData(), m = s.getHeatmapStyle();
|
|
6079
|
+
if (y) {
|
|
6080
|
+
const b = y.xValues.length, v = y.yValues.length;
|
|
6095
6081
|
u.count = (b - 1) * (v - 1) * 6;
|
|
6096
6082
|
let x = 1 / 0, S = -1 / 0;
|
|
6097
|
-
for (let
|
|
6098
|
-
const A =
|
|
6083
|
+
for (let w = 0; w < y.zValues.length; w++) {
|
|
6084
|
+
const A = y.zValues[w];
|
|
6099
6085
|
A < x && (x = A), A > S && (S = A);
|
|
6100
6086
|
}
|
|
6101
6087
|
x === S && (x -= 1, S += 1), u.zBounds = {
|
|
@@ -6108,10 +6094,10 @@ function on(i, e) {
|
|
|
6108
6094
|
}
|
|
6109
6095
|
}
|
|
6110
6096
|
if (r === "candlestick") {
|
|
6111
|
-
const
|
|
6112
|
-
|
|
6097
|
+
const g = i.renderer.getBuffer(`${s.getId()}_bullish`);
|
|
6098
|
+
g && t.push({
|
|
6113
6099
|
id: `${s.getId()}_bullish`,
|
|
6114
|
-
buffer:
|
|
6100
|
+
buffer: g,
|
|
6115
6101
|
count: s.bullishCount || 0,
|
|
6116
6102
|
style: {
|
|
6117
6103
|
...s.getStyle(),
|
|
@@ -6122,10 +6108,10 @@ function on(i, e) {
|
|
|
6122
6108
|
// Using bar renderer (triangles)
|
|
6123
6109
|
yBounds: h
|
|
6124
6110
|
});
|
|
6125
|
-
const
|
|
6126
|
-
|
|
6111
|
+
const y = i.renderer.getBuffer(`${s.getId()}_bearish`);
|
|
6112
|
+
y && t.push({
|
|
6127
6113
|
id: `${s.getId()}_bearish`,
|
|
6128
|
-
buffer:
|
|
6114
|
+
buffer: y,
|
|
6129
6115
|
count: s.bearishCount || 0,
|
|
6130
6116
|
style: {
|
|
6131
6117
|
...s.getStyle(),
|
|
@@ -6149,7 +6135,7 @@ function on(i, e) {
|
|
|
6149
6135
|
return t;
|
|
6150
6136
|
}
|
|
6151
6137
|
function Ye(i, e, t) {
|
|
6152
|
-
var
|
|
6138
|
+
var g, y;
|
|
6153
6139
|
const n = i.container.getBoundingClientRect();
|
|
6154
6140
|
if (n.width === 0 || n.height === 0) {
|
|
6155
6141
|
console.warn(
|
|
@@ -6157,7 +6143,7 @@ function Ye(i, e, t) {
|
|
|
6157
6143
|
);
|
|
6158
6144
|
return;
|
|
6159
6145
|
}
|
|
6160
|
-
i.overlay.clear(), i.overlay.setLatexAPI(i.latexAPI), (
|
|
6146
|
+
i.overlay.clear(), i.overlay.setLatexAPI(i.latexAPI), (g = i.layout.title) != null && g.visible && i.layout.title.text && i.overlay.drawChartTitle(e, i.layout.title);
|
|
6161
6147
|
let s = !1, o = !1, r = !1, a = 0, l = "degrees", c = 5, d = 12;
|
|
6162
6148
|
i.series.forEach((m) => {
|
|
6163
6149
|
const b = m.getType();
|
|
@@ -6198,10 +6184,10 @@ function Ye(i, e, t) {
|
|
|
6198
6184
|
const b = m.getType();
|
|
6199
6185
|
if (b === "gauge") {
|
|
6200
6186
|
const v = m.getGaugeData(), x = m.getGaugeStyle();
|
|
6201
|
-
v && x &&
|
|
6187
|
+
v && x && an(i.overlayCtx, v, x, e);
|
|
6202
6188
|
} else if (b === "sankey") {
|
|
6203
6189
|
const v = m.getSankeyData(), x = m.getSankeyStyle();
|
|
6204
|
-
v && x &&
|
|
6190
|
+
v && x && ln(i.overlayCtx, v, x, e);
|
|
6205
6191
|
}
|
|
6206
6192
|
}), h || i.overlay.drawXAxis(e, i.xScale, i.xAxisOptions, i.layout.xAxisLayout);
|
|
6207
6193
|
const f = [], u = [];
|
|
@@ -6224,7 +6210,7 @@ function Ye(i, e, t) {
|
|
|
6224
6210
|
const b = m.getYAxisId() || i.primaryYAxisId, x = i.yScales.get(b) || t;
|
|
6225
6211
|
i.overlay.drawErrorBars(e, m, i.xScale, x);
|
|
6226
6212
|
}
|
|
6227
|
-
}), i.selectionRect && i.overlay.drawSelectionRect(i.selectionRect), i.selectionManager.render(i.overlayCtx, e), (
|
|
6213
|
+
}), i.selectionRect && i.overlay.drawSelectionRect(i.selectionRect), i.selectionManager.render(i.overlayCtx, e), (y = i.cursorOptions) != null && y.enabled && i.cursorPosition) {
|
|
6228
6214
|
const m = i.cursorOptions.valueDisplayMode ?? "floating";
|
|
6229
6215
|
let b;
|
|
6230
6216
|
m !== "disabled" && (b = i.cursorOptions.formatter ? i.cursorOptions.formatter(
|
|
@@ -6245,7 +6231,7 @@ Y: ${i.pixelToDataY(i.cursorPosition.y).toExponential(2)}`);
|
|
|
6245
6231
|
i.overlay.drawCursor(e, v, i.cursorOptions.lineStyle);
|
|
6246
6232
|
}
|
|
6247
6233
|
}
|
|
6248
|
-
class
|
|
6234
|
+
class cn {
|
|
6249
6235
|
constructor(e) {
|
|
6250
6236
|
p(this, "animationFrameId", null);
|
|
6251
6237
|
p(this, "needsFullRender", !1);
|
|
@@ -6344,7 +6330,7 @@ class rn {
|
|
|
6344
6330
|
if (this.lastRenderTime = o, !this.ctx.pluginManager.notifyBeforeRender(r))
|
|
6345
6331
|
return;
|
|
6346
6332
|
if (e) {
|
|
6347
|
-
const c =
|
|
6333
|
+
const c = hn(s, n);
|
|
6348
6334
|
this.ctx.renderer.render(c, {
|
|
6349
6335
|
bounds: this.ctx.viewBounds,
|
|
6350
6336
|
invertX: !!this.ctx.xAxisOptions.invertAxis,
|
|
@@ -6384,14 +6370,14 @@ class rn {
|
|
|
6384
6370
|
this.frameCount = 0;
|
|
6385
6371
|
}
|
|
6386
6372
|
}
|
|
6387
|
-
class
|
|
6373
|
+
class un {
|
|
6388
6374
|
constructor(e) {
|
|
6389
6375
|
p(this, "container");
|
|
6390
6376
|
p(this, "webglCanvas");
|
|
6391
6377
|
p(this, "overlayCanvas");
|
|
6392
6378
|
p(this, "overlayCtx");
|
|
6393
6379
|
p(this, "series", /* @__PURE__ */ new Map());
|
|
6394
|
-
p(this, "events", new
|
|
6380
|
+
p(this, "events", new nt());
|
|
6395
6381
|
p(this, "viewBounds", {
|
|
6396
6382
|
xMin: -0.5,
|
|
6397
6383
|
xMax: 0.5,
|
|
@@ -6447,14 +6433,14 @@ class an {
|
|
|
6447
6433
|
p(this, "selectionManager");
|
|
6448
6434
|
p(this, "responsiveManager");
|
|
6449
6435
|
this.initialOptions = e, this.container = e.container, this.chartId = e.id ?? `chart_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
|
|
6450
|
-
const t =
|
|
6436
|
+
const t = zi(this.container, e);
|
|
6451
6437
|
if (this.baseTheme = t.theme, this.theme = t.theme, this.colorScheme = e.colorScheme ? Ee(e.colorScheme) : Ie(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({
|
|
6452
6438
|
enabled: this.layout.crosshair.enabled !== !1,
|
|
6453
6439
|
crosshair: !0,
|
|
6454
6440
|
snap: this.layout.crosshair.snapToData,
|
|
6455
6441
|
valueDisplayMode: this.layout.crosshair.valueDisplayMode,
|
|
6456
6442
|
cornerPosition: this.layout.crosshair.cornerPosition
|
|
6457
|
-
}), this.pluginManager = new
|
|
6443
|
+
}), this.pluginManager = new Hi({
|
|
6458
6444
|
chart: this,
|
|
6459
6445
|
container: this.container,
|
|
6460
6446
|
theme: this.theme,
|
|
@@ -6496,12 +6482,12 @@ class an {
|
|
|
6496
6482
|
var r;
|
|
6497
6483
|
return (r = this.pluginManager) == null ? void 0 : r.get(o);
|
|
6498
6484
|
}
|
|
6499
|
-
}), this.pluginBridge = new
|
|
6485
|
+
}), this.pluginBridge = new Ki(this.pluginManager), e.loading !== !1) {
|
|
6500
6486
|
const o = typeof e.loading == "object" ? e.loading : {
|
|
6501
6487
|
message: "Loading SciPlot...",
|
|
6502
6488
|
overlayOpacity: 0.1
|
|
6503
6489
|
};
|
|
6504
|
-
this.use(
|
|
6490
|
+
this.use(st({
|
|
6505
6491
|
...o,
|
|
6506
6492
|
autoShow: !0
|
|
6507
6493
|
// Ensure it shows immediately
|
|
@@ -6513,7 +6499,7 @@ class an {
|
|
|
6513
6499
|
`[SciPlot] 'renderer: "webgpu"' requested but WebGPU renderer is experimental and not yet implemented. Falling back to WebGL. WebGPU supported: ${o}`
|
|
6514
6500
|
);
|
|
6515
6501
|
}
|
|
6516
|
-
this.renderer = new
|
|
6502
|
+
this.renderer = new Bt(this.webglCanvas), this.renderer.setDPR(this.dpr), this.overlay = new Ot(this.overlayCtx, this.theme), this.selectionManager = new _t({
|
|
6517
6503
|
getSeries: () => this.series,
|
|
6518
6504
|
getPlotArea: () => this.getPlotArea(),
|
|
6519
6505
|
getXScale: () => this.xScale,
|
|
@@ -6524,15 +6510,15 @@ class an {
|
|
|
6524
6510
|
requestRender: () => this.requestRender()
|
|
6525
6511
|
}), this.events.on("selectionChange", (o) => {
|
|
6526
6512
|
this.pluginManager.notifySelectionChange(o.selected);
|
|
6527
|
-
}), this.animationEngine = new
|
|
6513
|
+
}), this.animationEngine = new qe(), this.animationConfig = typeof e.animations == "boolean" ? { ...N, enabled: e.animations } : Fe(e.animations);
|
|
6528
6514
|
const s = typeof e.responsive == "boolean" ? { enabled: e.responsive } : e.responsive;
|
|
6529
|
-
this.responsiveManager = new
|
|
6515
|
+
this.responsiveManager = new Vt(
|
|
6530
6516
|
{
|
|
6531
6517
|
container: this.container,
|
|
6532
6518
|
onStateChange: (o) => this.handleResponsiveChange(o)
|
|
6533
6519
|
},
|
|
6534
6520
|
s
|
|
6535
|
-
), this.axisManager = new
|
|
6521
|
+
), this.axisManager = new en({
|
|
6536
6522
|
xAxisOptions: this.xAxisOptions,
|
|
6537
6523
|
xScale: this.xScale,
|
|
6538
6524
|
yAxisOptionsMap: this.yAxisOptionsMap,
|
|
@@ -6540,7 +6526,7 @@ class an {
|
|
|
6540
6526
|
primaryYAxisId: this.primaryYAxisId,
|
|
6541
6527
|
series: this.series,
|
|
6542
6528
|
requestRender: () => this.requestRender()
|
|
6543
|
-
}), this.stateManager = new
|
|
6529
|
+
}), this.stateManager = new rn({
|
|
6544
6530
|
viewBounds: this.viewBounds,
|
|
6545
6531
|
xAxisOptions: this.xAxisOptions,
|
|
6546
6532
|
xScale: this.xScale,
|
|
@@ -6561,7 +6547,7 @@ class an {
|
|
|
6561
6547
|
removeSeries: (o) => this.removeSeries(o),
|
|
6562
6548
|
addSeries: (o) => this.addSeries(o),
|
|
6563
6549
|
requestRender: () => this.requestRender()
|
|
6564
|
-
}), this.renderLoop = new
|
|
6550
|
+
}), this.renderLoop = new cn({
|
|
6565
6551
|
webglCanvas: this.webglCanvas,
|
|
6566
6552
|
overlayCanvas: this.overlayCanvas,
|
|
6567
6553
|
overlayCtx: this.overlayCtx,
|
|
@@ -6586,14 +6572,14 @@ class an {
|
|
|
6586
6572
|
pluginManager: this.pluginManager,
|
|
6587
6573
|
getLayout: () => this.layout,
|
|
6588
6574
|
getLatex: () => this.latex,
|
|
6589
|
-
updateSeriesBuffer: (o) =>
|
|
6575
|
+
updateSeriesBuffer: (o) => pe(this.getSeriesContext(), o),
|
|
6590
6576
|
getPlotArea: () => this.getPlotArea(),
|
|
6591
6577
|
pixelToDataX: (o) => this.pixelToDataX(o),
|
|
6592
6578
|
pixelToDataY: (o, r) => this.pixelToDataY(o, r),
|
|
6593
6579
|
get yScale() {
|
|
6594
6580
|
return this.yScales.get(this.primaryYAxisId) || this.yScales.values().next().value;
|
|
6595
6581
|
}
|
|
6596
|
-
}), this.interaction = new
|
|
6582
|
+
}), this.interaction = new $t(
|
|
6597
6583
|
this.container,
|
|
6598
6584
|
{
|
|
6599
6585
|
onZoom: (o, r) => {
|
|
@@ -6642,14 +6628,14 @@ class an {
|
|
|
6642
6628
|
}, h = this.selectionManager.hitTestRegion(d);
|
|
6643
6629
|
if (h.length > 0) {
|
|
6644
6630
|
const f = /* @__PURE__ */ new Map();
|
|
6645
|
-
h.forEach((
|
|
6646
|
-
let
|
|
6647
|
-
|
|
6631
|
+
h.forEach((g) => {
|
|
6632
|
+
let y = f.get(g.seriesId);
|
|
6633
|
+
y || (y = [], f.set(g.seriesId, y)), y.push(g.index);
|
|
6648
6634
|
});
|
|
6649
6635
|
const u = Array.from(f.entries()).map(
|
|
6650
|
-
([
|
|
6651
|
-
seriesId:
|
|
6652
|
-
indices:
|
|
6636
|
+
([g, y]) => ({
|
|
6637
|
+
seriesId: g,
|
|
6638
|
+
indices: y
|
|
6653
6639
|
})
|
|
6654
6640
|
);
|
|
6655
6641
|
this.selectionManager.selectPoints(
|
|
@@ -6679,7 +6665,7 @@ class an {
|
|
|
6679
6665
|
},
|
|
6680
6666
|
() => this.getPlotArea(),
|
|
6681
6667
|
(o) => this.getInteractedBounds(o),
|
|
6682
|
-
() =>
|
|
6668
|
+
() => $i(this.yAxisOptionsMap)
|
|
6683
6669
|
), new ResizeObserver(() => {
|
|
6684
6670
|
!this.isDestroyed && !this.resizeSuspended && this.resize();
|
|
6685
6671
|
}).observe(this.container), this.initControls(), this.initLegend(e);
|
|
@@ -6779,7 +6765,7 @@ class an {
|
|
|
6779
6765
|
* Mark this chart's initialization as complete in the queue
|
|
6780
6766
|
*/
|
|
6781
6767
|
async completeInit() {
|
|
6782
|
-
this.initQueueId && (await this.animationEngine.waitForIdle(), await new Promise((e) => setTimeout(e, 60)), this.initQueueId && (
|
|
6768
|
+
this.initQueueId && (await this.animationEngine.waitForIdle(), await new Promise((e) => setTimeout(e, 60)), this.initQueueId && (Qe(this.initQueueId), this.initQueueId = null));
|
|
6783
6769
|
}
|
|
6784
6770
|
executeOrQueue(e, t) {
|
|
6785
6771
|
this.renderLoop.isInitStarted() ? t() : this.commandQueue.push({ fn: t, name: e });
|
|
@@ -6791,7 +6777,7 @@ class an {
|
|
|
6791
6777
|
this.initQueueId = e;
|
|
6792
6778
|
}
|
|
6793
6779
|
initControls() {
|
|
6794
|
-
this.controls =
|
|
6780
|
+
this.controls = Gi({
|
|
6795
6781
|
container: this.container,
|
|
6796
6782
|
theme: this.theme,
|
|
6797
6783
|
showControls: this.showControls,
|
|
@@ -6827,7 +6813,7 @@ class an {
|
|
|
6827
6813
|
initLegend(e) {
|
|
6828
6814
|
var n;
|
|
6829
6815
|
const t = (n = e.layout) == null ? void 0 : n.legend;
|
|
6830
|
-
this.legend =
|
|
6816
|
+
this.legend = ji(
|
|
6831
6817
|
{
|
|
6832
6818
|
container: this.container,
|
|
6833
6819
|
theme: this.theme,
|
|
@@ -6864,7 +6850,7 @@ class an {
|
|
|
6864
6850
|
if (this.hoveredSeriesId = s.getId(), o) {
|
|
6865
6851
|
const l = s.getStyle();
|
|
6866
6852
|
this.originalSeriesStyles.set(s.getId(), { ...l });
|
|
6867
|
-
const c = ((r = this.colorScheme) == null ? void 0 : r.highlightColor) ||
|
|
6853
|
+
const c = ((r = this.colorScheme) == null ? void 0 : r.highlightColor) || ft(l.color || "#ff0055", this.theme.isDark);
|
|
6868
6854
|
s.setStyle({
|
|
6869
6855
|
color: c
|
|
6870
6856
|
}), (a = this.legend) == null || a.updateSeriesStyle(s);
|
|
@@ -6888,7 +6874,7 @@ class an {
|
|
|
6888
6874
|
);
|
|
6889
6875
|
}
|
|
6890
6876
|
setTheme(e) {
|
|
6891
|
-
this.baseTheme = typeof e == "string" ?
|
|
6877
|
+
this.baseTheme = typeof e == "string" ? He(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 = Ie(this.theme.isDark)), this.requestRender();
|
|
6892
6878
|
}
|
|
6893
6879
|
/**
|
|
6894
6880
|
* Set the color scheme for multi-series charts
|
|
@@ -6904,7 +6890,7 @@ class an {
|
|
|
6904
6890
|
return this.colorScheme;
|
|
6905
6891
|
}
|
|
6906
6892
|
getPlotArea() {
|
|
6907
|
-
return
|
|
6893
|
+
return Oi(this.container, this.yAxisOptionsMap, this.layout);
|
|
6908
6894
|
}
|
|
6909
6895
|
getInteractedBounds(e) {
|
|
6910
6896
|
if (e) {
|
|
@@ -6919,7 +6905,7 @@ class an {
|
|
|
6919
6905
|
return this.viewBounds;
|
|
6920
6906
|
}
|
|
6921
6907
|
exportImage(e = "png") {
|
|
6922
|
-
return
|
|
6908
|
+
return Xt(
|
|
6923
6909
|
this.webglCanvas,
|
|
6924
6910
|
this.overlayCanvas,
|
|
6925
6911
|
this.backgroundColor,
|
|
@@ -6929,6 +6915,24 @@ class an {
|
|
|
6929
6915
|
e
|
|
6930
6916
|
);
|
|
6931
6917
|
}
|
|
6918
|
+
exportSVG() {
|
|
6919
|
+
const e = this.container.getBoundingClientRect();
|
|
6920
|
+
return Ht(
|
|
6921
|
+
this.getAllSeries(),
|
|
6922
|
+
this.viewBounds,
|
|
6923
|
+
this.getPlotArea(),
|
|
6924
|
+
this.xScale,
|
|
6925
|
+
this.yScales,
|
|
6926
|
+
this.theme,
|
|
6927
|
+
e.width || this.container.clientWidth,
|
|
6928
|
+
e.height || this.container.clientHeight,
|
|
6929
|
+
{
|
|
6930
|
+
xAxis: this.xAxisOptions,
|
|
6931
|
+
yAxis: this.yAxisOptionsMap.get(this.primaryYAxisId),
|
|
6932
|
+
primaryYAxisId: this.primaryYAxisId
|
|
6933
|
+
}
|
|
6934
|
+
);
|
|
6935
|
+
}
|
|
6932
6936
|
// Series Management (delegates to ChartSeries)
|
|
6933
6937
|
getSeriesContext() {
|
|
6934
6938
|
return {
|
|
@@ -6949,7 +6953,7 @@ class an {
|
|
|
6949
6953
|
};
|
|
6950
6954
|
}
|
|
6951
6955
|
addSeries(e) {
|
|
6952
|
-
|
|
6956
|
+
Ti(this.getSeriesContext(), e);
|
|
6953
6957
|
const t = this.series.get(e.id);
|
|
6954
6958
|
t && this.pluginManager.notifySeriesAdd({ series: t, changeType: "add" });
|
|
6955
6959
|
}
|
|
@@ -6961,11 +6965,11 @@ class an {
|
|
|
6961
6965
|
}
|
|
6962
6966
|
removeSeries(e) {
|
|
6963
6967
|
const t = this.series.get(e);
|
|
6964
|
-
|
|
6968
|
+
Ii(this.getSeriesContext(), e), t && this.pluginManager.notifySeriesRemove({ series: t, changeType: "remove" });
|
|
6965
6969
|
}
|
|
6966
6970
|
updateSeries(e, t) {
|
|
6967
6971
|
var s, o;
|
|
6968
|
-
|
|
6972
|
+
Ri(this.getSeriesContext(), e, t), this.recalculateTools();
|
|
6969
6973
|
const n = this.series.get(e);
|
|
6970
6974
|
n && this.pluginManager.notifyDataUpdate({
|
|
6971
6975
|
seriesId: e,
|
|
@@ -6975,7 +6979,7 @@ class an {
|
|
|
6975
6979
|
});
|
|
6976
6980
|
}
|
|
6977
6981
|
appendData(e, t, n) {
|
|
6978
|
-
|
|
6982
|
+
Fi(this.getSeriesContext(), e, t, n), this.recalculateTools();
|
|
6979
6983
|
const s = this.series.get(e);
|
|
6980
6984
|
s && this.pluginManager.notifyDataUpdate({
|
|
6981
6985
|
seriesId: e,
|
|
@@ -6988,7 +6992,7 @@ class an {
|
|
|
6988
6992
|
this.autoScroll = e;
|
|
6989
6993
|
}
|
|
6990
6994
|
setMaxPoints(e, t) {
|
|
6991
|
-
|
|
6995
|
+
Di(this.getSeriesContext(), e, t);
|
|
6992
6996
|
}
|
|
6993
6997
|
/**
|
|
6994
6998
|
* Add a line of best fit to a series
|
|
@@ -7030,7 +7034,7 @@ class an {
|
|
|
7030
7034
|
zoom(e) {
|
|
7031
7035
|
const t = { ...this.viewBounds };
|
|
7032
7036
|
if (this.animationConfig.enabled && e.animate !== !1) {
|
|
7033
|
-
const n =
|
|
7037
|
+
const n = si(
|
|
7034
7038
|
this.getAnimatedNavContext(),
|
|
7035
7039
|
e
|
|
7036
7040
|
);
|
|
@@ -7038,7 +7042,7 @@ class an {
|
|
|
7038
7042
|
s.message !== "Animation cancelled" && console.error("[SciPlot] Animation error:", s);
|
|
7039
7043
|
});
|
|
7040
7044
|
} else
|
|
7041
|
-
|
|
7045
|
+
Qt(this.getNavContext(), e);
|
|
7042
7046
|
this.pluginManager.notifyViewChange({
|
|
7043
7047
|
previous: t,
|
|
7044
7048
|
current: { ...this.viewBounds },
|
|
@@ -7048,7 +7052,7 @@ class an {
|
|
|
7048
7052
|
}
|
|
7049
7053
|
pan(e, t, n) {
|
|
7050
7054
|
const s = { ...this.viewBounds };
|
|
7051
|
-
|
|
7055
|
+
Jt(this.getNavContext(), e, t, n), this.pluginManager.notifyViewChange({
|
|
7052
7056
|
previous: s,
|
|
7053
7057
|
current: { ...this.viewBounds },
|
|
7054
7058
|
trigger: "pan",
|
|
@@ -7061,7 +7065,7 @@ class an {
|
|
|
7061
7065
|
fit(e) {
|
|
7062
7066
|
this.executeOrQueue("fit", () => {
|
|
7063
7067
|
const t = { ...this.viewBounds }, n = e == null ? void 0 : e.padding;
|
|
7064
|
-
|
|
7068
|
+
ei(this.getNavContext(), {
|
|
7065
7069
|
x: e == null ? void 0 : e.x,
|
|
7066
7070
|
y: e == null ? void 0 : e.y,
|
|
7067
7071
|
padding: n
|
|
@@ -7083,7 +7087,7 @@ class an {
|
|
|
7083
7087
|
this.executeOrQueue("autoScale", () => {
|
|
7084
7088
|
const t = { ...this.viewBounds };
|
|
7085
7089
|
if (this.animationConfig.enabled && e) {
|
|
7086
|
-
const n =
|
|
7090
|
+
const n = oi(
|
|
7087
7091
|
this.getAnimatedNavContext(),
|
|
7088
7092
|
!0
|
|
7089
7093
|
);
|
|
@@ -7091,7 +7095,7 @@ class an {
|
|
|
7091
7095
|
s.message !== "Animation cancelled" && console.error("[SciPlot] Animation error:", s);
|
|
7092
7096
|
});
|
|
7093
7097
|
} else
|
|
7094
|
-
|
|
7098
|
+
Kt(this.getNavContext());
|
|
7095
7099
|
this.pluginManager.notifyViewChange({
|
|
7096
7100
|
previous: t,
|
|
7097
7101
|
current: { ...this.viewBounds },
|
|
@@ -7105,14 +7109,14 @@ class an {
|
|
|
7105
7109
|
* Used during streaming to prevent X-axis shifting
|
|
7106
7110
|
*/
|
|
7107
7111
|
autoScaleYOnly() {
|
|
7108
|
-
|
|
7112
|
+
ti(this.getNavContext()), this.requestRender();
|
|
7109
7113
|
}
|
|
7110
7114
|
/**
|
|
7111
7115
|
* Animate view bounds to specific target
|
|
7112
7116
|
*/
|
|
7113
7117
|
animateTo(e) {
|
|
7114
7118
|
var n, s, o, r;
|
|
7115
|
-
const t =
|
|
7119
|
+
const t = ri(
|
|
7116
7120
|
this.getAnimatedNavContext(),
|
|
7117
7121
|
{
|
|
7118
7122
|
xMin: (n = e.xRange) == null ? void 0 : n[0],
|
|
@@ -7139,7 +7143,7 @@ class an {
|
|
|
7139
7143
|
* Set animation configuration
|
|
7140
7144
|
*/
|
|
7141
7145
|
setAnimationConfig(e) {
|
|
7142
|
-
this.animationConfig =
|
|
7146
|
+
this.animationConfig = Fe({
|
|
7143
7147
|
...this.animationConfig,
|
|
7144
7148
|
...e
|
|
7145
7149
|
});
|
|
@@ -7152,7 +7156,7 @@ class an {
|
|
|
7152
7156
|
}
|
|
7153
7157
|
handleBoxZoom(e) {
|
|
7154
7158
|
const t = e === null;
|
|
7155
|
-
this.selectionRect =
|
|
7159
|
+
this.selectionRect = ii(
|
|
7156
7160
|
this.getNavContext(),
|
|
7157
7161
|
e,
|
|
7158
7162
|
this.selectionRect,
|
|
@@ -7211,10 +7215,10 @@ class an {
|
|
|
7211
7215
|
}
|
|
7212
7216
|
// Export
|
|
7213
7217
|
exportCSV(e) {
|
|
7214
|
-
return
|
|
7218
|
+
return Wt(this.getAllSeries(), e);
|
|
7215
7219
|
}
|
|
7216
7220
|
exportJSON(e) {
|
|
7217
|
-
return
|
|
7221
|
+
return Nt(this.getAllSeries(), this.viewBounds, e);
|
|
7218
7222
|
}
|
|
7219
7223
|
// ============================================
|
|
7220
7224
|
// Axis Management
|
|
@@ -7256,7 +7260,7 @@ class an {
|
|
|
7256
7260
|
this.axisManager.updateXAxis(e), this.requestRender();
|
|
7257
7261
|
}
|
|
7258
7262
|
updateLayout(e) {
|
|
7259
|
-
this.layout =
|
|
7263
|
+
this.layout = Ze({
|
|
7260
7264
|
...this.layout,
|
|
7261
7265
|
...e
|
|
7262
7266
|
}), this.requestRender();
|
|
@@ -7479,7 +7483,7 @@ class an {
|
|
|
7479
7483
|
resize() {
|
|
7480
7484
|
if (this.resizeSuspended) return;
|
|
7481
7485
|
const e = this.initialOptions.devicePixelRatio ?? window.devicePixelRatio;
|
|
7482
|
-
Math.abs(e - this.dpr) > 1e-3 && (this.dpr = e, this.renderer.setDPR(this.dpr)),
|
|
7486
|
+
Math.abs(e - this.dpr) > 1e-3 && (this.dpr = e, this.renderer.setDPR(this.dpr)), Yi(
|
|
7483
7487
|
this.container,
|
|
7484
7488
|
this.webglCanvas,
|
|
7485
7489
|
this.overlayCanvas,
|
|
@@ -7537,71 +7541,60 @@ class an {
|
|
|
7537
7541
|
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();
|
|
7538
7542
|
}
|
|
7539
7543
|
}
|
|
7540
|
-
function
|
|
7541
|
-
const e = new
|
|
7542
|
-
return
|
|
7544
|
+
function Bn(i) {
|
|
7545
|
+
const e = new un(i);
|
|
7546
|
+
return Qi().then((t) => {
|
|
7543
7547
|
if (e.setInitQueueId(t), e.isDestroyed) {
|
|
7544
|
-
|
|
7548
|
+
Qe(t);
|
|
7545
7549
|
return;
|
|
7546
7550
|
}
|
|
7547
7551
|
e.startInit(), e.completeInit();
|
|
7548
7552
|
}), e;
|
|
7549
7553
|
}
|
|
7550
7554
|
export {
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
|
|
7564
|
-
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
Zt as e,
|
|
7585
|
-
fn as f,
|
|
7586
|
-
An as g,
|
|
7587
|
-
Pn as h,
|
|
7588
|
-
ee as i,
|
|
7589
|
-
pn as j,
|
|
7590
|
-
_e as k,
|
|
7591
|
-
gn as l,
|
|
7592
|
-
qe as m,
|
|
7593
|
-
we as n,
|
|
7594
|
-
Rt as o,
|
|
7555
|
+
qe as A,
|
|
7556
|
+
on as B,
|
|
7557
|
+
Ji as C,
|
|
7558
|
+
N as D,
|
|
7559
|
+
Lt as E,
|
|
7560
|
+
kn as F,
|
|
7561
|
+
Pn as G,
|
|
7562
|
+
xn as H,
|
|
7563
|
+
bn as I,
|
|
7564
|
+
Xi as J,
|
|
7565
|
+
re as K,
|
|
7566
|
+
ee as L,
|
|
7567
|
+
Ft as M,
|
|
7568
|
+
Bt as N,
|
|
7569
|
+
Ot as O,
|
|
7570
|
+
Hi as P,
|
|
7571
|
+
Sn as Q,
|
|
7572
|
+
yi as S,
|
|
7573
|
+
Mn as a,
|
|
7574
|
+
je as b,
|
|
7575
|
+
Bn as c,
|
|
7576
|
+
te as d,
|
|
7577
|
+
ni as e,
|
|
7578
|
+
vn as f,
|
|
7579
|
+
pn as g,
|
|
7580
|
+
Ce as h,
|
|
7581
|
+
We as i,
|
|
7582
|
+
Dt as j,
|
|
7583
|
+
zt as k,
|
|
7584
|
+
mn as l,
|
|
7585
|
+
Fe as m,
|
|
7586
|
+
He as n,
|
|
7587
|
+
O as o,
|
|
7595
7588
|
_ as p,
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7589
|
+
wn as q,
|
|
7590
|
+
An as r,
|
|
7591
|
+
Ze as s,
|
|
7592
|
+
Je as t,
|
|
7593
|
+
ze as u,
|
|
7594
|
+
Oe as v,
|
|
7595
|
+
Cn as w,
|
|
7596
|
+
tn as x,
|
|
7597
|
+
nn as y,
|
|
7598
|
+
sn as z
|
|
7606
7599
|
};
|
|
7607
|
-
//# sourceMappingURL=
|
|
7600
|
+
//# sourceMappingURL=ChartCore-BimVvUEg.js.map
|