@wick-charts/vue 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +37 -0
- package/dist/index.js +1183 -1126
- package/package.json +2 -2
- package/src/ChartContainer.vue +12 -3
- package/src/ui/Title.vue +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { inject as
|
|
1
|
+
import { inject as xt, defineComponent as pt, ref as q, onMounted as dt, onUnmounted as ct, watch as ht, createCommentVNode as Z, shallowRef as Zi, provide as pe, computed as P, nextTick as Tn, openBlock as D, createElementBlock as z, normalizeStyle as X, createElementVNode as $, renderSlot as te, unref as F, Fragment as tt, toDisplayString as J, useSlots as Ce, createBlock as vi, Teleport as bi, renderList as Ct, onBeforeUnmount as qs, watchEffect as ns, createTextVNode as Js, createVNode as Qs } from "vue";
|
|
2
2
|
var Zs = Object.defineProperty, ss = (i) => {
|
|
3
3
|
throw TypeError(i);
|
|
4
|
-
}, ta = (i, t, e) => t in i ? Zs(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e,
|
|
4
|
+
}, ta = (i, t, e) => t in i ? Zs(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, R = (i, t, e) => ta(i, typeof t != "symbol" ? t + "" : t, e), cn = (i, t, e) => t.has(i) || ss("Cannot " + e), o = (i, t, e) => (cn(i, t, "read from private field"), e ? e.call(i) : t.get(i)), W = (i, t, e) => t.has(i) ? ss("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), M = (i, t, e, n) => (cn(i, t, "write to private field"), t.set(i, e), e), B = (i, t, e) => (cn(i, t, "access private method"), e), tn = (i, t, e, n) => ({
|
|
5
5
|
set _(s) {
|
|
6
6
|
M(i, t, s);
|
|
7
7
|
},
|
|
@@ -12,7 +12,7 @@ var Zs = Object.defineProperty, ss = (i) => {
|
|
|
12
12
|
const Se = (i) => 1 - (1 - i) ** 3;
|
|
13
13
|
class He {
|
|
14
14
|
constructor(t) {
|
|
15
|
-
|
|
15
|
+
R(this, "_current"), R(this, "_from"), R(this, "_to"), R(this, "_startTime", 0), R(this, "_activeDuration"), R(this, "_defaultDuration"), R(this, "_easing"), R(this, "_lerp"), R(this, "_equals"), R(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 ?? Se, this._lerp = t.lerp, this._equals = t.equals ?? Object.is;
|
|
16
16
|
}
|
|
17
17
|
get current() {
|
|
18
18
|
return this._current;
|
|
@@ -73,10 +73,10 @@ const In = 250, Si = {
|
|
|
73
73
|
streamTick: In,
|
|
74
74
|
/** Explicit fit-to-data / batch reflow. */
|
|
75
75
|
fit: In
|
|
76
|
-
},
|
|
76
|
+
}, Pi = 250, Me = Pi, un = Pi, as = 600, os = Pi, ea = 0, en = Pi, Rn = 100;
|
|
77
77
|
class yi {
|
|
78
78
|
constructor() {
|
|
79
|
-
|
|
79
|
+
R(this, "listeners", /* @__PURE__ */ new Map());
|
|
80
80
|
}
|
|
81
81
|
on(t, e) {
|
|
82
82
|
let n = this.listeners.get(t);
|
|
@@ -116,7 +116,7 @@ function An(i, t, e) {
|
|
|
116
116
|
}
|
|
117
117
|
class ia extends yi {
|
|
118
118
|
constructor(t, e) {
|
|
119
|
-
super(),
|
|
119
|
+
super(), R(this, "mainCanvas"), R(this, "mainCtx"), R(this, "overlayCanvas"), R(this, "overlayCtx"), R(this, "resizeObserver"), R(this, "_size"), R(this, "supportsDevicePixelContentBox", !1), this.mainCanvas = An(t, 0), this.overlayCanvas = An(t, 1);
|
|
120
120
|
const n = this.mainCanvas.getContext("2d", { alpha: !0 }), s = this.overlayCanvas.getContext("2d", { alpha: !0 });
|
|
121
121
|
if (!n || !s)
|
|
122
122
|
throw new Error("CanvasManager: failed to acquire 2D rendering context");
|
|
@@ -159,8 +159,8 @@ class ia extends yi {
|
|
|
159
159
|
if (c)
|
|
160
160
|
r = c.inlineSize, l = c.blockSize;
|
|
161
161
|
else {
|
|
162
|
-
const
|
|
163
|
-
r =
|
|
162
|
+
const g = t.contentRect;
|
|
163
|
+
r = g.width, l = g.height;
|
|
164
164
|
}
|
|
165
165
|
const u = window.devicePixelRatio || 1;
|
|
166
166
|
s = Math.round(r * u), a = Math.round(l * u);
|
|
@@ -227,11 +227,11 @@ function ca(i) {
|
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
function ua({ scope: i, theme: t, chartMediaHeight: e, side: n, now: s }, a) {
|
|
230
|
-
const { context: r, horizontalPixelRatio: l, verticalPixelRatio: h } = i, d = sa * l, c = aa * l, u = oa * l,
|
|
230
|
+
const { context: r, horizontalPixelRatio: l, verticalPixelRatio: h } = i, d = sa * l, c = aa * l, u = oa * l, g = a * l, b = n === "right" ? g + u : g - u, p = e / 2 * h, k = s % Wn / Wn, S = Math.floor(k * 3), m = rs(t.axis.textColor ?? "#787b86", 0.3), w = t.axis.textColor ?? "#787b86";
|
|
231
231
|
r.save();
|
|
232
232
|
for (let f = 0; f < 3; f++) {
|
|
233
|
-
const
|
|
234
|
-
r.beginPath(), r.arc(
|
|
233
|
+
const v = (f - 1) * c, x = b + v;
|
|
234
|
+
r.beginPath(), r.arc(x, p, d, 0, Math.PI * 2), r.fillStyle = f === S ? w : m, r.fill();
|
|
235
235
|
}
|
|
236
236
|
r.restore();
|
|
237
237
|
}
|
|
@@ -253,22 +253,22 @@ function fa(i, t, e, n, s) {
|
|
|
253
253
|
const d = e.niceTickValues();
|
|
254
254
|
a.beginPath();
|
|
255
255
|
for (const u of d) {
|
|
256
|
-
const
|
|
257
|
-
a.moveTo(0,
|
|
256
|
+
const g = Math.round(e.valueToBitmapY(u)) + 0.5;
|
|
257
|
+
a.moveTo(0, g), a.lineTo(r.width, g);
|
|
258
258
|
}
|
|
259
259
|
a.stroke();
|
|
260
260
|
const { ticks: c } = t.niceTickValues(s);
|
|
261
261
|
a.beginPath();
|
|
262
262
|
for (const u of c) {
|
|
263
|
-
const
|
|
264
|
-
a.moveTo(
|
|
263
|
+
const g = Math.round(t.timeToBitmapX(u)) + 0.5;
|
|
264
|
+
a.moveTo(g, 0), a.lineTo(g, r.height);
|
|
265
265
|
}
|
|
266
266
|
a.stroke(), a.setLineDash([]);
|
|
267
267
|
}
|
|
268
268
|
function Oe(i, t, e) {
|
|
269
269
|
return Math.max(t, Math.min(e, i));
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Mt(i, t, e) {
|
|
272
272
|
return i + (t - i) * e;
|
|
273
273
|
}
|
|
274
274
|
function _n(i, t, e, n) {
|
|
@@ -290,7 +290,7 @@ function Xi(i, t, e) {
|
|
|
290
290
|
}
|
|
291
291
|
class hs extends yi {
|
|
292
292
|
constructor() {
|
|
293
|
-
super(...arguments),
|
|
293
|
+
super(...arguments), R(this, "data", []), R(this, "_visible", !0), R(this, "cachedRange", null), R(this, "cachedResult", []);
|
|
294
294
|
}
|
|
295
295
|
setVisible(t) {
|
|
296
296
|
this._visible = t;
|
|
@@ -351,7 +351,7 @@ class hs extends yi {
|
|
|
351
351
|
}
|
|
352
352
|
class pa {
|
|
353
353
|
constructor(t, e, n, s = 0) {
|
|
354
|
-
|
|
354
|
+
R(this, "dragging", !1), R(this, "lastX", 0), this.viewport = t, this.timeScale = e, this.canvas = n, this.inputResponseMs = s;
|
|
355
355
|
}
|
|
356
356
|
/** Update the input-response duration without recreating the handler. */
|
|
357
357
|
setInputResponseMs(t) {
|
|
@@ -377,7 +377,7 @@ class pa {
|
|
|
377
377
|
const ga = 150;
|
|
378
378
|
class ma {
|
|
379
379
|
constructor(t, e, n = 0) {
|
|
380
|
-
|
|
380
|
+
R(this, "reboundTimer", null), this.viewport = t, this.timeScale = e, this.inputResponseMs = n;
|
|
381
381
|
}
|
|
382
382
|
/** Update the input-response duration without recreating the handler. */
|
|
383
383
|
setInputResponseMs(t) {
|
|
@@ -406,23 +406,23 @@ function va(i, t) {
|
|
|
406
406
|
}
|
|
407
407
|
class ba extends yi {
|
|
408
408
|
constructor(t, e, n, s, a = 0) {
|
|
409
|
-
super(),
|
|
409
|
+
super(), R(this, "zoom"), R(this, "pan"), R(this, "canvas"), R(this, "timeScale"), R(this, "yScale"), R(this, "viewport"), R(this, "onWheel", (r) => {
|
|
410
410
|
this.zoom.handleWheel(r);
|
|
411
|
-
}),
|
|
411
|
+
}), R(this, "onMouseDown", (r) => {
|
|
412
412
|
this.zoom.cancelPendingRebound(), this.pan.handleMouseDown(r);
|
|
413
|
-
}),
|
|
413
|
+
}), R(this, "onMouseMove", (r) => {
|
|
414
414
|
this.pan.isDragging() && this.pan.handleMouseMove(r), this.emitCrosshair(r.offsetX, r.offsetY);
|
|
415
|
-
}),
|
|
415
|
+
}), R(this, "onMouseUp", () => {
|
|
416
416
|
this.pan.handleMouseUp();
|
|
417
|
-
}),
|
|
417
|
+
}), R(this, "onMouseLeave", () => {
|
|
418
418
|
this.pan.handleMouseUp(), this.emit("crosshairMove", null);
|
|
419
|
-
}),
|
|
420
|
-
}),
|
|
419
|
+
}), R(this, "onDblClick", () => {
|
|
420
|
+
}), R(this, "lastTouchDist", 0), R(this, "lastTouchCenter", 0), R(this, "touchCount", 0), R(this, "onTouchStart", (r) => {
|
|
421
421
|
r.preventDefault(), this.zoom.cancelPendingRebound(), this.touchCount = r.touches.length, r.touches.length === 1 ? this.pan.handleMouseDown({
|
|
422
422
|
button: 0,
|
|
423
423
|
clientX: r.touches[0].clientX
|
|
424
424
|
}) : r.touches.length === 2 && (this.lastTouchDist = Math.abs(r.touches[0].clientX - r.touches[1].clientX), this.lastTouchCenter = (r.touches[0].clientX + r.touches[1].clientX) / 2);
|
|
425
|
-
}),
|
|
425
|
+
}), R(this, "onTouchMove", (r) => {
|
|
426
426
|
if (r.preventDefault(), r.touches.length === 1 && this.touchCount === 1)
|
|
427
427
|
this.pan.handleMouseMove({
|
|
428
428
|
clientX: r.touches[0].clientX
|
|
@@ -435,7 +435,7 @@ class ba extends yi {
|
|
|
435
435
|
}
|
|
436
436
|
this.lastTouchDist = l, this.lastTouchCenter = h;
|
|
437
437
|
}
|
|
438
|
-
}),
|
|
438
|
+
}), R(this, "onTouchEnd", (r) => {
|
|
439
439
|
if (r.touches.length === 0) {
|
|
440
440
|
const l = this.touchCount === 2;
|
|
441
441
|
this.pan.handleMouseUp(), l && this.viewport.startRebound(this.timeScale.getMediaWidth()), this.touchCount = 0, this.lastTouchDist = 0, this.emit("crosshairMove", null);
|
|
@@ -479,30 +479,30 @@ const wa = 100, ka = {
|
|
|
479
479
|
whiteSpace: "pre",
|
|
480
480
|
letterSpacing: "0.01em"
|
|
481
481
|
};
|
|
482
|
-
function
|
|
482
|
+
function Fn(i) {
|
|
483
483
|
let t = 0;
|
|
484
484
|
for (const e of Object.values(i)) t += e;
|
|
485
485
|
return t;
|
|
486
486
|
}
|
|
487
|
-
const mi = 9, dn = 7,
|
|
487
|
+
const mi = 9, dn = 7, Et = 6, fn = 9;
|
|
488
488
|
function Sa(i, t) {
|
|
489
489
|
return Math.round(i * t).toLocaleString("en-US");
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function Bn(i, t, e, n, s) {
|
|
492
492
|
return [
|
|
493
493
|
i.padEnd(mi),
|
|
494
494
|
t.toFixed(1).padStart(dn),
|
|
495
|
-
e.toFixed(2).padStart(
|
|
496
|
-
n.toFixed(2).padStart(
|
|
495
|
+
e.toFixed(2).padStart(Et),
|
|
496
|
+
n.toFixed(2).padStart(Et),
|
|
497
497
|
Sa(s, t).padStart(fn)
|
|
498
498
|
].join(" ");
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function Dn(i) {
|
|
501
501
|
return [
|
|
502
502
|
i.padEnd(mi),
|
|
503
503
|
"—".padStart(dn),
|
|
504
|
-
"—".padStart(
|
|
505
|
-
"—".padStart(
|
|
504
|
+
"—".padStart(Et),
|
|
505
|
+
"—".padStart(Et),
|
|
506
506
|
"idle".padStart(fn)
|
|
507
507
|
].join(" ");
|
|
508
508
|
}
|
|
@@ -510,19 +510,19 @@ function Ma() {
|
|
|
510
510
|
return [
|
|
511
511
|
"".padEnd(mi),
|
|
512
512
|
"FPS".padStart(dn),
|
|
513
|
-
"ms".padStart(
|
|
514
|
-
"worst".padStart(
|
|
513
|
+
"ms".padStart(Et),
|
|
514
|
+
"worst".padStart(Et),
|
|
515
515
|
"calls/s".padStart(fn)
|
|
516
516
|
].join(" ");
|
|
517
517
|
}
|
|
518
518
|
function Ca(i) {
|
|
519
|
-
const t =
|
|
519
|
+
const t = Fn(i.drawCalls.main), e = Fn(i.drawCalls.overlay), n = i.frameCount.main === 0 ? Dn("Main") : Bn("Main", i.mainRendersPerSec, i.mainFrameMs.last, i.mainFrameMs.p95, t), s = i.frameCount.overlay === 0 ? Dn("Overlay") : Bn("Overlay", i.overlayRendersPerSec, i.overlayFrameMs.last, i.overlayFrameMs.p95, e), a = [Ma(), n, s], r = Object.keys(i.perSeries);
|
|
520
520
|
if (r.length > 1) {
|
|
521
|
-
a.push(""), a.push("Per series (main pass)"), a.push(["".padEnd(mi), "ms".padStart(
|
|
521
|
+
a.push(""), a.push("Per series (main pass)"), a.push(["".padEnd(mi), "ms".padStart(Et), "worst".padStart(Et)].join(" "));
|
|
522
522
|
for (const l of r) {
|
|
523
523
|
const h = i.perSeries[l];
|
|
524
524
|
a.push(
|
|
525
|
-
[` ${l}`.padEnd(mi), h.last.toFixed(2).padStart(
|
|
525
|
+
[` ${l}`.padEnd(mi), h.last.toFixed(2).padStart(Et), h.p95.toFixed(2).padStart(Et)].join(" ")
|
|
526
526
|
);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
@@ -531,7 +531,7 @@ function Ca(i) {
|
|
|
531
531
|
}
|
|
532
532
|
class Ta {
|
|
533
533
|
constructor(t, e, n = wa) {
|
|
534
|
-
|
|
534
|
+
R(this, "element"), R(this, "unsubscribe"), R(this, "updateIntervalMs"), R(this, "lastUpdate", 0), this.updateIntervalMs = n;
|
|
535
535
|
for (const s of t.querySelectorAll("[data-chart-perf-hud]"))
|
|
536
536
|
s.remove();
|
|
537
537
|
this.element = document.createElement("div"), this.element.setAttribute("data-chart-perf-hud", ""), Object.assign(this.element.style, ka), this.element.textContent = "perf: waiting for first frame…", t.appendChild(this.element), this.unsubscribe = e.onFrame((s) => this.onFrame(s));
|
|
@@ -563,7 +563,7 @@ function ji(i) {
|
|
|
563
563
|
p95: t[Math.floor(t.length * 0.95)] ?? 0
|
|
564
564
|
};
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function Pn(i) {
|
|
567
567
|
if (i.length < 2) return 0;
|
|
568
568
|
const t = i[i.length - 1] - i[0];
|
|
569
569
|
return t <= 0 ? 0 : (i.length - 1) * 1e3 / t;
|
|
@@ -575,7 +575,7 @@ function zn(i) {
|
|
|
575
575
|
}
|
|
576
576
|
class Ki {
|
|
577
577
|
constructor(t = {}) {
|
|
578
|
-
|
|
578
|
+
R(this, "drawCallsMain", /* @__PURE__ */ new Map()), R(this, "drawCallsOverlay", /* @__PURE__ */ new Map()), R(this, "mainMs", []), R(this, "overlayMs", []), R(this, "mainStamps", []), R(this, "overlayStamps", []), R(this, "perSeriesMs", /* @__PURE__ */ new Map()), R(this, "perSeriesStamps", /* @__PURE__ */ new Map()), R(this, "listeners", /* @__PURE__ */ new Set()), R(this, "windowMs"), R(this, "maxSamples"), R(this, "heapInterval"), R(this, "heapCounter", 0), R(this, "heapMb", null), R(this, "mainFrameCount", 0), R(this, "overlayFrameCount", 0), R(this, "lastStamp", 0), this.windowMs = t.windowMs ?? Ia, this.maxSamples = t.maxSamples ?? Ra, this.heapInterval = t.heapSampleEveryNFrames ?? La;
|
|
579
579
|
}
|
|
580
580
|
/** Clear the draw-call tally for the given layer. Call at the start of each frame. */
|
|
581
581
|
resetDrawCalls(t) {
|
|
@@ -612,10 +612,10 @@ class Ki {
|
|
|
612
612
|
getStats() {
|
|
613
613
|
const t = {};
|
|
614
614
|
for (const [n, s] of this.perSeriesMs) t[n] = ji(s);
|
|
615
|
-
const e =
|
|
615
|
+
const e = Pn(this.mainStamps);
|
|
616
616
|
return {
|
|
617
617
|
mainRendersPerSec: e,
|
|
618
|
-
overlayRendersPerSec:
|
|
618
|
+
overlayRendersPerSec: Pn(this.overlayStamps),
|
|
619
619
|
fps: e,
|
|
620
620
|
mainFrameMs: ji(this.mainMs),
|
|
621
621
|
overlayFrameMs: ji(this.overlayMs),
|
|
@@ -640,7 +640,7 @@ class Ki {
|
|
|
640
640
|
}
|
|
641
641
|
class wi {
|
|
642
642
|
constructor(t) {
|
|
643
|
-
|
|
643
|
+
R(this, "dirty", !1), R(this, "rafId", null), R(this, "callback"), R(this, "render", (e) => {
|
|
644
644
|
this.dirty = !1, this.rafId = null, this.callback(e);
|
|
645
645
|
}), this.callback = t;
|
|
646
646
|
}
|
|
@@ -651,7 +651,7 @@ class wi {
|
|
|
651
651
|
this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.dirty = !1;
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
|
-
const Le = 6e4, ge = 36e5, he = 864e5,
|
|
654
|
+
const Le = 6e4, ge = 36e5, he = 864e5, Ht = 365 * he;
|
|
655
655
|
function Ne(i) {
|
|
656
656
|
return i instanceof Date ? i.getTime() : i;
|
|
657
657
|
}
|
|
@@ -670,30 +670,30 @@ function _a(i) {
|
|
|
670
670
|
}
|
|
671
671
|
function zi(i, t) {
|
|
672
672
|
const e = new Date(i);
|
|
673
|
-
return t >=
|
|
673
|
+
return t >= Ht ? e.toLocaleDateString("en-US", { year: "numeric" }) : t >= he ? e.toLocaleDateString("en-US", { month: "short", day: "numeric" }) : t >= ge ? e.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit", hour12: !1 }) : e.toLocaleTimeString("en-US", {
|
|
674
674
|
hour: "2-digit",
|
|
675
675
|
minute: "2-digit",
|
|
676
676
|
second: "2-digit",
|
|
677
677
|
hour12: !1
|
|
678
678
|
});
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function Fa(i) {
|
|
681
681
|
return new Date(i).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
682
682
|
}
|
|
683
|
-
function
|
|
684
|
-
const t = [1e3, 5e3, 1e4, 15e3, 3e4], e = [Le, 5 * Le, 10 * Le, 15 * Le, 30 * Le], n = [ge, 2 * ge, 4 * ge, 6 * ge, 12 * ge], s = [he, 7 * he, 30 * he, 90 * he], a = [
|
|
685
|
-
return i < Le ? [...t, ...e, ...n, ...s, ...a] : i < ge ? [...e, ...n, ...s, ...a] : i < he ? [...n, ...s, ...a] : i <
|
|
683
|
+
function Ba(i) {
|
|
684
|
+
const t = [1e3, 5e3, 1e4, 15e3, 3e4], e = [Le, 5 * Le, 10 * Le, 15 * Le, 30 * Le], n = [ge, 2 * ge, 4 * ge, 6 * ge, 12 * ge], s = [he, 7 * he, 30 * he, 90 * he], a = [Ht, 2 * Ht, 5 * Ht, 10 * Ht, 25 * Ht, 50 * Ht, 100 * Ht];
|
|
685
|
+
return i < Le ? [...t, ...e, ...n, ...s, ...a] : i < ge ? [...e, ...n, ...s, ...a] : i < he ? [...n, ...s, ...a] : i < Ht ? [...s, ...a] : a;
|
|
686
686
|
}
|
|
687
|
-
const
|
|
687
|
+
const Da = 50, Pa = 80;
|
|
688
688
|
class cs {
|
|
689
689
|
constructor() {
|
|
690
|
-
|
|
690
|
+
R(this, "from", 0), R(this, "to", 0), R(this, "width", 1), R(this, "pixelRatio", 1), R(this, "dataInterval", null), R(this, "labelCountHintValue", null), R(this, "minSpacingValue", null), R(this, "resolvedInterval", null), R(this, "lastInterval", null), R(this, "lastWant", null), R(this, "lastBucketKey", null);
|
|
691
691
|
}
|
|
692
692
|
get labelCountHint() {
|
|
693
693
|
return this.labelCountHintValue;
|
|
694
694
|
}
|
|
695
695
|
get minLabelSpacing() {
|
|
696
|
-
return this.minSpacingValue ??
|
|
696
|
+
return this.minSpacingValue ?? Pa;
|
|
697
697
|
}
|
|
698
698
|
update(t, e, n, s) {
|
|
699
699
|
if (this.from = t.from, this.to = t.to, this.width = e, this.pixelRatio = n, s !== void 0 && s > 0) {
|
|
@@ -741,7 +741,7 @@ class cs {
|
|
|
741
741
|
this.lastBucketKey !== null && this.lastBucketKey !== r && this.resetHysteresis(), this.lastBucketKey = r, this.dataInterval = t, this.resolveInterval();
|
|
742
742
|
}
|
|
743
743
|
if (this.resolvedInterval == null) return { ticks: [], tickInterval: 0 };
|
|
744
|
-
const e = this.resolvedInterval, n = Math.ceil(this.from / e) * e, s = Math.max(0, Math.min(
|
|
744
|
+
const e = this.resolvedInterval, n = Math.ceil(this.from / e) * e, s = Math.max(0, Math.min(Da, Math.floor((this.to - n) / e) + 1)), a = [];
|
|
745
745
|
for (let r = 0; r < s; r++) a.push(n + r * e);
|
|
746
746
|
return { ticks: a, tickInterval: e };
|
|
747
747
|
}
|
|
@@ -761,7 +761,7 @@ class cs {
|
|
|
761
761
|
this.resolvedInterval = null;
|
|
762
762
|
return;
|
|
763
763
|
}
|
|
764
|
-
const t =
|
|
764
|
+
const t = Ba(this.dataInterval), e = this.to - this.from, n = e / this.width * this.minLabelSpacing;
|
|
765
765
|
let s;
|
|
766
766
|
if (this.labelCountHint != null) {
|
|
767
767
|
const l = Math.max(1, this.labelCountHint);
|
|
@@ -840,7 +840,7 @@ function Ea(i) {
|
|
|
840
840
|
const $a = 50, Oa = 50;
|
|
841
841
|
class ps {
|
|
842
842
|
constructor() {
|
|
843
|
-
|
|
843
|
+
R(this, "min", 0), R(this, "max", 0), R(this, "height", 1), R(this, "pixelRatio", 1), R(this, "labelCountHintValue", null), R(this, "minSpacingValue", null), R(this, "resolvedInterval", null), R(this, "lastInterval", null), R(this, "lastRawInterval", null), R(this, "customFormat", null);
|
|
844
844
|
}
|
|
845
845
|
get labelCountHint() {
|
|
846
846
|
return this.labelCountHintValue;
|
|
@@ -982,20 +982,20 @@ function ja(i) {
|
|
|
982
982
|
return i.positive > 0 ? 100 : i.negative < 0 ? -100 : 0;
|
|
983
983
|
}
|
|
984
984
|
const Ka = 16, qa = (i, t, e) => i + (t - i) * e;
|
|
985
|
-
var
|
|
985
|
+
var Tt, Nt, me;
|
|
986
986
|
class gs {
|
|
987
987
|
constructor(t) {
|
|
988
|
-
|
|
988
|
+
R(this, "stores"), W(this, Tt), W(this, Nt), W(this, me, 0), R(this, "entries"), this.stores = Array.from({ length: t }, () => new hs()), M(this, Tt, new Array(t).fill(null)), M(this, Nt, new Array(t).fill(Number.NaN)), this.entries = Array.from({ length: t }, () => /* @__PURE__ */ new Map());
|
|
989
989
|
}
|
|
990
990
|
/** Per-layer smoothed last value. Read by tests via cast — exposed as a
|
|
991
991
|
* derived view of the live-track animators' `current`. `null` for layers
|
|
992
992
|
* whose animator has not been seeded yet (no data). */
|
|
993
993
|
get displayedLastValues() {
|
|
994
|
-
return o(this,
|
|
994
|
+
return o(this, Tt).map((t) => (t == null ? void 0 : t.current) ?? null);
|
|
995
995
|
}
|
|
996
996
|
/** Read-only view used by {@link effectiveValue} to gate the substitution. */
|
|
997
997
|
get lastSeededTimes() {
|
|
998
|
-
return o(this,
|
|
998
|
+
return o(this, Nt);
|
|
999
999
|
}
|
|
1000
1000
|
// --- Color accessors ------------------------------------------------------
|
|
1001
1001
|
getColor() {
|
|
@@ -1050,8 +1050,8 @@ class gs {
|
|
|
1050
1050
|
dispose() {
|
|
1051
1051
|
for (const t of this.stores) t.removeAllListeners();
|
|
1052
1052
|
for (const t of this.entries) t.clear();
|
|
1053
|
-
for (let t = 0; t < o(this,
|
|
1054
|
-
o(this,
|
|
1053
|
+
for (let t = 0; t < o(this, Tt).length; t++)
|
|
1054
|
+
o(this, Tt)[t] = null, o(this, Nt)[t] = Number.NaN;
|
|
1055
1055
|
M(this, me, 0);
|
|
1056
1056
|
}
|
|
1057
1057
|
/**
|
|
@@ -1064,7 +1064,7 @@ class gs {
|
|
|
1064
1064
|
/** True while any entrance is active OR any layer's live-track animator is mid-flight. */
|
|
1065
1065
|
get needsAnimation() {
|
|
1066
1066
|
for (const t of this.entries) if (t.size > 0) return !0;
|
|
1067
|
-
for (const t of o(this,
|
|
1067
|
+
for (const t of o(this, Tt))
|
|
1068
1068
|
if (t != null && t.animating) return !0;
|
|
1069
1069
|
return !1;
|
|
1070
1070
|
}
|
|
@@ -1082,17 +1082,17 @@ class gs {
|
|
|
1082
1082
|
for (let a = 0; a < this.stores.length; a++) {
|
|
1083
1083
|
const r = this.stores[a].last();
|
|
1084
1084
|
if (!r) {
|
|
1085
|
-
o(this,
|
|
1085
|
+
o(this, Tt)[a] = null, o(this, Nt)[a] = Number.NaN;
|
|
1086
1086
|
continue;
|
|
1087
1087
|
}
|
|
1088
|
-
const l = o(this,
|
|
1088
|
+
const l = o(this, Nt)[a] !== r.time, h = o(this, Tt)[a];
|
|
1089
1089
|
if (h === null || l || e <= 0) {
|
|
1090
|
-
o(this,
|
|
1090
|
+
o(this, Tt)[a] = new He({
|
|
1091
1091
|
initial: r.value,
|
|
1092
1092
|
duration: e > 0 ? e : 0,
|
|
1093
1093
|
easing: Se,
|
|
1094
1094
|
lerp: qa
|
|
1095
|
-
}), o(this,
|
|
1095
|
+
}), o(this, Nt)[a] = r.time;
|
|
1096
1096
|
continue;
|
|
1097
1097
|
}
|
|
1098
1098
|
h.setTarget(r.value, { duration: e, now: s }), h.tick(t);
|
|
@@ -1106,8 +1106,8 @@ class gs {
|
|
|
1106
1106
|
/** The effective Y-value to render for (layer, time) — substitutes smoothed value for the live last point. */
|
|
1107
1107
|
effectiveValue(t, e, n) {
|
|
1108
1108
|
var s;
|
|
1109
|
-
if (o(this,
|
|
1110
|
-
const a = (s = o(this,
|
|
1109
|
+
if (o(this, Nt)[t] !== e) return n;
|
|
1110
|
+
const a = (s = o(this, Tt)[t]) == null ? void 0 : s.current;
|
|
1111
1111
|
return a === void 0 ? n : a;
|
|
1112
1112
|
}
|
|
1113
1113
|
// --- Data queries ---------------------------------------------------------
|
|
@@ -1224,7 +1224,7 @@ class gs {
|
|
|
1224
1224
|
return l > r ? { min: r, max: l } : null;
|
|
1225
1225
|
}
|
|
1226
1226
|
}
|
|
1227
|
-
|
|
1227
|
+
Tt = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap();
|
|
1228
1228
|
const Ja = {
|
|
1229
1229
|
colors: ["#26a69a", "#ef5350"],
|
|
1230
1230
|
barWidthRatio: 0.6,
|
|
@@ -1237,7 +1237,7 @@ function Yn(i) {
|
|
|
1237
1237
|
}
|
|
1238
1238
|
class Qa extends gs {
|
|
1239
1239
|
constructor(t, e) {
|
|
1240
|
-
super(t),
|
|
1240
|
+
super(t), R(this, "options"), this.options = { ...Ja, ...Yn(e) };
|
|
1241
1241
|
}
|
|
1242
1242
|
/** For chart compatibility — returns first store */
|
|
1243
1243
|
get store() {
|
|
@@ -1268,8 +1268,8 @@ class Qa extends gs {
|
|
|
1268
1268
|
return { topY: n, barHeight: s, x: a, barWidth: r, alpha: 1 };
|
|
1269
1269
|
let h = n, d = s, c = a, u = 1;
|
|
1270
1270
|
if ((l === "fade" || l === "fade-grow") && (u = t), l === "grow" || l === "fade-grow") {
|
|
1271
|
-
const
|
|
1272
|
-
n < e ? h = e -
|
|
1271
|
+
const g = s * t;
|
|
1272
|
+
n < e ? h = e - g : h = e, d = Math.max(1, g);
|
|
1273
1273
|
}
|
|
1274
1274
|
return l === "slide" && (c = a + (1 - t) * r, u = t), { topY: h, barHeight: d, x: c, barWidth: r, alpha: u };
|
|
1275
1275
|
}
|
|
@@ -1290,62 +1290,62 @@ class Qa extends gs {
|
|
|
1290
1290
|
renderOff(t) {
|
|
1291
1291
|
const { scope: e, timeScale: n, yScale: s, dataInterval: a } = t, { context: r, horizontalPixelRatio: l } = e, h = n.getRange(), d = performance.now();
|
|
1292
1292
|
let c = 0;
|
|
1293
|
-
for (const
|
|
1294
|
-
if (!
|
|
1295
|
-
const f =
|
|
1293
|
+
for (const w of this.stores) {
|
|
1294
|
+
if (!w.isVisible()) continue;
|
|
1295
|
+
const f = w.getVisibleData(h.from, h.to).length;
|
|
1296
1296
|
if (f > c && (c = f), c > 2) break;
|
|
1297
1297
|
}
|
|
1298
|
-
const u = n.barWidthBitmap(a),
|
|
1298
|
+
const u = n.barWidthBitmap(a), g = Math.round(30 * l), b = c <= 2 ? Math.min(g, u) : u, p = Math.max(1, Math.round(b * this.options.barWidthRatio) - 2), k = Math.floor(p / 2), S = s.getRange().min < 0, m = S ? s.valueToBitmapY(0) : e.bitmapSize.height;
|
|
1299
1299
|
if (this.stores.length === 1) {
|
|
1300
1300
|
if (!this.stores[0].isVisible()) return;
|
|
1301
|
-
const
|
|
1302
|
-
for (const
|
|
1303
|
-
if (!Number.isFinite(
|
|
1304
|
-
const
|
|
1305
|
-
if (
|
|
1306
|
-
const L = s.valueToBitmapY(
|
|
1301
|
+
const w = this.options.colors[0], f = this.options.colors.length > 1 ? this.options.colors[1] : w, v = this.stores[0].getVisibleData(h.from, h.to);
|
|
1302
|
+
for (const x of v) {
|
|
1303
|
+
if (!Number.isFinite(x.value)) continue;
|
|
1304
|
+
const I = this.effectiveValue(0, x.time, x.value), y = this.entranceProgress(0, x.time, d), T = n.timeToBitmapX(x.time);
|
|
1305
|
+
if (I >= 0) {
|
|
1306
|
+
const L = s.valueToBitmapY(I), C = Math.max(1, m - L);
|
|
1307
1307
|
this.drawAnimatedBar(
|
|
1308
1308
|
r,
|
|
1309
|
-
|
|
1310
|
-
|
|
1309
|
+
y,
|
|
1310
|
+
m,
|
|
1311
1311
|
L,
|
|
1312
1312
|
C,
|
|
1313
1313
|
T - k,
|
|
1314
|
-
|
|
1315
|
-
|
|
1314
|
+
p,
|
|
1315
|
+
I >= 0 ? w : f
|
|
1316
1316
|
);
|
|
1317
1317
|
} else {
|
|
1318
|
-
const L = s.valueToBitmapY(
|
|
1319
|
-
this.drawAnimatedBar(r,
|
|
1318
|
+
const L = s.valueToBitmapY(I), C = Math.max(1, L - m);
|
|
1319
|
+
this.drawAnimatedBar(r, y, m, m, C, T - k, p, f);
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
1322
|
} else {
|
|
1323
|
-
const
|
|
1324
|
-
for (let
|
|
1325
|
-
for (const
|
|
1326
|
-
if (!Number.isFinite(
|
|
1327
|
-
let
|
|
1328
|
-
|
|
1323
|
+
const w = this.stores.map((v) => v.isVisible() ? v.getVisibleData(h.from, h.to) : []), f = /* @__PURE__ */ new Map();
|
|
1324
|
+
for (let v = 0; v < w.length; v++)
|
|
1325
|
+
for (const x of w[v]) {
|
|
1326
|
+
if (!Number.isFinite(x.value)) continue;
|
|
1327
|
+
let I = f.get(x.time);
|
|
1328
|
+
I || (I = [], f.set(x.time, I)), I.push({ layer: v, value: this.effectiveValue(v, x.time, x.value) });
|
|
1329
1329
|
}
|
|
1330
|
-
for (const [
|
|
1331
|
-
|
|
1332
|
-
const
|
|
1333
|
-
for (const { layer:
|
|
1334
|
-
const L = this.options.colors[
|
|
1330
|
+
for (const [v, x] of f) {
|
|
1331
|
+
x.sort((y, T) => Math.abs(T.value) - Math.abs(y.value));
|
|
1332
|
+
const I = n.timeToBitmapX(v);
|
|
1333
|
+
for (const { layer: y, value: T } of x) {
|
|
1334
|
+
const L = this.options.colors[y % this.options.colors.length], C = this.entranceProgress(y, v, d);
|
|
1335
1335
|
if (T >= 0) {
|
|
1336
|
-
const A = s.valueToBitmapY(T), _ = Math.max(1,
|
|
1337
|
-
this.drawAnimatedBar(r, C,
|
|
1336
|
+
const A = s.valueToBitmapY(T), _ = Math.max(1, m - A);
|
|
1337
|
+
this.drawAnimatedBar(r, C, m, A, _, I - k, p, L);
|
|
1338
1338
|
} else {
|
|
1339
|
-
const A = s.valueToBitmapY(T), _ = Math.max(1, A -
|
|
1340
|
-
this.drawAnimatedBar(r, C,
|
|
1339
|
+
const A = s.valueToBitmapY(T), _ = Math.max(1, A - m);
|
|
1340
|
+
this.drawAnimatedBar(r, C, m, m, _, I - k, p, L);
|
|
1341
1341
|
}
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
1344
|
}
|
|
1345
1345
|
if (S) {
|
|
1346
1346
|
r.strokeStyle = t.theme.grid.color, r.lineWidth = 1;
|
|
1347
|
-
const
|
|
1348
|
-
r.beginPath(), r.moveTo(0,
|
|
1347
|
+
const w = Math.round(m) + 0.5;
|
|
1348
|
+
r.beginPath(), r.moveTo(0, w), r.lineTo(e.bitmapSize.width, w), r.stroke();
|
|
1349
1349
|
}
|
|
1350
1350
|
}
|
|
1351
1351
|
/** Stacked (normal or percent) rendering */
|
|
@@ -1354,48 +1354,48 @@ class Qa extends gs {
|
|
|
1354
1354
|
let u = 0;
|
|
1355
1355
|
for (const f of this.stores) {
|
|
1356
1356
|
if (!f.isVisible()) continue;
|
|
1357
|
-
const
|
|
1358
|
-
if (
|
|
1357
|
+
const v = f.getVisibleData(d.from, d.to).length;
|
|
1358
|
+
if (v > u && (u = v), u > 2) break;
|
|
1359
1359
|
}
|
|
1360
|
-
const
|
|
1361
|
-
if (
|
|
1362
|
-
const
|
|
1363
|
-
for (let f = 0; f <
|
|
1364
|
-
for (const
|
|
1365
|
-
let
|
|
1366
|
-
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1360
|
+
const g = s.barWidthBitmap(r), b = Math.round(30 * h), p = u <= 2 ? Math.min(b, g) : g, k = Math.max(1, Math.round(p * this.options.barWidthRatio) - 2), S = Math.floor(k / 2), m = this.stores.map((f) => f.isVisible() ? f.getVisibleData(d.from, d.to) : []);
|
|
1361
|
+
if (m.every((f) => f.length === 0)) return;
|
|
1362
|
+
const w = /* @__PURE__ */ new Map();
|
|
1363
|
+
for (let f = 0; f < m.length; f++)
|
|
1364
|
+
for (const v of m[f]) {
|
|
1365
|
+
let x = w.get(v.time);
|
|
1366
|
+
x || (x = new Array(m.length).fill(0), w.set(v.time, x));
|
|
1367
|
+
const I = Number.isFinite(v.value) ? v.value : 0;
|
|
1368
|
+
x[f] = this.stores[f].isVisible() ? this.effectiveValue(f, v.time, I) : 0;
|
|
1369
1369
|
}
|
|
1370
|
-
for (let f = 0; f <
|
|
1371
|
-
const
|
|
1372
|
-
for (const [
|
|
1373
|
-
const
|
|
1374
|
-
if (
|
|
1375
|
-
const T = s.timeToBitmapX(
|
|
1370
|
+
for (let f = 0; f < m.length; f++) {
|
|
1371
|
+
const v = this.options.colors[f % this.options.colors.length];
|
|
1372
|
+
for (const [x, I] of w) {
|
|
1373
|
+
const y = I[f];
|
|
1374
|
+
if (y === 0) continue;
|
|
1375
|
+
const T = s.timeToBitmapX(x);
|
|
1376
1376
|
let L = 0, C = 0;
|
|
1377
1377
|
for (let _ = 0; _ < f; _++) {
|
|
1378
|
-
const E =
|
|
1378
|
+
const E = I[_];
|
|
1379
1379
|
E > 0 ? L += E : C += E;
|
|
1380
1380
|
}
|
|
1381
|
-
const A = this.entranceProgress(f,
|
|
1381
|
+
const A = this.entranceProgress(f, x, c);
|
|
1382
1382
|
if (e) {
|
|
1383
1383
|
let _ = 0, E = 0;
|
|
1384
|
-
for (const V of
|
|
1384
|
+
for (const V of I)
|
|
1385
1385
|
V > 0 ? _ += V : E += V;
|
|
1386
|
-
if (
|
|
1387
|
-
const V = L / _ * 100, U = (L +
|
|
1388
|
-
this.drawAnimatedBar(l, A, K, j, gt, T - S, k,
|
|
1389
|
-
} else if (
|
|
1390
|
-
const V = C / E * -100, U = (C +
|
|
1391
|
-
this.drawAnimatedBar(l, A, j, j, gt, T - S, k,
|
|
1386
|
+
if (y > 0 && _ > 0) {
|
|
1387
|
+
const V = L / _ * 100, U = (L + y) / _ * 100, j = a.valueToBitmapY(U), K = a.valueToBitmapY(V), gt = Math.max(1, K - j);
|
|
1388
|
+
this.drawAnimatedBar(l, A, K, j, gt, T - S, k, v);
|
|
1389
|
+
} else if (y < 0 && E < 0) {
|
|
1390
|
+
const V = C / E * -100, U = (C + y) / E * -100, j = a.valueToBitmapY(V), K = a.valueToBitmapY(U), gt = Math.max(1, K - j);
|
|
1391
|
+
this.drawAnimatedBar(l, A, j, j, gt, T - S, k, v);
|
|
1392
1392
|
}
|
|
1393
|
-
} else if (
|
|
1394
|
-
const _ = a.valueToBitmapY(L +
|
|
1395
|
-
this.drawAnimatedBar(l, A, E, _, V, T - S, k,
|
|
1393
|
+
} else if (y > 0) {
|
|
1394
|
+
const _ = a.valueToBitmapY(L + y), E = a.valueToBitmapY(L), V = Math.max(1, E - _);
|
|
1395
|
+
this.drawAnimatedBar(l, A, E, _, V, T - S, k, v);
|
|
1396
1396
|
} else {
|
|
1397
|
-
const _ = a.valueToBitmapY(C), E = a.valueToBitmapY(C +
|
|
1398
|
-
this.drawAnimatedBar(l, A, _, _, V, T - S, k,
|
|
1397
|
+
const _ = a.valueToBitmapY(C), E = a.valueToBitmapY(C + y), V = Math.max(1, E - _);
|
|
1398
|
+
this.drawAnimatedBar(l, A, _, _, V, T - S, k, v);
|
|
1399
1399
|
}
|
|
1400
1400
|
}
|
|
1401
1401
|
}
|
|
@@ -1452,17 +1452,17 @@ function to(i, t, e, n) {
|
|
|
1452
1452
|
for (let l = 0; l < t - 2; l++) {
|
|
1453
1453
|
const h = Math.floor((l + 1) * a) + 1, d = Math.min(Math.floor((l + 2) * a) + 1, i.length - 1);
|
|
1454
1454
|
let c = 0, u = 0;
|
|
1455
|
-
const
|
|
1456
|
-
if (
|
|
1457
|
-
for (let f =
|
|
1455
|
+
const g = d, b = Math.min(Math.floor((l + 3) * a) + 1, i.length), p = b - g;
|
|
1456
|
+
if (p > 0) {
|
|
1457
|
+
for (let f = g; f < b; f++)
|
|
1458
1458
|
c += e(i[f]), u += n(i[f]);
|
|
1459
|
-
c /=
|
|
1459
|
+
c /= p, u /= p;
|
|
1460
1460
|
}
|
|
1461
1461
|
let k = -1, S = h;
|
|
1462
|
-
const
|
|
1462
|
+
const m = e(i[r]), w = n(i[r]);
|
|
1463
1463
|
for (let f = h; f < d; f++) {
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1464
|
+
const v = Math.abs((m - c) * (n(i[f]) - w) - (m - e(i[f])) * (u - w));
|
|
1465
|
+
v > k && (k = v, S = f);
|
|
1466
1466
|
}
|
|
1467
1467
|
s.push(i[S]), r = S;
|
|
1468
1468
|
}
|
|
@@ -1509,15 +1509,15 @@ function On(i) {
|
|
|
1509
1509
|
const t = { ...i };
|
|
1510
1510
|
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;
|
|
1511
1511
|
}
|
|
1512
|
-
var
|
|
1512
|
+
var Wt, _e, Fe;
|
|
1513
1513
|
class ao {
|
|
1514
1514
|
constructor(t, e) {
|
|
1515
|
-
|
|
1515
|
+
R(this, "store"), R(this, "options"), W(this, Wt, null), W(this, _e, Number.NaN), W(this, Fe, 0), R(this, "entries", /* @__PURE__ */ new Map()), this.store = t, this.options = { ...so, ...On(e) };
|
|
1516
1516
|
}
|
|
1517
1517
|
/** Smoothed OHLC of the live last candle. Null until first render. */
|
|
1518
1518
|
get displayedLast() {
|
|
1519
1519
|
var t;
|
|
1520
|
-
return ((t = o(this,
|
|
1520
|
+
return ((t = o(this, Wt)) == null ? void 0 : t.current) ?? null;
|
|
1521
1521
|
}
|
|
1522
1522
|
updateOptions(t) {
|
|
1523
1523
|
this.options = { ...this.options, ...On(t) };
|
|
@@ -1560,7 +1560,7 @@ class ao {
|
|
|
1560
1560
|
return this.store.on("update", t), () => this.store.off("update", t);
|
|
1561
1561
|
}
|
|
1562
1562
|
dispose() {
|
|
1563
|
-
this.store.removeAllListeners(), M(this,
|
|
1563
|
+
this.store.removeAllListeners(), M(this, Wt, null), M(this, _e, Number.NaN), M(this, Fe, 0), this.entries.clear();
|
|
1564
1564
|
}
|
|
1565
1565
|
getLastValue() {
|
|
1566
1566
|
const t = this.store.last();
|
|
@@ -1577,7 +1577,7 @@ class ao {
|
|
|
1577
1577
|
/** True while any entrance animation is active or the displayed last candle hasn't converged. */
|
|
1578
1578
|
get needsAnimation() {
|
|
1579
1579
|
var t;
|
|
1580
|
-
return !!(this.entries.size > 0 || (t = o(this,
|
|
1580
|
+
return !!(this.entries.size > 0 || (t = o(this, Wt)) != null && t.animating);
|
|
1581
1581
|
}
|
|
1582
1582
|
/**
|
|
1583
1583
|
* Compute the entrance progress for a candle's `time`, in [0, 1]. Returns 1 for
|
|
@@ -1609,70 +1609,70 @@ class ao {
|
|
|
1609
1609
|
advanceLiveTracking(t) {
|
|
1610
1610
|
const e = this.store.last();
|
|
1611
1611
|
if (!e) {
|
|
1612
|
-
M(this,
|
|
1612
|
+
M(this, Wt, null), M(this, _e, Number.NaN);
|
|
1613
1613
|
return;
|
|
1614
1614
|
}
|
|
1615
1615
|
const n = o(this, _e) !== e.time, s = de(this.options.smoothMs, un);
|
|
1616
|
-
if (o(this,
|
|
1617
|
-
M(this,
|
|
1616
|
+
if (o(this, Wt) === null || n || s <= 0) {
|
|
1617
|
+
M(this, Wt, new He({
|
|
1618
1618
|
initial: { ...e },
|
|
1619
1619
|
duration: s > 0 ? s : 0,
|
|
1620
1620
|
easing: Se,
|
|
1621
1621
|
lerp: io,
|
|
1622
1622
|
equals: no
|
|
1623
|
-
})), M(this, _e, e.time), M(this,
|
|
1623
|
+
})), M(this, _e, e.time), M(this, Fe, t);
|
|
1624
1624
|
return;
|
|
1625
1625
|
}
|
|
1626
|
-
const a = Math.min(t - o(this,
|
|
1627
|
-
o(this,
|
|
1626
|
+
const a = Math.min(t - o(this, Fe), 16), r = t - a;
|
|
1627
|
+
o(this, Wt).setTarget(e, { duration: s, now: r }), o(this, Wt).tick(t), M(this, Fe, t);
|
|
1628
1628
|
}
|
|
1629
1629
|
render(t) {
|
|
1630
1630
|
const { scope: e, timeScale: n, yScale: s, dataInterval: a } = t, { context: r, horizontalPixelRatio: l } = e, h = n.getRange(), d = performance.now();
|
|
1631
1631
|
this.advanceLiveTracking(d);
|
|
1632
1632
|
let c = this.store.getVisibleData(h.from, h.to);
|
|
1633
|
-
const u = e.mediaSize.width,
|
|
1634
|
-
if (
|
|
1635
|
-
if (!
|
|
1633
|
+
const u = e.mediaSize.width, g = c.length > u * 2;
|
|
1634
|
+
if (g && (c = Za(c, Math.round(u * 1.5)), this.entries.clear()), c.length === 0) return;
|
|
1635
|
+
if (!g && this.displayedLast) {
|
|
1636
1636
|
const T = c.length - 1;
|
|
1637
1637
|
c[T].time === this.displayedLast.time && (c = [...c.slice(0, T), this.displayedLast]);
|
|
1638
1638
|
}
|
|
1639
|
-
const
|
|
1640
|
-
if (
|
|
1639
|
+
const b = this.entries.size > 0 ? /* @__PURE__ */ new Map() : null;
|
|
1640
|
+
if (b)
|
|
1641
1641
|
for (const T of c)
|
|
1642
|
-
this.entries.has(T.time) &&
|
|
1643
|
-
const
|
|
1644
|
-
let
|
|
1645
|
-
(
|
|
1646
|
-
const f = Math.floor(
|
|
1642
|
+
this.entries.has(T.time) && b.set(T.time, this.entranceProgress(T.time, d));
|
|
1643
|
+
const p = n.barWidthBitmap(a), k = Math.round(30 * l), S = c.length <= 2 ? Math.min(k, p) : p, m = Math.max(1, Math.round(l));
|
|
1644
|
+
let w = Math.max(1, Math.round(S * this.options.bodyWidthRatio) - 2);
|
|
1645
|
+
(w & 1) !== (m & 1) && (w = w > 1 ? w - 1 : 2);
|
|
1646
|
+
const f = Math.floor(w / 2), v = Math.round(s.getMediaHeight() * e.verticalPixelRatio);
|
|
1647
1647
|
this.drawVolume({
|
|
1648
1648
|
ctx: r,
|
|
1649
1649
|
data: c,
|
|
1650
1650
|
timeScale: n,
|
|
1651
|
-
chartHeight:
|
|
1651
|
+
chartHeight: v,
|
|
1652
1652
|
barWidth: S,
|
|
1653
|
-
wickWidth:
|
|
1654
|
-
entranceByTime:
|
|
1653
|
+
wickWidth: m,
|
|
1654
|
+
entranceByTime: b
|
|
1655
1655
|
});
|
|
1656
|
-
const
|
|
1656
|
+
const x = [], I = [];
|
|
1657
1657
|
for (const T of c)
|
|
1658
|
-
T.close >= T.open ?
|
|
1659
|
-
const
|
|
1658
|
+
T.close >= T.open ? x.push(T) : I.push(T);
|
|
1659
|
+
const y = {
|
|
1660
1660
|
ctx: r,
|
|
1661
1661
|
timeScale: n,
|
|
1662
1662
|
yScale: s,
|
|
1663
1663
|
halfBody: f,
|
|
1664
|
-
bodyWidth:
|
|
1665
|
-
wickWidth:
|
|
1666
|
-
entranceByTime:
|
|
1664
|
+
bodyWidth: w,
|
|
1665
|
+
wickWidth: m,
|
|
1666
|
+
entranceByTime: b
|
|
1667
1667
|
};
|
|
1668
1668
|
this.drawCandles({
|
|
1669
|
-
...
|
|
1670
|
-
candles:
|
|
1669
|
+
...y,
|
|
1670
|
+
candles: x,
|
|
1671
1671
|
body: this.options.up.body,
|
|
1672
1672
|
wickColor: this.options.up.wick
|
|
1673
1673
|
}), this.drawCandles({
|
|
1674
|
-
...
|
|
1675
|
-
candles:
|
|
1674
|
+
...y,
|
|
1675
|
+
candles: I,
|
|
1676
1676
|
body: this.options.down.body,
|
|
1677
1677
|
wickColor: this.options.down.wick
|
|
1678
1678
|
});
|
|
@@ -1693,24 +1693,24 @@ class ao {
|
|
|
1693
1693
|
const d = s * 0.2;
|
|
1694
1694
|
let c = Math.max(1, a - 2);
|
|
1695
1695
|
(c & 1) !== (r & 1) && (c = c > 1 ? c - 1 : 2);
|
|
1696
|
-
const u = Math.floor(c / 2),
|
|
1696
|
+
const u = Math.floor(c / 2), g = Ye(Zt(this.options.up.body), 0.2), b = Ye(Zt(this.options.down.body), 0.2), p = this.options.entryAnimation ?? "unfold";
|
|
1697
1697
|
for (const k of e) {
|
|
1698
1698
|
if (!Number.isFinite(k.volume) || k.volume <= 0) continue;
|
|
1699
|
-
const S = k.volume,
|
|
1700
|
-
t.fillStyle = f ?
|
|
1701
|
-
const
|
|
1702
|
-
if (
|
|
1703
|
-
t.fillRect(
|
|
1699
|
+
const S = k.volume, m = n.timeToBitmapX(k.time), w = Math.max(1, S / h * d), f = k.close >= k.open;
|
|
1700
|
+
t.fillStyle = f ? g : b;
|
|
1701
|
+
const v = (l == null ? void 0 : l.get(k.time)) ?? 1;
|
|
1702
|
+
if (v >= 1 || p === "none") {
|
|
1703
|
+
t.fillRect(m - u, s - w, c, w);
|
|
1704
1704
|
continue;
|
|
1705
1705
|
}
|
|
1706
|
-
const
|
|
1707
|
-
x:
|
|
1706
|
+
const x = qi(v, p, {
|
|
1707
|
+
x: m - u,
|
|
1708
1708
|
barWidth: c,
|
|
1709
1709
|
anchorY: s,
|
|
1710
|
-
topY: s -
|
|
1710
|
+
topY: s - w,
|
|
1711
1711
|
bottomY: s
|
|
1712
1712
|
});
|
|
1713
|
-
t.save(), t.globalAlpha =
|
|
1713
|
+
t.save(), t.globalAlpha = x.alpha, t.fillRect(x.x, x.topY, c, Math.max(1, x.bottomY - x.topY)), t.restore();
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
1716
|
drawCandles({
|
|
@@ -1726,47 +1726,47 @@ class ao {
|
|
|
1726
1726
|
entranceByTime: c
|
|
1727
1727
|
}) {
|
|
1728
1728
|
if (e.length === 0) return;
|
|
1729
|
-
const u = this.options.entryAnimation ?? "unfold",
|
|
1729
|
+
const u = this.options.entryAnimation ?? "unfold", g = r + 2;
|
|
1730
1730
|
t.fillStyle = d;
|
|
1731
|
-
for (const
|
|
1732
|
-
const k = (c == null ? void 0 : c.get(
|
|
1731
|
+
for (const p of e) {
|
|
1732
|
+
const k = (c == null ? void 0 : c.get(p.time)) ?? 1, S = n.timeToBitmapX(p.time), m = s.valueToBitmapY(p.open), w = s.valueToBitmapY(p.high), f = s.valueToBitmapY(p.low), v = S - Math.floor(l / 2);
|
|
1733
1733
|
if (k >= 1 || u === "none") {
|
|
1734
|
-
t.fillRect(
|
|
1734
|
+
t.fillRect(v, w, l, f - w);
|
|
1735
1735
|
continue;
|
|
1736
1736
|
}
|
|
1737
|
-
const
|
|
1738
|
-
x,
|
|
1739
|
-
barWidth:
|
|
1740
|
-
anchorY:
|
|
1741
|
-
topY:
|
|
1737
|
+
const x = qi(k, u, {
|
|
1738
|
+
x: v,
|
|
1739
|
+
barWidth: g,
|
|
1740
|
+
anchorY: m,
|
|
1741
|
+
topY: w,
|
|
1742
1742
|
bottomY: f
|
|
1743
1743
|
});
|
|
1744
|
-
t.save(), t.globalAlpha =
|
|
1744
|
+
t.save(), t.globalAlpha = x.alpha, t.fillRect(x.x, x.topY, l, Math.max(1, x.bottomY - x.topY)), t.restore();
|
|
1745
1745
|
}
|
|
1746
|
-
const
|
|
1747
|
-
for (const
|
|
1748
|
-
const k = (c == null ? void 0 : c.get(
|
|
1749
|
-
let
|
|
1750
|
-
if (
|
|
1746
|
+
const b = Array.isArray(h);
|
|
1747
|
+
for (const p of e) {
|
|
1748
|
+
const k = (c == null ? void 0 : c.get(p.time)) ?? 1, S = n.timeToBitmapX(p.time), m = s.valueToBitmapY(p.open), w = s.valueToBitmapY(p.close), f = Math.min(m, w), v = Math.max(m, w), x = Math.max(1, v - f), I = k < 1 && u !== "none";
|
|
1749
|
+
let y = S - a, T = f, L = x, C = 1;
|
|
1750
|
+
if (I) {
|
|
1751
1751
|
const A = qi(k, u, {
|
|
1752
1752
|
x: S - a,
|
|
1753
|
-
barWidth:
|
|
1754
|
-
anchorY:
|
|
1753
|
+
barWidth: g,
|
|
1754
|
+
anchorY: m,
|
|
1755
1755
|
topY: f,
|
|
1756
|
-
bottomY:
|
|
1756
|
+
bottomY: v
|
|
1757
1757
|
});
|
|
1758
|
-
|
|
1758
|
+
y = A.x, T = A.topY, L = Math.max(1, A.bottomY - A.topY), C = A.alpha;
|
|
1759
1759
|
}
|
|
1760
|
-
if (
|
|
1760
|
+
if (I && t.save(), b && L > 2) {
|
|
1761
1761
|
const A = t.createLinearGradient(0, T, 0, T + L);
|
|
1762
1762
|
A.addColorStop(0, h[0]), A.addColorStop(1, h[1]), t.fillStyle = A;
|
|
1763
1763
|
} else
|
|
1764
|
-
t.fillStyle =
|
|
1765
|
-
|
|
1764
|
+
t.fillStyle = b ? h[0] : h;
|
|
1765
|
+
I && (t.globalAlpha = C), t.fillRect(y, T, r, L), I && t.restore();
|
|
1766
1766
|
}
|
|
1767
1767
|
}
|
|
1768
1768
|
}
|
|
1769
|
-
|
|
1769
|
+
Wt = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap();
|
|
1770
1770
|
function qi(i, t, e) {
|
|
1771
1771
|
switch (t) {
|
|
1772
1772
|
case "none":
|
|
@@ -1776,8 +1776,8 @@ function qi(i, t, e) {
|
|
|
1776
1776
|
case "unfold":
|
|
1777
1777
|
return {
|
|
1778
1778
|
x: e.x,
|
|
1779
|
-
topY:
|
|
1780
|
-
bottomY:
|
|
1779
|
+
topY: Mt(e.anchorY, e.topY, i),
|
|
1780
|
+
bottomY: Mt(e.anchorY, e.bottomY, i),
|
|
1781
1781
|
alpha: 1
|
|
1782
1782
|
};
|
|
1783
1783
|
case "slide":
|
|
@@ -1790,8 +1790,8 @@ function qi(i, t, e) {
|
|
|
1790
1790
|
case "fade-unfold":
|
|
1791
1791
|
return {
|
|
1792
1792
|
x: e.x,
|
|
1793
|
-
topY:
|
|
1794
|
-
bottomY:
|
|
1793
|
+
topY: Mt(e.anchorY, e.topY, i),
|
|
1794
|
+
bottomY: Mt(e.anchorY, e.bottomY, i),
|
|
1795
1795
|
alpha: i
|
|
1796
1796
|
};
|
|
1797
1797
|
}
|
|
@@ -1810,7 +1810,7 @@ function Hn(i) {
|
|
|
1810
1810
|
}
|
|
1811
1811
|
class ro extends gs {
|
|
1812
1812
|
constructor(t, e) {
|
|
1813
|
-
super(t),
|
|
1813
|
+
super(t), R(this, "options"), R(this, "areaGradientCache", /* @__PURE__ */ new Map()), this.options = { ...oo, ...Hn(e) };
|
|
1814
1814
|
}
|
|
1815
1815
|
/** Back-compat: first store. */
|
|
1816
1816
|
get store() {
|
|
@@ -1887,40 +1887,40 @@ class ro extends gs {
|
|
|
1887
1887
|
return { x: l, y: h };
|
|
1888
1888
|
const u = a.getAll();
|
|
1889
1889
|
if (u.length < 2) return { x: l, y: h };
|
|
1890
|
-
const
|
|
1891
|
-
if (!Number.isFinite(
|
|
1892
|
-
const
|
|
1890
|
+
const g = u[u.length - 2];
|
|
1891
|
+
if (!Number.isFinite(g.value)) return { x: l, y: h };
|
|
1892
|
+
const b = e.timeToBitmapX(g.time), p = n.valueToBitmapY(g.value);
|
|
1893
1893
|
return {
|
|
1894
|
-
x:
|
|
1895
|
-
y:
|
|
1894
|
+
x: Mt(b, l, c),
|
|
1895
|
+
y: Mt(p, h, c)
|
|
1896
1896
|
};
|
|
1897
1897
|
}
|
|
1898
1898
|
/** Each layer drawn independently */
|
|
1899
1899
|
renderOff(t) {
|
|
1900
1900
|
var e;
|
|
1901
|
-
const { scope: n, timeScale: s, yScale: a } = t, { context: r } = n, l = s.getRange(), { verticalPixelRatio: h } = n, d = this.options.strokeWidth > 0, c = Math.max(1, Math.round(this.options.strokeWidth * h)), u = performance.now(),
|
|
1902
|
-
for (let
|
|
1903
|
-
if (!this.stores[
|
|
1904
|
-
let
|
|
1901
|
+
const { scope: n, timeScale: s, yScale: a } = t, { context: r } = n, l = s.getRange(), { verticalPixelRatio: h } = n, d = this.options.strokeWidth > 0, c = Math.max(1, Math.round(this.options.strokeWidth * h)), u = performance.now(), g = this.options.entryAnimation ?? "grow";
|
|
1902
|
+
for (let b = 0; b < this.stores.length; b++) {
|
|
1903
|
+
if (!this.stores[b].isVisible()) continue;
|
|
1904
|
+
let p = this.stores[b].getVisibleData(l.from, l.to);
|
|
1905
1905
|
const k = n.mediaSize.width;
|
|
1906
|
-
if (
|
|
1907
|
-
const S = this.options.colors[
|
|
1908
|
-
x: s.timeToBitmapX(
|
|
1909
|
-
y: a.valueToBitmapY(this.effectiveValue(
|
|
1910
|
-
},
|
|
1911
|
-
|
|
1912
|
-
const T =
|
|
1906
|
+
if (p.length > k * 2 && (p = En(p, Math.round(k * 1.5))), p.length < 2) continue;
|
|
1907
|
+
const S = this.options.colors[b % this.options.colors.length], m = p[p.length - 1], w = this.peekEntry(b, m.time), f = this.entranceProgress(b, m.time, u), v = w && g === "fade" && f < 1, x = this.trailingEndpoint(b, s, a, u) ?? {
|
|
1908
|
+
x: s.timeToBitmapX(m.time),
|
|
1909
|
+
y: a.valueToBitmapY(this.effectiveValue(b, m.time, m.value))
|
|
1910
|
+
}, I = x.x, y = x.y;
|
|
1911
|
+
v && (r.save(), r.globalAlpha = f);
|
|
1912
|
+
const T = p.length - 1, L = [];
|
|
1913
1913
|
let C = null;
|
|
1914
1914
|
for (let _ = 0; _ < T; _++) {
|
|
1915
|
-
const E =
|
|
1915
|
+
const E = p[_].value;
|
|
1916
1916
|
if (!Number.isFinite(E)) {
|
|
1917
1917
|
C = null;
|
|
1918
1918
|
continue;
|
|
1919
1919
|
}
|
|
1920
|
-
C || (C = [], L.push(C)), C.push({ x: s.timeToBitmapX(
|
|
1920
|
+
C || (C = [], L.push(C)), C.push({ x: s.timeToBitmapX(p[_].time), y: a.valueToBitmapY(E) });
|
|
1921
1921
|
}
|
|
1922
|
-
const A = (e =
|
|
1923
|
-
if (Number.isFinite(
|
|
1922
|
+
const A = (e = p[T]) == null ? void 0 : e.value;
|
|
1923
|
+
if (Number.isFinite(I) && Number.isFinite(y) && Number.isFinite(A) && (C ? C.push({ x: I, y }) : L.push([{ x: I, y }])), d && L.some((_) => _.length >= 2)) {
|
|
1924
1924
|
r.beginPath();
|
|
1925
1925
|
for (const _ of L)
|
|
1926
1926
|
if (!(_.length < 2)) {
|
|
@@ -1937,7 +1937,7 @@ class ro extends gs {
|
|
|
1937
1937
|
E && (r.fillStyle = S, r.fill());
|
|
1938
1938
|
}
|
|
1939
1939
|
if (this.options.area.visible) {
|
|
1940
|
-
const _ = n.bitmapSize.height, E = String(
|
|
1940
|
+
const _ = n.bitmapSize.height, E = String(b), V = this.areaGradientCache.get(E);
|
|
1941
1941
|
let U;
|
|
1942
1942
|
V && V.bottomY === _ && V.color === S ? U = V.gradient : (U = r.createLinearGradient(0, 0, 0, _), U.addColorStop(0, Ye(S, 0.12)), U.addColorStop(1, Ye(S, 0.01)), this.areaGradientCache.set(E, { gradient: U, bottomY: _, color: S })), r.fillStyle = U;
|
|
1943
1943
|
for (const j of L)
|
|
@@ -1947,26 +1947,26 @@ class ro extends gs {
|
|
|
1947
1947
|
r.lineTo(j[j.length - 1].x, _), r.lineTo(j[0].x, _), r.closePath(), r.fill();
|
|
1948
1948
|
}
|
|
1949
1949
|
}
|
|
1950
|
-
|
|
1950
|
+
v && r.restore();
|
|
1951
1951
|
}
|
|
1952
1952
|
}
|
|
1953
1953
|
/** Stacked area rendering */
|
|
1954
1954
|
renderStacked(t, e) {
|
|
1955
|
-
const { scope: n, timeScale: s, yScale: a } = t, { context: r } = n, l = s.getRange(), { verticalPixelRatio: h } = n, d = this.options.strokeWidth > 0, c = Math.max(1, Math.round(this.options.strokeWidth * h)), u = n.mediaSize.width,
|
|
1956
|
-
let T =
|
|
1955
|
+
const { scope: n, timeScale: s, yScale: a } = t, { context: r } = n, l = s.getRange(), { verticalPixelRatio: h } = n, d = this.options.strokeWidth > 0, c = Math.max(1, Math.round(this.options.strokeWidth * h)), u = n.mediaSize.width, g = this.stores.map((y) => {
|
|
1956
|
+
let T = y.getVisibleData(l.from, l.to);
|
|
1957
1957
|
return T.length > u * 2 && (T = En(T, Math.round(u * 1.5))), T;
|
|
1958
|
-
}),
|
|
1959
|
-
for (const
|
|
1960
|
-
for (const T of
|
|
1961
|
-
const
|
|
1962
|
-
if (
|
|
1963
|
-
const k =
|
|
1958
|
+
}), b = /* @__PURE__ */ new Set();
|
|
1959
|
+
for (const y of g)
|
|
1960
|
+
for (const T of y) b.add(T.time);
|
|
1961
|
+
const p = Array.from(b).sort((y, T) => y - T);
|
|
1962
|
+
if (p.length < 2) return;
|
|
1963
|
+
const k = g.map((y, T) => {
|
|
1964
1964
|
const L = /* @__PURE__ */ new Map();
|
|
1965
|
-
for (const C of
|
|
1965
|
+
for (const C of y) L.set(C.time, this.effectiveValue(T, C.time, C.value));
|
|
1966
1966
|
return L;
|
|
1967
|
-
}), S = Array.from({ length: this.stores.length }, () => new Array(
|
|
1968
|
-
for (let
|
|
1969
|
-
const T =
|
|
1967
|
+
}), S = Array.from({ length: this.stores.length }, () => new Array(p.length).fill(0));
|
|
1968
|
+
for (let y = 0; y < p.length; y++) {
|
|
1969
|
+
const T = p[y];
|
|
1970
1970
|
let L = 0;
|
|
1971
1971
|
if (e)
|
|
1972
1972
|
for (let A = 0; A < this.stores.length; A++) {
|
|
@@ -1977,39 +1977,39 @@ class ro extends gs {
|
|
|
1977
1977
|
let C = 0;
|
|
1978
1978
|
for (let A = 0; A < this.stores.length; A++) {
|
|
1979
1979
|
const _ = this.stores[A].isVisible() ? k[A].get(T) : 0, E = Number.isFinite(_) ? _ : 0;
|
|
1980
|
-
C += e && L > 0 ? E / L * 100 : E, S[A][
|
|
1980
|
+
C += e && L > 0 ? E / L * 100 : E, S[A][y] = C;
|
|
1981
1981
|
}
|
|
1982
1982
|
}
|
|
1983
|
-
const
|
|
1984
|
-
for (let
|
|
1985
|
-
const
|
|
1986
|
-
for (let
|
|
1987
|
-
if (!this.stores[
|
|
1988
|
-
const T = this.stores[
|
|
1983
|
+
const m = performance.now(), w = this.options.entryAnimation ?? "grow", f = /* @__PURE__ */ new Map();
|
|
1984
|
+
for (let y = 0; y < p.length; y++) f.set(p[y], y);
|
|
1985
|
+
const v = p.length - 1, x = new Array(this.stores.length).fill(1);
|
|
1986
|
+
for (let y = 0; y < this.stores.length; y++) {
|
|
1987
|
+
if (!this.stores[y].isVisible()) continue;
|
|
1988
|
+
const T = this.stores[y].last();
|
|
1989
1989
|
if (!T) continue;
|
|
1990
|
-
const L = this.peekEntry(
|
|
1990
|
+
const L = this.peekEntry(y, T.time);
|
|
1991
1991
|
if (!L) continue;
|
|
1992
1992
|
const C = f.get(T.time);
|
|
1993
|
-
C !==
|
|
1993
|
+
C !== v || f.get(L.fromTime) !== C - 1 || (x[y] = this.entranceProgress(y, T.time, m));
|
|
1994
1994
|
}
|
|
1995
|
-
const
|
|
1996
|
-
if (T >= 1 ||
|
|
1997
|
-
const L =
|
|
1998
|
-
|
|
1995
|
+
const I = (y, T) => {
|
|
1996
|
+
if (T >= 1 || y.length < 2) return;
|
|
1997
|
+
const L = y.length - 1, C = y[L - 1], A = y[L];
|
|
1998
|
+
y[L] = [Mt(C[0], A[0], T), Mt(C[1], A[1], T)];
|
|
1999
1999
|
};
|
|
2000
|
-
for (let
|
|
2001
|
-
if (!this.stores[
|
|
2002
|
-
const T = this.options.colors[
|
|
2003
|
-
for (let V = 0; V <
|
|
2004
|
-
A.push([s.timeToBitmapX(
|
|
2005
|
-
|
|
2000
|
+
for (let y = this.stores.length - 1; y >= 0; y--) {
|
|
2001
|
+
if (!this.stores[y].isVisible()) continue;
|
|
2002
|
+
const T = this.options.colors[y % this.options.colors.length], L = x[y], C = y > 0 && this.stores[y - 1].isVisible() ? x[y - 1] : 1, A = [];
|
|
2003
|
+
for (let V = 0; V < p.length; V++)
|
|
2004
|
+
A.push([s.timeToBitmapX(p[V]), a.valueToBitmapY(S[y][V])]);
|
|
2005
|
+
w === "grow" && I(A, L);
|
|
2006
2006
|
const _ = [];
|
|
2007
|
-
for (let V = 0; V <
|
|
2008
|
-
const U =
|
|
2009
|
-
_.push([s.timeToBitmapX(
|
|
2007
|
+
for (let V = 0; V < p.length; V++) {
|
|
2008
|
+
const U = y > 0 ? S[y - 1][V] : 0;
|
|
2009
|
+
_.push([s.timeToBitmapX(p[V]), a.valueToBitmapY(U)]);
|
|
2010
2010
|
}
|
|
2011
|
-
|
|
2012
|
-
const E =
|
|
2011
|
+
w === "grow" && I(_, C);
|
|
2012
|
+
const E = w === "fade" && L < 1;
|
|
2013
2013
|
if (E && (r.save(), r.globalAlpha = L), this.options.area.visible) {
|
|
2014
2014
|
r.beginPath(), r.moveTo(A[0][0], A[0][1]);
|
|
2015
2015
|
for (let V = 1; V < A.length; V++)
|
|
@@ -2034,32 +2034,32 @@ class ro extends gs {
|
|
|
2034
2034
|
drawOverlay(t) {
|
|
2035
2035
|
const { scope: e, timeScale: n, yScale: s, crosshair: a, dataInterval: r } = t, l = e, h = this.resolvedPulseMs();
|
|
2036
2036
|
if (a) {
|
|
2037
|
-
const d = this.options.colors, c = this.options.stacking, u = 4 * l.horizontalPixelRatio,
|
|
2037
|
+
const d = this.options.colors, c = this.options.stacking, u = 4 * l.horizontalPixelRatio, g = [], b = [];
|
|
2038
2038
|
for (let k = 0; k < this.stores.length; k++) {
|
|
2039
2039
|
const S = this.stores[k].findNearest(a.time, r);
|
|
2040
|
-
S ? (
|
|
2040
|
+
S ? (g.push(S.value), b.push(S.time)) : (g.push(0), b.push(null));
|
|
2041
2041
|
}
|
|
2042
|
-
const
|
|
2042
|
+
const p = [];
|
|
2043
2043
|
if (c === "off")
|
|
2044
|
-
for (const k of
|
|
2044
|
+
for (const k of g) p.push(k);
|
|
2045
2045
|
else {
|
|
2046
2046
|
let k = 0;
|
|
2047
2047
|
if (c === "percent")
|
|
2048
|
-
for (let
|
|
2049
|
-
this.stores[
|
|
2048
|
+
for (let m = 0; m < g.length; m++)
|
|
2049
|
+
this.stores[m].isVisible() && (k += g[m]);
|
|
2050
2050
|
let S = 0;
|
|
2051
|
-
for (let
|
|
2052
|
-
const
|
|
2053
|
-
S += c === "percent" && k > 0 ?
|
|
2051
|
+
for (let m = 0; m < g.length; m++) {
|
|
2052
|
+
const w = this.stores[m].isVisible() ? g[m] : 0;
|
|
2053
|
+
S += c === "percent" && k > 0 ? w / k * 100 : w, p.push(S);
|
|
2054
2054
|
}
|
|
2055
2055
|
}
|
|
2056
2056
|
for (let k = 0; k < this.stores.length; k++) {
|
|
2057
|
-
const S =
|
|
2057
|
+
const S = b[k];
|
|
2058
2058
|
if (S === null || !this.stores[k].isVisible()) continue;
|
|
2059
|
-
const
|
|
2060
|
-
e.context.beginPath(), e.context.arc(
|
|
2061
|
-
const
|
|
2062
|
-
e.context.fillStyle =
|
|
2059
|
+
const m = d[k % d.length], w = n.timeToBitmapX(S), f = s.valueToBitmapY(p[k]);
|
|
2060
|
+
e.context.beginPath(), e.context.arc(w, f, u + 3 * l.horizontalPixelRatio, 0, Math.PI * 2);
|
|
2061
|
+
const v = m.startsWith("#") ? m + "40" : /^rgb\(/i.test(m) ? m.replace(/^rgb\((.*)\)$/i, "rgba($1, 0.25)") : m.replace(/[\d.]+\)\s*$/, "0.25)");
|
|
2062
|
+
e.context.fillStyle = v, e.context.fill(), e.context.beginPath(), e.context.arc(w, f, u, 0, Math.PI * 2), e.context.fillStyle = m, e.context.fill();
|
|
2063
2063
|
}
|
|
2064
2064
|
}
|
|
2065
2065
|
if (this.hasPulse && h > 0) {
|
|
@@ -2068,53 +2068,53 @@ class ro extends gs {
|
|
|
2068
2068
|
const c = this.options.stacking;
|
|
2069
2069
|
for (let u = 0; u < this.stores.length; u++) {
|
|
2070
2070
|
if (!this.stores[u].isVisible()) continue;
|
|
2071
|
-
const
|
|
2071
|
+
const g = this.options.colors[u % this.options.colors.length];
|
|
2072
2072
|
if (c === "off") {
|
|
2073
|
-
const
|
|
2074
|
-
if (!
|
|
2073
|
+
const x = this.trailingEndpoint(u, n, s, d);
|
|
2074
|
+
if (!x) continue;
|
|
2075
2075
|
this.drawPulse({
|
|
2076
2076
|
ctx: e.context,
|
|
2077
|
-
x:
|
|
2078
|
-
y:
|
|
2079
|
-
color:
|
|
2077
|
+
x: x.x,
|
|
2078
|
+
y: x.y,
|
|
2079
|
+
color: g,
|
|
2080
2080
|
pixelRatio: l.horizontalPixelRatio,
|
|
2081
2081
|
pulseMs: h
|
|
2082
2082
|
});
|
|
2083
2083
|
continue;
|
|
2084
2084
|
}
|
|
2085
|
-
const
|
|
2086
|
-
if (!
|
|
2087
|
-
const
|
|
2088
|
-
const
|
|
2089
|
-
const C = L === u &&
|
|
2090
|
-
return !C || C.time !==
|
|
2085
|
+
const b = this.stores[u].last();
|
|
2086
|
+
if (!b) continue;
|
|
2087
|
+
const p = b.time, k = c === "percent", S = (x) => {
|
|
2088
|
+
const I = (L) => {
|
|
2089
|
+
const C = L === u && x === p ? b : this.stores[L].findNearest(x, 0);
|
|
2090
|
+
return !C || C.time !== x ? 0 : this.effectiveValue(L, x, C.value);
|
|
2091
2091
|
};
|
|
2092
|
-
let
|
|
2092
|
+
let y = 0;
|
|
2093
2093
|
if (k)
|
|
2094
2094
|
for (let L = 0; L < this.stores.length; L++)
|
|
2095
|
-
this.stores[L].isVisible() && (
|
|
2095
|
+
this.stores[L].isVisible() && (y += I(L));
|
|
2096
2096
|
let T = 0;
|
|
2097
2097
|
for (let L = 0; L <= u; L++) {
|
|
2098
2098
|
if (!this.stores[L].isVisible()) continue;
|
|
2099
|
-
const C =
|
|
2100
|
-
T += k &&
|
|
2099
|
+
const C = I(L);
|
|
2100
|
+
T += k && y > 0 ? C / y * 100 : C;
|
|
2101
2101
|
}
|
|
2102
2102
|
return T;
|
|
2103
2103
|
};
|
|
2104
|
-
let
|
|
2105
|
-
const f = this.options.entryAnimation ?? "grow",
|
|
2106
|
-
if (f === "grow" &&
|
|
2107
|
-
const
|
|
2108
|
-
if (
|
|
2109
|
-
const
|
|
2110
|
-
|
|
2104
|
+
let m = n.timeToBitmapX(p), w = s.valueToBitmapY(S(p));
|
|
2105
|
+
const f = this.options.entryAnimation ?? "grow", v = this.peekEntry(u, p);
|
|
2106
|
+
if (f === "grow" && v) {
|
|
2107
|
+
const x = this.entranceProgress(u, p, d);
|
|
2108
|
+
if (x < 1 && v.fromTime !== p) {
|
|
2109
|
+
const I = n.timeToBitmapX(v.fromTime), y = s.valueToBitmapY(S(v.fromTime));
|
|
2110
|
+
m = Mt(I, m, x), w = Mt(y, w, x);
|
|
2111
2111
|
}
|
|
2112
2112
|
}
|
|
2113
2113
|
this.drawPulse({
|
|
2114
2114
|
ctx: e.context,
|
|
2115
|
-
x:
|
|
2116
|
-
y:
|
|
2117
|
-
color:
|
|
2115
|
+
x: m,
|
|
2116
|
+
y: w,
|
|
2117
|
+
color: g,
|
|
2118
2118
|
pixelRatio: l.horizontalPixelRatio,
|
|
2119
2119
|
pulseMs: h
|
|
2120
2120
|
});
|
|
@@ -2176,8 +2176,8 @@ function fo(i) {
|
|
|
2176
2176
|
}
|
|
2177
2177
|
const Ee = Math.PI * 2, ys = 0.85;
|
|
2178
2178
|
function Nn(i) {
|
|
2179
|
-
const { bitmapWidth: t, bitmapHeight: e, padTop: n, padBottom: s } = i, a = Math.max(0, i.labelReserve ?? 0), r = Math.min(Math.max(0, n), e), l = Math.min(Math.max(0, s), e - r), h = e - r - l, d = Math.max(0, t - 2 * a), c = t / 2, u = r + h / 2,
|
|
2180
|
-
return { cx: c, cy: u, maxR:
|
|
2179
|
+
const { bitmapWidth: t, bitmapHeight: e, padTop: n, padBottom: s } = i, a = Math.max(0, i.labelReserve ?? 0), r = Math.min(Math.max(0, n), e), l = Math.min(Math.max(0, s), e - r), h = e - r - l, d = Math.max(0, t - 2 * a), c = t / 2, u = r + h / 2, g = Math.max(0, Math.min(d, h) / 2 * ys);
|
|
2180
|
+
return { cx: c, cy: u, maxR: g };
|
|
2181
2181
|
}
|
|
2182
2182
|
function po(i) {
|
|
2183
2183
|
if (!i.startsWith("#")) return !1;
|
|
@@ -2213,17 +2213,17 @@ function mo(i, t) {
|
|
|
2213
2213
|
const e = Xn(i), n = Xn(t), s = n.a, a = Math.round(n.r * s + e.r * (1 - s)), r = Math.round(n.g * s + e.g * (1 - s)), l = Math.round(n.b * s + e.b * (1 - s));
|
|
2214
2214
|
return `#${a.toString(16).padStart(2, "0")}${r.toString(16).padStart(2, "0")}${l.toString(16).padStart(2, "0")}`;
|
|
2215
2215
|
}
|
|
2216
|
-
var Q, et,
|
|
2216
|
+
var Q, et, _t, bt, Be, ne, Rt, ve, Pt, sn, Mi, xs, ws, ks;
|
|
2217
2217
|
class Ci {
|
|
2218
2218
|
constructor(t) {
|
|
2219
|
-
W(this,
|
|
2219
|
+
W(this, Pt), W(this, Q, []), W(this, et), W(this, _t, -1), W(this, bt, []), W(this, Be, 0), W(this, ne, 1), W(this, Rt, null), W(this, ve, []), M(this, et, B(this, Pt, sn).call(this, lo, t ?? {}));
|
|
2220
2220
|
}
|
|
2221
2221
|
getData() {
|
|
2222
2222
|
return o(this, Q);
|
|
2223
2223
|
}
|
|
2224
2224
|
setData(t) {
|
|
2225
2225
|
const e = t ?? [];
|
|
2226
|
-
M(this, Q, e), M(this, bt, new Array(e.length).fill(0)), M(this, ne, o(this, et).animate ? 0 : 1), M(this,
|
|
2226
|
+
M(this, Q, e), M(this, bt, new Array(e.length).fill(0)), M(this, ne, o(this, et).animate ? 0 : 1), M(this, Rt, null);
|
|
2227
2227
|
for (const n of o(this, ve))
|
|
2228
2228
|
n();
|
|
2229
2229
|
}
|
|
@@ -2236,7 +2236,7 @@ class Ci {
|
|
|
2236
2236
|
updateOptions(t) {
|
|
2237
2237
|
var e, n;
|
|
2238
2238
|
const s = (e = o(this, et).sliceLabels) == null ? void 0 : e.mode;
|
|
2239
|
-
M(this, et,
|
|
2239
|
+
M(this, et, B(this, Pt, sn).call(this, o(this, et), t ?? {})), ((n = o(this, et).sliceLabels) == null ? void 0 : n.mode) === "outside" && s !== "outside" && M(this, ne, o(this, et).animate ? 0 : 1), M(this, Rt, null);
|
|
2240
2240
|
}
|
|
2241
2241
|
getColor() {
|
|
2242
2242
|
var t, e;
|
|
@@ -2254,48 +2254,48 @@ class Ci {
|
|
|
2254
2254
|
return [this.getColor()];
|
|
2255
2255
|
}
|
|
2256
2256
|
applyTheme(t, e) {
|
|
2257
|
-
t.typography.fontFamily !== e.typography.fontFamily && M(this,
|
|
2257
|
+
t.typography.fontFamily !== e.typography.fontFamily && M(this, Rt, null);
|
|
2258
2258
|
}
|
|
2259
2259
|
/** Hit-test: which slice is at this bitmap coordinate? Returns index or -1. */
|
|
2260
2260
|
hitTest(t, e, n, s, a) {
|
|
2261
2261
|
var r;
|
|
2262
2262
|
if (o(this, Q).length === 0) return -1;
|
|
2263
|
-
const l = o(this, Q).reduce((f,
|
|
2263
|
+
const l = o(this, Q).reduce((f, v) => f + v.value, 0);
|
|
2264
2264
|
if (l <= 0) return -1;
|
|
2265
|
-
const h = ((r = o(this,
|
|
2265
|
+
const h = ((r = o(this, Rt)) == null ? void 0 : r.reserve) ?? 0, { cx: d, cy: c, maxR: u } = Nn({
|
|
2266
2266
|
bitmapWidth: n,
|
|
2267
2267
|
bitmapHeight: s,
|
|
2268
2268
|
padTop: (a == null ? void 0 : a.top) ?? 0,
|
|
2269
2269
|
padBottom: (a == null ? void 0 : a.bottom) ?? 0,
|
|
2270
2270
|
labelReserve: h
|
|
2271
|
-
}),
|
|
2272
|
-
if (S >
|
|
2273
|
-
let
|
|
2274
|
-
|
|
2275
|
-
let
|
|
2271
|
+
}), g = u, b = g * o(this, et).innerRadiusRatio, p = t - d, k = e - c, S = Math.sqrt(p * p + k * k);
|
|
2272
|
+
if (S > g || S < b) return -1;
|
|
2273
|
+
let m = Math.atan2(k, p) + Math.PI / 2;
|
|
2274
|
+
m < 0 && (m += Ee);
|
|
2275
|
+
let w = 0;
|
|
2276
2276
|
for (let f = 0; f < o(this, Q).length; f++) {
|
|
2277
|
-
const
|
|
2278
|
-
if (
|
|
2279
|
-
|
|
2277
|
+
const v = o(this, Q)[f].value / l * Ee;
|
|
2278
|
+
if (m >= w && m < w + v) return f;
|
|
2279
|
+
w += v;
|
|
2280
2280
|
}
|
|
2281
2281
|
return -1;
|
|
2282
2282
|
}
|
|
2283
2283
|
setHoverIndex(t) {
|
|
2284
|
-
return o(this,
|
|
2284
|
+
return o(this, _t) === t ? !1 : (M(this, _t, t), !0);
|
|
2285
2285
|
}
|
|
2286
2286
|
getHoverIndex() {
|
|
2287
|
-
return o(this,
|
|
2287
|
+
return o(this, _t);
|
|
2288
2288
|
}
|
|
2289
2289
|
getHoverInfo(t) {
|
|
2290
|
-
if (o(this,
|
|
2291
|
-
const e = o(this, Q)[o(this,
|
|
2290
|
+
if (o(this, _t) < 0) return null;
|
|
2291
|
+
const e = o(this, Q)[o(this, _t)];
|
|
2292
2292
|
if (!e) return null;
|
|
2293
2293
|
const n = o(this, Q).reduce((a, r) => a + r.value, 0), s = o(this, et).colors ?? t.seriesColors;
|
|
2294
2294
|
return {
|
|
2295
2295
|
label: e.label,
|
|
2296
2296
|
value: e.value,
|
|
2297
2297
|
percent: n > 0 ? e.value / n * 100 : 0,
|
|
2298
|
-
color: e.color ?? s[o(this,
|
|
2298
|
+
color: e.color ?? s[o(this, _t) % s.length]
|
|
2299
2299
|
};
|
|
2300
2300
|
}
|
|
2301
2301
|
getSliceInfo(t) {
|
|
@@ -2313,13 +2313,13 @@ class Ci {
|
|
|
2313
2313
|
var t;
|
|
2314
2314
|
if (!o(this, et).animate) return !1;
|
|
2315
2315
|
for (let e = 0; e < o(this, bt).length; e++) {
|
|
2316
|
-
const n = e === o(this,
|
|
2316
|
+
const n = e === o(this, _t) ? 1 : 0;
|
|
2317
2317
|
if (Math.abs(o(this, bt)[e] - n) > 0.01) return !0;
|
|
2318
2318
|
}
|
|
2319
2319
|
return ((t = o(this, et).sliceLabels) == null ? void 0 : t.mode) === "outside" && o(this, ne) < 0.99;
|
|
2320
2320
|
}
|
|
2321
2321
|
dispose() {
|
|
2322
|
-
M(this, ve, []), M(this, Q, []), M(this, bt, []), M(this,
|
|
2322
|
+
M(this, ve, []), M(this, Q, []), M(this, bt, []), M(this, Be, 0);
|
|
2323
2323
|
}
|
|
2324
2324
|
/**
|
|
2325
2325
|
* @internal Test-only accessor for the animated slice offsets. The backing
|
|
@@ -2332,61 +2332,61 @@ class Ci {
|
|
|
2332
2332
|
}
|
|
2333
2333
|
render(t) {
|
|
2334
2334
|
if (o(this, Q).length === 0) return;
|
|
2335
|
-
const { scope: e, theme: n, padding: s } = t, { context: a, bitmapSize: r, horizontalPixelRatio: l, verticalPixelRatio: h } = e, d = performance.now(), c = o(this,
|
|
2336
|
-
M(this,
|
|
2335
|
+
const { scope: e, theme: n, padding: s } = t, { context: a, bitmapSize: r, horizontalPixelRatio: l, verticalPixelRatio: h } = e, d = performance.now(), c = o(this, Be) ? Math.min(0.05, (d - o(this, Be)) / 1e3) : 0;
|
|
2336
|
+
M(this, Be, d);
|
|
2337
2337
|
const u = o(this, Q).reduce((U, j) => U + j.value, 0);
|
|
2338
2338
|
if (u <= 0) return;
|
|
2339
|
-
const
|
|
2339
|
+
const g = 12;
|
|
2340
2340
|
for (; o(this, bt).length < o(this, Q).length; )
|
|
2341
2341
|
o(this, bt).push(0);
|
|
2342
2342
|
if (o(this, et).animate)
|
|
2343
2343
|
for (let U = 0; U < o(this, Q).length; U++) {
|
|
2344
|
-
const j = U === o(this,
|
|
2345
|
-
o(this, bt)[U] = _n(o(this, bt)[U], j,
|
|
2344
|
+
const j = U === o(this, _t) ? 1 : 0;
|
|
2345
|
+
o(this, bt)[U] = _n(o(this, bt)[U], j, g, c);
|
|
2346
2346
|
}
|
|
2347
|
-
const
|
|
2348
|
-
a.font = `${
|
|
2349
|
-
const
|
|
2347
|
+
const b = co(o(this, et).sliceLabels);
|
|
2348
|
+
a.font = `${b.fontSize * l}px ${n.typography.fontFamily}`, b.mode === "outside" && o(this, et).animate && M(this, ne, _n(o(this, ne), 1, 6, c));
|
|
2349
|
+
const p = o(this, et).colors ?? n.seriesColors, k = b.mode === "outside" ? B(this, Pt, xs).call(this, a, b, u, l) : 0, { cx: S, cy: m, maxR: w } = Nn({
|
|
2350
2350
|
bitmapWidth: r.width,
|
|
2351
2351
|
bitmapHeight: r.height,
|
|
2352
2352
|
padTop: s.top * h,
|
|
2353
2353
|
padBottom: s.bottom * h,
|
|
2354
2354
|
labelReserve: k
|
|
2355
|
-
}), f =
|
|
2355
|
+
}), f = w, v = f * o(this, et).innerRadiusRatio, x = o(this, et).padAngle * nn, I = 8 * l, y = o(this, et).shadow ?? !1, T = uo(y), L = o(this, et).innerShadow ?? !1, C = fo(L);
|
|
2356
2356
|
let A = -Math.PI / 2;
|
|
2357
2357
|
for (let U = 0; U < o(this, Q).length; U++) {
|
|
2358
|
-
const j = o(this, Q)[U], K = j.value / u * Ee, gt = A +
|
|
2358
|
+
const j = o(this, Q)[U], K = j.value / u * Ee, gt = A + x / 2, st = A + K - x / 2, ee = A + K / 2, $t = j.color ?? p[U % p.length];
|
|
2359
2359
|
if (st <= gt) {
|
|
2360
2360
|
A += K;
|
|
2361
2361
|
continue;
|
|
2362
2362
|
}
|
|
2363
|
-
const Te = o(this, bt)[U] *
|
|
2364
|
-
a.beginPath(), a.arc(
|
|
2365
|
-
const
|
|
2366
|
-
if (
|
|
2363
|
+
const Te = o(this, bt)[U] * I, ut = Math.cos(ee) * Te, Ie = Math.sin(ee) * Te, Ot = S + ut, Lt = m + Ie;
|
|
2364
|
+
a.beginPath(), a.arc(Ot, Lt, f, gt, st), v > 0 ? a.arc(Ot, Lt, v, st, gt, !0) : a.lineTo(Ot, Lt), a.closePath();
|
|
2365
|
+
const At = a.createRadialGradient(Ot, Lt, v || 0, Ot, Lt, f);
|
|
2366
|
+
if (At.addColorStop(0, go($t, 0.15)), L) {
|
|
2367
2367
|
const fe = Math.max(0, Math.min(0.999, 1 - C.depth));
|
|
2368
|
-
|
|
2368
|
+
At.addColorStop(fe, $t), At.addColorStop(1, mo($t, C.color));
|
|
2369
2369
|
} else
|
|
2370
|
-
|
|
2371
|
-
a.fillStyle =
|
|
2370
|
+
At.addColorStop(1, $t);
|
|
2371
|
+
a.fillStyle = At;
|
|
2372
2372
|
const Re = o(this, bt)[U];
|
|
2373
|
-
if (
|
|
2374
|
-
const fe =
|
|
2375
|
-
a.shadowColor =
|
|
2373
|
+
if (y || Re > 0.01) {
|
|
2374
|
+
const fe = y ? 1 : 0, Ge = Re;
|
|
2375
|
+
a.shadowColor = y ? T.color : "rgba(0,0,0,0.25)", a.shadowBlur = (T.blur * fe + 12 * Ge) * l, a.shadowOffsetX = T.offsetX * fe * l + ut * 0.3 * Ge, a.shadowOffsetY = T.offsetY * fe * h + Ie * 0.3 * Ge;
|
|
2376
2376
|
}
|
|
2377
2377
|
a.fill(), a.shadowColor = "transparent", a.shadowBlur = 0, a.shadowOffsetX = 0, a.shadowOffsetY = 0, A += K;
|
|
2378
2378
|
}
|
|
2379
|
-
if (
|
|
2379
|
+
if (b.mode === "none") return;
|
|
2380
2380
|
A = -Math.PI / 2;
|
|
2381
2381
|
const _ = n.tooltip.textColor;
|
|
2382
|
-
if (
|
|
2383
|
-
const U =
|
|
2382
|
+
if (b.mode === "outside") {
|
|
2383
|
+
const U = B(this, Pt, ks).call(this, {
|
|
2384
2384
|
cx: S,
|
|
2385
|
-
cy:
|
|
2385
|
+
cy: m,
|
|
2386
2386
|
outerR: f,
|
|
2387
2387
|
total: u,
|
|
2388
|
-
palette:
|
|
2389
|
-
labels:
|
|
2388
|
+
palette: p,
|
|
2389
|
+
labels: b,
|
|
2390
2390
|
hpr: l,
|
|
2391
2391
|
bitmapHeight: r.height
|
|
2392
2392
|
}), j = U.length > 1 ? Math.min(0.06, 0.9 / (U.length - 1)) : 0;
|
|
@@ -2394,34 +2394,34 @@ class Ci {
|
|
|
2394
2394
|
const gt = U[K];
|
|
2395
2395
|
if (gt === null) continue;
|
|
2396
2396
|
const st = K * j, ee = Oe((o(this, ne) - st) / (1 - st), 0, 1);
|
|
2397
|
-
|
|
2397
|
+
B(this, Pt, ws).call(this, {
|
|
2398
2398
|
context: a,
|
|
2399
2399
|
entry: gt,
|
|
2400
2400
|
textColor: _,
|
|
2401
|
-
labels:
|
|
2401
|
+
labels: b,
|
|
2402
2402
|
hpr: l,
|
|
2403
2403
|
progress: ee
|
|
2404
2404
|
});
|
|
2405
2405
|
}
|
|
2406
2406
|
return;
|
|
2407
2407
|
}
|
|
2408
|
-
const E =
|
|
2408
|
+
const E = v > 0 ? (f + v) / 2 : f * 0.65;
|
|
2409
2409
|
a.textAlign = "center", a.textBaseline = "middle";
|
|
2410
|
-
const V =
|
|
2410
|
+
const V = b.minSliceAngle * nn;
|
|
2411
2411
|
for (let U = 0; U < o(this, Q).length; U++) {
|
|
2412
2412
|
const j = o(this, Q)[U], K = j.value / u * Ee;
|
|
2413
2413
|
if (K >= V) {
|
|
2414
|
-
const gt = A + K / 2, st = o(this, bt)[U] *
|
|
2415
|
-
if (!
|
|
2416
|
-
const
|
|
2417
|
-
a.fillStyle = po(ee) ? "#000000" : "#ffffff", a.fillText(
|
|
2414
|
+
const gt = A + K / 2, st = o(this, bt)[U] * I, ee = j.color ?? p[U % p.length], $t = B(this, Pt, Mi).call(this, j, u, b.content), Te = a.measureText($t).width, ut = b.fontSize * 1.2 * l, Ie = K < Math.PI ? 2 * E * Math.sin(K / 2) : 2 * E, Ot = Te > Ie - 4 * l, Lt = v > 0 && E - v < ut;
|
|
2415
|
+
if (!Ot && !Lt) {
|
|
2416
|
+
const At = S + Math.cos(gt) * (E + st), Re = m + Math.sin(gt) * (E + st);
|
|
2417
|
+
a.fillStyle = po(ee) ? "#000000" : "#ffffff", a.fillText($t, At, Re);
|
|
2418
2418
|
}
|
|
2419
2419
|
}
|
|
2420
2420
|
A += K;
|
|
2421
2421
|
}
|
|
2422
2422
|
}
|
|
2423
2423
|
}
|
|
2424
|
-
Q = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(),
|
|
2424
|
+
Q = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), _t = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakSet(), /**
|
|
2425
2425
|
* Merge partial options onto a base, deep-merging `sliceLabels` so callers
|
|
2426
2426
|
* can override one field (e.g. `mode`) without dropping sibling defaults.
|
|
2427
2427
|
*/
|
|
@@ -2443,15 +2443,15 @@ Mi = function(i, t, e) {
|
|
|
2443
2443
|
*/
|
|
2444
2444
|
xs = function(i, t, e, n) {
|
|
2445
2445
|
const s = i.font;
|
|
2446
|
-
if (o(this,
|
|
2447
|
-
return o(this,
|
|
2446
|
+
if (o(this, Rt) && o(this, Rt).fontScale === n && o(this, Rt).font === s)
|
|
2447
|
+
return o(this, Rt).reserve;
|
|
2448
2448
|
let a = 0;
|
|
2449
2449
|
for (const h of o(this, Q)) {
|
|
2450
|
-
const d =
|
|
2450
|
+
const d = B(this, Pt, Mi).call(this, h, e, t.content), c = i.measureText(d).width;
|
|
2451
2451
|
c > a && (a = c);
|
|
2452
2452
|
}
|
|
2453
2453
|
const r = Math.max(t.distance, t.elbowLen), l = (a + (r + Math.max(0, t.railWidth) + t.legPad + 4) * n) / ys;
|
|
2454
|
-
return M(this,
|
|
2454
|
+
return M(this, Rt, { fontScale: n, font: s, reserve: l }), l;
|
|
2455
2455
|
}, /**
|
|
2456
2456
|
* Draw one outside label: anchor dot → radial elbow (per-slice, at slice
|
|
2457
2457
|
* midangle) → short diagonal to the de-cluster-adjusted rail y → horizontal
|
|
@@ -2462,17 +2462,17 @@ xs = function(i, t, e, n) {
|
|
|
2462
2462
|
ws = function(i) {
|
|
2463
2463
|
const { context: t, entry: e, textColor: n, labels: s, hpr: a, progress: r } = i;
|
|
2464
2464
|
if (r <= 0) return;
|
|
2465
|
-
const { anchorX: l, anchorY: h, elbowX: d, elbowY: c, side: u, text:
|
|
2466
|
-
if (t.save(), t.globalAlpha =
|
|
2467
|
-
t.save(), t.globalAlpha =
|
|
2468
|
-
const
|
|
2469
|
-
if (t.lineTo(
|
|
2470
|
-
const
|
|
2471
|
-
t.lineTo(
|
|
2465
|
+
const { anchorX: l, anchorY: h, elbowX: d, elbowY: c, side: u, text: g, color: b, labelX: p, labelY: k } = e, S = p + u * s.legPad * a, m = Oe(r / 0.15, 0, 1), w = Oe((r - 0.15) / 0.45, 0, 1), f = Oe((r - 0.6) / 0.4, 0, 1);
|
|
2466
|
+
if (t.save(), t.globalAlpha = m, t.fillStyle = b, t.beginPath(), t.arc(l, h, 2.5 * a, 0, Ee), t.fill(), t.restore(), w > 0) {
|
|
2467
|
+
t.save(), t.globalAlpha = w, t.strokeStyle = b, t.lineWidth = 1 * a, t.lineCap = "round", t.beginPath(), t.moveTo(l, h);
|
|
2468
|
+
const v = l + (d - l) * w, x = h + (c - h) * w;
|
|
2469
|
+
if (t.lineTo(v, x), f > 0) {
|
|
2470
|
+
const I = d + (p - d) * f, y = c + (k - c) * f;
|
|
2471
|
+
t.lineTo(I, y);
|
|
2472
2472
|
}
|
|
2473
2473
|
t.stroke(), t.restore();
|
|
2474
2474
|
}
|
|
2475
|
-
f > 0 && (t.save(), t.globalAlpha = f, t.fillStyle = n, t.textAlign = u >= 0 ? "left" : "right", t.textBaseline = "middle", t.fillText(
|
|
2475
|
+
f > 0 && (t.save(), t.globalAlpha = f, t.fillStyle = n, t.textAlign = u >= 0 ? "left" : "right", t.textBaseline = "middle", t.fillText(g, S, k), t.restore());
|
|
2476
2476
|
}, /**
|
|
2477
2477
|
* Lay out one outside label per eligible slice. Returns entries in original
|
|
2478
2478
|
* slice order so the caller can map by index to reveal progress / explode.
|
|
@@ -2489,13 +2489,13 @@ ws = function(i) {
|
|
|
2489
2489
|
* the label, which would push text across the pie.
|
|
2490
2490
|
*/
|
|
2491
2491
|
ks = function(i) {
|
|
2492
|
-
const { cx: t, cy: e, outerR: n, total: s, palette: a, labels: r, hpr: l, bitmapHeight: h } = i, d = new Array(o(this, Q).length).fill(null), c = r.elbowLen * l, u = Math.max(r.distance, r.elbowLen) * l,
|
|
2493
|
-
let
|
|
2492
|
+
const { cx: t, cy: e, outerR: n, total: s, palette: a, labels: r, hpr: l, bitmapHeight: h } = i, d = new Array(o(this, Q).length).fill(null), c = r.elbowLen * l, u = Math.max(r.distance, r.elbowLen) * l, g = Math.max(0, r.railWidth) * l, b = [];
|
|
2493
|
+
let p = -Math.PI / 2;
|
|
2494
2494
|
const k = r.minSliceAngle * nn;
|
|
2495
2495
|
for (let f = 0; f < o(this, Q).length; f++) {
|
|
2496
|
-
const
|
|
2497
|
-
if (
|
|
2498
|
-
const
|
|
2496
|
+
const v = o(this, Q)[f], x = v.value / s * Ee;
|
|
2497
|
+
if (x >= k) {
|
|
2498
|
+
const I = p + x / 2, y = o(this, bt)[f] * (8 * l), T = Math.cos(I), L = Math.sin(I), C = T >= 0 ? 1 : -1, A = t + T * (n + y), _ = e + L * (n + y), E = t + T * (n + y + c), V = e + L * (n + y + c), U = t + T * (n + y + u) + C * g, j = e + L * (n + y + u), K = {
|
|
2499
2499
|
anchorX: A,
|
|
2500
2500
|
anchorY: _,
|
|
2501
2501
|
elbowX: E,
|
|
@@ -2503,75 +2503,75 @@ ks = function(i) {
|
|
|
2503
2503
|
side: C,
|
|
2504
2504
|
labelX: U,
|
|
2505
2505
|
labelY: j,
|
|
2506
|
-
text:
|
|
2507
|
-
color:
|
|
2506
|
+
text: B(this, Pt, Mi).call(this, v, s, r.content),
|
|
2507
|
+
color: v.color ?? a[f % a.length]
|
|
2508
2508
|
};
|
|
2509
|
-
d[f] = K,
|
|
2509
|
+
d[f] = K, b.push({ entry: K });
|
|
2510
2510
|
}
|
|
2511
|
-
|
|
2511
|
+
p += x;
|
|
2512
2512
|
}
|
|
2513
|
-
const S = Math.max(1, r.fontSize * r.labelGap) * l,
|
|
2513
|
+
const S = Math.max(1, r.fontSize * r.labelGap) * l, m = r.fontSize * l, w = h - r.fontSize * l;
|
|
2514
2514
|
for (const f of [1, -1]) {
|
|
2515
|
+
const v = [];
|
|
2516
|
+
for (const y of b)
|
|
2517
|
+
y.entry.side === f && v.push(y.entry);
|
|
2518
|
+
if (v.length === 0) continue;
|
|
2519
|
+
v.sort((y, T) => y.labelY - T.labelY);
|
|
2515
2520
|
const x = [];
|
|
2516
|
-
for (
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
x.sort((b, T) => b.labelY - T.labelY);
|
|
2520
|
-
const y = [];
|
|
2521
|
-
for (let b = 0; b < x.length; b++)
|
|
2522
|
-
for (y.push({ count: 1, sumIdeal: x[b].labelY, startIdx: b }); y.length >= 2; ) {
|
|
2523
|
-
const T = y[y.length - 2], L = y[y.length - 1], C = T.sumIdeal / T.count, A = L.sumIdeal / L.count, _ = C + (T.count - 1) * S / 2;
|
|
2521
|
+
for (let y = 0; y < v.length; y++)
|
|
2522
|
+
for (x.push({ count: 1, sumIdeal: v[y].labelY, startIdx: y }); x.length >= 2; ) {
|
|
2523
|
+
const T = x[x.length - 2], L = x[x.length - 1], C = T.sumIdeal / T.count, A = L.sumIdeal / L.count, _ = C + (T.count - 1) * S / 2;
|
|
2524
2524
|
if (A - (L.count - 1) * S / 2 >= _ + S) break;
|
|
2525
|
-
T.count += L.count, T.sumIdeal += L.sumIdeal,
|
|
2525
|
+
T.count += L.count, T.sumIdeal += L.sumIdeal, x.pop();
|
|
2526
2526
|
}
|
|
2527
|
-
if (
|
|
2528
|
-
const
|
|
2529
|
-
if (T <
|
|
2530
|
-
for (
|
|
2531
|
-
const L =
|
|
2527
|
+
if (x.length > 0) {
|
|
2528
|
+
const y = x[0], T = y.sumIdeal / y.count - (y.count - 1) * S / 2;
|
|
2529
|
+
if (T < m)
|
|
2530
|
+
for (y.sumIdeal += (m - T) * y.count; x.length >= 2; ) {
|
|
2531
|
+
const L = x[0], C = x[1], A = L.sumIdeal / L.count, _ = C.sumIdeal / C.count, E = A + (L.count - 1) * S / 2;
|
|
2532
2532
|
if (_ - (C.count - 1) * S / 2 >= E + S) break;
|
|
2533
|
-
L.count += C.count, L.sumIdeal += C.sumIdeal,
|
|
2533
|
+
L.count += C.count, L.sumIdeal += C.sumIdeal, x.splice(1, 1);
|
|
2534
2534
|
}
|
|
2535
2535
|
}
|
|
2536
|
-
if (
|
|
2537
|
-
const
|
|
2538
|
-
if (T >
|
|
2539
|
-
for (
|
|
2540
|
-
const L =
|
|
2536
|
+
if (x.length > 0) {
|
|
2537
|
+
const y = x[x.length - 1], T = y.sumIdeal / y.count + (y.count - 1) * S / 2;
|
|
2538
|
+
if (T > w)
|
|
2539
|
+
for (y.sumIdeal -= (T - w) * y.count; x.length >= 2; ) {
|
|
2540
|
+
const L = x[x.length - 2], C = x[x.length - 1], A = L.sumIdeal / L.count, _ = C.sumIdeal / C.count, E = A + (L.count - 1) * S / 2;
|
|
2541
2541
|
if (_ - (C.count - 1) * S / 2 >= E + S) break;
|
|
2542
|
-
L.count += C.count, L.sumIdeal += C.sumIdeal,
|
|
2542
|
+
L.count += C.count, L.sumIdeal += C.sumIdeal, x.pop();
|
|
2543
2543
|
}
|
|
2544
2544
|
}
|
|
2545
|
-
const
|
|
2546
|
-
for (const
|
|
2547
|
-
const T = (
|
|
2548
|
-
T >
|
|
2545
|
+
const I = (m + w) / 2;
|
|
2546
|
+
for (const y of x) {
|
|
2547
|
+
const T = (y.count - 1) * S, L = y.sumIdeal / y.count;
|
|
2548
|
+
T > w - m && L - T / 2 < m && (y.sumIdeal = I * y.count);
|
|
2549
2549
|
}
|
|
2550
|
-
for (const
|
|
2551
|
-
const T =
|
|
2552
|
-
for (let L = 0; L <
|
|
2553
|
-
|
|
2550
|
+
for (const y of x) {
|
|
2551
|
+
const T = y.sumIdeal / y.count;
|
|
2552
|
+
for (let L = 0; L < y.count; L++)
|
|
2553
|
+
v[y.startIdx + L].labelY = T + (L - (y.count - 1) / 2) * S;
|
|
2554
2554
|
}
|
|
2555
2555
|
}
|
|
2556
|
-
for (const f of
|
|
2557
|
-
const
|
|
2558
|
-
let
|
|
2559
|
-
if (Math.abs(
|
|
2560
|
-
const L =
|
|
2561
|
-
|
|
2556
|
+
for (const f of b) {
|
|
2557
|
+
const v = f.entry, x = v.labelY - v.anchorY;
|
|
2558
|
+
let I;
|
|
2559
|
+
if (Math.abs(x) <= c) {
|
|
2560
|
+
const L = v.side * Math.sqrt(Math.max(0, c * c - x * x));
|
|
2561
|
+
I = v.anchorX + L;
|
|
2562
2562
|
} else
|
|
2563
|
-
|
|
2564
|
-
const
|
|
2565
|
-
|
|
2563
|
+
I = (v.anchorX + v.labelX) / 2;
|
|
2564
|
+
const y = Math.min(v.anchorX, v.labelX), T = Math.max(v.anchorX, v.labelX);
|
|
2565
|
+
v.elbowX = Math.max(y, Math.min(T, I)), v.elbowY = v.labelY;
|
|
2566
2566
|
}
|
|
2567
2567
|
return d;
|
|
2568
2568
|
};
|
|
2569
2569
|
function vo(i) {
|
|
2570
|
-
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;
|
|
2570
|
+
return !i.startsWith("#") || i.length < 7 ? !1 : 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;
|
|
2571
2571
|
}
|
|
2572
2572
|
function at(i) {
|
|
2573
|
-
var t, e, n, s, a, r, l, h, d, c, u,
|
|
2574
|
-
const { background: st, name: ee = "Custom", description:
|
|
2573
|
+
var t, e, n, s, a, r, l, h, d, c, u, g, b, p, k, S, m, w, f, v, x, I, y, T, L, C, A, _, E, V, U, j, K, gt;
|
|
2574
|
+
const { background: st, name: ee = "Custom", description: $t, fontUrl: Te = null } = i, ut = vo(st), Ie = ut ? "#d1d4dc" : "#24292f", Ot = ut ? "#787b86" : "#8b949e", Lt = ut ? "#26a69a" : "#2da44e", At = ut ? "#ef5350" : "#cf222e", Re = ut ? "#2962ff" : "#0969da", fe = ut ? "rgba(42,46,57,0.6)" : "rgba(200,200,200,0.5)", Ge = ut ? "rgba(150,150,150,0.5)" : "rgba(170,170,170,0.3)", kn = ut ? Je(st, 0.1) : an(st, 0.05), Ns = ut ? De(st, 0.92) : De(st, 0.95), Xs = ut ? De(Je(st, 0.15), 0.6) : "rgba(200,200,200,0.5)", Us = Ei, Oi = ((e = (t = i.candlestick) == null ? void 0 : t.up) == null ? void 0 : e.body) ?? Lt, Hi = ((s = (n = i.candlestick) == null ? void 0 : n.down) == null ? void 0 : s.body) ?? At, Ni = Zt(Oi), xi = Zt(Hi), je = ((a = i.line) == null ? void 0 : a.color) ?? Re, Sn = ((r = i.tooltip) == null ? void 0 : r.textColor) ?? Ie, Mn = ((l = i.axis) == null ? void 0 : l.textColor) ?? Ot, Gs = ((h = i.typography) == null ? void 0 : h.fontFamily) ?? Us, Cn = ((d = i.typography) == null ? void 0 : d.fontSize) ?? 12, js = i.chartGradient ?? (ut ? [Je(st, 0.04), an(st, 0.06)] : [Je(st, 0.06), st]), Ks = {
|
|
2575
2575
|
background: st,
|
|
2576
2576
|
chartGradient: js,
|
|
2577
2577
|
typography: {
|
|
@@ -2585,28 +2585,28 @@ function at(i) {
|
|
|
2585
2585
|
candlestick: {
|
|
2586
2586
|
up: {
|
|
2587
2587
|
body: Oi,
|
|
2588
|
-
wick: ((
|
|
2588
|
+
wick: ((b = (g = i.candlestick) == null ? void 0 : g.up) == null ? void 0 : b.wick) ?? Ni
|
|
2589
2589
|
},
|
|
2590
2590
|
down: {
|
|
2591
2591
|
body: Hi,
|
|
2592
|
-
wick: ((k = (
|
|
2592
|
+
wick: ((k = (p = i.candlestick) == null ? void 0 : p.down) == null ? void 0 : k.wick) ?? xi
|
|
2593
2593
|
}
|
|
2594
2594
|
},
|
|
2595
2595
|
line: {
|
|
2596
2596
|
color: je,
|
|
2597
2597
|
width: ((S = i.line) == null ? void 0 : S.width) ?? 1,
|
|
2598
|
-
areaTopColor: ((
|
|
2599
|
-
areaBottomColor: ((
|
|
2598
|
+
areaTopColor: ((m = i.line) == null ? void 0 : m.areaTopColor) ?? De(je, 0.08),
|
|
2599
|
+
areaBottomColor: ((w = i.line) == null ? void 0 : w.areaBottomColor) ?? De(je, 0.01)
|
|
2600
2600
|
},
|
|
2601
|
-
seriesColors: i.seriesColors ?? [je,
|
|
2601
|
+
seriesColors: i.seriesColors ?? [je, Lt, At],
|
|
2602
2602
|
bands: {
|
|
2603
2603
|
upper: ((f = i.bands) == null ? void 0 : f.upper) ?? je,
|
|
2604
|
-
lower: ((
|
|
2604
|
+
lower: ((v = i.bands) == null ? void 0 : v.lower) ?? xi
|
|
2605
2605
|
},
|
|
2606
2606
|
crosshair: {
|
|
2607
|
-
color: ((
|
|
2608
|
-
labelBackground: ((
|
|
2609
|
-
labelTextColor: ((
|
|
2607
|
+
color: ((x = i.crosshair) == null ? void 0 : x.color) ?? Ge,
|
|
2608
|
+
labelBackground: ((I = i.crosshair) == null ? void 0 : I.labelBackground) ?? kn,
|
|
2609
|
+
labelTextColor: ((y = i.crosshair) == null ? void 0 : y.labelTextColor) ?? Sn
|
|
2610
2610
|
},
|
|
2611
2611
|
axis: {
|
|
2612
2612
|
fontSize: ((T = i.axis) == null ? void 0 : T.fontSize) ?? 10,
|
|
@@ -2639,40 +2639,40 @@ function at(i) {
|
|
|
2639
2639
|
config: i.navigator
|
|
2640
2640
|
})
|
|
2641
2641
|
};
|
|
2642
|
-
return { name: ee, description:
|
|
2642
|
+
return { name: ee, description: $t, fontUrl: Te, dark: ut, theme: Ks };
|
|
2643
2643
|
}
|
|
2644
2644
|
function bo(i) {
|
|
2645
|
-
var t, e, n, s, a, r, l, h, d, c, u,
|
|
2646
|
-
const { dark: f, bg:
|
|
2645
|
+
var t, e, n, s, a, r, l, h, d, c, u, g, b, p, k, S, m, w;
|
|
2646
|
+
const { dark: f, bg: v, neutralFg: x, upBody: I, downBody: y, upBase: T, downBase: L, config: C } = i, A = (C == null ? void 0 : C.background) ?? "transparent", _ = f ? "rgba(255,255,255,1)" : "rgba(0,0,0,1)", E = ((t = C == null ? void 0 : C.handle) == null ? void 0 : t.color) ?? Ke(_, 0.3), V = ((e = C == null ? void 0 : C.mask) == null ? void 0 : e.fill) ?? Ke(v, f ? 0.78 : 0.82);
|
|
2647
2647
|
return {
|
|
2648
2648
|
height: (C == null ? void 0 : C.height) ?? 48,
|
|
2649
2649
|
background: A,
|
|
2650
|
-
borderColor: (C == null ? void 0 : C.borderColor) ?? Ke(
|
|
2650
|
+
borderColor: (C == null ? void 0 : C.borderColor) ?? Ke(x, f ? 0.18 : 0.22),
|
|
2651
2651
|
line: {
|
|
2652
|
-
color: ((n = C == null ? void 0 : C.line) == null ? void 0 : n.color) ??
|
|
2652
|
+
color: ((n = C == null ? void 0 : C.line) == null ? void 0 : n.color) ?? x,
|
|
2653
2653
|
width: ((s = C == null ? void 0 : C.line) == null ? void 0 : s.width) ?? 1,
|
|
2654
|
-
areaTopColor: ((a = C == null ? void 0 : C.line) == null ? void 0 : a.areaTopColor) ?? Ke(
|
|
2655
|
-
areaBottomColor: ((r = C == null ? void 0 : C.line) == null ? void 0 : r.areaBottomColor) ?? Ke(
|
|
2654
|
+
areaTopColor: ((a = C == null ? void 0 : C.line) == null ? void 0 : a.areaTopColor) ?? Ke(x, f ? 0.22 : 0.18),
|
|
2655
|
+
areaBottomColor: ((r = C == null ? void 0 : C.line) == null ? void 0 : r.areaBottomColor) ?? Ke(x, 0)
|
|
2656
2656
|
},
|
|
2657
2657
|
candlestick: {
|
|
2658
2658
|
up: {
|
|
2659
|
-
body: ((h = (l = C == null ? void 0 : C.candlestick) == null ? void 0 : l.up) == null ? void 0 : h.body) ??
|
|
2659
|
+
body: ((h = (l = C == null ? void 0 : C.candlestick) == null ? void 0 : l.up) == null ? void 0 : h.body) ?? I,
|
|
2660
2660
|
wick: ((c = (d = C == null ? void 0 : C.candlestick) == null ? void 0 : d.up) == null ? void 0 : c.wick) ?? T
|
|
2661
2661
|
},
|
|
2662
2662
|
down: {
|
|
2663
|
-
body: ((
|
|
2664
|
-
wick: ((
|
|
2663
|
+
body: ((g = (u = C == null ? void 0 : C.candlestick) == null ? void 0 : u.down) == null ? void 0 : g.body) ?? y,
|
|
2664
|
+
wick: ((p = (b = C == null ? void 0 : C.candlestick) == null ? void 0 : b.down) == null ? void 0 : p.wick) ?? L
|
|
2665
2665
|
}
|
|
2666
2666
|
},
|
|
2667
2667
|
// Window has no chrome — the unmasked region IS the window.
|
|
2668
2668
|
window: {
|
|
2669
2669
|
fill: ((k = C == null ? void 0 : C.window) == null ? void 0 : k.fill) ?? "transparent",
|
|
2670
2670
|
border: ((S = C == null ? void 0 : C.window) == null ? void 0 : S.border) ?? "transparent",
|
|
2671
|
-
borderWidth: ((
|
|
2671
|
+
borderWidth: ((m = C == null ? void 0 : C.window) == null ? void 0 : m.borderWidth) ?? 0
|
|
2672
2672
|
},
|
|
2673
2673
|
handle: {
|
|
2674
2674
|
color: E,
|
|
2675
|
-
width: ((
|
|
2675
|
+
width: ((w = C == null ? void 0 : C.handle) == null ? void 0 : w.width) ?? 6
|
|
2676
2676
|
},
|
|
2677
2677
|
mask: {
|
|
2678
2678
|
fill: V
|
|
@@ -2680,11 +2680,11 @@ function bo(i) {
|
|
|
2680
2680
|
};
|
|
2681
2681
|
}
|
|
2682
2682
|
function Ke(i, t) {
|
|
2683
|
-
if (i.startsWith("#") && i.length === 7) return
|
|
2683
|
+
if (i.startsWith("#") && i.length === 7) return De(i, t);
|
|
2684
2684
|
const e = i.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);
|
|
2685
2685
|
return e ? `rgba(${e[1]},${e[2]},${e[3]},${t})` : i;
|
|
2686
2686
|
}
|
|
2687
|
-
function
|
|
2687
|
+
function De(i, t) {
|
|
2688
2688
|
const e = parseInt(i.slice(1, 3), 16), n = parseInt(i.slice(3, 5), 16), s = parseInt(i.slice(5, 7), 16);
|
|
2689
2689
|
return `rgba(${e}, ${n}, ${s}, ${t})`;
|
|
2690
2690
|
}
|
|
@@ -2736,13 +2736,13 @@ const Vi = "'JetBrains Mono', 'Fira Code', monospace", Yi = "https://fonts.googl
|
|
|
2736
2736
|
right: { intervals: 3 },
|
|
2737
2737
|
left: { intervals: 0 }
|
|
2738
2738
|
}, Co = 0.1, To = 0.3, Io = 0.4, Ro = 0.5, Lo = 4, Ao = (i, t, e) => ({
|
|
2739
|
-
from:
|
|
2740
|
-
to:
|
|
2739
|
+
from: Mt(i.from, t.from, e),
|
|
2740
|
+
to: Mt(i.to, t.to, e)
|
|
2741
2741
|
}), Wo = (i, t) => i.from === t.from && i.to === t.to;
|
|
2742
|
-
var vt,
|
|
2742
|
+
var vt, Ft, ft;
|
|
2743
2743
|
class _o extends yi {
|
|
2744
2744
|
constructor({ padding: t, reboundMs: e } = {}) {
|
|
2745
|
-
super(), W(this, vt),
|
|
2745
|
+
super(), W(this, vt), R(this, "_yRange", { min: 0, max: 0 }), R(this, "_autoScroll", !0), R(this, "padding"), R(this, "reboundMs"), R(this, "dataInterval", 6e4), W(this, Ft, null), W(this, ft, null), R(this, "_prevDataEnd", null), R(this, "_lastChartWidth", 0), this.padding = {
|
|
2746
2746
|
top: (t == null ? void 0 : t.top) ?? ie.top,
|
|
2747
2747
|
bottom: (t == null ? void 0 : t.bottom) ?? ie.bottom,
|
|
2748
2748
|
right: (t == null ? void 0 : t.right) ?? ie.right,
|
|
@@ -2799,7 +2799,7 @@ class _o extends yi {
|
|
|
2799
2799
|
}
|
|
2800
2800
|
/** First data timestamp registered via {@link setDataStart}, or `null` before any data has arrived. */
|
|
2801
2801
|
get dataStart() {
|
|
2802
|
-
return o(this,
|
|
2802
|
+
return o(this, Ft);
|
|
2803
2803
|
}
|
|
2804
2804
|
/** Last data timestamp registered via {@link setDataEnd}, or `null` before any data has arrived. */
|
|
2805
2805
|
get dataEnd() {
|
|
@@ -2823,7 +2823,7 @@ class _o extends yi {
|
|
|
2823
2823
|
return this.padding;
|
|
2824
2824
|
}
|
|
2825
2825
|
setDataStart(t) {
|
|
2826
|
-
M(this,
|
|
2826
|
+
M(this, Ft, t);
|
|
2827
2827
|
}
|
|
2828
2828
|
setDataEnd(t) {
|
|
2829
2829
|
this._prevDataEnd = o(this, ft), M(this, ft, t);
|
|
@@ -2872,7 +2872,7 @@ class _o extends yi {
|
|
|
2872
2872
|
/** Compute the left/right soft bound for the given pan-time range and chart width.
|
|
2873
2873
|
* Returns null on the side whose data boundary is unset or whose padding resolution fails. */
|
|
2874
2874
|
getSoftBounds(t, e) {
|
|
2875
|
-
const n = (r) => typeof r == "object" || r === 0 || e > 0, s = o(this,
|
|
2875
|
+
const n = (r) => typeof r == "object" || r === 0 || e > 0, s = o(this, Ft) !== null && n(this.padding.left) ? o(this, Ft) - this.resolveHPad(this.padding.left, t, e) : null, a = o(this, ft) !== null && n(this.padding.right) ? o(this, ft) + this.resolveHPad(this.padding.right, t, e) : null;
|
|
2876
2876
|
return { left: s, right: a };
|
|
2877
2877
|
}
|
|
2878
2878
|
/** Minimum visible range (zoom-in ceiling). Expressed as 10 bars. */
|
|
@@ -2893,11 +2893,11 @@ class _o extends yi {
|
|
|
2893
2893
|
* target, not a mid-tween animated position.
|
|
2894
2894
|
*/
|
|
2895
2895
|
dataFitsCurrentViewport(t = 0) {
|
|
2896
|
-
if (o(this,
|
|
2896
|
+
if (o(this, Ft) === null || o(this, ft) === null) return !1;
|
|
2897
2897
|
const { from: e, to: n } = this.logicalRange, s = n - e;
|
|
2898
2898
|
if (s <= 0) return !1;
|
|
2899
2899
|
t > 0 && (this._lastChartWidth = t);
|
|
2900
|
-
const a = t > 0 ? t : this._lastChartWidth, r = this.resolveHPad(this.padding.left, s, a), l = o(this,
|
|
2900
|
+
const a = t > 0 ? t : this._lastChartWidth, r = this.resolveHPad(this.padding.left, s, a), l = o(this, Ft) - r, h = this.dataInterval * 0.5;
|
|
2901
2901
|
return Math.abs(e - l) <= h;
|
|
2902
2902
|
}
|
|
2903
2903
|
/** Maximum visible range (zoom-out floor). When interval-based horizontal padding is
|
|
@@ -2906,8 +2906,8 @@ class _o extends yi {
|
|
|
2906
2906
|
* when padding is purely pixel-based (where width depends on chartWidth, unavailable
|
|
2907
2907
|
* here). Returns null when data bounds are unknown — no hard ceiling in that case. */
|
|
2908
2908
|
softMaxRange() {
|
|
2909
|
-
if (o(this,
|
|
2910
|
-
const t = o(this, ft) - o(this,
|
|
2909
|
+
if (o(this, Ft) === null || o(this, ft) === null) return null;
|
|
2910
|
+
const t = o(this, ft) - o(this, Ft);
|
|
2911
2911
|
if (t <= 0) return null;
|
|
2912
2912
|
const e = typeof this.padding.left == "object" ? this.padding.left.intervals * this.dataInterval : null, n = typeof this.padding.right == "object" ? this.padding.right.intervals * this.dataInterval : null;
|
|
2913
2913
|
return e !== null || n !== null ? t + (e ?? 0) + (n ?? 0) : t + this.dataInterval * 5;
|
|
@@ -2927,12 +2927,20 @@ class _o extends yi {
|
|
|
2927
2927
|
* so callers can lob in a range before the data interval stabilises.
|
|
2928
2928
|
* Validation runs up-front so a rejected call never mutates auto-scroll
|
|
2929
2929
|
* or cancels in-flight animations.
|
|
2930
|
+
*
|
|
2931
|
+
* Idempotent: if the requested range matches the current visible range,
|
|
2932
|
+
* returns without snapping the animator or emitting `change`. Lets two
|
|
2933
|
+
* mutually-syncing charts terminate naturally — without this, each
|
|
2934
|
+
* `setRange` echo retriggers `viewportChange` on the receiver, ping-ponging
|
|
2935
|
+
* forever.
|
|
2930
2936
|
*/
|
|
2931
2937
|
setRange(t) {
|
|
2932
2938
|
const { from: e, to: n } = t;
|
|
2933
2939
|
if (!Number.isFinite(e) || !Number.isFinite(n) || n <= e || (n - e) / this.dataInterval < 2) return;
|
|
2934
|
-
const s =
|
|
2935
|
-
|
|
2940
|
+
const s = this.visibleRange;
|
|
2941
|
+
if (s.from === e && s.to === n) return;
|
|
2942
|
+
const a = o(this, ft) !== null && o(this, ft) >= e && o(this, ft) <= n;
|
|
2943
|
+
this._autoScroll = a, this.applyLogical(e, n);
|
|
2936
2944
|
}
|
|
2937
2945
|
/** Set the Y-axis range. Adds pixel-based padding unless a side has a fixed (explicit) bound. */
|
|
2938
2946
|
setYRange(t, e, n, s = !1, a = !1) {
|
|
@@ -2970,31 +2978,31 @@ class _o extends yi {
|
|
|
2970
2978
|
const { from: a, to: r } = this.logicalRange, l = r - a;
|
|
2971
2979
|
if (l <= 0) return;
|
|
2972
2980
|
const h = this.softMinRange, { left: d, right: c } = this.getSoftBounds(l, n), u = d !== null && c !== null ? c - d : this.softMaxRange();
|
|
2973
|
-
let
|
|
2974
|
-
const
|
|
2981
|
+
let g = e;
|
|
2982
|
+
const b = h * Io;
|
|
2975
2983
|
if (e < 1 && l < h) {
|
|
2976
|
-
const
|
|
2977
|
-
|
|
2984
|
+
const w = h - l, f = (1 - Math.min(1, w / b)) ** 2;
|
|
2985
|
+
g = 1 - (1 - e) * f;
|
|
2978
2986
|
}
|
|
2979
|
-
let
|
|
2980
|
-
|
|
2987
|
+
let p = l * g;
|
|
2988
|
+
p < h - b && (p = h - b), e > 1 && u !== null && p > u && (p = u);
|
|
2981
2989
|
const k = (t - a) / l;
|
|
2982
|
-
let S = t - k *
|
|
2983
|
-
if (e < 1 &&
|
|
2984
|
-
const
|
|
2985
|
-
S +=
|
|
2990
|
+
let S = t - k * p, m = S + p;
|
|
2991
|
+
if (e < 1 && m < r) {
|
|
2992
|
+
const w = r - m;
|
|
2993
|
+
S += w, m += w;
|
|
2986
2994
|
}
|
|
2987
2995
|
if (e > 1) {
|
|
2988
|
-
if (c !== null &&
|
|
2989
|
-
const
|
|
2990
|
-
S -=
|
|
2996
|
+
if (c !== null && m > c) {
|
|
2997
|
+
const w = m - c;
|
|
2998
|
+
S -= w, m -= w;
|
|
2991
2999
|
}
|
|
2992
3000
|
if (d !== null && S < d) {
|
|
2993
|
-
const
|
|
2994
|
-
S +=
|
|
3001
|
+
const w = d - S;
|
|
3002
|
+
S += w, m += w;
|
|
2995
3003
|
}
|
|
2996
3004
|
}
|
|
2997
|
-
s > 0 ? this.retargetLogical(S,
|
|
3005
|
+
s > 0 ? this.retargetLogical(S, m, s) : this.applyLogical(S, m), this.emit("interact");
|
|
2998
3006
|
}
|
|
2999
3007
|
/**
|
|
3000
3008
|
* Shift the visible range by a time delta. Overshooting either data edge
|
|
@@ -3012,23 +3020,23 @@ class _o extends yi {
|
|
|
3012
3020
|
const { left: l, right: h } = this.getSoftBounds(r, e), d = r * To;
|
|
3013
3021
|
let c = t;
|
|
3014
3022
|
if (t > 0 && h !== null) {
|
|
3015
|
-
const
|
|
3016
|
-
|
|
3023
|
+
const p = Math.max(0, a - h);
|
|
3024
|
+
p > 0 && (c *= 1 / (p / d + 1));
|
|
3017
3025
|
} else if (t < 0 && l !== null) {
|
|
3018
|
-
const
|
|
3019
|
-
|
|
3026
|
+
const p = Math.max(0, l - s);
|
|
3027
|
+
p > 0 && (c *= 1 / (p / d + 1));
|
|
3020
3028
|
}
|
|
3021
|
-
let u = s + c,
|
|
3022
|
-
if (h !== null &&
|
|
3023
|
-
const
|
|
3024
|
-
u -=
|
|
3029
|
+
let u = s + c, g = a + c;
|
|
3030
|
+
if (h !== null && g > h + d) {
|
|
3031
|
+
const p = g - (h + d);
|
|
3032
|
+
u -= p, g -= p;
|
|
3025
3033
|
}
|
|
3026
3034
|
if (l !== null && u < l - d) {
|
|
3027
|
-
const
|
|
3028
|
-
u +=
|
|
3035
|
+
const p = l - d - u;
|
|
3036
|
+
u += p, g += p;
|
|
3029
3037
|
}
|
|
3030
|
-
const
|
|
3031
|
-
this._autoScroll =
|
|
3038
|
+
const b = o(this, ft) !== null && o(this, ft) >= u && o(this, ft) <= g;
|
|
3039
|
+
this._autoScroll = b, n > 0 ? this.retargetLogical(u, g, n) : this.applyLogical(u, g), this.emit("interact");
|
|
3032
3040
|
}
|
|
3033
3041
|
/**
|
|
3034
3042
|
* Animate the visible range back into soft bounds after a gesture ends.
|
|
@@ -3047,26 +3055,26 @@ class _o extends yi {
|
|
|
3047
3055
|
l < a && (l = a), r !== null && l > r && (l = r);
|
|
3048
3056
|
let h = e, d = n;
|
|
3049
3057
|
if (l !== s) {
|
|
3050
|
-
const
|
|
3051
|
-
h =
|
|
3058
|
+
const w = (e + n) / 2;
|
|
3059
|
+
h = w - l / 2, d = w + l / 2;
|
|
3052
3060
|
}
|
|
3053
3061
|
const { left: c, right: u } = this.getSoftBounds(l, t);
|
|
3054
3062
|
if (u !== null && d > u) {
|
|
3055
|
-
const
|
|
3056
|
-
h -=
|
|
3063
|
+
const w = d - u;
|
|
3064
|
+
h -= w, d -= w;
|
|
3057
3065
|
}
|
|
3058
3066
|
if (c !== null && h < c) {
|
|
3059
|
-
const
|
|
3060
|
-
h +=
|
|
3067
|
+
const w = c - h;
|
|
3068
|
+
h += w, d += w;
|
|
3061
3069
|
}
|
|
3062
|
-
const
|
|
3063
|
-
if (
|
|
3064
|
-
const
|
|
3065
|
-
let k = null, S = 0,
|
|
3066
|
-
u !== null && n - u >
|
|
3070
|
+
const g = Math.abs(h - e), b = Math.abs(d - n);
|
|
3071
|
+
if (g < 1 && b < 1) return;
|
|
3072
|
+
const p = s * Co;
|
|
3073
|
+
let k = null, S = 0, m = 0;
|
|
3074
|
+
u !== null && n - u > p ? (k = "right", S = n - u, m = u) : c !== null && c - e > p && (k = "left", S = c - e, m = c), this.reboundMs <= 0 ? this.applyLogical(h, d) : this.retargetLogical(h, d, this.reboundMs), this.emit("interact"), k !== null && this.emit("edgeReached", {
|
|
3067
3075
|
side: k,
|
|
3068
3076
|
overshoot: S,
|
|
3069
|
-
boundaryTime:
|
|
3077
|
+
boundaryTime: m
|
|
3070
3078
|
});
|
|
3071
3079
|
}
|
|
3072
3080
|
/**
|
|
@@ -3081,10 +3089,10 @@ class _o extends yi {
|
|
|
3081
3089
|
fitToData(t, e, n = 0, s = !1, a) {
|
|
3082
3090
|
this._autoScroll = !0, n > 0 && (this._lastChartWidth = n);
|
|
3083
3091
|
const r = 400 * this.dataInterval, l = e - t, h = l > 0 ? l : this.dataInterval * 10, d = this.resolveHPad(this.padding.right, h, n), c = this.resolveHPad(this.padding.left, h, n);
|
|
3084
|
-
let u = e + d,
|
|
3085
|
-
u -
|
|
3086
|
-
const { from:
|
|
3087
|
-
s && !(
|
|
3092
|
+
let u = e + d, g = t - c;
|
|
3093
|
+
u - g > r && (u = e + d, g = u - r);
|
|
3094
|
+
const { from: b, to: p } = this.logicalRange;
|
|
3095
|
+
s && !(b === 0 && p === 0) ? this.retargetLogical(g, u, a ?? Si.fit) : this.applyLogical(g, u);
|
|
3088
3096
|
}
|
|
3089
3097
|
/**
|
|
3090
3098
|
* Keep the right edge pinned to the latest data (real-time auto-scroll).
|
|
@@ -3105,8 +3113,8 @@ class _o extends yi {
|
|
|
3105
3113
|
if (a <= 0) return;
|
|
3106
3114
|
const r = this.resolveHPad(this.padding.right, a, e), l = s, h = this._prevDataEnd !== null ? l - this._prevDataEnd : r, d = Math.max(0, Math.min(r, h)), c = t + d, u = c - a;
|
|
3107
3115
|
this._autoScroll = !0;
|
|
3108
|
-
const
|
|
3109
|
-
Math.abs(c - s) <
|
|
3116
|
+
const g = Ro * this.dataInterval, b = e > 0 ? Lo / e * a : g, p = Math.min(g, b);
|
|
3117
|
+
Math.abs(c - s) < p || (this.retargetLogical(u, c, Si.streamTick), this._prevDataEnd = o(this, ft));
|
|
3110
3118
|
}
|
|
3111
3119
|
/** Return the number of data bars (candles/points) currently visible. */
|
|
3112
3120
|
getVisibleBarsCount() {
|
|
@@ -3117,7 +3125,7 @@ class _o extends yi {
|
|
|
3117
3125
|
this.removeAllListeners();
|
|
3118
3126
|
}
|
|
3119
3127
|
}
|
|
3120
|
-
vt = /* @__PURE__ */ new WeakMap(),
|
|
3128
|
+
vt = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap();
|
|
3121
3129
|
function Ae(i, t) {
|
|
3122
3130
|
return i === !1 || i === 0 ? 0 : i === void 0 ? t : i;
|
|
3123
3131
|
}
|
|
@@ -3138,7 +3146,7 @@ function Un(i) {
|
|
|
3138
3146
|
};
|
|
3139
3147
|
return { points: s, viewport: a };
|
|
3140
3148
|
}
|
|
3141
|
-
function
|
|
3149
|
+
function Fo(i) {
|
|
3142
3150
|
if (!i) return { monitor: null, ownsMonitor: !1, showHud: !1 };
|
|
3143
3151
|
if (i === !0) return { monitor: new Ki(), ownsMonitor: !0, showHud: !0 };
|
|
3144
3152
|
if (i instanceof Ki) return { monitor: i, ownsMonitor: !1, showHud: !1 };
|
|
@@ -3149,55 +3157,55 @@ function Bo(i) {
|
|
|
3149
3157
|
showHud: t ?? !s
|
|
3150
3158
|
};
|
|
3151
3159
|
}
|
|
3152
|
-
let
|
|
3153
|
-
var rt,
|
|
3154
|
-
class
|
|
3160
|
+
let Bo = 0;
|
|
3161
|
+
var rt, N, it, It, Pe, O, ot, Qe, wt, yt, mt, re, on, ze, Bt, Ti, Ii, Gt, Ze, be, pi, _i, zt, Xt, ti, ei, nt, le, Gn, Ri, ii, ni, Rs, Ls, Li, si, se, ae, Ve, ai;
|
|
3162
|
+
class Do extends yi {
|
|
3155
3163
|
constructor(t, e) {
|
|
3156
3164
|
var n, s, a, r;
|
|
3157
|
-
super(), W(this, nt), W(this, rt), W(this,
|
|
3165
|
+
super(), W(this, nt), W(this, rt), W(this, N), W(this, it), W(this, It), R(this, "timeScale"), R(this, "yScale"), W(this, Pe), W(this, O, []), W(this, ot), W(this, Qe), W(this, wt, 6e4), W(this, yt, null), W(this, mt, {}), W(this, re, null), W(this, on, !1), W(this, ze, {}), W(this, Bt, { left: "idle", right: "idle" }), W(this, Ti, { left: null, right: null }), W(this, Ii), W(this, Gt, 0), W(this, Ze, !1), W(this, be, !1), W(this, pi, !1), W(this, _i, 0), W(this, zt), W(this, Xt), W(this, ti, !1), W(this, ei, null), W(this, Li, 0), W(this, si, !1), W(this, se, new He({
|
|
3158
3166
|
initial: 0,
|
|
3159
3167
|
duration: en,
|
|
3160
3168
|
easing: Se,
|
|
3161
|
-
lerp: (c, u,
|
|
3169
|
+
lerp: (c, u, g) => c + (u - c) * g
|
|
3162
3170
|
})), W(this, ae, new He({
|
|
3163
3171
|
initial: 0,
|
|
3164
3172
|
duration: en,
|
|
3165
3173
|
easing: Se,
|
|
3166
|
-
lerp: (c, u,
|
|
3167
|
-
})), W(this, Ve, !1), W(this, ai, !1), e != null && e.axis && (M(this, ze, e.axis), M(this, mt, { min: (n = e.axis.y) == null ? void 0 : n.min, max: (s = e.axis.y) == null ? void 0 : s.max })), M(this, ot, (e == null ? void 0 : e.theme) ?? Is.theme), M(this, Qe, ((a = e == null ? void 0 : e.grid) == null ? void 0 : a.visible) !== !1), M(this,
|
|
3168
|
-
const l =
|
|
3169
|
-
M(this, Xt, l.monitor), M(this, ti, l.ownsMonitor), M(this, rt, new ia(t, o(this, Xt) ?? void 0)), M(this,
|
|
3174
|
+
lerp: (c, u, g) => c + (u - c) * g
|
|
3175
|
+
})), W(this, Ve, !1), W(this, ai, !1), e != null && e.axis && (M(this, ze, e.axis), M(this, mt, { min: (n = e.axis.y) == null ? void 0 : n.min, max: (s = e.axis.y) == null ? void 0 : s.max })), M(this, ot, (e == null ? void 0 : e.theme) ?? Is.theme), M(this, Qe, ((a = e == null ? void 0 : e.grid) == null ? void 0 : a.visible) !== !1), M(this, zt, Un(e == null ? void 0 : e.animations)), M(this, Ii, e == null ? void 0 : e.onEdgeReached);
|
|
3176
|
+
const l = Fo(e == null ? void 0 : e.perf);
|
|
3177
|
+
M(this, Xt, l.monitor), M(this, ti, l.ownsMonitor), M(this, rt, new ia(t, o(this, Xt) ?? void 0)), M(this, N, new _o({
|
|
3170
3178
|
padding: e == null ? void 0 : e.padding,
|
|
3171
|
-
reboundMs: o(this,
|
|
3172
|
-
})), xa(this, o(this,
|
|
3179
|
+
reboundMs: o(this, zt).viewport.reboundMs
|
|
3180
|
+
})), xa(this, o(this, N)), this.timeScale = new cs(), this.yScale = new ps();
|
|
3173
3181
|
const h = o(this, Xt);
|
|
3174
3182
|
h ? (M(this, it, new wi((c) => {
|
|
3175
3183
|
h.resetDrawCalls("main");
|
|
3176
3184
|
const u = performance.now();
|
|
3177
3185
|
this.renderMain(c), h.recordFrame("main", performance.now() - u, c);
|
|
3178
|
-
})), M(this,
|
|
3186
|
+
})), M(this, It, new wi((c) => {
|
|
3179
3187
|
h.resetDrawCalls("overlay");
|
|
3180
3188
|
const u = performance.now();
|
|
3181
3189
|
this.renderOverlay(c), h.recordFrame("overlay", performance.now() - u, c);
|
|
3182
|
-
})), l.showHud && M(this, ei, new Ta(t, h))) : (M(this, it, new wi((c) => this.renderMain(c))), M(this,
|
|
3190
|
+
})), l.showHud && M(this, ei, new Ta(t, h))) : (M(this, it, new wi((c) => this.renderMain(c))), M(this, It, new wi((c) => this.renderOverlay(c))));
|
|
3183
3191
|
const d = (e == null ? void 0 : e.interactive) !== !1;
|
|
3184
|
-
M(this,
|
|
3192
|
+
M(this, Pe, d ? new ba(
|
|
3185
3193
|
o(this, rt).canvas,
|
|
3186
|
-
o(this,
|
|
3194
|
+
o(this, N),
|
|
3187
3195
|
this.timeScale,
|
|
3188
3196
|
this.yScale,
|
|
3189
|
-
o(this,
|
|
3190
|
-
) : null), o(this,
|
|
3197
|
+
o(this, zt).viewport.inputResponseMs
|
|
3198
|
+
) : null), o(this, N).on("change", () => {
|
|
3191
3199
|
this.syncScales(), o(this, it).markDirty(), this.emit("viewportChange");
|
|
3192
|
-
}), o(this,
|
|
3200
|
+
}), o(this, N).on("edgeReached", (c) => {
|
|
3193
3201
|
var u;
|
|
3194
3202
|
o(this, Ti)[c.side] = c.boundaryTime, (u = o(this, Ii)) == null || u.call(this, c);
|
|
3195
|
-
}), o(this,
|
|
3203
|
+
}), o(this, N).on("interact", () => {
|
|
3196
3204
|
M(this, ai, !0);
|
|
3197
3205
|
}), o(this, rt).on("resize", () => {
|
|
3198
3206
|
this.updateScales(!0), this.renderMain(), this.emit("viewportChange");
|
|
3199
|
-
}), (r = o(this,
|
|
3200
|
-
M(this,
|
|
3207
|
+
}), (r = o(this, Pe)) == null || r.on("crosshairMove", (c) => {
|
|
3208
|
+
M(this, yt, c), o(this, It).markDirty(), this.emit("crosshairMove", c), B(this, nt, Ls).call(this, c);
|
|
3201
3209
|
});
|
|
3202
3210
|
}
|
|
3203
3211
|
get yAxisWidth() {
|
|
@@ -3225,11 +3233,11 @@ class Po extends yi {
|
|
|
3225
3233
|
up: { ...o(this, ot).candlestick.up },
|
|
3226
3234
|
down: { ...o(this, ot).candlestick.down },
|
|
3227
3235
|
bodyWidthRatio: 0.6,
|
|
3228
|
-
...
|
|
3236
|
+
...B(this, nt, Ri).call(this, "candle"),
|
|
3229
3237
|
...t,
|
|
3230
|
-
...
|
|
3238
|
+
...B(this, nt, ii).call(this)
|
|
3231
3239
|
});
|
|
3232
|
-
return
|
|
3240
|
+
return B(this, nt, ni).call(this, n, n.store, t ?? {});
|
|
3233
3241
|
}
|
|
3234
3242
|
/** Add a line series and return its unique ID. */
|
|
3235
3243
|
addLineSeries(t) {
|
|
@@ -3237,32 +3245,32 @@ class Po extends yi {
|
|
|
3237
3245
|
colors: s === 1 ? [o(this, ot).line.color] : o(this, ot).seriesColors.slice(0, s),
|
|
3238
3246
|
strokeWidth: o(this, ot).line.width,
|
|
3239
3247
|
area: { visible: !0 },
|
|
3240
|
-
...
|
|
3248
|
+
...B(this, nt, Ri).call(this, "line"),
|
|
3241
3249
|
...n,
|
|
3242
|
-
...
|
|
3250
|
+
...B(this, nt, ii).call(this)
|
|
3243
3251
|
});
|
|
3244
|
-
return
|
|
3252
|
+
return B(this, nt, ni).call(this, a, a.store, n);
|
|
3245
3253
|
}
|
|
3246
3254
|
/** Add a bar series and return its unique ID. */
|
|
3247
3255
|
addBarSeries(t) {
|
|
3248
3256
|
const { layers: e, ...n } = t ?? {}, s = e ?? 1, a = new Qa(s, {
|
|
3249
3257
|
colors: o(this, ot).seriesColors.slice(0, s),
|
|
3250
3258
|
barWidthRatio: 0.6,
|
|
3251
|
-
...
|
|
3259
|
+
...B(this, nt, Ri).call(this, "bar"),
|
|
3252
3260
|
...n,
|
|
3253
|
-
...
|
|
3261
|
+
...B(this, nt, ii).call(this)
|
|
3254
3262
|
});
|
|
3255
|
-
return
|
|
3263
|
+
return B(this, nt, ni).call(this, a, a.store, n);
|
|
3256
3264
|
}
|
|
3257
3265
|
/** Add a pie/donut series. Set `innerRadiusRatio > 0` for donut. */
|
|
3258
3266
|
addPieSeries(t) {
|
|
3259
3267
|
const e = new Ci(t);
|
|
3260
|
-
return
|
|
3268
|
+
return B(this, nt, ni).call(this, e, null, t ?? {});
|
|
3261
3269
|
}
|
|
3262
3270
|
/** Remove a series by ID and clean up its resources. */
|
|
3263
3271
|
removeSeries(t) {
|
|
3264
3272
|
const e = o(this, O).findIndex((n) => n.id === t);
|
|
3265
|
-
e >= 0 && (o(this, O)[e].renderer.dispose(), o(this, O).splice(e, 1), M(this, re, null), this.updateViewportPadding(), o(this, it).markDirty(), this.emit("seriesChange"),
|
|
3273
|
+
e >= 0 && (o(this, O)[e].renderer.dispose(), o(this, O).splice(e, 1), M(this, re, null), this.updateViewportPadding(), o(this, it).markDirty(), this.emit("seriesChange"), B(this, nt, le).call(this));
|
|
3266
3274
|
}
|
|
3267
3275
|
/**
|
|
3268
3276
|
* Replace all data for a series.
|
|
@@ -3294,9 +3302,9 @@ class Po extends yi {
|
|
|
3294
3302
|
const n = o(this, O).find((d) => d.id === t);
|
|
3295
3303
|
if (!n) return;
|
|
3296
3304
|
const s = n.label, a = n.renderer.getLayerColors().slice();
|
|
3297
|
-
n.renderer.updateOptions({ ...e, ...
|
|
3305
|
+
n.renderer.updateOptions({ ...e, ...B(this, nt, ii).call(this) }), "label" in e && typeof e.label == "string" && (n.label = e.label), o(this, it).markDirty();
|
|
3298
3306
|
const r = n.renderer.getLayerColors(), l = a.length !== r.length || a.some((d, c) => d !== r[c]), h = s !== n.label;
|
|
3299
|
-
(l || h) &&
|
|
3307
|
+
(l || h) && B(this, nt, le).call(this);
|
|
3300
3308
|
}
|
|
3301
3309
|
/**
|
|
3302
3310
|
* Batch multiple updates: suppress recomputes until `fn` returns. Exceptions
|
|
@@ -3314,7 +3322,7 @@ class Po extends yi {
|
|
|
3314
3322
|
setSeriesVisible(t, e) {
|
|
3315
3323
|
const n = o(this, O).find((s) => s.id === t);
|
|
3316
3324
|
if (!(!n || n.visible === e)) {
|
|
3317
|
-
if (n.visible = e,
|
|
3325
|
+
if (n.visible = e, B(this, nt, le).call(this), o(this, Gt) > 0) {
|
|
3318
3326
|
M(this, be, !0);
|
|
3319
3327
|
return;
|
|
3320
3328
|
}
|
|
@@ -3329,7 +3337,7 @@ class Po extends yi {
|
|
|
3329
3337
|
setLayerVisible(t, e, n) {
|
|
3330
3338
|
const s = o(this, O).find((a) => a.id === t);
|
|
3331
3339
|
if (s && !(s.renderer.getLayerCount() <= 1) && s.renderer.isLayerVisible(e) !== n) {
|
|
3332
|
-
if (s.renderer.setLayerVisible(e, n),
|
|
3340
|
+
if (s.renderer.setLayerVisible(e, n), B(this, nt, le).call(this), o(this, Gt) > 0) {
|
|
3333
3341
|
M(this, be, !0);
|
|
3334
3342
|
return;
|
|
3335
3343
|
}
|
|
@@ -3345,10 +3353,10 @@ class Po extends yi {
|
|
|
3345
3353
|
const { first: t, last: e } = this.getDataBounds();
|
|
3346
3354
|
if (t === void 0 || e === void 0) return;
|
|
3347
3355
|
const n = o(this, rt).size.media.width - this.yAxisWidth;
|
|
3348
|
-
o(this,
|
|
3356
|
+
o(this, N).fitToData(t, e, n, !0);
|
|
3349
3357
|
}
|
|
3350
3358
|
getVisibleRange() {
|
|
3351
|
-
return o(this,
|
|
3359
|
+
return o(this, N).visibleRange;
|
|
3352
3360
|
}
|
|
3353
3361
|
/**
|
|
3354
3362
|
* Return the full span of registered data, or `null` before any data has
|
|
@@ -3356,7 +3364,7 @@ class Po extends yi {
|
|
|
3356
3364
|
* tracking and is cheaper than recomputing from series stores.
|
|
3357
3365
|
*/
|
|
3358
3366
|
getDataRange() {
|
|
3359
|
-
const t = o(this,
|
|
3367
|
+
const t = o(this, N).dataStart, e = o(this, N).dataEnd;
|
|
3360
3368
|
return t === null || e === null ? null : { from: t, to: e };
|
|
3361
3369
|
}
|
|
3362
3370
|
/**
|
|
@@ -3379,17 +3387,65 @@ class Po extends yi {
|
|
|
3379
3387
|
if (!Number.isInteger(t) || t < 2) return;
|
|
3380
3388
|
const { first: e, last: n } = this.getDataBounds();
|
|
3381
3389
|
if (e === void 0 || n === void 0) return;
|
|
3382
|
-
const s = Math.max(e, n - (t - 1) * o(this,
|
|
3383
|
-
o(this,
|
|
3390
|
+
const s = Math.max(e, n - (t - 1) * o(this, wt)), a = o(this, rt).size.media.width - this.yAxisWidth;
|
|
3391
|
+
o(this, N).fitToData(s, n, a, !1);
|
|
3384
3392
|
return;
|
|
3385
3393
|
}
|
|
3386
|
-
o(this,
|
|
3394
|
+
o(this, N).setRange(t);
|
|
3387
3395
|
}
|
|
3388
3396
|
getYRange() {
|
|
3389
|
-
return o(this,
|
|
3397
|
+
return o(this, N).yRange;
|
|
3390
3398
|
}
|
|
3391
3399
|
getCrosshairPosition() {
|
|
3392
|
-
return o(this,
|
|
3400
|
+
return o(this, yt);
|
|
3401
|
+
}
|
|
3402
|
+
/**
|
|
3403
|
+
* Programmatically set or clear the crosshair. Same effect as the user
|
|
3404
|
+
* hovering over `(timeToX(time), valueToY(y))` — emits `crosshairMove`,
|
|
3405
|
+
* marks the overlay layer dirty, and lets `<Crosshair>` / `<Tooltip>`
|
|
3406
|
+
* react via their normal store subscriptions.
|
|
3407
|
+
*
|
|
3408
|
+
* Pass `null` to clear (mirrors the pointer-leave path).
|
|
3409
|
+
*
|
|
3410
|
+
* `y` is optional. Resolution order when omitted:
|
|
3411
|
+
* 1. **current crosshair's y** — preserves whatever the chart already
|
|
3412
|
+
* has (real cursor y, or a previously-synthesised value). This is
|
|
3413
|
+
* what makes the cross-chart broadcast pattern work: when an echo
|
|
3414
|
+
* arrives at the chart that originated the hover, the existing y
|
|
3415
|
+
* stays in place and the idempotency check below short-circuits the
|
|
3416
|
+
* loop. Without preservation, the echo would overwrite the source's
|
|
3417
|
+
* real cursor y with the midpoint default and the tooltip would
|
|
3418
|
+
* jitter between cursor and midpoint every mouse-move.
|
|
3419
|
+
* 2. **midpoint of the current Y range** — fallback when there is no
|
|
3420
|
+
* current crosshair (first programmatic set on a chart that hasn't
|
|
3421
|
+
* been hovered yet).
|
|
3422
|
+
*
|
|
3423
|
+
* Idempotent: a call that produces the same `(time, y)` pair as the
|
|
3424
|
+
* current crosshair is a no-op (no emit). Combined with the y-preservation
|
|
3425
|
+
* above, this lets N charts broadcast their hover to each other without
|
|
3426
|
+
* a feedback-loop guard.
|
|
3427
|
+
*/
|
|
3428
|
+
setCrosshair(t) {
|
|
3429
|
+
if (t === null) {
|
|
3430
|
+
if (o(this, yt) === null) return;
|
|
3431
|
+
M(this, yt, null), o(this, It).markDirty(), this.emit("crosshairMove", null);
|
|
3432
|
+
return;
|
|
3433
|
+
}
|
|
3434
|
+
const { time: e } = t;
|
|
3435
|
+
if (!Number.isFinite(e)) return;
|
|
3436
|
+
const n = o(this, yt);
|
|
3437
|
+
let s;
|
|
3438
|
+
if (t.y !== void 0)
|
|
3439
|
+
s = t.y;
|
|
3440
|
+
else if (n !== null)
|
|
3441
|
+
s = n.y;
|
|
3442
|
+
else {
|
|
3443
|
+
const l = o(this, N).yRange;
|
|
3444
|
+
s = (l.min + l.max) / 2;
|
|
3445
|
+
}
|
|
3446
|
+
if (!Number.isFinite(s) || n !== null && n.time === e && n.y === s) return;
|
|
3447
|
+
const a = this.timeScale.timeToX(e), r = this.yScale.valueToY(s);
|
|
3448
|
+
M(this, yt, { mediaX: a, mediaY: r, time: e, y: s }), o(this, It).markDirty(), this.emit("crosshairMove", o(this, yt));
|
|
3393
3449
|
}
|
|
3394
3450
|
/** Get the last visible value and whether the absolute last point is on screen. */
|
|
3395
3451
|
getLastValue(t) {
|
|
@@ -3397,7 +3453,7 @@ class Po extends yi {
|
|
|
3397
3453
|
if (!(e != null && e.store)) return null;
|
|
3398
3454
|
const n = e.store.last();
|
|
3399
3455
|
if (!n) return null;
|
|
3400
|
-
const s = (h) => "close" in h ? h.close : h.value, { from: a, to: r } = o(this,
|
|
3456
|
+
const s = (h) => "close" in h ? h.close : h.value, { from: a, to: r } = o(this, N).visibleRange;
|
|
3401
3457
|
if (n.time >= a && n.time <= r)
|
|
3402
3458
|
return { value: s(n), isLive: !0 };
|
|
3403
3459
|
const l = e.store.getVisibleData(a, r);
|
|
@@ -3420,7 +3476,7 @@ class Po extends yi {
|
|
|
3420
3476
|
getDataAtTime(t, e) {
|
|
3421
3477
|
var n, s;
|
|
3422
3478
|
const a = o(this, O).find((r) => r.id === t);
|
|
3423
|
-
return a ? ((s = (n = a.renderer).getDataAtTime) == null ? void 0 : s.call(n, e, o(this,
|
|
3479
|
+
return a ? ((s = (n = a.renderer).getDataAtTime) == null ? void 0 : s.call(n, e, o(this, wt))) ?? null : null;
|
|
3424
3480
|
}
|
|
3425
3481
|
/**
|
|
3426
3482
|
* Get all layers' data at a given time for multi-layer series (Bar/Line
|
|
@@ -3431,7 +3487,7 @@ class Po extends yi {
|
|
|
3431
3487
|
getLayerSnapshots(t, e) {
|
|
3432
3488
|
var n, s;
|
|
3433
3489
|
const a = o(this, O).find((r) => r.id === t);
|
|
3434
|
-
return a != null && a.visible ? ((s = (n = a.renderer).getLayerSnapshots) == null ? void 0 : s.call(n, e, o(this,
|
|
3490
|
+
return a != null && a.visible ? ((s = (n = a.renderer).getLayerSnapshots) == null ? void 0 : s.call(n, e, o(this, wt))) ?? null : null;
|
|
3435
3491
|
}
|
|
3436
3492
|
getSeriesIds() {
|
|
3437
3493
|
return o(this, re) || M(this, re, o(this, O).map((t) => t.id)), o(this, re).slice();
|
|
@@ -3545,7 +3601,7 @@ class Po extends yi {
|
|
|
3545
3601
|
M(this, ot, t);
|
|
3546
3602
|
for (const n of o(this, O))
|
|
3547
3603
|
n.renderer.applyTheme(t, e);
|
|
3548
|
-
o(this, it).markDirty(),
|
|
3604
|
+
o(this, it).markDirty(), B(this, nt, le).call(this);
|
|
3549
3605
|
}
|
|
3550
3606
|
getTheme() {
|
|
3551
3607
|
return o(this, ot);
|
|
@@ -3584,7 +3640,7 @@ class Po extends yi {
|
|
|
3584
3640
|
};
|
|
3585
3641
|
}
|
|
3586
3642
|
getDataInterval() {
|
|
3587
|
-
return o(this,
|
|
3643
|
+
return o(this, wt);
|
|
3588
3644
|
}
|
|
3589
3645
|
/**
|
|
3590
3646
|
* Update viewport padding at runtime. Refits the visible time range to
|
|
@@ -3615,7 +3671,7 @@ class Po extends yi {
|
|
|
3615
3671
|
setAnimations(t) {
|
|
3616
3672
|
var e, n, s;
|
|
3617
3673
|
const a = Un(t);
|
|
3618
|
-
M(this,
|
|
3674
|
+
M(this, zt, a), o(this, N).setReboundMs(a.viewport.reboundMs), (e = o(this, Pe)) == null || e.setInputResponseMs(a.viewport.inputResponseMs);
|
|
3619
3675
|
const r = {};
|
|
3620
3676
|
if (a.points.enterMs === 0 && (r.entryMs = 0), a.points.smoothMs === 0 && (r.smoothMs = 0), a.points.pulseMs === 0 && (r.pulseMs = 0), Object.keys(r).length > 0)
|
|
3621
3677
|
for (const l of o(this, O))
|
|
@@ -3623,14 +3679,14 @@ class Po extends yi {
|
|
|
3623
3679
|
o(this, it).markDirty();
|
|
3624
3680
|
}
|
|
3625
3681
|
setPadding(t) {
|
|
3626
|
-
const e = o(this,
|
|
3627
|
-
o(this,
|
|
3628
|
-
const n = o(this,
|
|
3682
|
+
const e = o(this, N).getPadding();
|
|
3683
|
+
o(this, N).setPadding(t);
|
|
3684
|
+
const n = o(this, N).getPadding(), s = !jn(e.left, n.left) || !jn(e.right, n.right), a = e.top !== n.top || e.bottom !== n.bottom;
|
|
3629
3685
|
if (s) {
|
|
3630
3686
|
const { first: r, last: l } = this.getDataBounds();
|
|
3631
3687
|
if (r !== void 0 && l !== void 0) {
|
|
3632
3688
|
const h = o(this, rt).size.media.width - this.yAxisWidth;
|
|
3633
|
-
o(this,
|
|
3689
|
+
o(this, N).fitToData(r, l, h, !1);
|
|
3634
3690
|
}
|
|
3635
3691
|
}
|
|
3636
3692
|
a && this.updateYRange(!0), this.syncScales(), o(this, it).markDirty(), a && this.emit("viewportChange");
|
|
@@ -3649,11 +3705,11 @@ class Po extends yi {
|
|
|
3649
3705
|
* symmetry and currently renders identically to `idle`.
|
|
3650
3706
|
*/
|
|
3651
3707
|
setEdgeState(t, e) {
|
|
3652
|
-
o(this,
|
|
3708
|
+
o(this, Bt)[t] !== e && (o(this, Bt)[t] = e, o(this, It).markDirty());
|
|
3653
3709
|
}
|
|
3654
3710
|
/** Read the current host-declared state for a given edge. */
|
|
3655
3711
|
getEdgeState(t) {
|
|
3656
|
-
return o(this,
|
|
3712
|
+
return o(this, Bt)[t];
|
|
3657
3713
|
}
|
|
3658
3714
|
/** Notify chart that a YLabel is present (affects right padding). */
|
|
3659
3715
|
setYLabel(t) {
|
|
@@ -3665,7 +3721,7 @@ class Po extends yi {
|
|
|
3665
3721
|
destroy() {
|
|
3666
3722
|
var t, e, n;
|
|
3667
3723
|
for (const s of o(this, O)) s.renderer.dispose();
|
|
3668
|
-
M(this, O, []), M(this, re, null), o(this,
|
|
3724
|
+
M(this, O, []), M(this, re, null), o(this, N).destroy(), o(this, it).destroy(), o(this, It).destroy(), (t = o(this, Pe)) == null || t.destroy(), o(this, rt).destroy(), (e = o(this, ei)) == null || e.destroy(), M(this, ei, null), o(this, ti) && ((n = o(this, Xt)) == null || n.destroy()), M(this, Xt, null), M(this, ti, !1), this.removeAllListeners();
|
|
3669
3725
|
}
|
|
3670
3726
|
/** The attached performance monitor, or `null` when instrumentation is disabled. */
|
|
3671
3727
|
getPerfMonitor() {
|
|
@@ -3688,17 +3744,17 @@ class Po extends yi {
|
|
|
3688
3744
|
}
|
|
3689
3745
|
this.updateDataInterval();
|
|
3690
3746
|
const { first: t, last: e } = this.getDataBounds();
|
|
3691
|
-
t !== void 0 && o(this,
|
|
3747
|
+
t !== void 0 && o(this, N).setDataStart(t), e !== void 0 && o(this, N).setDataEnd(e);
|
|
3692
3748
|
let n = 0;
|
|
3693
3749
|
for (const r of o(this, O))
|
|
3694
3750
|
r.renderer.getTotalLength ? n += r.renderer.getTotalLength() : r.store && (n += r.store.length);
|
|
3695
3751
|
const s = n - o(this, Li) > 5;
|
|
3696
3752
|
if (M(this, Li, n), t !== void 0 && e !== void 0) {
|
|
3697
|
-
const { from: r, to: l } = o(this,
|
|
3698
|
-
h ? o(this,
|
|
3753
|
+
const { from: r, to: l } = o(this, N).logicalRange, h = r === 0 && l === 0, d = o(this, rt).size.media.width - this.yAxisWidth;
|
|
3754
|
+
h ? o(this, N).fitToData(t, e, d, !1) : s && o(this, N).autoScroll ? o(this, N).fitToData(t, e, d, !0) : !s && o(this, N).autoScroll && (o(this, N).dataFitsCurrentViewport(d) ? o(this, N).fitToData(t, e, d, !0, Si.streamTick) : o(this, N).scrollToEnd(e, d));
|
|
3699
3755
|
}
|
|
3700
3756
|
const a = o(this, si);
|
|
3701
|
-
M(this, si, !1), this.updateYRange(s || a), this.syncScales(), o(this, it).markDirty(), this.emit("dataUpdate"),
|
|
3757
|
+
M(this, si, !1), this.updateYRange(s || a), this.syncScales(), o(this, it).markDirty(), this.emit("dataUpdate"), B(this, nt, le).call(this);
|
|
3702
3758
|
}
|
|
3703
3759
|
updateDataInterval() {
|
|
3704
3760
|
for (const t of o(this, O)) {
|
|
@@ -3706,7 +3762,7 @@ class Po extends yi {
|
|
|
3706
3762
|
const e = t.store.getAll();
|
|
3707
3763
|
if (e.length >= 2) {
|
|
3708
3764
|
const n = e.slice(0, 20).map((s) => s.time);
|
|
3709
|
-
M(this,
|
|
3765
|
+
M(this, wt, _a(n)), o(this, N).setDataInterval(o(this, wt));
|
|
3710
3766
|
break;
|
|
3711
3767
|
}
|
|
3712
3768
|
}
|
|
@@ -3746,28 +3802,28 @@ class Po extends yi {
|
|
|
3746
3802
|
return n === 1 / 0 || s === -1 / 0 ? null : { min: n, max: s };
|
|
3747
3803
|
}
|
|
3748
3804
|
updateYRange(t = !1, e) {
|
|
3749
|
-
const n = o(this,
|
|
3805
|
+
const n = o(this, N).logicalRange, s = o(this, mt).min !== void 0 && o(this, mt).min !== "auto" && typeof o(this, mt).min != "number" || o(this, mt).max !== void 0 && o(this, mt).max !== "auto" && typeof o(this, mt).max != "number" ? [] : null, a = this.computeTargetYRange(n, s);
|
|
3750
3806
|
if (a === null) {
|
|
3751
3807
|
M(this, Ve, !1);
|
|
3752
3808
|
return;
|
|
3753
3809
|
}
|
|
3754
|
-
const r = this.resolveBound(o(this, mt).min, a.min, a.max, s ?? [], "min"), l = this.resolveBound(o(this, mt).max, a.max, a.min, s ?? [], "max"), h = o(this,
|
|
3810
|
+
const r = this.resolveBound(o(this, mt).min, a.min, a.max, s ?? [], "min"), l = this.resolveBound(o(this, mt).max, a.max, a.min, s ?? [], "max"), h = o(this, zt).viewport.yAxisMs, d = o(this, ai);
|
|
3755
3811
|
M(this, ai, !1);
|
|
3756
3812
|
const c = d && h > Rn ? Rn : h;
|
|
3757
3813
|
if (!o(this, Ve) || t || c <= 0)
|
|
3758
3814
|
o(this, se).snap(r), o(this, ae).snap(l), M(this, Ve, !0);
|
|
3759
3815
|
else {
|
|
3760
|
-
const
|
|
3761
|
-
r < o(this, se).current && !
|
|
3816
|
+
const m = o(this, zt).points.enterMs > 0;
|
|
3817
|
+
r < o(this, se).current && !m ? o(this, se).snap(r) : o(this, se).setTarget(r, { duration: c, now: e }), l > o(this, ae).current && !m ? o(this, ae).snap(l) : o(this, ae).setTarget(l, { duration: c, now: e });
|
|
3762
3818
|
}
|
|
3763
|
-
const u = e ?? performance.now(),
|
|
3764
|
-
(
|
|
3765
|
-
const
|
|
3766
|
-
o(this,
|
|
3819
|
+
const u = e ?? performance.now(), g = o(this, se).tick(u), b = o(this, ae).tick(u);
|
|
3820
|
+
(g || b) && o(this, it).markDirty();
|
|
3821
|
+
const p = o(this, mt).min !== void 0 && o(this, mt).min !== "auto", k = o(this, mt).max !== void 0 && o(this, mt).max !== "auto", S = o(this, rt).size.media.height - this.xAxisHeight;
|
|
3822
|
+
o(this, N).setYRange(
|
|
3767
3823
|
o(this, se).current,
|
|
3768
3824
|
o(this, ae).current,
|
|
3769
3825
|
S,
|
|
3770
|
-
|
|
3826
|
+
p,
|
|
3771
3827
|
k
|
|
3772
3828
|
);
|
|
3773
3829
|
}
|
|
@@ -3792,38 +3848,38 @@ class Po extends yi {
|
|
|
3792
3848
|
const t = o(this, rt).size;
|
|
3793
3849
|
if (t.media.width === 0 || t.media.height === 0) return;
|
|
3794
3850
|
const e = t.media.width - this.yAxisWidth, n = t.media.height - this.xAxisHeight;
|
|
3795
|
-
this.timeScale.update(o(this,
|
|
3851
|
+
this.timeScale.update(o(this, N).visibleRange, e, t.horizontalPixelRatio, o(this, wt)), this.yScale.update(o(this, N).yRange, n, t.verticalPixelRatio);
|
|
3796
3852
|
}
|
|
3797
3853
|
updateScales(t = !1, e) {
|
|
3798
3854
|
const n = o(this, rt).size;
|
|
3799
3855
|
if (n.media.width === 0 || n.media.height === 0) return;
|
|
3800
3856
|
const s = n.media.width - this.yAxisWidth, a = n.media.height - this.xAxisHeight;
|
|
3801
|
-
this.timeScale.update(o(this,
|
|
3857
|
+
this.timeScale.update(o(this, N).visibleRange, s, n.horizontalPixelRatio, o(this, wt)), this.yScale.update(o(this, N).yRange, a, n.verticalPixelRatio), this.updateYRange(t, e), this.yScale.update(o(this, N).yRange, a, n.verticalPixelRatio);
|
|
3802
3858
|
}
|
|
3803
3859
|
/** Expensive: background, grid, all series. Only on data/viewport/resize change. */
|
|
3804
3860
|
renderMain(t) {
|
|
3805
3861
|
const e = o(this, rt).size;
|
|
3806
3862
|
if (e.media.width === 0 || e.media.height === 0) return;
|
|
3807
3863
|
const n = typeof t == "number" ? t : performance.now();
|
|
3808
|
-
o(this,
|
|
3864
|
+
o(this, N).tick(n) && o(this, it).markDirty(), this.updateScales(!1, n), o(this, rt).useMainLayer((s) => {
|
|
3809
3865
|
const { context: a, bitmapSize: r } = s, l = (e.media.width - this.yAxisWidth) * e.horizontalPixelRatio, h = (e.media.height - this.xAxisHeight) * e.verticalPixelRatio;
|
|
3810
|
-
a.clearRect(0, 0, r.width, r.height), a.save(), a.beginPath(), a.rect(0, 0, l, h), a.clip(), o(this, Qe) && fa(s, this.timeScale, this.yScale, o(this, ot), o(this,
|
|
3811
|
-
const d = o(this,
|
|
3812
|
-
for (const
|
|
3813
|
-
if (!
|
|
3814
|
-
const
|
|
3866
|
+
a.clearRect(0, 0, r.width, r.height), a.save(), a.beginPath(), a.rect(0, 0, l, h), a.clip(), o(this, Qe) && fa(s, this.timeScale, this.yScale, o(this, ot), o(this, wt));
|
|
3867
|
+
const d = o(this, N).getPadding(), c = { top: d.top, bottom: d.bottom }, u = o(this, Xt);
|
|
3868
|
+
for (const g of o(this, O)) {
|
|
3869
|
+
if (!g.visible) continue;
|
|
3870
|
+
const b = {
|
|
3815
3871
|
scope: s,
|
|
3816
3872
|
timeScale: this.timeScale,
|
|
3817
3873
|
yScale: this.yScale,
|
|
3818
3874
|
theme: o(this, ot),
|
|
3819
|
-
dataInterval: o(this,
|
|
3875
|
+
dataInterval: o(this, wt),
|
|
3820
3876
|
padding: c
|
|
3821
3877
|
};
|
|
3822
3878
|
if (u) {
|
|
3823
|
-
const
|
|
3824
|
-
|
|
3879
|
+
const p = performance.now();
|
|
3880
|
+
g.renderer.render(b), u.recordSeries(g.id, performance.now() - p, n);
|
|
3825
3881
|
} else
|
|
3826
|
-
|
|
3882
|
+
g.renderer.render(b);
|
|
3827
3883
|
}
|
|
3828
3884
|
a.restore();
|
|
3829
3885
|
});
|
|
@@ -3845,25 +3901,25 @@ class Po extends yi {
|
|
|
3845
3901
|
a = !0;
|
|
3846
3902
|
break;
|
|
3847
3903
|
}
|
|
3848
|
-
const r = o(this,
|
|
3904
|
+
const r = o(this, Bt).left === "loading" || o(this, Bt).right === "loading", l = o(this, Bt).left !== "idle" || o(this, Bt).right !== "idle";
|
|
3849
3905
|
if (o(this, rt).useOverlayLayer((h) => {
|
|
3850
3906
|
var d, c;
|
|
3851
|
-
if (!o(this,
|
|
3852
|
-
const u = (s.media.width - this.yAxisWidth) * s.horizontalPixelRatio,
|
|
3853
|
-
if (h.context.save(), h.context.beginPath(), h.context.rect(0, 0, u,
|
|
3854
|
-
const k = o(this,
|
|
3907
|
+
if (!o(this, yt) && !a && !l) return;
|
|
3908
|
+
const u = (s.media.width - this.yAxisWidth) * s.horizontalPixelRatio, g = (s.media.height - this.xAxisHeight) * s.verticalPixelRatio;
|
|
3909
|
+
if (h.context.save(), h.context.beginPath(), h.context.rect(0, 0, u, g), h.context.clip(), o(this, yt) && B(this, nt, Rs).call(this)) {
|
|
3910
|
+
const k = o(this, yt).mediaX * s.horizontalPixelRatio, S = o(this, yt).mediaY * s.verticalPixelRatio;
|
|
3855
3911
|
na(h, k, S, o(this, ot));
|
|
3856
3912
|
}
|
|
3857
|
-
const
|
|
3913
|
+
const b = o(this, N).getPadding(), p = { top: b.top, bottom: b.bottom };
|
|
3858
3914
|
for (const k of o(this, O))
|
|
3859
3915
|
k.visible && ((c = (d = k.renderer).drawOverlay) == null || c.call(d, {
|
|
3860
3916
|
scope: h,
|
|
3861
3917
|
timeScale: this.timeScale,
|
|
3862
3918
|
yScale: this.yScale,
|
|
3863
3919
|
theme: o(this, ot),
|
|
3864
|
-
dataInterval: o(this,
|
|
3865
|
-
padding:
|
|
3866
|
-
crosshair: o(this,
|
|
3920
|
+
dataInterval: o(this, wt),
|
|
3921
|
+
padding: p,
|
|
3922
|
+
crosshair: o(this, yt)
|
|
3867
3923
|
}));
|
|
3868
3924
|
l && this.drawEdgeIndicators(h, s.media.height - this.xAxisHeight), h.context.restore();
|
|
3869
3925
|
}), a) {
|
|
@@ -3874,14 +3930,14 @@ class Po extends yi {
|
|
|
3874
3930
|
c = !0;
|
|
3875
3931
|
break;
|
|
3876
3932
|
}
|
|
3877
|
-
c && o(this,
|
|
3933
|
+
c && o(this, It).markDirty();
|
|
3878
3934
|
}
|
|
3879
|
-
r && o(this,
|
|
3935
|
+
r && o(this, It).markDirty();
|
|
3880
3936
|
}
|
|
3881
3937
|
drawEdgeIndicators(t, e) {
|
|
3882
3938
|
const n = performance.now();
|
|
3883
3939
|
for (const s of ["left", "right"]) {
|
|
3884
|
-
const a = o(this,
|
|
3940
|
+
const a = o(this, Bt)[s];
|
|
3885
3941
|
if (a === "idle" || a === "has-more") continue;
|
|
3886
3942
|
const r = this.resolveEdgeBoundary(s);
|
|
3887
3943
|
r !== null && ca({
|
|
@@ -3910,7 +3966,7 @@ class Po extends yi {
|
|
|
3910
3966
|
return t === "left" ? n ?? null : s ?? null;
|
|
3911
3967
|
}
|
|
3912
3968
|
}
|
|
3913
|
-
rt = /* @__PURE__ */ new WeakMap(),
|
|
3969
|
+
rt = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap(), wt = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), on = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap(), Bt = /* @__PURE__ */ new WeakMap(), Ti = /* @__PURE__ */ new WeakMap(), Ii = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakMap(), Ze = /* @__PURE__ */ new WeakMap(), be = /* @__PURE__ */ new WeakMap(), pi = /* @__PURE__ */ new WeakMap(), _i = /* @__PURE__ */ new WeakMap(), zt = /* @__PURE__ */ new WeakMap(), Xt = /* @__PURE__ */ new WeakMap(), ti = /* @__PURE__ */ new WeakMap(), ei = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakSet(), /**
|
|
3914
3970
|
* Bump overlay version + emit `overlayChange`. Call from every mutation
|
|
3915
3971
|
* path whose output overlay components care about: data, series list,
|
|
3916
3972
|
* per-series/layer visibility, options, theme.
|
|
@@ -3938,7 +3994,7 @@ Gn = function(i) {
|
|
|
3938
3994
|
return i;
|
|
3939
3995
|
let t;
|
|
3940
3996
|
do
|
|
3941
|
-
t = `series_${++
|
|
3997
|
+
t = `series_${++Bo}`;
|
|
3942
3998
|
while (o(this, O).some((e) => e.id === t));
|
|
3943
3999
|
return t;
|
|
3944
4000
|
}, /**
|
|
@@ -3952,7 +4008,7 @@ Gn = function(i) {
|
|
|
3952
4008
|
* the user's options for the disable paths.
|
|
3953
4009
|
*/
|
|
3954
4010
|
Ri = function(i) {
|
|
3955
|
-
const { enterMs: t, smoothMs: e, pulseMs: n } = o(this,
|
|
4011
|
+
const { enterMs: t, smoothMs: e, pulseMs: n } = o(this, zt).points;
|
|
3956
4012
|
return i === "line" ? { enterMs: t, smoothMs: e, pulseMs: n } : { enterMs: t, smoothMs: e };
|
|
3957
4013
|
}, /**
|
|
3958
4014
|
* Chart-level animation overrides — these *win over* any per-series value
|
|
@@ -3961,7 +4017,7 @@ Ri = function(i) {
|
|
|
3961
4017
|
* `addXSeries` wrappers.
|
|
3962
4018
|
*/
|
|
3963
4019
|
ii = function() {
|
|
3964
|
-
const { enterMs: i, smoothMs: t, pulseMs: e } = o(this,
|
|
4020
|
+
const { enterMs: i, smoothMs: t, pulseMs: e } = o(this, zt).points, n = {};
|
|
3965
4021
|
return i === 0 && (n.enterMs = 0), t === 0 && (n.smoothMs = 0), e === 0 && (n.pulseMs = 0), n;
|
|
3966
4022
|
}, /**
|
|
3967
4023
|
* Shared registration boilerplate for every renderer: assign an id, hook
|
|
@@ -3971,8 +4027,8 @@ ii = function() {
|
|
|
3971
4027
|
*/
|
|
3972
4028
|
ni = function(i, t, e) {
|
|
3973
4029
|
var n;
|
|
3974
|
-
const s =
|
|
3975
|
-
return (n = i.onDataChanged) == null || n.call(i, () => this.onDataChanged()), o(this, O).push({ id: s, label: e.label, renderer: i, store: t, visible: !0 }), M(this, re, null), this.updateViewportPadding(), this.emit("seriesChange"),
|
|
4030
|
+
const s = B(this, nt, Gn).call(this, e.id);
|
|
4031
|
+
return (n = i.onDataChanged) == null || n.call(i, () => this.onDataChanged()), o(this, O).push({ id: s, label: e.label, renderer: i, store: t, visible: !0 }), M(this, re, null), this.updateViewportPadding(), this.emit("seriesChange"), B(this, nt, le).call(this), s;
|
|
3976
4032
|
}, /**
|
|
3977
4033
|
* True if any visible series is non-pie (line / bar / candlestick). Used
|
|
3978
4034
|
* to gate crosshair rendering — a pie-only chart has no meaningful x/y
|
|
@@ -3988,7 +4044,7 @@ Rs = function() {
|
|
|
3988
4044
|
* (currently: pie). Any change in hover index schedules a main-layer redraw.
|
|
3989
4045
|
*/
|
|
3990
4046
|
Ls = function(i) {
|
|
3991
|
-
const t = o(this, rt).size, e = o(this,
|
|
4047
|
+
const t = o(this, rt).size, e = o(this, N).getPadding(), n = {
|
|
3992
4048
|
top: e.top * t.verticalPixelRatio,
|
|
3993
4049
|
bottom: e.bottom * t.verticalPixelRatio
|
|
3994
4050
|
};
|
|
@@ -4007,7 +4063,7 @@ Ls = function(i) {
|
|
|
4007
4063
|
function jn(i, t) {
|
|
4008
4064
|
return typeof i == "number" && typeof t == "number" ? i === t : typeof i == "object" && typeof t == "object" ? i.intervals === t.intervals : !1;
|
|
4009
4065
|
}
|
|
4010
|
-
function
|
|
4066
|
+
function Po(i, t) {
|
|
4011
4067
|
if (i.length <= t || t <= 0) return i;
|
|
4012
4068
|
const e = i[0].time, n = i[i.length - 1].time, s = n - e;
|
|
4013
4069
|
if (s <= 0) return i;
|
|
@@ -4017,8 +4073,8 @@ function Do(i, t) {
|
|
|
4017
4073
|
const d = h === t - 1 ? n + 1 : e + (h + 1) * a;
|
|
4018
4074
|
let c = null, u = null;
|
|
4019
4075
|
for (; l < i.length && i[l].time < d; ) {
|
|
4020
|
-
const
|
|
4021
|
-
(c === null ||
|
|
4076
|
+
const g = i[l];
|
|
4077
|
+
(c === null || g.value < c.value) && (c = g), (u === null || g.value > u.value) && (u = g), l++;
|
|
4022
4078
|
}
|
|
4023
4079
|
if (!(c === null || u === null)) {
|
|
4024
4080
|
if (c === u) {
|
|
@@ -4080,25 +4136,25 @@ function Oo(i, t, e = !0, n = 1) {
|
|
|
4080
4136
|
if (e) {
|
|
4081
4137
|
const u = s.createLinearGradient(0, 0, 0, l);
|
|
4082
4138
|
u.addColorStop(0, h.line.areaTopColor), u.addColorStop(1, h.line.areaBottomColor), s.beginPath();
|
|
4083
|
-
for (let
|
|
4084
|
-
const
|
|
4085
|
-
|
|
4139
|
+
for (let g = 0; g <= c; g++) {
|
|
4140
|
+
const b = t[g], p = a.timeToX(b.time), k = r.valueToY(b.value);
|
|
4141
|
+
g === 0 ? s.moveTo(p, k) : s.lineTo(p, k);
|
|
4086
4142
|
}
|
|
4087
4143
|
if (s.lineTo(a.timeToX(t[c].time), l), s.lineTo(a.timeToX(t[0].time), l), s.closePath(), s.fillStyle = u, s.fill(), d) {
|
|
4088
4144
|
s.save(), s.globalAlpha = n, s.beginPath();
|
|
4089
|
-
const
|
|
4090
|
-
s.moveTo(
|
|
4145
|
+
const g = t[c], b = t[t.length - 1], p = a.timeToX(g.time), k = a.timeToX(b.time);
|
|
4146
|
+
s.moveTo(p, r.valueToY(g.value)), s.lineTo(k, r.valueToY(b.value)), s.lineTo(k, l), s.lineTo(p, l), s.closePath(), s.fillStyle = u, s.fill(), s.restore();
|
|
4091
4147
|
}
|
|
4092
4148
|
}
|
|
4093
4149
|
s.beginPath();
|
|
4094
4150
|
for (let u = 0; u <= c; u++) {
|
|
4095
|
-
const
|
|
4096
|
-
u === 0 ? s.moveTo(
|
|
4151
|
+
const g = t[u], b = a.timeToX(g.time), p = r.valueToY(g.value);
|
|
4152
|
+
u === 0 ? s.moveTo(b, p) : s.lineTo(b, p);
|
|
4097
4153
|
}
|
|
4098
4154
|
if (s.strokeStyle = h.line.color, s.lineWidth = h.line.width, s.stroke(), d) {
|
|
4099
4155
|
s.save(), s.globalAlpha = n, s.beginPath();
|
|
4100
|
-
const u = t[c],
|
|
4101
|
-
s.moveTo(a.timeToX(u.time), r.valueToY(u.value)), s.lineTo(a.timeToX(
|
|
4156
|
+
const u = t[c], g = t[t.length - 1];
|
|
4157
|
+
s.moveTo(a.timeToX(u.time), r.valueToY(u.value)), s.lineTo(a.timeToX(g.time), r.valueToY(g.value)), s.strokeStyle = h.line.color, s.lineWidth = h.line.width, s.stroke(), s.restore();
|
|
4102
4158
|
}
|
|
4103
4159
|
}
|
|
4104
4160
|
function Ho(i, t, e = 1) {
|
|
@@ -4109,8 +4165,8 @@ function Ho(i, t, e = 1) {
|
|
|
4109
4165
|
), d = e < 1, c = t.length - 1;
|
|
4110
4166
|
n.fillStyle = l.line.color;
|
|
4111
4167
|
for (let u = 0; u < t.length; u++) {
|
|
4112
|
-
const
|
|
4113
|
-
d && u === c ? (n.save(), n.globalAlpha = e, n.fillRect(
|
|
4168
|
+
const g = t[u], b = s.timeToX(g.time), p = a.valueToY(g.value), k = Math.max(1, r - p);
|
|
4169
|
+
d && u === c ? (n.save(), n.globalAlpha = e, n.fillRect(b - h / 2, p, h, k), n.restore()) : n.fillRect(b - h / 2, p, h, k);
|
|
4114
4170
|
}
|
|
4115
4171
|
}
|
|
4116
4172
|
function No(i, t, e = 1) {
|
|
@@ -4120,76 +4176,76 @@ function No(i, t, e = 1) {
|
|
|
4120
4176
|
t.length > 1 ? Math.abs(s.timeToX(t[1].time) - s.timeToX(t[0].time)) * 0.75 : 2
|
|
4121
4177
|
), h = e < 1, d = t.length - 1;
|
|
4122
4178
|
for (let c = 0; c < t.length; c++) {
|
|
4123
|
-
const u = t[c],
|
|
4124
|
-
f && (n.save(), n.globalAlpha = e), n.strokeStyle =
|
|
4125
|
-
const
|
|
4126
|
-
n.fillStyle =
|
|
4179
|
+
const u = t[c], g = u.close >= u.open ? r.candlestick.up : r.candlestick.down, b = Zt(g.body), p = s.timeToX(u.time), k = a.valueToY(u.open), S = a.valueToY(u.close), m = a.valueToY(u.high), w = a.valueToY(u.low), f = h && c === d;
|
|
4180
|
+
f && (n.save(), n.globalAlpha = e), n.strokeStyle = g.wick, n.lineWidth = 1, n.beginPath(), n.moveTo(p, m), n.lineTo(p, w), n.stroke();
|
|
4181
|
+
const v = Math.min(k, S), x = Math.max(1, Math.abs(S - k));
|
|
4182
|
+
n.fillStyle = b, n.fillRect(p - l / 2, v, l, x), f && n.restore();
|
|
4127
4183
|
}
|
|
4128
4184
|
}
|
|
4129
4185
|
function Xo(i, t, e) {
|
|
4130
4186
|
const n = Math.max(e.from, Math.min(e.to, t.from)), s = Math.max(e.from, Math.min(e.to, t.to)), a = i.timeToX(n), r = i.timeToX(s), l = Math.min(a, r), h = Math.max(a, r);
|
|
4131
4187
|
return { left: l, right: h, width: Math.max(1, h - l) };
|
|
4132
4188
|
}
|
|
4133
|
-
var
|
|
4189
|
+
var Dt, G, Fi, lt, Vt, ue, qt, Jt, jt, Kt, ke, $e, oe, Ai, Wi, ye, Ut, Qt, oi, Yt, ri, gi, li, we, hi, ci, ui, di, xe, fi, H, rn, St, Ws, ln, ce, qe, Ji, ki, qn, _s, Fs, Bs, Jn, Qn, We, Zn;
|
|
4134
4190
|
class Uo {
|
|
4135
4191
|
constructor(t) {
|
|
4136
|
-
W(this, H), W(this,
|
|
4192
|
+
W(this, H), W(this, Dt), W(this, G), W(this, Fi), W(this, lt), W(this, Vt), W(this, ue), W(this, qt), W(this, Jt), W(this, jt), W(this, Kt), W(this, ke), W(this, $e), W(this, oe, new cs()), W(this, Ai, new ps()), W(this, Wi, 0), W(this, ye, 0), W(this, Ut, 1), W(this, Qt, null), W(this, oi, !0), W(this, Yt, null), W(this, ri, null), W(this, gi, -1), W(this, li), W(this, we, null), W(this, hi), W(this, ci), W(this, ui), W(this, di), W(this, xe), W(this, fi), M(this, Dt, t.container), M(this, lt, t.chart), M(this, ke, t.data), M(this, $e, t.options ?? {}), window.getComputedStyle(o(this, Dt)).position === "static" && (o(this, Dt).style.position = "relative"), M(this, G, document.createElement("canvas")), o(this, G).style.position = "absolute", o(this, G).style.left = "0", o(this, G).style.top = "0", o(this, G).style.height = "100%", o(this, G).style.touchAction = "none", o(this, Dt).appendChild(o(this, G));
|
|
4137
4193
|
const e = o(this, G).getContext("2d", { alpha: !0 });
|
|
4138
4194
|
if (!e) throw new Error("NavigatorController: failed to acquire 2D context");
|
|
4139
|
-
M(this,
|
|
4195
|
+
M(this, Fi, e), M(this, Vt, document.createElement("div")), o(this, Vt).dataset.chartNavigatorOverlay = "", o(this, Vt).style.cssText = "position:absolute;left:0;top:0;height:100%;pointer-events:none;", M(this, ue, document.createElement("div")), o(this, ue).style.cssText = "position:absolute;left:0;top:0;bottom:0;", M(this, qt, document.createElement("div")), o(this, qt).style.cssText = "position:absolute;top:0;bottom:0;", M(this, Jt, document.createElement("div")), o(this, Jt).style.cssText = "position:absolute;top:0;bottom:0;box-sizing:border-box;", M(this, jt, es()), M(this, Kt, es()), o(this, Vt).append(o(this, ue), o(this, qt), o(this, Jt), o(this, jt), o(this, Kt)), o(this, Dt).appendChild(o(this, Vt)), M(this, hi, () => B(this, H, ce).call(this)), M(this, ci, () => B(this, H, ce).call(this)), o(this, lt).on("viewportChange", o(this, hi)), o(this, lt).on("overlayChange", o(this, ci)), M(this, ui, (s) => B(this, H, _s).call(this, s)), M(this, di, (s) => B(this, H, Fs).call(this, s)), M(this, xe, (s) => B(this, H, Bs).call(this, s)), M(this, fi, () => {
|
|
4140
4196
|
o(this, we) === null && (o(this, G).style.cursor = "default");
|
|
4141
|
-
}), o(this, G).addEventListener("pointerdown", o(this, ui)), o(this, G).addEventListener("pointermove", o(this, di)), o(this, G).addEventListener("pointerup", o(this, xe)), o(this, G).addEventListener("pointercancel", o(this, xe)), o(this, G).addEventListener("pointerleave", o(this, fi)), M(this, li, new ResizeObserver((s) =>
|
|
4142
|
-
const n = o(this,
|
|
4143
|
-
n.width > 0 && n.height > 0 &&
|
|
4197
|
+
}), o(this, G).addEventListener("pointerdown", o(this, ui)), o(this, G).addEventListener("pointermove", o(this, di)), o(this, G).addEventListener("pointerup", o(this, xe)), o(this, G).addEventListener("pointercancel", o(this, xe)), o(this, G).addEventListener("pointerleave", o(this, fi)), M(this, li, new ResizeObserver((s) => B(this, H, Ws).call(this, s[0]))), o(this, li).observe(o(this, Dt)), B(this, H, rn).call(this);
|
|
4198
|
+
const n = o(this, Dt).getBoundingClientRect();
|
|
4199
|
+
n.width > 0 && n.height > 0 && B(this, H, ln).call(this, n.width, n.height), B(this, H, ce).call(this);
|
|
4144
4200
|
}
|
|
4145
4201
|
setData(t) {
|
|
4146
4202
|
var e;
|
|
4147
4203
|
const n = Go(t), s = (n == null ? void 0 : n.time) ?? null;
|
|
4148
4204
|
if (s !== null && o(this, ri) !== null && s !== o(this, ri)) {
|
|
4149
|
-
const a = ((e = o(this,
|
|
4150
|
-
M(this,
|
|
4205
|
+
const a = ((e = o(this, Yt)) == null ? void 0 : e.current) ?? 0;
|
|
4206
|
+
M(this, Yt, new He({
|
|
4151
4207
|
initial: a,
|
|
4152
4208
|
duration: Me,
|
|
4153
4209
|
easing: Se,
|
|
4154
4210
|
lerp: (r, l, h) => r + (l - r) * h
|
|
4155
|
-
})), o(this,
|
|
4211
|
+
})), o(this, Yt).setTarget(1);
|
|
4156
4212
|
}
|
|
4157
|
-
M(this, ri, s), M(this, gi, (n == null ? void 0 : n.seriesIndex) ?? -1), M(this, ke, t),
|
|
4213
|
+
M(this, ri, s), M(this, gi, (n == null ? void 0 : n.seriesIndex) ?? -1), M(this, ke, t), B(this, H, ce).call(this);
|
|
4158
4214
|
}
|
|
4159
4215
|
setOptions(t) {
|
|
4160
|
-
M(this, $e, t),
|
|
4216
|
+
M(this, $e, t), B(this, H, rn).call(this), B(this, H, ce).call(this);
|
|
4161
4217
|
}
|
|
4162
4218
|
destroy() {
|
|
4163
|
-
o(this, lt).off("viewportChange", o(this, hi)), o(this, lt).off("overlayChange", o(this, ci)), o(this, G).removeEventListener("pointerdown", o(this, ui)), o(this, G).removeEventListener("pointermove", o(this, di)), o(this, G).removeEventListener("pointerup", o(this, xe)), o(this, G).removeEventListener("pointercancel", o(this, xe)), o(this, G).removeEventListener("pointerleave", o(this, fi)), o(this, li).disconnect(), o(this, Qt) !== null && (cancelAnimationFrame(o(this, Qt)), M(this, Qt, null)), o(this, G).remove(), o(this,
|
|
4219
|
+
o(this, lt).off("viewportChange", o(this, hi)), o(this, lt).off("overlayChange", o(this, ci)), o(this, G).removeEventListener("pointerdown", o(this, ui)), o(this, G).removeEventListener("pointermove", o(this, di)), o(this, G).removeEventListener("pointerup", o(this, xe)), o(this, G).removeEventListener("pointercancel", o(this, xe)), o(this, G).removeEventListener("pointerleave", o(this, fi)), o(this, li).disconnect(), o(this, Qt) !== null && (cancelAnimationFrame(o(this, Qt)), M(this, Qt, null)), o(this, G).remove(), o(this, Vt).remove();
|
|
4164
4220
|
}
|
|
4165
4221
|
/** CSS pixel height of the strip — theme default unless overridden. */
|
|
4166
4222
|
get height() {
|
|
4167
4223
|
return o(this, $e).height ?? o(this, lt).getTheme().navigator.height;
|
|
4168
4224
|
}
|
|
4169
4225
|
}
|
|
4170
|
-
|
|
4226
|
+
Dt = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), Fi = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), Vt = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), Jt = /* @__PURE__ */ new WeakMap(), jt = /* @__PURE__ */ new WeakMap(), Kt = /* @__PURE__ */ new WeakMap(), ke = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), oe = /* @__PURE__ */ new WeakMap(), Ai = /* @__PURE__ */ new WeakMap(), Wi = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakMap(), Ut = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), oi = /* @__PURE__ */ new WeakMap(), Yt = /* @__PURE__ */ new WeakMap(), ri = /* @__PURE__ */ new WeakMap(), gi = /* @__PURE__ */ new WeakMap(), li = /* @__PURE__ */ new WeakMap(), we = /* @__PURE__ */ new WeakMap(), hi = /* @__PURE__ */ new WeakMap(), ci = /* @__PURE__ */ new WeakMap(), ui = /* @__PURE__ */ new WeakMap(), di = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), fi = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakSet(), /** Push `options.height` (when set) onto the container's CSS height so
|
|
4171
4227
|
* direct core consumers see the option take effect. When the option is
|
|
4172
4228
|
* absent we leave the container alone — framework wrappers manage their
|
|
4173
4229
|
* own inline height via JSX, and overwriting it here would clobber the
|
|
4174
4230
|
* caller's value during the first layout effect. */
|
|
4175
4231
|
rn = function() {
|
|
4176
4232
|
const i = o(this, $e).height;
|
|
4177
|
-
i !== void 0 && (o(this,
|
|
4178
|
-
},
|
|
4233
|
+
i !== void 0 && (o(this, Dt).style.height = `${i}px`);
|
|
4234
|
+
}, St = function() {
|
|
4179
4235
|
return Math.max(0, o(this, Wi) - o(this, lt).yAxisWidth);
|
|
4180
4236
|
}, Ws = function(i) {
|
|
4181
4237
|
var t;
|
|
4182
4238
|
if (!i) return;
|
|
4183
4239
|
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;
|
|
4184
|
-
n <= 0 || s <= 0 || (
|
|
4240
|
+
n <= 0 || s <= 0 || (B(this, H, ln).call(this, n, s), B(this, H, ce).call(this));
|
|
4185
4241
|
}, ln = function(i, t) {
|
|
4186
4242
|
const e = window.devicePixelRatio || 1;
|
|
4187
4243
|
M(this, Wi, i), M(this, ye, t), M(this, Ut, e);
|
|
4188
|
-
const n = o(this, H,
|
|
4189
|
-
o(this, G).width = Math.round(n * e), o(this, G).height = Math.round(t * e), o(this, G).style.width = `${n}px`, o(this,
|
|
4244
|
+
const n = o(this, H, St);
|
|
4245
|
+
o(this, G).width = Math.round(n * e), o(this, G).height = Math.round(t * e), o(this, G).style.width = `${n}px`, o(this, Vt).style.width = `${n}px`;
|
|
4190
4246
|
}, ce = function() {
|
|
4191
4247
|
o(this, oi) && o(this, Qt) !== null || (M(this, oi, !0), o(this, Qt) === null && M(this, Qt, requestAnimationFrame(() => {
|
|
4192
|
-
M(this, Qt, null), M(this, oi, !1),
|
|
4248
|
+
M(this, Qt, null), M(this, oi, !1), B(this, H, Jn).call(this);
|
|
4193
4249
|
})));
|
|
4194
4250
|
}, // --- input -------------------------------------------------------------
|
|
4195
4251
|
/** Extract media-x from a pointer event, relative to the canvas. */
|
|
@@ -4200,18 +4256,18 @@ qe = function(i) {
|
|
|
4200
4256
|
* the first RAF-driven render — pointer handlers rely on this so hit-tests
|
|
4201
4257
|
* compute against primed scales even on the opening gesture. */
|
|
4202
4258
|
Ji = function() {
|
|
4203
|
-
const i =
|
|
4204
|
-
return o(this, oe).update(i, o(this, H,
|
|
4259
|
+
const i = B(this, H, We).call(this), t = B(this, H, Zn).call(this);
|
|
4260
|
+
return o(this, oe).update(i, o(this, H, St), o(this, Ut)), o(this, Ai).update(t, o(this, ye), o(this, Ut)), { dataRange: i, yRange: t };
|
|
4205
4261
|
}, ki = function() {
|
|
4206
|
-
return
|
|
4262
|
+
return B(this, H, Ji).call(this), Xo(o(this, oe), o(this, lt).getVisibleRange(), B(this, H, We).call(this));
|
|
4207
4263
|
}, qn = function() {
|
|
4208
|
-
const i =
|
|
4209
|
-
return t <= 0 || o(this, H,
|
|
4264
|
+
const i = B(this, H, We).call(this), t = i.to - i.from;
|
|
4265
|
+
return t <= 0 || o(this, H, St) <= 0 ? 0 : o(this, H, St) / t;
|
|
4210
4266
|
}, _s = function(i) {
|
|
4211
4267
|
if (i.button !== void 0 && i.button !== 0) return;
|
|
4212
|
-
const t =
|
|
4268
|
+
const t = B(this, H, qe).call(this, i), e = B(this, H, We).call(this);
|
|
4213
4269
|
if (e.to <= e.from) return;
|
|
4214
|
-
const n =
|
|
4270
|
+
const n = B(this, H, ki).call(this), s = As(t, n), a = B(this, H, qn).call(this);
|
|
4215
4271
|
if (a === 0) return;
|
|
4216
4272
|
let r = o(this, lt).getVisibleRange();
|
|
4217
4273
|
if (s.snapToCenter) {
|
|
@@ -4224,19 +4280,19 @@ Ji = function() {
|
|
|
4224
4280
|
startX: t,
|
|
4225
4281
|
startVisible: r,
|
|
4226
4282
|
pixelsPerTime: a
|
|
4227
|
-
}), o(this, G).setPointerCapture(i.pointerId), o(this, G).style.cursor =
|
|
4283
|
+
}), o(this, G).setPointerCapture(i.pointerId), o(this, G).style.cursor = Ds(
|
|
4228
4284
|
s.gesture,
|
|
4229
4285
|
/*dragging*/
|
|
4230
4286
|
!0
|
|
4231
4287
|
), i.preventDefault();
|
|
4232
|
-
},
|
|
4288
|
+
}, Fs = function(i) {
|
|
4233
4289
|
const t = o(this, we);
|
|
4234
4290
|
if (t === null) {
|
|
4235
|
-
o(this, G).style.cursor = ts(
|
|
4291
|
+
o(this, G).style.cursor = ts(B(this, H, qe).call(this, i), B(this, H, ki).call(this));
|
|
4236
4292
|
return;
|
|
4237
4293
|
}
|
|
4238
4294
|
if (i.pointerId !== t.pointerId) return;
|
|
4239
|
-
const e =
|
|
4295
|
+
const e = B(this, H, qe).call(this, i) - t.startX, n = B(this, H, We).call(this);
|
|
4240
4296
|
let s;
|
|
4241
4297
|
if (t.gesture === "pan")
|
|
4242
4298
|
s = Vo({
|
|
@@ -4257,50 +4313,50 @@ Ji = function() {
|
|
|
4257
4313
|
});
|
|
4258
4314
|
}
|
|
4259
4315
|
o(this, lt).setVisibleRange(s);
|
|
4260
|
-
},
|
|
4316
|
+
}, Bs = function(i) {
|
|
4261
4317
|
const t = o(this, we);
|
|
4262
|
-
t === null || i.pointerId !== t.pointerId || (M(this, we, null), o(this, G).hasPointerCapture(i.pointerId) && o(this, G).releasePointerCapture(i.pointerId), o(this, G).style.cursor = ts(
|
|
4318
|
+
t === null || i.pointerId !== t.pointerId || (M(this, we, null), o(this, G).hasPointerCapture(i.pointerId) && o(this, G).releasePointerCapture(i.pointerId), o(this, G).style.cursor = ts(B(this, H, qe).call(this, i), B(this, H, ki).call(this)));
|
|
4263
4319
|
}, // --- render ------------------------------------------------------------
|
|
4264
4320
|
Jn = function() {
|
|
4265
|
-
if (o(this, H,
|
|
4266
|
-
const i = o(this, lt).getTheme().navigator, { dataRange: t } =
|
|
4267
|
-
o(this, G).width = Math.round(o(this, H,
|
|
4268
|
-
const e = o(this,
|
|
4321
|
+
if (o(this, H, St) <= 0 || o(this, ye) <= 0) return;
|
|
4322
|
+
const i = o(this, lt).getTheme().navigator, { dataRange: t } = B(this, H, Ji).call(this);
|
|
4323
|
+
o(this, G).width = Math.round(o(this, H, St) * o(this, Ut)), o(this, G).height = Math.round(o(this, ye) * o(this, Ut)), o(this, G).style.width = `${o(this, H, St)}px`, o(this, Vt).style.width = `${o(this, H, St)}px`;
|
|
4324
|
+
const e = o(this, Fi), n = o(this, G).width, s = o(this, G).height;
|
|
4269
4325
|
e.save(), e.clearRect(0, 0, n, s), e.scale(o(this, Ut), o(this, Ut));
|
|
4270
4326
|
const a = {
|
|
4271
4327
|
ctx: e,
|
|
4272
4328
|
timeScale: o(this, oe),
|
|
4273
4329
|
yScale: o(this, Ai),
|
|
4274
|
-
mediaWidth: o(this, H,
|
|
4330
|
+
mediaWidth: o(this, H, St),
|
|
4275
4331
|
mediaHeight: o(this, ye),
|
|
4276
4332
|
theme: i
|
|
4277
4333
|
};
|
|
4278
4334
|
o(this, G).style.boxShadow = `inset 0 1px 0 ${i.borderColor}, inset 0 -1px 0 ${i.borderColor}`, $o(a);
|
|
4279
4335
|
let r = 1;
|
|
4280
|
-
o(this,
|
|
4281
|
-
const l = Math.max(1, Math.round(o(this, H,
|
|
4336
|
+
o(this, Yt) !== null && (o(this, Yt).tick(performance.now()), r = o(this, Yt).current, o(this, Yt).animating ? B(this, H, ce).call(this) : M(this, Yt, null));
|
|
4337
|
+
const l = Math.max(1, Math.round(o(this, H, St))), h = o(this, ke);
|
|
4282
4338
|
if (h.type === "candlestick")
|
|
4283
4339
|
No(a, zo(h.points, l), r);
|
|
4284
4340
|
else {
|
|
4285
4341
|
const d = Qi(h), c = d.length === 1, u = o(this, gi) >= 0 ? o(this, gi) : d.length - 1;
|
|
4286
|
-
for (let
|
|
4287
|
-
const
|
|
4288
|
-
h.type === "bar" ? Ho(a,
|
|
4342
|
+
for (let g = 0; g < d.length; g++) {
|
|
4343
|
+
const b = Po(d[g], l), p = g === u ? r : 1;
|
|
4344
|
+
h.type === "bar" ? Ho(a, b, p) : Oo(a, b, c, p);
|
|
4289
4345
|
}
|
|
4290
4346
|
}
|
|
4291
|
-
e.restore(),
|
|
4347
|
+
e.restore(), B(this, H, Qn).call(this, i, t);
|
|
4292
4348
|
}, Qn = function(i, t) {
|
|
4293
4349
|
if (t.to <= t.from) return;
|
|
4294
4350
|
const e = o(this, lt).getVisibleRange(), n = Math.max(t.from, Math.min(t.to, e.from)), s = Math.max(t.from, Math.min(t.to, e.to)), a = o(this, oe).timeToX(n), r = o(this, oe).timeToX(s), l = Math.min(a, r), h = Math.max(a, r), d = Math.max(1, h - l);
|
|
4295
4351
|
o(this, ue).style.width = `${l}px`, o(this, ue).style.background = i.mask.fill, o(this, ue).style.display = l > 0 ? "block" : "none";
|
|
4296
|
-
const c = Math.max(0, o(this, H,
|
|
4352
|
+
const c = Math.max(0, o(this, H, St) - (l + d));
|
|
4297
4353
|
o(this, qt).style.left = `${l + d}px`, o(this, qt).style.width = `${c}px`, o(this, qt).style.background = i.mask.fill, o(this, qt).style.display = c > 0 ? "block" : "none", o(this, Jt).style.left = `${l}px`, o(this, Jt).style.width = `${d}px`, o(this, Jt).style.background = i.window.fill, o(this, Jt).style.border = i.window.borderWidth > 0 ? `${i.window.borderWidth}px solid ${i.window.border}` : "none";
|
|
4298
|
-
const u = i.handle.width,
|
|
4299
|
-
o(this, jt).style.left = `${l - u / 2}px`, o(this, jt).style.width = `${u}px`, o(this, jt).style.background = i.handle.color, o(this, jt).style.borderRadius = `${
|
|
4300
|
-
for (const
|
|
4301
|
-
|
|
4302
|
-
for (const
|
|
4303
|
-
|
|
4354
|
+
const u = i.handle.width, g = Math.max(1, u / 2), b = o(this, lt).getTheme().background;
|
|
4355
|
+
o(this, jt).style.left = `${l - u / 2}px`, o(this, jt).style.width = `${u}px`, o(this, jt).style.background = i.handle.color, o(this, jt).style.borderRadius = `${g}px`, o(this, Kt).style.left = `${l + d - u / 2}px`, o(this, Kt).style.width = `${u}px`, o(this, Kt).style.background = i.handle.color, o(this, Kt).style.borderRadius = `${g}px`;
|
|
4356
|
+
for (const p of o(this, jt).children)
|
|
4357
|
+
p.style.background = b;
|
|
4358
|
+
for (const p of o(this, Kt).children)
|
|
4359
|
+
p.style.background = b;
|
|
4304
4360
|
}, We = function() {
|
|
4305
4361
|
const i = o(this, ke);
|
|
4306
4362
|
let t = Number.POSITIVE_INFINITY, e = Number.NEGATIVE_INFINITY, n = 0;
|
|
@@ -4351,11 +4407,11 @@ function Go(i) {
|
|
|
4351
4407
|
}
|
|
4352
4408
|
return e === null ? null : { time: e, seriesIndex: n };
|
|
4353
4409
|
}
|
|
4354
|
-
function
|
|
4410
|
+
function Ds(i, t) {
|
|
4355
4411
|
return i === "resize-left" || i === "resize-right" ? "ew-resize" : t ? "grabbing" : "grab";
|
|
4356
4412
|
}
|
|
4357
4413
|
function ts(i, t) {
|
|
4358
|
-
return
|
|
4414
|
+
return Ds(jo(i, t), !1);
|
|
4359
4415
|
}
|
|
4360
4416
|
function jo(i, t) {
|
|
4361
4417
|
return As(i, t).gesture;
|
|
@@ -4370,7 +4426,7 @@ function es() {
|
|
|
4370
4426
|
return i;
|
|
4371
4427
|
}
|
|
4372
4428
|
const hn = /* @__PURE__ */ new WeakMap();
|
|
4373
|
-
function
|
|
4429
|
+
function Ps(i, t) {
|
|
4374
4430
|
var e;
|
|
4375
4431
|
return (e = hn.get(i)) == null ? void 0 : e.get(t);
|
|
4376
4432
|
}
|
|
@@ -4389,7 +4445,7 @@ function Vs(i, t) {
|
|
|
4389
4445
|
return t === "asc" ? a - r : r - a;
|
|
4390
4446
|
}), e;
|
|
4391
4447
|
}
|
|
4392
|
-
function
|
|
4448
|
+
function Bi(i) {
|
|
4393
4449
|
const t = Object.freeze({ ...i.data }), e = {
|
|
4394
4450
|
id: i.id,
|
|
4395
4451
|
seriesId: i.seriesId,
|
|
@@ -4401,7 +4457,7 @@ function Fi(i) {
|
|
|
4401
4457
|
return Object.freeze(e);
|
|
4402
4458
|
}
|
|
4403
4459
|
function Ys(i, t) {
|
|
4404
|
-
const e = t.sort ?? "none", n = i.getOverlayVersion(), s =
|
|
4460
|
+
const e = t.sort ?? "none", n = i.getOverlayVersion(), s = Ps(i, t.cacheKey);
|
|
4405
4461
|
if (s && s.version === n && s.time === t.time && s.sort === e)
|
|
4406
4462
|
return s.data;
|
|
4407
4463
|
const a = [];
|
|
@@ -4413,7 +4469,7 @@ function Ys(i, t) {
|
|
|
4413
4469
|
if (!c) continue;
|
|
4414
4470
|
for (const u of c)
|
|
4415
4471
|
a.push(
|
|
4416
|
-
|
|
4472
|
+
Bi({
|
|
4417
4473
|
id: `${l}_layer${u.layerIndex}`,
|
|
4418
4474
|
seriesId: l,
|
|
4419
4475
|
layerIndex: u.layerIndex,
|
|
@@ -4426,7 +4482,7 @@ function Ys(i, t) {
|
|
|
4426
4482
|
}
|
|
4427
4483
|
const d = i.getDataAtTime(l, t.time);
|
|
4428
4484
|
d && a.push(
|
|
4429
|
-
|
|
4485
|
+
Bi({
|
|
4430
4486
|
id: l,
|
|
4431
4487
|
seriesId: l,
|
|
4432
4488
|
label: h,
|
|
@@ -4439,7 +4495,7 @@ function Ys(i, t) {
|
|
|
4439
4495
|
return zs(i, t.cacheKey, { version: n, time: t.time, sort: e, data: r }), r;
|
|
4440
4496
|
}
|
|
4441
4497
|
function Ko(i, t) {
|
|
4442
|
-
const e = t.sort ?? "none", n = i.getOverlayVersion(), s =
|
|
4498
|
+
const e = t.sort ?? "none", n = i.getOverlayVersion(), s = Ps(i, t.cacheKey);
|
|
4443
4499
|
if (s && s.version === n && s.time === null && s.sort === e)
|
|
4444
4500
|
return s.data;
|
|
4445
4501
|
const a = [];
|
|
@@ -4449,7 +4505,7 @@ function Ko(i, t) {
|
|
|
4449
4505
|
if (d) {
|
|
4450
4506
|
for (const u of d)
|
|
4451
4507
|
a.push(
|
|
4452
|
-
|
|
4508
|
+
Bi({
|
|
4453
4509
|
id: `${l}_layer${u.layerIndex}`,
|
|
4454
4510
|
seriesId: l,
|
|
4455
4511
|
layerIndex: u.layerIndex,
|
|
@@ -4462,7 +4518,7 @@ function Ko(i, t) {
|
|
|
4462
4518
|
}
|
|
4463
4519
|
const c = i.getLastData(l);
|
|
4464
4520
|
c && a.push(
|
|
4465
|
-
|
|
4521
|
+
Bi({
|
|
4466
4522
|
id: l,
|
|
4467
4523
|
seriesId: l,
|
|
4468
4524
|
label: h,
|
|
@@ -4474,7 +4530,7 @@ function Ko(i, t) {
|
|
|
4474
4530
|
const r = Object.freeze(Vs(a, e));
|
|
4475
4531
|
return zs(i, t.cacheKey, { version: n, time: null, sort: e, data: r }), r;
|
|
4476
4532
|
}
|
|
4477
|
-
const
|
|
4533
|
+
const Br = {
|
|
4478
4534
|
background: "#131722",
|
|
4479
4535
|
chartGradient: ["#1a1f2e", "#101318"],
|
|
4480
4536
|
typography: {
|
|
@@ -4562,7 +4618,7 @@ const Fr = {
|
|
|
4562
4618
|
fill: "rgba(19, 23, 34, 0.78)"
|
|
4563
4619
|
}
|
|
4564
4620
|
}
|
|
4565
|
-
},
|
|
4621
|
+
}, Dr = {
|
|
4566
4622
|
background: "#ffffff",
|
|
4567
4623
|
chartGradient: ["#ffffff", "#f5f6f8"],
|
|
4568
4624
|
typography: {
|
|
@@ -4645,7 +4701,7 @@ const Fr = {
|
|
|
4645
4701
|
fill: "rgba(255, 255, 255, 0.82)"
|
|
4646
4702
|
}
|
|
4647
4703
|
}
|
|
4648
|
-
},
|
|
4704
|
+
}, Pr = at({
|
|
4649
4705
|
name: "Andromeda",
|
|
4650
4706
|
description: "Deep space purples and cosmic blues",
|
|
4651
4707
|
background: "#23262e",
|
|
@@ -5312,22 +5368,22 @@ const Fr = {
|
|
|
5312
5368
|
typography: { fontFamily: Vi },
|
|
5313
5369
|
fontUrl: Yi
|
|
5314
5370
|
});
|
|
5315
|
-
function
|
|
5316
|
-
const { x: t, y: e, chartWidth: n, chartHeight: s, tooltipWidth: a, tooltipHeight: r, offsetX: l = 16, offsetY: h = 16 } = i, d = t + l + a > n ? t - l - a : t + l, c = e + h + r > s ? e - h - r : e + h, u = Math.max(0, n - a),
|
|
5371
|
+
function Di(i) {
|
|
5372
|
+
const { x: t, y: e, chartWidth: n, chartHeight: s, tooltipWidth: a, tooltipHeight: r, offsetX: l = 16, offsetY: h = 16 } = i, d = t + l + a > n ? t - l - a : t + l, c = e + h + r > s ? e - h - r : e + h, u = Math.max(0, n - a), g = Math.max(0, s - r);
|
|
5317
5373
|
return {
|
|
5318
5374
|
left: Math.max(0, Math.min(u, d)),
|
|
5319
|
-
top: Math.max(0, Math.min(
|
|
5375
|
+
top: Math.max(0, Math.min(g, c))
|
|
5320
5376
|
};
|
|
5321
5377
|
}
|
|
5322
5378
|
const yn = Symbol("wick-chart"), Ue = Symbol("wick-theme"), Es = Symbol("wick-title-anchor"), $s = Symbol("wick-info-bar-anchor"), xn = Symbol("wick-legend-anchor"), wn = Symbol("wick-legend-right-anchor"), Os = Symbol("wick-navigator-anchor");
|
|
5323
|
-
function
|
|
5324
|
-
const i =
|
|
5379
|
+
function kt() {
|
|
5380
|
+
const i = xt(yn);
|
|
5325
5381
|
if (!i || !i.value)
|
|
5326
5382
|
throw new Error("useChartInstance must be used within <ChartContainer>");
|
|
5327
5383
|
return i.value;
|
|
5328
5384
|
}
|
|
5329
5385
|
function tr() {
|
|
5330
|
-
const i =
|
|
5386
|
+
const i = xt(Ue);
|
|
5331
5387
|
if (!i)
|
|
5332
5388
|
throw new Error("useTheme must be used within <ChartContainer>");
|
|
5333
5389
|
return i;
|
|
@@ -5340,7 +5396,7 @@ const nl = /* @__PURE__ */ pt({
|
|
|
5340
5396
|
id: {}
|
|
5341
5397
|
},
|
|
5342
5398
|
setup(i) {
|
|
5343
|
-
const t = i, e =
|
|
5399
|
+
const t = i, e = kt(), n = q(null);
|
|
5344
5400
|
return dt(() => {
|
|
5345
5401
|
const s = e.addBarSeries({
|
|
5346
5402
|
...t.options,
|
|
@@ -5377,7 +5433,7 @@ const nl = /* @__PURE__ */ pt({
|
|
|
5377
5433
|
id: {}
|
|
5378
5434
|
},
|
|
5379
5435
|
setup(i) {
|
|
5380
|
-
const t = i, e =
|
|
5436
|
+
const t = i, e = kt(), n = q(null);
|
|
5381
5437
|
let s = 0;
|
|
5382
5438
|
return dt(() => {
|
|
5383
5439
|
const a = e.addCandlestickSeries({ ...t.options, id: t.id });
|
|
@@ -5430,58 +5486,59 @@ const nl = /* @__PURE__ */ pt({
|
|
|
5430
5486
|
grid: {},
|
|
5431
5487
|
headerLayout: { default: "overlay" },
|
|
5432
5488
|
animations: { type: [Boolean, Object] },
|
|
5433
|
-
perf: { type: [Boolean, Object] }
|
|
5489
|
+
perf: { type: [Boolean, Object] },
|
|
5490
|
+
onEdgeReached: {}
|
|
5434
5491
|
},
|
|
5435
5492
|
setup(i) {
|
|
5436
|
-
const t = i, e = q(), n = Zi(null), s = Zi(t.theme), a = t.perf, r =
|
|
5437
|
-
pe(yn, n), pe(Ue, s), pe(Es,
|
|
5438
|
-
let
|
|
5439
|
-
const
|
|
5440
|
-
function
|
|
5441
|
-
var x,
|
|
5493
|
+
const t = i, e = q(), n = Zi(null), s = Zi(t.theme), a = t.perf, r = t.onEdgeReached, l = q(null), h = q(null), d = q(null), c = q(null), u = q(null), g = q(null);
|
|
5494
|
+
pe(yn, n), pe(Ue, s), pe(Es, h), pe($s, d), pe(xn, c), pe(wn, u), pe(Os, g);
|
|
5495
|
+
let b = null;
|
|
5496
|
+
const p = q(0), k = P(() => t.headerLayout === "overlay" ? p.value : 0);
|
|
5497
|
+
function S() {
|
|
5498
|
+
var x, I, y, T;
|
|
5442
5499
|
if (!n.value) return;
|
|
5443
|
-
const
|
|
5444
|
-
((
|
|
5500
|
+
const v = { top: (((x = t.padding) == null ? void 0 : x.top) ?? 20) + k.value };
|
|
5501
|
+
((I = t.padding) == null ? void 0 : I.bottom) !== void 0 && (v.bottom = t.padding.bottom), ((y = t.padding) == null ? void 0 : y.right) !== void 0 && (v.right = t.padding.right), ((T = t.padding) == null ? void 0 : T.left) !== void 0 && (v.left = t.padding.left), n.value.setPadding(v);
|
|
5445
5502
|
}
|
|
5446
|
-
function
|
|
5447
|
-
|
|
5448
|
-
const
|
|
5449
|
-
if (!
|
|
5450
|
-
|
|
5503
|
+
function m() {
|
|
5504
|
+
b == null || b.disconnect(), b = null;
|
|
5505
|
+
const f = t.headerLayout === "overlay" ? l.value : null;
|
|
5506
|
+
if (!f) {
|
|
5507
|
+
p.value = 0, S();
|
|
5451
5508
|
return;
|
|
5452
5509
|
}
|
|
5453
|
-
const
|
|
5454
|
-
|
|
5510
|
+
const v = () => {
|
|
5511
|
+
p.value = f.getBoundingClientRect().height, S();
|
|
5455
5512
|
};
|
|
5456
|
-
|
|
5513
|
+
v(), b = new ResizeObserver(v), b.observe(f);
|
|
5457
5514
|
}
|
|
5458
5515
|
dt(async () => {
|
|
5459
5516
|
if (!e.value) return;
|
|
5460
|
-
const
|
|
5461
|
-
t.axis && (
|
|
5517
|
+
const f = {};
|
|
5518
|
+
t.axis && (f.axis = t.axis), t.theme && (f.theme = t.theme), t.padding && (f.padding = t.padding), t.interactive !== void 0 && (f.interactive = t.interactive), t.grid !== void 0 && (f.grid = t.grid), a !== void 0 && (f.perf = a), r && (f.onEdgeReached = r), t.animations !== void 0 && (f.animations = t.animations), n.value = new Do(e.value, f), await Tn(), m();
|
|
5462
5519
|
}), ct(() => {
|
|
5463
|
-
var
|
|
5464
|
-
|
|
5520
|
+
var f;
|
|
5521
|
+
b == null || b.disconnect(), b = null, (f = n.value) == null || f.destroy(), n.value = null;
|
|
5465
5522
|
}), ht(
|
|
5466
5523
|
() => t.headerLayout,
|
|
5467
5524
|
async () => {
|
|
5468
|
-
n.value && (await Tn(),
|
|
5525
|
+
n.value && (await Tn(), m());
|
|
5469
5526
|
}
|
|
5470
5527
|
), ht(
|
|
5471
5528
|
() => t.theme,
|
|
5472
|
-
(
|
|
5473
|
-
n.value &&
|
|
5529
|
+
(f) => {
|
|
5530
|
+
n.value && f && (n.value.setTheme(f), s.value = f);
|
|
5474
5531
|
}
|
|
5475
5532
|
), ht(
|
|
5476
5533
|
() => t.axis,
|
|
5477
|
-
(
|
|
5478
|
-
n.value &&
|
|
5534
|
+
(f) => {
|
|
5535
|
+
n.value && f && n.value.setAxis(f);
|
|
5479
5536
|
},
|
|
5480
5537
|
{ deep: !0 }
|
|
5481
5538
|
), ht(
|
|
5482
5539
|
() => {
|
|
5483
|
-
var
|
|
5484
|
-
return (
|
|
5540
|
+
var f;
|
|
5541
|
+
return (f = t.grid) == null ? void 0 : f.visible;
|
|
5485
5542
|
},
|
|
5486
5543
|
() => {
|
|
5487
5544
|
n.value && t.grid !== void 0 && n.value.setGrid(t.grid);
|
|
@@ -5493,35 +5550,35 @@ const nl = /* @__PURE__ */ pt({
|
|
|
5493
5550
|
}
|
|
5494
5551
|
), ht(
|
|
5495
5552
|
() => {
|
|
5496
|
-
var
|
|
5553
|
+
var f, v, x, I, y, T;
|
|
5497
5554
|
return [
|
|
5498
|
-
(
|
|
5499
|
-
(
|
|
5500
|
-
typeof ((x = t.padding) == null ? void 0 : x.right) == "object" ? t.padding.right.intervals : (
|
|
5501
|
-
typeof ((
|
|
5502
|
-
|
|
5555
|
+
(f = t.padding) == null ? void 0 : f.top,
|
|
5556
|
+
(v = t.padding) == null ? void 0 : v.bottom,
|
|
5557
|
+
typeof ((x = t.padding) == null ? void 0 : x.right) == "object" ? t.padding.right.intervals : (I = t.padding) == null ? void 0 : I.right,
|
|
5558
|
+
typeof ((y = t.padding) == null ? void 0 : y.left) == "object" ? t.padding.left.intervals : (T = t.padding) == null ? void 0 : T.left,
|
|
5559
|
+
k.value
|
|
5503
5560
|
];
|
|
5504
5561
|
},
|
|
5505
|
-
|
|
5562
|
+
S
|
|
5506
5563
|
);
|
|
5507
|
-
const
|
|
5508
|
-
const
|
|
5509
|
-
return `position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; background: ${t.gradient ? `linear-gradient(to bottom, ${
|
|
5564
|
+
const w = P(() => {
|
|
5565
|
+
const f = s.value, [v, x] = (f == null ? void 0 : f.chartGradient) ?? ["transparent", "transparent"], I = (f == null ? void 0 : f.background) ?? "transparent";
|
|
5566
|
+
return `position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; background: ${t.gradient ? `linear-gradient(to bottom, ${v} 0%, ${I} 70%, ${x} 100%)` : I}`;
|
|
5510
5567
|
});
|
|
5511
|
-
return (
|
|
5512
|
-
style:
|
|
5568
|
+
return (f, v) => (D(), z("div", {
|
|
5569
|
+
style: X(w.value)
|
|
5513
5570
|
}, [
|
|
5514
5571
|
$("div", er, [
|
|
5515
5572
|
$("div", ir, [
|
|
5516
|
-
i.headerLayout === "inline" ? (
|
|
5573
|
+
i.headerLayout === "inline" ? (D(), z("div", nr, [
|
|
5517
5574
|
$("div", {
|
|
5518
5575
|
ref_key: "titleAnchor",
|
|
5519
|
-
ref:
|
|
5576
|
+
ref: h,
|
|
5520
5577
|
"data-chart-title-anchor": ""
|
|
5521
5578
|
}, null, 512),
|
|
5522
5579
|
$("div", {
|
|
5523
5580
|
ref_key: "infoBarAnchor",
|
|
5524
|
-
ref:
|
|
5581
|
+
ref: d,
|
|
5525
5582
|
"data-tooltip-legend-anchor": ""
|
|
5526
5583
|
}, null, 512)
|
|
5527
5584
|
])) : Z("", !0),
|
|
@@ -5530,45 +5587,45 @@ const nl = /* @__PURE__ */ pt({
|
|
|
5530
5587
|
ref: e,
|
|
5531
5588
|
style: { position: "relative", flex: "1", "min-width": "0", "min-height": "0", overflow: "hidden" }
|
|
5532
5589
|
}, [
|
|
5533
|
-
i.headerLayout === "overlay" ? (
|
|
5590
|
+
i.headerLayout === "overlay" ? (D(), z("div", {
|
|
5534
5591
|
key: 0,
|
|
5535
5592
|
ref_key: "topOverlayRef",
|
|
5536
|
-
ref:
|
|
5593
|
+
ref: l,
|
|
5537
5594
|
"data-chart-top-overlay": "",
|
|
5538
5595
|
style: { position: "absolute", top: "0", left: "0", right: "0", "z-index": "2", "pointer-events": "none", display: "flex", "flex-direction": "column" }
|
|
5539
5596
|
}, [
|
|
5540
5597
|
$("div", {
|
|
5541
5598
|
ref_key: "titleAnchor",
|
|
5542
|
-
ref:
|
|
5599
|
+
ref: h,
|
|
5543
5600
|
"data-chart-title-anchor": ""
|
|
5544
5601
|
}, null, 512),
|
|
5545
5602
|
$("div", {
|
|
5546
5603
|
ref_key: "infoBarAnchor",
|
|
5547
|
-
ref:
|
|
5604
|
+
ref: d,
|
|
5548
5605
|
"data-tooltip-legend-anchor": ""
|
|
5549
5606
|
}, null, 512)
|
|
5550
5607
|
], 512)) : Z("", !0),
|
|
5551
|
-
n.value ? (
|
|
5552
|
-
te(
|
|
5608
|
+
n.value ? (D(), z("div", sr, [
|
|
5609
|
+
te(f.$slots, "default")
|
|
5553
5610
|
])) : Z("", !0)
|
|
5554
5611
|
], 512)
|
|
5555
5612
|
]),
|
|
5556
5613
|
$("div", {
|
|
5557
5614
|
ref_key: "legendRightAnchor",
|
|
5558
|
-
ref:
|
|
5615
|
+
ref: u,
|
|
5559
5616
|
"data-legend-right-anchor": "",
|
|
5560
5617
|
style: { flex: "0 0 auto" }
|
|
5561
5618
|
}, null, 512)
|
|
5562
5619
|
]),
|
|
5563
5620
|
$("div", {
|
|
5564
5621
|
ref_key: "legendAnchor",
|
|
5565
|
-
ref:
|
|
5622
|
+
ref: c,
|
|
5566
5623
|
"data-legend-anchor": "",
|
|
5567
5624
|
style: { flex: "0 0 auto" }
|
|
5568
5625
|
}, null, 512),
|
|
5569
5626
|
$("div", {
|
|
5570
5627
|
ref_key: "navigatorAnchor",
|
|
5571
|
-
ref:
|
|
5628
|
+
ref: g,
|
|
5572
5629
|
"data-navigator-anchor": "",
|
|
5573
5630
|
style: { flex: "0 0 auto" }
|
|
5574
5631
|
}, null, 512)
|
|
@@ -5619,7 +5676,7 @@ const hl = /* @__PURE__ */ pt({
|
|
|
5619
5676
|
id: {}
|
|
5620
5677
|
},
|
|
5621
5678
|
setup(i) {
|
|
5622
|
-
const t = i, e =
|
|
5679
|
+
const t = i, e = kt(), n = q(null);
|
|
5623
5680
|
return dt(() => {
|
|
5624
5681
|
const s = e.addLineSeries({
|
|
5625
5682
|
...t.options,
|
|
@@ -5656,7 +5713,7 @@ const hl = /* @__PURE__ */ pt({
|
|
|
5656
5713
|
id: {}
|
|
5657
5714
|
},
|
|
5658
5715
|
setup(i) {
|
|
5659
|
-
const t = i, e =
|
|
5716
|
+
const t = i, e = kt(), n = q(null);
|
|
5660
5717
|
return dt(() => {
|
|
5661
5718
|
const s = e.addPieSeries({ ...t.options, id: t.id });
|
|
5662
5719
|
n.value = s, t.data.length > 0 && e.setSeriesData(s, t.data);
|
|
@@ -5678,7 +5735,7 @@ const hl = /* @__PURE__ */ pt({
|
|
|
5678
5735
|
}), ul = /* @__PURE__ */ pt({
|
|
5679
5736
|
__name: "Crosshair",
|
|
5680
5737
|
setup(i) {
|
|
5681
|
-
const t =
|
|
5738
|
+
const t = kt(), e = $i(t), n = P(() => t.getTheme()), s = P(() => t.getDataInterval()), a = P(() => ({
|
|
5682
5739
|
// Blend the theme's labelBackground at 80% opacity so the axis grid
|
|
5683
5740
|
// shows through — keeps the badge from looking like an opaque block
|
|
5684
5741
|
// while still masking whatever tick sits underneath.
|
|
@@ -5695,25 +5752,25 @@ const hl = /* @__PURE__ */ pt({
|
|
|
5695
5752
|
// live last-value stays visible when the crosshair crosses its row.
|
|
5696
5753
|
zIndex: 2
|
|
5697
5754
|
}));
|
|
5698
|
-
return (r, l) =>
|
|
5755
|
+
return (r, l) => F(e) ? (D(), z(tt, { key: 0 }, [
|
|
5699
5756
|
$("div", {
|
|
5700
|
-
style:
|
|
5757
|
+
style: X({
|
|
5701
5758
|
position: "absolute",
|
|
5702
5759
|
right: "0",
|
|
5703
|
-
top:
|
|
5760
|
+
top: F(e).mediaY + "px",
|
|
5704
5761
|
transform: "translateY(-50%)",
|
|
5705
5762
|
...a.value
|
|
5706
5763
|
})
|
|
5707
|
-
}, J(
|
|
5764
|
+
}, J(F(t).yScale.formatY(F(e).y)), 5),
|
|
5708
5765
|
$("div", {
|
|
5709
|
-
style:
|
|
5766
|
+
style: X({
|
|
5710
5767
|
position: "absolute",
|
|
5711
5768
|
bottom: "0",
|
|
5712
|
-
left:
|
|
5769
|
+
left: F(e).mediaX + "px",
|
|
5713
5770
|
transform: "translateX(-50%)",
|
|
5714
5771
|
...a.value
|
|
5715
5772
|
})
|
|
5716
|
-
}, J(
|
|
5773
|
+
}, J(F(zi)(F(e).time, s.value)), 5)
|
|
5717
5774
|
], 64)) : Z("", !0);
|
|
5718
5775
|
}
|
|
5719
5776
|
}), ar = {
|
|
@@ -5729,9 +5786,9 @@ const hl = /* @__PURE__ */ pt({
|
|
|
5729
5786
|
format: { type: Function }
|
|
5730
5787
|
},
|
|
5731
5788
|
setup(i) {
|
|
5732
|
-
const t = i, e =
|
|
5733
|
-
() => t.format ?? ((f,
|
|
5734
|
-
), s =
|
|
5789
|
+
const t = i, e = P(() => t.sort ?? "none"), n = P(
|
|
5790
|
+
() => t.format ?? ((f, v) => v === "volume" ? Xe(f) : fs(f))
|
|
5791
|
+
), s = kt(), a = $i(s), r = xt(Ue), l = xt($s);
|
|
5735
5792
|
if (!r)
|
|
5736
5793
|
throw new Error("<InfoBar> must be used within <ChartContainer>: missing ThemeKey.");
|
|
5737
5794
|
if (!l)
|
|
@@ -5744,31 +5801,31 @@ const hl = /* @__PURE__ */ pt({
|
|
|
5744
5801
|
}), ct(() => {
|
|
5745
5802
|
s.off("overlayChange", d);
|
|
5746
5803
|
});
|
|
5747
|
-
const c =
|
|
5804
|
+
const c = P(() => {
|
|
5748
5805
|
h.value;
|
|
5749
5806
|
const f = a.value;
|
|
5750
5807
|
return f === null ? null : Ys(s, { time: f.time, sort: e.value, cacheKey: "infobar-hover" });
|
|
5751
|
-
}), u =
|
|
5752
|
-
() =>
|
|
5753
|
-
),
|
|
5754
|
-
function
|
|
5808
|
+
}), u = P(() => (h.value, Ko(s, { sort: e.value, cacheKey: "infobar-last" }))), g = P(() => c.value !== null && c.value.length > 0), b = P(
|
|
5809
|
+
() => g.value ? c.value : u.value
|
|
5810
|
+
), p = P(() => s.getDataInterval()), k = P(() => b.value.length === 0 ? 0 : g.value && a.value ? a.value.time : Math.max(...b.value.map((f) => f.data.time))), S = Ce(), m = P(() => typeof S.default == "function");
|
|
5811
|
+
function w(f) {
|
|
5755
5812
|
return "open" in f;
|
|
5756
5813
|
}
|
|
5757
|
-
return (f,
|
|
5814
|
+
return (f, v) => F(l) && F(r) && b.value.length > 0 ? (D(), vi(bi, {
|
|
5758
5815
|
key: 0,
|
|
5759
|
-
to:
|
|
5816
|
+
to: F(l)
|
|
5760
5817
|
}, [
|
|
5761
5818
|
$("div", {
|
|
5762
5819
|
"data-tooltip-legend": "",
|
|
5763
|
-
style:
|
|
5764
|
-
|
|
5820
|
+
style: X(
|
|
5821
|
+
m.value ? {
|
|
5765
5822
|
display: "flex",
|
|
5766
5823
|
alignItems: "center",
|
|
5767
5824
|
flexShrink: 0,
|
|
5768
|
-
fontSize:
|
|
5769
|
-
fontFamily:
|
|
5825
|
+
fontSize: F(r).typography.fontSize + "px",
|
|
5826
|
+
fontFamily: F(r).typography.fontFamily,
|
|
5770
5827
|
fontVariantNumeric: "tabular-nums",
|
|
5771
|
-
opacity:
|
|
5828
|
+
opacity: g.value ? 1 : 0.6,
|
|
5772
5829
|
transition: "opacity 0.2s ease",
|
|
5773
5830
|
pointerEvents: "none"
|
|
5774
5831
|
} : {
|
|
@@ -5778,70 +5835,70 @@ const hl = /* @__PURE__ */ pt({
|
|
|
5778
5835
|
flexWrap: "wrap",
|
|
5779
5836
|
padding: "4px 8px",
|
|
5780
5837
|
flexShrink: 0,
|
|
5781
|
-
fontSize:
|
|
5782
|
-
fontFamily:
|
|
5838
|
+
fontSize: F(r).typography.fontSize + "px",
|
|
5839
|
+
fontFamily: F(r).typography.fontFamily,
|
|
5783
5840
|
fontVariantNumeric: "tabular-nums",
|
|
5784
|
-
opacity:
|
|
5841
|
+
opacity: g.value ? 1 : 0.6,
|
|
5785
5842
|
transition: "opacity 0.2s ease",
|
|
5786
5843
|
pointerEvents: "none"
|
|
5787
5844
|
}
|
|
5788
5845
|
)
|
|
5789
5846
|
}, [
|
|
5790
|
-
|
|
5847
|
+
m.value ? te(f.$slots, "default", {
|
|
5791
5848
|
key: 0,
|
|
5792
|
-
snapshots:
|
|
5849
|
+
snapshots: b.value,
|
|
5793
5850
|
time: k.value,
|
|
5794
|
-
isHover:
|
|
5795
|
-
}) : (
|
|
5851
|
+
isHover: g.value
|
|
5852
|
+
}) : (D(), z(tt, { key: 1 }, [
|
|
5796
5853
|
$("span", {
|
|
5797
|
-
style:
|
|
5798
|
-
}, J(
|
|
5799
|
-
(
|
|
5800
|
-
key:
|
|
5854
|
+
style: X({ color: F(r).axis.textColor, marginRight: "2px" })
|
|
5855
|
+
}, J(F(zi)(k.value, p.value)), 5),
|
|
5856
|
+
(D(!0), z(tt, null, Ct(b.value, (x) => (D(), z(tt, {
|
|
5857
|
+
key: x.id
|
|
5801
5858
|
}, [
|
|
5802
|
-
|
|
5803
|
-
(
|
|
5804
|
-
{ label: "O", field: "open", val:
|
|
5805
|
-
{ label: "H", field: "high", val:
|
|
5806
|
-
{ label: "L", field: "low", val:
|
|
5807
|
-
{ label: "C", field: "close", val:
|
|
5808
|
-
], (
|
|
5809
|
-
key:
|
|
5859
|
+
w(x.data) ? (D(), z("span", ar, [
|
|
5860
|
+
(D(!0), z(tt, null, Ct([
|
|
5861
|
+
{ label: "O", field: "open", val: x.data.open },
|
|
5862
|
+
{ label: "H", field: "high", val: x.data.high },
|
|
5863
|
+
{ label: "L", field: "low", val: x.data.low },
|
|
5864
|
+
{ label: "C", field: "close", val: x.data.close }
|
|
5865
|
+
], (I) => (D(), z(tt, {
|
|
5866
|
+
key: I.label
|
|
5810
5867
|
}, [
|
|
5811
5868
|
$("span", {
|
|
5812
|
-
style:
|
|
5813
|
-
}, J(
|
|
5869
|
+
style: X({ color: F(r).axis.textColor, opacity: 0.5, marginLeft: "5px" })
|
|
5870
|
+
}, J(I.label), 5),
|
|
5814
5871
|
$("span", {
|
|
5815
|
-
style:
|
|
5816
|
-
color:
|
|
5817
|
-
|
|
5872
|
+
style: X({
|
|
5873
|
+
color: F(Zt)(
|
|
5874
|
+
x.data.close >= x.data.open ? F(r).candlestick.up.body : F(r).candlestick.down.body
|
|
5818
5875
|
),
|
|
5819
5876
|
fontWeight: 500,
|
|
5820
5877
|
marginLeft: "2px"
|
|
5821
5878
|
})
|
|
5822
|
-
}, J(n.value(
|
|
5879
|
+
}, J(n.value(I.val, I.field)), 5)
|
|
5823
5880
|
], 64))), 128)),
|
|
5824
|
-
|
|
5881
|
+
x.data.volume != null ? (D(), z(tt, { key: 0 }, [
|
|
5825
5882
|
$("span", {
|
|
5826
|
-
style:
|
|
5883
|
+
style: X({ color: F(r).axis.textColor, opacity: 0.5, marginLeft: "5px" })
|
|
5827
5884
|
}, "V", 4),
|
|
5828
5885
|
$("span", {
|
|
5829
|
-
style:
|
|
5830
|
-
}, J(n.value(
|
|
5886
|
+
style: X({ color: F(r).axis.textColor, fontWeight: 500, marginLeft: "2px" })
|
|
5887
|
+
}, J(n.value(x.data.volume, "volume")), 5)
|
|
5831
5888
|
], 64)) : Z("", !0)
|
|
5832
|
-
])) : (
|
|
5889
|
+
])) : (D(), z("span", or, [
|
|
5833
5890
|
$("span", {
|
|
5834
|
-
style:
|
|
5891
|
+
style: X({
|
|
5835
5892
|
width: "6px",
|
|
5836
5893
|
height: "6px",
|
|
5837
5894
|
borderRadius: "50%",
|
|
5838
|
-
background:
|
|
5895
|
+
background: x.color,
|
|
5839
5896
|
flexShrink: 0
|
|
5840
5897
|
})
|
|
5841
5898
|
}, null, 4),
|
|
5842
5899
|
$("span", {
|
|
5843
|
-
style:
|
|
5844
|
-
}, J(n.value(
|
|
5900
|
+
style: X({ color: x.color, fontWeight: 500 })
|
|
5901
|
+
}, J(n.value(x.data.value, "value")), 5)
|
|
5845
5902
|
]))
|
|
5846
5903
|
], 64))), 128))
|
|
5847
5904
|
], 64))
|
|
@@ -5856,12 +5913,12 @@ const hl = /* @__PURE__ */ pt({
|
|
|
5856
5913
|
mode: { default: "toggle" }
|
|
5857
5914
|
},
|
|
5858
5915
|
setup(i) {
|
|
5859
|
-
const t = i, e =
|
|
5916
|
+
const t = i, e = kt(), n = xt(Ue), s = xt(xn), a = xt(wn);
|
|
5860
5917
|
if (!n)
|
|
5861
5918
|
throw new Error("<Legend> must be used within <ChartContainer>: missing ThemeKey.");
|
|
5862
5919
|
if (!s || !a)
|
|
5863
5920
|
throw new Error("<Legend> must be used within <ChartContainer>: missing legend anchors.");
|
|
5864
|
-
const r =
|
|
5921
|
+
const r = P(() => t.position === "right" ? a.value : s.value), l = q(null), h = q(0), d = () => {
|
|
5865
5922
|
h.value++;
|
|
5866
5923
|
}, c = () => {
|
|
5867
5924
|
l.value = null;
|
|
@@ -5871,12 +5928,12 @@ const hl = /* @__PURE__ */ pt({
|
|
|
5871
5928
|
}), ct(() => {
|
|
5872
5929
|
e.off("overlayChange", d), e.off("seriesChange", c);
|
|
5873
5930
|
});
|
|
5874
|
-
function u(
|
|
5875
|
-
const { id:
|
|
5876
|
-
return { id:
|
|
5877
|
-
|
|
5931
|
+
function u(m) {
|
|
5932
|
+
const { id: w, seriesId: f, layerIndex: v, label: x, color: I, isDisabled: y } = m;
|
|
5933
|
+
return { id: w, seriesId: f, layerIndex: v, label: x, color: I, isDisabled: y, toggle: () => {
|
|
5934
|
+
v !== void 0 ? e.setLayerVisible(f, v, !e.isLayerVisible(f, v)) : e.setSeriesVisible(f, !e.isSeriesVisible(f));
|
|
5878
5935
|
}, isolate: () => {
|
|
5879
|
-
if (l.value ===
|
|
5936
|
+
if (l.value === w) {
|
|
5880
5937
|
e.batch(() => {
|
|
5881
5938
|
for (const C of e.getSeriesIds()) {
|
|
5882
5939
|
e.setSeriesVisible(C, !0);
|
|
@@ -5893,62 +5950,62 @@ const hl = /* @__PURE__ */ pt({
|
|
|
5893
5950
|
if (A) {
|
|
5894
5951
|
e.setSeriesVisible(C, C === f);
|
|
5895
5952
|
for (let _ = 0; _ < A.length; _++)
|
|
5896
|
-
e.setLayerVisible(C, _, C === f && _ ===
|
|
5953
|
+
e.setLayerVisible(C, _, C === f && _ === v);
|
|
5897
5954
|
} else
|
|
5898
|
-
e.setSeriesVisible(C, C ===
|
|
5955
|
+
e.setSeriesVisible(C, C === w);
|
|
5899
5956
|
}
|
|
5900
|
-
}), l.value =
|
|
5957
|
+
}), l.value = w;
|
|
5901
5958
|
} };
|
|
5902
5959
|
}
|
|
5903
|
-
function
|
|
5904
|
-
const
|
|
5905
|
-
for (const f of
|
|
5906
|
-
const
|
|
5907
|
-
if (
|
|
5908
|
-
const
|
|
5909
|
-
for (let
|
|
5910
|
-
const
|
|
5911
|
-
|
|
5960
|
+
function g(m) {
|
|
5961
|
+
const w = [];
|
|
5962
|
+
for (const f of m.getSeriesIds()) {
|
|
5963
|
+
const v = m.getSeriesLayers(f);
|
|
5964
|
+
if (v) {
|
|
5965
|
+
const x = m.getSeriesLabel(f);
|
|
5966
|
+
for (let I = 0; I < v.length; I++) {
|
|
5967
|
+
const y = `${f}_layer${I}`, T = m.isSeriesVisible(f) && m.isLayerVisible(f, I);
|
|
5968
|
+
w.push(
|
|
5912
5969
|
u({
|
|
5913
|
-
id:
|
|
5970
|
+
id: y,
|
|
5914
5971
|
seriesId: f,
|
|
5915
|
-
layerIndex:
|
|
5916
|
-
label:
|
|
5917
|
-
color:
|
|
5972
|
+
layerIndex: I,
|
|
5973
|
+
label: x ? `${x} ${I + 1}` : `Series ${I + 1}`,
|
|
5974
|
+
color: v[I].color,
|
|
5918
5975
|
isDisabled: !T
|
|
5919
5976
|
})
|
|
5920
5977
|
);
|
|
5921
5978
|
}
|
|
5922
5979
|
} else {
|
|
5923
|
-
const
|
|
5924
|
-
if (!
|
|
5925
|
-
const
|
|
5926
|
-
|
|
5980
|
+
const x = m.getSeriesColor(f);
|
|
5981
|
+
if (!x) continue;
|
|
5982
|
+
const I = m.getSeriesLabel(f), y = m.isSeriesVisible(f);
|
|
5983
|
+
w.push(
|
|
5927
5984
|
u({
|
|
5928
5985
|
id: f,
|
|
5929
5986
|
seriesId: f,
|
|
5930
5987
|
layerIndex: void 0,
|
|
5931
|
-
label:
|
|
5932
|
-
color:
|
|
5933
|
-
isDisabled: !
|
|
5988
|
+
label: I ?? "Series",
|
|
5989
|
+
color: x,
|
|
5990
|
+
isDisabled: !y
|
|
5934
5991
|
})
|
|
5935
5992
|
);
|
|
5936
5993
|
}
|
|
5937
5994
|
}
|
|
5938
|
-
return
|
|
5995
|
+
return w;
|
|
5939
5996
|
}
|
|
5940
|
-
const
|
|
5941
|
-
function S(
|
|
5942
|
-
t.mode === "isolate" || t.mode === "solo" ?
|
|
5997
|
+
const b = P(() => (h.value, l.value, g(e))), p = Ce(), k = P(() => typeof p.default == "function");
|
|
5998
|
+
function S(m) {
|
|
5999
|
+
t.mode === "isolate" || t.mode === "solo" ? m.isolate() : m.toggle();
|
|
5943
6000
|
}
|
|
5944
|
-
return (
|
|
6001
|
+
return (m, w) => r.value && F(n) ? (D(), vi(bi, {
|
|
5945
6002
|
key: 0,
|
|
5946
6003
|
to: r.value
|
|
5947
6004
|
}, [
|
|
5948
|
-
k.value &&
|
|
6005
|
+
k.value && b.value.length > 0 ? (D(), z("div", {
|
|
5949
6006
|
key: 0,
|
|
5950
6007
|
"data-legend": i.position,
|
|
5951
|
-
style:
|
|
6008
|
+
style: X({
|
|
5952
6009
|
display: "flex",
|
|
5953
6010
|
flexDirection: i.position === "right" ? "column" : "row",
|
|
5954
6011
|
flexWrap: "wrap",
|
|
@@ -5956,18 +6013,18 @@ const hl = /* @__PURE__ */ pt({
|
|
|
5956
6013
|
padding: i.position === "right" ? "8px 6px" : "6px 8px",
|
|
5957
6014
|
alignItems: i.position === "right" ? "flex-start" : "center",
|
|
5958
6015
|
justifyContent: i.position === "right" ? "flex-start" : "center",
|
|
5959
|
-
fontFamily:
|
|
5960
|
-
fontSize:
|
|
5961
|
-
color:
|
|
6016
|
+
fontFamily: F(n).typography.fontFamily,
|
|
6017
|
+
fontSize: F(n).axis.fontSize + "px",
|
|
6018
|
+
color: F(n).axis.textColor,
|
|
5962
6019
|
pointerEvents: "auto",
|
|
5963
6020
|
flexShrink: 0
|
|
5964
6021
|
})
|
|
5965
6022
|
}, [
|
|
5966
|
-
te(
|
|
5967
|
-
], 12, rr)) : i.items && i.items.length > 0 ? (
|
|
6023
|
+
te(m.$slots, "default", { items: b.value })
|
|
6024
|
+
], 12, rr)) : i.items && i.items.length > 0 ? (D(), z("div", {
|
|
5968
6025
|
key: 1,
|
|
5969
6026
|
"data-legend": i.position,
|
|
5970
|
-
style:
|
|
6027
|
+
style: X({
|
|
5971
6028
|
display: "flex",
|
|
5972
6029
|
flexDirection: i.position === "right" ? "column" : "row",
|
|
5973
6030
|
flexWrap: "wrap",
|
|
@@ -5975,15 +6032,15 @@ const hl = /* @__PURE__ */ pt({
|
|
|
5975
6032
|
padding: i.position === "right" ? "8px 6px" : "6px 8px",
|
|
5976
6033
|
alignItems: i.position === "right" ? "flex-start" : "center",
|
|
5977
6034
|
justifyContent: i.position === "right" ? "flex-start" : "center",
|
|
5978
|
-
fontFamily:
|
|
5979
|
-
fontSize:
|
|
5980
|
-
color:
|
|
6035
|
+
fontFamily: F(n).typography.fontFamily,
|
|
6036
|
+
fontSize: F(n).axis.fontSize + "px",
|
|
6037
|
+
color: F(n).axis.textColor,
|
|
5981
6038
|
pointerEvents: "auto",
|
|
5982
6039
|
flexShrink: 0
|
|
5983
6040
|
})
|
|
5984
6041
|
}, [
|
|
5985
|
-
(
|
|
5986
|
-
key:
|
|
6042
|
+
(D(!0), z(tt, null, Ct(i.items, (f, v) => (D(), z("div", {
|
|
6043
|
+
key: v,
|
|
5987
6044
|
style: {
|
|
5988
6045
|
display: "flex",
|
|
5989
6046
|
alignItems: "center",
|
|
@@ -5992,7 +6049,7 @@ const hl = /* @__PURE__ */ pt({
|
|
|
5992
6049
|
}
|
|
5993
6050
|
}, [
|
|
5994
6051
|
$("span", {
|
|
5995
|
-
style:
|
|
6052
|
+
style: X({
|
|
5996
6053
|
width: "8px",
|
|
5997
6054
|
height: "8px",
|
|
5998
6055
|
borderRadius: "2px",
|
|
@@ -6002,10 +6059,10 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6002
6059
|
}, null, 4),
|
|
6003
6060
|
$("span", hr, J(f.label), 1)
|
|
6004
6061
|
]))), 128))
|
|
6005
|
-
], 12, lr)) :
|
|
6062
|
+
], 12, lr)) : b.value.length > 0 ? (D(), z("div", {
|
|
6006
6063
|
key: 2,
|
|
6007
6064
|
"data-legend": i.position,
|
|
6008
|
-
style:
|
|
6065
|
+
style: X({
|
|
6009
6066
|
display: "flex",
|
|
6010
6067
|
flexDirection: i.position === "right" ? "column" : "row",
|
|
6011
6068
|
flexWrap: "wrap",
|
|
@@ -6013,18 +6070,18 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6013
6070
|
padding: i.position === "right" ? "8px 6px" : "6px 8px",
|
|
6014
6071
|
alignItems: i.position === "right" ? "flex-start" : "center",
|
|
6015
6072
|
justifyContent: i.position === "right" ? "flex-start" : "center",
|
|
6016
|
-
fontFamily:
|
|
6017
|
-
fontSize:
|
|
6018
|
-
color:
|
|
6073
|
+
fontFamily: F(n).typography.fontFamily,
|
|
6074
|
+
fontSize: F(n).axis.fontSize + "px",
|
|
6075
|
+
color: F(n).axis.textColor,
|
|
6019
6076
|
pointerEvents: "auto",
|
|
6020
6077
|
flexShrink: 0
|
|
6021
6078
|
})
|
|
6022
6079
|
}, [
|
|
6023
|
-
(
|
|
6080
|
+
(D(!0), z(tt, null, Ct(b.value, (f) => (D(), z("button", {
|
|
6024
6081
|
key: f.id,
|
|
6025
6082
|
type: "button",
|
|
6026
|
-
onClick: (
|
|
6027
|
-
style:
|
|
6083
|
+
onClick: (v) => S(f),
|
|
6084
|
+
style: X({
|
|
6028
6085
|
display: "flex",
|
|
6029
6086
|
alignItems: "center",
|
|
6030
6087
|
gap: "4px",
|
|
@@ -6042,7 +6099,7 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6042
6099
|
})
|
|
6043
6100
|
}, [
|
|
6044
6101
|
$("span", {
|
|
6045
|
-
style:
|
|
6102
|
+
style: X({
|
|
6046
6103
|
width: "8px",
|
|
6047
6104
|
height: "8px",
|
|
6048
6105
|
borderRadius: "2px",
|
|
@@ -6062,10 +6119,10 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6062
6119
|
height: {}
|
|
6063
6120
|
},
|
|
6064
6121
|
setup(i) {
|
|
6065
|
-
const t = i, e =
|
|
6122
|
+
const t = i, e = xt(Os), n = xt(yn), s = xt(Ue);
|
|
6066
6123
|
if (!e || !n || !s)
|
|
6067
6124
|
throw new Error("<Navigator> must be used within <ChartContainer>.");
|
|
6068
|
-
const a = q(null), r = Zi(null), l =
|
|
6125
|
+
const a = q(null), r = Zi(null), l = P(() => t.height ?? s.value.navigator.height);
|
|
6069
6126
|
return ht(
|
|
6070
6127
|
[a, () => n.value],
|
|
6071
6128
|
([h, d]) => {
|
|
@@ -6092,15 +6149,15 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6092
6149
|
), qs(() => {
|
|
6093
6150
|
var h;
|
|
6094
6151
|
(h = r.value) == null || h.destroy(), r.value = null;
|
|
6095
|
-
}), (h, d) =>
|
|
6152
|
+
}), (h, d) => F(e) ? (D(), vi(bi, {
|
|
6096
6153
|
key: 0,
|
|
6097
|
-
to:
|
|
6154
|
+
to: F(e)
|
|
6098
6155
|
}, [
|
|
6099
6156
|
$("div", {
|
|
6100
6157
|
ref_key: "stripRef",
|
|
6101
6158
|
ref: a,
|
|
6102
6159
|
"data-chart-navigator": "",
|
|
6103
|
-
style:
|
|
6160
|
+
style: X({
|
|
6104
6161
|
position: "relative",
|
|
6105
6162
|
width: "100%",
|
|
6106
6163
|
height: l.value + "px",
|
|
@@ -6137,29 +6194,29 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6137
6194
|
dt(() => {
|
|
6138
6195
|
e.value = !0;
|
|
6139
6196
|
});
|
|
6140
|
-
const n =
|
|
6197
|
+
const n = P(() => {
|
|
6141
6198
|
const r = t.format;
|
|
6142
6199
|
if (typeof r == "function") return r;
|
|
6143
6200
|
const l = new Intl.NumberFormat(t.locale, typeof r == "object" ? r : void 0);
|
|
6144
6201
|
return (h) => l.format(h);
|
|
6145
|
-
}), s =
|
|
6202
|
+
}), s = P(() => {
|
|
6146
6203
|
const r = n.value(t.value), l = [];
|
|
6147
6204
|
for (const h of r)
|
|
6148
6205
|
h >= "0" && h <= "9" ? l.push({ type: "digit", value: h }) : l.push({ type: "symbol", value: h });
|
|
6149
6206
|
return l;
|
|
6150
6207
|
}), a = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
6151
|
-
return (r, l) => (
|
|
6152
|
-
(
|
|
6153
|
-
h.type === "digit" ? (
|
|
6208
|
+
return (r, l) => (D(), z("span", fr, [
|
|
6209
|
+
(D(!0), z(tt, null, Ct(s.value, (h, d) => (D(), z(tt, { key: d }, [
|
|
6210
|
+
h.type === "digit" ? (D(), z("span", pr, [
|
|
6154
6211
|
$("span", {
|
|
6155
|
-
style:
|
|
6212
|
+
style: X({
|
|
6156
6213
|
display: "flex",
|
|
6157
6214
|
flexDirection: "column",
|
|
6158
6215
|
transform: "translateY(" + -parseInt(h.value) * 1.2 + "em)",
|
|
6159
6216
|
transition: e.value ? "transform " + i.spinDuration + "ms cubic-bezier(0.16, 1, 0.3, 1)" : "none"
|
|
6160
6217
|
})
|
|
6161
6218
|
}, [
|
|
6162
|
-
(
|
|
6219
|
+
(D(), z(tt, null, Ct(a, (c) => $("span", {
|
|
6163
6220
|
key: c,
|
|
6164
6221
|
style: {
|
|
6165
6222
|
display: "flex",
|
|
@@ -6169,7 +6226,7 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6169
6226
|
}
|
|
6170
6227
|
}, J(c), 1)), 64))
|
|
6171
6228
|
], 4)
|
|
6172
|
-
])) : (
|
|
6229
|
+
])) : (D(), z("span", gr, J(h.value), 1))
|
|
6173
6230
|
], 64))), 128))
|
|
6174
6231
|
]));
|
|
6175
6232
|
}
|
|
@@ -6182,69 +6239,69 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6182
6239
|
position: { default: "bottom" }
|
|
6183
6240
|
},
|
|
6184
6241
|
setup(i) {
|
|
6185
|
-
const t = i, e =
|
|
6242
|
+
const t = i, e = xt(xn), n = xt(wn);
|
|
6186
6243
|
if (!e || !n)
|
|
6187
6244
|
throw new Error("<PieLegend> must be used within <ChartContainer>: missing legend anchors.");
|
|
6188
|
-
const s =
|
|
6245
|
+
const s = P(() => t.position === "right" ? n.value : t.position === "bottom" ? e.value : null), a = P(() => t.mode ?? "both"), r = P(() => t.format ?? Xe), l = kt(), h = tr(), d = Ce(), c = P(() => typeof d.default == "function"), u = q(0), g = () => {
|
|
6189
6246
|
u.value++;
|
|
6190
6247
|
};
|
|
6191
6248
|
dt(() => {
|
|
6192
|
-
l.on("overlayChange",
|
|
6249
|
+
l.on("overlayChange", g), l.getSeriesIds().length > 0 && u.value++;
|
|
6193
6250
|
}), ct(() => {
|
|
6194
|
-
l.off("overlayChange",
|
|
6251
|
+
l.off("overlayChange", g);
|
|
6195
6252
|
});
|
|
6196
|
-
function
|
|
6197
|
-
if (
|
|
6198
|
-
const f =
|
|
6253
|
+
function b(m, w) {
|
|
6254
|
+
if (w !== void 0) return w;
|
|
6255
|
+
const f = m.getSeriesIdsByType("pie", { visibleOnly: !0 });
|
|
6199
6256
|
return f.length > 0 ? f[0] : null;
|
|
6200
6257
|
}
|
|
6201
|
-
const
|
|
6202
|
-
return (
|
|
6258
|
+
const p = P(() => h.value), k = P(() => (u.value, b(l, t.seriesId))), S = P(() => (u.value, k.value === null ? [] : l.getSliceInfo(k.value) ?? []));
|
|
6259
|
+
return (m, w) => c.value && S.value.length > 0 ? te(m.$slots, "default", {
|
|
6203
6260
|
key: 0,
|
|
6204
6261
|
slices: S.value,
|
|
6205
6262
|
mode: a.value,
|
|
6206
6263
|
format: r.value
|
|
6207
|
-
}) : S.value.length > 0 && s.value ? (
|
|
6264
|
+
}) : S.value.length > 0 && s.value ? (D(), vi(bi, {
|
|
6208
6265
|
key: 1,
|
|
6209
6266
|
to: s.value
|
|
6210
6267
|
}, [
|
|
6211
6268
|
$("div", {
|
|
6212
6269
|
"data-chart-pie-legend": "",
|
|
6213
6270
|
"data-chart-pie-legend-position": i.position,
|
|
6214
|
-
style:
|
|
6271
|
+
style: X({
|
|
6215
6272
|
display: "flex",
|
|
6216
6273
|
flexDirection: "column",
|
|
6217
6274
|
gap: "6px",
|
|
6218
6275
|
padding: "6px 10px",
|
|
6219
|
-
fontFamily:
|
|
6220
|
-
fontSize:
|
|
6221
|
-
color:
|
|
6276
|
+
fontFamily: p.value.typography.fontFamily,
|
|
6277
|
+
fontSize: p.value.typography.fontSize + "px",
|
|
6278
|
+
color: p.value.tooltip.textColor,
|
|
6222
6279
|
pointerEvents: "auto"
|
|
6223
6280
|
})
|
|
6224
6281
|
}, [
|
|
6225
|
-
(
|
|
6226
|
-
key:
|
|
6282
|
+
(D(!0), z(tt, null, Ct(S.value, (f, v) => (D(), z("div", {
|
|
6283
|
+
key: v,
|
|
6227
6284
|
style: { display: "flex", alignItems: "center", gap: "10px" }
|
|
6228
6285
|
}, [
|
|
6229
6286
|
$("span", {
|
|
6230
|
-
style:
|
|
6287
|
+
style: X({ width: "10px", height: "10px", borderRadius: "50%", background: f.color, flexShrink: 0 })
|
|
6231
6288
|
}, null, 4),
|
|
6232
6289
|
$("span", br, J(f.label), 1),
|
|
6233
|
-
a.value === "value" || a.value === "both" ? (
|
|
6290
|
+
a.value === "value" || a.value === "both" ? (D(), z("span", {
|
|
6234
6291
|
key: 0,
|
|
6235
|
-
style:
|
|
6292
|
+
style: X({
|
|
6236
6293
|
fontWeight: 600,
|
|
6237
6294
|
fontVariantNumeric: "tabular-nums",
|
|
6238
6295
|
minWidth: a.value === "value" ? "40px" : void 0,
|
|
6239
6296
|
textAlign: "right"
|
|
6240
6297
|
})
|
|
6241
6298
|
}, J(r.value(f.value)), 5)) : Z("", !0),
|
|
6242
|
-
a.value === "percent" || a.value === "both" ? (
|
|
6299
|
+
a.value === "percent" || a.value === "both" ? (D(), z("span", {
|
|
6243
6300
|
key: 1,
|
|
6244
|
-
style:
|
|
6301
|
+
style: X({
|
|
6245
6302
|
opacity: a.value === "percent" ? 1 : 0.5,
|
|
6246
6303
|
fontWeight: a.value === "percent" ? 600 : 400,
|
|
6247
|
-
fontSize: (a.value === "percent" ?
|
|
6304
|
+
fontSize: (a.value === "percent" ? p.value.typography.fontSize : p.value.axis.fontSize) + "px",
|
|
6248
6305
|
fontVariantNumeric: "tabular-nums",
|
|
6249
6306
|
minWidth: "40px",
|
|
6250
6307
|
textAlign: "right"
|
|
@@ -6252,44 +6309,44 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6252
6309
|
}, J(f.percent.toFixed(1)) + "% ", 5)) : Z("", !0)
|
|
6253
6310
|
]))), 128))
|
|
6254
6311
|
], 12, vr)
|
|
6255
|
-
], 8, ["to"])) : S.value.length > 0 ? (
|
|
6312
|
+
], 8, ["to"])) : S.value.length > 0 ? (D(), z("div", {
|
|
6256
6313
|
key: 2,
|
|
6257
6314
|
"data-chart-pie-legend": "",
|
|
6258
6315
|
"data-chart-pie-legend-position": "overlay",
|
|
6259
|
-
style:
|
|
6316
|
+
style: X({
|
|
6260
6317
|
display: "flex",
|
|
6261
6318
|
flexDirection: "column",
|
|
6262
6319
|
gap: "6px",
|
|
6263
6320
|
padding: "8px 12px",
|
|
6264
|
-
fontFamily:
|
|
6265
|
-
fontSize:
|
|
6266
|
-
color:
|
|
6321
|
+
fontFamily: p.value.typography.fontFamily,
|
|
6322
|
+
fontSize: p.value.typography.fontSize + "px",
|
|
6323
|
+
color: p.value.tooltip.textColor,
|
|
6267
6324
|
pointerEvents: "auto"
|
|
6268
6325
|
})
|
|
6269
6326
|
}, [
|
|
6270
|
-
(
|
|
6271
|
-
key:
|
|
6327
|
+
(D(!0), z(tt, null, Ct(S.value, (f, v) => (D(), z("div", {
|
|
6328
|
+
key: v,
|
|
6272
6329
|
style: { display: "flex", alignItems: "center", gap: "10px" }
|
|
6273
6330
|
}, [
|
|
6274
6331
|
$("span", {
|
|
6275
|
-
style:
|
|
6332
|
+
style: X({ width: "10px", height: "10px", borderRadius: "50%", background: f.color, flexShrink: 0 })
|
|
6276
6333
|
}, null, 4),
|
|
6277
6334
|
$("span", yr, J(f.label), 1),
|
|
6278
|
-
a.value === "value" || a.value === "both" ? (
|
|
6335
|
+
a.value === "value" || a.value === "both" ? (D(), z("span", {
|
|
6279
6336
|
key: 0,
|
|
6280
|
-
style:
|
|
6337
|
+
style: X({
|
|
6281
6338
|
fontWeight: 600,
|
|
6282
6339
|
fontVariantNumeric: "tabular-nums",
|
|
6283
6340
|
minWidth: a.value === "value" ? "40px" : void 0,
|
|
6284
6341
|
textAlign: "right"
|
|
6285
6342
|
})
|
|
6286
6343
|
}, J(r.value(f.value)), 5)) : Z("", !0),
|
|
6287
|
-
a.value === "percent" || a.value === "both" ? (
|
|
6344
|
+
a.value === "percent" || a.value === "both" ? (D(), z("span", {
|
|
6288
6345
|
key: 1,
|
|
6289
|
-
style:
|
|
6346
|
+
style: X({
|
|
6290
6347
|
opacity: a.value === "percent" ? 1 : 0.5,
|
|
6291
6348
|
fontWeight: a.value === "percent" ? 600 : 400,
|
|
6292
|
-
fontSize: (a.value === "percent" ?
|
|
6349
|
+
fontSize: (a.value === "percent" ? p.value.typography.fontSize : p.value.axis.fontSize) + "px",
|
|
6293
6350
|
fontVariantNumeric: "tabular-nums",
|
|
6294
6351
|
minWidth: "40px",
|
|
6295
6352
|
textAlign: "right"
|
|
@@ -6305,7 +6362,7 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6305
6362
|
format: { type: Function }
|
|
6306
6363
|
},
|
|
6307
6364
|
setup(i) {
|
|
6308
|
-
const t = i, e =
|
|
6365
|
+
const t = i, e = P(() => t.format ?? Xe), n = kt(), s = $i(n), a = Ce(), r = P(() => typeof a.default == "function"), l = q(0), h = () => {
|
|
6309
6366
|
l.value++;
|
|
6310
6367
|
};
|
|
6311
6368
|
dt(() => {
|
|
@@ -6313,57 +6370,57 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6313
6370
|
}), ct(() => {
|
|
6314
6371
|
n.off("overlayChange", h);
|
|
6315
6372
|
});
|
|
6316
|
-
function d(
|
|
6317
|
-
if (
|
|
6318
|
-
const f =
|
|
6373
|
+
function d(m, w) {
|
|
6374
|
+
if (w !== void 0) return w;
|
|
6375
|
+
const f = m.getSeriesIdsByType("pie", { visibleOnly: !0 });
|
|
6319
6376
|
return f.length > 0 ? f[0] : null;
|
|
6320
6377
|
}
|
|
6321
|
-
const c =
|
|
6378
|
+
const c = P(() => (l.value, n.getTheme())), u = P(() => (l.value, d(n, t.seriesId))), g = P(() => (s.value, l.value, u.value === null ? null : n.getHoverInfo(u.value))), b = q(null), p = q(null);
|
|
6322
6379
|
let k = null;
|
|
6323
|
-
ns((
|
|
6380
|
+
ns((m) => {
|
|
6324
6381
|
if (!r.value) return;
|
|
6325
|
-
const
|
|
6326
|
-
!
|
|
6327
|
-
var
|
|
6328
|
-
const
|
|
6329
|
-
if (!
|
|
6330
|
-
const
|
|
6331
|
-
(!
|
|
6332
|
-
}), k.observe(
|
|
6382
|
+
const w = b.value;
|
|
6383
|
+
!w || typeof ResizeObserver > "u" || (k = new ResizeObserver((f) => {
|
|
6384
|
+
var I;
|
|
6385
|
+
const v = (I = f[0]) == null ? void 0 : I.contentRect;
|
|
6386
|
+
if (!v) return;
|
|
6387
|
+
const x = p.value;
|
|
6388
|
+
(!x || x.width !== v.width || x.height !== v.height) && (p.value = { width: v.width, height: v.height });
|
|
6389
|
+
}), k.observe(w), m(() => {
|
|
6333
6390
|
k == null || k.disconnect(), k = null;
|
|
6334
6391
|
}));
|
|
6335
6392
|
});
|
|
6336
|
-
const S =
|
|
6337
|
-
if (!s.value || !
|
|
6338
|
-
const
|
|
6393
|
+
const S = P(() => {
|
|
6394
|
+
if (!s.value || !g.value) return null;
|
|
6395
|
+
const m = n.getMediaSize();
|
|
6339
6396
|
if (r.value) {
|
|
6340
|
-
const
|
|
6341
|
-
return
|
|
6397
|
+
const w = p.value;
|
|
6398
|
+
return w ? Di({
|
|
6342
6399
|
x: s.value.mediaX,
|
|
6343
6400
|
y: s.value.mediaY,
|
|
6344
|
-
chartWidth:
|
|
6345
|
-
chartHeight:
|
|
6346
|
-
tooltipWidth:
|
|
6347
|
-
tooltipHeight:
|
|
6401
|
+
chartWidth: m.width,
|
|
6402
|
+
chartHeight: m.height,
|
|
6403
|
+
tooltipWidth: w.width,
|
|
6404
|
+
tooltipHeight: w.height,
|
|
6348
6405
|
offsetX: 16,
|
|
6349
6406
|
offsetY: 16
|
|
6350
6407
|
}) : { left: 0, top: 0 };
|
|
6351
6408
|
}
|
|
6352
|
-
return
|
|
6409
|
+
return Di({
|
|
6353
6410
|
x: s.value.mediaX,
|
|
6354
6411
|
y: s.value.mediaY,
|
|
6355
|
-
chartWidth:
|
|
6356
|
-
chartHeight:
|
|
6412
|
+
chartWidth: m.width,
|
|
6413
|
+
chartHeight: m.height,
|
|
6357
6414
|
tooltipWidth: Tr,
|
|
6358
6415
|
tooltipHeight: Ir,
|
|
6359
6416
|
offsetX: 16,
|
|
6360
6417
|
offsetY: 16
|
|
6361
6418
|
});
|
|
6362
6419
|
});
|
|
6363
|
-
return (
|
|
6364
|
-
|
|
6420
|
+
return (m, w) => (D(), z(tt, null, [
|
|
6421
|
+
g.value && F(s) && S.value && !r.value ? (D(), z("div", {
|
|
6365
6422
|
key: 0,
|
|
6366
|
-
style:
|
|
6423
|
+
style: X({
|
|
6367
6424
|
position: "absolute",
|
|
6368
6425
|
left: S.value.left + "px",
|
|
6369
6426
|
top: S.value.top + "px",
|
|
@@ -6386,40 +6443,40 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6386
6443
|
}, [
|
|
6387
6444
|
$("div", xr, [
|
|
6388
6445
|
$("span", {
|
|
6389
|
-
style:
|
|
6446
|
+
style: X({
|
|
6390
6447
|
width: "10px",
|
|
6391
6448
|
height: "10px",
|
|
6392
6449
|
borderRadius: "50%",
|
|
6393
|
-
background:
|
|
6450
|
+
background: g.value.color,
|
|
6394
6451
|
flexShrink: 0
|
|
6395
6452
|
})
|
|
6396
6453
|
}, null, 4),
|
|
6397
|
-
$("span", wr, J(
|
|
6454
|
+
$("span", wr, J(g.value.label), 1)
|
|
6398
6455
|
]),
|
|
6399
6456
|
$("div", kr, [
|
|
6400
|
-
$("span", Sr, J(e.value(
|
|
6401
|
-
$("span", Mr, J(
|
|
6457
|
+
$("span", Sr, J(e.value(g.value.value)), 1),
|
|
6458
|
+
$("span", Mr, J(g.value.percent.toFixed(1)) + "%", 1)
|
|
6402
6459
|
])
|
|
6403
6460
|
], 4)) : Z("", !0),
|
|
6404
|
-
|
|
6461
|
+
g.value && F(s) && S.value && r.value ? (D(), z("div", {
|
|
6405
6462
|
key: 1,
|
|
6406
6463
|
ref_key: "containerRef",
|
|
6407
|
-
ref:
|
|
6408
|
-
"data-measured":
|
|
6409
|
-
style:
|
|
6464
|
+
ref: b,
|
|
6465
|
+
"data-measured": p.value !== null ? "true" : "false",
|
|
6466
|
+
style: X({
|
|
6410
6467
|
position: "absolute",
|
|
6411
6468
|
left: S.value.left + "px",
|
|
6412
6469
|
top: S.value.top + "px",
|
|
6413
6470
|
pointerEvents: "none",
|
|
6414
6471
|
zIndex: 10,
|
|
6415
6472
|
width: "max-content",
|
|
6416
|
-
maxWidth:
|
|
6473
|
+
maxWidth: F(n).getMediaSize().width + "px",
|
|
6417
6474
|
boxSizing: "border-box",
|
|
6418
|
-
visibility:
|
|
6475
|
+
visibility: p.value !== null ? "visible" : "hidden"
|
|
6419
6476
|
})
|
|
6420
6477
|
}, [
|
|
6421
|
-
te(
|
|
6422
|
-
info:
|
|
6478
|
+
te(m.$slots, "default", {
|
|
6479
|
+
info: g.value,
|
|
6423
6480
|
format: e.value
|
|
6424
6481
|
})
|
|
6425
6482
|
], 12, Cr)) : Z("", !0)
|
|
@@ -6432,7 +6489,7 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6432
6489
|
minLabelSpacing: {}
|
|
6433
6490
|
},
|
|
6434
6491
|
setup(i) {
|
|
6435
|
-
const t = i, e =
|
|
6492
|
+
const t = i, e = kt(), n = Hs(e), s = () => {
|
|
6436
6493
|
e.setTimeAxisLabelDensity({
|
|
6437
6494
|
labelCount: t.labelCount ?? null,
|
|
6438
6495
|
minLabelSpacing: t.minLabelSpacing ?? null
|
|
@@ -6441,40 +6498,40 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6441
6498
|
s(), ht(() => [t.labelCount, t.minLabelSpacing], s), ct(() => {
|
|
6442
6499
|
e.setTimeAxisLabelDensity({ labelCount: null, minLabelSpacing: null });
|
|
6443
6500
|
});
|
|
6444
|
-
const a = /* @__PURE__ */ new Map(), r =
|
|
6501
|
+
const a = /* @__PURE__ */ new Map(), r = P(() => e.getTheme()), l = P(() => {
|
|
6445
6502
|
n.value;
|
|
6446
|
-
const h = e.getDataInterval(), { ticks: d, tickInterval: c } = e.timeScale.niceTickValues(h), u = new Set(d),
|
|
6447
|
-
for (const
|
|
6448
|
-
a.has(
|
|
6449
|
-
for (const [
|
|
6450
|
-
u.has(
|
|
6451
|
-
for (const [
|
|
6452
|
-
|
|
6503
|
+
const h = e.getDataInterval(), { ticks: d, tickInterval: c } = e.timeScale.niceTickValues(h), u = new Set(d), g = performance.now();
|
|
6504
|
+
for (const b of d)
|
|
6505
|
+
a.has(b) ? a.get(b).opacity = 1 : a.set(b, { opacity: 1, addedAt: g });
|
|
6506
|
+
for (const [b, p] of a)
|
|
6507
|
+
u.has(b) || (p.opacity = 0);
|
|
6508
|
+
for (const [b, p] of a)
|
|
6509
|
+
p.opacity === 0 && g - p.addedAt > 5e3 && a.delete(b);
|
|
6453
6510
|
return {
|
|
6454
6511
|
allTicks: Array.from(a.entries()),
|
|
6455
6512
|
tickInterval: c
|
|
6456
6513
|
};
|
|
6457
6514
|
});
|
|
6458
|
-
return (h, d) => (
|
|
6459
|
-
style:
|
|
6515
|
+
return (h, d) => (D(), z("div", {
|
|
6516
|
+
style: X({
|
|
6460
6517
|
position: "absolute",
|
|
6461
6518
|
left: "0",
|
|
6462
6519
|
bottom: "0",
|
|
6463
|
-
right:
|
|
6464
|
-
height:
|
|
6520
|
+
right: F(e).yAxisWidth + "px",
|
|
6521
|
+
height: F(e).xAxisHeight + "px",
|
|
6465
6522
|
pointerEvents: "none",
|
|
6466
6523
|
display: "flex",
|
|
6467
6524
|
alignItems: "center"
|
|
6468
6525
|
})
|
|
6469
6526
|
}, [
|
|
6470
|
-
(
|
|
6527
|
+
(D(!0), z(tt, null, Ct(l.value.allTicks, ([c, u]) => (D(), z("span", {
|
|
6471
6528
|
key: c,
|
|
6472
|
-
style:
|
|
6529
|
+
style: X({
|
|
6473
6530
|
position: "absolute",
|
|
6474
|
-
left:
|
|
6531
|
+
left: F(e).timeScale.timeToX(c) + "px",
|
|
6475
6532
|
transform: "translateX(-50%)",
|
|
6476
|
-
color:
|
|
6477
|
-
fontSize:
|
|
6533
|
+
color: F(vs)(r.value, "x"),
|
|
6534
|
+
fontSize: F(ms)(r.value, "x") + "px",
|
|
6478
6535
|
fontFamily: r.value.typography.fontFamily,
|
|
6479
6536
|
userSelect: "none",
|
|
6480
6537
|
whiteSpace: "nowrap",
|
|
@@ -6482,7 +6539,7 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6482
6539
|
transition: "opacity 0.25s ease",
|
|
6483
6540
|
willChange: "opacity"
|
|
6484
6541
|
})
|
|
6485
|
-
}, J(
|
|
6542
|
+
}, J(F(zi)(c, l.value.tickInterval)), 5))), 128))
|
|
6486
6543
|
], 4));
|
|
6487
6544
|
}
|
|
6488
6545
|
}), bl = /* @__PURE__ */ pt({
|
|
@@ -6491,39 +6548,39 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6491
6548
|
sub: {}
|
|
6492
6549
|
},
|
|
6493
6550
|
setup(i) {
|
|
6494
|
-
const t =
|
|
6551
|
+
const t = xt(Es), e = xt(Ue), n = Ce(), s = P(() => typeof n.sub == "function");
|
|
6495
6552
|
if (!t)
|
|
6496
6553
|
throw new Error("<Title> must be used within <ChartContainer>: missing TitleAnchorKey.");
|
|
6497
6554
|
if (!e)
|
|
6498
6555
|
throw new Error("<Title> must be used within <ChartContainer>: missing ThemeKey.");
|
|
6499
|
-
return (a, r) =>
|
|
6556
|
+
return (a, r) => F(t) ? (D(), vi(bi, {
|
|
6500
6557
|
key: 0,
|
|
6501
|
-
to:
|
|
6558
|
+
to: F(t)
|
|
6502
6559
|
}, [
|
|
6503
6560
|
$("div", {
|
|
6504
6561
|
"data-chart-title": "",
|
|
6505
|
-
style:
|
|
6562
|
+
style: X({
|
|
6506
6563
|
display: "flex",
|
|
6507
6564
|
alignItems: "baseline",
|
|
6508
6565
|
gap: "6px",
|
|
6509
|
-
padding: "6px 8px
|
|
6566
|
+
padding: "6px 8px 0",
|
|
6510
6567
|
flexShrink: 0,
|
|
6511
|
-
fontFamily:
|
|
6512
|
-
fontSize:
|
|
6568
|
+
fontFamily: F(e).typography.fontFamily,
|
|
6569
|
+
fontSize: F(e).typography.fontSize + "px",
|
|
6513
6570
|
fontWeight: 600,
|
|
6514
|
-
color:
|
|
6571
|
+
color: F(e).tooltip.textColor,
|
|
6515
6572
|
pointerEvents: "none"
|
|
6516
6573
|
})
|
|
6517
6574
|
}, [
|
|
6518
6575
|
$("span", null, [
|
|
6519
6576
|
te(a.$slots, "default")
|
|
6520
6577
|
]),
|
|
6521
|
-
s.value || i.sub ? (
|
|
6578
|
+
s.value || i.sub ? (D(), z("span", {
|
|
6522
6579
|
key: 0,
|
|
6523
|
-
style:
|
|
6580
|
+
style: X({
|
|
6524
6581
|
fontWeight: 400,
|
|
6525
|
-
color:
|
|
6526
|
-
fontSize:
|
|
6582
|
+
color: F(e).axis.textColor,
|
|
6583
|
+
fontSize: F(e).axis.fontSize + "px"
|
|
6527
6584
|
})
|
|
6528
6585
|
}, [
|
|
6529
6586
|
te(a.$slots, "sub", {}, () => [
|
|
@@ -6546,9 +6603,9 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6546
6603
|
format: { type: Function }
|
|
6547
6604
|
},
|
|
6548
6605
|
setup(i) {
|
|
6549
|
-
const t = i, e =
|
|
6550
|
-
() => t.format ?? ((
|
|
6551
|
-
), s =
|
|
6606
|
+
const t = i, e = P(() => t.sort ?? "none"), n = P(
|
|
6607
|
+
() => t.format ?? ((v, x) => x === "volume" ? Xe(v) : fs(v))
|
|
6608
|
+
), s = kt(), a = $i(s), r = q(0), l = () => {
|
|
6552
6609
|
r.value++;
|
|
6553
6610
|
};
|
|
6554
6611
|
dt(() => {
|
|
@@ -6556,62 +6613,62 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6556
6613
|
}), ct(() => {
|
|
6557
6614
|
s.off("overlayChange", l);
|
|
6558
6615
|
});
|
|
6559
|
-
const h =
|
|
6616
|
+
const h = P(() => s.getTheme()), d = P(() => s.getDataInterval()), c = P(() => (r.value, a.value ? Ys(s, {
|
|
6560
6617
|
time: a.value.time,
|
|
6561
6618
|
sort: e.value,
|
|
6562
6619
|
cacheKey: "tooltip"
|
|
6563
|
-
}) : [])), u =
|
|
6564
|
-
var
|
|
6565
|
-
return ((
|
|
6566
|
-
}),
|
|
6620
|
+
}) : [])), u = P(() => {
|
|
6621
|
+
var v;
|
|
6622
|
+
return ((v = a.value) == null ? void 0 : v.time) ?? 0;
|
|
6623
|
+
}), g = Ce(), b = P(() => typeof g.default == "function"), p = q(null), k = q(null);
|
|
6567
6624
|
let S = null;
|
|
6568
|
-
ns((
|
|
6569
|
-
if (!
|
|
6570
|
-
const
|
|
6571
|
-
!
|
|
6625
|
+
ns((v) => {
|
|
6626
|
+
if (!b.value) return;
|
|
6627
|
+
const x = p.value;
|
|
6628
|
+
!x || typeof ResizeObserver > "u" || (S = new ResizeObserver((I) => {
|
|
6572
6629
|
var L;
|
|
6573
|
-
const
|
|
6574
|
-
if (!
|
|
6630
|
+
const y = (L = I[0]) == null ? void 0 : L.contentRect;
|
|
6631
|
+
if (!y) return;
|
|
6575
6632
|
const T = k.value;
|
|
6576
|
-
(!T || T.width !==
|
|
6577
|
-
}), S.observe(
|
|
6633
|
+
(!T || T.width !== y.width || T.height !== y.height) && (k.value = { width: y.width, height: y.height });
|
|
6634
|
+
}), S.observe(x), v(() => {
|
|
6578
6635
|
S == null || S.disconnect(), S = null;
|
|
6579
6636
|
}));
|
|
6580
6637
|
});
|
|
6581
|
-
const
|
|
6638
|
+
const m = P(() => {
|
|
6582
6639
|
if (!a.value || c.value.length === 0) return null;
|
|
6583
|
-
const
|
|
6584
|
-
if (
|
|
6640
|
+
const v = s.getMediaSize(), x = v.width - s.yAxisWidth, I = v.height - s.xAxisHeight;
|
|
6641
|
+
if (b.value) {
|
|
6585
6642
|
const A = k.value;
|
|
6586
|
-
return A ?
|
|
6643
|
+
return A ? Di({
|
|
6587
6644
|
x: a.value.mediaX,
|
|
6588
6645
|
y: a.value.mediaY,
|
|
6589
|
-
chartWidth:
|
|
6590
|
-
chartHeight:
|
|
6646
|
+
chartWidth: x,
|
|
6647
|
+
chartHeight: I,
|
|
6591
6648
|
tooltipWidth: A.width,
|
|
6592
6649
|
tooltipHeight: A.height
|
|
6593
6650
|
}) : { left: 0, top: 0 };
|
|
6594
6651
|
}
|
|
6595
|
-
const
|
|
6596
|
-
return
|
|
6652
|
+
const y = c.value.some((A) => "open" in A.data), T = c.value.filter((A) => !("open" in A.data)).length, L = 160, C = y ? 140 : 40 + T * 22;
|
|
6653
|
+
return Di({
|
|
6597
6654
|
x: a.value.mediaX,
|
|
6598
6655
|
y: a.value.mediaY,
|
|
6599
|
-
chartWidth:
|
|
6600
|
-
chartHeight:
|
|
6656
|
+
chartWidth: x,
|
|
6657
|
+
chartHeight: I,
|
|
6601
6658
|
tooltipWidth: L,
|
|
6602
6659
|
tooltipHeight: C
|
|
6603
6660
|
});
|
|
6604
|
-
}),
|
|
6605
|
-
function f(
|
|
6606
|
-
return "open" in
|
|
6661
|
+
}), w = P(() => !b.value || k.value !== null);
|
|
6662
|
+
function f(v) {
|
|
6663
|
+
return "open" in v;
|
|
6607
6664
|
}
|
|
6608
|
-
return (
|
|
6609
|
-
|
|
6665
|
+
return (v, x) => (D(), z(tt, null, [
|
|
6666
|
+
F(a) && c.value.length > 0 && m.value && !b.value ? (D(), z("div", {
|
|
6610
6667
|
key: 0,
|
|
6611
|
-
style:
|
|
6668
|
+
style: X({
|
|
6612
6669
|
position: "absolute",
|
|
6613
|
-
left:
|
|
6614
|
-
top:
|
|
6670
|
+
left: m.value.left + "px",
|
|
6671
|
+
top: m.value.top + "px",
|
|
6615
6672
|
pointerEvents: "none",
|
|
6616
6673
|
background: h.value.tooltip.background,
|
|
6617
6674
|
backdropFilter: "blur(12px)",
|
|
@@ -6630,7 +6687,7 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6630
6687
|
})
|
|
6631
6688
|
}, [
|
|
6632
6689
|
$("div", {
|
|
6633
|
-
style:
|
|
6690
|
+
style: X({
|
|
6634
6691
|
fontSize: h.value.axis.fontSize + "px",
|
|
6635
6692
|
color: h.value.axis.textColor,
|
|
6636
6693
|
marginBottom: "8px",
|
|
@@ -6638,62 +6695,62 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6638
6695
|
borderBottom: "1px solid " + h.value.tooltip.borderColor,
|
|
6639
6696
|
letterSpacing: "0.02em"
|
|
6640
6697
|
})
|
|
6641
|
-
}, J(
|
|
6642
|
-
(
|
|
6643
|
-
key:
|
|
6698
|
+
}, J(F(Fa)(u.value)) + " " + J(F(zi)(u.value, d.value)), 5),
|
|
6699
|
+
(D(!0), z(tt, null, Ct(c.value, (I) => (D(), z(tt, {
|
|
6700
|
+
key: I.id
|
|
6644
6701
|
}, [
|
|
6645
|
-
f(
|
|
6646
|
-
(
|
|
6647
|
-
{ label: "Open", val:
|
|
6648
|
-
{ label: "High", val:
|
|
6649
|
-
{ label: "Low", val:
|
|
6650
|
-
{ label: "Close", val:
|
|
6651
|
-
], (
|
|
6652
|
-
key:
|
|
6702
|
+
f(I.data) ? (D(), z("div", Rr, [
|
|
6703
|
+
(D(!0), z(tt, null, Ct([
|
|
6704
|
+
{ label: "Open", val: I.data.open, field: "open" },
|
|
6705
|
+
{ label: "High", val: I.data.high, field: "high" },
|
|
6706
|
+
{ label: "Low", val: I.data.low, field: "low" },
|
|
6707
|
+
{ label: "Close", val: I.data.close, field: "close" }
|
|
6708
|
+
], (y) => (D(), z(tt, {
|
|
6709
|
+
key: y.label
|
|
6653
6710
|
}, [
|
|
6654
|
-
$("span", Lr, J(
|
|
6711
|
+
$("span", Lr, J(y.label), 1),
|
|
6655
6712
|
$("span", {
|
|
6656
|
-
style:
|
|
6713
|
+
style: X({
|
|
6657
6714
|
fontWeight: 600,
|
|
6658
|
-
color:
|
|
6659
|
-
|
|
6715
|
+
color: F(Zt)(
|
|
6716
|
+
I.data.close >= I.data.open ? h.value.candlestick.up.body : h.value.candlestick.down.body
|
|
6660
6717
|
),
|
|
6661
6718
|
textAlign: "right"
|
|
6662
6719
|
})
|
|
6663
|
-
}, J(n.value(
|
|
6720
|
+
}, J(n.value(y.val, y.field)), 5)
|
|
6664
6721
|
], 64))), 128)),
|
|
6665
|
-
|
|
6666
|
-
|
|
6722
|
+
I.data.volume != null ? (D(), z(tt, { key: 0 }, [
|
|
6723
|
+
x[0] || (x[0] = $("span", { style: { opacity: 0.5 } }, "Volume", -1)),
|
|
6667
6724
|
$("span", {
|
|
6668
|
-
style:
|
|
6669
|
-
}, J(n.value(
|
|
6725
|
+
style: X({ fontWeight: 600, color: h.value.tooltip.textColor, textAlign: "right" })
|
|
6726
|
+
}, J(n.value(I.data.volume, "volume")), 5)
|
|
6670
6727
|
], 64)) : Z("", !0)
|
|
6671
|
-
])) : (
|
|
6728
|
+
])) : (D(), z("div", Ar, [
|
|
6672
6729
|
$("span", {
|
|
6673
|
-
style:
|
|
6730
|
+
style: X({
|
|
6674
6731
|
width: "8px",
|
|
6675
6732
|
height: "8px",
|
|
6676
6733
|
borderRadius: "50%",
|
|
6677
|
-
background:
|
|
6734
|
+
background: I.color,
|
|
6678
6735
|
flexShrink: 0
|
|
6679
6736
|
})
|
|
6680
6737
|
}, null, 4),
|
|
6681
|
-
$("span", Wr, J(
|
|
6738
|
+
$("span", Wr, J(I.label ?? "Value"), 1),
|
|
6682
6739
|
$("span", {
|
|
6683
|
-
style:
|
|
6684
|
-
}, J(n.value(
|
|
6740
|
+
style: X({ fontWeight: 600, color: I.color })
|
|
6741
|
+
}, J(n.value(I.data.value, "value")), 5)
|
|
6685
6742
|
]))
|
|
6686
6743
|
], 64))), 128))
|
|
6687
6744
|
], 4)) : Z("", !0),
|
|
6688
|
-
|
|
6745
|
+
F(a) && c.value.length > 0 && m.value && b.value ? (D(), z("div", {
|
|
6689
6746
|
key: 1,
|
|
6690
6747
|
ref_key: "containerRef",
|
|
6691
|
-
ref:
|
|
6692
|
-
"data-measured":
|
|
6693
|
-
style:
|
|
6748
|
+
ref: p,
|
|
6749
|
+
"data-measured": w.value ? "true" : "false",
|
|
6750
|
+
style: X({
|
|
6694
6751
|
position: "absolute",
|
|
6695
|
-
left:
|
|
6696
|
-
top:
|
|
6752
|
+
left: m.value.left + "px",
|
|
6753
|
+
top: m.value.top + "px",
|
|
6697
6754
|
pointerEvents: "none",
|
|
6698
6755
|
background: h.value.tooltip.background,
|
|
6699
6756
|
backdropFilter: "blur(12px)",
|
|
@@ -6707,13 +6764,13 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6707
6764
|
fontVariantNumeric: "tabular-nums",
|
|
6708
6765
|
color: h.value.tooltip.textColor,
|
|
6709
6766
|
width: "max-content",
|
|
6710
|
-
maxWidth:
|
|
6767
|
+
maxWidth: F(s).getMediaSize().width - F(s).yAxisWidth + "px",
|
|
6711
6768
|
boxSizing: "border-box",
|
|
6712
6769
|
zIndex: 10,
|
|
6713
6770
|
visibility: k.value !== null ? "visible" : "hidden"
|
|
6714
6771
|
})
|
|
6715
6772
|
}, [
|
|
6716
|
-
te(
|
|
6773
|
+
te(v.$slots, "default", {
|
|
6717
6774
|
snapshots: c.value,
|
|
6718
6775
|
time: u.value
|
|
6719
6776
|
})
|
|
@@ -6728,7 +6785,7 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6728
6785
|
minLabelSpacing: {}
|
|
6729
6786
|
},
|
|
6730
6787
|
setup(i) {
|
|
6731
|
-
const t = i, e =
|
|
6788
|
+
const t = i, e = kt(), n = Hs(e), s = () => e.yScale.setFormat(t.format ?? null);
|
|
6732
6789
|
dt(s), ht(() => t.format, s), ct(() => e.yScale.setFormat(null));
|
|
6733
6790
|
const a = () => {
|
|
6734
6791
|
e.setYAxisLabelDensity({
|
|
@@ -6737,44 +6794,44 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6737
6794
|
});
|
|
6738
6795
|
};
|
|
6739
6796
|
a(), ht(() => [t.labelCount, t.minLabelSpacing], a), ct(() => e.setYAxisLabelDensity({ labelCount: null, minLabelSpacing: null }));
|
|
6740
|
-
const r = /* @__PURE__ */ new Map(), l =
|
|
6797
|
+
const r = /* @__PURE__ */ new Map(), l = P(() => e.getTheme()), h = P(() => {
|
|
6741
6798
|
n.value;
|
|
6742
6799
|
const d = e.yScale.niceTickValues(), c = new Set(d), u = performance.now();
|
|
6743
|
-
for (const
|
|
6744
|
-
r.has(
|
|
6745
|
-
for (const [
|
|
6746
|
-
c.has(
|
|
6747
|
-
for (const [
|
|
6748
|
-
|
|
6800
|
+
for (const g of d)
|
|
6801
|
+
r.has(g) ? r.get(g).opacity = 1 : r.set(g, { opacity: 1, addedAt: u });
|
|
6802
|
+
for (const [g, b] of r)
|
|
6803
|
+
c.has(g) || (b.opacity = 0);
|
|
6804
|
+
for (const [g, b] of r)
|
|
6805
|
+
b.opacity === 0 && u - b.addedAt > 5e3 && r.delete(g);
|
|
6749
6806
|
return Array.from(r.entries());
|
|
6750
6807
|
});
|
|
6751
|
-
return (d, c) => (
|
|
6752
|
-
style:
|
|
6808
|
+
return (d, c) => (D(), z("div", {
|
|
6809
|
+
style: X({
|
|
6753
6810
|
position: "absolute",
|
|
6754
6811
|
right: "0",
|
|
6755
6812
|
top: "0",
|
|
6756
|
-
bottom:
|
|
6757
|
-
width:
|
|
6813
|
+
bottom: F(e).xAxisHeight + "px",
|
|
6814
|
+
width: F(e).yAxisWidth + "px",
|
|
6758
6815
|
pointerEvents: "none"
|
|
6759
6816
|
})
|
|
6760
6817
|
}, [
|
|
6761
|
-
(
|
|
6818
|
+
(D(!0), z(tt, null, Ct(h.value, ([u, g]) => (D(), z("span", {
|
|
6762
6819
|
key: u,
|
|
6763
|
-
style:
|
|
6820
|
+
style: X({
|
|
6764
6821
|
position: "absolute",
|
|
6765
6822
|
right: "8px",
|
|
6766
|
-
top:
|
|
6823
|
+
top: F(e).yScale.valueToY(u) + "px",
|
|
6767
6824
|
transform: "translateY(-50%)",
|
|
6768
|
-
color:
|
|
6769
|
-
fontSize:
|
|
6825
|
+
color: F(vs)(l.value, "y"),
|
|
6826
|
+
fontSize: F(ms)(l.value, "y") + "px",
|
|
6770
6827
|
fontFamily: l.value.typography.fontFamily,
|
|
6771
6828
|
fontVariantNumeric: "tabular-nums",
|
|
6772
6829
|
userSelect: "none",
|
|
6773
|
-
opacity:
|
|
6830
|
+
opacity: g.opacity,
|
|
6774
6831
|
transition: "opacity 0.25s ease",
|
|
6775
6832
|
willChange: "opacity"
|
|
6776
6833
|
})
|
|
6777
|
-
}, J(
|
|
6834
|
+
}, J(F(e).yScale.formatY(u)), 5))), 128))
|
|
6778
6835
|
], 4));
|
|
6779
6836
|
}
|
|
6780
6837
|
}), wl = /* @__PURE__ */ pt({
|
|
@@ -6785,7 +6842,7 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6785
6842
|
format: { type: Function }
|
|
6786
6843
|
},
|
|
6787
6844
|
setup(i) {
|
|
6788
|
-
const t = i, e =
|
|
6845
|
+
const t = i, e = kt(), n = Ce(), s = P(() => typeof n.default == "function"), a = q(0), r = () => {
|
|
6789
6846
|
a.value++;
|
|
6790
6847
|
};
|
|
6791
6848
|
dt(() => {
|
|
@@ -6793,18 +6850,18 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6793
6850
|
}), ct(() => {
|
|
6794
6851
|
e.setYLabel(!1), e.off("overlayChange", r), e.off("viewportChange", r);
|
|
6795
6852
|
});
|
|
6796
|
-
function l(
|
|
6797
|
-
if (
|
|
6798
|
-
const f =
|
|
6853
|
+
function l(m, w) {
|
|
6854
|
+
if (w !== void 0) return w;
|
|
6855
|
+
const f = m.getSeriesIdsByType("time", { visibleOnly: !0, singleLayerOnly: !0 });
|
|
6799
6856
|
if (f.length > 0) return f[0];
|
|
6800
|
-
const
|
|
6801
|
-
return
|
|
6857
|
+
const v = m.getSeriesIdsByType("time", { visibleOnly: !0 });
|
|
6858
|
+
return v.length > 0 ? v[0] : null;
|
|
6802
6859
|
}
|
|
6803
|
-
const h =
|
|
6860
|
+
const h = P(() => (a.value, l(e, t.seriesId))), d = P(() => (a.value, h.value !== null ? e.getStackedLastValue(h.value) : null)), c = P(() => (a.value, h.value !== null ? e.getPreviousClose(h.value) : null)), u = P(() => (a.value, e.getTheme())), g = P(() => (a.value, d.value === null ? 0 : e.yScale.valueToY(d.value.value))), b = P(() => d.value === null || c.value === null ? "neutral" : d.value.value > c.value ? "up" : d.value.value < c.value ? "down" : "neutral"), p = P(() => {
|
|
6804
6861
|
if (d.value === null) return u.value.yLabel.neutralBackground;
|
|
6805
6862
|
if (!d.value.isLive) return u.value.axis.textColor;
|
|
6806
6863
|
if (t.color) return t.color;
|
|
6807
|
-
switch (
|
|
6864
|
+
switch (b.value) {
|
|
6808
6865
|
case "up":
|
|
6809
6866
|
return u.value.yLabel.upBackground;
|
|
6810
6867
|
case "down":
|
|
@@ -6812,51 +6869,51 @@ const hl = /* @__PURE__ */ pt({
|
|
|
6812
6869
|
default:
|
|
6813
6870
|
return u.value.yLabel.neutralBackground;
|
|
6814
6871
|
}
|
|
6815
|
-
}), k =
|
|
6872
|
+
}), k = P(() => {
|
|
6816
6873
|
a.value;
|
|
6817
|
-
const
|
|
6818
|
-
return
|
|
6819
|
-
}), S =
|
|
6874
|
+
const m = e.yScale.getRange(), w = m.max - m.min;
|
|
6875
|
+
return w < 0.1 ? 6 : w < 10 ? 4 : w < 1e3 ? 2 : 0;
|
|
6876
|
+
}), S = P(() => {
|
|
6820
6877
|
if (t.format) return t.format;
|
|
6821
|
-
const
|
|
6878
|
+
const m = new Intl.NumberFormat("en-US", {
|
|
6822
6879
|
minimumFractionDigits: k.value,
|
|
6823
6880
|
maximumFractionDigits: k.value,
|
|
6824
6881
|
useGrouping: !1
|
|
6825
6882
|
});
|
|
6826
|
-
return (
|
|
6883
|
+
return (w) => m.format(w);
|
|
6827
6884
|
});
|
|
6828
|
-
return (
|
|
6829
|
-
s.value ? te(
|
|
6885
|
+
return (m, w) => d.value !== null ? (D(), z(tt, { key: 0 }, [
|
|
6886
|
+
s.value ? te(m.$slots, "default", {
|
|
6830
6887
|
key: 0,
|
|
6831
6888
|
value: d.value.value,
|
|
6832
|
-
y:
|
|
6833
|
-
bgColor:
|
|
6889
|
+
y: g.value,
|
|
6890
|
+
bgColor: p.value,
|
|
6834
6891
|
isLive: d.value.isLive,
|
|
6835
|
-
direction:
|
|
6892
|
+
direction: b.value,
|
|
6836
6893
|
format: S.value
|
|
6837
|
-
}) : (
|
|
6894
|
+
}) : (D(), z(tt, { key: 1 }, [
|
|
6838
6895
|
$("div", {
|
|
6839
|
-
style:
|
|
6896
|
+
style: X({
|
|
6840
6897
|
position: "absolute",
|
|
6841
6898
|
left: "0",
|
|
6842
|
-
right:
|
|
6843
|
-
top:
|
|
6899
|
+
right: F(e).yAxisWidth + "px",
|
|
6900
|
+
top: g.value + "px",
|
|
6844
6901
|
height: "0",
|
|
6845
|
-
borderTop: "1px dashed " +
|
|
6902
|
+
borderTop: "1px dashed " + p.value,
|
|
6846
6903
|
opacity: 0.5,
|
|
6847
6904
|
pointerEvents: "none",
|
|
6848
6905
|
zIndex: 2
|
|
6849
6906
|
})
|
|
6850
6907
|
}, null, 4),
|
|
6851
6908
|
$("div", {
|
|
6852
|
-
style:
|
|
6909
|
+
style: X({
|
|
6853
6910
|
position: "absolute",
|
|
6854
6911
|
right: "4px",
|
|
6855
|
-
top:
|
|
6912
|
+
top: g.value + "px",
|
|
6856
6913
|
transform: "translateY(-50%)",
|
|
6857
6914
|
pointerEvents: "auto",
|
|
6858
6915
|
zIndex: 3,
|
|
6859
|
-
background:
|
|
6916
|
+
background: p.value,
|
|
6860
6917
|
color: u.value.yLabel.textColor,
|
|
6861
6918
|
fontSize: u.value.yLabel.fontSize + "px",
|
|
6862
6919
|
fontFamily: u.value.typography.fontFamily,
|
|
@@ -6880,7 +6937,7 @@ export {
|
|
|
6880
6937
|
nl as BarSeries,
|
|
6881
6938
|
sl as CandlestickSeries,
|
|
6882
6939
|
al as ChartContainer,
|
|
6883
|
-
|
|
6940
|
+
Do as ChartInstance,
|
|
6884
6941
|
ul as Crosshair,
|
|
6885
6942
|
dl as InfoBar,
|
|
6886
6943
|
fl as Legend,
|
|
@@ -6896,19 +6953,19 @@ export {
|
|
|
6896
6953
|
yl as Tooltip,
|
|
6897
6954
|
xl as YAxis,
|
|
6898
6955
|
wl as YLabel,
|
|
6899
|
-
|
|
6956
|
+
Pr as andromeda,
|
|
6900
6957
|
Y as autoGradient,
|
|
6901
6958
|
zr as ayuMirage,
|
|
6902
6959
|
Ys as buildHoverSnapshots,
|
|
6903
6960
|
Ko as buildLastSnapshots,
|
|
6904
6961
|
Is as catppuccin,
|
|
6905
|
-
|
|
6962
|
+
Di as computeTooltipPosition,
|
|
6906
6963
|
at as createTheme,
|
|
6907
|
-
|
|
6964
|
+
Br as darkTheme,
|
|
6908
6965
|
_a as detectInterval,
|
|
6909
6966
|
Vr as dracula,
|
|
6910
6967
|
Xe as formatCompact,
|
|
6911
|
-
|
|
6968
|
+
Fa as formatDate,
|
|
6912
6969
|
fs as formatPriceAdaptive,
|
|
6913
6970
|
zi as formatTime,
|
|
6914
6971
|
Yr as githubLight,
|
|
@@ -6917,7 +6974,7 @@ export {
|
|
|
6917
6974
|
Or as highContrast,
|
|
6918
6975
|
Hr as lavenderMist,
|
|
6919
6976
|
Nr as lightPink,
|
|
6920
|
-
|
|
6977
|
+
Dr as lightTheme,
|
|
6921
6978
|
Xr as materialPalenight,
|
|
6922
6979
|
Ur as minimalLight,
|
|
6923
6980
|
Gr as mintBreeze,
|
|
@@ -6934,7 +6991,7 @@ export {
|
|
|
6934
6991
|
tl as rosePineDawn,
|
|
6935
6992
|
el as sandDune,
|
|
6936
6993
|
il as solarizedLight,
|
|
6937
|
-
|
|
6994
|
+
kt as useChartInstance,
|
|
6938
6995
|
$i as useCrosshairPosition,
|
|
6939
6996
|
rl as useLastYValue,
|
|
6940
6997
|
ll as usePreviousClose,
|