@wick-charts/react 0.3.4 → 0.3.5
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 +3 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +14 -0
- package/dist/index.js +1071 -1071
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useContext as
|
|
2
|
-
import { jsx as A, jsxs as X, Fragment as
|
|
3
|
-
var
|
|
1
|
+
import { useContext as an, createContext as Zn, useRef as G, useLayoutEffect as nt, useEffect as ct, useMemo as Jt, useSyncExternalStore as fi, useState as Ct, Children as xn, isValidElement as wn, Fragment as Os } from "react";
|
|
2
|
+
import { jsx as A, jsxs as X, Fragment as Ye } from "react/jsx-runtime";
|
|
3
|
+
var Hs = Object.defineProperty, ts = (i) => {
|
|
4
4
|
throw TypeError(i);
|
|
5
|
-
},
|
|
5
|
+
}, $s = (i, t, e) => t in i ? Hs(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, T = (i, t, e) => $s(i, typeof t != "symbol" ? t + "" : t, e), on = (i, t, e) => t.has(i) || ts("Cannot " + e), o = (i, t, e) => (on(i, t, "read from private field"), e ? e.call(i) : t.get(i)), L = (i, t, e) => t.has(i) ? ts("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), k = (i, t, e, n) => (on(i, t, "write to private field"), t.set(i, e), e), B = (i, t, e) => (on(i, t, "access private method"), e), qi = (i, t, e, n) => ({
|
|
6
6
|
set _(s) {
|
|
7
7
|
k(i, t, s);
|
|
8
8
|
},
|
|
@@ -10,10 +10,10 @@ var Os = Object.defineProperty, Zn = (i) => {
|
|
|
10
10
|
return o(i, t, n);
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
const
|
|
14
|
-
class
|
|
13
|
+
const xe = (i) => 1 - (1 - i) ** 3;
|
|
14
|
+
class Ee {
|
|
15
15
|
constructor(t) {
|
|
16
|
-
T(this, "_current"), T(this, "_from"), T(this, "_to"), T(this, "_startTime", 0), T(this, "_activeDuration"), T(this, "_defaultDuration"), T(this, "_easing"), T(this, "_lerp"), T(this, "_equals"), T(this, "_animating", !1), this._current = t.initial, this._from = t.initial, this._to = t.initial, this._defaultDuration = t.duration, this._activeDuration = t.duration, this._easing = t.easing ??
|
|
16
|
+
T(this, "_current"), T(this, "_from"), T(this, "_to"), T(this, "_startTime", 0), T(this, "_activeDuration"), T(this, "_defaultDuration"), T(this, "_easing"), T(this, "_lerp"), T(this, "_equals"), T(this, "_animating", !1), this._current = t.initial, this._from = t.initial, this._to = t.initial, this._defaultDuration = t.duration, this._activeDuration = t.duration, this._easing = t.easing ?? xe, this._lerp = t.lerp, this._equals = t.equals ?? Object.is;
|
|
17
17
|
}
|
|
18
18
|
get current() {
|
|
19
19
|
return this._current;
|
|
@@ -68,14 +68,14 @@ class Ye {
|
|
|
68
68
|
return this._current = this._lerp(this._from, this._to, this._easing(n)), !0;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const Sn = 250, xi = {
|
|
72
72
|
/** Streaming data tick: new point appended, viewport + Y range + last-bar
|
|
73
73
|
* tracker all retarget with this duration so they land in lockstep. */
|
|
74
|
-
streamTick:
|
|
74
|
+
streamTick: Sn,
|
|
75
75
|
/** Explicit fit-to-data / batch reflow. */
|
|
76
|
-
fit:
|
|
77
|
-
},
|
|
78
|
-
class
|
|
76
|
+
fit: Sn
|
|
77
|
+
}, Di = 250, we = Di, ln = Di, es = 600, is = Di, Ns = 0, Ji = Di, Mn = 100;
|
|
78
|
+
class gi {
|
|
79
79
|
constructor() {
|
|
80
80
|
T(this, "listeners", /* @__PURE__ */ new Map());
|
|
81
81
|
}
|
|
@@ -95,7 +95,7 @@ class fi {
|
|
|
95
95
|
this.listeners.clear();
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function kn(i, t) {
|
|
99
99
|
const e = /* @__PURE__ */ new Map();
|
|
100
100
|
return new Proxy(i, {
|
|
101
101
|
get(n, s) {
|
|
@@ -111,17 +111,17 @@ function Mn(i, t) {
|
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Cn(i, t, e) {
|
|
115
115
|
const n = document.createElement("canvas");
|
|
116
116
|
return n.style.position = "absolute", n.style.inset = "0", n.style.width = "100%", n.style.height = "100%", n.style.display = "block", n.style.zIndex = String(t), i.appendChild(n), n;
|
|
117
117
|
}
|
|
118
|
-
class
|
|
118
|
+
class Xs extends gi {
|
|
119
119
|
constructor(t, e) {
|
|
120
|
-
super(), T(this, "mainCanvas"), T(this, "mainCtx"), T(this, "overlayCanvas"), T(this, "overlayCtx"), T(this, "resizeObserver"), T(this, "_size"), T(this, "supportsDevicePixelContentBox", !1), this.mainCanvas =
|
|
120
|
+
super(), T(this, "mainCanvas"), T(this, "mainCtx"), T(this, "overlayCanvas"), T(this, "overlayCtx"), T(this, "resizeObserver"), T(this, "_size"), T(this, "supportsDevicePixelContentBox", !1), this.mainCanvas = Cn(t, 0), this.overlayCanvas = Cn(t, 1);
|
|
121
121
|
const n = this.mainCanvas.getContext("2d", { alpha: !0 }), s = this.overlayCanvas.getContext("2d", { alpha: !0 });
|
|
122
122
|
if (!n || !s)
|
|
123
123
|
throw new Error("CanvasManager: failed to acquire 2D rendering context");
|
|
124
|
-
this.mainCtx = e ?
|
|
124
|
+
this.mainCtx = e ? kn(n, e.drawCallsMain) : n, this.overlayCtx = e ? kn(s, e.drawCallsOverlay) : s;
|
|
125
125
|
const r = window.devicePixelRatio || 1;
|
|
126
126
|
this._size = {
|
|
127
127
|
media: { width: 0, height: 0 },
|
|
@@ -208,27 +208,27 @@ class Ns extends fi {
|
|
|
208
208
|
this.resizeObserver.disconnect(), this.mainCanvas.remove(), this.overlayCanvas.remove(), this.removeAllListeners();
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function Us(i, t, e, n) {
|
|
212
212
|
const { context: s, bitmapSize: r, horizontalPixelRatio: a } = i;
|
|
213
213
|
s.strokeStyle = n.crosshair.color, s.lineWidth = 1, s.setLineDash([4 * a, 4 * a]);
|
|
214
214
|
const l = Math.round(t) + 0.5, h = Math.round(e) + 0.5;
|
|
215
215
|
s.beginPath(), s.moveTo(l, 0), s.lineTo(l, r.height), s.moveTo(0, h), s.lineTo(r.width, h), s.stroke(), s.setLineDash([]);
|
|
216
216
|
}
|
|
217
|
-
const
|
|
218
|
-
function
|
|
217
|
+
const Gs = 3, js = 8, Tn = 900, Ks = 24, qs = 11, Js = 10, Qs = 18;
|
|
218
|
+
function Zs(i) {
|
|
219
219
|
const { state: t } = i;
|
|
220
220
|
if (t === "idle" || t === "has-more") return;
|
|
221
221
|
const e = i.timeScale.timeToX(i.boundaryTime);
|
|
222
222
|
if (Number.isFinite(e)) {
|
|
223
223
|
if (t === "loading") {
|
|
224
|
-
|
|
224
|
+
tr(i, e);
|
|
225
225
|
return;
|
|
226
226
|
}
|
|
227
|
-
t === "no-data" &&
|
|
227
|
+
t === "no-data" && er(i, e);
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
const { context: a, horizontalPixelRatio: l, verticalPixelRatio: h } = i, d =
|
|
230
|
+
function tr({ scope: i, theme: t, chartMediaHeight: e, side: n, now: s }, r) {
|
|
231
|
+
const { context: a, horizontalPixelRatio: l, verticalPixelRatio: h } = i, d = Gs * l, c = js * l, u = Ks * l, f = r * l, m = n === "right" ? f + u : f - u, g = e / 2 * h, p = s % Tn / Tn, v = Math.floor(p * 3), w = ns(t.axis.textColor ?? "#787b86", 0.3), x = t.axis.textColor ?? "#787b86";
|
|
232
232
|
a.save();
|
|
233
233
|
for (let y = 0; y < 3; y++) {
|
|
234
234
|
const M = (y - 1) * c, S = m + M;
|
|
@@ -236,19 +236,19 @@ function Zs({ scope: i, theme: t, chartMediaHeight: e, side: n, now: s }, r) {
|
|
|
236
236
|
}
|
|
237
237
|
a.restore();
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function er({ scope: i, theme: t, chartMediaHeight: e, side: n }, s) {
|
|
240
240
|
const { context: r, horizontalPixelRatio: a, verticalPixelRatio: l } = i, h = Math.round(s * a) + 0.5;
|
|
241
|
-
r.save(), r.strokeStyle =
|
|
242
|
-
const d =
|
|
243
|
-
r.fillStyle = t.axis.textColor ?? "#787b86", r.font = `${
|
|
241
|
+
r.save(), r.strokeStyle = ns(t.axis.textColor ?? "#787b86", 0.6), r.lineWidth = 1, r.setLineDash([4 * a, 4 * a]), r.beginPath(), r.moveTo(h, 0), r.lineTo(h, e * l), r.stroke(), r.setLineDash([]);
|
|
242
|
+
const d = Js * a, c = n === "right" ? h - d : h + d, u = Qs * l;
|
|
243
|
+
r.fillStyle = t.axis.textColor ?? "#787b86", r.font = `${qs * a}px ${t.typography.fontFamily}`, r.textAlign = n === "right" ? "right" : "left", r.textBaseline = "top", r.fillText("No more data", c, u), r.restore();
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function ns(i, t) {
|
|
246
246
|
const e = /^#([0-9a-f]{6})$/i.exec(i.trim());
|
|
247
247
|
if (!e) return i;
|
|
248
248
|
const n = parseInt(e[1].slice(0, 2), 16), s = parseInt(e[1].slice(2, 4), 16), r = parseInt(e[1].slice(4, 6), 16);
|
|
249
249
|
return `rgba(${n}, ${s}, ${r}, ${t})`;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function ir(i, t, e, n, s) {
|
|
252
252
|
const { context: r, bitmapSize: a, horizontalPixelRatio: l, verticalPixelRatio: h } = i;
|
|
253
253
|
r.strokeStyle = n.grid.color, r.lineWidth = 1, n.grid.style === "dashed" ? r.setLineDash([4 * l, 4 * l]) : n.grid.style === "dotted" && r.setLineDash([1 * l, 3 * l]);
|
|
254
254
|
const d = e.niceTickValues();
|
|
@@ -266,20 +266,20 @@ function er(i, t, e, n, s) {
|
|
|
266
266
|
}
|
|
267
267
|
r.stroke(), r.setLineDash([]);
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function Ve(i, t, e) {
|
|
270
270
|
return Math.max(t, Math.min(e, i));
|
|
271
271
|
}
|
|
272
272
|
function bt(i, t, e) {
|
|
273
273
|
return i + (t - i) * e;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function Rn(i, t, e, n) {
|
|
276
276
|
const s = Math.exp(-e * n);
|
|
277
277
|
return t + (i - t) * s;
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function ss(i) {
|
|
280
280
|
return 1 - (1 - i) ** 3;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Hi(i, t, e) {
|
|
283
283
|
let n = 0, s = i.length - 1;
|
|
284
284
|
for (; n <= s; ) {
|
|
285
285
|
const r = n + s >>> 1, a = e(i[r]);
|
|
@@ -289,7 +289,7 @@ function Oi(i, t, e) {
|
|
|
289
289
|
}
|
|
290
290
|
return n;
|
|
291
291
|
}
|
|
292
|
-
class
|
|
292
|
+
class rs extends gi {
|
|
293
293
|
constructor() {
|
|
294
294
|
super(...arguments), T(this, "data", []), T(this, "_visible", !0), T(this, "cachedRange", null), T(this, "cachedResult", []);
|
|
295
295
|
}
|
|
@@ -324,7 +324,7 @@ class ss extends fi {
|
|
|
324
324
|
getVisibleData(t, e) {
|
|
325
325
|
if (this.data.length === 0) return [];
|
|
326
326
|
if (this.cachedRange && this.cachedRange.from === t && this.cachedRange.to === e) return this.cachedResult;
|
|
327
|
-
const n = Math.max(0,
|
|
327
|
+
const n = Math.max(0, Hi(this.data, t, (r) => r.time) - 1), s = Math.min(this.data.length, Hi(this.data, e, (r) => r.time) + 1);
|
|
328
328
|
return this.cachedResult = this.data.slice(n, s), this.cachedRange = { from: t, to: e }, this.cachedResult;
|
|
329
329
|
}
|
|
330
330
|
first() {
|
|
@@ -341,7 +341,7 @@ class ss extends fi {
|
|
|
341
341
|
}
|
|
342
342
|
findNearest(t, e) {
|
|
343
343
|
if (this.data.length === 0) return null;
|
|
344
|
-
const n =
|
|
344
|
+
const n = Hi(this.data, t, (a) => a.time);
|
|
345
345
|
let s = null, r = e;
|
|
346
346
|
for (let a = Math.max(0, n - 1); a <= Math.min(this.data.length - 1, n + 1); a++) {
|
|
347
347
|
const l = Math.abs(this.data[a].time - t);
|
|
@@ -350,7 +350,7 @@ class ss extends fi {
|
|
|
350
350
|
return s;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
class
|
|
353
|
+
class nr {
|
|
354
354
|
constructor(t, e, n, s = 0) {
|
|
355
355
|
T(this, "dragging", !1), T(this, "lastX", 0), this.viewport = t, this.timeScale = e, this.canvas = n, this.inputResponseMs = s;
|
|
356
356
|
}
|
|
@@ -375,8 +375,8 @@ class ir {
|
|
|
375
375
|
return this.dragging;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
const
|
|
379
|
-
class
|
|
378
|
+
const sr = 150;
|
|
379
|
+
class rr {
|
|
380
380
|
constructor(t, e, n = 0) {
|
|
381
381
|
T(this, "reboundTimer", null), this.viewport = t, this.timeScale = e, this.inputResponseMs = n;
|
|
382
382
|
}
|
|
@@ -391,10 +391,10 @@ class sr {
|
|
|
391
391
|
}
|
|
392
392
|
handleWheel(t) {
|
|
393
393
|
t.preventDefault();
|
|
394
|
-
const e =
|
|
394
|
+
const e = ar(t.deltaY, t.deltaMode), n = Math.exp(e * 5e-3), s = this.timeScale.getMediaWidth(), r = Math.min(t.offsetX, s), a = this.timeScale.xToTime(r);
|
|
395
395
|
this.viewport.zoomAt(a, n, s, this.inputResponseMs), this.reboundTimer !== null && clearTimeout(this.reboundTimer), this.reboundTimer = setTimeout(() => {
|
|
396
396
|
this.reboundTimer = null, this.viewport.startRebound(s);
|
|
397
|
-
},
|
|
397
|
+
}, sr);
|
|
398
398
|
}
|
|
399
399
|
/** Cancel any pending rebound — called by InteractionHandler.destroy and when
|
|
400
400
|
* a competing gesture (mousedown, touchstart) takes over. */
|
|
@@ -402,10 +402,10 @@ class sr {
|
|
|
402
402
|
this.reboundTimer !== null && (clearTimeout(this.reboundTimer), this.reboundTimer = null);
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function ar(i, t) {
|
|
406
406
|
return t === WheelEvent.DOM_DELTA_LINE ? i * 8 : t === WheelEvent.DOM_DELTA_PAGE ? i * 24 : i;
|
|
407
407
|
}
|
|
408
|
-
class
|
|
408
|
+
class or extends gi {
|
|
409
409
|
constructor(t, e, n, s, r = 0) {
|
|
410
410
|
super(), T(this, "zoom"), T(this, "pan"), T(this, "canvas"), T(this, "timeScale"), T(this, "yScale"), T(this, "viewport"), T(this, "onWheel", (a) => {
|
|
411
411
|
this.zoom.handleWheel(a);
|
|
@@ -441,7 +441,7 @@ class ar extends fi {
|
|
|
441
441
|
const l = this.touchCount === 2;
|
|
442
442
|
this.pan.handleMouseUp(), l && this.viewport.startRebound(this.timeScale.getMediaWidth()), this.touchCount = 0, this.lastTouchDist = 0, this.emit("crosshairMove", null);
|
|
443
443
|
}
|
|
444
|
-
}), this.canvas = t, this.viewport = e, this.timeScale = n, this.yScale = s, this.zoom = new
|
|
444
|
+
}), this.canvas = t, this.viewport = e, this.timeScale = n, this.yScale = s, this.zoom = new rr(e, n, r), this.pan = new nr(e, n, t, r), t.style.cursor = "crosshair", t.style.touchAction = "none", t.addEventListener("wheel", this.onWheel, { passive: !1 }), t.addEventListener("mousedown", this.onMouseDown), t.addEventListener("mousemove", this.onMouseMove), t.addEventListener("mouseup", this.onMouseUp), t.addEventListener("mouseleave", this.onMouseLeave), t.addEventListener("dblclick", this.onDblClick), t.addEventListener("touchstart", this.onTouchStart, { passive: !1 }), t.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), t.addEventListener("touchend", this.onTouchEnd);
|
|
445
445
|
}
|
|
446
446
|
/** Update the per-event ease duration applied to pan/zoom commits. Both
|
|
447
447
|
* the wheel/drag handler and the touch-pinch path (which reads via
|
|
@@ -462,11 +462,11 @@ class ar extends fi {
|
|
|
462
462
|
this.zoom.cancelPendingRebound(), this.canvas.removeEventListener("wheel", this.onWheel), this.canvas.removeEventListener("mousedown", this.onMouseDown), this.canvas.removeEventListener("mousemove", this.onMouseMove), this.canvas.removeEventListener("mouseup", this.onMouseUp), this.canvas.removeEventListener("mouseleave", this.onMouseLeave), this.canvas.removeEventListener("dblclick", this.onDblClick), this.canvas.removeEventListener("touchstart", this.onTouchStart), this.canvas.removeEventListener("touchmove", this.onTouchMove), this.canvas.removeEventListener("touchend", this.onTouchEnd), this.removeAllListeners();
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
|
-
const
|
|
466
|
-
function
|
|
467
|
-
|
|
465
|
+
const lr = /* @__PURE__ */ new WeakMap();
|
|
466
|
+
function hr(i, t) {
|
|
467
|
+
lr.set(i, t);
|
|
468
468
|
}
|
|
469
|
-
const
|
|
469
|
+
const cr = 100, ur = {
|
|
470
470
|
position: "absolute",
|
|
471
471
|
top: "4px",
|
|
472
472
|
right: "4px",
|
|
@@ -480,82 +480,82 @@ const hr = 100, cr = {
|
|
|
480
480
|
whiteSpace: "pre",
|
|
481
481
|
letterSpacing: "0.01em"
|
|
482
482
|
};
|
|
483
|
-
function
|
|
483
|
+
function In(i) {
|
|
484
484
|
let t = 0;
|
|
485
485
|
for (const e of Object.values(i)) t += e;
|
|
486
486
|
return t;
|
|
487
487
|
}
|
|
488
|
-
const
|
|
489
|
-
function
|
|
488
|
+
const di = 9, hn = 7, Vt = 6, cn = 9;
|
|
489
|
+
function dr(i, t) {
|
|
490
490
|
return Math.round(i * t).toLocaleString("en-US");
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function Ln(i, t, e, n, s) {
|
|
493
493
|
return [
|
|
494
|
-
i.padEnd(
|
|
495
|
-
t.toFixed(1).padStart(
|
|
494
|
+
i.padEnd(di),
|
|
495
|
+
t.toFixed(1).padStart(hn),
|
|
496
496
|
e.toFixed(2).padStart(Vt),
|
|
497
497
|
n.toFixed(2).padStart(Vt),
|
|
498
|
-
|
|
498
|
+
dr(s, t).padStart(cn)
|
|
499
499
|
].join(" ");
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function An(i) {
|
|
502
502
|
return [
|
|
503
|
-
i.padEnd(
|
|
504
|
-
"—".padStart(
|
|
503
|
+
i.padEnd(di),
|
|
504
|
+
"—".padStart(hn),
|
|
505
505
|
"—".padStart(Vt),
|
|
506
506
|
"—".padStart(Vt),
|
|
507
|
-
"idle".padStart(
|
|
507
|
+
"idle".padStart(cn)
|
|
508
508
|
].join(" ");
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function fr() {
|
|
511
511
|
return [
|
|
512
|
-
"".padEnd(
|
|
513
|
-
"FPS".padStart(
|
|
512
|
+
"".padEnd(di),
|
|
513
|
+
"FPS".padStart(hn),
|
|
514
514
|
"ms".padStart(Vt),
|
|
515
515
|
"worst".padStart(Vt),
|
|
516
|
-
"calls/s".padStart(
|
|
516
|
+
"calls/s".padStart(cn)
|
|
517
517
|
].join(" ");
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
const t =
|
|
519
|
+
function gr(i) {
|
|
520
|
+
const t = In(i.drawCalls.main), e = In(i.drawCalls.overlay), n = i.frameCount.main === 0 ? An("Main") : Ln("Main", i.mainRendersPerSec, i.mainFrameMs.last, i.mainFrameMs.p95, t), s = i.frameCount.overlay === 0 ? An("Overlay") : Ln("Overlay", i.overlayRendersPerSec, i.overlayFrameMs.last, i.overlayFrameMs.p95, e), r = [fr(), n, s], a = Object.keys(i.perSeries);
|
|
521
521
|
if (a.length > 1) {
|
|
522
|
-
r.push(""), r.push("Per series (main pass)"), r.push(["".padEnd(
|
|
522
|
+
r.push(""), r.push("Per series (main pass)"), r.push(["".padEnd(di), "ms".padStart(Vt), "worst".padStart(Vt)].join(" "));
|
|
523
523
|
for (const l of a) {
|
|
524
524
|
const h = i.perSeries[l];
|
|
525
525
|
r.push(
|
|
526
|
-
[` ${l}`.padEnd(
|
|
526
|
+
[` ${l}`.padEnd(di), h.last.toFixed(2).padStart(Vt), h.p95.toFixed(2).padStart(Vt)].join(" ")
|
|
527
527
|
);
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
530
|
return r.join(`
|
|
531
531
|
`);
|
|
532
532
|
}
|
|
533
|
-
class
|
|
534
|
-
constructor(t, e, n =
|
|
533
|
+
class mr {
|
|
534
|
+
constructor(t, e, n = cr) {
|
|
535
535
|
T(this, "element"), T(this, "unsubscribe"), T(this, "updateIntervalMs"), T(this, "lastUpdate", 0), this.updateIntervalMs = n;
|
|
536
536
|
for (const s of t.querySelectorAll("[data-chart-perf-hud]"))
|
|
537
537
|
s.remove();
|
|
538
|
-
this.element = document.createElement("div"), this.element.setAttribute("data-chart-perf-hud", ""), Object.assign(this.element.style,
|
|
538
|
+
this.element = document.createElement("div"), this.element.setAttribute("data-chart-perf-hud", ""), Object.assign(this.element.style, ur), this.element.textContent = "perf: waiting for first frame…", t.appendChild(this.element), this.unsubscribe = e.onFrame((s) => this.onFrame(s));
|
|
539
539
|
}
|
|
540
540
|
destroy() {
|
|
541
541
|
this.unsubscribe(), this.element.remove();
|
|
542
542
|
}
|
|
543
543
|
onFrame(t) {
|
|
544
544
|
const e = performance.now();
|
|
545
|
-
e - this.lastUpdate < this.updateIntervalMs || (this.lastUpdate = e, this.element.textContent =
|
|
545
|
+
e - this.lastUpdate < this.updateIntervalMs || (this.lastUpdate = e, this.element.textContent = gr(t));
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
const
|
|
549
|
-
function
|
|
548
|
+
const pr = 5e3, br = 2e3, vr = 30;
|
|
549
|
+
function $i(i, t, e) {
|
|
550
550
|
let n = 0;
|
|
551
551
|
for (; n < t.length && t[n] < e; ) n++;
|
|
552
552
|
n > 0 && (i.splice(0, n), t.splice(0, n));
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function Ni(i, t, e) {
|
|
555
555
|
const n = i.length - e;
|
|
556
556
|
n > 0 && (i.splice(0, n), t.splice(0, n));
|
|
557
557
|
}
|
|
558
|
-
function
|
|
558
|
+
function Xi(i) {
|
|
559
559
|
if (i.length === 0) return { last: 0, p50: 0, p95: 0 };
|
|
560
560
|
const t = [...i].sort((e, n) => e - n);
|
|
561
561
|
return {
|
|
@@ -564,19 +564,19 @@ function Ni(i) {
|
|
|
564
564
|
p95: t[Math.floor(t.length * 0.95)] ?? 0
|
|
565
565
|
};
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function Wn(i) {
|
|
568
568
|
if (i.length < 2) return 0;
|
|
569
569
|
const t = i[i.length - 1] - i[0];
|
|
570
570
|
return t <= 0 ? 0 : (i.length - 1) * 1e3 / t;
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function Dn(i) {
|
|
573
573
|
const t = {};
|
|
574
574
|
for (const [e, n] of i) t[e] = n;
|
|
575
575
|
return t;
|
|
576
576
|
}
|
|
577
|
-
class
|
|
577
|
+
class Ui {
|
|
578
578
|
constructor(t = {}) {
|
|
579
|
-
T(this, "drawCallsMain", /* @__PURE__ */ new Map()), T(this, "drawCallsOverlay", /* @__PURE__ */ new Map()), T(this, "mainMs", []), T(this, "overlayMs", []), T(this, "mainStamps", []), T(this, "overlayStamps", []), T(this, "perSeriesMs", /* @__PURE__ */ new Map()), T(this, "perSeriesStamps", /* @__PURE__ */ new Map()), T(this, "listeners", /* @__PURE__ */ new Set()), T(this, "windowMs"), T(this, "maxSamples"), T(this, "heapInterval"), T(this, "heapCounter", 0), T(this, "heapMb", null), T(this, "mainFrameCount", 0), T(this, "overlayFrameCount", 0), T(this, "lastStamp", 0), this.windowMs = t.windowMs ??
|
|
579
|
+
T(this, "drawCallsMain", /* @__PURE__ */ new Map()), T(this, "drawCallsOverlay", /* @__PURE__ */ new Map()), T(this, "mainMs", []), T(this, "overlayMs", []), T(this, "mainStamps", []), T(this, "overlayStamps", []), T(this, "perSeriesMs", /* @__PURE__ */ new Map()), T(this, "perSeriesStamps", /* @__PURE__ */ new Map()), T(this, "listeners", /* @__PURE__ */ new Set()), T(this, "windowMs"), T(this, "maxSamples"), T(this, "heapInterval"), T(this, "heapCounter", 0), T(this, "heapMb", null), T(this, "mainFrameCount", 0), T(this, "overlayFrameCount", 0), T(this, "lastStamp", 0), this.windowMs = t.windowMs ?? pr, this.maxSamples = t.maxSamples ?? br, this.heapInterval = t.heapSampleEveryNFrames ?? vr;
|
|
580
580
|
}
|
|
581
581
|
/** Clear the draw-call tally for the given layer. Call at the start of each frame. */
|
|
582
582
|
resetDrawCalls(t) {
|
|
@@ -597,10 +597,10 @@ class Xi {
|
|
|
597
597
|
/** Drop samples older than `windowMs` behind the newest recorded stamp, and enforce the hard per-layer cap. */
|
|
598
598
|
trimAll(t) {
|
|
599
599
|
const e = t - this.windowMs;
|
|
600
|
-
|
|
600
|
+
$i(this.mainMs, this.mainStamps, e), $i(this.overlayMs, this.overlayStamps, e), Ni(this.mainMs, this.mainStamps, this.maxSamples), Ni(this.overlayMs, this.overlayStamps, this.maxSamples);
|
|
601
601
|
for (const n of this.perSeriesMs.keys()) {
|
|
602
602
|
const s = this.perSeriesMs.get(n), r = this.perSeriesStamps.get(n);
|
|
603
|
-
!s || !r || (
|
|
603
|
+
!s || !r || ($i(s, r, e), Ni(s, r, this.maxSamples));
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
/** Subscribe to per-frame stat snapshots. Returns an unsubscribe function. */
|
|
@@ -612,18 +612,18 @@ class Xi {
|
|
|
612
612
|
/** Snapshot current stats. Safe to call outside frames. */
|
|
613
613
|
getStats() {
|
|
614
614
|
const t = {};
|
|
615
|
-
for (const [n, s] of this.perSeriesMs) t[n] =
|
|
616
|
-
const e =
|
|
615
|
+
for (const [n, s] of this.perSeriesMs) t[n] = Xi(s);
|
|
616
|
+
const e = Wn(this.mainStamps);
|
|
617
617
|
return {
|
|
618
618
|
mainRendersPerSec: e,
|
|
619
|
-
overlayRendersPerSec:
|
|
619
|
+
overlayRendersPerSec: Wn(this.overlayStamps),
|
|
620
620
|
fps: e,
|
|
621
|
-
mainFrameMs:
|
|
622
|
-
overlayFrameMs:
|
|
621
|
+
mainFrameMs: Xi(this.mainMs),
|
|
622
|
+
overlayFrameMs: Xi(this.overlayMs),
|
|
623
623
|
frameCount: { main: this.mainFrameCount, overlay: this.overlayFrameCount },
|
|
624
624
|
drawCalls: {
|
|
625
|
-
main:
|
|
626
|
-
overlay:
|
|
625
|
+
main: Dn(this.drawCallsMain),
|
|
626
|
+
overlay: Dn(this.drawCallsOverlay)
|
|
627
627
|
},
|
|
628
628
|
perSeries: t,
|
|
629
629
|
heapMb: this.heapMb
|
|
@@ -639,7 +639,7 @@ class Xi {
|
|
|
639
639
|
this.heapMb = t ? t.usedJSHeapSize / (1024 * 1024) : null;
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
|
-
class
|
|
642
|
+
class vi {
|
|
643
643
|
constructor(t) {
|
|
644
644
|
T(this, "dirty", !1), T(this, "rafId", null), T(this, "callback"), T(this, "render", (e) => {
|
|
645
645
|
this.dirty = !1, this.rafId = null, this.callback(e);
|
|
@@ -652,41 +652,41 @@ class bi {
|
|
|
652
652
|
this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.dirty = !1;
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
|
-
const
|
|
655
|
+
const Me = 6e4, de = 36e5, le = 864e5, Et = 365 * le;
|
|
656
656
|
function vt(i) {
|
|
657
657
|
return i instanceof Date ? i.getTime() : i;
|
|
658
658
|
}
|
|
659
|
-
function vr(i) {
|
|
660
|
-
return i.length === 0 || !i.some((t) => t.time instanceof Date) ? i : i.map((t) => ({ ...t, time: vt(t.time) }));
|
|
661
|
-
}
|
|
662
659
|
function yr(i) {
|
|
663
660
|
return i.length === 0 || !i.some((t) => t.time instanceof Date) ? i : i.map((t) => ({ ...t, time: vt(t.time) }));
|
|
664
661
|
}
|
|
665
662
|
function xr(i) {
|
|
666
|
-
|
|
663
|
+
return i.length === 0 || !i.some((t) => t.time instanceof Date) ? i : i.map((t) => ({ ...t, time: vt(t.time) }));
|
|
664
|
+
}
|
|
665
|
+
function wr(i) {
|
|
666
|
+
if (i.length < 2) return le;
|
|
667
667
|
const t = [];
|
|
668
668
|
for (let e = 1; e < Math.min(i.length, 20); e++)
|
|
669
669
|
t.push(i[e] - i[e - 1]);
|
|
670
670
|
return t.sort((e, n) => e - n), t[Math.floor(t.length / 2)];
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function Fi(i, t) {
|
|
673
673
|
const e = new Date(i);
|
|
674
|
-
return t >=
|
|
674
|
+
return t >= Et ? e.toLocaleDateString("en-US", { year: "numeric" }) : t >= le ? e.toLocaleDateString("en-US", { month: "short", day: "numeric" }) : t >= de ? e.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit", hour12: !1 }) : e.toLocaleTimeString("en-US", {
|
|
675
675
|
hour: "2-digit",
|
|
676
676
|
minute: "2-digit",
|
|
677
677
|
second: "2-digit",
|
|
678
678
|
hour12: !1
|
|
679
679
|
});
|
|
680
680
|
}
|
|
681
|
-
function
|
|
681
|
+
function Sr(i) {
|
|
682
682
|
return new Date(i).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
683
683
|
}
|
|
684
|
-
function
|
|
685
|
-
const t = [1e3, 5e3, 1e4, 15e3, 3e4], e = [
|
|
686
|
-
return i <
|
|
684
|
+
function Mr(i) {
|
|
685
|
+
const t = [1e3, 5e3, 1e4, 15e3, 3e4], e = [Me, 5 * Me, 10 * Me, 15 * Me, 30 * Me], n = [de, 2 * de, 4 * de, 6 * de, 12 * de], s = [le, 7 * le, 30 * le, 90 * le], r = [Et, 2 * Et, 5 * Et, 10 * Et, 25 * Et, 50 * Et, 100 * Et];
|
|
686
|
+
return i < Me ? [...t, ...e, ...n, ...s, ...r] : i < de ? [...e, ...n, ...s, ...r] : i < le ? [...n, ...s, ...r] : i < Et ? [...s, ...r] : r;
|
|
687
687
|
}
|
|
688
|
-
const
|
|
689
|
-
class
|
|
688
|
+
const kr = 50, Cr = 80;
|
|
689
|
+
class as {
|
|
690
690
|
constructor() {
|
|
691
691
|
T(this, "from", 0), T(this, "to", 0), T(this, "width", 1), T(this, "pixelRatio", 1), T(this, "dataInterval", null), T(this, "labelCountHintValue", null), T(this, "minSpacingValue", null), T(this, "resolvedInterval", null), T(this, "lastInterval", null), T(this, "lastWant", null), T(this, "lastBucketKey", null);
|
|
692
692
|
}
|
|
@@ -694,20 +694,20 @@ class rs {
|
|
|
694
694
|
return this.labelCountHintValue;
|
|
695
695
|
}
|
|
696
696
|
get minLabelSpacing() {
|
|
697
|
-
return this.minSpacingValue ??
|
|
697
|
+
return this.minSpacingValue ?? Cr;
|
|
698
698
|
}
|
|
699
699
|
update(t, e, n, s) {
|
|
700
700
|
if (this.from = t.from, this.to = t.to, this.width = e, this.pixelRatio = n, s !== void 0 && s > 0) {
|
|
701
|
-
const r =
|
|
701
|
+
const r = Fn(s);
|
|
702
702
|
this.lastBucketKey !== null && this.lastBucketKey !== r && this.resetHysteresis(), this.lastBucketKey = r, this.dataInterval = s;
|
|
703
703
|
}
|
|
704
704
|
this.resolveInterval();
|
|
705
705
|
}
|
|
706
706
|
setLabelCount(t) {
|
|
707
|
-
this.labelCountHintValue =
|
|
707
|
+
this.labelCountHintValue = Tr(t), this.resetHysteresis(), this.resolveInterval();
|
|
708
708
|
}
|
|
709
709
|
setMinSpacing(t) {
|
|
710
|
-
this.minSpacingValue =
|
|
710
|
+
this.minSpacingValue = Rr(t), this.resetHysteresis(), this.resolveInterval();
|
|
711
711
|
}
|
|
712
712
|
resetHysteresis() {
|
|
713
713
|
this.lastInterval = null, this.lastWant = null;
|
|
@@ -738,11 +738,11 @@ class rs {
|
|
|
738
738
|
niceTickValues(t) {
|
|
739
739
|
if (this.to <= this.from) return { ticks: [], tickInterval: 0 };
|
|
740
740
|
if (this.dataInterval !== t) {
|
|
741
|
-
const a =
|
|
741
|
+
const a = Fn(t);
|
|
742
742
|
this.lastBucketKey !== null && this.lastBucketKey !== a && this.resetHysteresis(), this.lastBucketKey = a, this.dataInterval = t, this.resolveInterval();
|
|
743
743
|
}
|
|
744
744
|
if (this.resolvedInterval == null) return { ticks: [], tickInterval: 0 };
|
|
745
|
-
const e = this.resolvedInterval, n = Math.ceil(this.from / e) * e, s = Math.max(0, Math.min(
|
|
745
|
+
const e = this.resolvedInterval, n = Math.ceil(this.from / e) * e, s = Math.max(0, Math.min(kr, Math.floor((this.to - n) / e) + 1)), r = [];
|
|
746
746
|
for (let a = 0; a < s; a++) r.push(n + a * e);
|
|
747
747
|
return { ticks: r, tickInterval: e };
|
|
748
748
|
}
|
|
@@ -762,7 +762,7 @@ class rs {
|
|
|
762
762
|
this.resolvedInterval = null;
|
|
763
763
|
return;
|
|
764
764
|
}
|
|
765
|
-
const t =
|
|
765
|
+
const t = Mr(this.dataInterval), e = this.to - this.from, n = e / this.width * this.minLabelSpacing;
|
|
766
766
|
let s;
|
|
767
767
|
if (this.labelCountHint != null) {
|
|
768
768
|
const l = Math.max(1, this.labelCountHint);
|
|
@@ -794,52 +794,52 @@ class rs {
|
|
|
794
794
|
return Math.max(0, Math.floor((this.to - e) / t) + 1);
|
|
795
795
|
}
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function Fn(i) {
|
|
798
798
|
return i < 6e4 ? 0 : i < 36e5 ? 1 : i < 864e5 ? 2 : 3;
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function Tr(i) {
|
|
801
801
|
return typeof i == "number" && Number.isFinite(i) && i >= 2 ? Math.floor(i) : null;
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function Rr(i) {
|
|
804
804
|
return typeof i == "number" && Number.isFinite(i) && i > 0 ? i : null;
|
|
805
805
|
}
|
|
806
|
-
function
|
|
806
|
+
function os(i) {
|
|
807
807
|
const t = Math.abs(i);
|
|
808
808
|
if (t === 0) return "0";
|
|
809
809
|
if (t < 1e-12) return i.toExponential(2);
|
|
810
810
|
const e = Math.max(0, Math.ceil(-Math.log10(t)) - 1), n = Math.min(12, e + 4), s = i.toFixed(n);
|
|
811
811
|
return s.includes(".") ? s.replace(/\.?0+$/, "") : s;
|
|
812
812
|
}
|
|
813
|
-
function
|
|
813
|
+
function ls(i) {
|
|
814
814
|
return Number.isNaN(i) ? "—" : i === 1 / 0 ? "∞" : i === -1 / 0 ? "−∞" : null;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
const e =
|
|
816
|
+
function Se(i, t) {
|
|
817
|
+
const e = ls(i);
|
|
818
818
|
if (e !== null) return e;
|
|
819
819
|
const n = Math.abs(i), s = (t == null ? void 0 : t.decimals) ?? 2, r = (a, l, h) => {
|
|
820
820
|
const d = a / l, c = Number.parseFloat(d.toFixed(s));
|
|
821
821
|
return Math.abs(c) >= 1e3 ? null : `${d.toFixed(s)}${h}`;
|
|
822
822
|
};
|
|
823
|
-
return n >= 1e15 ? i.toExponential(2) : n >= 1e12 ? r(i, 1e12, "T") ?? i.toExponential(2) : n >= 1e9 ? r(i, 1e9, "B") ?? `${(i / 1e12).toFixed(s)}T` : n >= 1e6 ? r(i, 1e6, "M") ?? `${(i / 1e9).toFixed(s)}B` : n >= 1e3 ? r(i, 1e3, "K") ?? `${(i / 1e6).toFixed(s)}M` : n < 1 ?
|
|
823
|
+
return n >= 1e15 ? i.toExponential(2) : n >= 1e12 ? r(i, 1e12, "T") ?? i.toExponential(2) : n >= 1e9 ? r(i, 1e9, "B") ?? `${(i / 1e12).toFixed(s)}T` : n >= 1e6 ? r(i, 1e6, "M") ?? `${(i / 1e9).toFixed(s)}B` : n >= 1e3 ? r(i, 1e3, "K") ?? `${(i / 1e6).toFixed(s)}M` : n < 1 ? os(i) : n < 100 ? i.toFixed(2) : i.toFixed(0);
|
|
824
824
|
}
|
|
825
|
-
function
|
|
826
|
-
const t =
|
|
825
|
+
function hs(i) {
|
|
826
|
+
const t = ls(i);
|
|
827
827
|
if (t !== null) return t;
|
|
828
828
|
const e = Math.abs(i);
|
|
829
|
-
return e === 0 ? "0" : e < 1 ?
|
|
829
|
+
return e === 0 ? "0" : e < 1 ? os(i) : e < 100 ? i.toFixed(4) : e >= 1e7 ? Se(i) : e < 1e4 ? i.toFixed(2) : i.toFixed(0);
|
|
830
830
|
}
|
|
831
|
-
function
|
|
831
|
+
function Ir(i) {
|
|
832
832
|
if (!Number.isFinite(i) || i <= 0) return 1;
|
|
833
833
|
const t = 10 ** Math.floor(Math.log10(i)), e = i / t;
|
|
834
834
|
return (e <= 1 ? 1 : e <= 2 ? 2 : e <= 5 ? 5 : 10) * t;
|
|
835
835
|
}
|
|
836
|
-
function
|
|
836
|
+
function Lr(i) {
|
|
837
837
|
if (!Number.isFinite(i) || i <= 0) return 1;
|
|
838
838
|
const t = 10 ** Math.floor(Math.log10(i)), e = i / t;
|
|
839
839
|
return (e >= 5 ? 5 : e >= 2 ? 2 : 1) * t;
|
|
840
840
|
}
|
|
841
|
-
const
|
|
842
|
-
class
|
|
841
|
+
const Ar = 50, Wr = 50;
|
|
842
|
+
class cs {
|
|
843
843
|
constructor() {
|
|
844
844
|
T(this, "min", 0), T(this, "max", 0), T(this, "height", 1), T(this, "pixelRatio", 1), T(this, "labelCountHintValue", null), T(this, "minSpacingValue", null), T(this, "resolvedInterval", null), T(this, "lastInterval", null), T(this, "lastRawInterval", null), T(this, "customFormat", null);
|
|
845
845
|
}
|
|
@@ -847,7 +847,7 @@ class hs {
|
|
|
847
847
|
return this.labelCountHintValue;
|
|
848
848
|
}
|
|
849
849
|
get minLabelSpacing() {
|
|
850
|
-
return this.minSpacingValue ??
|
|
850
|
+
return this.minSpacingValue ?? Wr;
|
|
851
851
|
}
|
|
852
852
|
/** Recalculate the scale with a new Y range, chart height, and device pixel ratio. */
|
|
853
853
|
update(t, e, n) {
|
|
@@ -855,11 +855,11 @@ class hs {
|
|
|
855
855
|
}
|
|
856
856
|
/** Desired label count. Invalid values (NaN, <2, Infinity) clear the hint. */
|
|
857
857
|
setLabelCount(t) {
|
|
858
|
-
this.labelCountHintValue =
|
|
858
|
+
this.labelCountHintValue = Dr(t), this.resetHysteresis(), this.resolveInterval();
|
|
859
859
|
}
|
|
860
860
|
/** Minimum pixel gap between adjacent labels. */
|
|
861
861
|
setMinSpacing(t) {
|
|
862
|
-
this.minSpacingValue =
|
|
862
|
+
this.minSpacingValue = Fr(t), this.resetHysteresis(), this.resolveInterval();
|
|
863
863
|
}
|
|
864
864
|
resetHysteresis() {
|
|
865
865
|
this.lastInterval = null, this.lastRawInterval = null;
|
|
@@ -892,7 +892,7 @@ class hs {
|
|
|
892
892
|
*/
|
|
893
893
|
niceTickValues() {
|
|
894
894
|
if (this.resolvedInterval == null) return [];
|
|
895
|
-
const t = this.resolvedInterval, e = Math.ceil(this.min / t) * t, n = Math.max(0, Math.min(
|
|
895
|
+
const t = this.resolvedInterval, e = Math.ceil(this.min / t) * t, n = Math.max(0, Math.min(Ar, Math.floor((this.max - e) / t) + 1)), s = [];
|
|
896
896
|
for (let r = 0; r < n; r++) s.push(e + r * t);
|
|
897
897
|
return s;
|
|
898
898
|
}
|
|
@@ -911,7 +911,7 @@ class hs {
|
|
|
911
911
|
*/
|
|
912
912
|
formatY(t) {
|
|
913
913
|
if (this.customFormat) return this.customFormat(t);
|
|
914
|
-
if (this.max - this.min >= 1e6) return
|
|
914
|
+
if (this.max - this.min >= 1e6) return Se(t);
|
|
915
915
|
const e = this.resolvedInterval, n = e != null && e > 0 ? Math.max(0, -Math.floor(Math.log10(e))) : 1;
|
|
916
916
|
return t.toFixed(n);
|
|
917
917
|
}
|
|
@@ -940,9 +940,9 @@ class hs {
|
|
|
940
940
|
return;
|
|
941
941
|
}
|
|
942
942
|
}
|
|
943
|
-
let r =
|
|
943
|
+
let r = Ir(s);
|
|
944
944
|
if (this.labelCountHint != null && this.countTicks(r) < this.labelCountHint) {
|
|
945
|
-
const a =
|
|
945
|
+
const a = Lr(s);
|
|
946
946
|
a >= e && a > 0 && (r = a);
|
|
947
947
|
}
|
|
948
948
|
this.resolvedInterval = r, this.lastInterval = r, this.lastRawInterval = s;
|
|
@@ -953,21 +953,21 @@ class hs {
|
|
|
953
953
|
return Math.max(0, Math.floor((this.max - e) / t) + 1);
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function Dr(i) {
|
|
957
957
|
return typeof i == "number" && Number.isFinite(i) && i >= 2 ? Math.floor(i) : null;
|
|
958
958
|
}
|
|
959
|
-
function
|
|
959
|
+
function Fr(i) {
|
|
960
960
|
return typeof i == "number" && Number.isFinite(i) && i > 0 ? i : null;
|
|
961
961
|
}
|
|
962
|
-
function
|
|
962
|
+
function ue(i, t) {
|
|
963
963
|
return i === !1 ? 0 : i === void 0 ? t : i;
|
|
964
964
|
}
|
|
965
|
-
function
|
|
965
|
+
function Br(i, t, e, n) {
|
|
966
966
|
const s = i == null ? void 0 : i.get(t);
|
|
967
967
|
if (!s) return 1;
|
|
968
968
|
if (n <= 0)
|
|
969
969
|
return i == null || i.delete(t), 1;
|
|
970
|
-
const r =
|
|
970
|
+
const r = Ve((e - s.startTime) / n, 0, 1), a = ss(r);
|
|
971
971
|
return r >= 1 && (i == null || i.delete(t)), a;
|
|
972
972
|
}
|
|
973
973
|
function Pr(i) {
|
|
@@ -976,17 +976,17 @@ function Pr(i) {
|
|
|
976
976
|
n > 0 ? t += n : n < 0 && (e += n);
|
|
977
977
|
return { positive: t, negative: e };
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function zr(i) {
|
|
980
980
|
return i.positive > 0 ? i.positive : i.negative < 0 ? i.negative : 0;
|
|
981
981
|
}
|
|
982
|
-
function
|
|
982
|
+
function Vr(i) {
|
|
983
983
|
return i.positive > 0 ? 100 : i.negative < 0 ? -100 : 0;
|
|
984
984
|
}
|
|
985
|
-
const
|
|
986
|
-
var St,
|
|
987
|
-
class
|
|
985
|
+
const Yr = 16, Er = (i, t, e) => i + (t - i) * e;
|
|
986
|
+
var St, _t, fe;
|
|
987
|
+
class us {
|
|
988
988
|
constructor(t) {
|
|
989
|
-
T(this, "stores"), L(this, St), L(this,
|
|
989
|
+
T(this, "stores"), L(this, St), L(this, _t), L(this, fe, 0), T(this, "entries"), this.stores = Array.from({ length: t }, () => new rs()), k(this, St, new Array(t).fill(null)), k(this, _t, new Array(t).fill(Number.NaN)), this.entries = Array.from({ length: t }, () => /* @__PURE__ */ new Map());
|
|
990
990
|
}
|
|
991
991
|
/** Per-layer smoothed last value. Read by tests via cast — exposed as a
|
|
992
992
|
* derived view of the live-track animators' `current`. `null` for layers
|
|
@@ -996,7 +996,7 @@ class cs {
|
|
|
996
996
|
}
|
|
997
997
|
/** Read-only view used by {@link effectiveValue} to gate the substitution. */
|
|
998
998
|
get lastSeededTimes() {
|
|
999
|
-
return o(this,
|
|
999
|
+
return o(this, _t);
|
|
1000
1000
|
}
|
|
1001
1001
|
// --- Color accessors ------------------------------------------------------
|
|
1002
1002
|
getColor() {
|
|
@@ -1010,7 +1010,7 @@ class cs {
|
|
|
1010
1010
|
var n;
|
|
1011
1011
|
const s = this.stores[e];
|
|
1012
1012
|
if (!s) return;
|
|
1013
|
-
const r =
|
|
1013
|
+
const r = xr(t ?? []);
|
|
1014
1014
|
s.setData(r), (n = this.entries[e]) == null || n.clear();
|
|
1015
1015
|
}
|
|
1016
1016
|
appendPoint(t, e = 0) {
|
|
@@ -1052,8 +1052,8 @@ class cs {
|
|
|
1052
1052
|
for (const t of this.stores) t.removeAllListeners();
|
|
1053
1053
|
for (const t of this.entries) t.clear();
|
|
1054
1054
|
for (let t = 0; t < o(this, St).length; t++)
|
|
1055
|
-
o(this, St)[t] = null, o(this,
|
|
1056
|
-
k(this,
|
|
1055
|
+
o(this, St)[t] = null, o(this, _t)[t] = Number.NaN;
|
|
1056
|
+
k(this, fe, 0);
|
|
1057
1057
|
}
|
|
1058
1058
|
/**
|
|
1059
1059
|
* Drop all in-flight per-point entrance animations across every layer.
|
|
@@ -1078,36 +1078,36 @@ class cs {
|
|
|
1078
1078
|
* which pass ticks first.
|
|
1079
1079
|
*/
|
|
1080
1080
|
advanceLiveTracking(t) {
|
|
1081
|
-
if (t === o(this,
|
|
1082
|
-
const e =
|
|
1081
|
+
if (t === o(this, fe)) return;
|
|
1082
|
+
const e = ue(this.getCommonOptions().smoothMs, ln), n = o(this, fe) ? Math.min(t - o(this, fe), Yr) : 0, s = t - n;
|
|
1083
1083
|
for (let r = 0; r < this.stores.length; r++) {
|
|
1084
1084
|
const a = this.stores[r].last();
|
|
1085
1085
|
if (!a) {
|
|
1086
|
-
o(this, St)[r] = null, o(this,
|
|
1086
|
+
o(this, St)[r] = null, o(this, _t)[r] = Number.NaN;
|
|
1087
1087
|
continue;
|
|
1088
1088
|
}
|
|
1089
|
-
const l = o(this,
|
|
1089
|
+
const l = o(this, _t)[r] !== a.time, h = o(this, St)[r];
|
|
1090
1090
|
if (h === null || l || e <= 0) {
|
|
1091
|
-
o(this, St)[r] = new
|
|
1091
|
+
o(this, St)[r] = new Ee({
|
|
1092
1092
|
initial: a.value,
|
|
1093
1093
|
duration: e > 0 ? e : 0,
|
|
1094
|
-
easing:
|
|
1095
|
-
lerp:
|
|
1096
|
-
}), o(this,
|
|
1094
|
+
easing: xe,
|
|
1095
|
+
lerp: Er
|
|
1096
|
+
}), o(this, _t)[r] = a.time;
|
|
1097
1097
|
continue;
|
|
1098
1098
|
}
|
|
1099
1099
|
h.setTarget(a.value, { duration: e, now: s }), h.tick(t);
|
|
1100
1100
|
}
|
|
1101
|
-
k(this,
|
|
1101
|
+
k(this, fe, t);
|
|
1102
1102
|
}
|
|
1103
1103
|
entranceProgress(t, e, n) {
|
|
1104
|
-
const s =
|
|
1105
|
-
return
|
|
1104
|
+
const s = ue(this.getCommonOptions().entryMs, we);
|
|
1105
|
+
return Br(this.entries[t], e, n, s);
|
|
1106
1106
|
}
|
|
1107
1107
|
/** The effective Y-value to render for (layer, time) — substitutes smoothed value for the live last point. */
|
|
1108
1108
|
effectiveValue(t, e, n) {
|
|
1109
1109
|
var s;
|
|
1110
|
-
if (o(this,
|
|
1110
|
+
if (o(this, _t)[t] !== e) return n;
|
|
1111
1111
|
const r = (s = o(this, St)[t]) == null ? void 0 : s.current;
|
|
1112
1112
|
return r === void 0 ? n : r;
|
|
1113
1113
|
}
|
|
@@ -1173,7 +1173,7 @@ class cs {
|
|
|
1173
1173
|
s.push(l && l.time === e ? l.value : 0);
|
|
1174
1174
|
}
|
|
1175
1175
|
const r = Pr(s);
|
|
1176
|
-
return { value: n === "percent" ?
|
|
1176
|
+
return { value: n === "percent" ? Vr(r) : zr(r), isLive: !0 };
|
|
1177
1177
|
}
|
|
1178
1178
|
getLayerLastSnapshots() {
|
|
1179
1179
|
if (this.stores.length <= 1) return null;
|
|
@@ -1225,33 +1225,33 @@ class cs {
|
|
|
1225
1225
|
return l > a ? { min: a, max: l } : null;
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
|
-
St = /* @__PURE__ */ new WeakMap(),
|
|
1229
|
-
const
|
|
1228
|
+
St = /* @__PURE__ */ new WeakMap(), _t = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakMap();
|
|
1229
|
+
const _r = {
|
|
1230
1230
|
colors: ["#26a69a", "#ef5350"],
|
|
1231
1231
|
barWidthRatio: 0.6,
|
|
1232
1232
|
stacking: "off"
|
|
1233
1233
|
};
|
|
1234
|
-
function
|
|
1234
|
+
function Bn(i) {
|
|
1235
1235
|
if (!i) return {};
|
|
1236
1236
|
const t = { ...i };
|
|
1237
1237
|
return i.enterAnimation !== void 0 && i.entryAnimation === void 0 && (t.entryAnimation = i.enterAnimation), i.enterMs !== void 0 && i.entryMs === void 0 && (t.entryMs = i.enterMs), t;
|
|
1238
1238
|
}
|
|
1239
|
-
class
|
|
1239
|
+
class Or extends us {
|
|
1240
1240
|
constructor(t, e) {
|
|
1241
|
-
super(t), T(this, "options"), this.options = { ...
|
|
1241
|
+
super(t), T(this, "options"), this.options = { ..._r, ...Bn(e) };
|
|
1242
1242
|
}
|
|
1243
1243
|
/** For chart compatibility — returns first store */
|
|
1244
1244
|
get store() {
|
|
1245
1245
|
return this.stores[0];
|
|
1246
1246
|
}
|
|
1247
1247
|
updateOptions(t) {
|
|
1248
|
-
this.options = { ...this.options, ...
|
|
1248
|
+
this.options = { ...this.options, ...Bn(t) };
|
|
1249
1249
|
}
|
|
1250
1250
|
getCommonOptions() {
|
|
1251
1251
|
return this.options;
|
|
1252
1252
|
}
|
|
1253
1253
|
createEntry(t, e, n) {
|
|
1254
|
-
const s = this.options.entryAnimation ?? "fade-grow", r =
|
|
1254
|
+
const s = this.options.entryAnimation ?? "fade-grow", r = ue(this.options.entryMs, we);
|
|
1255
1255
|
return s === "none" || r <= 0 ? null : { startTime: n };
|
|
1256
1256
|
}
|
|
1257
1257
|
applyTheme(t, e) {
|
|
@@ -1334,11 +1334,11 @@ class _r extends cs {
|
|
|
1334
1334
|
for (const { layer: b, value: R } of S) {
|
|
1335
1335
|
const I = this.options.colors[b % this.options.colors.length], C = this.entranceProgress(b, M, d);
|
|
1336
1336
|
if (R >= 0) {
|
|
1337
|
-
const
|
|
1338
|
-
this.drawAnimatedBar(a, C, w,
|
|
1337
|
+
const W = s.valueToBitmapY(R), D = Math.max(1, w - W);
|
|
1338
|
+
this.drawAnimatedBar(a, C, w, W, D, F - p, g, I);
|
|
1339
1339
|
} else {
|
|
1340
|
-
const
|
|
1341
|
-
this.drawAnimatedBar(a, C, w, w,
|
|
1340
|
+
const W = s.valueToBitmapY(R), D = Math.max(1, W - w);
|
|
1341
|
+
this.drawAnimatedBar(a, C, w, w, D, F - p, g, I);
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
1344
|
}
|
|
@@ -1375,28 +1375,28 @@ class _r extends cs {
|
|
|
1375
1375
|
if (b === 0) continue;
|
|
1376
1376
|
const R = s.timeToBitmapX(S);
|
|
1377
1377
|
let I = 0, C = 0;
|
|
1378
|
-
for (let
|
|
1379
|
-
const V = F[
|
|
1378
|
+
for (let D = 0; D < y; D++) {
|
|
1379
|
+
const V = F[D];
|
|
1380
1380
|
V > 0 ? I += V : C += V;
|
|
1381
1381
|
}
|
|
1382
|
-
const
|
|
1382
|
+
const W = this.entranceProgress(y, S, c);
|
|
1383
1383
|
if (e) {
|
|
1384
|
-
let
|
|
1385
|
-
for (const
|
|
1386
|
-
|
|
1387
|
-
if (b > 0 &&
|
|
1388
|
-
const
|
|
1389
|
-
this.drawAnimatedBar(l,
|
|
1384
|
+
let D = 0, V = 0;
|
|
1385
|
+
for (const P of F)
|
|
1386
|
+
P > 0 ? D += P : V += P;
|
|
1387
|
+
if (b > 0 && D > 0) {
|
|
1388
|
+
const P = I / D * 100, _ = (I + b) / D * 100, N = r.valueToBitmapY(_), H = r.valueToBitmapY(P), st = Math.max(1, H - N);
|
|
1389
|
+
this.drawAnimatedBar(l, W, H, N, st, R - v, p, M);
|
|
1390
1390
|
} else if (b < 0 && V < 0) {
|
|
1391
|
-
const
|
|
1392
|
-
this.drawAnimatedBar(l,
|
|
1391
|
+
const P = C / V * -100, _ = (C + b) / V * -100, N = r.valueToBitmapY(P), H = r.valueToBitmapY(_), st = Math.max(1, H - N);
|
|
1392
|
+
this.drawAnimatedBar(l, W, N, N, st, R - v, p, M);
|
|
1393
1393
|
}
|
|
1394
1394
|
} else if (b > 0) {
|
|
1395
|
-
const
|
|
1396
|
-
this.drawAnimatedBar(l,
|
|
1395
|
+
const D = r.valueToBitmapY(I + b), V = r.valueToBitmapY(I), P = Math.max(1, V - D);
|
|
1396
|
+
this.drawAnimatedBar(l, W, V, D, P, R - v, p, M);
|
|
1397
1397
|
} else {
|
|
1398
|
-
const
|
|
1399
|
-
this.drawAnimatedBar(l,
|
|
1398
|
+
const D = r.valueToBitmapY(C), V = r.valueToBitmapY(C + b), P = Math.max(1, V - D);
|
|
1399
|
+
this.drawAnimatedBar(l, W, D, D, P, R - v, p, M);
|
|
1400
1400
|
}
|
|
1401
1401
|
}
|
|
1402
1402
|
}
|
|
@@ -1420,14 +1420,14 @@ class _r extends cs {
|
|
|
1420
1420
|
}
|
|
1421
1421
|
}
|
|
1422
1422
|
function Pn(i, t) {
|
|
1423
|
-
return i.length <= t ? i :
|
|
1423
|
+
return i.length <= t ? i : $r(
|
|
1424
1424
|
i,
|
|
1425
1425
|
t,
|
|
1426
1426
|
(e) => e.time,
|
|
1427
1427
|
(e) => e.value
|
|
1428
1428
|
);
|
|
1429
1429
|
}
|
|
1430
|
-
function
|
|
1430
|
+
function Hr(i, t) {
|
|
1431
1431
|
if (i.length <= t) return i;
|
|
1432
1432
|
const e = Math.ceil(i.length / t), n = [];
|
|
1433
1433
|
for (let s = 0; s < i.length; s += e) {
|
|
@@ -1446,7 +1446,7 @@ function Or(i, t) {
|
|
|
1446
1446
|
}
|
|
1447
1447
|
return n;
|
|
1448
1448
|
}
|
|
1449
|
-
function
|
|
1449
|
+
function $r(i, t, e, n) {
|
|
1450
1450
|
if (t >= i.length || t < 3) return i;
|
|
1451
1451
|
const s = [i[0]], r = (i.length - 2) / (t - 2);
|
|
1452
1452
|
let a = 0;
|
|
@@ -1469,51 +1469,51 @@ function Hr(i, t, e, n) {
|
|
|
1469
1469
|
}
|
|
1470
1470
|
return s.push(i[i.length - 1]), s;
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1472
|
+
function ds(i, t) {
|
|
1473
1473
|
var e, n;
|
|
1474
1474
|
return t === "x" && ((e = i.axis.x) == null ? void 0 : e.fontSize) !== void 0 ? i.axis.x.fontSize : t === "y" && ((n = i.axis.y) == null ? void 0 : n.fontSize) !== void 0 ? i.axis.y.fontSize : i.axis.fontSize;
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1476
|
+
function fs(i, t) {
|
|
1477
1477
|
var e, n;
|
|
1478
1478
|
return t === "x" && ((e = i.axis.x) == null ? void 0 : e.textColor) !== void 0 ? i.axis.x.textColor : t === "y" && ((n = i.axis.y) == null ? void 0 : n.textColor) !== void 0 ? i.axis.y.textColor : i.axis.textColor;
|
|
1479
1479
|
}
|
|
1480
1480
|
function kt(i) {
|
|
1481
1481
|
return Array.isArray(i) ? i.source ?? i[0] : i;
|
|
1482
1482
|
}
|
|
1483
|
-
const
|
|
1484
|
-
function
|
|
1483
|
+
const zn = /* @__PURE__ */ new Map();
|
|
1484
|
+
function Nr(i) {
|
|
1485
1485
|
return [parseInt(i.slice(1, 3), 16), parseInt(i.slice(3, 5), 16), parseInt(i.slice(5, 7), 16)];
|
|
1486
1486
|
}
|
|
1487
|
-
function
|
|
1487
|
+
function Be(i, t) {
|
|
1488
1488
|
if (i.startsWith("rgba")) return i.replace(/[\d.]+\)\s*$/, `${t})`);
|
|
1489
1489
|
if (i.startsWith("rgb(")) return i.replace(/^rgb\((.*)\)$/i, `rgba($1, ${t})`);
|
|
1490
1490
|
const e = i + t;
|
|
1491
|
-
let n =
|
|
1491
|
+
let n = zn.get(e);
|
|
1492
1492
|
if (n) return n;
|
|
1493
|
-
const [s, r, a] =
|
|
1494
|
-
return n = `rgba(${s}, ${r}, ${a}, ${t})`,
|
|
1493
|
+
const [s, r, a] = Nr(i);
|
|
1494
|
+
return n = `rgba(${s}, ${r}, ${a}, ${t})`, zn.set(e, n), n;
|
|
1495
1495
|
}
|
|
1496
|
-
const
|
|
1496
|
+
const Xr = (i, t, e) => ({
|
|
1497
1497
|
time: t.time,
|
|
1498
1498
|
open: i.open + (t.open - i.open) * e,
|
|
1499
1499
|
high: i.high + (t.high - i.high) * e,
|
|
1500
1500
|
low: i.low + (t.low - i.low) * e,
|
|
1501
1501
|
close: i.close + (t.close - i.close) * e,
|
|
1502
1502
|
volume: i.volume === void 0 || t.volume === void 0 ? t.volume : i.volume + (t.volume - i.volume) * e
|
|
1503
|
-
}),
|
|
1503
|
+
}), Ur = (i, t) => i.time === t.time && i.open === t.open && i.high === t.high && i.low === t.low && i.close === t.close && i.volume === t.volume, Gr = {
|
|
1504
1504
|
up: { body: "#26a69a", wick: "#26a69a" },
|
|
1505
1505
|
down: { body: "#ef5350", wick: "#ef5350" },
|
|
1506
1506
|
bodyWidthRatio: 0.6
|
|
1507
1507
|
};
|
|
1508
|
-
function
|
|
1508
|
+
function Vn(i) {
|
|
1509
1509
|
if (!i) return {};
|
|
1510
1510
|
const t = { ...i };
|
|
1511
1511
|
return i.enterAnimation !== void 0 && i.entryAnimation === void 0 && (t.entryAnimation = i.enterAnimation), i.enterMs !== void 0 && i.entryMs === void 0 && (t.entryMs = i.enterMs), t;
|
|
1512
1512
|
}
|
|
1513
|
-
var It,
|
|
1514
|
-
class
|
|
1513
|
+
var It, Te, Re;
|
|
1514
|
+
class jr {
|
|
1515
1515
|
constructor(t, e) {
|
|
1516
|
-
T(this, "store"), T(this, "options"), L(this, It, null), L(this,
|
|
1516
|
+
T(this, "store"), T(this, "options"), L(this, It, null), L(this, Te, Number.NaN), L(this, Re, 0), T(this, "entries", /* @__PURE__ */ new Map()), this.store = t, this.options = { ...Gr, ...Vn(e) };
|
|
1517
1517
|
}
|
|
1518
1518
|
/** Smoothed OHLC of the live last candle. Null until first render. */
|
|
1519
1519
|
get displayedLast() {
|
|
@@ -1521,19 +1521,19 @@ class Gr {
|
|
|
1521
1521
|
return ((t = o(this, It)) == null ? void 0 : t.current) ?? null;
|
|
1522
1522
|
}
|
|
1523
1523
|
updateOptions(t) {
|
|
1524
|
-
this.options = { ...this.options, ...
|
|
1524
|
+
this.options = { ...this.options, ...Vn(t) };
|
|
1525
1525
|
}
|
|
1526
1526
|
getColor() {
|
|
1527
1527
|
return kt(this.options.up.body);
|
|
1528
1528
|
}
|
|
1529
1529
|
// --- SeriesRenderer interface implementation ------------------------------
|
|
1530
1530
|
setData(t) {
|
|
1531
|
-
this.store.setData(
|
|
1531
|
+
this.store.setData(yr(t ?? [])), this.entries.clear();
|
|
1532
1532
|
}
|
|
1533
1533
|
appendPoint(t) {
|
|
1534
1534
|
const e = t, n = vt(e.time);
|
|
1535
1535
|
this.store.append({ ...e, time: n });
|
|
1536
|
-
const s = this.options.entryAnimation ?? "unfold", r =
|
|
1536
|
+
const s = this.options.entryAnimation ?? "unfold", r = ue(this.options.entryMs, we);
|
|
1537
1537
|
s !== "none" && r > 0 && this.entries.set(n, { startTime: performance.now() });
|
|
1538
1538
|
}
|
|
1539
1539
|
updateLastPoint(t) {
|
|
@@ -1561,7 +1561,7 @@ class Gr {
|
|
|
1561
1561
|
return this.store.on("update", t), () => this.store.off("update", t);
|
|
1562
1562
|
}
|
|
1563
1563
|
dispose() {
|
|
1564
|
-
this.store.removeAllListeners(), k(this, It, null), k(this,
|
|
1564
|
+
this.store.removeAllListeners(), k(this, It, null), k(this, Te, Number.NaN), k(this, Re, 0), this.entries.clear();
|
|
1565
1565
|
}
|
|
1566
1566
|
getLastValue() {
|
|
1567
1567
|
const t = this.store.last();
|
|
@@ -1588,10 +1588,10 @@ class Gr {
|
|
|
1588
1588
|
entranceProgress(t, e) {
|
|
1589
1589
|
const n = this.entries.get(t);
|
|
1590
1590
|
if (!n) return 1;
|
|
1591
|
-
const s =
|
|
1591
|
+
const s = ue(this.options.entryMs, we);
|
|
1592
1592
|
if (s <= 0)
|
|
1593
1593
|
return this.entries.delete(t), 1;
|
|
1594
|
-
const r =
|
|
1594
|
+
const r = Ve((e - n.startTime) / s, 0, 1), a = ss(r);
|
|
1595
1595
|
return r >= 1 && this.entries.delete(t), a;
|
|
1596
1596
|
}
|
|
1597
1597
|
/**
|
|
@@ -1610,29 +1610,29 @@ class Gr {
|
|
|
1610
1610
|
advanceLiveTracking(t) {
|
|
1611
1611
|
const e = this.store.last();
|
|
1612
1612
|
if (!e) {
|
|
1613
|
-
k(this, It, null), k(this,
|
|
1613
|
+
k(this, It, null), k(this, Te, Number.NaN);
|
|
1614
1614
|
return;
|
|
1615
1615
|
}
|
|
1616
|
-
const n = o(this,
|
|
1616
|
+
const n = o(this, Te) !== e.time, s = ue(this.options.smoothMs, ln);
|
|
1617
1617
|
if (o(this, It) === null || n || s <= 0) {
|
|
1618
|
-
k(this, It, new
|
|
1618
|
+
k(this, It, new Ee({
|
|
1619
1619
|
initial: { ...e },
|
|
1620
1620
|
duration: s > 0 ? s : 0,
|
|
1621
|
-
easing:
|
|
1622
|
-
lerp:
|
|
1623
|
-
equals:
|
|
1624
|
-
})), k(this,
|
|
1621
|
+
easing: xe,
|
|
1622
|
+
lerp: Xr,
|
|
1623
|
+
equals: Ur
|
|
1624
|
+
})), k(this, Te, e.time), k(this, Re, t);
|
|
1625
1625
|
return;
|
|
1626
1626
|
}
|
|
1627
|
-
const r = Math.min(t - o(this,
|
|
1628
|
-
o(this, It).setTarget(e, { duration: s, now: a }), o(this, It).tick(t), k(this,
|
|
1627
|
+
const r = Math.min(t - o(this, Re), 16), a = t - r;
|
|
1628
|
+
o(this, It).setTarget(e, { duration: s, now: a }), o(this, It).tick(t), k(this, Re, t);
|
|
1629
1629
|
}
|
|
1630
1630
|
render(t) {
|
|
1631
1631
|
const { scope: e, timeScale: n, yScale: s, dataInterval: r } = t, { context: a, horizontalPixelRatio: l } = e, h = n.getRange(), d = performance.now();
|
|
1632
1632
|
this.advanceLiveTracking(d);
|
|
1633
1633
|
let c = this.store.getVisibleData(h.from, h.to);
|
|
1634
1634
|
const u = e.mediaSize.width, f = c.length > u * 2;
|
|
1635
|
-
if (f && (c =
|
|
1635
|
+
if (f && (c = Hr(c, Math.round(u * 1.5)), this.entries.clear()), c.length === 0) return;
|
|
1636
1636
|
if (!f && this.displayedLast) {
|
|
1637
1637
|
const R = c.length - 1;
|
|
1638
1638
|
c[R].time === this.displayedLast.time && (c = [...c.slice(0, R), this.displayedLast]);
|
|
@@ -1694,7 +1694,7 @@ class Gr {
|
|
|
1694
1694
|
const d = s * 0.2;
|
|
1695
1695
|
let c = Math.max(1, r - 2);
|
|
1696
1696
|
(c & 1) !== (a & 1) && (c = c > 1 ? c - 1 : 2);
|
|
1697
|
-
const u = Math.floor(c / 2), f =
|
|
1697
|
+
const u = Math.floor(c / 2), f = Be(kt(this.options.up.body), 0.2), m = Be(kt(this.options.down.body), 0.2), g = this.options.entryAnimation ?? "unfold";
|
|
1698
1698
|
for (const p of e) {
|
|
1699
1699
|
if (!Number.isFinite(p.volume) || p.volume <= 0) continue;
|
|
1700
1700
|
const v = p.volume, w = n.timeToBitmapX(p.time), x = Math.max(1, v / h * d), y = p.close >= p.open;
|
|
@@ -1704,7 +1704,7 @@ class Gr {
|
|
|
1704
1704
|
t.fillRect(w - u, s - x, c, x);
|
|
1705
1705
|
continue;
|
|
1706
1706
|
}
|
|
1707
|
-
const S =
|
|
1707
|
+
const S = Gi(M, g, {
|
|
1708
1708
|
x: w - u,
|
|
1709
1709
|
barWidth: c,
|
|
1710
1710
|
anchorY: s,
|
|
@@ -1735,7 +1735,7 @@ class Gr {
|
|
|
1735
1735
|
t.fillRect(M, x, l, y - x);
|
|
1736
1736
|
continue;
|
|
1737
1737
|
}
|
|
1738
|
-
const S =
|
|
1738
|
+
const S = Gi(p, u, {
|
|
1739
1739
|
x: M,
|
|
1740
1740
|
barWidth: f,
|
|
1741
1741
|
anchorY: w,
|
|
@@ -1749,26 +1749,26 @@ class Gr {
|
|
|
1749
1749
|
const p = (c == null ? void 0 : c.get(g.time)) ?? 1, v = n.timeToBitmapX(g.time), w = s.valueToBitmapY(g.open), x = s.valueToBitmapY(g.close), y = Math.min(w, x), M = Math.max(w, x), S = Math.max(1, M - y), F = p < 1 && u !== "none";
|
|
1750
1750
|
let b = v - r, R = y, I = S, C = 1;
|
|
1751
1751
|
if (F) {
|
|
1752
|
-
const
|
|
1752
|
+
const W = Gi(p, u, {
|
|
1753
1753
|
x: v - r,
|
|
1754
1754
|
barWidth: f,
|
|
1755
1755
|
anchorY: w,
|
|
1756
1756
|
topY: y,
|
|
1757
1757
|
bottomY: M
|
|
1758
1758
|
});
|
|
1759
|
-
b =
|
|
1759
|
+
b = W.x, R = W.topY, I = Math.max(1, W.bottomY - W.topY), C = W.alpha;
|
|
1760
1760
|
}
|
|
1761
1761
|
if (F && t.save(), m && I > 2) {
|
|
1762
|
-
const
|
|
1763
|
-
|
|
1762
|
+
const W = t.createLinearGradient(0, R, 0, R + I);
|
|
1763
|
+
W.addColorStop(0, h[0]), W.addColorStop(1, h[1]), t.fillStyle = W;
|
|
1764
1764
|
} else
|
|
1765
1765
|
t.fillStyle = m ? h[0] : h;
|
|
1766
1766
|
F && (t.globalAlpha = C), t.fillRect(b, R, a, I), F && t.restore();
|
|
1767
1767
|
}
|
|
1768
1768
|
}
|
|
1769
1769
|
}
|
|
1770
|
-
It = /* @__PURE__ */ new WeakMap(),
|
|
1771
|
-
function
|
|
1770
|
+
It = /* @__PURE__ */ new WeakMap(), Te = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap();
|
|
1771
|
+
function Gi(i, t, e) {
|
|
1772
1772
|
switch (t) {
|
|
1773
1773
|
case "none":
|
|
1774
1774
|
return { x: e.x, topY: e.topY, bottomY: e.bottomY, alpha: 1 };
|
|
@@ -1797,28 +1797,28 @@ function Ui(i, t, e) {
|
|
|
1797
1797
|
};
|
|
1798
1798
|
}
|
|
1799
1799
|
}
|
|
1800
|
-
const
|
|
1800
|
+
const Kr = {
|
|
1801
1801
|
colors: ["#2962FF"],
|
|
1802
1802
|
strokeWidth: 1,
|
|
1803
1803
|
area: { visible: !0 },
|
|
1804
1804
|
pulse: !0,
|
|
1805
1805
|
stacking: "off"
|
|
1806
1806
|
};
|
|
1807
|
-
function
|
|
1807
|
+
function Yn(i) {
|
|
1808
1808
|
if (!i) return {};
|
|
1809
1809
|
const t = { ...i };
|
|
1810
1810
|
return i.areaFill !== void 0 && i.area === void 0 && (t.area = { visible: !!i.areaFill }), i.enterAnimation !== void 0 && i.entryAnimation === void 0 && (t.entryAnimation = i.enterAnimation), i.enterMs !== void 0 && i.entryMs === void 0 && (t.entryMs = i.enterMs), t;
|
|
1811
1811
|
}
|
|
1812
|
-
class
|
|
1812
|
+
class qr extends us {
|
|
1813
1813
|
constructor(t, e) {
|
|
1814
|
-
super(t), T(this, "options"), T(this, "areaGradientCache", /* @__PURE__ */ new Map()), this.options = { ...
|
|
1814
|
+
super(t), T(this, "options"), T(this, "areaGradientCache", /* @__PURE__ */ new Map()), this.options = { ...Kr, ...Yn(e) };
|
|
1815
1815
|
}
|
|
1816
1816
|
/** Back-compat: first store. */
|
|
1817
1817
|
get store() {
|
|
1818
1818
|
return this.stores[0];
|
|
1819
1819
|
}
|
|
1820
1820
|
updateOptions(t) {
|
|
1821
|
-
this.options = { ...this.options, ...
|
|
1821
|
+
this.options = { ...this.options, ...Yn(t) };
|
|
1822
1822
|
}
|
|
1823
1823
|
getStacking() {
|
|
1824
1824
|
return this.options.stacking;
|
|
@@ -1828,7 +1828,7 @@ class Kr extends cs {
|
|
|
1828
1828
|
}
|
|
1829
1829
|
createEntry(t, e, n) {
|
|
1830
1830
|
var s;
|
|
1831
|
-
const r = this.options.entryAnimation ?? "grow", a =
|
|
1831
|
+
const r = this.options.entryAnimation ?? "grow", a = ue(this.options.entryMs, we);
|
|
1832
1832
|
if (r === "none" || a <= 0) return null;
|
|
1833
1833
|
const l = (s = this.stores[t]) == null ? void 0 : s.last();
|
|
1834
1834
|
return {
|
|
@@ -1847,7 +1847,7 @@ class Kr extends cs {
|
|
|
1847
1847
|
}
|
|
1848
1848
|
/** Resolved pulse period in ms. 0 disables the pulse entirely. */
|
|
1849
1849
|
resolvedPulseMs() {
|
|
1850
|
-
return
|
|
1850
|
+
return ue(this.options.pulseMs, es);
|
|
1851
1851
|
}
|
|
1852
1852
|
get hasPulse() {
|
|
1853
1853
|
return this.options.pulse && this.resolvedPulseMs() > 0 && this.stores.some((t) => t.isVisible() && t.length > 0);
|
|
@@ -1912,40 +1912,40 @@ class Kr extends cs {
|
|
|
1912
1912
|
M && (a.save(), a.globalAlpha = y);
|
|
1913
1913
|
const R = g.length - 1, I = [];
|
|
1914
1914
|
let C = null;
|
|
1915
|
-
for (let
|
|
1916
|
-
const V = g[
|
|
1915
|
+
for (let D = 0; D < R; D++) {
|
|
1916
|
+
const V = g[D].value;
|
|
1917
1917
|
if (!Number.isFinite(V)) {
|
|
1918
1918
|
C = null;
|
|
1919
1919
|
continue;
|
|
1920
1920
|
}
|
|
1921
|
-
C || (C = [], I.push(C)), C.push({ x: s.timeToBitmapX(g[
|
|
1921
|
+
C || (C = [], I.push(C)), C.push({ x: s.timeToBitmapX(g[D].time), y: r.valueToBitmapY(V) });
|
|
1922
1922
|
}
|
|
1923
|
-
const
|
|
1924
|
-
if (Number.isFinite(F) && Number.isFinite(b) && Number.isFinite(
|
|
1923
|
+
const W = (e = g[R]) == null ? void 0 : e.value;
|
|
1924
|
+
if (Number.isFinite(F) && Number.isFinite(b) && Number.isFinite(W) && (C ? C.push({ x: F, y: b }) : I.push([{ x: F, y: b }])), d && I.some((D) => D.length >= 2)) {
|
|
1925
1925
|
a.beginPath();
|
|
1926
|
-
for (const
|
|
1927
|
-
if (!(
|
|
1928
|
-
a.moveTo(
|
|
1929
|
-
for (let V = 1; V <
|
|
1926
|
+
for (const D of I)
|
|
1927
|
+
if (!(D.length < 2)) {
|
|
1928
|
+
a.moveTo(D[0].x, D[0].y);
|
|
1929
|
+
for (let V = 1; V < D.length; V++) a.lineTo(D[V].x, D[V].y);
|
|
1930
1930
|
}
|
|
1931
1931
|
a.strokeStyle = v, a.lineWidth = c, a.lineJoin = "round", a.lineCap = "round", a.stroke();
|
|
1932
1932
|
}
|
|
1933
1933
|
if (d) {
|
|
1934
|
-
const
|
|
1934
|
+
const D = Math.max(1, c / 2);
|
|
1935
1935
|
let V = !1;
|
|
1936
|
-
for (const
|
|
1937
|
-
|
|
1936
|
+
for (const P of I)
|
|
1937
|
+
P.length === 1 && (V || (a.beginPath(), V = !0), a.moveTo(P[0].x + D, P[0].y), a.arc(P[0].x, P[0].y, D, 0, Math.PI * 2));
|
|
1938
1938
|
V && (a.fillStyle = v, a.fill());
|
|
1939
1939
|
}
|
|
1940
1940
|
if (this.options.area.visible) {
|
|
1941
|
-
const
|
|
1941
|
+
const D = n.bitmapSize.height, V = String(m), P = this.areaGradientCache.get(V);
|
|
1942
1942
|
let _;
|
|
1943
|
-
|
|
1943
|
+
P && P.bottomY === D && P.color === v ? _ = P.gradient : (_ = a.createLinearGradient(0, 0, 0, D), _.addColorStop(0, Be(v, 0.12)), _.addColorStop(1, Be(v, 0.01)), this.areaGradientCache.set(V, { gradient: _, bottomY: D, color: v })), a.fillStyle = _;
|
|
1944
1944
|
for (const N of I)
|
|
1945
1945
|
if (!(N.length < 2)) {
|
|
1946
1946
|
a.beginPath(), a.moveTo(N[0].x, N[0].y);
|
|
1947
1947
|
for (let H = 1; H < N.length; H++) a.lineTo(N[H].x, N[H].y);
|
|
1948
|
-
a.lineTo(N[N.length - 1].x,
|
|
1948
|
+
a.lineTo(N[N.length - 1].x, D), a.lineTo(N[0].x, D), a.closePath(), a.fill();
|
|
1949
1949
|
}
|
|
1950
1950
|
}
|
|
1951
1951
|
M && a.restore();
|
|
@@ -1970,15 +1970,15 @@ class Kr extends cs {
|
|
|
1970
1970
|
const R = g[b];
|
|
1971
1971
|
let I = 0;
|
|
1972
1972
|
if (e)
|
|
1973
|
-
for (let
|
|
1974
|
-
if (!this.stores[
|
|
1975
|
-
const
|
|
1976
|
-
Number.isFinite(
|
|
1973
|
+
for (let W = 0; W < this.stores.length; W++) {
|
|
1974
|
+
if (!this.stores[W].isVisible()) continue;
|
|
1975
|
+
const D = p[W].get(R);
|
|
1976
|
+
Number.isFinite(D) && (I += D);
|
|
1977
1977
|
}
|
|
1978
1978
|
let C = 0;
|
|
1979
|
-
for (let
|
|
1980
|
-
const
|
|
1981
|
-
C += e && I > 0 ? V / I * 100 : V, v[
|
|
1979
|
+
for (let W = 0; W < this.stores.length; W++) {
|
|
1980
|
+
const D = this.stores[W].isVisible() ? p[W].get(R) : 0, V = Number.isFinite(D) ? D : 0;
|
|
1981
|
+
C += e && I > 0 ? V / I * 100 : V, v[W][b] = C;
|
|
1982
1982
|
}
|
|
1983
1983
|
}
|
|
1984
1984
|
const w = performance.now(), x = this.options.entryAnimation ?? "grow", y = /* @__PURE__ */ new Map();
|
|
@@ -1995,34 +1995,34 @@ class Kr extends cs {
|
|
|
1995
1995
|
}
|
|
1996
1996
|
const F = (b, R) => {
|
|
1997
1997
|
if (R >= 1 || b.length < 2) return;
|
|
1998
|
-
const I = b.length - 1, C = b[I - 1],
|
|
1999
|
-
b[I] = [bt(C[0],
|
|
1998
|
+
const I = b.length - 1, C = b[I - 1], W = b[I];
|
|
1999
|
+
b[I] = [bt(C[0], W[0], R), bt(C[1], W[1], R)];
|
|
2000
2000
|
};
|
|
2001
2001
|
for (let b = this.stores.length - 1; b >= 0; b--) {
|
|
2002
2002
|
if (!this.stores[b].isVisible()) continue;
|
|
2003
|
-
const R = this.options.colors[b % this.options.colors.length], I = S[b], C = b > 0 && this.stores[b - 1].isVisible() ? S[b - 1] : 1,
|
|
2004
|
-
for (let
|
|
2005
|
-
|
|
2006
|
-
x === "grow" && F(
|
|
2007
|
-
const
|
|
2008
|
-
for (let
|
|
2009
|
-
const _ = b > 0 ? v[b - 1][
|
|
2010
|
-
|
|
2003
|
+
const R = this.options.colors[b % this.options.colors.length], I = S[b], C = b > 0 && this.stores[b - 1].isVisible() ? S[b - 1] : 1, W = [];
|
|
2004
|
+
for (let P = 0; P < g.length; P++)
|
|
2005
|
+
W.push([s.timeToBitmapX(g[P]), r.valueToBitmapY(v[b][P])]);
|
|
2006
|
+
x === "grow" && F(W, I);
|
|
2007
|
+
const D = [];
|
|
2008
|
+
for (let P = 0; P < g.length; P++) {
|
|
2009
|
+
const _ = b > 0 ? v[b - 1][P] : 0;
|
|
2010
|
+
D.push([s.timeToBitmapX(g[P]), r.valueToBitmapY(_)]);
|
|
2011
2011
|
}
|
|
2012
|
-
x === "grow" && F(
|
|
2012
|
+
x === "grow" && F(D, C);
|
|
2013
2013
|
const V = x === "fade" && I < 1;
|
|
2014
2014
|
if (V && (a.save(), a.globalAlpha = I), this.options.area.visible) {
|
|
2015
|
-
a.beginPath(), a.moveTo(
|
|
2016
|
-
for (let
|
|
2017
|
-
a.lineTo(
|
|
2018
|
-
for (let
|
|
2019
|
-
a.lineTo(
|
|
2020
|
-
a.closePath(), a.fillStyle =
|
|
2015
|
+
a.beginPath(), a.moveTo(W[0][0], W[0][1]);
|
|
2016
|
+
for (let P = 1; P < W.length; P++)
|
|
2017
|
+
a.lineTo(W[P][0], W[P][1]);
|
|
2018
|
+
for (let P = D.length - 1; P >= 0; P--)
|
|
2019
|
+
a.lineTo(D[P][0], D[P][1]);
|
|
2020
|
+
a.closePath(), a.fillStyle = Be(R, 0.25), a.fill();
|
|
2021
2021
|
}
|
|
2022
2022
|
if (d) {
|
|
2023
|
-
a.beginPath(), a.moveTo(
|
|
2024
|
-
for (let
|
|
2025
|
-
a.lineTo(
|
|
2023
|
+
a.beginPath(), a.moveTo(W[0][0], W[0][1]);
|
|
2024
|
+
for (let P = 1; P < W.length; P++)
|
|
2025
|
+
a.lineTo(W[P][0], W[P][1]);
|
|
2026
2026
|
a.strokeStyle = R, a.lineWidth = c, a.lineJoin = "round", a.lineCap = "round", a.stroke();
|
|
2027
2027
|
}
|
|
2028
2028
|
V && a.restore();
|
|
@@ -2131,10 +2131,10 @@ class Kr extends cs {
|
|
|
2131
2131
|
pulseMs: a
|
|
2132
2132
|
}) {
|
|
2133
2133
|
const l = 3 * r, h = 0.4 + 0.6 * Math.abs(Math.sin(performance.now() / a)), d = l + 4 * r * h;
|
|
2134
|
-
t.beginPath(), t.arc(e, n, d, 0, Math.PI * 2), t.fillStyle =
|
|
2134
|
+
t.beginPath(), t.arc(e, n, d, 0, Math.PI * 2), t.fillStyle = Be(s, h * 0.3), t.fill(), t.beginPath(), t.arc(e, n, l, 0, Math.PI * 2), t.fillStyle = s, t.fill();
|
|
2135
2135
|
}
|
|
2136
2136
|
}
|
|
2137
|
-
const
|
|
2137
|
+
const gs = {
|
|
2138
2138
|
mode: "outside",
|
|
2139
2139
|
content: "both",
|
|
2140
2140
|
fontSize: 11,
|
|
@@ -2153,44 +2153,44 @@ const fs = {
|
|
|
2153
2153
|
// that PAV collapses into a centered block on dense datasets.
|
|
2154
2154
|
labelGap: 1.8,
|
|
2155
2155
|
balanceSides: !0
|
|
2156
|
-
},
|
|
2156
|
+
}, Jr = {
|
|
2157
2157
|
innerRadiusRatio: 0,
|
|
2158
2158
|
// 1.15° ≈ 0.02 rad — same visual default as before the radians→degrees switch.
|
|
2159
2159
|
padAngle: 1.15,
|
|
2160
|
-
sliceLabels: { ...
|
|
2160
|
+
sliceLabels: { ...gs },
|
|
2161
2161
|
// Motion off by default: label draw-in + hover explode both skipped.
|
|
2162
2162
|
animate: !1
|
|
2163
|
-
},
|
|
2164
|
-
function
|
|
2163
|
+
}, Qi = Math.PI / 180;
|
|
2164
|
+
function Qr(i, t) {
|
|
2165
2165
|
return { ...i ?? {}, ...t };
|
|
2166
2166
|
}
|
|
2167
|
-
function Qr(i) {
|
|
2168
|
-
return { ...fs, ...i ?? {} };
|
|
2169
|
-
}
|
|
2170
2167
|
function Zr(i) {
|
|
2168
|
+
return { ...gs, ...i ?? {} };
|
|
2169
|
+
}
|
|
2170
|
+
function ta(i) {
|
|
2171
2171
|
const t = { color: "rgba(0, 0, 0, 0.22)", blur: 24, offsetX: 0, offsetY: 10 };
|
|
2172
2172
|
return i === !0 || i === !1 ? t : { ...t, ...i };
|
|
2173
2173
|
}
|
|
2174
|
-
function
|
|
2174
|
+
function ea(i) {
|
|
2175
2175
|
const t = { color: "rgba(0, 0, 0, 0.1)", depth: 0.3 };
|
|
2176
2176
|
return i === !0 || i === !1 ? t : { ...t, ...i };
|
|
2177
2177
|
}
|
|
2178
|
-
const Pe = Math.PI * 2,
|
|
2179
|
-
function
|
|
2180
|
-
const { bitmapWidth: t, bitmapHeight: e, padTop: n, padBottom: s } = i, r = Math.max(0, i.labelReserve ?? 0), a = Math.min(Math.max(0, n), e), l = Math.min(Math.max(0, s), e - a), h = e - a - l, d = Math.max(0, t - 2 * r), c = t / 2, u = a + h / 2, f = Math.max(0, Math.min(d, h) / 2 *
|
|
2178
|
+
const Pe = Math.PI * 2, ms = 0.85;
|
|
2179
|
+
function En(i) {
|
|
2180
|
+
const { bitmapWidth: t, bitmapHeight: e, padTop: n, padBottom: s } = i, r = Math.max(0, i.labelReserve ?? 0), a = Math.min(Math.max(0, n), e), l = Math.min(Math.max(0, s), e - a), h = e - a - l, d = Math.max(0, t - 2 * r), c = t / 2, u = a + h / 2, f = Math.max(0, Math.min(d, h) / 2 * ms);
|
|
2181
2181
|
return { cx: c, cy: u, maxR: f };
|
|
2182
2182
|
}
|
|
2183
|
-
function
|
|
2183
|
+
function ia(i) {
|
|
2184
2184
|
if (!i.startsWith("#")) return !1;
|
|
2185
2185
|
const t = parseInt(i.slice(1, 3), 16), e = parseInt(i.slice(3, 5), 16), n = parseInt(i.slice(5, 7), 16);
|
|
2186
2186
|
return t * 0.299 + e * 0.587 + n * 0.114 > 150;
|
|
2187
2187
|
}
|
|
2188
|
-
function
|
|
2188
|
+
function na(i, t) {
|
|
2189
2189
|
if (!i.startsWith("#")) return i;
|
|
2190
2190
|
const e = Math.min(255, parseInt(i.slice(1, 3), 16) + Math.round(255 * t)), n = Math.min(255, parseInt(i.slice(3, 5), 16) + Math.round(255 * t)), s = Math.min(255, parseInt(i.slice(5, 7), 16) + Math.round(255 * t));
|
|
2191
2191
|
return `#${e.toString(16).padStart(2, "0")}${n.toString(16).padStart(2, "0")}${s.toString(16).padStart(2, "0")}`;
|
|
2192
2192
|
}
|
|
2193
|
-
function
|
|
2193
|
+
function _n(i) {
|
|
2194
2194
|
if (i.startsWith("#"))
|
|
2195
2195
|
return {
|
|
2196
2196
|
r: parseInt(i.slice(1, 3), 16) || 0,
|
|
@@ -2210,34 +2210,34 @@ function En(i) {
|
|
|
2210
2210
|
}
|
|
2211
2211
|
return { r: 0, g: 0, b: 0, a: 1 };
|
|
2212
2212
|
}
|
|
2213
|
-
function
|
|
2214
|
-
const e =
|
|
2213
|
+
function sa(i, t) {
|
|
2214
|
+
const e = _n(i), n = _n(t), s = n.a, r = Math.round(n.r * s + e.r * (1 - s)), a = Math.round(n.g * s + e.g * (1 - s)), l = Math.round(n.b * s + e.b * (1 - s));
|
|
2215
2215
|
return `#${r.toString(16).padStart(2, "0")}${a.toString(16).padStart(2, "0")}${l.toString(16).padStart(2, "0")}`;
|
|
2216
2216
|
}
|
|
2217
|
-
var U, K, Lt, ht,
|
|
2218
|
-
class
|
|
2217
|
+
var U, K, Lt, ht, Ie, ie, Mt, ge, Ft, Zi, wi, ps, bs, vs;
|
|
2218
|
+
class Si {
|
|
2219
2219
|
constructor(t) {
|
|
2220
|
-
L(this, Ft), L(this, U, []), L(this, K), L(this, Lt, -1), L(this, ht, []), L(this,
|
|
2220
|
+
L(this, Ft), L(this, U, []), L(this, K), L(this, Lt, -1), L(this, ht, []), L(this, Ie, 0), L(this, ie, 1), L(this, Mt, null), L(this, ge, []), k(this, K, B(this, Ft, Zi).call(this, Jr, t ?? {}));
|
|
2221
2221
|
}
|
|
2222
2222
|
getData() {
|
|
2223
2223
|
return o(this, U);
|
|
2224
2224
|
}
|
|
2225
2225
|
setData(t) {
|
|
2226
2226
|
const e = t ?? [];
|
|
2227
|
-
k(this, U, e), k(this, ht, new Array(e.length).fill(0)), k(this,
|
|
2228
|
-
for (const n of o(this,
|
|
2227
|
+
k(this, U, e), k(this, ht, new Array(e.length).fill(0)), k(this, ie, o(this, K).animate ? 0 : 1), k(this, Mt, null);
|
|
2228
|
+
for (const n of o(this, ge))
|
|
2229
2229
|
n();
|
|
2230
2230
|
}
|
|
2231
2231
|
onDataChanged(t) {
|
|
2232
|
-
return o(this,
|
|
2233
|
-
const e = o(this,
|
|
2234
|
-
e >= 0 && o(this,
|
|
2232
|
+
return o(this, ge).push(t), () => {
|
|
2233
|
+
const e = o(this, ge).indexOf(t);
|
|
2234
|
+
e >= 0 && o(this, ge).splice(e, 1);
|
|
2235
2235
|
};
|
|
2236
2236
|
}
|
|
2237
2237
|
updateOptions(t) {
|
|
2238
2238
|
var e, n;
|
|
2239
2239
|
const s = (e = o(this, K).sliceLabels) == null ? void 0 : e.mode;
|
|
2240
|
-
k(this, K,
|
|
2240
|
+
k(this, K, B(this, Ft, Zi).call(this, o(this, K), t ?? {})), ((n = o(this, K).sliceLabels) == null ? void 0 : n.mode) === "outside" && s !== "outside" && k(this, ie, o(this, K).animate ? 0 : 1), k(this, Mt, null);
|
|
2241
2241
|
}
|
|
2242
2242
|
getColor() {
|
|
2243
2243
|
var t, e;
|
|
@@ -2263,7 +2263,7 @@ class wi {
|
|
|
2263
2263
|
if (o(this, U).length === 0) return -1;
|
|
2264
2264
|
const l = o(this, U).reduce((y, M) => y + M.value, 0);
|
|
2265
2265
|
if (l <= 0) return -1;
|
|
2266
|
-
const h = ((a = o(this, Mt)) == null ? void 0 : a.reserve) ?? 0, { cx: d, cy: c, maxR: u } =
|
|
2266
|
+
const h = ((a = o(this, Mt)) == null ? void 0 : a.reserve) ?? 0, { cx: d, cy: c, maxR: u } = En({
|
|
2267
2267
|
bitmapWidth: n,
|
|
2268
2268
|
bitmapHeight: s,
|
|
2269
2269
|
padTop: (r == null ? void 0 : r.top) ?? 0,
|
|
@@ -2317,10 +2317,10 @@ class wi {
|
|
|
2317
2317
|
const n = e === o(this, Lt) ? 1 : 0;
|
|
2318
2318
|
if (Math.abs(o(this, ht)[e] - n) > 0.01) return !0;
|
|
2319
2319
|
}
|
|
2320
|
-
return ((t = o(this, K).sliceLabels) == null ? void 0 : t.mode) === "outside" && o(this,
|
|
2320
|
+
return ((t = o(this, K).sliceLabels) == null ? void 0 : t.mode) === "outside" && o(this, ie) < 0.99;
|
|
2321
2321
|
}
|
|
2322
2322
|
dispose() {
|
|
2323
|
-
k(this,
|
|
2323
|
+
k(this, ge, []), k(this, U, []), k(this, ht, []), k(this, Ie, 0);
|
|
2324
2324
|
}
|
|
2325
2325
|
/**
|
|
2326
2326
|
* @internal Test-only accessor for the animated slice offsets. The backing
|
|
@@ -2333,8 +2333,8 @@ class wi {
|
|
|
2333
2333
|
}
|
|
2334
2334
|
render(t) {
|
|
2335
2335
|
if (o(this, U).length === 0) return;
|
|
2336
|
-
const { scope: e, theme: n, padding: s } = t, { context: r, bitmapSize: a, horizontalPixelRatio: l, verticalPixelRatio: h } = e, d = performance.now(), c = o(this,
|
|
2337
|
-
k(this,
|
|
2336
|
+
const { scope: e, theme: n, padding: s } = t, { context: r, bitmapSize: a, horizontalPixelRatio: l, verticalPixelRatio: h } = e, d = performance.now(), c = o(this, Ie) ? Math.min(0.05, (d - o(this, Ie)) / 1e3) : 0;
|
|
2337
|
+
k(this, Ie, d);
|
|
2338
2338
|
const u = o(this, U).reduce((_, N) => _ + N.value, 0);
|
|
2339
2339
|
if (u <= 0) return;
|
|
2340
2340
|
const f = 12;
|
|
@@ -2343,45 +2343,45 @@ class wi {
|
|
|
2343
2343
|
if (o(this, K).animate)
|
|
2344
2344
|
for (let _ = 0; _ < o(this, U).length; _++) {
|
|
2345
2345
|
const N = _ === o(this, Lt) ? 1 : 0;
|
|
2346
|
-
o(this, ht)[_] =
|
|
2346
|
+
o(this, ht)[_] = Rn(o(this, ht)[_], N, f, c);
|
|
2347
2347
|
}
|
|
2348
|
-
const m =
|
|
2349
|
-
r.font = `${m.fontSize * l}px ${n.typography.fontFamily}`, m.mode === "outside" && o(this, K).animate && k(this,
|
|
2350
|
-
const g = o(this, K).colors ?? n.seriesColors, p = m.mode === "outside" ?
|
|
2348
|
+
const m = Zr(o(this, K).sliceLabels);
|
|
2349
|
+
r.font = `${m.fontSize * l}px ${n.typography.fontFamily}`, m.mode === "outside" && o(this, K).animate && k(this, ie, Rn(o(this, ie), 1, 6, c));
|
|
2350
|
+
const g = o(this, K).colors ?? n.seriesColors, p = m.mode === "outside" ? B(this, Ft, ps).call(this, r, m, u, l) : 0, { cx: v, cy: w, maxR: x } = En({
|
|
2351
2351
|
bitmapWidth: a.width,
|
|
2352
2352
|
bitmapHeight: a.height,
|
|
2353
2353
|
padTop: s.top * h,
|
|
2354
2354
|
padBottom: s.bottom * h,
|
|
2355
2355
|
labelReserve: p
|
|
2356
|
-
}), y = x, M = y * o(this, K).innerRadiusRatio, S = o(this, K).padAngle *
|
|
2357
|
-
let
|
|
2356
|
+
}), y = x, M = y * o(this, K).innerRadiusRatio, S = o(this, K).padAngle * Qi, F = 8 * l, b = o(this, K).shadow ?? !1, R = ta(b), I = o(this, K).innerShadow ?? !1, C = ea(I);
|
|
2357
|
+
let W = -Math.PI / 2;
|
|
2358
2358
|
for (let _ = 0; _ < o(this, U).length; _++) {
|
|
2359
|
-
const N = o(this, U)[_], H = N.value / u * Pe, st =
|
|
2359
|
+
const N = o(this, U)[_], H = N.value / u * Pe, st = W + S / 2, j = W + H - S / 2, yt = W + H / 2, xt = N.color ?? g[_ % g.length];
|
|
2360
2360
|
if (j <= st) {
|
|
2361
|
-
|
|
2361
|
+
W += H;
|
|
2362
2362
|
continue;
|
|
2363
2363
|
}
|
|
2364
|
-
const Tt = o(this, ht)[_] * F, Q = Math.cos(yt) * Tt,
|
|
2364
|
+
const Tt = o(this, ht)[_] * F, Q = Math.cos(yt) * Tt, Qt = Math.sin(yt) * Tt, wt = v + Q, ft = w + Qt;
|
|
2365
2365
|
r.beginPath(), r.arc(wt, ft, y, st, j), M > 0 ? r.arc(wt, ft, M, j, st, !0) : r.lineTo(wt, ft), r.closePath();
|
|
2366
2366
|
const gt = r.createRadialGradient(wt, ft, M || 0, wt, ft, y);
|
|
2367
|
-
if (gt.addColorStop(0,
|
|
2367
|
+
if (gt.addColorStop(0, na(xt, 0.15)), I) {
|
|
2368
2368
|
const Rt = Math.max(0, Math.min(0.999, 1 - C.depth));
|
|
2369
|
-
gt.addColorStop(Rt, xt), gt.addColorStop(1,
|
|
2369
|
+
gt.addColorStop(Rt, xt), gt.addColorStop(1, sa(xt, C.color));
|
|
2370
2370
|
} else
|
|
2371
2371
|
gt.addColorStop(1, xt);
|
|
2372
2372
|
r.fillStyle = gt;
|
|
2373
2373
|
const Yt = o(this, ht)[_];
|
|
2374
2374
|
if (b || Yt > 0.01) {
|
|
2375
|
-
const Rt = b ? 1 : 0,
|
|
2376
|
-
r.shadowColor = b ? R.color : "rgba(0,0,0,0.25)", r.shadowBlur = (R.blur * Rt + 12 *
|
|
2375
|
+
const Rt = b ? 1 : 0, Zt = Yt;
|
|
2376
|
+
r.shadowColor = b ? R.color : "rgba(0,0,0,0.25)", r.shadowBlur = (R.blur * Rt + 12 * Zt) * l, r.shadowOffsetX = R.offsetX * Rt * l + Q * 0.3 * Zt, r.shadowOffsetY = R.offsetY * Rt * h + Qt * 0.3 * Zt;
|
|
2377
2377
|
}
|
|
2378
|
-
r.fill(), r.shadowColor = "transparent", r.shadowBlur = 0, r.shadowOffsetX = 0, r.shadowOffsetY = 0,
|
|
2378
|
+
r.fill(), r.shadowColor = "transparent", r.shadowBlur = 0, r.shadowOffsetX = 0, r.shadowOffsetY = 0, W += H;
|
|
2379
2379
|
}
|
|
2380
2380
|
if (m.mode === "none") return;
|
|
2381
|
-
|
|
2382
|
-
const
|
|
2381
|
+
W = -Math.PI / 2;
|
|
2382
|
+
const D = n.tooltip.textColor;
|
|
2383
2383
|
if (m.mode === "outside") {
|
|
2384
|
-
const _ =
|
|
2384
|
+
const _ = B(this, Ft, vs).call(this, {
|
|
2385
2385
|
cx: v,
|
|
2386
2386
|
cy: w,
|
|
2387
2387
|
outerR: y,
|
|
@@ -2394,11 +2394,11 @@ class wi {
|
|
|
2394
2394
|
for (let H = 0; H < _.length; H++) {
|
|
2395
2395
|
const st = _[H];
|
|
2396
2396
|
if (st === null) continue;
|
|
2397
|
-
const j = H * N, yt =
|
|
2398
|
-
|
|
2397
|
+
const j = H * N, yt = Ve((o(this, ie) - j) / (1 - j), 0, 1);
|
|
2398
|
+
B(this, Ft, bs).call(this, {
|
|
2399
2399
|
context: r,
|
|
2400
2400
|
entry: st,
|
|
2401
|
-
textColor:
|
|
2401
|
+
textColor: D,
|
|
2402
2402
|
labels: m,
|
|
2403
2403
|
hpr: l,
|
|
2404
2404
|
progress: yt
|
|
@@ -2408,29 +2408,29 @@ class wi {
|
|
|
2408
2408
|
}
|
|
2409
2409
|
const V = M > 0 ? (y + M) / 2 : y * 0.65;
|
|
2410
2410
|
r.textAlign = "center", r.textBaseline = "middle";
|
|
2411
|
-
const
|
|
2411
|
+
const P = m.minSliceAngle * Qi;
|
|
2412
2412
|
for (let _ = 0; _ < o(this, U).length; _++) {
|
|
2413
2413
|
const N = o(this, U)[_], H = N.value / u * Pe;
|
|
2414
|
-
if (H >=
|
|
2415
|
-
const st =
|
|
2414
|
+
if (H >= P) {
|
|
2415
|
+
const st = W + H / 2, j = o(this, ht)[_] * F, yt = N.color ?? g[_ % g.length], xt = B(this, Ft, wi).call(this, N, u, m.content), Tt = r.measureText(xt).width, Q = m.fontSize * 1.2 * l, Qt = H < Math.PI ? 2 * V * Math.sin(H / 2) : 2 * V, wt = Tt > Qt - 4 * l, ft = M > 0 && V - M < Q;
|
|
2416
2416
|
if (!wt && !ft) {
|
|
2417
2417
|
const gt = v + Math.cos(st) * (V + j), Yt = w + Math.sin(st) * (V + j);
|
|
2418
|
-
r.fillStyle =
|
|
2418
|
+
r.fillStyle = ia(yt) ? "#000000" : "#ffffff", r.fillText(xt, gt, Yt);
|
|
2419
2419
|
}
|
|
2420
2420
|
}
|
|
2421
|
-
|
|
2421
|
+
W += H;
|
|
2422
2422
|
}
|
|
2423
2423
|
}
|
|
2424
2424
|
}
|
|
2425
|
-
U = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(),
|
|
2425
|
+
U = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), Ie = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakSet(), /**
|
|
2426
2426
|
* Merge partial options onto a base, deep-merging `sliceLabels` so callers
|
|
2427
2427
|
* can override one field (e.g. `mode`) without dropping sibling defaults.
|
|
2428
2428
|
*/
|
|
2429
|
-
|
|
2429
|
+
Zi = function(i, t) {
|
|
2430
2430
|
const e = { ...i, ...t };
|
|
2431
|
-
return t.sliceLabels !== void 0 && (e.sliceLabels =
|
|
2431
|
+
return t.sliceLabels !== void 0 && (e.sliceLabels = Qr(i.sliceLabels, t.sliceLabels)), e;
|
|
2432
2432
|
}, /** Build the text shown for one slice given the resolved content mode. */
|
|
2433
|
-
|
|
2433
|
+
wi = function(i, t, e) {
|
|
2434
2434
|
const n = t > 0 ? i.value / t * 100 : 0, s = `${n.toFixed(n >= 10 ? 0 : 1)}%`;
|
|
2435
2435
|
return e === "percent" ? s : e === "label" ? i.label : `${i.label} ${s}`;
|
|
2436
2436
|
}, /**
|
|
@@ -2442,16 +2442,16 @@ xi = function(i, t, e) {
|
|
|
2442
2442
|
* the active `context.font` string so a theme swap that changes the font
|
|
2443
2443
|
* family / size busts the cache and triggers a fresh measurement.
|
|
2444
2444
|
*/
|
|
2445
|
-
|
|
2445
|
+
ps = function(i, t, e, n) {
|
|
2446
2446
|
const s = i.font;
|
|
2447
2447
|
if (o(this, Mt) && o(this, Mt).fontScale === n && o(this, Mt).font === s)
|
|
2448
2448
|
return o(this, Mt).reserve;
|
|
2449
2449
|
let r = 0;
|
|
2450
2450
|
for (const h of o(this, U)) {
|
|
2451
|
-
const d =
|
|
2451
|
+
const d = B(this, Ft, wi).call(this, h, e, t.content), c = i.measureText(d).width;
|
|
2452
2452
|
c > r && (r = c);
|
|
2453
2453
|
}
|
|
2454
|
-
const a = Math.max(t.distance, t.elbowLen), l = (r + (a + Math.max(0, t.railWidth) + t.legPad + 4) * n) /
|
|
2454
|
+
const a = Math.max(t.distance, t.elbowLen), l = (r + (a + Math.max(0, t.railWidth) + t.legPad + 4) * n) / ms;
|
|
2455
2455
|
return k(this, Mt, { fontScale: n, font: s, reserve: l }), l;
|
|
2456
2456
|
}, /**
|
|
2457
2457
|
* Draw one outside label: anchor dot → radial elbow (per-slice, at slice
|
|
@@ -2460,10 +2460,10 @@ ms = function(i, t, e, n) {
|
|
|
2460
2460
|
* lines from cutting across the pie when several small slices cluster near
|
|
2461
2461
|
* 12 o'clock or 6 o'clock.
|
|
2462
2462
|
*/
|
|
2463
|
-
|
|
2463
|
+
bs = function(i) {
|
|
2464
2464
|
const { context: t, entry: e, textColor: n, labels: s, hpr: r, progress: a } = i;
|
|
2465
2465
|
if (a <= 0) return;
|
|
2466
|
-
const { anchorX: l, anchorY: h, elbowX: d, elbowY: c, side: u, text: f, color: m, labelX: g, labelY: p } = e, v = g + u * s.legPad * r, w =
|
|
2466
|
+
const { anchorX: l, anchorY: h, elbowX: d, elbowY: c, side: u, text: f, color: m, labelX: g, labelY: p } = e, v = g + u * s.legPad * r, w = Ve(a / 0.15, 0, 1), x = Ve((a - 0.15) / 0.45, 0, 1), y = Ve((a - 0.6) / 0.4, 0, 1);
|
|
2467
2467
|
if (t.save(), t.globalAlpha = w, t.fillStyle = m, t.beginPath(), t.arc(l, h, 2.5 * r, 0, Pe), t.fill(), t.restore(), x > 0) {
|
|
2468
2468
|
t.save(), t.globalAlpha = x, t.strokeStyle = m, t.lineWidth = 1 * r, t.lineCap = "round", t.beginPath(), t.moveTo(l, h);
|
|
2469
2469
|
const M = l + (d - l) * x, S = h + (c - h) * x;
|
|
@@ -2489,22 +2489,22 @@ ps = function(i) {
|
|
|
2489
2489
|
* to the opposite side would mean flipping text direction without moving
|
|
2490
2490
|
* the label, which would push text across the pie.
|
|
2491
2491
|
*/
|
|
2492
|
-
|
|
2492
|
+
vs = function(i) {
|
|
2493
2493
|
const { cx: t, cy: e, outerR: n, total: s, palette: r, labels: a, hpr: l, bitmapHeight: h } = i, d = new Array(o(this, U).length).fill(null), c = a.elbowLen * l, u = Math.max(a.distance, a.elbowLen) * l, f = Math.max(0, a.railWidth) * l, m = [];
|
|
2494
2494
|
let g = -Math.PI / 2;
|
|
2495
|
-
const p = a.minSliceAngle *
|
|
2495
|
+
const p = a.minSliceAngle * Qi;
|
|
2496
2496
|
for (let y = 0; y < o(this, U).length; y++) {
|
|
2497
2497
|
const M = o(this, U)[y], S = M.value / s * Pe;
|
|
2498
2498
|
if (S >= p) {
|
|
2499
|
-
const F = g + S / 2, b = o(this, ht)[y] * (8 * l), R = Math.cos(F), I = Math.sin(F), C = R >= 0 ? 1 : -1,
|
|
2500
|
-
anchorX:
|
|
2501
|
-
anchorY:
|
|
2499
|
+
const F = g + S / 2, b = o(this, ht)[y] * (8 * l), R = Math.cos(F), I = Math.sin(F), C = R >= 0 ? 1 : -1, W = t + R * (n + b), D = e + I * (n + b), V = t + R * (n + b + c), P = e + I * (n + b + c), _ = t + R * (n + b + u) + C * f, N = e + I * (n + b + u), H = {
|
|
2500
|
+
anchorX: W,
|
|
2501
|
+
anchorY: D,
|
|
2502
2502
|
elbowX: V,
|
|
2503
|
-
elbowY:
|
|
2503
|
+
elbowY: P,
|
|
2504
2504
|
side: C,
|
|
2505
2505
|
labelX: _,
|
|
2506
2506
|
labelY: N,
|
|
2507
|
-
text:
|
|
2507
|
+
text: B(this, Ft, wi).call(this, M, s, a.content),
|
|
2508
2508
|
color: M.color ?? r[y % r.length]
|
|
2509
2509
|
};
|
|
2510
2510
|
d[y] = H, m.push({ entry: H });
|
|
@@ -2521,16 +2521,16 @@ bs = function(i) {
|
|
|
2521
2521
|
const S = [];
|
|
2522
2522
|
for (let b = 0; b < M.length; b++)
|
|
2523
2523
|
for (S.push({ count: 1, sumIdeal: M[b].labelY, startIdx: b }); S.length >= 2; ) {
|
|
2524
|
-
const R = S[S.length - 2], I = S[S.length - 1], C = R.sumIdeal / R.count,
|
|
2525
|
-
if (
|
|
2524
|
+
const R = S[S.length - 2], I = S[S.length - 1], C = R.sumIdeal / R.count, W = I.sumIdeal / I.count, D = C + (R.count - 1) * v / 2;
|
|
2525
|
+
if (W - (I.count - 1) * v / 2 >= D + v) break;
|
|
2526
2526
|
R.count += I.count, R.sumIdeal += I.sumIdeal, S.pop();
|
|
2527
2527
|
}
|
|
2528
2528
|
if (S.length > 0) {
|
|
2529
2529
|
const b = S[0], R = b.sumIdeal / b.count - (b.count - 1) * v / 2;
|
|
2530
2530
|
if (R < w)
|
|
2531
2531
|
for (b.sumIdeal += (w - R) * b.count; S.length >= 2; ) {
|
|
2532
|
-
const I = S[0], C = S[1],
|
|
2533
|
-
if (
|
|
2532
|
+
const I = S[0], C = S[1], W = I.sumIdeal / I.count, D = C.sumIdeal / C.count, V = W + (I.count - 1) * v / 2;
|
|
2533
|
+
if (D - (C.count - 1) * v / 2 >= V + v) break;
|
|
2534
2534
|
I.count += C.count, I.sumIdeal += C.sumIdeal, S.splice(1, 1);
|
|
2535
2535
|
}
|
|
2536
2536
|
}
|
|
@@ -2538,8 +2538,8 @@ bs = function(i) {
|
|
|
2538
2538
|
const b = S[S.length - 1], R = b.sumIdeal / b.count + (b.count - 1) * v / 2;
|
|
2539
2539
|
if (R > x)
|
|
2540
2540
|
for (b.sumIdeal -= (R - x) * b.count; S.length >= 2; ) {
|
|
2541
|
-
const I = S[S.length - 2], C = S[S.length - 1],
|
|
2542
|
-
if (
|
|
2541
|
+
const I = S[S.length - 2], C = S[S.length - 1], W = I.sumIdeal / I.count, D = C.sumIdeal / C.count, V = W + (I.count - 1) * v / 2;
|
|
2542
|
+
if (D - (C.count - 1) * v / 2 >= V + v) break;
|
|
2543
2543
|
I.count += C.count, I.sumIdeal += C.sumIdeal, S.pop();
|
|
2544
2544
|
}
|
|
2545
2545
|
}
|
|
@@ -2567,17 +2567,17 @@ bs = function(i) {
|
|
|
2567
2567
|
}
|
|
2568
2568
|
return d;
|
|
2569
2569
|
};
|
|
2570
|
-
function
|
|
2570
|
+
function ra(i) {
|
|
2571
2571
|
return parseInt(i.slice(1, 3), 16) * 0.299 + parseInt(i.slice(3, 5), 16) * 0.587 + parseInt(i.slice(5, 7), 16) * 0.114 < 128;
|
|
2572
2572
|
}
|
|
2573
2573
|
function Z(i) {
|
|
2574
|
-
var t, e, n, s, r, a, l, h, d, c, u, f, m, g, p, v, w, x, y, M, S, F, b, R, I, C,
|
|
2575
|
-
const { background: j, name: yt = "Custom", description: xt, fontUrl: Tt = null } = i, Q =
|
|
2574
|
+
var t, e, n, s, r, a, l, h, d, c, u, f, m, g, p, v, w, x, y, M, S, F, b, R, I, C, W, D, V, P, _, N, H, st;
|
|
2575
|
+
const { background: j, name: yt = "Custom", description: xt, fontUrl: Tt = null } = i, Q = ra(j), Qt = Q ? "#d1d4dc" : "#24292f", wt = Q ? "#787b86" : "#8b949e", ft = Q ? "#26a69a" : "#2da44e", gt = Q ? "#ef5350" : "#cf222e", Yt = Q ? "#2962ff" : "#0969da", Rt = Q ? "rgba(42,46,57,0.6)" : "rgba(200,200,200,0.5)", Zt = Q ? "rgba(150,150,150,0.5)" : "rgba(170,170,170,0.3)", _e = Q ? Ge(j, 0.1) : tn(j, 0.05), mi = Q ? Le(j, 0.92) : Le(j, 0.95), pi = Q ? Le(Ge(j, 0.15), 0.6) : "rgba(200,200,200,0.5)", rt = zi, mt = ((e = (t = i.candlestick) == null ? void 0 : t.up) == null ? void 0 : e.body) ?? ft, te = ((s = (n = i.candlestick) == null ? void 0 : n.down) == null ? void 0 : s.body) ?? gt, Oi = kt(mt), bi = kt(te), Oe = ((r = i.line) == null ? void 0 : r.color) ?? Yt, bn = ((a = i.tooltip) == null ? void 0 : a.textColor) ?? Qt, vn = ((l = i.axis) == null ? void 0 : l.textColor) ?? wt, Ys = ((h = i.typography) == null ? void 0 : h.fontFamily) ?? rt, yn = ((d = i.typography) == null ? void 0 : d.fontSize) ?? 12, Es = i.chartGradient ?? (Q ? [Ge(j, 0.04), tn(j, 0.06)] : [Ge(j, 0.06), j]), _s = {
|
|
2576
2576
|
background: j,
|
|
2577
|
-
chartGradient:
|
|
2577
|
+
chartGradient: Es,
|
|
2578
2578
|
typography: {
|
|
2579
|
-
fontFamily:
|
|
2580
|
-
fontSize:
|
|
2579
|
+
fontFamily: Ys,
|
|
2580
|
+
fontSize: yn
|
|
2581
2581
|
},
|
|
2582
2582
|
grid: {
|
|
2583
2583
|
color: ((c = i.grid) == null ? void 0 : c.color) ?? Rt,
|
|
@@ -2586,74 +2586,74 @@ function Z(i) {
|
|
|
2586
2586
|
candlestick: {
|
|
2587
2587
|
up: {
|
|
2588
2588
|
body: mt,
|
|
2589
|
-
wick: ((m = (f = i.candlestick) == null ? void 0 : f.up) == null ? void 0 : m.wick) ??
|
|
2589
|
+
wick: ((m = (f = i.candlestick) == null ? void 0 : f.up) == null ? void 0 : m.wick) ?? Oi
|
|
2590
2590
|
},
|
|
2591
2591
|
down: {
|
|
2592
|
-
body:
|
|
2593
|
-
wick: ((p = (g = i.candlestick) == null ? void 0 : g.down) == null ? void 0 : p.wick) ??
|
|
2592
|
+
body: te,
|
|
2593
|
+
wick: ((p = (g = i.candlestick) == null ? void 0 : g.down) == null ? void 0 : p.wick) ?? bi
|
|
2594
2594
|
}
|
|
2595
2595
|
},
|
|
2596
2596
|
line: {
|
|
2597
|
-
color:
|
|
2597
|
+
color: Oe,
|
|
2598
2598
|
width: ((v = i.line) == null ? void 0 : v.width) ?? 1,
|
|
2599
|
-
areaTopColor: ((w = i.line) == null ? void 0 : w.areaTopColor) ??
|
|
2600
|
-
areaBottomColor: ((x = i.line) == null ? void 0 : x.areaBottomColor) ??
|
|
2599
|
+
areaTopColor: ((w = i.line) == null ? void 0 : w.areaTopColor) ?? Le(Oe, 0.08),
|
|
2600
|
+
areaBottomColor: ((x = i.line) == null ? void 0 : x.areaBottomColor) ?? Le(Oe, 0.01)
|
|
2601
2601
|
},
|
|
2602
|
-
seriesColors: i.seriesColors ?? [
|
|
2602
|
+
seriesColors: i.seriesColors ?? [Oe, ft, gt],
|
|
2603
2603
|
bands: {
|
|
2604
|
-
upper: ((y = i.bands) == null ? void 0 : y.upper) ??
|
|
2605
|
-
lower: ((M = i.bands) == null ? void 0 : M.lower) ??
|
|
2604
|
+
upper: ((y = i.bands) == null ? void 0 : y.upper) ?? Oe,
|
|
2605
|
+
lower: ((M = i.bands) == null ? void 0 : M.lower) ?? bi
|
|
2606
2606
|
},
|
|
2607
2607
|
crosshair: {
|
|
2608
|
-
color: ((S = i.crosshair) == null ? void 0 : S.color) ??
|
|
2609
|
-
labelBackground: ((F = i.crosshair) == null ? void 0 : F.labelBackground) ??
|
|
2610
|
-
labelTextColor: ((b = i.crosshair) == null ? void 0 : b.labelTextColor) ??
|
|
2608
|
+
color: ((S = i.crosshair) == null ? void 0 : S.color) ?? Zt,
|
|
2609
|
+
labelBackground: ((F = i.crosshair) == null ? void 0 : F.labelBackground) ?? _e,
|
|
2610
|
+
labelTextColor: ((b = i.crosshair) == null ? void 0 : b.labelTextColor) ?? bn
|
|
2611
2611
|
},
|
|
2612
2612
|
axis: {
|
|
2613
2613
|
fontSize: ((R = i.axis) == null ? void 0 : R.fontSize) ?? 10,
|
|
2614
|
-
textColor:
|
|
2614
|
+
textColor: vn,
|
|
2615
2615
|
// Shallow-copy the override so later caller mutations don't leak into the theme.
|
|
2616
2616
|
...(I = i.axis) != null && I.x ? { x: { ...i.axis.x } } : {},
|
|
2617
2617
|
...(C = i.axis) != null && C.y ? { y: { ...i.axis.y } } : {}
|
|
2618
2618
|
},
|
|
2619
2619
|
yLabel: {
|
|
2620
|
-
fontSize: ((
|
|
2621
|
-
upBackground: ((
|
|
2622
|
-
downBackground: ((V = i.yLabel) == null ? void 0 : V.downBackground) ??
|
|
2623
|
-
neutralBackground: ((
|
|
2620
|
+
fontSize: ((W = i.yLabel) == null ? void 0 : W.fontSize) ?? 11,
|
|
2621
|
+
upBackground: ((D = i.yLabel) == null ? void 0 : D.upBackground) ?? Oi,
|
|
2622
|
+
downBackground: ((V = i.yLabel) == null ? void 0 : V.downBackground) ?? bi,
|
|
2623
|
+
neutralBackground: ((P = i.yLabel) == null ? void 0 : P.neutralBackground) ?? _e,
|
|
2624
2624
|
textColor: ((_ = i.yLabel) == null ? void 0 : _.textColor) ?? "#ffffff"
|
|
2625
2625
|
},
|
|
2626
2626
|
tooltip: {
|
|
2627
|
-
fontSize: ((N = i.tooltip) == null ? void 0 : N.fontSize) ??
|
|
2628
|
-
background: ((H = i.tooltip) == null ? void 0 : H.background) ??
|
|
2629
|
-
textColor:
|
|
2630
|
-
borderColor: ((st = i.tooltip) == null ? void 0 : st.borderColor) ??
|
|
2627
|
+
fontSize: ((N = i.tooltip) == null ? void 0 : N.fontSize) ?? yn,
|
|
2628
|
+
background: ((H = i.tooltip) == null ? void 0 : H.background) ?? mi,
|
|
2629
|
+
textColor: bn,
|
|
2630
|
+
borderColor: ((st = i.tooltip) == null ? void 0 : st.borderColor) ?? pi
|
|
2631
2631
|
},
|
|
2632
|
-
navigator:
|
|
2632
|
+
navigator: aa({
|
|
2633
2633
|
dark: Q,
|
|
2634
2634
|
bg: j,
|
|
2635
|
-
neutralFg:
|
|
2635
|
+
neutralFg: vn,
|
|
2636
2636
|
upBody: mt,
|
|
2637
|
-
downBody:
|
|
2638
|
-
upBase:
|
|
2639
|
-
downBase:
|
|
2637
|
+
downBody: te,
|
|
2638
|
+
upBase: Oi,
|
|
2639
|
+
downBase: bi,
|
|
2640
2640
|
config: i.navigator
|
|
2641
2641
|
})
|
|
2642
2642
|
};
|
|
2643
|
-
return { name: yt, description: xt, fontUrl: Tt, dark: Q, theme:
|
|
2643
|
+
return { name: yt, description: xt, fontUrl: Tt, dark: Q, theme: _s };
|
|
2644
2644
|
}
|
|
2645
|
-
function
|
|
2645
|
+
function aa(i) {
|
|
2646
2646
|
var t, e, n, s, r, a, l, h, d, c, u, f, m, g, p, v, w, x;
|
|
2647
|
-
const { dark: y, bg: M, neutralFg: S, upBody: F, downBody: b, upBase: R, downBase: I, config: C } = i,
|
|
2647
|
+
const { dark: y, bg: M, neutralFg: S, upBody: F, downBody: b, upBase: R, downBase: I, config: C } = i, W = (C == null ? void 0 : C.background) ?? "transparent", D = y ? "rgba(255,255,255,1)" : "rgba(0,0,0,1)", V = ((t = C == null ? void 0 : C.handle) == null ? void 0 : t.color) ?? He(D, 0.3), P = ((e = C == null ? void 0 : C.mask) == null ? void 0 : e.fill) ?? He(M, y ? 0.78 : 0.82);
|
|
2648
2648
|
return {
|
|
2649
2649
|
height: (C == null ? void 0 : C.height) ?? 48,
|
|
2650
|
-
background:
|
|
2651
|
-
borderColor: (C == null ? void 0 : C.borderColor) ??
|
|
2650
|
+
background: W,
|
|
2651
|
+
borderColor: (C == null ? void 0 : C.borderColor) ?? He(S, y ? 0.18 : 0.22),
|
|
2652
2652
|
line: {
|
|
2653
2653
|
color: ((n = C == null ? void 0 : C.line) == null ? void 0 : n.color) ?? S,
|
|
2654
2654
|
width: ((s = C == null ? void 0 : C.line) == null ? void 0 : s.width) ?? 1,
|
|
2655
|
-
areaTopColor: ((r = C == null ? void 0 : C.line) == null ? void 0 : r.areaTopColor) ??
|
|
2656
|
-
areaBottomColor: ((a = C == null ? void 0 : C.line) == null ? void 0 : a.areaBottomColor) ??
|
|
2655
|
+
areaTopColor: ((r = C == null ? void 0 : C.line) == null ? void 0 : r.areaTopColor) ?? He(S, y ? 0.22 : 0.18),
|
|
2656
|
+
areaBottomColor: ((a = C == null ? void 0 : C.line) == null ? void 0 : a.areaBottomColor) ?? He(S, 0)
|
|
2657
2657
|
},
|
|
2658
2658
|
candlestick: {
|
|
2659
2659
|
up: {
|
|
@@ -2676,144 +2676,84 @@ function ra(i) {
|
|
|
2676
2676
|
width: ((x = C == null ? void 0 : C.handle) == null ? void 0 : x.width) ?? 6
|
|
2677
2677
|
},
|
|
2678
2678
|
mask: {
|
|
2679
|
-
fill:
|
|
2679
|
+
fill: P
|
|
2680
2680
|
}
|
|
2681
2681
|
};
|
|
2682
2682
|
}
|
|
2683
|
-
function
|
|
2684
|
-
if (i.startsWith("#") && i.length === 7) return
|
|
2683
|
+
function He(i, t) {
|
|
2684
|
+
if (i.startsWith("#") && i.length === 7) return Le(i, t);
|
|
2685
2685
|
const e = i.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);
|
|
2686
2686
|
return e ? `rgba(${e[1]},${e[2]},${e[3]},${t})` : i;
|
|
2687
2687
|
}
|
|
2688
|
-
function
|
|
2688
|
+
function Le(i, t) {
|
|
2689
2689
|
const e = parseInt(i.slice(1, 3), 16), n = parseInt(i.slice(3, 5), 16), s = parseInt(i.slice(5, 7), 16);
|
|
2690
2690
|
return `rgba(${e}, ${n}, ${s}, ${t})`;
|
|
2691
2691
|
}
|
|
2692
|
-
function
|
|
2692
|
+
function Ge(i, t) {
|
|
2693
2693
|
if (!i.startsWith("#")) return i;
|
|
2694
2694
|
const e = Math.min(255, Math.round(parseInt(i.slice(1, 3), 16) + 255 * t)), n = Math.min(255, Math.round(parseInt(i.slice(3, 5), 16) + 255 * t)), s = Math.min(255, Math.round(parseInt(i.slice(5, 7), 16) + 255 * t));
|
|
2695
2695
|
return `#${e.toString(16).padStart(2, "0")}${n.toString(16).padStart(2, "0")}${s.toString(16).padStart(2, "0")}`;
|
|
2696
2696
|
}
|
|
2697
|
-
function
|
|
2697
|
+
function tn(i, t) {
|
|
2698
2698
|
if (!i.startsWith("#")) return i;
|
|
2699
2699
|
const e = Math.max(0, Math.round(parseInt(i.slice(1, 3), 16) * (1 - t))), n = Math.max(0, Math.round(parseInt(i.slice(3, 5), 16) * (1 - t))), s = Math.max(0, Math.round(parseInt(i.slice(5, 7), 16) * (1 - t)));
|
|
2700
2700
|
return `#${e.toString(16).padStart(2, "0")}${n.toString(16).padStart(2, "0")}${s.toString(16).padStart(2, "0")}`;
|
|
2701
2701
|
}
|
|
2702
2702
|
function z(i) {
|
|
2703
|
-
const t = i.startsWith("#") && i.length === 7 ? [
|
|
2703
|
+
const t = i.startsWith("#") && i.length === 7 ? [Ge(i, 0.2), tn(i, 0.15)] : [i, i];
|
|
2704
2704
|
return Object.defineProperty(t, "source", { value: i, enumerable: !1 }), t;
|
|
2705
2705
|
}
|
|
2706
|
-
const
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
fontSize: 12
|
|
2712
|
-
},
|
|
2713
|
-
grid: {
|
|
2714
|
-
color: "rgba(42, 46, 57, 0.6)",
|
|
2715
|
-
style: "dashed"
|
|
2716
|
-
},
|
|
2706
|
+
const Bi = "'JetBrains Mono', 'Fira Code', monospace", Pi = "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap", zi = "'Outfit', -apple-system, BlinkMacSystemFont, sans-serif", un = "https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600&display=swap", ys = "'Roboto Mono', monospace", xs = "https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;600&display=swap", oa = "'IBM Plex Mono', monospace", la = "https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap", dn = "'Fira Code', monospace", fn = "https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap", ws = "'Source Code Pro', monospace", Ss = "https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500;600&display=swap", ha = "'Space Mono', monospace", ca = "https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap", gn = "'Plus Jakarta Sans', sans-serif", mn = "https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap", ua = "'Caveat', 'Comic Sans MS', cursive", da = "https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&display=swap", fa = Z({
|
|
2707
|
+
name: "Catppuccin",
|
|
2708
|
+
description: "Pastel tones on a mocha base",
|
|
2709
|
+
background: "#1e1e2e",
|
|
2710
|
+
grid: { color: "rgba(49,50,68,0.8)" },
|
|
2717
2711
|
candlestick: {
|
|
2718
|
-
up: { body: z("#
|
|
2719
|
-
down: { body: z("#
|
|
2720
|
-
},
|
|
2721
|
-
line: {
|
|
2722
|
-
color: "#2962FF",
|
|
2723
|
-
width: 1,
|
|
2724
|
-
areaTopColor: "rgba(41, 98, 255, 0.08)",
|
|
2725
|
-
areaBottomColor: "rgba(41, 98, 255, 0.01)"
|
|
2712
|
+
up: { body: z("#a6e3a1"), wick: "#a6e3a1" },
|
|
2713
|
+
down: { body: z("#f38ba8"), wick: "#f38ba8" }
|
|
2726
2714
|
},
|
|
2715
|
+
line: { color: "#89b4fa" },
|
|
2727
2716
|
seriesColors: [
|
|
2728
|
-
"#
|
|
2729
|
-
"#
|
|
2730
|
-
"#
|
|
2731
|
-
"#
|
|
2732
|
-
"#
|
|
2733
|
-
"#
|
|
2734
|
-
"#
|
|
2735
|
-
"#
|
|
2736
|
-
"#
|
|
2737
|
-
"#
|
|
2717
|
+
"#89b4fa",
|
|
2718
|
+
"#fab387",
|
|
2719
|
+
"#a6e3a1",
|
|
2720
|
+
"#cba6f7",
|
|
2721
|
+
"#f38ba8",
|
|
2722
|
+
"#f9e2af",
|
|
2723
|
+
"#94e2d5",
|
|
2724
|
+
"#eba0ac",
|
|
2725
|
+
"#74c7ec",
|
|
2726
|
+
"#cba6f7"
|
|
2738
2727
|
],
|
|
2739
|
-
bands: {
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
},
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
labelTextColor: "#d1d4dc"
|
|
2747
|
-
},
|
|
2748
|
-
axis: {
|
|
2749
|
-
fontSize: 10,
|
|
2750
|
-
textColor: "#787b86"
|
|
2751
|
-
},
|
|
2752
|
-
yLabel: {
|
|
2753
|
-
fontSize: 11,
|
|
2754
|
-
upBackground: "#26a69a",
|
|
2755
|
-
downBackground: "#ef5350",
|
|
2756
|
-
neutralBackground: "#363a45",
|
|
2757
|
-
textColor: "#ffffff"
|
|
2758
|
-
},
|
|
2759
|
-
tooltip: {
|
|
2760
|
-
fontSize: 12,
|
|
2761
|
-
background: "rgba(19, 23, 34, 0.9)",
|
|
2762
|
-
textColor: "#d1d4dc",
|
|
2763
|
-
borderColor: "rgba(42, 46, 57, 0.8)"
|
|
2764
|
-
},
|
|
2765
|
-
navigator: {
|
|
2766
|
-
height: 48,
|
|
2767
|
-
background: "transparent",
|
|
2768
|
-
borderColor: "rgba(120, 123, 134, 0.18)",
|
|
2769
|
-
line: {
|
|
2770
|
-
color: "#787b86",
|
|
2771
|
-
width: 1,
|
|
2772
|
-
areaTopColor: "rgba(120, 123, 134, 0.22)",
|
|
2773
|
-
areaBottomColor: "rgba(120, 123, 134, 0)"
|
|
2774
|
-
},
|
|
2775
|
-
candlestick: {
|
|
2776
|
-
up: { body: z("#26a69a"), wick: "#26a69a" },
|
|
2777
|
-
down: { body: z("#ef5350"), wick: "#ef5350" }
|
|
2778
|
-
},
|
|
2779
|
-
window: {
|
|
2780
|
-
fill: "transparent",
|
|
2781
|
-
border: "transparent",
|
|
2782
|
-
borderWidth: 0
|
|
2783
|
-
},
|
|
2784
|
-
handle: {
|
|
2785
|
-
color: "rgba(255, 255, 255, 0.30)",
|
|
2786
|
-
width: 6
|
|
2787
|
-
},
|
|
2788
|
-
// Mask = page bg at high alpha. Outside the window the sparkline is
|
|
2789
|
-
// washed out by this color, so the visible window reads as a spotlight.
|
|
2790
|
-
mask: {
|
|
2791
|
-
fill: "rgba(19, 23, 34, 0.78)"
|
|
2792
|
-
}
|
|
2793
|
-
}
|
|
2794
|
-
}, te = {
|
|
2728
|
+
bands: { upper: "#74c7ec", lower: "#f38ba8" },
|
|
2729
|
+
crosshair: { color: "rgba(108,112,134,0.4)", labelBackground: "#313244" },
|
|
2730
|
+
axis: { textColor: "#6c7086" },
|
|
2731
|
+
tooltip: { background: "rgba(30,30,46,0.92)", textColor: "#cdd6f4", borderColor: "rgba(49,50,68,0.6)" },
|
|
2732
|
+
typography: { fontFamily: zi },
|
|
2733
|
+
fontUrl: un
|
|
2734
|
+
}), ee = {
|
|
2795
2735
|
top: 20,
|
|
2796
2736
|
bottom: 20,
|
|
2797
2737
|
right: { intervals: 3 },
|
|
2798
2738
|
left: { intervals: 0 }
|
|
2799
|
-
},
|
|
2739
|
+
}, ga = 0.1, ma = 0.3, pa = 0.4, ba = 0.5, va = 4, ya = (i, t, e) => ({
|
|
2800
2740
|
from: bt(i.from, t.from, e),
|
|
2801
2741
|
to: bt(i.to, t.to, e)
|
|
2802
|
-
}),
|
|
2742
|
+
}), xa = (i, t) => i.from === t.from && i.to === t.to;
|
|
2803
2743
|
var lt, At, at;
|
|
2804
|
-
class
|
|
2744
|
+
class wa extends gi {
|
|
2805
2745
|
constructor({ padding: t, reboundMs: e } = {}) {
|
|
2806
2746
|
super(), L(this, lt), T(this, "_yRange", { min: 0, max: 0 }), T(this, "_autoScroll", !0), T(this, "padding"), T(this, "reboundMs"), T(this, "dataInterval", 6e4), L(this, At, null), L(this, at, null), T(this, "_prevDataEnd", null), T(this, "_lastChartWidth", 0), this.padding = {
|
|
2807
|
-
top: (t == null ? void 0 : t.top) ??
|
|
2808
|
-
bottom: (t == null ? void 0 : t.bottom) ??
|
|
2809
|
-
right: (t == null ? void 0 : t.right) ??
|
|
2810
|
-
left: (t == null ? void 0 : t.left) ??
|
|
2811
|
-
}, this.reboundMs = e ??
|
|
2747
|
+
top: (t == null ? void 0 : t.top) ?? ee.top,
|
|
2748
|
+
bottom: (t == null ? void 0 : t.bottom) ?? ee.bottom,
|
|
2749
|
+
right: (t == null ? void 0 : t.right) ?? ee.right,
|
|
2750
|
+
left: (t == null ? void 0 : t.left) ?? ee.left
|
|
2751
|
+
}, this.reboundMs = e ?? is, k(this, lt, new Ee({
|
|
2812
2752
|
initial: { from: 0, to: 0 },
|
|
2813
|
-
duration:
|
|
2814
|
-
easing:
|
|
2815
|
-
lerp:
|
|
2816
|
-
equals:
|
|
2753
|
+
duration: xi.streamTick,
|
|
2754
|
+
easing: xe,
|
|
2755
|
+
lerp: ya,
|
|
2756
|
+
equals: xa
|
|
2817
2757
|
}));
|
|
2818
2758
|
}
|
|
2819
2759
|
/**
|
|
@@ -2872,10 +2812,10 @@ class xa extends fi {
|
|
|
2872
2812
|
/** Replace padding configuration. Only updates fields that are provided; others keep defaults. */
|
|
2873
2813
|
setPadding(t) {
|
|
2874
2814
|
this.padding = {
|
|
2875
|
-
top: (t == null ? void 0 : t.top) ??
|
|
2876
|
-
bottom: (t == null ? void 0 : t.bottom) ??
|
|
2877
|
-
right: (t == null ? void 0 : t.right) ??
|
|
2878
|
-
left: (t == null ? void 0 : t.left) ??
|
|
2815
|
+
top: (t == null ? void 0 : t.top) ?? ee.top,
|
|
2816
|
+
bottom: (t == null ? void 0 : t.bottom) ?? ee.bottom,
|
|
2817
|
+
right: (t == null ? void 0 : t.right) ?? ee.right,
|
|
2818
|
+
left: (t == null ? void 0 : t.left) ?? ee.left
|
|
2879
2819
|
};
|
|
2880
2820
|
}
|
|
2881
2821
|
/** Read the currently-resolved padding — used by `ChartInstance.setPadding`
|
|
@@ -3032,7 +2972,7 @@ class xa extends fi {
|
|
|
3032
2972
|
if (l <= 0) return;
|
|
3033
2973
|
const h = this.softMinRange, { left: d, right: c } = this.getSoftBounds(l, n), u = d !== null && c !== null ? c - d : this.softMaxRange();
|
|
3034
2974
|
let f = e;
|
|
3035
|
-
const m = h *
|
|
2975
|
+
const m = h * pa;
|
|
3036
2976
|
if (e < 1 && l < h) {
|
|
3037
2977
|
const x = h - l, y = (1 - Math.min(1, x / m)) ** 2;
|
|
3038
2978
|
f = 1 - (1 - e) * y;
|
|
@@ -3070,7 +3010,7 @@ class xa extends fi {
|
|
|
3070
3010
|
e > 0 && (this._lastChartWidth = e), this.cancelPendingAnimation();
|
|
3071
3011
|
const { from: s, to: r } = this.logicalRange, a = r - s;
|
|
3072
3012
|
if (a <= 0) return;
|
|
3073
|
-
const { left: l, right: h } = this.getSoftBounds(a, e), d = a *
|
|
3013
|
+
const { left: l, right: h } = this.getSoftBounds(a, e), d = a * ma;
|
|
3074
3014
|
let c = t;
|
|
3075
3015
|
if (t > 0 && h !== null) {
|
|
3076
3016
|
const g = Math.max(0, r - h);
|
|
@@ -3122,7 +3062,7 @@ class xa extends fi {
|
|
|
3122
3062
|
}
|
|
3123
3063
|
const f = Math.abs(h - e), m = Math.abs(d - n);
|
|
3124
3064
|
if (f < 1 && m < 1) return;
|
|
3125
|
-
const g = s *
|
|
3065
|
+
const g = s * ga;
|
|
3126
3066
|
let p = null, v = 0, w = 0;
|
|
3127
3067
|
u !== null && n - u > g ? (p = "right", v = n - u, w = u) : c !== null && c - e > g && (p = "left", v = c - e, w = c), this.reboundMs <= 0 ? this.applyLogical(h, d) : this.retargetLogical(h, d, this.reboundMs), this.emit("interact"), p !== null && this.emit("edgeReached", {
|
|
3128
3068
|
side: p,
|
|
@@ -3145,7 +3085,7 @@ class xa extends fi {
|
|
|
3145
3085
|
let u = e + d, f = t - c;
|
|
3146
3086
|
u - f > a && (u = e + d, f = u - a);
|
|
3147
3087
|
const { from: m, to: g } = this.logicalRange;
|
|
3148
|
-
s && !(m === 0 && g === 0) ? this.retargetLogical(f, u, r ??
|
|
3088
|
+
s && !(m === 0 && g === 0) ? this.retargetLogical(f, u, r ?? xi.fit) : this.applyLogical(f, u);
|
|
3149
3089
|
}
|
|
3150
3090
|
/**
|
|
3151
3091
|
* Keep the right edge pinned to the latest data (real-time auto-scroll).
|
|
@@ -3166,8 +3106,8 @@ class xa extends fi {
|
|
|
3166
3106
|
if (r <= 0) return;
|
|
3167
3107
|
const a = this.resolveHPad(this.padding.right, r, e), l = s, h = this._prevDataEnd !== null ? l - this._prevDataEnd : a, d = Math.max(0, Math.min(a, h)), c = t + d, u = c - r;
|
|
3168
3108
|
this._autoScroll = !0;
|
|
3169
|
-
const f =
|
|
3170
|
-
Math.abs(c - s) < g || (this.retargetLogical(u, c,
|
|
3109
|
+
const f = ba * this.dataInterval, m = e > 0 ? va / e * r : f, g = Math.min(f, m);
|
|
3110
|
+
Math.abs(c - s) < g || (this.retargetLogical(u, c, xi.streamTick), this._prevDataEnd = o(this, at));
|
|
3171
3111
|
}
|
|
3172
3112
|
/** Return the number of data bars (candles/points) currently visible. */
|
|
3173
3113
|
getVisibleBarsCount() {
|
|
@@ -3179,94 +3119,94 @@ class xa extends fi {
|
|
|
3179
3119
|
}
|
|
3180
3120
|
}
|
|
3181
3121
|
lt = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap();
|
|
3182
|
-
function
|
|
3122
|
+
function ke(i, t) {
|
|
3183
3123
|
return i === !1 || i === 0 ? 0 : i === void 0 ? t : i;
|
|
3184
3124
|
}
|
|
3185
|
-
function
|
|
3125
|
+
function On(i) {
|
|
3186
3126
|
if (i === !1)
|
|
3187
3127
|
return {
|
|
3188
3128
|
points: { enterMs: 0, smoothMs: 0, pulseMs: 0 },
|
|
3189
3129
|
viewport: { reboundMs: 0, yAxisMs: 0, inputResponseMs: 0 }
|
|
3190
3130
|
};
|
|
3191
3131
|
const t = i === !0 || i === void 0 ? void 0 : i, e = t == null ? void 0 : t.points, n = t == null ? void 0 : t.viewport, s = e === !1 ? { enterMs: 0, smoothMs: 0, pulseMs: 0 } : {
|
|
3192
|
-
enterMs:
|
|
3193
|
-
smoothMs:
|
|
3194
|
-
pulseMs:
|
|
3132
|
+
enterMs: ke(e == null ? void 0 : e.enterMs, we),
|
|
3133
|
+
smoothMs: ke(e == null ? void 0 : e.smoothMs, ln),
|
|
3134
|
+
pulseMs: ke(e == null ? void 0 : e.pulseMs, es)
|
|
3195
3135
|
}, r = n === !1 ? { reboundMs: 0, yAxisMs: 0, inputResponseMs: 0 } : {
|
|
3196
|
-
reboundMs:
|
|
3197
|
-
yAxisMs:
|
|
3198
|
-
inputResponseMs:
|
|
3136
|
+
reboundMs: ke(n == null ? void 0 : n.reboundMs, is),
|
|
3137
|
+
yAxisMs: ke(n == null ? void 0 : n.yAxisMs, Ji),
|
|
3138
|
+
inputResponseMs: ke(n == null ? void 0 : n.inputResponseMs, Ns)
|
|
3199
3139
|
};
|
|
3200
3140
|
return { points: s, viewport: r };
|
|
3201
3141
|
}
|
|
3202
|
-
function
|
|
3142
|
+
function Sa(i) {
|
|
3203
3143
|
if (!i) return { monitor: null, ownsMonitor: !1, showHud: !1 };
|
|
3204
|
-
if (i === !0) return { monitor: new
|
|
3205
|
-
if (i instanceof
|
|
3144
|
+
if (i === !0) return { monitor: new Ui(), ownsMonitor: !0, showHud: !0 };
|
|
3145
|
+
if (i instanceof Ui) return { monitor: i, ownsMonitor: !1, showHud: !1 };
|
|
3206
3146
|
const { hud: t, monitor: e, ...n } = i, s = e !== void 0;
|
|
3207
3147
|
return {
|
|
3208
|
-
monitor: e ?? new
|
|
3148
|
+
monitor: e ?? new Ui(n),
|
|
3209
3149
|
ownsMonitor: !s,
|
|
3210
3150
|
showHud: t ?? !s
|
|
3211
3151
|
};
|
|
3212
3152
|
}
|
|
3213
|
-
let
|
|
3214
|
-
var et, O, q,
|
|
3215
|
-
class
|
|
3153
|
+
let Ma = 0;
|
|
3154
|
+
var et, O, q, Ot, Ae, Y, tt, je, dt, Ht, ot, ae, en, We, Wt, Mi, ki, Xt, Ke, me, ci, Li, Bt, $t, qe, Je, J, oe, Hn, Ci, Qe, Ze, Ms, ks, Ti, ti, ne, se, De, ei;
|
|
3155
|
+
class ka extends gi {
|
|
3216
3156
|
constructor(t, e) {
|
|
3217
3157
|
var n, s, r, a;
|
|
3218
|
-
super(), L(this, J), L(this, et), L(this, O), L(this, q), L(this,
|
|
3158
|
+
super(), L(this, J), L(this, et), L(this, O), L(this, q), L(this, Ot), T(this, "timeScale"), T(this, "yScale"), L(this, Ae), L(this, Y, []), L(this, tt), L(this, je), L(this, dt, 6e4), L(this, Ht, null), L(this, ot, {}), L(this, ae, null), L(this, en, !1), L(this, We, {}), L(this, Wt, { left: "idle", right: "idle" }), L(this, Mi, { left: null, right: null }), L(this, ki), L(this, Xt, 0), L(this, Ke, !1), L(this, me, !1), L(this, ci, !1), L(this, Li, 0), L(this, Bt), L(this, $t), L(this, qe, !1), L(this, Je, null), L(this, Ti, 0), L(this, ti, !1), L(this, ne, new Ee({
|
|
3219
3159
|
initial: 0,
|
|
3220
|
-
duration:
|
|
3221
|
-
easing:
|
|
3160
|
+
duration: Ji,
|
|
3161
|
+
easing: xe,
|
|
3222
3162
|
lerp: (c, u, f) => c + (u - c) * f
|
|
3223
|
-
})), L(this,
|
|
3163
|
+
})), L(this, se, new Ee({
|
|
3224
3164
|
initial: 0,
|
|
3225
|
-
duration:
|
|
3226
|
-
easing:
|
|
3165
|
+
duration: Ji,
|
|
3166
|
+
easing: xe,
|
|
3227
3167
|
lerp: (c, u, f) => c + (u - c) * f
|
|
3228
|
-
})), L(this,
|
|
3229
|
-
const l =
|
|
3230
|
-
k(this,
|
|
3168
|
+
})), L(this, De, !1), L(this, ei, !1), e != null && e.axis && (k(this, We, e.axis), k(this, ot, { min: (n = e.axis.y) == null ? void 0 : n.min, max: (s = e.axis.y) == null ? void 0 : s.max })), k(this, tt, (e == null ? void 0 : e.theme) ?? fa.theme), k(this, je, ((r = e == null ? void 0 : e.grid) == null ? void 0 : r.visible) !== !1), k(this, Bt, On(e == null ? void 0 : e.animations)), k(this, ki, e == null ? void 0 : e.onEdgeReached);
|
|
3169
|
+
const l = Sa(e == null ? void 0 : e.perf);
|
|
3170
|
+
k(this, $t, l.monitor), k(this, qe, l.ownsMonitor), k(this, et, new Xs(t, o(this, $t) ?? void 0)), k(this, O, new wa({
|
|
3231
3171
|
padding: e == null ? void 0 : e.padding,
|
|
3232
|
-
reboundMs: o(this,
|
|
3233
|
-
})),
|
|
3234
|
-
const h = o(this,
|
|
3235
|
-
h ? (k(this, q, new
|
|
3172
|
+
reboundMs: o(this, Bt).viewport.reboundMs
|
|
3173
|
+
})), hr(this, o(this, O)), this.timeScale = new as(), this.yScale = new cs();
|
|
3174
|
+
const h = o(this, $t);
|
|
3175
|
+
h ? (k(this, q, new vi((c) => {
|
|
3236
3176
|
h.resetDrawCalls("main");
|
|
3237
3177
|
const u = performance.now();
|
|
3238
3178
|
this.renderMain(c), h.recordFrame("main", performance.now() - u, c);
|
|
3239
|
-
})), k(this,
|
|
3179
|
+
})), k(this, Ot, new vi((c) => {
|
|
3240
3180
|
h.resetDrawCalls("overlay");
|
|
3241
3181
|
const u = performance.now();
|
|
3242
3182
|
this.renderOverlay(c), h.recordFrame("overlay", performance.now() - u, c);
|
|
3243
|
-
})), l.showHud && k(this,
|
|
3183
|
+
})), l.showHud && k(this, Je, new mr(t, h))) : (k(this, q, new vi((c) => this.renderMain(c))), k(this, Ot, new vi((c) => this.renderOverlay(c))));
|
|
3244
3184
|
const d = (e == null ? void 0 : e.interactive) !== !1;
|
|
3245
|
-
k(this,
|
|
3185
|
+
k(this, Ae, d ? new or(
|
|
3246
3186
|
o(this, et).canvas,
|
|
3247
3187
|
o(this, O),
|
|
3248
3188
|
this.timeScale,
|
|
3249
3189
|
this.yScale,
|
|
3250
|
-
o(this,
|
|
3190
|
+
o(this, Bt).viewport.inputResponseMs
|
|
3251
3191
|
) : null), o(this, O).on("change", () => {
|
|
3252
3192
|
this.syncScales(), o(this, q).markDirty(), this.emit("viewportChange");
|
|
3253
3193
|
}), o(this, O).on("edgeReached", (c) => {
|
|
3254
3194
|
var u;
|
|
3255
|
-
o(this,
|
|
3195
|
+
o(this, Mi)[c.side] = c.boundaryTime, (u = o(this, ki)) == null || u.call(this, c);
|
|
3256
3196
|
}), o(this, O).on("interact", () => {
|
|
3257
|
-
k(this,
|
|
3197
|
+
k(this, ei, !0);
|
|
3258
3198
|
}), o(this, et).on("resize", () => {
|
|
3259
3199
|
this.updateScales(!0), this.renderMain(), this.emit("viewportChange");
|
|
3260
|
-
}), (a = o(this,
|
|
3261
|
-
k(this,
|
|
3200
|
+
}), (a = o(this, Ae)) == null || a.on("crosshairMove", (c) => {
|
|
3201
|
+
k(this, Ht, c), o(this, Ot).markDirty(), this.emit("crosshairMove", c), B(this, J, ks).call(this, c);
|
|
3262
3202
|
});
|
|
3263
3203
|
}
|
|
3264
3204
|
get yAxisWidth() {
|
|
3265
|
-
const t = o(this,
|
|
3205
|
+
const t = o(this, We).y;
|
|
3266
3206
|
return (t == null ? void 0 : t.visible) === !1 ? 0 : (t == null ? void 0 : t.width) ?? 55;
|
|
3267
3207
|
}
|
|
3268
3208
|
get xAxisHeight() {
|
|
3269
|
-
const t = o(this,
|
|
3209
|
+
const t = o(this, We).x;
|
|
3270
3210
|
return (t == null ? void 0 : t.visible) === !1 ? 0 : (t == null ? void 0 : t.height) ?? 30;
|
|
3271
3211
|
}
|
|
3272
3212
|
/**
|
|
@@ -3278,52 +3218,52 @@ class Ma extends fi {
|
|
|
3278
3218
|
* @internal
|
|
3279
3219
|
*/
|
|
3280
3220
|
getOverlayVersion() {
|
|
3281
|
-
return o(this,
|
|
3221
|
+
return o(this, Li);
|
|
3282
3222
|
}
|
|
3283
3223
|
/** Add a candlestick (OHLC) series and return its unique ID. */
|
|
3284
3224
|
addCandlestickSeries(t) {
|
|
3285
|
-
const e = new
|
|
3225
|
+
const e = new rs(), n = new jr(e, {
|
|
3286
3226
|
up: { ...o(this, tt).candlestick.up },
|
|
3287
3227
|
down: { ...o(this, tt).candlestick.down },
|
|
3288
3228
|
bodyWidthRatio: 0.6,
|
|
3289
|
-
...
|
|
3229
|
+
...B(this, J, Ci).call(this, "candle"),
|
|
3290
3230
|
...t,
|
|
3291
|
-
...
|
|
3231
|
+
...B(this, J, Qe).call(this)
|
|
3292
3232
|
});
|
|
3293
|
-
return
|
|
3233
|
+
return B(this, J, Ze).call(this, n, n.store, t ?? {});
|
|
3294
3234
|
}
|
|
3295
3235
|
/** Add a line series and return its unique ID. */
|
|
3296
3236
|
addLineSeries(t) {
|
|
3297
|
-
const { layers: e, ...n } = t ?? {}, s = e ?? 1, r = new
|
|
3237
|
+
const { layers: e, ...n } = t ?? {}, s = e ?? 1, r = new qr(s, {
|
|
3298
3238
|
colors: s === 1 ? [o(this, tt).line.color] : o(this, tt).seriesColors.slice(0, s),
|
|
3299
3239
|
strokeWidth: o(this, tt).line.width,
|
|
3300
3240
|
area: { visible: !0 },
|
|
3301
|
-
...
|
|
3241
|
+
...B(this, J, Ci).call(this, "line"),
|
|
3302
3242
|
...n,
|
|
3303
|
-
...
|
|
3243
|
+
...B(this, J, Qe).call(this)
|
|
3304
3244
|
});
|
|
3305
|
-
return
|
|
3245
|
+
return B(this, J, Ze).call(this, r, r.store, n);
|
|
3306
3246
|
}
|
|
3307
3247
|
/** Add a bar series and return its unique ID. */
|
|
3308
3248
|
addBarSeries(t) {
|
|
3309
|
-
const { layers: e, ...n } = t ?? {}, s = e ?? 1, r = new
|
|
3249
|
+
const { layers: e, ...n } = t ?? {}, s = e ?? 1, r = new Or(s, {
|
|
3310
3250
|
colors: o(this, tt).seriesColors.slice(0, s),
|
|
3311
3251
|
barWidthRatio: 0.6,
|
|
3312
|
-
...
|
|
3252
|
+
...B(this, J, Ci).call(this, "bar"),
|
|
3313
3253
|
...n,
|
|
3314
|
-
...
|
|
3254
|
+
...B(this, J, Qe).call(this)
|
|
3315
3255
|
});
|
|
3316
|
-
return
|
|
3256
|
+
return B(this, J, Ze).call(this, r, r.store, n);
|
|
3317
3257
|
}
|
|
3318
3258
|
/** Add a pie/donut series. Set `innerRadiusRatio > 0` for donut. */
|
|
3319
3259
|
addPieSeries(t) {
|
|
3320
|
-
const e = new
|
|
3321
|
-
return
|
|
3260
|
+
const e = new Si(t);
|
|
3261
|
+
return B(this, J, Ze).call(this, e, null, t ?? {});
|
|
3322
3262
|
}
|
|
3323
3263
|
/** Remove a series by ID and clean up its resources. */
|
|
3324
3264
|
removeSeries(t) {
|
|
3325
3265
|
const e = o(this, Y).findIndex((n) => n.id === t);
|
|
3326
|
-
e >= 0 && (o(this, Y)[e].renderer.dispose(), o(this, Y).splice(e, 1), k(this, ae, null), this.updateViewportPadding(), o(this, q).markDirty(), this.emit("seriesChange"),
|
|
3266
|
+
e >= 0 && (o(this, Y)[e].renderer.dispose(), o(this, Y).splice(e, 1), k(this, ae, null), this.updateViewportPadding(), o(this, q).markDirty(), this.emit("seriesChange"), B(this, J, oe).call(this));
|
|
3327
3267
|
}
|
|
3328
3268
|
/**
|
|
3329
3269
|
* Replace all data for a series.
|
|
@@ -3336,7 +3276,7 @@ class Ma extends fi {
|
|
|
3336
3276
|
*/
|
|
3337
3277
|
setSeriesData(t, e, n) {
|
|
3338
3278
|
const s = o(this, Y).find((r) => r.id === t);
|
|
3339
|
-
s && (k(this,
|
|
3279
|
+
s && (k(this, ti, !0), s.renderer.setData(e, n));
|
|
3340
3280
|
}
|
|
3341
3281
|
/** Append a new data point to the end of a series (real-time tick). */
|
|
3342
3282
|
appendData(t, e, n) {
|
|
@@ -3355,28 +3295,28 @@ class Ma extends fi {
|
|
|
3355
3295
|
const n = o(this, Y).find((d) => d.id === t);
|
|
3356
3296
|
if (!n) return;
|
|
3357
3297
|
const s = n.label, r = n.renderer.getLayerColors().slice();
|
|
3358
|
-
n.renderer.updateOptions({ ...e, ...
|
|
3298
|
+
n.renderer.updateOptions({ ...e, ...B(this, J, Qe).call(this) }), "label" in e && typeof e.label == "string" && (n.label = e.label), o(this, q).markDirty();
|
|
3359
3299
|
const a = n.renderer.getLayerColors(), l = r.length !== a.length || r.some((d, c) => d !== a[c]), h = s !== n.label;
|
|
3360
|
-
(l || h) &&
|
|
3300
|
+
(l || h) && B(this, J, oe).call(this);
|
|
3361
3301
|
}
|
|
3362
3302
|
/**
|
|
3363
3303
|
* Batch multiple updates: suppress recomputes until `fn` returns. Exceptions
|
|
3364
3304
|
* inside `fn` still flush the batch so counters don't leak across calls.
|
|
3365
3305
|
*/
|
|
3366
3306
|
batch(t) {
|
|
3367
|
-
|
|
3307
|
+
qi(this, Xt)._++;
|
|
3368
3308
|
try {
|
|
3369
3309
|
t();
|
|
3370
3310
|
} finally {
|
|
3371
|
-
--
|
|
3311
|
+
--qi(this, Xt)._ <= 0 && (k(this, Xt, 0), o(this, Ke) ? (k(this, Ke, !1), k(this, me, !1), this.onDataChanged()) : o(this, me) && (k(this, me, !1), this.updateYRange(!0), o(this, q).markDirty()), o(this, ci) && (k(this, ci, !1), this.emit("overlayChange")));
|
|
3372
3312
|
}
|
|
3373
3313
|
}
|
|
3374
3314
|
/** Show or hide a series. Hidden series are not rendered and excluded from Y-range. */
|
|
3375
3315
|
setSeriesVisible(t, e) {
|
|
3376
3316
|
const n = o(this, Y).find((s) => s.id === t);
|
|
3377
3317
|
if (!(!n || n.visible === e)) {
|
|
3378
|
-
if (n.visible = e,
|
|
3379
|
-
k(this,
|
|
3318
|
+
if (n.visible = e, B(this, J, oe).call(this), o(this, Xt) > 0) {
|
|
3319
|
+
k(this, me, !0);
|
|
3380
3320
|
return;
|
|
3381
3321
|
}
|
|
3382
3322
|
this.updateYRange(!0), o(this, q).markDirty();
|
|
@@ -3390,8 +3330,8 @@ class Ma extends fi {
|
|
|
3390
3330
|
setLayerVisible(t, e, n) {
|
|
3391
3331
|
const s = o(this, Y).find((r) => r.id === t);
|
|
3392
3332
|
if (s && !(s.renderer.getLayerCount() <= 1) && s.renderer.isLayerVisible(e) !== n) {
|
|
3393
|
-
if (s.renderer.setLayerVisible(e, n),
|
|
3394
|
-
k(this,
|
|
3333
|
+
if (s.renderer.setLayerVisible(e, n), B(this, J, oe).call(this), o(this, Xt) > 0) {
|
|
3334
|
+
k(this, me, !0);
|
|
3395
3335
|
return;
|
|
3396
3336
|
}
|
|
3397
3337
|
this.updateYRange(!0), o(this, q).markDirty();
|
|
@@ -3450,7 +3390,7 @@ class Ma extends fi {
|
|
|
3450
3390
|
return o(this, O).yRange;
|
|
3451
3391
|
}
|
|
3452
3392
|
getCrosshairPosition() {
|
|
3453
|
-
return o(this,
|
|
3393
|
+
return o(this, Ht);
|
|
3454
3394
|
}
|
|
3455
3395
|
/** Get the last visible value and whether the absolute last point is on screen. */
|
|
3456
3396
|
getLastValue(t) {
|
|
@@ -3503,7 +3443,7 @@ class Ma extends fi {
|
|
|
3503
3443
|
*/
|
|
3504
3444
|
getSeriesType(t) {
|
|
3505
3445
|
const e = o(this, Y).find((n) => n.id === t);
|
|
3506
|
-
return e ? e.renderer instanceof
|
|
3446
|
+
return e ? e.renderer instanceof Si ? "pie" : "time" : null;
|
|
3507
3447
|
}
|
|
3508
3448
|
/**
|
|
3509
3449
|
* Filter `getSeriesIds()` by renderer type. `'pie'` returns pie series,
|
|
@@ -3517,7 +3457,7 @@ class Ma extends fi {
|
|
|
3517
3457
|
getSeriesIdsByType(t, e) {
|
|
3518
3458
|
const n = (e == null ? void 0 : e.visibleOnly) === !0, s = (e == null ? void 0 : e.singleLayerOnly) === !0, r = [];
|
|
3519
3459
|
for (const a of o(this, Y)) {
|
|
3520
|
-
const l = a.renderer instanceof
|
|
3460
|
+
const l = a.renderer instanceof Si;
|
|
3521
3461
|
if (t === "pie" && !l || t === "time" && l) continue;
|
|
3522
3462
|
const h = a.renderer.getLayerCount();
|
|
3523
3463
|
if (!(s && h > 1)) {
|
|
@@ -3606,7 +3546,7 @@ class Ma extends fi {
|
|
|
3606
3546
|
k(this, tt, t);
|
|
3607
3547
|
for (const n of o(this, Y))
|
|
3608
3548
|
n.renderer.applyTheme(t, e);
|
|
3609
|
-
o(this, q).markDirty(),
|
|
3549
|
+
o(this, q).markDirty(), B(this, J, oe).call(this);
|
|
3610
3550
|
}
|
|
3611
3551
|
getTheme() {
|
|
3612
3552
|
return o(this, tt);
|
|
@@ -3615,7 +3555,7 @@ class Ma extends fi {
|
|
|
3615
3555
|
setAxis(t) {
|
|
3616
3556
|
var e, n;
|
|
3617
3557
|
const s = this.yAxisWidth, r = this.xAxisHeight;
|
|
3618
|
-
k(this,
|
|
3558
|
+
k(this, We, t), k(this, ot, { min: (e = t.y) == null ? void 0 : e.min, max: (n = t.y) == null ? void 0 : n.max }), k(this, De, !1), this.updateYRange(!0), (this.yAxisWidth !== s || this.xAxisHeight !== r) && this.updateScales(!0), o(this, q).markDirty();
|
|
3619
3559
|
}
|
|
3620
3560
|
/**
|
|
3621
3561
|
* Apply label-density knobs driven by `<YAxis labelCount=… minLabelSpacing=…>`
|
|
@@ -3675,8 +3615,8 @@ class Ma extends fi {
|
|
|
3675
3615
|
*/
|
|
3676
3616
|
setAnimations(t) {
|
|
3677
3617
|
var e, n, s;
|
|
3678
|
-
const r =
|
|
3679
|
-
k(this,
|
|
3618
|
+
const r = On(t);
|
|
3619
|
+
k(this, Bt, r), o(this, O).setReboundMs(r.viewport.reboundMs), (e = o(this, Ae)) == null || e.setInputResponseMs(r.viewport.inputResponseMs);
|
|
3680
3620
|
const a = {};
|
|
3681
3621
|
if (r.points.enterMs === 0 && (a.entryMs = 0), r.points.smoothMs === 0 && (a.smoothMs = 0), r.points.pulseMs === 0 && (a.pulseMs = 0), Object.keys(a).length > 0)
|
|
3682
3622
|
for (const l of o(this, Y))
|
|
@@ -3686,7 +3626,7 @@ class Ma extends fi {
|
|
|
3686
3626
|
setPadding(t) {
|
|
3687
3627
|
const e = o(this, O).getPadding();
|
|
3688
3628
|
o(this, O).setPadding(t);
|
|
3689
|
-
const n = o(this, O).getPadding(), s =
|
|
3629
|
+
const n = o(this, O).getPadding(), s = !$n(e.left, n.left) || !$n(e.right, n.right), r = e.top !== n.top || e.bottom !== n.bottom;
|
|
3690
3630
|
if (s) {
|
|
3691
3631
|
const { first: a, last: l } = this.getDataBounds();
|
|
3692
3632
|
if (a !== void 0 && l !== void 0) {
|
|
@@ -3698,7 +3638,7 @@ class Ma extends fi {
|
|
|
3698
3638
|
}
|
|
3699
3639
|
/** Show or hide the background grid. Takes effect on the next render frame. */
|
|
3700
3640
|
setGrid(t) {
|
|
3701
|
-
k(this,
|
|
3641
|
+
k(this, je, t.visible), o(this, q).markDirty();
|
|
3702
3642
|
}
|
|
3703
3643
|
/**
|
|
3704
3644
|
* Set the visual state for one side of the chart. Typically called in
|
|
@@ -3710,15 +3650,15 @@ class Ma extends fi {
|
|
|
3710
3650
|
* symmetry and currently renders identically to `idle`.
|
|
3711
3651
|
*/
|
|
3712
3652
|
setEdgeState(t, e) {
|
|
3713
|
-
o(this,
|
|
3653
|
+
o(this, Wt)[t] !== e && (o(this, Wt)[t] = e, o(this, Ot).markDirty());
|
|
3714
3654
|
}
|
|
3715
3655
|
/** Read the current host-declared state for a given edge. */
|
|
3716
3656
|
getEdgeState(t) {
|
|
3717
|
-
return o(this,
|
|
3657
|
+
return o(this, Wt)[t];
|
|
3718
3658
|
}
|
|
3719
3659
|
/** Notify chart that a YLabel is present (affects right padding). */
|
|
3720
3660
|
setYLabel(t) {
|
|
3721
|
-
k(this,
|
|
3661
|
+
k(this, en, t), this.updateViewportPadding();
|
|
3722
3662
|
}
|
|
3723
3663
|
updateViewportPadding() {
|
|
3724
3664
|
}
|
|
@@ -3726,11 +3666,11 @@ class Ma extends fi {
|
|
|
3726
3666
|
destroy() {
|
|
3727
3667
|
var t, e, n;
|
|
3728
3668
|
for (const s of o(this, Y)) s.renderer.dispose();
|
|
3729
|
-
k(this, Y, []), k(this, ae, null), o(this, O).destroy(), o(this, q).destroy(), o(this,
|
|
3669
|
+
k(this, Y, []), k(this, ae, null), o(this, O).destroy(), o(this, q).destroy(), o(this, Ot).destroy(), (t = o(this, Ae)) == null || t.destroy(), o(this, et).destroy(), (e = o(this, Je)) == null || e.destroy(), k(this, Je, null), o(this, qe) && ((n = o(this, $t)) == null || n.destroy()), k(this, $t, null), k(this, qe, !1), this.removeAllListeners();
|
|
3730
3670
|
}
|
|
3731
3671
|
/** The attached performance monitor, or `null` when instrumentation is disabled. */
|
|
3732
3672
|
getPerfMonitor() {
|
|
3733
|
-
return o(this,
|
|
3673
|
+
return o(this, $t);
|
|
3734
3674
|
}
|
|
3735
3675
|
/** Compute the earliest and latest timestamps across all series. */
|
|
3736
3676
|
getDataBounds() {
|
|
@@ -3743,8 +3683,8 @@ class Ma extends fi {
|
|
|
3743
3683
|
return { first: t, last: e };
|
|
3744
3684
|
}
|
|
3745
3685
|
onDataChanged() {
|
|
3746
|
-
if (o(this,
|
|
3747
|
-
k(this,
|
|
3686
|
+
if (o(this, Xt) > 0) {
|
|
3687
|
+
k(this, Ke, !0);
|
|
3748
3688
|
return;
|
|
3749
3689
|
}
|
|
3750
3690
|
this.updateDataInterval();
|
|
@@ -3753,13 +3693,13 @@ class Ma extends fi {
|
|
|
3753
3693
|
let n = 0;
|
|
3754
3694
|
for (const a of o(this, Y))
|
|
3755
3695
|
a.renderer.getTotalLength ? n += a.renderer.getTotalLength() : a.store && (n += a.store.length);
|
|
3756
|
-
const s = n - o(this,
|
|
3757
|
-
if (k(this,
|
|
3696
|
+
const s = n - o(this, Ti) > 5;
|
|
3697
|
+
if (k(this, Ti, n), t !== void 0 && e !== void 0) {
|
|
3758
3698
|
const { from: a, to: l } = o(this, O).logicalRange, h = a === 0 && l === 0, d = o(this, et).size.media.width - this.yAxisWidth;
|
|
3759
|
-
h ? o(this, O).fitToData(t, e, d, !1) : s && o(this, O).autoScroll ? o(this, O).fitToData(t, e, d, !0) : !s && o(this, O).autoScroll && (o(this, O).dataFitsCurrentViewport(d) ? o(this, O).fitToData(t, e, d, !0,
|
|
3699
|
+
h ? o(this, O).fitToData(t, e, d, !1) : s && o(this, O).autoScroll ? o(this, O).fitToData(t, e, d, !0) : !s && o(this, O).autoScroll && (o(this, O).dataFitsCurrentViewport(d) ? o(this, O).fitToData(t, e, d, !0, xi.streamTick) : o(this, O).scrollToEnd(e, d));
|
|
3760
3700
|
}
|
|
3761
|
-
const r = o(this,
|
|
3762
|
-
k(this,
|
|
3701
|
+
const r = o(this, ti);
|
|
3702
|
+
k(this, ti, !1), this.updateYRange(s || r), this.syncScales(), o(this, q).markDirty(), this.emit("dataUpdate"), B(this, J, oe).call(this);
|
|
3763
3703
|
}
|
|
3764
3704
|
updateDataInterval() {
|
|
3765
3705
|
for (const t of o(this, Y)) {
|
|
@@ -3767,7 +3707,7 @@ class Ma extends fi {
|
|
|
3767
3707
|
const e = t.store.getAll();
|
|
3768
3708
|
if (e.length >= 2) {
|
|
3769
3709
|
const n = e.slice(0, 20).map((s) => s.time);
|
|
3770
|
-
k(this, dt,
|
|
3710
|
+
k(this, dt, wr(n)), o(this, O).setDataInterval(o(this, dt));
|
|
3771
3711
|
break;
|
|
3772
3712
|
}
|
|
3773
3713
|
}
|
|
@@ -3809,24 +3749,24 @@ class Ma extends fi {
|
|
|
3809
3749
|
updateYRange(t = !1, e) {
|
|
3810
3750
|
const n = o(this, O).logicalRange, s = o(this, ot).min !== void 0 && o(this, ot).min !== "auto" && typeof o(this, ot).min != "number" || o(this, ot).max !== void 0 && o(this, ot).max !== "auto" && typeof o(this, ot).max != "number" ? [] : null, r = this.computeTargetYRange(n, s);
|
|
3811
3751
|
if (r === null) {
|
|
3812
|
-
k(this,
|
|
3752
|
+
k(this, De, !1);
|
|
3813
3753
|
return;
|
|
3814
3754
|
}
|
|
3815
|
-
const a = this.resolveBound(o(this, ot).min, r.min, r.max, s ?? [], "min"), l = this.resolveBound(o(this, ot).max, r.max, r.min, s ?? [], "max"), h = o(this,
|
|
3816
|
-
k(this,
|
|
3817
|
-
const c = d && h >
|
|
3818
|
-
if (!o(this,
|
|
3819
|
-
o(this,
|
|
3755
|
+
const a = this.resolveBound(o(this, ot).min, r.min, r.max, s ?? [], "min"), l = this.resolveBound(o(this, ot).max, r.max, r.min, s ?? [], "max"), h = o(this, Bt).viewport.yAxisMs, d = o(this, ei);
|
|
3756
|
+
k(this, ei, !1);
|
|
3757
|
+
const c = d && h > Mn ? Mn : h;
|
|
3758
|
+
if (!o(this, De) || t || c <= 0)
|
|
3759
|
+
o(this, ne).snap(a), o(this, se).snap(l), k(this, De, !0);
|
|
3820
3760
|
else {
|
|
3821
|
-
const w = o(this,
|
|
3822
|
-
a < o(this,
|
|
3761
|
+
const w = o(this, Bt).points.enterMs > 0;
|
|
3762
|
+
a < o(this, ne).current && !w ? o(this, ne).snap(a) : o(this, ne).setTarget(a, { duration: c, now: e }), l > o(this, se).current && !w ? o(this, se).snap(l) : o(this, se).setTarget(l, { duration: c, now: e });
|
|
3823
3763
|
}
|
|
3824
|
-
const u = e ?? performance.now(), f = o(this,
|
|
3764
|
+
const u = e ?? performance.now(), f = o(this, ne).tick(u), m = o(this, se).tick(u);
|
|
3825
3765
|
(f || m) && o(this, q).markDirty();
|
|
3826
3766
|
const g = o(this, ot).min !== void 0 && o(this, ot).min !== "auto", p = o(this, ot).max !== void 0 && o(this, ot).max !== "auto", v = o(this, et).size.media.height - this.xAxisHeight;
|
|
3827
3767
|
o(this, O).setYRange(
|
|
3828
|
-
o(this, ie).current,
|
|
3829
3768
|
o(this, ne).current,
|
|
3769
|
+
o(this, se).current,
|
|
3830
3770
|
v,
|
|
3831
3771
|
g,
|
|
3832
3772
|
p
|
|
@@ -3868,8 +3808,8 @@ class Ma extends fi {
|
|
|
3868
3808
|
const n = typeof t == "number" ? t : performance.now();
|
|
3869
3809
|
o(this, O).tick(n) && o(this, q).markDirty(), this.updateScales(!1, n), o(this, et).useMainLayer((s) => {
|
|
3870
3810
|
const { context: r, bitmapSize: a } = s, l = (e.media.width - this.yAxisWidth) * e.horizontalPixelRatio, h = (e.media.height - this.xAxisHeight) * e.verticalPixelRatio;
|
|
3871
|
-
r.clearRect(0, 0, a.width, a.height), r.save(), r.beginPath(), r.rect(0, 0, l, h), r.clip(), o(this,
|
|
3872
|
-
const d = o(this, O).getPadding(), c = { top: d.top, bottom: d.bottom }, u = o(this,
|
|
3811
|
+
r.clearRect(0, 0, a.width, a.height), r.save(), r.beginPath(), r.rect(0, 0, l, h), r.clip(), o(this, je) && ir(s, this.timeScale, this.yScale, o(this, tt), o(this, dt));
|
|
3812
|
+
const d = o(this, O).getPadding(), c = { top: d.top, bottom: d.bottom }, u = o(this, $t);
|
|
3873
3813
|
for (const f of o(this, Y)) {
|
|
3874
3814
|
if (!f.visible) continue;
|
|
3875
3815
|
const m = {
|
|
@@ -3906,14 +3846,14 @@ class Ma extends fi {
|
|
|
3906
3846
|
r = !0;
|
|
3907
3847
|
break;
|
|
3908
3848
|
}
|
|
3909
|
-
const a = o(this,
|
|
3849
|
+
const a = o(this, Wt).left === "loading" || o(this, Wt).right === "loading", l = o(this, Wt).left !== "idle" || o(this, Wt).right !== "idle";
|
|
3910
3850
|
if (o(this, et).useOverlayLayer((h) => {
|
|
3911
3851
|
var d, c;
|
|
3912
|
-
if (!o(this,
|
|
3852
|
+
if (!o(this, Ht) && !r && !l) return;
|
|
3913
3853
|
const u = (s.media.width - this.yAxisWidth) * s.horizontalPixelRatio, f = (s.media.height - this.xAxisHeight) * s.verticalPixelRatio;
|
|
3914
|
-
if (h.context.save(), h.context.beginPath(), h.context.rect(0, 0, u, f), h.context.clip(), o(this,
|
|
3915
|
-
const p = o(this,
|
|
3916
|
-
|
|
3854
|
+
if (h.context.save(), h.context.beginPath(), h.context.rect(0, 0, u, f), h.context.clip(), o(this, Ht) && B(this, J, Ms).call(this)) {
|
|
3855
|
+
const p = o(this, Ht).mediaX * s.horizontalPixelRatio, v = o(this, Ht).mediaY * s.verticalPixelRatio;
|
|
3856
|
+
Us(h, p, v, o(this, tt));
|
|
3917
3857
|
}
|
|
3918
3858
|
const m = o(this, O).getPadding(), g = { top: m.top, bottom: m.bottom };
|
|
3919
3859
|
for (const p of o(this, Y))
|
|
@@ -3924,7 +3864,7 @@ class Ma extends fi {
|
|
|
3924
3864
|
theme: o(this, tt),
|
|
3925
3865
|
dataInterval: o(this, dt),
|
|
3926
3866
|
padding: g,
|
|
3927
|
-
crosshair: o(this,
|
|
3867
|
+
crosshair: o(this, Ht)
|
|
3928
3868
|
}));
|
|
3929
3869
|
l && this.drawEdgeIndicators(h, s.media.height - this.xAxisHeight), h.context.restore();
|
|
3930
3870
|
}), r) {
|
|
@@ -3935,17 +3875,17 @@ class Ma extends fi {
|
|
|
3935
3875
|
c = !0;
|
|
3936
3876
|
break;
|
|
3937
3877
|
}
|
|
3938
|
-
c && o(this,
|
|
3878
|
+
c && o(this, Ot).markDirty();
|
|
3939
3879
|
}
|
|
3940
|
-
a && o(this,
|
|
3880
|
+
a && o(this, Ot).markDirty();
|
|
3941
3881
|
}
|
|
3942
3882
|
drawEdgeIndicators(t, e) {
|
|
3943
3883
|
const n = performance.now();
|
|
3944
3884
|
for (const s of ["left", "right"]) {
|
|
3945
|
-
const r = o(this,
|
|
3885
|
+
const r = o(this, Wt)[s];
|
|
3946
3886
|
if (r === "idle" || r === "has-more") continue;
|
|
3947
3887
|
const a = this.resolveEdgeBoundary(s);
|
|
3948
|
-
a !== null &&
|
|
3888
|
+
a !== null && Zs({
|
|
3949
3889
|
scope: t,
|
|
3950
3890
|
timeScale: this.timeScale,
|
|
3951
3891
|
theme: o(this, tt),
|
|
@@ -3965,13 +3905,13 @@ class Ma extends fi {
|
|
|
3965
3905
|
* directly on mount to show a "no-data" marker from the start).
|
|
3966
3906
|
*/
|
|
3967
3907
|
resolveEdgeBoundary(t) {
|
|
3968
|
-
const e = o(this,
|
|
3908
|
+
const e = o(this, Mi)[t];
|
|
3969
3909
|
if (e !== null) return e;
|
|
3970
3910
|
const { first: n, last: s } = this.getDataBounds();
|
|
3971
3911
|
return t === "left" ? n ?? null : s ?? null;
|
|
3972
3912
|
}
|
|
3973
3913
|
}
|
|
3974
|
-
et = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(),
|
|
3914
|
+
et = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), Ot = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), je = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), ae = /* @__PURE__ */ new WeakMap(), en = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new WeakMap(), Mi = /* @__PURE__ */ new WeakMap(), ki = /* @__PURE__ */ new WeakMap(), Xt = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap(), ci = /* @__PURE__ */ new WeakMap(), Li = /* @__PURE__ */ new WeakMap(), Bt = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap(), qe = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakSet(), /**
|
|
3975
3915
|
* Bump overlay version + emit `overlayChange`. Call from every mutation
|
|
3976
3916
|
* path whose output overlay components care about: data, series list,
|
|
3977
3917
|
* per-series/layer visibility, options, theme.
|
|
@@ -3984,8 +3924,8 @@ et = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), q = /* @_
|
|
|
3984
3924
|
* render instead of N.
|
|
3985
3925
|
*/
|
|
3986
3926
|
oe = function() {
|
|
3987
|
-
if (
|
|
3988
|
-
k(this,
|
|
3927
|
+
if (qi(this, Li)._++, o(this, Xt) > 0) {
|
|
3928
|
+
k(this, ci, !0);
|
|
3989
3929
|
return;
|
|
3990
3930
|
}
|
|
3991
3931
|
this.emit("overlayChange");
|
|
@@ -3994,12 +3934,12 @@ oe = function() {
|
|
|
3994
3934
|
* otherwise generate a new auto ID. Auto-generated IDs never collide with each other
|
|
3995
3935
|
* or with user-provided IDs because they use a monotonically increasing counter.
|
|
3996
3936
|
*/
|
|
3997
|
-
|
|
3937
|
+
Hn = function(i) {
|
|
3998
3938
|
if (i && !o(this, Y).some((e) => e.id === i))
|
|
3999
3939
|
return i;
|
|
4000
3940
|
let t;
|
|
4001
3941
|
do
|
|
4002
|
-
t = `series_${++
|
|
3942
|
+
t = `series_${++Ma}`;
|
|
4003
3943
|
while (o(this, Y).some((e) => e.id === t));
|
|
4004
3944
|
return t;
|
|
4005
3945
|
}, /**
|
|
@@ -4012,8 +3952,8 @@ On = function(i) {
|
|
|
4012
3952
|
* `#seriesAnimationDefaults(kind, options)` so the result merges *after*
|
|
4013
3953
|
* the user's options for the disable paths.
|
|
4014
3954
|
*/
|
|
4015
|
-
|
|
4016
|
-
const { enterMs: t, smoothMs: e, pulseMs: n } = o(this,
|
|
3955
|
+
Ci = function(i) {
|
|
3956
|
+
const { enterMs: t, smoothMs: e, pulseMs: n } = o(this, Bt).points;
|
|
4017
3957
|
return i === "line" ? { enterMs: t, smoothMs: e, pulseMs: n } : { enterMs: t, smoothMs: e };
|
|
4018
3958
|
}, /**
|
|
4019
3959
|
* Chart-level animation overrides — these *win over* any per-series value
|
|
@@ -4021,8 +3961,8 @@ ki = function(i) {
|
|
|
4021
3961
|
* documented as a hard disable. Merged AFTER user options in the
|
|
4022
3962
|
* `addXSeries` wrappers.
|
|
4023
3963
|
*/
|
|
4024
|
-
|
|
4025
|
-
const { enterMs: i, smoothMs: t, pulseMs: e } = o(this,
|
|
3964
|
+
Qe = function() {
|
|
3965
|
+
const { enterMs: i, smoothMs: t, pulseMs: e } = o(this, Bt).points, n = {};
|
|
4026
3966
|
return i === 0 && (n.enterMs = 0), t === 0 && (n.smoothMs = 0), e === 0 && (n.pulseMs = 0), n;
|
|
4027
3967
|
}, /**
|
|
4028
3968
|
* Shared registration boilerplate for every renderer: assign an id, hook
|
|
@@ -4030,25 +3970,25 @@ Je = function() {
|
|
|
4030
3970
|
* the usual churn events. Pie passes `null` for `store`; time-series
|
|
4031
3971
|
* renderers pass their owned `TimeSeriesStore`.
|
|
4032
3972
|
*/
|
|
4033
|
-
|
|
3973
|
+
Ze = function(i, t, e) {
|
|
4034
3974
|
var n;
|
|
4035
|
-
const s =
|
|
4036
|
-
return (n = i.onDataChanged) == null || n.call(i, () => this.onDataChanged()), o(this, Y).push({ id: s, label: e.label, renderer: i, store: t, visible: !0 }), k(this, ae, null), this.updateViewportPadding(), this.emit("seriesChange"),
|
|
3975
|
+
const s = B(this, J, Hn).call(this, e.id);
|
|
3976
|
+
return (n = i.onDataChanged) == null || n.call(i, () => this.onDataChanged()), o(this, Y).push({ id: s, label: e.label, renderer: i, store: t, visible: !0 }), k(this, ae, null), this.updateViewportPadding(), this.emit("seriesChange"), B(this, J, oe).call(this), s;
|
|
4037
3977
|
}, /**
|
|
4038
3978
|
* True if any visible series is non-pie (line / bar / candlestick). Used
|
|
4039
3979
|
* to gate crosshair rendering — a pie-only chart has no meaningful x/y
|
|
4040
3980
|
* coordinate system, so the dashed hairlines would just be visual noise.
|
|
4041
3981
|
*/
|
|
4042
|
-
|
|
3982
|
+
Ms = function() {
|
|
4043
3983
|
for (const i of o(this, Y))
|
|
4044
|
-
if (i.visible && !(i.renderer instanceof
|
|
3984
|
+
if (i.visible && !(i.renderer instanceof Si))
|
|
4045
3985
|
return !0;
|
|
4046
3986
|
return !1;
|
|
4047
3987
|
}, /**
|
|
4048
3988
|
* Dispatch a crosshair move to every renderer that supports spatial hover
|
|
4049
3989
|
* (currently: pie). Any change in hover index schedules a main-layer redraw.
|
|
4050
3990
|
*/
|
|
4051
|
-
|
|
3991
|
+
ks = function(i) {
|
|
4052
3992
|
const t = o(this, et).size, e = o(this, O).getPadding(), n = {
|
|
4053
3993
|
top: e.top * t.verticalPixelRatio,
|
|
4054
3994
|
bottom: e.bottom * t.verticalPixelRatio
|
|
@@ -4064,11 +4004,11 @@ Ms = function(i) {
|
|
|
4064
4004
|
r.renderer.setHoverIndex(a) && (s = !0);
|
|
4065
4005
|
}
|
|
4066
4006
|
s && o(this, q).markDirty();
|
|
4067
|
-
},
|
|
4068
|
-
function
|
|
4007
|
+
}, Ti = /* @__PURE__ */ new WeakMap(), ti = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), ei = /* @__PURE__ */ new WeakMap();
|
|
4008
|
+
function $n(i, t) {
|
|
4069
4009
|
return typeof i == "number" && typeof t == "number" ? i === t : typeof i == "object" && typeof t == "object" ? i.intervals === t.intervals : !1;
|
|
4070
4010
|
}
|
|
4071
|
-
function
|
|
4011
|
+
function Ca(i, t) {
|
|
4072
4012
|
if (i.length <= t || t <= 0) return i;
|
|
4073
4013
|
const e = i[0].time, n = i[i.length - 1].time, s = n - e;
|
|
4074
4014
|
if (s <= 0) return i;
|
|
@@ -4091,7 +4031,7 @@ function ka(i, t) {
|
|
|
4091
4031
|
}
|
|
4092
4032
|
return a;
|
|
4093
4033
|
}
|
|
4094
|
-
function
|
|
4034
|
+
function Ta(i, t) {
|
|
4095
4035
|
if (i.length <= t || t <= 0) return i;
|
|
4096
4036
|
const e = i[0].time, n = i[i.length - 1].time, s = n - e;
|
|
4097
4037
|
if (s <= 0) return i;
|
|
@@ -4108,16 +4048,16 @@ function Ca(i, t) {
|
|
|
4108
4048
|
}
|
|
4109
4049
|
return a;
|
|
4110
4050
|
}
|
|
4111
|
-
const
|
|
4112
|
-
function
|
|
4113
|
-
return Math.abs(i - t.left) <=
|
|
4051
|
+
const Nn = 8;
|
|
4052
|
+
function Cs(i, t) {
|
|
4053
|
+
return Math.abs(i - t.left) <= Nn ? { gesture: "resize-left", snapToCenter: !1 } : Math.abs(i - t.right) <= Nn ? { gesture: "resize-right", snapToCenter: !1 } : i > t.left && i < t.right ? { gesture: "pan", snapToCenter: !1 } : { gesture: "pan", snapToCenter: !0 };
|
|
4114
4054
|
}
|
|
4115
|
-
function
|
|
4055
|
+
function Ra(i) {
|
|
4116
4056
|
const { startVisible: t, deltaPx: e, pixelsPerTime: n, dataRange: s } = i, r = t.to - t.from, a = e / n;
|
|
4117
4057
|
let l = t.from + a, h = t.to + a;
|
|
4118
4058
|
return l < s.from && (l = s.from, h = l + r), h > s.to && (h = s.to, l = h - r), l < s.from && (l = s.from), { from: l, to: h };
|
|
4119
4059
|
}
|
|
4120
|
-
function
|
|
4060
|
+
function Ia(i) {
|
|
4121
4061
|
const { edge: t, startVisible: e, deltaPx: n, pixelsPerTime: s, dataRange: r, minSpan: a } = i, l = n / s;
|
|
4122
4062
|
if (t === "left") {
|
|
4123
4063
|
let c = e.from + l, u = e.to;
|
|
@@ -4126,16 +4066,16 @@ function Ra(i) {
|
|
|
4126
4066
|
let h = e.from, d = e.to + l;
|
|
4127
4067
|
return d > r.to && (d = r.to), d - h < a && (d = h + a), d > r.to && (d = r.to, h = Math.max(r.from, d - a)), { from: h, to: d };
|
|
4128
4068
|
}
|
|
4129
|
-
function
|
|
4069
|
+
function La(i) {
|
|
4130
4070
|
const { time: t, startVisible: e, dataRange: n } = i, s = e.to - e.from;
|
|
4131
4071
|
let r = t - s / 2, a = r + s;
|
|
4132
4072
|
return r < n.from && (r = n.from, a = r + s), a > n.to && (a = n.to, r = a - s), r < n.from && (r = n.from), { from: r, to: a };
|
|
4133
4073
|
}
|
|
4134
|
-
function
|
|
4074
|
+
function Aa(i) {
|
|
4135
4075
|
const { ctx: t, theme: e, mediaWidth: n, mediaHeight: s } = i;
|
|
4136
4076
|
t.fillStyle = e.background, t.fillRect(0, 0, n, s);
|
|
4137
4077
|
}
|
|
4138
|
-
function
|
|
4078
|
+
function Wa(i, t, e = !0, n = 1) {
|
|
4139
4079
|
if (t.length < 2) return;
|
|
4140
4080
|
const { ctx: s, timeScale: r, yScale: a, mediaHeight: l, theme: h } = i, d = n < 1 && t.length >= 2, c = d ? t.length - 2 : t.length - 1;
|
|
4141
4081
|
if (e) {
|
|
@@ -4162,7 +4102,7 @@ function Aa(i, t, e = !0, n = 1) {
|
|
|
4162
4102
|
s.moveTo(r.timeToX(u.time), a.valueToY(u.value)), s.lineTo(r.timeToX(f.time), a.valueToY(f.value)), s.strokeStyle = h.line.color, s.lineWidth = h.line.width, s.stroke(), s.restore();
|
|
4163
4103
|
}
|
|
4164
4104
|
}
|
|
4165
|
-
function
|
|
4105
|
+
function Da(i, t, e = 1) {
|
|
4166
4106
|
if (t.length === 0) return;
|
|
4167
4107
|
const { ctx: n, timeScale: s, yScale: r, mediaHeight: a, theme: l } = i, h = Math.max(
|
|
4168
4108
|
1,
|
|
@@ -4174,7 +4114,7 @@ function Ba(i, t, e = 1) {
|
|
|
4174
4114
|
d && u === c ? (n.save(), n.globalAlpha = e, n.fillRect(m - h / 2, g, h, p), n.restore()) : n.fillRect(m - h / 2, g, h, p);
|
|
4175
4115
|
}
|
|
4176
4116
|
}
|
|
4177
|
-
function
|
|
4117
|
+
function Fa(i, t, e = 1) {
|
|
4178
4118
|
if (t.length === 0) return;
|
|
4179
4119
|
const { ctx: n, timeScale: s, yScale: r, theme: a } = i, l = Math.max(
|
|
4180
4120
|
1,
|
|
@@ -4187,120 +4127,120 @@ function Wa(i, t, e = 1) {
|
|
|
4187
4127
|
n.fillStyle = m, n.fillRect(g - l / 2, M, l, S), y && n.restore();
|
|
4188
4128
|
}
|
|
4189
4129
|
}
|
|
4190
|
-
function
|
|
4130
|
+
function Ba(i, t, e) {
|
|
4191
4131
|
const n = Math.max(e.from, Math.min(e.to, t.from)), s = Math.max(e.from, Math.min(e.to, t.to)), r = i.timeToX(n), a = i.timeToX(s), l = Math.min(r, a), h = Math.max(r, a);
|
|
4192
4132
|
return { left: l, right: h, width: Math.max(1, h - l) };
|
|
4193
4133
|
}
|
|
4194
|
-
var
|
|
4134
|
+
var Dt, $, Ai, it, Pt, ce, jt, Kt, Ut, Gt, ye, ze, re, Ri, Ii, pe, Nt, qt, ii, zt, ni, ui, si, ve, ri, ai, oi, li, be, hi, E, nn, pt, Ts, sn, he, $e, ji, yi, Xn, Rs, Is, Ls, Un, Gn, Ce, jn;
|
|
4195
4135
|
class Pa {
|
|
4196
4136
|
constructor(t) {
|
|
4197
|
-
L(this, E), L(this,
|
|
4137
|
+
L(this, E), L(this, Dt), L(this, $), L(this, Ai), L(this, it), L(this, Pt), L(this, ce), L(this, jt), L(this, Kt), L(this, Ut), L(this, Gt), L(this, ye), L(this, ze), L(this, re, new as()), L(this, Ri, new cs()), L(this, Ii, 0), L(this, pe, 0), L(this, Nt, 1), L(this, qt, null), L(this, ii, !0), L(this, zt, null), L(this, ni, null), L(this, ui, -1), L(this, si), L(this, ve, null), L(this, ri), L(this, ai), L(this, oi), L(this, li), L(this, be), L(this, hi), k(this, Dt, t.container), k(this, it, t.chart), k(this, ye, t.data), k(this, ze, t.options ?? {}), window.getComputedStyle(o(this, Dt)).position === "static" && (o(this, Dt).style.position = "relative"), k(this, $, document.createElement("canvas")), o(this, $).style.position = "absolute", o(this, $).style.left = "0", o(this, $).style.top = "0", o(this, $).style.height = "100%", o(this, $).style.touchAction = "none", o(this, Dt).appendChild(o(this, $));
|
|
4198
4138
|
const e = o(this, $).getContext("2d", { alpha: !0 });
|
|
4199
4139
|
if (!e) throw new Error("NavigatorController: failed to acquire 2D context");
|
|
4200
|
-
k(this,
|
|
4201
|
-
o(this,
|
|
4202
|
-
}), o(this, $).addEventListener("pointerdown", o(this,
|
|
4203
|
-
const n = o(this,
|
|
4204
|
-
n.width > 0 && n.height > 0 &&
|
|
4140
|
+
k(this, Ai, e), k(this, Pt, document.createElement("div")), o(this, Pt).dataset.chartNavigatorOverlay = "", o(this, Pt).style.cssText = "position:absolute;left:0;top:0;height:100%;pointer-events:none;", k(this, ce, document.createElement("div")), o(this, ce).style.cssText = "position:absolute;left:0;top:0;bottom:0;", k(this, jt, document.createElement("div")), o(this, jt).style.cssText = "position:absolute;top:0;bottom:0;", k(this, Kt, document.createElement("div")), o(this, Kt).style.cssText = "position:absolute;top:0;bottom:0;box-sizing:border-box;", k(this, Ut, qn()), k(this, Gt, qn()), o(this, Pt).append(o(this, ce), o(this, jt), o(this, Kt), o(this, Ut), o(this, Gt)), o(this, Dt).appendChild(o(this, Pt)), k(this, ri, () => B(this, E, he).call(this)), k(this, ai, () => B(this, E, he).call(this)), o(this, it).on("viewportChange", o(this, ri)), o(this, it).on("overlayChange", o(this, ai)), k(this, oi, (s) => B(this, E, Rs).call(this, s)), k(this, li, (s) => B(this, E, Is).call(this, s)), k(this, be, (s) => B(this, E, Ls).call(this, s)), k(this, hi, () => {
|
|
4141
|
+
o(this, ve) === null && (o(this, $).style.cursor = "default");
|
|
4142
|
+
}), o(this, $).addEventListener("pointerdown", o(this, oi)), o(this, $).addEventListener("pointermove", o(this, li)), o(this, $).addEventListener("pointerup", o(this, be)), o(this, $).addEventListener("pointercancel", o(this, be)), o(this, $).addEventListener("pointerleave", o(this, hi)), k(this, si, new ResizeObserver((s) => B(this, E, Ts).call(this, s[0]))), o(this, si).observe(o(this, Dt)), B(this, E, nn).call(this);
|
|
4143
|
+
const n = o(this, Dt).getBoundingClientRect();
|
|
4144
|
+
n.width > 0 && n.height > 0 && B(this, E, sn).call(this, n.width, n.height), B(this, E, he).call(this);
|
|
4205
4145
|
}
|
|
4206
4146
|
setData(t) {
|
|
4207
4147
|
var e;
|
|
4208
|
-
const n =
|
|
4209
|
-
if (s !== null && o(this,
|
|
4148
|
+
const n = za(t), s = (n == null ? void 0 : n.time) ?? null;
|
|
4149
|
+
if (s !== null && o(this, ni) !== null && s !== o(this, ni)) {
|
|
4210
4150
|
const r = ((e = o(this, zt)) == null ? void 0 : e.current) ?? 0;
|
|
4211
|
-
k(this, zt, new
|
|
4151
|
+
k(this, zt, new Ee({
|
|
4212
4152
|
initial: r,
|
|
4213
|
-
duration:
|
|
4214
|
-
easing:
|
|
4153
|
+
duration: we,
|
|
4154
|
+
easing: xe,
|
|
4215
4155
|
lerp: (a, l, h) => a + (l - a) * h
|
|
4216
4156
|
})), o(this, zt).setTarget(1);
|
|
4217
4157
|
}
|
|
4218
|
-
k(this,
|
|
4158
|
+
k(this, ni, s), k(this, ui, (n == null ? void 0 : n.seriesIndex) ?? -1), k(this, ye, t), B(this, E, he).call(this);
|
|
4219
4159
|
}
|
|
4220
4160
|
setOptions(t) {
|
|
4221
|
-
k(this,
|
|
4161
|
+
k(this, ze, t), B(this, E, nn).call(this), B(this, E, he).call(this);
|
|
4222
4162
|
}
|
|
4223
4163
|
destroy() {
|
|
4224
|
-
o(this, it).off("viewportChange", o(this,
|
|
4164
|
+
o(this, it).off("viewportChange", o(this, ri)), o(this, it).off("overlayChange", o(this, ai)), o(this, $).removeEventListener("pointerdown", o(this, oi)), o(this, $).removeEventListener("pointermove", o(this, li)), o(this, $).removeEventListener("pointerup", o(this, be)), o(this, $).removeEventListener("pointercancel", o(this, be)), o(this, $).removeEventListener("pointerleave", o(this, hi)), o(this, si).disconnect(), o(this, qt) !== null && (cancelAnimationFrame(o(this, qt)), k(this, qt, null)), o(this, $).remove(), o(this, Pt).remove();
|
|
4225
4165
|
}
|
|
4226
4166
|
/** CSS pixel height of the strip — theme default unless overridden. */
|
|
4227
4167
|
get height() {
|
|
4228
|
-
return o(this,
|
|
4168
|
+
return o(this, ze).height ?? o(this, it).getTheme().navigator.height;
|
|
4229
4169
|
}
|
|
4230
4170
|
}
|
|
4231
|
-
|
|
4171
|
+
Dt = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), Ai = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), jt = /* @__PURE__ */ new WeakMap(), Kt = /* @__PURE__ */ new WeakMap(), Ut = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), Ri = /* @__PURE__ */ new WeakMap(), Ii = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), ii = /* @__PURE__ */ new WeakMap(), zt = /* @__PURE__ */ new WeakMap(), ni = /* @__PURE__ */ new WeakMap(), ui = /* @__PURE__ */ new WeakMap(), si = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakMap(), ri = /* @__PURE__ */ new WeakMap(), ai = /* @__PURE__ */ new WeakMap(), oi = /* @__PURE__ */ new WeakMap(), li = /* @__PURE__ */ new WeakMap(), be = /* @__PURE__ */ new WeakMap(), hi = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakSet(), /** Push `options.height` (when set) onto the container's CSS height so
|
|
4232
4172
|
* direct core consumers see the option take effect. When the option is
|
|
4233
4173
|
* absent we leave the container alone — framework wrappers manage their
|
|
4234
4174
|
* own inline height via JSX, and overwriting it here would clobber the
|
|
4235
4175
|
* caller's value during the first layout effect. */
|
|
4236
|
-
|
|
4237
|
-
const i = o(this,
|
|
4238
|
-
i !== void 0 && (o(this,
|
|
4176
|
+
nn = function() {
|
|
4177
|
+
const i = o(this, ze).height;
|
|
4178
|
+
i !== void 0 && (o(this, Dt).style.height = `${i}px`);
|
|
4239
4179
|
}, pt = function() {
|
|
4240
|
-
return Math.max(0, o(this,
|
|
4241
|
-
},
|
|
4180
|
+
return Math.max(0, o(this, Ii) - o(this, it).yAxisWidth);
|
|
4181
|
+
}, Ts = function(i) {
|
|
4242
4182
|
var t;
|
|
4243
4183
|
if (!i) return;
|
|
4244
4184
|
const e = (t = i.contentBoxSize) == null ? void 0 : t[0], n = (e == null ? void 0 : e.inlineSize) ?? i.contentRect.width, s = (e == null ? void 0 : e.blockSize) ?? i.contentRect.height;
|
|
4245
|
-
n <= 0 || s <= 0 || (
|
|
4246
|
-
},
|
|
4185
|
+
n <= 0 || s <= 0 || (B(this, E, sn).call(this, n, s), B(this, E, he).call(this));
|
|
4186
|
+
}, sn = function(i, t) {
|
|
4247
4187
|
const e = window.devicePixelRatio || 1;
|
|
4248
|
-
k(this,
|
|
4188
|
+
k(this, Ii, i), k(this, pe, t), k(this, Nt, e);
|
|
4249
4189
|
const n = o(this, E, pt);
|
|
4250
|
-
o(this, $).width = Math.round(n * e), o(this, $).height = Math.round(t * e), o(this, $).style.width = `${n}px`, o(this,
|
|
4251
|
-
},
|
|
4252
|
-
o(this,
|
|
4253
|
-
k(this,
|
|
4190
|
+
o(this, $).width = Math.round(n * e), o(this, $).height = Math.round(t * e), o(this, $).style.width = `${n}px`, o(this, Pt).style.width = `${n}px`;
|
|
4191
|
+
}, he = function() {
|
|
4192
|
+
o(this, ii) && o(this, qt) !== null || (k(this, ii, !0), o(this, qt) === null && k(this, qt, requestAnimationFrame(() => {
|
|
4193
|
+
k(this, qt, null), k(this, ii, !1), B(this, E, Un).call(this);
|
|
4254
4194
|
})));
|
|
4255
4195
|
}, // --- input -------------------------------------------------------------
|
|
4256
4196
|
/** Extract media-x from a pointer event, relative to the canvas. */
|
|
4257
|
-
|
|
4197
|
+
$e = function(i) {
|
|
4258
4198
|
const t = o(this, $).getBoundingClientRect();
|
|
4259
4199
|
return i.clientX - t.left;
|
|
4260
4200
|
}, /** Keep scales synced with current data bounds + size. Safe to call ahead of
|
|
4261
4201
|
* the first RAF-driven render — pointer handlers rely on this so hit-tests
|
|
4262
4202
|
* compute against primed scales even on the opening gesture. */
|
|
4263
|
-
|
|
4264
|
-
const i =
|
|
4265
|
-
return o(this,
|
|
4266
|
-
},
|
|
4267
|
-
return
|
|
4268
|
-
},
|
|
4269
|
-
const i =
|
|
4203
|
+
ji = function() {
|
|
4204
|
+
const i = B(this, E, Ce).call(this), t = B(this, E, jn).call(this);
|
|
4205
|
+
return o(this, re).update(i, o(this, E, pt), o(this, Nt)), o(this, Ri).update(t, o(this, pe), o(this, Nt)), { dataRange: i, yRange: t };
|
|
4206
|
+
}, yi = function() {
|
|
4207
|
+
return B(this, E, ji).call(this), Ba(o(this, re), o(this, it).getVisibleRange(), B(this, E, Ce).call(this));
|
|
4208
|
+
}, Xn = function() {
|
|
4209
|
+
const i = B(this, E, Ce).call(this), t = i.to - i.from;
|
|
4270
4210
|
return t <= 0 || o(this, E, pt) <= 0 ? 0 : o(this, E, pt) / t;
|
|
4271
|
-
},
|
|
4211
|
+
}, Rs = function(i) {
|
|
4272
4212
|
if (i.button !== void 0 && i.button !== 0) return;
|
|
4273
|
-
const t =
|
|
4213
|
+
const t = B(this, E, $e).call(this, i), e = B(this, E, Ce).call(this);
|
|
4274
4214
|
if (e.to <= e.from) return;
|
|
4275
|
-
const n =
|
|
4215
|
+
const n = B(this, E, yi).call(this), s = Cs(t, n), r = B(this, E, Xn).call(this);
|
|
4276
4216
|
if (r === 0) return;
|
|
4277
4217
|
let a = o(this, it).getVisibleRange();
|
|
4278
4218
|
if (s.snapToCenter) {
|
|
4279
|
-
const l = o(this,
|
|
4219
|
+
const l = o(this, re).xToTime(t), h = La({ time: l, startVisible: a, dataRange: e });
|
|
4280
4220
|
o(this, it).setVisibleRange(h), a = h;
|
|
4281
4221
|
}
|
|
4282
|
-
k(this,
|
|
4222
|
+
k(this, ve, {
|
|
4283
4223
|
pointerId: i.pointerId,
|
|
4284
4224
|
gesture: s.gesture,
|
|
4285
4225
|
startX: t,
|
|
4286
4226
|
startVisible: a,
|
|
4287
4227
|
pixelsPerTime: r
|
|
4288
|
-
}), o(this, $).setPointerCapture(i.pointerId), o(this, $).style.cursor =
|
|
4228
|
+
}), o(this, $).setPointerCapture(i.pointerId), o(this, $).style.cursor = As(
|
|
4289
4229
|
s.gesture,
|
|
4290
4230
|
/*dragging*/
|
|
4291
4231
|
!0
|
|
4292
4232
|
), i.preventDefault();
|
|
4293
|
-
},
|
|
4294
|
-
const t = o(this,
|
|
4233
|
+
}, Is = function(i) {
|
|
4234
|
+
const t = o(this, ve);
|
|
4295
4235
|
if (t === null) {
|
|
4296
|
-
o(this, $).style.cursor =
|
|
4236
|
+
o(this, $).style.cursor = Kn(B(this, E, $e).call(this, i), B(this, E, yi).call(this));
|
|
4297
4237
|
return;
|
|
4298
4238
|
}
|
|
4299
4239
|
if (i.pointerId !== t.pointerId) return;
|
|
4300
|
-
const e =
|
|
4240
|
+
const e = B(this, E, $e).call(this, i) - t.startX, n = B(this, E, Ce).call(this);
|
|
4301
4241
|
let s;
|
|
4302
4242
|
if (t.gesture === "pan")
|
|
4303
|
-
s =
|
|
4243
|
+
s = Ra({
|
|
4304
4244
|
startVisible: t.startVisible,
|
|
4305
4245
|
deltaPx: e,
|
|
4306
4246
|
pixelsPerTime: t.pixelsPerTime,
|
|
@@ -4308,7 +4248,7 @@ Gi = function() {
|
|
|
4308
4248
|
});
|
|
4309
4249
|
else {
|
|
4310
4250
|
const r = t.gesture === "resize-left" ? "left" : "right";
|
|
4311
|
-
s =
|
|
4251
|
+
s = Ia({
|
|
4312
4252
|
edge: r,
|
|
4313
4253
|
startVisible: t.startVisible,
|
|
4314
4254
|
deltaPx: e,
|
|
@@ -4318,57 +4258,57 @@ Gi = function() {
|
|
|
4318
4258
|
});
|
|
4319
4259
|
}
|
|
4320
4260
|
o(this, it).setVisibleRange(s);
|
|
4321
|
-
},
|
|
4322
|
-
const t = o(this,
|
|
4323
|
-
t === null || i.pointerId !== t.pointerId || (k(this,
|
|
4261
|
+
}, Ls = function(i) {
|
|
4262
|
+
const t = o(this, ve);
|
|
4263
|
+
t === null || i.pointerId !== t.pointerId || (k(this, ve, null), o(this, $).hasPointerCapture(i.pointerId) && o(this, $).releasePointerCapture(i.pointerId), o(this, $).style.cursor = Kn(B(this, E, $e).call(this, i), B(this, E, yi).call(this)));
|
|
4324
4264
|
}, // --- render ------------------------------------------------------------
|
|
4325
|
-
|
|
4326
|
-
if (o(this, E, pt) <= 0 || o(this,
|
|
4327
|
-
const i = o(this, it).getTheme().navigator, { dataRange: t } =
|
|
4328
|
-
o(this, $).width = Math.round(o(this, E, pt) * o(this,
|
|
4329
|
-
const e = o(this,
|
|
4330
|
-
e.save(), e.clearRect(0, 0, n, s), e.scale(o(this,
|
|
4265
|
+
Un = function() {
|
|
4266
|
+
if (o(this, E, pt) <= 0 || o(this, pe) <= 0) return;
|
|
4267
|
+
const i = o(this, it).getTheme().navigator, { dataRange: t } = B(this, E, ji).call(this);
|
|
4268
|
+
o(this, $).width = Math.round(o(this, E, pt) * o(this, Nt)), o(this, $).height = Math.round(o(this, pe) * o(this, Nt)), o(this, $).style.width = `${o(this, E, pt)}px`, o(this, Pt).style.width = `${o(this, E, pt)}px`;
|
|
4269
|
+
const e = o(this, Ai), n = o(this, $).width, s = o(this, $).height;
|
|
4270
|
+
e.save(), e.clearRect(0, 0, n, s), e.scale(o(this, Nt), o(this, Nt));
|
|
4331
4271
|
const r = {
|
|
4332
4272
|
ctx: e,
|
|
4333
|
-
timeScale: o(this,
|
|
4334
|
-
yScale: o(this,
|
|
4273
|
+
timeScale: o(this, re),
|
|
4274
|
+
yScale: o(this, Ri),
|
|
4335
4275
|
mediaWidth: o(this, E, pt),
|
|
4336
|
-
mediaHeight: o(this,
|
|
4276
|
+
mediaHeight: o(this, pe),
|
|
4337
4277
|
theme: i
|
|
4338
4278
|
};
|
|
4339
|
-
o(this, $).style.boxShadow = `inset 0 1px 0 ${i.borderColor}, inset 0 -1px 0 ${i.borderColor}`,
|
|
4279
|
+
o(this, $).style.boxShadow = `inset 0 1px 0 ${i.borderColor}, inset 0 -1px 0 ${i.borderColor}`, Aa(r);
|
|
4340
4280
|
let a = 1;
|
|
4341
|
-
o(this, zt) !== null && (o(this, zt).tick(performance.now()), a = o(this, zt).current, o(this, zt).animating ?
|
|
4342
|
-
const l = Math.max(1, Math.round(o(this, E, pt))), h = o(this,
|
|
4281
|
+
o(this, zt) !== null && (o(this, zt).tick(performance.now()), a = o(this, zt).current, o(this, zt).animating ? B(this, E, he).call(this) : k(this, zt, null));
|
|
4282
|
+
const l = Math.max(1, Math.round(o(this, E, pt))), h = o(this, ye);
|
|
4343
4283
|
if (h.type === "candlestick")
|
|
4344
|
-
|
|
4284
|
+
Fa(r, Ta(h.points, l), a);
|
|
4345
4285
|
else {
|
|
4346
|
-
const d =
|
|
4286
|
+
const d = Ki(h), c = d.length === 1, u = o(this, ui) >= 0 ? o(this, ui) : d.length - 1;
|
|
4347
4287
|
for (let f = 0; f < d.length; f++) {
|
|
4348
|
-
const m =
|
|
4349
|
-
h.type === "bar" ?
|
|
4288
|
+
const m = Ca(d[f], l), g = f === u ? a : 1;
|
|
4289
|
+
h.type === "bar" ? Da(r, m, g) : Wa(r, m, c, g);
|
|
4350
4290
|
}
|
|
4351
4291
|
}
|
|
4352
|
-
e.restore(),
|
|
4353
|
-
},
|
|
4292
|
+
e.restore(), B(this, E, Gn).call(this, i, t);
|
|
4293
|
+
}, Gn = function(i, t) {
|
|
4354
4294
|
if (t.to <= t.from) return;
|
|
4355
|
-
const e = o(this, it).getVisibleRange(), n = Math.max(t.from, Math.min(t.to, e.from)), s = Math.max(t.from, Math.min(t.to, e.to)), r = o(this,
|
|
4356
|
-
o(this,
|
|
4295
|
+
const e = o(this, it).getVisibleRange(), n = Math.max(t.from, Math.min(t.to, e.from)), s = Math.max(t.from, Math.min(t.to, e.to)), r = o(this, re).timeToX(n), a = o(this, re).timeToX(s), l = Math.min(r, a), h = Math.max(r, a), d = Math.max(1, h - l);
|
|
4296
|
+
o(this, ce).style.width = `${l}px`, o(this, ce).style.background = i.mask.fill, o(this, ce).style.display = l > 0 ? "block" : "none";
|
|
4357
4297
|
const c = Math.max(0, o(this, E, pt) - (l + d));
|
|
4358
|
-
o(this,
|
|
4298
|
+
o(this, jt).style.left = `${l + d}px`, o(this, jt).style.width = `${c}px`, o(this, jt).style.background = i.mask.fill, o(this, jt).style.display = c > 0 ? "block" : "none", o(this, Kt).style.left = `${l}px`, o(this, Kt).style.width = `${d}px`, o(this, Kt).style.background = i.window.fill, o(this, Kt).style.border = i.window.borderWidth > 0 ? `${i.window.borderWidth}px solid ${i.window.border}` : "none";
|
|
4359
4299
|
const u = i.handle.width, f = Math.max(1, u / 2), m = o(this, it).getTheme().background;
|
|
4360
|
-
o(this,
|
|
4361
|
-
for (const g of o(this, Xt).children)
|
|
4362
|
-
g.style.background = m;
|
|
4300
|
+
o(this, Ut).style.left = `${l - u / 2}px`, o(this, Ut).style.width = `${u}px`, o(this, Ut).style.background = i.handle.color, o(this, Ut).style.borderRadius = `${f}px`, o(this, Gt).style.left = `${l + d - u / 2}px`, o(this, Gt).style.width = `${u}px`, o(this, Gt).style.background = i.handle.color, o(this, Gt).style.borderRadius = `${f}px`;
|
|
4363
4301
|
for (const g of o(this, Ut).children)
|
|
4364
4302
|
g.style.background = m;
|
|
4365
|
-
|
|
4366
|
-
|
|
4303
|
+
for (const g of o(this, Gt).children)
|
|
4304
|
+
g.style.background = m;
|
|
4305
|
+
}, Ce = function() {
|
|
4306
|
+
const i = o(this, ye);
|
|
4367
4307
|
let t = Number.POSITIVE_INFINITY, e = Number.NEGATIVE_INFINITY, n = 0;
|
|
4368
4308
|
if (i.type === "candlestick")
|
|
4369
4309
|
n = i.points.length, n > 0 && (t = i.points[0].time, e = i.points[n - 1].time);
|
|
4370
4310
|
else
|
|
4371
|
-
for (const r of
|
|
4311
|
+
for (const r of Ki(i))
|
|
4372
4312
|
r.length !== 0 && (n += r.length, r[0].time < t && (t = r[0].time), r[r.length - 1].time > e && (e = r[r.length - 1].time));
|
|
4373
4313
|
if (n >= 2 && e > t)
|
|
4374
4314
|
return { from: t, to: e };
|
|
@@ -4376,14 +4316,14 @@ Xn = function() {
|
|
|
4376
4316
|
return { ...o(this, it).getVisibleRange() };
|
|
4377
4317
|
const s = o(this, it).getDataRange();
|
|
4378
4318
|
return s && s.to > s.from ? s : { ...o(this, it).getVisibleRange() };
|
|
4379
|
-
},
|
|
4380
|
-
const i = o(this,
|
|
4319
|
+
}, jn = function() {
|
|
4320
|
+
const i = o(this, ye);
|
|
4381
4321
|
let t = 1 / 0, e = -1 / 0;
|
|
4382
4322
|
if (i.type === "candlestick")
|
|
4383
4323
|
for (const s of i.points)
|
|
4384
4324
|
s.low < t && (t = s.low), s.high > e && (e = s.high);
|
|
4385
4325
|
else
|
|
4386
|
-
for (const s of
|
|
4326
|
+
for (const s of Ki(i))
|
|
4387
4327
|
for (const r of s)
|
|
4388
4328
|
r.value < t && (t = r.value), r.value > e && (e = r.value);
|
|
4389
4329
|
if (!Number.isFinite(t) || !Number.isFinite(e)) return { min: 0, max: 1 };
|
|
@@ -4394,10 +4334,10 @@ Xn = function() {
|
|
|
4394
4334
|
const n = (e - t) * 0.2;
|
|
4395
4335
|
return { min: t - n, max: e + n };
|
|
4396
4336
|
};
|
|
4397
|
-
function
|
|
4337
|
+
function Ki(i) {
|
|
4398
4338
|
return "series" in i ? i.series : [i.points];
|
|
4399
4339
|
}
|
|
4400
|
-
function
|
|
4340
|
+
function za(i) {
|
|
4401
4341
|
if (i.type === "candlestick") {
|
|
4402
4342
|
const s = i.points.length;
|
|
4403
4343
|
return s === 0 ? null : { time: i.points[s - 1].time, seriesIndex: -1 };
|
|
@@ -4412,16 +4352,16 @@ function Da(i) {
|
|
|
4412
4352
|
}
|
|
4413
4353
|
return e === null ? null : { time: e, seriesIndex: n };
|
|
4414
4354
|
}
|
|
4415
|
-
function
|
|
4355
|
+
function As(i, t) {
|
|
4416
4356
|
return i === "resize-left" || i === "resize-right" ? "ew-resize" : t ? "grabbing" : "grab";
|
|
4417
4357
|
}
|
|
4418
|
-
function
|
|
4419
|
-
return
|
|
4358
|
+
function Kn(i, t) {
|
|
4359
|
+
return As(Va(i, t), !1);
|
|
4420
4360
|
}
|
|
4421
|
-
function
|
|
4422
|
-
return
|
|
4361
|
+
function Va(i, t) {
|
|
4362
|
+
return Cs(i, t).gesture;
|
|
4423
4363
|
}
|
|
4424
|
-
function
|
|
4364
|
+
function qn() {
|
|
4425
4365
|
const i = document.createElement("div");
|
|
4426
4366
|
i.style.cssText = "position:absolute;top:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;";
|
|
4427
4367
|
for (let t = 0; t < 3; t++) {
|
|
@@ -4430,27 +4370,27 @@ function Kn() {
|
|
|
4430
4370
|
}
|
|
4431
4371
|
return i;
|
|
4432
4372
|
}
|
|
4433
|
-
const
|
|
4434
|
-
function
|
|
4373
|
+
const rn = /* @__PURE__ */ new WeakMap();
|
|
4374
|
+
function Ws(i, t) {
|
|
4435
4375
|
var e;
|
|
4436
|
-
return (e =
|
|
4376
|
+
return (e = rn.get(i)) == null ? void 0 : e.get(t);
|
|
4437
4377
|
}
|
|
4438
|
-
function
|
|
4439
|
-
let n =
|
|
4440
|
-
n || (n = /* @__PURE__ */ new Map(),
|
|
4378
|
+
function Ds(i, t, e) {
|
|
4379
|
+
let n = rn.get(i);
|
|
4380
|
+
n || (n = /* @__PURE__ */ new Map(), rn.set(i, n)), n.set(t, e);
|
|
4441
4381
|
}
|
|
4442
|
-
function
|
|
4382
|
+
function Jn(i) {
|
|
4443
4383
|
return "close" in i ? i.close : i.value;
|
|
4444
4384
|
}
|
|
4445
|
-
function
|
|
4385
|
+
function Fs(i, t) {
|
|
4446
4386
|
if (t === "none" || i.length <= 1) return i;
|
|
4447
4387
|
const e = [...i];
|
|
4448
4388
|
return e.sort((n, s) => {
|
|
4449
|
-
const r =
|
|
4389
|
+
const r = Jn(n.data), a = Jn(s.data);
|
|
4450
4390
|
return t === "asc" ? r - a : a - r;
|
|
4451
4391
|
}), e;
|
|
4452
4392
|
}
|
|
4453
|
-
function
|
|
4393
|
+
function Wi(i) {
|
|
4454
4394
|
const t = Object.freeze({ ...i.data }), e = {
|
|
4455
4395
|
id: i.id,
|
|
4456
4396
|
seriesId: i.seriesId,
|
|
@@ -4461,8 +4401,8 @@ function Ai(i) {
|
|
|
4461
4401
|
};
|
|
4462
4402
|
return Object.freeze(e);
|
|
4463
4403
|
}
|
|
4464
|
-
function
|
|
4465
|
-
const e = t.sort ?? "none", n = i.getOverlayVersion(), s =
|
|
4404
|
+
function Bs(i, t) {
|
|
4405
|
+
const e = t.sort ?? "none", n = i.getOverlayVersion(), s = Ws(i, t.cacheKey);
|
|
4466
4406
|
if (s && s.version === n && s.time === t.time && s.sort === e)
|
|
4467
4407
|
return s.data;
|
|
4468
4408
|
const r = [];
|
|
@@ -4474,7 +4414,7 @@ function Fs(i, t) {
|
|
|
4474
4414
|
if (!c) continue;
|
|
4475
4415
|
for (const u of c)
|
|
4476
4416
|
r.push(
|
|
4477
|
-
|
|
4417
|
+
Wi({
|
|
4478
4418
|
id: `${l}_layer${u.layerIndex}`,
|
|
4479
4419
|
seriesId: l,
|
|
4480
4420
|
layerIndex: u.layerIndex,
|
|
@@ -4487,7 +4427,7 @@ function Fs(i, t) {
|
|
|
4487
4427
|
}
|
|
4488
4428
|
const d = i.getDataAtTime(l, t.time);
|
|
4489
4429
|
d && r.push(
|
|
4490
|
-
|
|
4430
|
+
Wi({
|
|
4491
4431
|
id: l,
|
|
4492
4432
|
seriesId: l,
|
|
4493
4433
|
label: h,
|
|
@@ -4496,11 +4436,11 @@ function Fs(i, t) {
|
|
|
4496
4436
|
})
|
|
4497
4437
|
);
|
|
4498
4438
|
}
|
|
4499
|
-
const a = Object.freeze(
|
|
4500
|
-
return
|
|
4439
|
+
const a = Object.freeze(Fs(r, e));
|
|
4440
|
+
return Ds(i, t.cacheKey, { version: n, time: t.time, sort: e, data: a }), a;
|
|
4501
4441
|
}
|
|
4502
|
-
function
|
|
4503
|
-
const e = t.sort ?? "none", n = i.getOverlayVersion(), s =
|
|
4442
|
+
function Ya(i, t) {
|
|
4443
|
+
const e = t.sort ?? "none", n = i.getOverlayVersion(), s = Ws(i, t.cacheKey);
|
|
4504
4444
|
if (s && s.version === n && s.time === null && s.sort === e)
|
|
4505
4445
|
return s.data;
|
|
4506
4446
|
const r = [];
|
|
@@ -4510,7 +4450,7 @@ function Va(i, t) {
|
|
|
4510
4450
|
if (d) {
|
|
4511
4451
|
for (const u of d)
|
|
4512
4452
|
r.push(
|
|
4513
|
-
|
|
4453
|
+
Wi({
|
|
4514
4454
|
id: `${l}_layer${u.layerIndex}`,
|
|
4515
4455
|
seriesId: l,
|
|
4516
4456
|
layerIndex: u.layerIndex,
|
|
@@ -4523,7 +4463,7 @@ function Va(i, t) {
|
|
|
4523
4463
|
}
|
|
4524
4464
|
const c = i.getLastData(l);
|
|
4525
4465
|
c && r.push(
|
|
4526
|
-
|
|
4466
|
+
Wi({
|
|
4527
4467
|
id: l,
|
|
4528
4468
|
seriesId: l,
|
|
4529
4469
|
label: h,
|
|
@@ -4532,10 +4472,98 @@ function Va(i, t) {
|
|
|
4532
4472
|
})
|
|
4533
4473
|
);
|
|
4534
4474
|
}
|
|
4535
|
-
const a = Object.freeze(
|
|
4536
|
-
return
|
|
4475
|
+
const a = Object.freeze(Fs(r, e));
|
|
4476
|
+
return Ds(i, t.cacheKey, { version: n, time: null, sort: e, data: a }), a;
|
|
4537
4477
|
}
|
|
4538
|
-
const
|
|
4478
|
+
const ko = {
|
|
4479
|
+
background: "#131722",
|
|
4480
|
+
chartGradient: ["#1a1f2e", "#101318"],
|
|
4481
|
+
typography: {
|
|
4482
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
4483
|
+
fontSize: 12
|
|
4484
|
+
},
|
|
4485
|
+
grid: {
|
|
4486
|
+
color: "rgba(42, 46, 57, 0.6)",
|
|
4487
|
+
style: "dashed"
|
|
4488
|
+
},
|
|
4489
|
+
candlestick: {
|
|
4490
|
+
up: { body: z("#26a69a"), wick: "#26a69a" },
|
|
4491
|
+
down: { body: z("#ef5350"), wick: "#ef5350" }
|
|
4492
|
+
},
|
|
4493
|
+
line: {
|
|
4494
|
+
color: "#2962FF",
|
|
4495
|
+
width: 1,
|
|
4496
|
+
areaTopColor: "rgba(41, 98, 255, 0.08)",
|
|
4497
|
+
areaBottomColor: "rgba(41, 98, 255, 0.01)"
|
|
4498
|
+
},
|
|
4499
|
+
seriesColors: [
|
|
4500
|
+
"#2962FF",
|
|
4501
|
+
"#FF6D00",
|
|
4502
|
+
"#26a69a",
|
|
4503
|
+
"#AB47BC",
|
|
4504
|
+
"#ef5350",
|
|
4505
|
+
"#FFCA28",
|
|
4506
|
+
"#66BB6A",
|
|
4507
|
+
"#EC407A",
|
|
4508
|
+
"#42A5F5",
|
|
4509
|
+
"#B388FF"
|
|
4510
|
+
],
|
|
4511
|
+
bands: {
|
|
4512
|
+
upper: "#42A5F5",
|
|
4513
|
+
lower: "#EC407A"
|
|
4514
|
+
},
|
|
4515
|
+
crosshair: {
|
|
4516
|
+
color: "rgba(150, 150, 150, 0.5)",
|
|
4517
|
+
labelBackground: "#363a45",
|
|
4518
|
+
labelTextColor: "#d1d4dc"
|
|
4519
|
+
},
|
|
4520
|
+
axis: {
|
|
4521
|
+
fontSize: 10,
|
|
4522
|
+
textColor: "#787b86"
|
|
4523
|
+
},
|
|
4524
|
+
yLabel: {
|
|
4525
|
+
fontSize: 11,
|
|
4526
|
+
upBackground: "#26a69a",
|
|
4527
|
+
downBackground: "#ef5350",
|
|
4528
|
+
neutralBackground: "#363a45",
|
|
4529
|
+
textColor: "#ffffff"
|
|
4530
|
+
},
|
|
4531
|
+
tooltip: {
|
|
4532
|
+
fontSize: 12,
|
|
4533
|
+
background: "rgba(19, 23, 34, 0.9)",
|
|
4534
|
+
textColor: "#d1d4dc",
|
|
4535
|
+
borderColor: "rgba(42, 46, 57, 0.8)"
|
|
4536
|
+
},
|
|
4537
|
+
navigator: {
|
|
4538
|
+
height: 48,
|
|
4539
|
+
background: "transparent",
|
|
4540
|
+
borderColor: "rgba(120, 123, 134, 0.18)",
|
|
4541
|
+
line: {
|
|
4542
|
+
color: "#787b86",
|
|
4543
|
+
width: 1,
|
|
4544
|
+
areaTopColor: "rgba(120, 123, 134, 0.22)",
|
|
4545
|
+
areaBottomColor: "rgba(120, 123, 134, 0)"
|
|
4546
|
+
},
|
|
4547
|
+
candlestick: {
|
|
4548
|
+
up: { body: z("#26a69a"), wick: "#26a69a" },
|
|
4549
|
+
down: { body: z("#ef5350"), wick: "#ef5350" }
|
|
4550
|
+
},
|
|
4551
|
+
window: {
|
|
4552
|
+
fill: "transparent",
|
|
4553
|
+
border: "transparent",
|
|
4554
|
+
borderWidth: 0
|
|
4555
|
+
},
|
|
4556
|
+
handle: {
|
|
4557
|
+
color: "rgba(255, 255, 255, 0.30)",
|
|
4558
|
+
width: 6
|
|
4559
|
+
},
|
|
4560
|
+
// Mask = page bg at high alpha. Outside the window the sparkline is
|
|
4561
|
+
// washed out by this color, so the visible window reads as a spotlight.
|
|
4562
|
+
mask: {
|
|
4563
|
+
fill: "rgba(19, 23, 34, 0.78)"
|
|
4564
|
+
}
|
|
4565
|
+
}
|
|
4566
|
+
}, Co = {
|
|
4539
4567
|
background: "#ffffff",
|
|
4540
4568
|
chartGradient: ["#ffffff", "#f5f6f8"],
|
|
4541
4569
|
typography: {
|
|
@@ -4618,7 +4646,7 @@ const Mo = {
|
|
|
4618
4646
|
fill: "rgba(255, 255, 255, 0.82)"
|
|
4619
4647
|
}
|
|
4620
4648
|
}
|
|
4621
|
-
},
|
|
4649
|
+
}, To = Z({
|
|
4622
4650
|
name: "Andromeda",
|
|
4623
4651
|
description: "Deep space purples and cosmic blues",
|
|
4624
4652
|
background: "#23262e",
|
|
@@ -4644,9 +4672,9 @@ const Mo = {
|
|
|
4644
4672
|
crosshair: { color: "rgba(102,94,110,0.4)", labelBackground: "#2e3038" },
|
|
4645
4673
|
axis: { textColor: "#665e6e" },
|
|
4646
4674
|
tooltip: { background: "rgba(35,38,46,0.92)", textColor: "#d5ced9", borderColor: "rgba(50,48,56,0.6)" },
|
|
4647
|
-
typography: { fontFamily:
|
|
4648
|
-
fontUrl:
|
|
4649
|
-
}),
|
|
4675
|
+
typography: { fontFamily: ys },
|
|
4676
|
+
fontUrl: xs
|
|
4677
|
+
}), Ro = Z({
|
|
4650
4678
|
name: "Ayu Mirage",
|
|
4651
4679
|
description: "Warm dark with amber accents",
|
|
4652
4680
|
background: "#1f2430",
|
|
@@ -4672,37 +4700,9 @@ const Mo = {
|
|
|
4672
4700
|
crosshair: { color: "rgba(92,103,115,0.4)", labelBackground: "#2a3040" },
|
|
4673
4701
|
axis: { textColor: "#5c6773" },
|
|
4674
4702
|
tooltip: { background: "rgba(31,36,48,0.92)", textColor: "#cbccc6", borderColor: "rgba(42,48,60,0.6)" },
|
|
4675
|
-
typography: { fontFamily:
|
|
4676
|
-
fontUrl:
|
|
4677
|
-
}),
|
|
4678
|
-
name: "Catppuccin",
|
|
4679
|
-
description: "Pastel tones on a mocha base",
|
|
4680
|
-
background: "#1e1e2e",
|
|
4681
|
-
grid: { color: "rgba(49,50,68,0.8)" },
|
|
4682
|
-
candlestick: {
|
|
4683
|
-
up: { body: z("#a6e3a1"), wick: "#a6e3a1" },
|
|
4684
|
-
down: { body: z("#f38ba8"), wick: "#f38ba8" }
|
|
4685
|
-
},
|
|
4686
|
-
line: { color: "#89b4fa" },
|
|
4687
|
-
seriesColors: [
|
|
4688
|
-
"#89b4fa",
|
|
4689
|
-
"#fab387",
|
|
4690
|
-
"#a6e3a1",
|
|
4691
|
-
"#cba6f7",
|
|
4692
|
-
"#f38ba8",
|
|
4693
|
-
"#f9e2af",
|
|
4694
|
-
"#94e2d5",
|
|
4695
|
-
"#eba0ac",
|
|
4696
|
-
"#74c7ec",
|
|
4697
|
-
"#cba6f7"
|
|
4698
|
-
],
|
|
4699
|
-
bands: { upper: "#74c7ec", lower: "#f38ba8" },
|
|
4700
|
-
crosshair: { color: "rgba(108,112,134,0.4)", labelBackground: "#313244" },
|
|
4701
|
-
axis: { textColor: "#6c7086" },
|
|
4702
|
-
tooltip: { background: "rgba(30,30,46,0.92)", textColor: "#cdd6f4", borderColor: "rgba(49,50,68,0.6)" },
|
|
4703
|
-
typography: { fontFamily: Di },
|
|
4704
|
-
fontUrl: cn
|
|
4705
|
-
}), Ro = Z({
|
|
4703
|
+
typography: { fontFamily: zi },
|
|
4704
|
+
fontUrl: un
|
|
4705
|
+
}), Io = Z({
|
|
4706
4706
|
name: "Dracula",
|
|
4707
4707
|
description: "Classic dark with vibrant highlights",
|
|
4708
4708
|
background: "#282a36",
|
|
@@ -4728,9 +4728,9 @@ const Mo = {
|
|
|
4728
4728
|
crosshair: { color: "rgba(98,114,164,0.4)", labelBackground: "#44475a" },
|
|
4729
4729
|
axis: { textColor: "#a0b0d0" },
|
|
4730
4730
|
tooltip: { background: "rgba(40,42,54,0.92)", textColor: "#f8f8f2", borderColor: "rgba(68,71,90,0.6)" },
|
|
4731
|
-
typography: { fontFamily:
|
|
4732
|
-
fontUrl:
|
|
4733
|
-
}),
|
|
4731
|
+
typography: { fontFamily: dn },
|
|
4732
|
+
fontUrl: fn
|
|
4733
|
+
}), Lo = Z({
|
|
4734
4734
|
name: "GitHub Light",
|
|
4735
4735
|
description: "Clean and familiar, GitHub-inspired",
|
|
4736
4736
|
background: "#fafbfc",
|
|
@@ -4757,9 +4757,9 @@ const Mo = {
|
|
|
4757
4757
|
crosshair: { color: "rgba(208,215,222,0.3)", labelBackground: "#f0f3f6" },
|
|
4758
4758
|
axis: { textColor: "#8b949e" },
|
|
4759
4759
|
tooltip: { background: "rgba(250,251,252,0.95)", textColor: "#24292f", borderColor: "rgba(216,222,228,0.5)" },
|
|
4760
|
-
typography: { fontFamily:
|
|
4761
|
-
fontUrl:
|
|
4762
|
-
}),
|
|
4760
|
+
typography: { fontFamily: gn },
|
|
4761
|
+
fontUrl: mn
|
|
4762
|
+
}), Ao = Z({
|
|
4763
4763
|
name: "Gruvbox",
|
|
4764
4764
|
description: "Retro warm with earthy tones",
|
|
4765
4765
|
background: "#282828",
|
|
@@ -4785,12 +4785,12 @@ const Mo = {
|
|
|
4785
4785
|
crosshair: { color: "rgba(146,131,116,0.4)", labelBackground: "#3c3836" },
|
|
4786
4786
|
axis: { textColor: "#928374" },
|
|
4787
4787
|
tooltip: { background: "rgba(40,40,40,0.92)", textColor: "#ebdbb2", borderColor: "rgba(60,56,54,0.6)" },
|
|
4788
|
-
typography: { fontFamily:
|
|
4788
|
+
typography: { fontFamily: Bi },
|
|
4789
4789
|
fontUrl: Pi
|
|
4790
|
-
}),
|
|
4790
|
+
}), Wo = {
|
|
4791
4791
|
name: "Handwritten",
|
|
4792
4792
|
description: "Sketch-style with a personal touch",
|
|
4793
|
-
fontUrl:
|
|
4793
|
+
fontUrl: da,
|
|
4794
4794
|
dark: !1,
|
|
4795
4795
|
theme: {
|
|
4796
4796
|
background: "#fdf5e6",
|
|
@@ -4800,7 +4800,7 @@ const Mo = {
|
|
|
4800
4800
|
// than every other theme. `15` lands in the same visual weight class
|
|
4801
4801
|
// while still feeling distinctly handwritten.
|
|
4802
4802
|
typography: {
|
|
4803
|
-
fontFamily:
|
|
4803
|
+
fontFamily: ua,
|
|
4804
4804
|
fontSize: 15
|
|
4805
4805
|
},
|
|
4806
4806
|
grid: {
|
|
@@ -4883,7 +4883,7 @@ const Mo = {
|
|
|
4883
4883
|
}
|
|
4884
4884
|
}
|
|
4885
4885
|
}
|
|
4886
|
-
},
|
|
4886
|
+
}, Ea = "'Silkscreen', cursive", _a = "https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap", Do = Z({
|
|
4887
4887
|
name: "Matrix",
|
|
4888
4888
|
background: "#000000",
|
|
4889
4889
|
candlestick: {
|
|
@@ -4908,10 +4908,10 @@ const Mo = {
|
|
|
4908
4908
|
axis: { textColor: "#00cc33" },
|
|
4909
4909
|
crosshair: { color: "rgba(0,255,65,0.3)", labelBackground: "#0a1a0a" },
|
|
4910
4910
|
tooltip: { background: "rgba(0,10,0,0.95)", textColor: "#00ff41", borderColor: "rgba(0,255,65,0.2)" },
|
|
4911
|
-
typography: { fontFamily:
|
|
4912
|
-
fontUrl:
|
|
4911
|
+
typography: { fontFamily: Ea },
|
|
4912
|
+
fontUrl: _a,
|
|
4913
4913
|
chartGradient: ["#010a01", "#000000"]
|
|
4914
|
-
}),
|
|
4914
|
+
}), Fo = Z({
|
|
4915
4915
|
name: "Lavender Mist",
|
|
4916
4916
|
background: "#f5f0f4",
|
|
4917
4917
|
candlestick: {
|
|
@@ -4936,10 +4936,10 @@ const Mo = {
|
|
|
4936
4936
|
axis: { textColor: "#9a88a0" },
|
|
4937
4937
|
crosshair: { color: "rgba(150,130,155,0.2)", labelBackground: "#ebe4e8" },
|
|
4938
4938
|
tooltip: { background: "rgba(245,240,244,0.95)", textColor: "#3a3050", borderColor: "rgba(150,130,155,0.25)" },
|
|
4939
|
-
typography: { fontFamily:
|
|
4940
|
-
fontUrl:
|
|
4939
|
+
typography: { fontFamily: gn },
|
|
4940
|
+
fontUrl: mn,
|
|
4941
4941
|
chartGradient: ["#f8f4f7", "#f5f0f4"]
|
|
4942
|
-
}),
|
|
4942
|
+
}), Bo = Z({
|
|
4943
4943
|
name: "Love",
|
|
4944
4944
|
description: "Soft romantic pinks and roses",
|
|
4945
4945
|
background: "#fef7f8",
|
|
@@ -4966,8 +4966,8 @@ const Mo = {
|
|
|
4966
4966
|
crosshair: { color: "rgba(180,140,155,0.3)", labelBackground: "#f0dce2" },
|
|
4967
4967
|
axis: { textColor: "#b08898" },
|
|
4968
4968
|
tooltip: { background: "rgba(253,242,244,0.95)", textColor: "#4a3040", borderColor: "rgba(200,160,175,0.35)" },
|
|
4969
|
-
typography: { fontFamily:
|
|
4970
|
-
fontUrl:
|
|
4969
|
+
typography: { fontFamily: zi },
|
|
4970
|
+
fontUrl: un
|
|
4971
4971
|
}), Po = Z({
|
|
4972
4972
|
name: "Material Palenight",
|
|
4973
4973
|
description: "Material Design in moonlit hues",
|
|
@@ -4994,9 +4994,9 @@ const Mo = {
|
|
|
4994
4994
|
crosshair: { color: "rgba(103,110,149,0.4)", labelBackground: "#34324a" },
|
|
4995
4995
|
axis: { textColor: "#676e95" },
|
|
4996
4996
|
tooltip: { background: "rgba(41,45,62,0.92)", textColor: "#a6accd", borderColor: "rgba(55,59,75,0.6)" },
|
|
4997
|
-
typography: { fontFamily:
|
|
4998
|
-
fontUrl:
|
|
4999
|
-
}),
|
|
4997
|
+
typography: { fontFamily: ys },
|
|
4998
|
+
fontUrl: xs
|
|
4999
|
+
}), Oa = "'Silkscreen', cursive", Ha = "https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap", zo = Z({
|
|
5000
5000
|
name: "Monochrome",
|
|
5001
5001
|
description: "Pure black and white, pixel font",
|
|
5002
5002
|
background: "#ffffff",
|
|
@@ -5023,9 +5023,9 @@ const Mo = {
|
|
|
5023
5023
|
crosshair: { color: "rgba(0,0,0,0.08)", labelBackground: "#f0f0f0" },
|
|
5024
5024
|
axis: { textColor: "#b0b0b0" },
|
|
5025
5025
|
tooltip: { fontSize: 9, background: "rgba(255,255,255,0.97)", textColor: "#222222", borderColor: "rgba(0,0,0,0.08)" },
|
|
5026
|
-
typography: { fontFamily:
|
|
5027
|
-
fontUrl:
|
|
5028
|
-
}),
|
|
5026
|
+
typography: { fontFamily: Oa },
|
|
5027
|
+
fontUrl: Ha
|
|
5028
|
+
}), Vo = Z({
|
|
5029
5029
|
name: "Mint Breeze",
|
|
5030
5030
|
background: "#f6f5ee",
|
|
5031
5031
|
candlestick: {
|
|
@@ -5050,10 +5050,10 @@ const Mo = {
|
|
|
5050
5050
|
axis: { textColor: "#80a098" },
|
|
5051
5051
|
crosshair: { color: "rgba(120,140,120,0.18)", labelBackground: "#ece8de" },
|
|
5052
5052
|
tooltip: { background: "rgba(246,245,238,0.95)", textColor: "#2a3530", borderColor: "rgba(130,140,115,0.2)" },
|
|
5053
|
-
typography: { fontFamily:
|
|
5054
|
-
fontUrl:
|
|
5053
|
+
typography: { fontFamily: ha },
|
|
5054
|
+
fontUrl: ca,
|
|
5055
5055
|
chartGradient: ["#f8f7f0", "#f6f5ee"]
|
|
5056
|
-
}),
|
|
5056
|
+
}), Yo = Z({
|
|
5057
5057
|
name: "Monokai Pro",
|
|
5058
5058
|
description: "Bold syntax colors on dark gray",
|
|
5059
5059
|
background: "#2d2a2e",
|
|
@@ -5079,9 +5079,9 @@ const Mo = {
|
|
|
5079
5079
|
crosshair: { color: "rgba(114,112,114,0.4)", labelBackground: "#403e42" },
|
|
5080
5080
|
axis: { textColor: "#727072" },
|
|
5081
5081
|
tooltip: { background: "rgba(45,42,46,0.92)", textColor: "#fcfcfa", borderColor: "rgba(64,60,62,0.6)" },
|
|
5082
|
-
typography: { fontFamily:
|
|
5083
|
-
fontUrl:
|
|
5084
|
-
}),
|
|
5082
|
+
typography: { fontFamily: dn },
|
|
5083
|
+
fontUrl: fn
|
|
5084
|
+
}), Eo = Z({
|
|
5085
5085
|
name: "Night Owl",
|
|
5086
5086
|
description: "Crafted for late-night coding",
|
|
5087
5087
|
background: "#011627",
|
|
@@ -5109,9 +5109,9 @@ const Mo = {
|
|
|
5109
5109
|
// the page bg's blue family instead of reading as a separate teal-grey.
|
|
5110
5110
|
axis: { textColor: "#4d5a6c" },
|
|
5111
5111
|
tooltip: { background: "rgba(1,22,39,0.92)", textColor: "#d6deeb", borderColor: "rgba(31,52,72,0.6)" },
|
|
5112
|
-
typography: { fontFamily:
|
|
5112
|
+
typography: { fontFamily: Bi },
|
|
5113
5113
|
fontUrl: Pi
|
|
5114
|
-
}),
|
|
5114
|
+
}), _o = Z({
|
|
5115
5115
|
name: "One Dark Pro",
|
|
5116
5116
|
description: "Atom editor's iconic dark palette",
|
|
5117
5117
|
background: "#282c34",
|
|
@@ -5137,9 +5137,9 @@ const Mo = {
|
|
|
5137
5137
|
crosshair: { color: "rgba(99,110,123,0.4)", labelBackground: "#3e4451" },
|
|
5138
5138
|
axis: { textColor: "#5c6370" },
|
|
5139
5139
|
tooltip: { background: "rgba(40,44,52,0.92)", textColor: "#abb2bf", borderColor: "rgba(59,64,72,0.6)" },
|
|
5140
|
-
typography: { fontFamily:
|
|
5140
|
+
typography: { fontFamily: Bi },
|
|
5141
5141
|
fontUrl: Pi
|
|
5142
|
-
}),
|
|
5142
|
+
}), Oo = Z({
|
|
5143
5143
|
name: "Panda",
|
|
5144
5144
|
description: "Playful neons on charcoal",
|
|
5145
5145
|
background: "#292a2b",
|
|
@@ -5165,9 +5165,9 @@ const Mo = {
|
|
|
5165
5165
|
crosshair: { color: "rgba(117,117,117,0.4)", labelBackground: "#3a3a3c" },
|
|
5166
5166
|
axis: { textColor: "#757575" },
|
|
5167
5167
|
tooltip: { background: "rgba(41,42,43,0.92)", textColor: "#e6e6e6", borderColor: "rgba(58,58,60,0.6)" },
|
|
5168
|
-
typography: { fontFamily:
|
|
5169
|
-
fontUrl:
|
|
5170
|
-
}),
|
|
5168
|
+
typography: { fontFamily: dn },
|
|
5169
|
+
fontUrl: fn
|
|
5170
|
+
}), Ho = Z({
|
|
5171
5171
|
name: "Peach Cream",
|
|
5172
5172
|
background: "#fef6f0",
|
|
5173
5173
|
candlestick: {
|
|
@@ -5192,10 +5192,10 @@ const Mo = {
|
|
|
5192
5192
|
axis: { textColor: "#b09080" },
|
|
5193
5193
|
crosshair: { color: "rgba(180,140,120,0.2)", labelBackground: "#f0e4d8" },
|
|
5194
5194
|
tooltip: { background: "rgba(254,246,240,0.95)", textColor: "#4a3028", borderColor: "rgba(180,140,120,0.25)" },
|
|
5195
|
-
typography: { fontFamily:
|
|
5196
|
-
fontUrl:
|
|
5195
|
+
typography: { fontFamily: gn },
|
|
5196
|
+
fontUrl: mn,
|
|
5197
5197
|
chartGradient: ["#fff8f2", "#fef6f0"]
|
|
5198
|
-
}),
|
|
5198
|
+
}), $o = Z({
|
|
5199
5199
|
name: "Quiet Light",
|
|
5200
5200
|
description: "Subdued and easy on the eyes",
|
|
5201
5201
|
background: "#f5f5f5",
|
|
@@ -5225,9 +5225,9 @@ const Mo = {
|
|
|
5225
5225
|
crosshair: { color: "rgba(170,170,170,0.3)", labelBackground: "#e8e8e8" },
|
|
5226
5226
|
axis: { textColor: "#aaaaaa" },
|
|
5227
5227
|
tooltip: { background: "rgba(245,245,245,0.95)", textColor: "#333333", borderColor: "rgba(200,200,200,0.5)" },
|
|
5228
|
-
typography: { fontFamily:
|
|
5229
|
-
fontUrl:
|
|
5230
|
-
}),
|
|
5228
|
+
typography: { fontFamily: oa },
|
|
5229
|
+
fontUrl: la
|
|
5230
|
+
}), No = Z({
|
|
5231
5231
|
name: "Rosé Pine Dawn",
|
|
5232
5232
|
description: "Dawn-inspired warm neutrals",
|
|
5233
5233
|
background: "#faf4ed",
|
|
@@ -5253,9 +5253,9 @@ const Mo = {
|
|
|
5253
5253
|
crosshair: { color: "rgba(152,147,165,0.3)", labelBackground: "#f2e9e1" },
|
|
5254
5254
|
axis: { textColor: "#9893a5" },
|
|
5255
5255
|
tooltip: { background: "rgba(250,244,237,0.95)", textColor: "#575279", borderColor: "rgba(152,147,165,0.3)" },
|
|
5256
|
-
typography: { fontFamily:
|
|
5257
|
-
fontUrl:
|
|
5258
|
-
}),
|
|
5256
|
+
typography: { fontFamily: ws },
|
|
5257
|
+
fontUrl: Ss
|
|
5258
|
+
}), Xo = Z({
|
|
5259
5259
|
name: "Sand Dune",
|
|
5260
5260
|
background: "#f4f0e8",
|
|
5261
5261
|
candlestick: {
|
|
@@ -5280,10 +5280,10 @@ const Mo = {
|
|
|
5280
5280
|
axis: { textColor: "#9a8a70" },
|
|
5281
5281
|
crosshair: { color: "rgba(150,130,100,0.2)", labelBackground: "#e8e0d0" },
|
|
5282
5282
|
tooltip: { background: "rgba(244,240,232,0.95)", textColor: "#3a3020", borderColor: "rgba(150,130,100,0.3)" },
|
|
5283
|
-
typography: { fontFamily:
|
|
5284
|
-
fontUrl:
|
|
5283
|
+
typography: { fontFamily: ws },
|
|
5284
|
+
fontUrl: Ss,
|
|
5285
5285
|
chartGradient: ["#f8f4ec", "#f4f0e8"]
|
|
5286
|
-
}),
|
|
5286
|
+
}), Uo = Z({
|
|
5287
5287
|
name: "Solarized Light",
|
|
5288
5288
|
description: "Ethan Schoonover's precision palette",
|
|
5289
5289
|
background: "#fdf6e3",
|
|
@@ -5310,25 +5310,25 @@ const Mo = {
|
|
|
5310
5310
|
crosshair: { color: "rgba(147,161,161,0.3)", labelBackground: "#eee8d5" },
|
|
5311
5311
|
axis: { textColor: "#93a1a1" },
|
|
5312
5312
|
tooltip: { background: "rgba(253,246,227,0.95)", textColor: "#586e75", borderColor: "rgba(238,232,213,0.6)" },
|
|
5313
|
-
typography: { fontFamily:
|
|
5313
|
+
typography: { fontFamily: Bi },
|
|
5314
5314
|
fontUrl: Pi
|
|
5315
5315
|
});
|
|
5316
|
-
function
|
|
5316
|
+
function Vi(i) {
|
|
5317
5317
|
const { x: t, y: e, chartWidth: n, chartHeight: s, tooltipWidth: r, tooltipHeight: a, offsetX: l = 16, offsetY: h = 16 } = i, d = t + l + r > n ? t - l - r : t + l, c = e + h + a > s ? e - h - a : e + h, u = Math.max(0, n - r), f = Math.max(0, s - a);
|
|
5318
5318
|
return {
|
|
5319
5319
|
left: Math.max(0, Math.min(u, d)),
|
|
5320
5320
|
top: Math.max(0, Math.min(f, c))
|
|
5321
5321
|
};
|
|
5322
5322
|
}
|
|
5323
|
-
const
|
|
5323
|
+
const Fe = Zn(null);
|
|
5324
5324
|
function ut() {
|
|
5325
|
-
const i =
|
|
5325
|
+
const i = an(Fe);
|
|
5326
5326
|
if (!i)
|
|
5327
5327
|
throw new Error("useChartInstance must be used within <ChartContainer>");
|
|
5328
5328
|
return i;
|
|
5329
5329
|
}
|
|
5330
|
-
const
|
|
5331
|
-
function
|
|
5330
|
+
const $a = 20;
|
|
5331
|
+
function Na({ data: i, options: t, id: e }) {
|
|
5332
5332
|
var h;
|
|
5333
5333
|
const n = ut(), s = G(null), r = G([]), a = G([]), l = G([]);
|
|
5334
5334
|
return nt(() => {
|
|
@@ -5348,7 +5348,7 @@ function $a({ data: i, options: t, id: e }) {
|
|
|
5348
5348
|
const g = vt(u[0].time), p = vt(u[u.length - 1].time), v = l.current[c] ?? null, w = m !== null && m !== g, x = u.length - f;
|
|
5349
5349
|
if (w && x === 0 && (v !== null && v !== p))
|
|
5350
5350
|
n.setSeriesData(d, u.slice(0, -1), c), n.appendData(d, u[u.length - 1], c);
|
|
5351
|
-
else if (f === 0 || u.length < f || x >
|
|
5351
|
+
else if (f === 0 || u.length < f || x > $a || w)
|
|
5352
5352
|
n.setSeriesData(d, u, c);
|
|
5353
5353
|
else if (u.length === f)
|
|
5354
5354
|
n.updateData(d, u[u.length - 1], c);
|
|
@@ -5372,8 +5372,8 @@ function $a({ data: i, options: t, id: e }) {
|
|
|
5372
5372
|
t == null ? void 0 : t.smoothMs
|
|
5373
5373
|
]), null;
|
|
5374
5374
|
}
|
|
5375
|
-
const
|
|
5376
|
-
function
|
|
5375
|
+
const Xa = 20;
|
|
5376
|
+
function Go({ data: i, options: t, id: e }) {
|
|
5377
5377
|
var h, d, c, u, f, m;
|
|
5378
5378
|
const n = ut(), s = G(null), r = G(0), a = G(null), l = G(null);
|
|
5379
5379
|
return nt(() => {
|
|
@@ -5391,7 +5391,7 @@ function Uo({ data: i, options: t, id: e }) {
|
|
|
5391
5391
|
const p = r.current, v = a.current, w = l.current, x = vt(i[0].time), y = vt(i[i.length - 1].time), M = v !== null && v !== x, S = i.length - p;
|
|
5392
5392
|
if (M && S === 0 && (w !== null && w !== y))
|
|
5393
5393
|
n.setSeriesData(g, i.slice(0, -1)), n.appendData(g, i[i.length - 1]);
|
|
5394
|
-
else if (p === 0 || i.length < p || S >
|
|
5394
|
+
else if (p === 0 || i.length < p || S > Xa || M)
|
|
5395
5395
|
n.setSeriesData(g, i);
|
|
5396
5396
|
else if (i.length === p)
|
|
5397
5397
|
n.updateData(g, i[i.length - 1]);
|
|
@@ -5418,17 +5418,17 @@ function Uo({ data: i, options: t, id: e }) {
|
|
|
5418
5418
|
t == null ? void 0 : t.smoothMs
|
|
5419
5419
|
]), null;
|
|
5420
5420
|
}
|
|
5421
|
-
const
|
|
5422
|
-
function
|
|
5423
|
-
const i =
|
|
5421
|
+
const pn = Zn(null), Ne = pn.Provider;
|
|
5422
|
+
function Yi() {
|
|
5423
|
+
const i = an(pn);
|
|
5424
5424
|
if (!i)
|
|
5425
5425
|
throw new Error("useTheme must be used within <ThemeProvider>");
|
|
5426
5426
|
return i;
|
|
5427
5427
|
}
|
|
5428
|
-
function
|
|
5429
|
-
return
|
|
5428
|
+
function Ua() {
|
|
5429
|
+
return an(pn);
|
|
5430
5430
|
}
|
|
5431
|
-
function
|
|
5431
|
+
function Ei(i, t, e) {
|
|
5432
5432
|
const n = Array.isArray(t) ? t : [t];
|
|
5433
5433
|
return {
|
|
5434
5434
|
subscribe: (s) => {
|
|
@@ -5441,22 +5441,22 @@ function Yi(i, t, e) {
|
|
|
5441
5441
|
getSnapshot: e
|
|
5442
5442
|
};
|
|
5443
5443
|
}
|
|
5444
|
-
function
|
|
5445
|
-
const t =
|
|
5446
|
-
() =>
|
|
5444
|
+
function Ga(i) {
|
|
5445
|
+
const t = Jt(
|
|
5446
|
+
() => Ei(i, ["viewportChange", "dataUpdate", "seriesChange"], () => i.getVisibleRange()),
|
|
5447
5447
|
[i]
|
|
5448
5448
|
);
|
|
5449
|
-
return
|
|
5449
|
+
return fi(t.subscribe, t.getSnapshot);
|
|
5450
5450
|
}
|
|
5451
|
-
function
|
|
5452
|
-
const t =
|
|
5453
|
-
() =>
|
|
5451
|
+
function ja(i) {
|
|
5452
|
+
const t = Jt(
|
|
5453
|
+
() => Ei(i, ["viewportChange", "dataUpdate", "seriesChange"], () => i.getYRange()),
|
|
5454
5454
|
[i]
|
|
5455
5455
|
);
|
|
5456
|
-
return
|
|
5456
|
+
return fi(t.subscribe, t.getSnapshot);
|
|
5457
5457
|
}
|
|
5458
|
-
function
|
|
5459
|
-
const e =
|
|
5458
|
+
function jo(i, t) {
|
|
5459
|
+
const e = Jt(() => {
|
|
5460
5460
|
let n = i.getLastValue(t), s = n ? i.yScale.valueToY(n.value) : null;
|
|
5461
5461
|
const r = () => n, a = () => {
|
|
5462
5462
|
const l = i.getLastValue(t), h = l ? i.yScale.valueToY(l.value) : null;
|
|
@@ -5475,32 +5475,32 @@ function Go(i, t) {
|
|
|
5475
5475
|
getSnapshot: r
|
|
5476
5476
|
};
|
|
5477
5477
|
}, [i, t]);
|
|
5478
|
-
return
|
|
5478
|
+
return fi(e.subscribe, e.getSnapshot);
|
|
5479
5479
|
}
|
|
5480
|
-
function
|
|
5481
|
-
const e =
|
|
5482
|
-
() =>
|
|
5480
|
+
function Ko(i, t) {
|
|
5481
|
+
const e = Jt(
|
|
5482
|
+
() => Ei(i, "dataUpdate", () => i.getPreviousClose(t)),
|
|
5483
5483
|
[i, t]
|
|
5484
5484
|
);
|
|
5485
|
-
return
|
|
5485
|
+
return fi(e.subscribe, e.getSnapshot);
|
|
5486
5486
|
}
|
|
5487
|
-
function
|
|
5488
|
-
const t =
|
|
5489
|
-
return
|
|
5487
|
+
function _i(i) {
|
|
5488
|
+
const t = Jt(() => Ei(i, "crosshairMove", () => i.getCrosshairPosition()), [i]);
|
|
5489
|
+
return fi(t.subscribe, t.getSnapshot);
|
|
5490
5490
|
}
|
|
5491
|
-
const
|
|
5492
|
-
function
|
|
5493
|
-
const n = ut(), s =
|
|
5491
|
+
const Ka = (i, t) => t === "volume" ? Se(i) : hs(i);
|
|
5492
|
+
function qa({ sort: i = "none", format: t = Ka, children: e }) {
|
|
5493
|
+
const n = ut(), s = Yi(), r = _i(n), [, a] = Ct(0);
|
|
5494
5494
|
nt(() => {
|
|
5495
5495
|
const f = () => a((m) => m + 1);
|
|
5496
5496
|
return n.on("overlayChange", f), n.getSeriesIds().length > 0 && a((m) => m + 1), () => {
|
|
5497
5497
|
n.off("overlayChange", f);
|
|
5498
5498
|
};
|
|
5499
5499
|
}, [n]);
|
|
5500
|
-
const l =
|
|
5500
|
+
const l = Ya(n, { sort: i, cacheKey: "infobar-last" });
|
|
5501
5501
|
let h = l, d = l.length === 0 ? 0 : Math.max(...l.map((f) => f.data.time)), c = !1;
|
|
5502
5502
|
if (r !== null) {
|
|
5503
|
-
const f =
|
|
5503
|
+
const f = Bs(n, { time: r.time, sort: i, cacheKey: "infobar-hover" });
|
|
5504
5504
|
f.length > 0 && (h = f, d = r.time, c = !0);
|
|
5505
5505
|
}
|
|
5506
5506
|
if (h.length === 0) return null;
|
|
@@ -5543,17 +5543,17 @@ function Ka({ sort: i = "none", format: t = ja, children: e }) {
|
|
|
5543
5543
|
pointerEvents: "none"
|
|
5544
5544
|
},
|
|
5545
5545
|
children: [
|
|
5546
|
-
/* @__PURE__ */ A("span", { style: { color: s.axis.textColor, marginRight: 2 }, children:
|
|
5546
|
+
/* @__PURE__ */ A("span", { style: { color: s.axis.textColor, marginRight: 2 }, children: Fi(d, u) }),
|
|
5547
5547
|
h.map((f) => {
|
|
5548
5548
|
if ("open" in f.data) {
|
|
5549
5549
|
const p = f.data, v = p.close >= p.open, w = kt(v ? s.candlestick.up.body : s.candlestick.down.body);
|
|
5550
5550
|
return /* @__PURE__ */ X("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
|
|
5551
|
-
/* @__PURE__ */ A(
|
|
5552
|
-
/* @__PURE__ */ A(
|
|
5553
|
-
/* @__PURE__ */ A(
|
|
5554
|
-
/* @__PURE__ */ A(
|
|
5551
|
+
/* @__PURE__ */ A(Xe, { label: "O", display: t(p.open, "open"), color: w, dim: s.axis.textColor }),
|
|
5552
|
+
/* @__PURE__ */ A(Xe, { label: "H", display: t(p.high, "high"), color: w, dim: s.axis.textColor }),
|
|
5553
|
+
/* @__PURE__ */ A(Xe, { label: "L", display: t(p.low, "low"), color: w, dim: s.axis.textColor }),
|
|
5554
|
+
/* @__PURE__ */ A(Xe, { label: "C", display: t(p.close, "close"), color: w, dim: s.axis.textColor }),
|
|
5555
5555
|
p.volume != null && /* @__PURE__ */ A(
|
|
5556
|
-
|
|
5556
|
+
Xe,
|
|
5557
5557
|
{
|
|
5558
5558
|
label: "V",
|
|
5559
5559
|
display: t(p.volume, "volume"),
|
|
@@ -5584,13 +5584,13 @@ function Ka({ sort: i = "none", format: t = ja, children: e }) {
|
|
|
5584
5584
|
}
|
|
5585
5585
|
);
|
|
5586
5586
|
}
|
|
5587
|
-
function
|
|
5588
|
-
return /* @__PURE__ */ X(
|
|
5587
|
+
function Xe({ label: i, display: t, color: e, dim: n }) {
|
|
5588
|
+
return /* @__PURE__ */ X(Ye, { children: [
|
|
5589
5589
|
/* @__PURE__ */ A("span", { style: { color: n, opacity: 0.5, marginLeft: 5 }, children: i }),
|
|
5590
5590
|
/* @__PURE__ */ A("span", { style: { color: e, fontWeight: 500, marginLeft: 2 }, children: t })
|
|
5591
5591
|
] });
|
|
5592
5592
|
}
|
|
5593
|
-
function
|
|
5593
|
+
function Ja({ chart: i, isolatedIdRef: t, setIsolatedId: e }) {
|
|
5594
5594
|
const n = [], s = i.getSeriesIds();
|
|
5595
5595
|
for (const r of s) {
|
|
5596
5596
|
const a = i.getSeriesLayers(r);
|
|
@@ -5599,7 +5599,7 @@ function qa({ chart: i, isolatedIdRef: t, setIsolatedId: e }) {
|
|
|
5599
5599
|
for (let h = 0; h < a.length; h++) {
|
|
5600
5600
|
const d = `${r}_layer${h}`, c = i.isSeriesVisible(r) && i.isLayerVisible(r, h);
|
|
5601
5601
|
n.push(
|
|
5602
|
-
|
|
5602
|
+
Qn({
|
|
5603
5603
|
id: d,
|
|
5604
5604
|
seriesId: r,
|
|
5605
5605
|
layerIndex: h,
|
|
@@ -5617,7 +5617,7 @@ function qa({ chart: i, isolatedIdRef: t, setIsolatedId: e }) {
|
|
|
5617
5617
|
if (!l) continue;
|
|
5618
5618
|
const h = i.getSeriesLabel(r), d = i.isSeriesVisible(r);
|
|
5619
5619
|
n.push(
|
|
5620
|
-
|
|
5620
|
+
Qn({
|
|
5621
5621
|
id: r,
|
|
5622
5622
|
seriesId: r,
|
|
5623
5623
|
layerIndex: void 0,
|
|
@@ -5633,7 +5633,7 @@ function qa({ chart: i, isolatedIdRef: t, setIsolatedId: e }) {
|
|
|
5633
5633
|
}
|
|
5634
5634
|
return n;
|
|
5635
5635
|
}
|
|
5636
|
-
function
|
|
5636
|
+
function Qn(i) {
|
|
5637
5637
|
const { id: t, seriesId: e, layerIndex: n, label: s, color: r, isDisabled: a, chart: l, isolatedIdRef: h, setIsolatedId: d } = i;
|
|
5638
5638
|
return { id: t, seriesId: e, layerIndex: n, label: s, color: r, isDisabled: a, toggle: () => {
|
|
5639
5639
|
n !== void 0 ? l.setLayerVisible(e, n, !l.isLayerVisible(e, n)) : l.setSeriesVisible(e, !l.isSeriesVisible(e));
|
|
@@ -5662,16 +5662,16 @@ function Jn(i) {
|
|
|
5662
5662
|
}), h.current = t, d(t);
|
|
5663
5663
|
} };
|
|
5664
5664
|
}
|
|
5665
|
-
function
|
|
5666
|
-
const s = ut(), r =
|
|
5665
|
+
function Qa({ items: i, position: t = "bottom", mode: e = "toggle", children: n }) {
|
|
5666
|
+
const s = ut(), r = Yi(), [a, l] = Ct(null), [h, d] = Ct(0), c = G(a);
|
|
5667
5667
|
c.current = a, nt(() => {
|
|
5668
5668
|
const p = () => d((w) => w + 1), v = () => l(null);
|
|
5669
5669
|
return s.on("overlayChange", p), s.on("seriesChange", v), s.getSeriesIds().length > 0 && d((w) => w + 1), () => {
|
|
5670
5670
|
s.off("overlayChange", p), s.off("seriesChange", v);
|
|
5671
5671
|
};
|
|
5672
5672
|
}, [s]);
|
|
5673
|
-
const u =
|
|
5674
|
-
() =>
|
|
5673
|
+
const u = Jt(
|
|
5674
|
+
() => Ja({ chart: s, isolatedIdRef: c, setIsolatedId: l }),
|
|
5675
5675
|
// biome-ignore lint/correctness/useExhaustiveDependencies: `bumpSignal` is the subscription signal; isolatedId triggers the opacity-only refresh
|
|
5676
5676
|
[s, a, h]
|
|
5677
5677
|
), f = t === "right", m = {
|
|
@@ -5723,8 +5723,8 @@ function Ja({ items: i, position: t = "bottom", mode: e = "toggle", children: n
|
|
|
5723
5723
|
p.id
|
|
5724
5724
|
)) });
|
|
5725
5725
|
}
|
|
5726
|
-
function
|
|
5727
|
-
const s = ut(), r =
|
|
5726
|
+
function Za({ data: i, height: t, style: e, className: n }) {
|
|
5727
|
+
const s = ut(), r = Yi(), a = G(null), l = G(null);
|
|
5728
5728
|
nt(() => {
|
|
5729
5729
|
if (!a.current) return;
|
|
5730
5730
|
const d = new Pa({
|
|
@@ -5760,21 +5760,21 @@ function Qa({ data: i, height: t, style: e, className: n }) {
|
|
|
5760
5760
|
}
|
|
5761
5761
|
);
|
|
5762
5762
|
}
|
|
5763
|
-
function
|
|
5763
|
+
function to(i, t) {
|
|
5764
5764
|
if (t !== void 0) return t;
|
|
5765
5765
|
const e = i.getSeriesIdsByType("pie", { visibleOnly: !0 });
|
|
5766
5766
|
return e.length > 0 ? e[0] : null;
|
|
5767
5767
|
}
|
|
5768
|
-
function
|
|
5769
|
-
const r = t ?? "both", a = n ?? "bottom", l = e ??
|
|
5768
|
+
function eo({ seriesId: i, mode: t, format: e, position: n, children: s }) {
|
|
5769
|
+
const r = t ?? "both", a = n ?? "bottom", l = e ?? Se, h = ut(), d = h.getTheme(), [, c] = Ct(0);
|
|
5770
5770
|
nt(() => {
|
|
5771
5771
|
const g = () => c((p) => p + 1);
|
|
5772
5772
|
return h.on("overlayChange", g), h.getSeriesIds().length > 0 && g(), () => {
|
|
5773
5773
|
h.off("overlayChange", g);
|
|
5774
5774
|
};
|
|
5775
5775
|
}, [h]);
|
|
5776
|
-
const u =
|
|
5777
|
-
return !f || f.length === 0 ? null : s ? /* @__PURE__ */ A(
|
|
5776
|
+
const u = to(h, i), f = u !== null ? h.getSliceInfo(u) : null;
|
|
5777
|
+
return !f || f.length === 0 ? null : s ? /* @__PURE__ */ A(Ye, { children: s({ slices: f, mode: r, format: l }) }) : /* @__PURE__ */ A(
|
|
5778
5778
|
"div",
|
|
5779
5779
|
{
|
|
5780
5780
|
"data-chart-pie-legend": "",
|
|
@@ -5845,8 +5845,8 @@ function to({ seriesId: i, mode: t, format: e, position: n, children: s }) {
|
|
|
5845
5845
|
}
|
|
5846
5846
|
);
|
|
5847
5847
|
}
|
|
5848
|
-
function
|
|
5849
|
-
const n =
|
|
5848
|
+
function io({ children: i, sub: t, style: e }) {
|
|
5849
|
+
const n = Yi();
|
|
5850
5850
|
return /* @__PURE__ */ X(
|
|
5851
5851
|
"div",
|
|
5852
5852
|
{
|
|
@@ -5871,41 +5871,41 @@ function eo({ children: i, sub: t, style: e }) {
|
|
|
5871
5871
|
}
|
|
5872
5872
|
);
|
|
5873
5873
|
}
|
|
5874
|
-
function
|
|
5874
|
+
function no(i) {
|
|
5875
5875
|
let t = null, e = null, n = null, s = null, r = null;
|
|
5876
5876
|
const a = [], l = (h) => {
|
|
5877
|
-
if (
|
|
5878
|
-
|
|
5877
|
+
if (wn(h) && h.type === Os) {
|
|
5878
|
+
xn.forEach(h.props.children, l);
|
|
5879
5879
|
return;
|
|
5880
5880
|
}
|
|
5881
|
-
if (
|
|
5882
|
-
if (h.type ===
|
|
5881
|
+
if (wn(h)) {
|
|
5882
|
+
if (h.type === io) {
|
|
5883
5883
|
t = h;
|
|
5884
5884
|
return;
|
|
5885
5885
|
}
|
|
5886
|
-
if (h.type ===
|
|
5886
|
+
if (h.type === Qa) {
|
|
5887
5887
|
e = h;
|
|
5888
5888
|
return;
|
|
5889
5889
|
}
|
|
5890
|
-
if (h.type ===
|
|
5890
|
+
if (h.type === eo) {
|
|
5891
5891
|
const d = h;
|
|
5892
5892
|
d.props.position === "overlay" ? a.push(h) : n = d;
|
|
5893
5893
|
return;
|
|
5894
5894
|
}
|
|
5895
|
-
if (h.type ===
|
|
5895
|
+
if (h.type === qa) {
|
|
5896
5896
|
s = h;
|
|
5897
5897
|
return;
|
|
5898
5898
|
}
|
|
5899
|
-
if (h.type ===
|
|
5899
|
+
if (h.type === Za) {
|
|
5900
5900
|
r = h;
|
|
5901
5901
|
return;
|
|
5902
5902
|
}
|
|
5903
5903
|
}
|
|
5904
5904
|
a.push(h);
|
|
5905
5905
|
};
|
|
5906
|
-
return
|
|
5906
|
+
return xn.forEach(i, l), { titleEl: t, legendEl: e, pieLegendEl: n, tooltipLegendEl: s, navigatorEl: r, overlay: a };
|
|
5907
5907
|
}
|
|
5908
|
-
function
|
|
5908
|
+
function so({
|
|
5909
5909
|
children: i,
|
|
5910
5910
|
theme: t,
|
|
5911
5911
|
axis: e,
|
|
@@ -5919,12 +5919,12 @@ function no({
|
|
|
5919
5919
|
style: c,
|
|
5920
5920
|
className: u
|
|
5921
5921
|
}) {
|
|
5922
|
-
var Yt, Rt,
|
|
5923
|
-
const f = G(h), m =
|
|
5922
|
+
var Yt, Rt, Zt, _e, mi, pi;
|
|
5923
|
+
const f = G(h), m = Ua(), g = t ?? m ?? void 0, p = G(null), v = G(null), [w, x] = Ct(0);
|
|
5924
5924
|
nt(() => {
|
|
5925
5925
|
if (!p.current || v.current) return;
|
|
5926
5926
|
const rt = {};
|
|
5927
|
-
return e && (rt.axis = e), g && (rt.theme = g), n && (rt.padding = n), r !== void 0 && (rt.interactive = r), a !== void 0 && (rt.grid = a), f.current !== void 0 && (rt.perf = f.current), d !== void 0 && (rt.animations = d), v.current = new
|
|
5927
|
+
return e && (rt.axis = e), g && (rt.theme = g), n && (rt.padding = n), r !== void 0 && (rt.interactive = r), a !== void 0 && (rt.grid = a), f.current !== void 0 && (rt.perf = f.current), d !== void 0 && (rt.animations = d), v.current = new ka(p.current, rt), x((mt) => mt + 1), () => {
|
|
5928
5928
|
var mt;
|
|
5929
5929
|
(mt = v.current) == null || mt.destroy(), v.current = null;
|
|
5930
5930
|
};
|
|
@@ -5932,20 +5932,20 @@ function no({
|
|
|
5932
5932
|
v.current && g && v.current.setTheme(g);
|
|
5933
5933
|
}, [g]), ct(() => {
|
|
5934
5934
|
v.current && e && v.current.setAxis(e);
|
|
5935
|
-
}, [(Yt = e == null ? void 0 : e.y) == null ? void 0 : Yt.width, (Rt = e == null ? void 0 : e.y) == null ? void 0 : Rt.min, (
|
|
5935
|
+
}, [(Yt = e == null ? void 0 : e.y) == null ? void 0 : Yt.width, (Rt = e == null ? void 0 : e.y) == null ? void 0 : Rt.min, (Zt = e == null ? void 0 : e.y) == null ? void 0 : Zt.max, (_e = e == null ? void 0 : e.y) == null ? void 0 : _e.visible, (mi = e == null ? void 0 : e.x) == null ? void 0 : mi.height, (pi = e == null ? void 0 : e.x) == null ? void 0 : pi.visible]), ct(() => {
|
|
5936
5936
|
v.current && d !== void 0 && v.current.setAnimations(d);
|
|
5937
5937
|
}, [JSON.stringify(d)]);
|
|
5938
5938
|
const y = G(null), [M, S] = Ct(0), F = l === "overlay" ? M : 0;
|
|
5939
5939
|
ct(() => {
|
|
5940
5940
|
const rt = v.current;
|
|
5941
5941
|
if (!rt) return;
|
|
5942
|
-
const
|
|
5942
|
+
const te = {
|
|
5943
5943
|
top: ((n == null ? void 0 : n.top) ?? 20) + F,
|
|
5944
5944
|
...(n == null ? void 0 : n.bottom) !== void 0 ? { bottom: n.bottom } : {},
|
|
5945
5945
|
...(n == null ? void 0 : n.right) !== void 0 ? { right: n.right } : {},
|
|
5946
5946
|
...(n == null ? void 0 : n.left) !== void 0 ? { left: n.left } : {}
|
|
5947
5947
|
};
|
|
5948
|
-
rt.setPadding(
|
|
5948
|
+
rt.setPadding(te);
|
|
5949
5949
|
}, [
|
|
5950
5950
|
n == null ? void 0 : n.top,
|
|
5951
5951
|
n == null ? void 0 : n.bottom,
|
|
@@ -5955,7 +5955,7 @@ function no({
|
|
|
5955
5955
|
]), ct(() => {
|
|
5956
5956
|
v.current && a !== void 0 && v.current.setGrid(a);
|
|
5957
5957
|
}, [a == null ? void 0 : a.visible]);
|
|
5958
|
-
const b = v.current, { titleEl: R, legendEl: I, pieLegendEl: C, tooltipLegendEl:
|
|
5958
|
+
const b = v.current, { titleEl: R, legendEl: I, pieLegendEl: C, tooltipLegendEl: W, navigatorEl: D, overlay: V } = no(i), P = (I == null ? void 0 : I.props.position) ?? "bottom", _ = (C == null ? void 0 : C.props.position) ?? "bottom", N = P === "right" || _ === "right", H = g ?? (b == null ? void 0 : b.getTheme()), [st, j] = (H == null ? void 0 : H.chartGradient) ?? ["transparent", "transparent"], yt = (H == null ? void 0 : H.background) ?? "transparent", xt = s ? `linear-gradient(to bottom, ${st} 0%, ${yt} 70%, ${j} 100%)` : yt;
|
|
5959
5959
|
nt(() => {
|
|
5960
5960
|
if (l !== "overlay") {
|
|
5961
5961
|
S(0);
|
|
@@ -5968,10 +5968,10 @@ function no({
|
|
|
5968
5968
|
}
|
|
5969
5969
|
const mt = () => S(rt.getBoundingClientRect().height);
|
|
5970
5970
|
mt();
|
|
5971
|
-
const
|
|
5972
|
-
return
|
|
5973
|
-
}, [R !== null,
|
|
5974
|
-
const Tt = (R ||
|
|
5971
|
+
const te = new ResizeObserver(mt);
|
|
5972
|
+
return te.observe(rt), () => te.disconnect();
|
|
5973
|
+
}, [R !== null, W !== null, l, b !== null]);
|
|
5974
|
+
const Tt = (R || W) && /* @__PURE__ */ X(
|
|
5975
5975
|
"div",
|
|
5976
5976
|
{
|
|
5977
5977
|
"data-chart-header": "",
|
|
@@ -5997,7 +5997,7 @@ function no({
|
|
|
5997
5997
|
},
|
|
5998
5998
|
children: [
|
|
5999
5999
|
R,
|
|
6000
|
-
|
|
6000
|
+
W
|
|
6001
6001
|
]
|
|
6002
6002
|
}
|
|
6003
6003
|
), Q = /* @__PURE__ */ A(
|
|
@@ -6011,7 +6011,7 @@ function no({
|
|
|
6011
6011
|
minHeight: 0,
|
|
6012
6012
|
overflow: "hidden"
|
|
6013
6013
|
},
|
|
6014
|
-
children: b && /* @__PURE__ */ A(
|
|
6014
|
+
children: b && /* @__PURE__ */ A(Fe.Provider, { value: b, children: /* @__PURE__ */ X(Ne, { value: g ?? b.getTheme(), children: [
|
|
6015
6015
|
l === "overlay" && Tt,
|
|
6016
6016
|
/* @__PURE__ */ A(
|
|
6017
6017
|
"div",
|
|
@@ -6028,17 +6028,17 @@ function no({
|
|
|
6028
6028
|
)
|
|
6029
6029
|
] }) })
|
|
6030
6030
|
}
|
|
6031
|
-
),
|
|
6031
|
+
), Qt = l === "inline" ? /* @__PURE__ */ X(
|
|
6032
6032
|
"div",
|
|
6033
6033
|
{
|
|
6034
6034
|
"data-chart-canvas-block": "",
|
|
6035
6035
|
style: { display: "flex", flexDirection: "column", flex: 1, minWidth: 0, minHeight: 0 },
|
|
6036
6036
|
children: [
|
|
6037
|
-
b && Tt && /* @__PURE__ */ A(
|
|
6037
|
+
b && Tt && /* @__PURE__ */ A(Fe.Provider, { value: b, children: /* @__PURE__ */ A(Ne, { value: g ?? b.getTheme(), children: Tt }) }),
|
|
6038
6038
|
Q
|
|
6039
6039
|
]
|
|
6040
6040
|
}
|
|
6041
|
-
) : Q, wt = b && I && /* @__PURE__ */ A(
|
|
6041
|
+
) : Q, wt = b && I && /* @__PURE__ */ A(Fe.Provider, { value: b, children: /* @__PURE__ */ A(Ne, { value: g ?? b.getTheme(), children: I }) }), ft = b && C && /* @__PURE__ */ A(Fe.Provider, { value: b, children: /* @__PURE__ */ A(Ne, { value: g ?? b.getTheme(), children: C }) }), gt = b && D && /* @__PURE__ */ A(Fe.Provider, { value: b, children: /* @__PURE__ */ A(Ne, { value: g ?? b.getTheme(), children: D }) });
|
|
6042
6042
|
return /* @__PURE__ */ X(
|
|
6043
6043
|
"div",
|
|
6044
6044
|
{
|
|
@@ -6064,7 +6064,7 @@ function no({
|
|
|
6064
6064
|
minWidth: 0
|
|
6065
6065
|
},
|
|
6066
6066
|
children: [
|
|
6067
|
-
|
|
6067
|
+
Qt,
|
|
6068
6068
|
wt,
|
|
6069
6069
|
ft
|
|
6070
6070
|
]
|
|
@@ -6075,8 +6075,8 @@ function no({
|
|
|
6075
6075
|
}
|
|
6076
6076
|
);
|
|
6077
6077
|
}
|
|
6078
|
-
const
|
|
6079
|
-
function
|
|
6078
|
+
const ro = 20;
|
|
6079
|
+
function ao({ data: i, options: t, id: e }) {
|
|
6080
6080
|
var h, d;
|
|
6081
6081
|
const n = ut(), s = G(null), r = G([]), a = G([]), l = G([]);
|
|
6082
6082
|
return nt(() => {
|
|
@@ -6096,7 +6096,7 @@ function ro({ data: i, options: t, id: e }) {
|
|
|
6096
6096
|
const p = vt(f[0].time), v = vt(f[f.length - 1].time), w = l.current[u] ?? null, x = g !== null && g !== p, y = f.length - m;
|
|
6097
6097
|
if (x && y === 0 && (w !== null && w !== v))
|
|
6098
6098
|
n.setSeriesData(c, f.slice(0, -1), u), n.appendData(c, f[f.length - 1], u);
|
|
6099
|
-
else if (m === 0 || f.length < m || y >
|
|
6099
|
+
else if (m === 0 || f.length < m || y > ro || x)
|
|
6100
6100
|
n.setSeriesData(c, f, u);
|
|
6101
6101
|
else if (f.length === m)
|
|
6102
6102
|
n.updateData(c, f[f.length - 1], u);
|
|
@@ -6123,7 +6123,7 @@ function ro({ data: i, options: t, id: e }) {
|
|
|
6123
6123
|
t == null ? void 0 : t.smoothMs
|
|
6124
6124
|
]), null;
|
|
6125
6125
|
}
|
|
6126
|
-
function
|
|
6126
|
+
function qo({ data: i, options: t, id: e }) {
|
|
6127
6127
|
var r, a, l, h, d, c, u, f, m, g;
|
|
6128
6128
|
const n = ut(), s = G(null);
|
|
6129
6129
|
return nt(() => {
|
|
@@ -6155,8 +6155,8 @@ function Ko({ data: i, options: t, id: e }) {
|
|
|
6155
6155
|
s.current && n.setSeriesData(s.current, i);
|
|
6156
6156
|
}, [n, i]), null;
|
|
6157
6157
|
}
|
|
6158
|
-
function
|
|
6159
|
-
const i = ut(), t =
|
|
6158
|
+
function Jo() {
|
|
6159
|
+
const i = ut(), t = _i(i);
|
|
6160
6160
|
if (!t) return null;
|
|
6161
6161
|
const e = i.getTheme(), n = i.getDataInterval(), s = {
|
|
6162
6162
|
// Blend the theme's labelBackground at 80% opacity so the axis grid
|
|
@@ -6175,7 +6175,7 @@ function qo() {
|
|
|
6175
6175
|
// live last-value stays visible when the crosshair crosses its row.
|
|
6176
6176
|
zIndex: 2
|
|
6177
6177
|
};
|
|
6178
|
-
return /* @__PURE__ */ X(
|
|
6178
|
+
return /* @__PURE__ */ X(Ye, { children: [
|
|
6179
6179
|
/* @__PURE__ */ A(
|
|
6180
6180
|
"div",
|
|
6181
6181
|
{
|
|
@@ -6199,24 +6199,24 @@ function qo() {
|
|
|
6199
6199
|
transform: "translateX(-50%)",
|
|
6200
6200
|
...s
|
|
6201
6201
|
},
|
|
6202
|
-
children:
|
|
6202
|
+
children: Fi(t.time, n)
|
|
6203
6203
|
}
|
|
6204
6204
|
)
|
|
6205
6205
|
] });
|
|
6206
6206
|
}
|
|
6207
|
-
const
|
|
6208
|
-
function
|
|
6207
|
+
const oo = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
6208
|
+
function lo(i) {
|
|
6209
6209
|
const t = [];
|
|
6210
6210
|
for (const e of i)
|
|
6211
6211
|
e >= "0" && e <= "9" ? t.push({ type: "digit", value: e }) : t.push({ type: "symbol", value: e });
|
|
6212
6212
|
return t;
|
|
6213
6213
|
}
|
|
6214
|
-
function
|
|
6215
|
-
const l =
|
|
6214
|
+
function ho({ value: i, format: t, locale: e = "en-US", spinDuration: n = 350, className: s, style: r }) {
|
|
6215
|
+
const l = Jt(() => {
|
|
6216
6216
|
if (typeof t == "function") return t;
|
|
6217
6217
|
const d = new Intl.NumberFormat(e, typeof t == "object" ? t : void 0);
|
|
6218
6218
|
return (c) => d.format(c);
|
|
6219
|
-
}, [t, e])(i), h =
|
|
6219
|
+
}, [t, e])(i), h = lo(l);
|
|
6220
6220
|
return /* @__PURE__ */ A(
|
|
6221
6221
|
"span",
|
|
6222
6222
|
{
|
|
@@ -6228,12 +6228,12 @@ function lo({ value: i, format: t, locale: e = "en-US", spinDuration: n = 350, c
|
|
|
6228
6228
|
...r
|
|
6229
6229
|
},
|
|
6230
6230
|
children: h.map(
|
|
6231
|
-
(d, c) => d.type === "digit" ? /* @__PURE__ */ A(
|
|
6231
|
+
(d, c) => d.type === "digit" ? /* @__PURE__ */ A(co, { digit: parseInt(d.value, 10), duration: n }, `d${c}`) : /* @__PURE__ */ A("span", { style: { display: "inline-block" }, children: d.value }, `s${c}`)
|
|
6232
6232
|
)
|
|
6233
6233
|
}
|
|
6234
6234
|
);
|
|
6235
6235
|
}
|
|
6236
|
-
function
|
|
6236
|
+
function co({ digit: i, duration: t }) {
|
|
6237
6237
|
const e = G(!1);
|
|
6238
6238
|
return ct(() => {
|
|
6239
6239
|
e.current = !0;
|
|
@@ -6255,7 +6255,7 @@ function ho({ digit: i, duration: t }) {
|
|
|
6255
6255
|
transform: `translateY(${-i * 1.2}em)`,
|
|
6256
6256
|
transition: e.current ? `transform ${t}ms cubic-bezier(0.16, 1, 0.3, 1)` : "none"
|
|
6257
6257
|
},
|
|
6258
|
-
children:
|
|
6258
|
+
children: oo.map((n) => /* @__PURE__ */ A(
|
|
6259
6259
|
"span",
|
|
6260
6260
|
{
|
|
6261
6261
|
style: {
|
|
@@ -6273,26 +6273,26 @@ function ho({ digit: i, duration: t }) {
|
|
|
6273
6273
|
}
|
|
6274
6274
|
);
|
|
6275
6275
|
}
|
|
6276
|
-
function
|
|
6276
|
+
function uo(i, t) {
|
|
6277
6277
|
if (t !== void 0) return t;
|
|
6278
6278
|
const e = i.getSeriesIdsByType("pie", { visibleOnly: !0 });
|
|
6279
6279
|
return e.length > 0 ? e[0] : null;
|
|
6280
6280
|
}
|
|
6281
|
-
const
|
|
6282
|
-
function
|
|
6283
|
-
const n = ut(), s =
|
|
6281
|
+
const fo = 160, go = 70;
|
|
6282
|
+
function Qo({ seriesId: i, format: t = Se, children: e }) {
|
|
6283
|
+
const n = ut(), s = _i(n), [, r] = Ct(0);
|
|
6284
6284
|
nt(() => {
|
|
6285
6285
|
const f = () => r((m) => m + 1);
|
|
6286
6286
|
return n.on("overlayChange", f), () => {
|
|
6287
6287
|
n.off("overlayChange", f);
|
|
6288
6288
|
};
|
|
6289
6289
|
}, [n]);
|
|
6290
|
-
const a =
|
|
6290
|
+
const a = uo(n, i), l = a !== null ? n.getHoverInfo(a) : null;
|
|
6291
6291
|
if (!l || !s) return null;
|
|
6292
6292
|
const h = n.getTheme(), d = n.getMediaSize();
|
|
6293
6293
|
if (e)
|
|
6294
6294
|
return /* @__PURE__ */ A(
|
|
6295
|
-
|
|
6295
|
+
mo,
|
|
6296
6296
|
{
|
|
6297
6297
|
x: s.mediaX,
|
|
6298
6298
|
y: s.mediaY,
|
|
@@ -6301,13 +6301,13 @@ function Jo({ seriesId: i, format: t = we, children: e }) {
|
|
|
6301
6301
|
children: e({ info: l, format: t })
|
|
6302
6302
|
}
|
|
6303
6303
|
);
|
|
6304
|
-
const { left: c, top: u } =
|
|
6304
|
+
const { left: c, top: u } = Vi({
|
|
6305
6305
|
x: s.mediaX,
|
|
6306
6306
|
y: s.mediaY,
|
|
6307
6307
|
chartWidth: d.width,
|
|
6308
6308
|
chartHeight: d.height,
|
|
6309
|
-
tooltipWidth:
|
|
6310
|
-
tooltipHeight:
|
|
6309
|
+
tooltipWidth: fo,
|
|
6310
|
+
tooltipHeight: go,
|
|
6311
6311
|
offsetX: 16,
|
|
6312
6312
|
offsetY: 16
|
|
6313
6313
|
});
|
|
@@ -6361,7 +6361,7 @@ function Jo({ seriesId: i, format: t = we, children: e }) {
|
|
|
6361
6361
|
}
|
|
6362
6362
|
);
|
|
6363
6363
|
}
|
|
6364
|
-
function
|
|
6364
|
+
function mo({
|
|
6365
6365
|
x: i,
|
|
6366
6366
|
y: t,
|
|
6367
6367
|
chartWidth: e,
|
|
@@ -6381,7 +6381,7 @@ function go({
|
|
|
6381
6381
|
});
|
|
6382
6382
|
return c.observe(d), () => c.disconnect();
|
|
6383
6383
|
}, []);
|
|
6384
|
-
const h = a ?
|
|
6384
|
+
const h = a ? Vi({
|
|
6385
6385
|
x: i,
|
|
6386
6386
|
y: t,
|
|
6387
6387
|
chartWidth: e,
|
|
@@ -6413,22 +6413,22 @@ function go({
|
|
|
6413
6413
|
}
|
|
6414
6414
|
);
|
|
6415
6415
|
}
|
|
6416
|
-
function
|
|
6416
|
+
function po(i, t) {
|
|
6417
6417
|
if (i.startsWith("rgba") || !i.startsWith("#")) return i;
|
|
6418
6418
|
const e = parseInt(i.slice(1, 3), 16), n = parseInt(i.slice(3, 5), 16), s = parseInt(i.slice(5, 7), 16);
|
|
6419
6419
|
return `rgba(${e}, ${n}, ${s}, ${t})`;
|
|
6420
6420
|
}
|
|
6421
|
-
function
|
|
6421
|
+
function bo(i) {
|
|
6422
6422
|
if (i.length < 2) return { value: 0, pct: 0, positive: !0 };
|
|
6423
6423
|
const t = i[0].value, n = i[i.length - 1].value - t, s = t !== 0 ? n / t * 100 : 0;
|
|
6424
6424
|
return { value: n, pct: s, positive: n >= 0 };
|
|
6425
6425
|
}
|
|
6426
|
-
function
|
|
6426
|
+
function Zo({
|
|
6427
6427
|
data: i,
|
|
6428
6428
|
theme: t,
|
|
6429
6429
|
variant: e = "line",
|
|
6430
6430
|
valuePosition: n = "right",
|
|
6431
|
-
formatValue: s =
|
|
6431
|
+
formatValue: s = Se,
|
|
6432
6432
|
label: r,
|
|
6433
6433
|
sublabel: a,
|
|
6434
6434
|
color: l,
|
|
@@ -6441,7 +6441,7 @@ function Qo({
|
|
|
6441
6441
|
gradient: g = !0,
|
|
6442
6442
|
style: p
|
|
6443
6443
|
}) {
|
|
6444
|
-
const v = (d == null ? void 0 : d.visible) ?? c ?? !0, w = i.length > 0 ? i[i.length - 1].value : 0, x =
|
|
6444
|
+
const v = (d == null ? void 0 : d.visible) ?? c ?? !0, w = i.length > 0 ? i[i.length - 1].value : 0, x = Jt(() => bo(i), [i]), y = l ?? t.seriesColors[0], M = h ?? kt(t.candlestick.down.body), S = kt(
|
|
6445
6445
|
x.positive ? t.candlestick.up.body : t.candlestick.down.body
|
|
6446
6446
|
), F = n !== "none" && /* @__PURE__ */ X(
|
|
6447
6447
|
"div",
|
|
@@ -6515,7 +6515,7 @@ function Qo({
|
|
|
6515
6515
|
]
|
|
6516
6516
|
}
|
|
6517
6517
|
), b = /* @__PURE__ */ A("div", { style: { width: u, height: f, flexShrink: 0, borderRadius: 4, overflow: "hidden" }, children: /* @__PURE__ */ A(
|
|
6518
|
-
|
|
6518
|
+
so,
|
|
6519
6519
|
{
|
|
6520
6520
|
theme: t,
|
|
6521
6521
|
axis: {
|
|
@@ -6527,7 +6527,7 @@ function Qo({
|
|
|
6527
6527
|
interactive: !1,
|
|
6528
6528
|
grid: { visible: !1 },
|
|
6529
6529
|
children: e === "line" ? /* @__PURE__ */ A(
|
|
6530
|
-
|
|
6530
|
+
ao,
|
|
6531
6531
|
{
|
|
6532
6532
|
data: [i],
|
|
6533
6533
|
options: {
|
|
@@ -6539,7 +6539,7 @@ function Qo({
|
|
|
6539
6539
|
}
|
|
6540
6540
|
}
|
|
6541
6541
|
) : /* @__PURE__ */ A(
|
|
6542
|
-
|
|
6542
|
+
Na,
|
|
6543
6543
|
{
|
|
6544
6544
|
data: [i],
|
|
6545
6545
|
options: {
|
|
@@ -6560,7 +6560,7 @@ function Qo({
|
|
|
6560
6560
|
gap: 12,
|
|
6561
6561
|
padding: "8px 12px",
|
|
6562
6562
|
borderRadius: 8,
|
|
6563
|
-
background:
|
|
6563
|
+
background: po(t.tooltip.background, 0.7),
|
|
6564
6564
|
border: `1px solid ${t.tooltip.borderColor}`,
|
|
6565
6565
|
fontFamily: t.typography.fontFamily,
|
|
6566
6566
|
...p
|
|
@@ -6573,10 +6573,10 @@ function Qo({
|
|
|
6573
6573
|
}
|
|
6574
6574
|
);
|
|
6575
6575
|
}
|
|
6576
|
-
const Ps = 250,
|
|
6577
|
-
function
|
|
6576
|
+
const Ps = 250, zs = `opacity ${Ps / 1e3}s ease`, Vs = Ps * 2;
|
|
6577
|
+
function tl({ labelCount: i, minLabelSpacing: t } = {}) {
|
|
6578
6578
|
const e = ut();
|
|
6579
|
-
|
|
6579
|
+
Ga(e), nt(() => (e.setTimeAxisLabelDensity({
|
|
6580
6580
|
labelCount: i ?? null,
|
|
6581
6581
|
minLabelSpacing: t ?? null
|
|
6582
6582
|
}), () => {
|
|
@@ -6588,7 +6588,7 @@ function Zo({ labelCount: i, minLabelSpacing: t } = {}) {
|
|
|
6588
6588
|
for (const [f, m] of d)
|
|
6589
6589
|
l.has(f) || m.opacity !== 0 && (m.opacity = 0, m.fadedAt = c);
|
|
6590
6590
|
for (const [f, m] of d)
|
|
6591
|
-
m.opacity === 0 && m.fadedAt !== void 0 && c - m.fadedAt >
|
|
6591
|
+
m.opacity === 0 && m.fadedAt !== void 0 && c - m.fadedAt > Vs && d.delete(f);
|
|
6592
6592
|
const u = Array.from(d.entries());
|
|
6593
6593
|
return /* @__PURE__ */ A(
|
|
6594
6594
|
"div",
|
|
@@ -6612,16 +6612,16 @@ function Zo({ labelCount: i, minLabelSpacing: t } = {}) {
|
|
|
6612
6612
|
position: "absolute",
|
|
6613
6613
|
left: g,
|
|
6614
6614
|
transform: "translateX(-50%)",
|
|
6615
|
-
color:
|
|
6616
|
-
fontSize:
|
|
6615
|
+
color: fs(n, "x"),
|
|
6616
|
+
fontSize: ds(n, "x"),
|
|
6617
6617
|
fontFamily: n.typography.fontFamily,
|
|
6618
6618
|
userSelect: "none",
|
|
6619
6619
|
whiteSpace: "nowrap",
|
|
6620
6620
|
opacity: m.opacity,
|
|
6621
|
-
transition:
|
|
6621
|
+
transition: zs,
|
|
6622
6622
|
willChange: "opacity"
|
|
6623
6623
|
},
|
|
6624
|
-
children:
|
|
6624
|
+
children: Fi(f, a)
|
|
6625
6625
|
},
|
|
6626
6626
|
f
|
|
6627
6627
|
);
|
|
@@ -6629,20 +6629,20 @@ function Zo({ labelCount: i, minLabelSpacing: t } = {}) {
|
|
|
6629
6629
|
}
|
|
6630
6630
|
);
|
|
6631
6631
|
}
|
|
6632
|
-
const
|
|
6633
|
-
function
|
|
6634
|
-
const n = ut(), s =
|
|
6632
|
+
const vo = (i, t) => t === "volume" ? Se(i) : hs(i);
|
|
6633
|
+
function el({ sort: i = "none", format: t = vo, children: e }) {
|
|
6634
|
+
const n = ut(), s = _i(n), [, r] = Ct(0);
|
|
6635
6635
|
if (nt(() => {
|
|
6636
6636
|
const f = () => r((m) => m + 1);
|
|
6637
6637
|
return n.on("overlayChange", f), n.getSeriesIds().length > 0 && r((m) => m + 1), () => {
|
|
6638
6638
|
n.off("overlayChange", f);
|
|
6639
6639
|
};
|
|
6640
6640
|
}, [n]), !s) return null;
|
|
6641
|
-
const a =
|
|
6641
|
+
const a = Bs(n, { time: s.time, sort: i, cacheKey: "tooltip" });
|
|
6642
6642
|
if (a.length === 0) return null;
|
|
6643
6643
|
const l = n.getTheme(), h = n.getDataInterval(), d = n.getMediaSize(), c = d.width - n.yAxisWidth, u = d.height - n.xAxisHeight;
|
|
6644
6644
|
return e ? /* @__PURE__ */ A(
|
|
6645
|
-
|
|
6645
|
+
yo,
|
|
6646
6646
|
{
|
|
6647
6647
|
x: s.mediaX,
|
|
6648
6648
|
y: s.mediaY,
|
|
@@ -6652,7 +6652,7 @@ function tl({ sort: i = "none", format: t = bo, children: e }) {
|
|
|
6652
6652
|
children: e({ snapshots: a, time: s.time })
|
|
6653
6653
|
}
|
|
6654
6654
|
) : /* @__PURE__ */ A(
|
|
6655
|
-
|
|
6655
|
+
xo,
|
|
6656
6656
|
{
|
|
6657
6657
|
snapshots: a,
|
|
6658
6658
|
displayTime: s.time,
|
|
@@ -6666,7 +6666,7 @@ function tl({ sort: i = "none", format: t = bo, children: e }) {
|
|
|
6666
6666
|
}
|
|
6667
6667
|
);
|
|
6668
6668
|
}
|
|
6669
|
-
function
|
|
6669
|
+
function yo({
|
|
6670
6670
|
x: i,
|
|
6671
6671
|
y: t,
|
|
6672
6672
|
chartWidth: e,
|
|
@@ -6687,7 +6687,7 @@ function vo({
|
|
|
6687
6687
|
});
|
|
6688
6688
|
return u.observe(c), () => u.disconnect();
|
|
6689
6689
|
}, []);
|
|
6690
|
-
const d = l ?
|
|
6690
|
+
const d = l ? Vi({ x: i, y: t, chartWidth: e, chartHeight: n, tooltipWidth: l.width, tooltipHeight: l.height }) : { left: 0, top: 0 };
|
|
6691
6691
|
return /* @__PURE__ */ A(
|
|
6692
6692
|
"div",
|
|
6693
6693
|
{
|
|
@@ -6719,7 +6719,7 @@ function vo({
|
|
|
6719
6719
|
}
|
|
6720
6720
|
);
|
|
6721
6721
|
}
|
|
6722
|
-
function
|
|
6722
|
+
function xo({
|
|
6723
6723
|
snapshots: i,
|
|
6724
6724
|
displayTime: t,
|
|
6725
6725
|
x: e,
|
|
@@ -6730,7 +6730,7 @@ function yo({
|
|
|
6730
6730
|
dataInterval: l,
|
|
6731
6731
|
format: h
|
|
6732
6732
|
}) {
|
|
6733
|
-
const d = i.some((x) => "open" in x.data), c = i.filter((x) => !("open" in x.data)).length, u = 160, f = d ? 140 : 40 + c * 22, { left: m, top: g } =
|
|
6733
|
+
const d = i.some((x) => "open" in x.data), c = i.filter((x) => !("open" in x.data)).length, u = 160, f = d ? 140 : 40 + c * 22, { left: m, top: g } = Vi({ x: e, y: n, chartWidth: s, chartHeight: r, tooltipWidth: u, tooltipHeight: f }), p = a.tooltip.background, v = a.tooltip.borderColor;
|
|
6734
6734
|
return /* @__PURE__ */ X(
|
|
6735
6735
|
"div",
|
|
6736
6736
|
{
|
|
@@ -6771,9 +6771,9 @@ function yo({
|
|
|
6771
6771
|
letterSpacing: "0.02em"
|
|
6772
6772
|
},
|
|
6773
6773
|
children: [
|
|
6774
|
-
|
|
6774
|
+
Sr(t),
|
|
6775
6775
|
" ",
|
|
6776
|
-
|
|
6776
|
+
Fi(t, l)
|
|
6777
6777
|
]
|
|
6778
6778
|
}
|
|
6779
6779
|
),
|
|
@@ -6783,11 +6783,11 @@ function yo({
|
|
|
6783
6783
|
F ? a.candlestick.up.body : a.candlestick.down.body
|
|
6784
6784
|
);
|
|
6785
6785
|
return /* @__PURE__ */ X("div", { style: { display: "grid", gridTemplateColumns: "auto 1fr", gap: "4px 12px" }, children: [
|
|
6786
|
-
/* @__PURE__ */ A(
|
|
6787
|
-
/* @__PURE__ */ A(
|
|
6788
|
-
/* @__PURE__ */ A(
|
|
6789
|
-
/* @__PURE__ */ A(
|
|
6790
|
-
S.volume != null && /* @__PURE__ */ A(
|
|
6786
|
+
/* @__PURE__ */ A(Ue, { label: "Open", color: b, display: h(S.open, "open") }),
|
|
6787
|
+
/* @__PURE__ */ A(Ue, { label: "High", color: b, display: h(S.high, "high") }),
|
|
6788
|
+
/* @__PURE__ */ A(Ue, { label: "Low", color: b, display: h(S.low, "low") }),
|
|
6789
|
+
/* @__PURE__ */ A(Ue, { label: "Close", color: b, display: h(S.close, "close") }),
|
|
6790
|
+
S.volume != null && /* @__PURE__ */ A(Ue, { label: "Volume", color: a.tooltip.textColor, display: h(S.volume, "volume") })
|
|
6791
6791
|
] }, x.id);
|
|
6792
6792
|
}
|
|
6793
6793
|
const M = x.data;
|
|
@@ -6812,15 +6812,15 @@ function yo({
|
|
|
6812
6812
|
}
|
|
6813
6813
|
);
|
|
6814
6814
|
}
|
|
6815
|
-
function
|
|
6816
|
-
return /* @__PURE__ */ X(
|
|
6815
|
+
function Ue({ label: i, color: t, display: e }) {
|
|
6816
|
+
return /* @__PURE__ */ X(Ye, { children: [
|
|
6817
6817
|
/* @__PURE__ */ A("span", { style: { opacity: 0.5 }, children: i }),
|
|
6818
6818
|
/* @__PURE__ */ A("span", { style: { fontWeight: 600, color: t, textAlign: "right" }, children: e })
|
|
6819
6819
|
] });
|
|
6820
6820
|
}
|
|
6821
|
-
function
|
|
6821
|
+
function il({ format: i, labelCount: t, minLabelSpacing: e } = {}) {
|
|
6822
6822
|
const n = ut();
|
|
6823
|
-
|
|
6823
|
+
ja(n), nt(() => (n.yScale.setFormat(i ?? null), () => n.yScale.setFormat(null)), [n, i]), nt(() => (n.setYAxisLabelDensity({
|
|
6824
6824
|
labelCount: t ?? null,
|
|
6825
6825
|
minLabelSpacing: e ?? null
|
|
6826
6826
|
}), () => {
|
|
@@ -6832,7 +6832,7 @@ function el({ format: i, labelCount: t, minLabelSpacing: e } = {}) {
|
|
|
6832
6832
|
for (const [u, f] of h)
|
|
6833
6833
|
a.has(u) || f.opacity !== 0 && (f.opacity = 0, f.fadedAt = d);
|
|
6834
6834
|
for (const [u, f] of h)
|
|
6835
|
-
f.opacity === 0 && f.fadedAt !== void 0 && d - f.fadedAt >
|
|
6835
|
+
f.opacity === 0 && f.fadedAt !== void 0 && d - f.fadedAt > Vs && h.delete(u);
|
|
6836
6836
|
const c = Array.from(h.entries());
|
|
6837
6837
|
return /* @__PURE__ */ A(
|
|
6838
6838
|
"div",
|
|
@@ -6855,13 +6855,13 @@ function el({ format: i, labelCount: t, minLabelSpacing: e } = {}) {
|
|
|
6855
6855
|
right: 8,
|
|
6856
6856
|
top: m,
|
|
6857
6857
|
transform: "translateY(-50%)",
|
|
6858
|
-
color:
|
|
6859
|
-
fontSize:
|
|
6858
|
+
color: fs(s, "y"),
|
|
6859
|
+
fontSize: ds(s, "y"),
|
|
6860
6860
|
fontFamily: s.typography.fontFamily,
|
|
6861
6861
|
fontVariantNumeric: "tabular-nums",
|
|
6862
6862
|
userSelect: "none",
|
|
6863
6863
|
opacity: f.opacity,
|
|
6864
|
-
transition:
|
|
6864
|
+
transition: zs,
|
|
6865
6865
|
willChange: "opacity"
|
|
6866
6866
|
},
|
|
6867
6867
|
children: n.yScale.formatY(u)
|
|
@@ -6872,14 +6872,14 @@ function el({ format: i, labelCount: t, minLabelSpacing: e } = {}) {
|
|
|
6872
6872
|
}
|
|
6873
6873
|
);
|
|
6874
6874
|
}
|
|
6875
|
-
function
|
|
6875
|
+
function wo(i, t) {
|
|
6876
6876
|
if (t !== void 0) return t;
|
|
6877
6877
|
const e = i.getSeriesIdsByType("time", { visibleOnly: !0, singleLayerOnly: !0 });
|
|
6878
6878
|
if (e.length > 0) return e[0];
|
|
6879
6879
|
const n = i.getSeriesIdsByType("time", { visibleOnly: !0 });
|
|
6880
6880
|
return n.length > 0 ? n[0] : null;
|
|
6881
6881
|
}
|
|
6882
|
-
function
|
|
6882
|
+
function nl({ seriesId: i, color: t, format: e, children: n }) {
|
|
6883
6883
|
const s = ut();
|
|
6884
6884
|
ct(() => (s.setYLabel(!0), () => s.setYLabel(!1)), [s]);
|
|
6885
6885
|
const [, r] = Ct(0);
|
|
@@ -6889,7 +6889,7 @@ function il({ seriesId: i, color: t, format: e, children: n }) {
|
|
|
6889
6889
|
s.off("overlayChange", y), s.off("viewportChange", y);
|
|
6890
6890
|
};
|
|
6891
6891
|
}, [s]);
|
|
6892
|
-
const a =
|
|
6892
|
+
const a = wo(s, i), l = a !== null ? s.getStackedLastValue(a) : null, h = a !== null ? s.getPreviousClose(a) : null, d = s.yScale.getRange(), c = d.max - d.min, u = c < 0.1 ? 6 : c < 10 ? 4 : c < 1e3 ? 2 : 0, f = Jt(() => {
|
|
6893
6893
|
if (e) return e;
|
|
6894
6894
|
const y = new Intl.NumberFormat("en-US", {
|
|
6895
6895
|
minimumFractionDigits: u,
|
|
@@ -6901,7 +6901,7 @@ function il({ seriesId: i, color: t, format: e, children: n }) {
|
|
|
6901
6901
|
if (!l || a === null) return null;
|
|
6902
6902
|
const { value: m, isLive: g } = l, p = s.getTheme(), v = s.yScale.valueToY(m), w = h === null ? "neutral" : m > h ? "up" : m < h ? "down" : "neutral";
|
|
6903
6903
|
let x;
|
|
6904
|
-
return g ? t ? x = t : x = w === "up" ? p.yLabel.upBackground : w === "down" ? p.yLabel.downBackground : p.yLabel.neutralBackground : x = p.axis.textColor, n ? /* @__PURE__ */ A(
|
|
6904
|
+
return g ? t ? x = t : x = w === "up" ? p.yLabel.upBackground : w === "down" ? p.yLabel.downBackground : p.yLabel.neutralBackground : x = p.axis.textColor, n ? /* @__PURE__ */ A(Ye, { children: n({ value: m, y: v, bgColor: x, isLive: g, direction: w, format: f }) }) : /* @__PURE__ */ X(Ye, { children: [
|
|
6905
6905
|
/* @__PURE__ */ A(
|
|
6906
6906
|
"div",
|
|
6907
6907
|
{
|
|
@@ -6937,77 +6937,77 @@ function il({ seriesId: i, color: t, format: e, children: n }) {
|
|
|
6937
6937
|
whiteSpace: "nowrap",
|
|
6938
6938
|
transition: "background-color 0.3s ease"
|
|
6939
6939
|
},
|
|
6940
|
-
children: /* @__PURE__ */ A(
|
|
6940
|
+
children: /* @__PURE__ */ A(ho, { value: m, format: f, spinDuration: 350 })
|
|
6941
6941
|
}
|
|
6942
6942
|
)
|
|
6943
6943
|
] });
|
|
6944
6944
|
}
|
|
6945
6945
|
export {
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6946
|
+
Na as BarSeries,
|
|
6947
|
+
Go as CandlestickSeries,
|
|
6948
|
+
so as ChartContainer,
|
|
6949
|
+
ka as ChartInstance,
|
|
6950
|
+
Jo as Crosshair,
|
|
6951
|
+
qa as InfoBar,
|
|
6952
|
+
Qa as Legend,
|
|
6953
|
+
ao as LineSeries,
|
|
6954
|
+
Za as Navigator,
|
|
6955
6955
|
Pa as NavigatorController,
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6956
|
+
ho as NumberFlow,
|
|
6957
|
+
eo as PieLegend,
|
|
6958
|
+
qo as PieSeries,
|
|
6959
|
+
Qo as PieTooltip,
|
|
6960
|
+
Zo as Sparkline,
|
|
6961
|
+
Ne as ThemeProvider,
|
|
6962
|
+
tl as TimeAxis,
|
|
6963
|
+
io as Title,
|
|
6964
|
+
el as Tooltip,
|
|
6965
|
+
tl as XAxis,
|
|
6966
|
+
il as YAxis,
|
|
6967
|
+
nl as YLabel,
|
|
6968
|
+
To as andromeda,
|
|
6969
6969
|
z as autoGradient,
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6970
|
+
Ro as ayuMirage,
|
|
6971
|
+
Bs as buildHoverSnapshots,
|
|
6972
|
+
Ya as buildLastSnapshots,
|
|
6973
|
+
fa as catppuccin,
|
|
6974
|
+
Vi as computeTooltipPosition,
|
|
6975
6975
|
Z as createTheme,
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
6976
|
+
ko as darkTheme,
|
|
6977
|
+
wr as detectInterval,
|
|
6978
|
+
Io as dracula,
|
|
6979
|
+
Se as formatCompact,
|
|
6980
|
+
Sr as formatDate,
|
|
6981
|
+
hs as formatPriceAdaptive,
|
|
6982
|
+
Fi as formatTime,
|
|
6983
|
+
Lo as githubLight,
|
|
6984
|
+
Ao as gruvbox,
|
|
6985
|
+
Wo as handwritten,
|
|
6986
|
+
Do as highContrast,
|
|
6987
|
+
Fo as lavenderMist,
|
|
6988
|
+
Bo as lightPink,
|
|
6989
|
+
Co as lightTheme,
|
|
6990
6990
|
Po as materialPalenight,
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6991
|
+
zo as minimalLight,
|
|
6992
|
+
Vo as mintBreeze,
|
|
6993
|
+
Yo as monokaiPro,
|
|
6994
|
+
Eo as nightOwl,
|
|
6995
6995
|
vt as normalizeTime,
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
6996
|
+
_o as oneDarkPro,
|
|
6997
|
+
Oo as panda,
|
|
6998
|
+
Ho as peachCream,
|
|
6999
|
+
$o as quietLight,
|
|
7000
|
+
ds as resolveAxisFontSize,
|
|
7001
|
+
fs as resolveAxisTextColor,
|
|
7002
7002
|
kt as resolveCandlestickBodyColor,
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7003
|
+
No as rosePineDawn,
|
|
7004
|
+
Xo as sandDune,
|
|
7005
|
+
Uo as solarizedLight,
|
|
7006
7006
|
ut as useChartInstance,
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7007
|
+
_i as useCrosshairPosition,
|
|
7008
|
+
jo as useLastYValue,
|
|
7009
|
+
Ko as usePreviousClose,
|
|
7010
|
+
Yi as useTheme,
|
|
7011
|
+
Ga as useVisibleRange,
|
|
7012
|
+
ja as useYRange
|
|
7013
7013
|
};
|