@wick-charts/react 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -12
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +5 -11
- package/dist/index.js +195 -197
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useContext as Ue, createContext as Ii, useRef as N, useLayoutEffect as Q, useEffect as dt, useMemo as Dt, useSyncExternalStore as me, useState as bt, Children as ni, isValidElement as ri, Fragment as
|
|
1
|
+
import { useContext as Ue, createContext as Ii, useRef as N, useLayoutEffect as Q, useEffect as dt, useMemo as Dt, useSyncExternalStore as me, useState as bt, Children as ni, isValidElement as ri, Fragment as ss } from "react";
|
|
2
2
|
import { jsx as L, jsxs as H, Fragment as te } from "react/jsx-runtime";
|
|
3
|
-
var
|
|
3
|
+
var ns = Object.defineProperty, Di = (s) => {
|
|
4
4
|
throw TypeError(s);
|
|
5
|
-
},
|
|
5
|
+
}, rs = (s, t, e) => t in s ? ns(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, w = (s, t, e) => rs(s, typeof t != "symbol" ? t + "" : t, e), Ge = (s, t, e) => t.has(s) || Di("Cannot " + e), h = (s, t, e) => (Ge(s, t, "read from private field"), e ? e.call(s) : t.get(s)), P = (s, t, e) => t.has(s) ? Di("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), D = (s, t, e, i) => (Ge(s, t, "write to private field"), t.set(s, e), e), E = (s, t, e) => (Ge(s, t, "access private method"), e), He = (s, t, e, i) => ({
|
|
6
6
|
set _(n) {
|
|
7
7
|
D(s, t, n);
|
|
8
8
|
},
|
|
@@ -50,7 +50,7 @@ function oi(s, t, e) {
|
|
|
50
50
|
const i = document.createElement("canvas");
|
|
51
51
|
return i.style.position = "absolute", i.style.inset = "0", i.style.width = "100%", i.style.height = "100%", i.style.display = "block", i.style.zIndex = String(t), s.appendChild(i), i;
|
|
52
52
|
}
|
|
53
|
-
class
|
|
53
|
+
class as extends pe {
|
|
54
54
|
constructor(t, e) {
|
|
55
55
|
super(), w(this, "mainCanvas"), w(this, "mainCtx"), w(this, "overlayCanvas"), w(this, "overlayCtx"), w(this, "resizeObserver"), w(this, "_size"), w(this, "supportsDevicePixelContentBox", !1), this.mainCanvas = oi(t, 0), this.overlayCanvas = oi(t, 1);
|
|
56
56
|
const i = this.mainCanvas.getContext("2d", { alpha: !0 }), n = this.overlayCanvas.getContext("2d", { alpha: !0 });
|
|
@@ -143,27 +143,27 @@ class os extends pe {
|
|
|
143
143
|
this.resizeObserver.disconnect(), this.mainCanvas.remove(), this.overlayCanvas.remove(), this.removeAllListeners();
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function os(s, t, e, i) {
|
|
147
147
|
const { context: n, bitmapSize: r, horizontalPixelRatio: a } = s;
|
|
148
148
|
n.strokeStyle = i.crosshair.color, n.lineWidth = 1, n.setLineDash([4 * a, 4 * a]);
|
|
149
149
|
const o = Math.round(t) + 0.5, l = Math.round(e) + 0.5;
|
|
150
150
|
n.beginPath(), n.moveTo(o, 0), n.lineTo(o, r.height), n.moveTo(0, l), n.lineTo(r.width, l), n.stroke(), n.setLineDash([]);
|
|
151
151
|
}
|
|
152
|
-
const
|
|
153
|
-
function
|
|
152
|
+
const ls = 3, hs = 8, li = 900, cs = 24, us = 11, ds = 10, fs = 18;
|
|
153
|
+
function gs(s) {
|
|
154
154
|
const { state: t } = s;
|
|
155
155
|
if (t === "idle" || t === "has-more") return;
|
|
156
156
|
const e = s.timeScale.timeToX(s.boundaryTime);
|
|
157
157
|
if (Number.isFinite(e)) {
|
|
158
158
|
if (t === "loading") {
|
|
159
|
-
|
|
159
|
+
ms(s, e);
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
-
t === "no-data" &&
|
|
162
|
+
t === "no-data" && ps(s, e);
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
const { context: a, horizontalPixelRatio: o, verticalPixelRatio: l } = s, u =
|
|
165
|
+
function ms({ scope: s, theme: t, chartMediaHeight: e, side: i, now: n }, r) {
|
|
166
|
+
const { context: a, horizontalPixelRatio: o, verticalPixelRatio: l } = s, u = ls * o, c = hs * o, d = cs * o, f = r * o, g = i === "right" ? f + d : f - d, p = e / 2 * l, m = n % li / li, v = Math.floor(m * 3), y = Fi(t.axis.textColor ?? "#787b86", 0.3), x = t.axis.textColor ?? "#787b86";
|
|
167
167
|
a.save();
|
|
168
168
|
for (let S = 0; S < 3; S++) {
|
|
169
169
|
const M = (S - 1) * c, C = g + M;
|
|
@@ -171,11 +171,11 @@ function ps({ scope: s, theme: t, chartMediaHeight: e, side: i, now: n }, r) {
|
|
|
171
171
|
}
|
|
172
172
|
a.restore();
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function ps({ scope: s, theme: t, chartMediaHeight: e, side: i }, n) {
|
|
175
175
|
const { context: r, horizontalPixelRatio: a, verticalPixelRatio: o } = s, l = Math.round(n * a) + 0.5;
|
|
176
176
|
r.save(), r.strokeStyle = Fi(t.axis.textColor ?? "#787b86", 0.6), r.lineWidth = 1, r.setLineDash([4 * a, 4 * a]), r.beginPath(), r.moveTo(l, 0), r.lineTo(l, e * o), r.stroke(), r.setLineDash([]);
|
|
177
|
-
const u =
|
|
178
|
-
r.fillStyle = t.axis.textColor ?? "#787b86", r.font = `${
|
|
177
|
+
const u = ds * a, c = i === "right" ? l - u : l + u, d = fs * o;
|
|
178
|
+
r.fillStyle = t.axis.textColor ?? "#787b86", r.font = `${us * a}px ${t.typography.fontFamily}`, r.textAlign = i === "right" ? "right" : "left", r.textBaseline = "top", r.fillText("No more data", c, d), r.restore();
|
|
179
179
|
}
|
|
180
180
|
function Fi(s, t) {
|
|
181
181
|
const e = /^#([0-9a-f]{6})$/i.exec(s.trim());
|
|
@@ -183,7 +183,7 @@ function Fi(s, t) {
|
|
|
183
183
|
const i = parseInt(e[1].slice(0, 2), 16), n = parseInt(e[1].slice(2, 4), 16), r = parseInt(e[1].slice(4, 6), 16);
|
|
184
184
|
return `rgba(${i}, ${n}, ${r}, ${t})`;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function bs(s, t, e, i, n) {
|
|
187
187
|
const { context: r, bitmapSize: a, horizontalPixelRatio: o, verticalPixelRatio: l } = s;
|
|
188
188
|
r.strokeStyle = i.grid.color, r.lineWidth = 1, i.grid.style === "dashed" ? r.setLineDash([4 * o, 4 * o]) : i.grid.style === "dotted" && r.setLineDash([1 * o, 3 * o]);
|
|
189
189
|
const u = e.niceTickValues();
|
|
@@ -285,7 +285,7 @@ class zi extends pe {
|
|
|
285
285
|
return n;
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
class
|
|
288
|
+
class vs {
|
|
289
289
|
constructor(t, e, i) {
|
|
290
290
|
w(this, "dragging", !1), w(this, "lastX", 0), this.viewport = t, this.timeScale = e, this.canvas = i;
|
|
291
291
|
}
|
|
@@ -306,17 +306,17 @@ class ys {
|
|
|
306
306
|
return this.dragging;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
const
|
|
310
|
-
class
|
|
309
|
+
const ys = 150;
|
|
310
|
+
class xs {
|
|
311
311
|
constructor(t, e) {
|
|
312
312
|
w(this, "reboundTimer", null), this.viewport = t, this.timeScale = e;
|
|
313
313
|
}
|
|
314
314
|
handleWheel(t) {
|
|
315
315
|
t.preventDefault();
|
|
316
|
-
const e =
|
|
316
|
+
const e = Ss(t.deltaY, t.deltaMode), i = Math.exp(e * 5e-3), n = this.timeScale.getMediaWidth(), r = Math.min(t.offsetX, n), a = this.timeScale.xToTime(r);
|
|
317
317
|
this.viewport.zoomAt(a, i, n), this.reboundTimer !== null && clearTimeout(this.reboundTimer), this.reboundTimer = setTimeout(() => {
|
|
318
318
|
this.reboundTimer = null, this.viewport.startRebound(n);
|
|
319
|
-
},
|
|
319
|
+
}, ys);
|
|
320
320
|
}
|
|
321
321
|
/** Cancel any pending rebound — called by InteractionHandler.destroy and when
|
|
322
322
|
* a competing gesture (mousedown, touchstart) takes over. */
|
|
@@ -324,10 +324,10 @@ class Ss {
|
|
|
324
324
|
this.reboundTimer !== null && (clearTimeout(this.reboundTimer), this.reboundTimer = null);
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function Ss(s, t) {
|
|
328
328
|
return t === WheelEvent.DOM_DELTA_LINE ? s * 8 : t === WheelEvent.DOM_DELTA_PAGE ? s * 24 : s;
|
|
329
329
|
}
|
|
330
|
-
class
|
|
330
|
+
class ws extends pe {
|
|
331
331
|
constructor(t, e, i, n) {
|
|
332
332
|
super(), w(this, "zoom"), w(this, "pan"), w(this, "canvas"), w(this, "timeScale"), w(this, "yScale"), w(this, "viewport"), w(this, "onWheel", (r) => {
|
|
333
333
|
this.zoom.handleWheel(r);
|
|
@@ -365,7 +365,7 @@ class Cs extends pe {
|
|
|
365
365
|
const a = this.touchCount === 2;
|
|
366
366
|
this.pan.handleMouseUp(), a && this.viewport.startRebound(this.timeScale.getMediaWidth()), this.touchCount = 0, this.lastTouchDist = 0;
|
|
367
367
|
}
|
|
368
|
-
}), this.canvas = t, this.viewport = e, this.timeScale = i, this.yScale = n, this.zoom = new
|
|
368
|
+
}), this.canvas = t, this.viewport = e, this.timeScale = i, this.yScale = n, this.zoom = new xs(e, i), this.pan = new vs(e, i, t), t.style.cursor = "crosshair", t.style.touchAction = "none", t.addEventListener("wheel", this.onWheel, { passive: !1 }), t.addEventListener("mousedown", this.onMouseDown), t.addEventListener("mousemove", this.onMouseMove), t.addEventListener("mouseup", this.onMouseUp), t.addEventListener("mouseleave", this.onMouseLeave), t.addEventListener("dblclick", this.onDblClick), t.addEventListener("touchstart", this.onTouchStart, { passive: !1 }), t.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), t.addEventListener("touchend", this.onTouchEnd);
|
|
369
369
|
}
|
|
370
370
|
emitCrosshair(t, e) {
|
|
371
371
|
const i = this.timeScale.xToTime(t), n = this.yScale.yToValue(e);
|
|
@@ -380,11 +380,11 @@ class Cs extends pe {
|
|
|
380
380
|
this.zoom.cancelPendingRebound(), this.canvas.removeEventListener("wheel", this.onWheel), this.canvas.removeEventListener("mousedown", this.onMouseDown), this.canvas.removeEventListener("mousemove", this.onMouseMove), this.canvas.removeEventListener("mouseup", this.onMouseUp), this.canvas.removeEventListener("mouseleave", this.onMouseLeave), this.canvas.removeEventListener("dblclick", this.onDblClick), this.canvas.removeEventListener("touchstart", this.onTouchStart), this.canvas.removeEventListener("touchmove", this.onTouchMove), this.canvas.removeEventListener("touchend", this.onTouchEnd), this.removeAllListeners();
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
|
-
const
|
|
384
|
-
function
|
|
385
|
-
|
|
383
|
+
const Cs = /* @__PURE__ */ new WeakMap();
|
|
384
|
+
function Ms(s, t) {
|
|
385
|
+
Cs.set(s, t);
|
|
386
386
|
}
|
|
387
|
-
const
|
|
387
|
+
const ks = 100, Ts = {
|
|
388
388
|
position: "absolute",
|
|
389
389
|
top: "4px",
|
|
390
390
|
right: "4px",
|
|
@@ -404,7 +404,7 @@ function hi(s) {
|
|
|
404
404
|
return t;
|
|
405
405
|
}
|
|
406
406
|
const ge = 9, je = 7, Ct = 6, Ke = 9;
|
|
407
|
-
function
|
|
407
|
+
function Rs(s, t) {
|
|
408
408
|
return Math.round(s * t).toLocaleString("en-US");
|
|
409
409
|
}
|
|
410
410
|
function ci(s, t, e, i, n) {
|
|
@@ -413,7 +413,7 @@ function ci(s, t, e, i, n) {
|
|
|
413
413
|
t.toFixed(1).padStart(je),
|
|
414
414
|
e.toFixed(2).padStart(Ct),
|
|
415
415
|
i.toFixed(2).padStart(Ct),
|
|
416
|
-
|
|
416
|
+
Rs(n, t).padStart(Ke)
|
|
417
417
|
].join(" ");
|
|
418
418
|
}
|
|
419
419
|
function ui(s) {
|
|
@@ -425,7 +425,7 @@ function ui(s) {
|
|
|
425
425
|
"idle".padStart(Ke)
|
|
426
426
|
].join(" ");
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function Ls() {
|
|
429
429
|
return [
|
|
430
430
|
"".padEnd(ge),
|
|
431
431
|
"FPS".padStart(je),
|
|
@@ -434,8 +434,8 @@ function Is() {
|
|
|
434
434
|
"calls/s".padStart(Ke)
|
|
435
435
|
].join(" ");
|
|
436
436
|
}
|
|
437
|
-
function
|
|
438
|
-
const t = hi(s.drawCalls.main), e = hi(s.drawCalls.overlay), i = s.frameCount.main === 0 ? ui("Main") : ci("Main", s.mainRendersPerSec, s.mainFrameMs.last, s.mainFrameMs.p95, t), n = s.frameCount.overlay === 0 ? ui("Overlay") : ci("Overlay", s.overlayRendersPerSec, s.overlayFrameMs.last, s.overlayFrameMs.p95, e), r = [
|
|
437
|
+
function Is(s) {
|
|
438
|
+
const t = hi(s.drawCalls.main), e = hi(s.drawCalls.overlay), i = s.frameCount.main === 0 ? ui("Main") : ci("Main", s.mainRendersPerSec, s.mainFrameMs.last, s.mainFrameMs.p95, t), n = s.frameCount.overlay === 0 ? ui("Overlay") : ci("Overlay", s.overlayRendersPerSec, s.overlayFrameMs.last, s.overlayFrameMs.p95, e), r = [Ls(), i, n], a = Object.keys(s.perSeries);
|
|
439
439
|
if (a.length > 1) {
|
|
440
440
|
r.push(""), r.push("Per series (main pass)"), r.push(["".padEnd(ge), "ms".padStart(Ct), "worst".padStart(Ct)].join(" "));
|
|
441
441
|
for (const o of a) {
|
|
@@ -448,22 +448,22 @@ function Ds(s) {
|
|
|
448
448
|
return r.join(`
|
|
449
449
|
`);
|
|
450
450
|
}
|
|
451
|
-
class
|
|
452
|
-
constructor(t, e, i =
|
|
451
|
+
class Ds {
|
|
452
|
+
constructor(t, e, i = ks) {
|
|
453
453
|
w(this, "element"), w(this, "unsubscribe"), w(this, "updateIntervalMs"), w(this, "lastUpdate", 0), this.updateIntervalMs = i;
|
|
454
454
|
for (const n of t.querySelectorAll("[data-chart-perf-hud]"))
|
|
455
455
|
n.remove();
|
|
456
|
-
this.element = document.createElement("div"), this.element.setAttribute("data-chart-perf-hud", ""), Object.assign(this.element.style,
|
|
456
|
+
this.element = document.createElement("div"), this.element.setAttribute("data-chart-perf-hud", ""), Object.assign(this.element.style, Ts), this.element.textContent = "perf: waiting for first frame…", t.appendChild(this.element), this.unsubscribe = e.onFrame((n) => this.onFrame(n));
|
|
457
457
|
}
|
|
458
458
|
destroy() {
|
|
459
459
|
this.unsubscribe(), this.element.remove();
|
|
460
460
|
}
|
|
461
461
|
onFrame(t) {
|
|
462
462
|
const e = performance.now();
|
|
463
|
-
e - this.lastUpdate < this.updateIntervalMs || (this.lastUpdate = e, this.element.textContent =
|
|
463
|
+
e - this.lastUpdate < this.updateIntervalMs || (this.lastUpdate = e, this.element.textContent = Is(t));
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
const
|
|
466
|
+
const Fs = 5e3, Bs = 2e3, zs = 30;
|
|
467
467
|
function We(s, t, e) {
|
|
468
468
|
let i = 0;
|
|
469
469
|
for (; i < t.length && t[i] < e; ) i++;
|
|
@@ -494,7 +494,7 @@ function fi(s) {
|
|
|
494
494
|
}
|
|
495
495
|
class Ee {
|
|
496
496
|
constructor(t = {}) {
|
|
497
|
-
w(this, "drawCallsMain", /* @__PURE__ */ new Map()), w(this, "drawCallsOverlay", /* @__PURE__ */ new Map()), w(this, "mainMs", []), w(this, "overlayMs", []), w(this, "mainStamps", []), w(this, "overlayStamps", []), w(this, "perSeriesMs", /* @__PURE__ */ new Map()), w(this, "perSeriesStamps", /* @__PURE__ */ new Map()), w(this, "listeners", /* @__PURE__ */ new Set()), w(this, "windowMs"), w(this, "maxSamples"), w(this, "heapInterval"), w(this, "heapCounter", 0), w(this, "heapMb", null), w(this, "mainFrameCount", 0), w(this, "overlayFrameCount", 0), w(this, "lastStamp", 0), this.windowMs = t.windowMs ??
|
|
497
|
+
w(this, "drawCallsMain", /* @__PURE__ */ new Map()), w(this, "drawCallsOverlay", /* @__PURE__ */ new Map()), w(this, "mainMs", []), w(this, "overlayMs", []), w(this, "mainStamps", []), w(this, "overlayStamps", []), w(this, "perSeriesMs", /* @__PURE__ */ new Map()), w(this, "perSeriesStamps", /* @__PURE__ */ new Map()), w(this, "listeners", /* @__PURE__ */ new Set()), w(this, "windowMs"), w(this, "maxSamples"), w(this, "heapInterval"), w(this, "heapCounter", 0), w(this, "heapMb", null), w(this, "mainFrameCount", 0), w(this, "overlayFrameCount", 0), w(this, "lastStamp", 0), this.windowMs = t.windowMs ?? Fs, this.maxSamples = t.maxSamples ?? Bs, this.heapInterval = t.heapSampleEveryNFrames ?? zs;
|
|
498
498
|
}
|
|
499
499
|
/** Clear the draw-call tally for the given layer. Call at the start of each frame. */
|
|
500
500
|
resetDrawCalls(t) {
|
|
@@ -574,13 +574,13 @@ const Ut = 6e4, Ht = 36e5, At = 864e5;
|
|
|
574
574
|
function ft(s) {
|
|
575
575
|
return s instanceof Date ? s.getTime() : s;
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function Ps(s) {
|
|
578
578
|
return s.length === 0 || !s.some((t) => t.time instanceof Date) ? s : s.map((t) => ({ ...t, time: ft(t.time) }));
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function As(s) {
|
|
581
581
|
return s.length === 0 || !s.some((t) => t.time instanceof Date) ? s : s.map((t) => ({ ...t, time: ft(t.time) }));
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function Ws(s) {
|
|
584
584
|
if (s.length < 2) return At;
|
|
585
585
|
const t = [];
|
|
586
586
|
for (let e = 1; e < Math.min(s.length, 20); e++)
|
|
@@ -596,15 +596,15 @@ function Le(s, t) {
|
|
|
596
596
|
hour12: !1
|
|
597
597
|
});
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function Vs(s) {
|
|
600
600
|
return new Date(s).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function Ys(s) {
|
|
603
603
|
const t = [1e3, 5e3, 1e4, 15e3, 3e4], e = [Ut, 5 * Ut, 10 * Ut, 15 * Ut, 30 * Ut], i = [Ht, 2 * Ht, 4 * Ht, 6 * Ht, 12 * Ht], n = [At, 7 * At, 30 * At, 90 * At, 365 * At];
|
|
604
604
|
return s < Ut ? [...t, ...e, ...i, ...n] : s < Ht ? [...e, ...i, ...n] : s < At ? [...i, ...n] : n;
|
|
605
605
|
}
|
|
606
|
-
const
|
|
607
|
-
class
|
|
606
|
+
const Es = 50, _s = 80;
|
|
607
|
+
class Hs {
|
|
608
608
|
constructor() {
|
|
609
609
|
w(this, "from", 0), w(this, "to", 0), w(this, "width", 1), w(this, "pixelRatio", 1), w(this, "dataInterval", null), w(this, "labelCountHintValue", null), w(this, "minSpacingValue", null), w(this, "resolvedInterval", null), w(this, "lastInterval", null), w(this, "lastWant", null), w(this, "lastBucketKey", null);
|
|
610
610
|
}
|
|
@@ -612,7 +612,7 @@ class Os {
|
|
|
612
612
|
return this.labelCountHintValue;
|
|
613
613
|
}
|
|
614
614
|
get minLabelSpacing() {
|
|
615
|
-
return this.minSpacingValue ??
|
|
615
|
+
return this.minSpacingValue ?? _s;
|
|
616
616
|
}
|
|
617
617
|
update(t, e, i, n) {
|
|
618
618
|
if (this.from = t.from, this.to = t.to, this.width = e, this.pixelRatio = i, n !== void 0 && n > 0) {
|
|
@@ -622,10 +622,10 @@ class Os {
|
|
|
622
622
|
this.resolveInterval();
|
|
623
623
|
}
|
|
624
624
|
setLabelCount(t) {
|
|
625
|
-
this.labelCountHintValue =
|
|
625
|
+
this.labelCountHintValue = Os(t), this.resetHysteresis(), this.resolveInterval();
|
|
626
626
|
}
|
|
627
627
|
setMinSpacing(t) {
|
|
628
|
-
this.minSpacingValue =
|
|
628
|
+
this.minSpacingValue = $s(t), this.resetHysteresis(), this.resolveInterval();
|
|
629
629
|
}
|
|
630
630
|
resetHysteresis() {
|
|
631
631
|
this.lastInterval = null, this.lastWant = null;
|
|
@@ -660,7 +660,7 @@ class Os {
|
|
|
660
660
|
this.lastBucketKey !== null && this.lastBucketKey !== a && this.resetHysteresis(), this.lastBucketKey = a, this.dataInterval = t, this.resolveInterval();
|
|
661
661
|
}
|
|
662
662
|
if (this.resolvedInterval == null) return { ticks: [], tickInterval: 0 };
|
|
663
|
-
const e = this.resolvedInterval, i = Math.ceil(this.from / e) * e, n = Math.max(0, Math.min(
|
|
663
|
+
const e = this.resolvedInterval, i = Math.ceil(this.from / e) * e, n = Math.max(0, Math.min(Es, Math.floor((this.to - i) / e) + 1)), r = [];
|
|
664
664
|
for (let a = 0; a < n; a++) r.push(i + a * e);
|
|
665
665
|
return { ticks: r, tickInterval: e };
|
|
666
666
|
}
|
|
@@ -680,7 +680,7 @@ class Os {
|
|
|
680
680
|
this.resolvedInterval = null;
|
|
681
681
|
return;
|
|
682
682
|
}
|
|
683
|
-
const t =
|
|
683
|
+
const t = Ys(this.dataInterval), e = this.to - this.from, i = e / this.width * this.minLabelSpacing;
|
|
684
684
|
let n;
|
|
685
685
|
if (this.labelCountHint != null) {
|
|
686
686
|
const o = Math.max(1, this.labelCountHint);
|
|
@@ -715,10 +715,10 @@ class Os {
|
|
|
715
715
|
function gi(s) {
|
|
716
716
|
return s < 6e4 ? 0 : s < 36e5 ? 1 : s < 864e5 ? 2 : 3;
|
|
717
717
|
}
|
|
718
|
-
function
|
|
718
|
+
function Os(s) {
|
|
719
719
|
return typeof s == "number" && Number.isFinite(s) && s >= 2 ? Math.floor(s) : null;
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function $s(s) {
|
|
722
722
|
return typeof s == "number" && Number.isFinite(s) && s > 0 ? s : null;
|
|
723
723
|
}
|
|
724
724
|
function Pi(s) {
|
|
@@ -746,18 +746,18 @@ function Wi(s) {
|
|
|
746
746
|
const e = Math.abs(s);
|
|
747
747
|
return e === 0 ? "0" : e < 1 ? Pi(s) : e < 100 ? s.toFixed(4) : e >= 1e7 ? Nt(s) : e < 1e4 ? s.toFixed(2) : s.toFixed(0);
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function Xs(s) {
|
|
750
750
|
if (!Number.isFinite(s) || s <= 0) return 1;
|
|
751
751
|
const t = 10 ** Math.floor(Math.log10(s)), e = s / t;
|
|
752
752
|
return (e <= 1 ? 1 : e <= 2 ? 2 : e <= 5 ? 5 : 10) * t;
|
|
753
753
|
}
|
|
754
|
-
function
|
|
754
|
+
function Ns(s) {
|
|
755
755
|
if (!Number.isFinite(s) || s <= 0) return 1;
|
|
756
756
|
const t = 10 ** Math.floor(Math.log10(s)), e = s / t;
|
|
757
757
|
return (e >= 5 ? 5 : e >= 2 ? 2 : 1) * t;
|
|
758
758
|
}
|
|
759
|
-
const
|
|
760
|
-
class
|
|
759
|
+
const Us = 50, Gs = 50;
|
|
760
|
+
class js {
|
|
761
761
|
constructor() {
|
|
762
762
|
w(this, "min", 0), w(this, "max", 0), w(this, "height", 1), w(this, "pixelRatio", 1), w(this, "labelCountHintValue", null), w(this, "minSpacingValue", null), w(this, "resolvedInterval", null), w(this, "lastInterval", null), w(this, "lastRawInterval", null), w(this, "customFormat", null);
|
|
763
763
|
}
|
|
@@ -765,7 +765,7 @@ class Ks {
|
|
|
765
765
|
return this.labelCountHintValue;
|
|
766
766
|
}
|
|
767
767
|
get minLabelSpacing() {
|
|
768
|
-
return this.minSpacingValue ??
|
|
768
|
+
return this.minSpacingValue ?? Gs;
|
|
769
769
|
}
|
|
770
770
|
/** Recalculate the scale with a new Y range, chart height, and device pixel ratio. */
|
|
771
771
|
update(t, e, i) {
|
|
@@ -773,11 +773,11 @@ class Ks {
|
|
|
773
773
|
}
|
|
774
774
|
/** Desired label count. Invalid values (NaN, <2, Infinity) clear the hint. */
|
|
775
775
|
setLabelCount(t) {
|
|
776
|
-
this.labelCountHintValue =
|
|
776
|
+
this.labelCountHintValue = Ks(t), this.resetHysteresis(), this.resolveInterval();
|
|
777
777
|
}
|
|
778
778
|
/** Minimum pixel gap between adjacent labels. */
|
|
779
779
|
setMinSpacing(t) {
|
|
780
|
-
this.minSpacingValue =
|
|
780
|
+
this.minSpacingValue = Js(t), this.resetHysteresis(), this.resolveInterval();
|
|
781
781
|
}
|
|
782
782
|
resetHysteresis() {
|
|
783
783
|
this.lastInterval = null, this.lastRawInterval = null;
|
|
@@ -810,7 +810,7 @@ class Ks {
|
|
|
810
810
|
*/
|
|
811
811
|
niceTickValues() {
|
|
812
812
|
if (this.resolvedInterval == null) return [];
|
|
813
|
-
const t = this.resolvedInterval, e = Math.ceil(this.min / t) * t, i = Math.max(0, Math.min(
|
|
813
|
+
const t = this.resolvedInterval, e = Math.ceil(this.min / t) * t, i = Math.max(0, Math.min(Us, Math.floor((this.max - e) / t) + 1)), n = [];
|
|
814
814
|
for (let r = 0; r < i; r++) n.push(e + r * t);
|
|
815
815
|
return n;
|
|
816
816
|
}
|
|
@@ -858,9 +858,9 @@ class Ks {
|
|
|
858
858
|
return;
|
|
859
859
|
}
|
|
860
860
|
}
|
|
861
|
-
let r =
|
|
861
|
+
let r = Xs(n);
|
|
862
862
|
if (this.labelCountHint != null && this.countTicks(r) < this.labelCountHint) {
|
|
863
|
-
const a =
|
|
863
|
+
const a = Ns(n);
|
|
864
864
|
a >= e && a > 0 && (r = a);
|
|
865
865
|
}
|
|
866
866
|
this.resolvedInterval = r, this.lastInterval = r, this.lastRawInterval = n;
|
|
@@ -871,10 +871,10 @@ class Ks {
|
|
|
871
871
|
return Math.max(0, Math.floor((this.max - e) / t) + 1);
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
|
-
function
|
|
874
|
+
function Ks(s) {
|
|
875
875
|
return typeof s == "number" && Number.isFinite(s) && s >= 2 ? Math.floor(s) : null;
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function Js(s) {
|
|
878
878
|
return typeof s == "number" && Number.isFinite(s) && s > 0 ? s : null;
|
|
879
879
|
}
|
|
880
880
|
function Et(s, t) {
|
|
@@ -884,7 +884,7 @@ function Gt(s, t) {
|
|
|
884
884
|
const e = Math.max(1e-4, Math.abs(t) * 1e-5);
|
|
885
885
|
return Math.abs(s - t) > e;
|
|
886
886
|
}
|
|
887
|
-
function
|
|
887
|
+
function qs(s, t, e, i) {
|
|
888
888
|
const n = s == null ? void 0 : s.get(t);
|
|
889
889
|
if (!n) return 1;
|
|
890
890
|
if (i <= 0)
|
|
@@ -892,16 +892,16 @@ function Qs(s, t, e, i) {
|
|
|
892
892
|
const r = Zt((e - n.startTime) / i, 0, 1), a = Bi(r);
|
|
893
893
|
return r >= 1 && (s == null || s.delete(t)), a;
|
|
894
894
|
}
|
|
895
|
-
function
|
|
895
|
+
function Qs(s) {
|
|
896
896
|
let t = 0, e = 0;
|
|
897
897
|
for (const i of s)
|
|
898
898
|
i > 0 ? t += i : i < 0 && (e += i);
|
|
899
899
|
return { positive: t, negative: e };
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function Zs(s) {
|
|
902
902
|
return s.positive > 0 ? s.positive : s.negative < 0 ? s.negative : 0;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function tn(s) {
|
|
905
905
|
return s.positive > 0 ? 100 : s.negative < 0 ? -100 : 0;
|
|
906
906
|
}
|
|
907
907
|
class Vi {
|
|
@@ -920,7 +920,7 @@ class Vi {
|
|
|
920
920
|
var i;
|
|
921
921
|
const n = this.stores[e];
|
|
922
922
|
if (!n) return;
|
|
923
|
-
const r =
|
|
923
|
+
const r = As(t ?? []);
|
|
924
924
|
n.setData(r), (i = this.entries[e]) == null || i.clear();
|
|
925
925
|
}
|
|
926
926
|
appendPoint(t, e = 0) {
|
|
@@ -1008,7 +1008,7 @@ class Vi {
|
|
|
1008
1008
|
}
|
|
1009
1009
|
entranceProgress(t, e, i) {
|
|
1010
1010
|
const n = Et(this.getCommonOptions().entryMs, 400);
|
|
1011
|
-
return
|
|
1011
|
+
return qs(this.entries[t], e, i, n);
|
|
1012
1012
|
}
|
|
1013
1013
|
/** The effective Y-value to render for (layer, time) — substitutes smoothed value for the live last point. */
|
|
1014
1014
|
effectiveValue(t, e, i) {
|
|
@@ -1076,8 +1076,8 @@ class Vi {
|
|
|
1076
1076
|
const o = a.last();
|
|
1077
1077
|
n.push(o && o.time === e ? o.value : 0);
|
|
1078
1078
|
}
|
|
1079
|
-
const r =
|
|
1080
|
-
return { value: i === "percent" ?
|
|
1079
|
+
const r = Qs(n);
|
|
1080
|
+
return { value: i === "percent" ? tn(r) : Zs(r), isLive: !0 };
|
|
1081
1081
|
}
|
|
1082
1082
|
getLayerLastSnapshots() {
|
|
1083
1083
|
if (this.stores.length <= 1) return null;
|
|
@@ -1129,7 +1129,7 @@ class Vi {
|
|
|
1129
1129
|
return o > a ? { min: a, max: o } : null;
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
1132
|
-
const
|
|
1132
|
+
const en = {
|
|
1133
1133
|
colors: ["#26a69a", "#ef5350"],
|
|
1134
1134
|
barWidthRatio: 0.6,
|
|
1135
1135
|
stacking: "off"
|
|
@@ -1139,9 +1139,9 @@ function mi(s) {
|
|
|
1139
1139
|
const t = { ...s };
|
|
1140
1140
|
return s.enterAnimation !== void 0 && s.entryAnimation === void 0 && (t.entryAnimation = s.enterAnimation), s.enterMs !== void 0 && s.entryMs === void 0 && (t.entryMs = s.enterMs), t;
|
|
1141
1141
|
}
|
|
1142
|
-
class
|
|
1142
|
+
class sn extends Vi {
|
|
1143
1143
|
constructor(t, e) {
|
|
1144
|
-
super(t), w(this, "options"), this.options = { ...
|
|
1144
|
+
super(t), w(this, "options"), this.options = { ...en, ...mi(e) };
|
|
1145
1145
|
}
|
|
1146
1146
|
/** For chart compatibility — returns first store */
|
|
1147
1147
|
get store() {
|
|
@@ -1306,14 +1306,14 @@ class nn extends Vi {
|
|
|
1306
1306
|
}
|
|
1307
1307
|
}
|
|
1308
1308
|
function pi(s, t) {
|
|
1309
|
-
return s.length <= t ? s :
|
|
1309
|
+
return s.length <= t ? s : rn(
|
|
1310
1310
|
s,
|
|
1311
1311
|
t,
|
|
1312
1312
|
(e) => e.time,
|
|
1313
1313
|
(e) => e.value
|
|
1314
1314
|
);
|
|
1315
1315
|
}
|
|
1316
|
-
function
|
|
1316
|
+
function nn(s, t) {
|
|
1317
1317
|
if (s.length <= t) return s;
|
|
1318
1318
|
const e = Math.ceil(s.length / t), i = [];
|
|
1319
1319
|
for (let n = 0; n < s.length; n += e) {
|
|
@@ -1332,7 +1332,7 @@ function rn(s, t) {
|
|
|
1332
1332
|
}
|
|
1333
1333
|
return i;
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1335
|
+
function rn(s, t, e, i) {
|
|
1336
1336
|
if (t >= s.length || t < 3) return s;
|
|
1337
1337
|
const n = [s[0]], r = (s.length - 2) / (t - 2);
|
|
1338
1338
|
let a = 0;
|
|
@@ -1371,7 +1371,7 @@ function qt(s, t) {
|
|
|
1371
1371
|
const [n, r, a] = Je(s);
|
|
1372
1372
|
return i = `rgba(${n}, ${r}, ${a}, ${t})`, bi.set(e, i), i;
|
|
1373
1373
|
}
|
|
1374
|
-
function
|
|
1374
|
+
function an(s, t) {
|
|
1375
1375
|
const e = s + t;
|
|
1376
1376
|
let i = vi.get(e);
|
|
1377
1377
|
if (i) return i;
|
|
@@ -1382,7 +1382,7 @@ function on(s, t) {
|
|
|
1382
1382
|
Math.min(255, Math.round(a + (255 - a) * t))
|
|
1383
1383
|
), vi.set(e, i), i;
|
|
1384
1384
|
}
|
|
1385
|
-
function
|
|
1385
|
+
function on(s, t) {
|
|
1386
1386
|
const e = s + t;
|
|
1387
1387
|
let i = yi.get(e);
|
|
1388
1388
|
if (i) return i;
|
|
@@ -1393,7 +1393,7 @@ function ln(s, t) {
|
|
|
1393
1393
|
Math.max(0, Math.round(a * (1 - t)))
|
|
1394
1394
|
), yi.set(e, i), i;
|
|
1395
1395
|
}
|
|
1396
|
-
const
|
|
1396
|
+
const ln = {
|
|
1397
1397
|
upColor: "#26a69a",
|
|
1398
1398
|
downColor: "#ef5350",
|
|
1399
1399
|
wickUpColor: "#26a69a",
|
|
@@ -1405,9 +1405,9 @@ function xi(s) {
|
|
|
1405
1405
|
const t = { ...s };
|
|
1406
1406
|
return s.candleGradient !== void 0 && s.bodyGradient === void 0 && (t.bodyGradient = s.candleGradient), s.enterAnimation !== void 0 && s.entryAnimation === void 0 && (t.entryAnimation = s.enterAnimation), s.enterMs !== void 0 && s.entryMs === void 0 && (t.entryMs = s.enterMs), t;
|
|
1407
1407
|
}
|
|
1408
|
-
class
|
|
1408
|
+
class hn {
|
|
1409
1409
|
constructor(t, e) {
|
|
1410
|
-
w(this, "store"), w(this, "options"), w(this, "displayedLast", null), w(this, "lastSeededTime", Number.NaN), w(this, "lastRenderTime", 0), w(this, "entries", /* @__PURE__ */ new Map()), this.store = t, this.options = { ...
|
|
1410
|
+
w(this, "store"), w(this, "options"), w(this, "displayedLast", null), w(this, "lastSeededTime", Number.NaN), w(this, "lastRenderTime", 0), w(this, "entries", /* @__PURE__ */ new Map()), this.store = t, this.options = { ...ln, ...xi(e) };
|
|
1411
1411
|
}
|
|
1412
1412
|
updateOptions(t) {
|
|
1413
1413
|
this.options = { ...this.options, ...xi(t) };
|
|
@@ -1417,7 +1417,7 @@ class cn {
|
|
|
1417
1417
|
}
|
|
1418
1418
|
// --- SeriesRenderer interface implementation ------------------------------
|
|
1419
1419
|
setData(t) {
|
|
1420
|
-
this.store.setData(
|
|
1420
|
+
this.store.setData(Ps(t ?? [])), this.entries.clear();
|
|
1421
1421
|
}
|
|
1422
1422
|
appendPoint(t) {
|
|
1423
1423
|
const e = t, i = ft(e.time);
|
|
@@ -1524,7 +1524,7 @@ class cn {
|
|
|
1524
1524
|
this.advanceLiveTracking(u);
|
|
1525
1525
|
let c = this.store.getVisibleData(l.from, l.to);
|
|
1526
1526
|
const d = e.mediaSize.width, f = c.length > d * 2;
|
|
1527
|
-
if (f && (c =
|
|
1527
|
+
if (f && (c = nn(c, Math.round(d * 1.5)), this.entries.clear()), c.length === 0) return;
|
|
1528
1528
|
if (!f && this.displayedLast) {
|
|
1529
1529
|
const R = c.length - 1;
|
|
1530
1530
|
c[R].time === this.displayedLast.time && (c = [...c.slice(0, R), this.displayedLast]);
|
|
@@ -1628,7 +1628,7 @@ class cn {
|
|
|
1628
1628
|
});
|
|
1629
1629
|
t.save(), t.globalAlpha = b.alpha, t.fillRect(b.x, b.topY, o, Math.max(1, b.bottomY - b.topY)), t.restore();
|
|
1630
1630
|
}
|
|
1631
|
-
const g = this.options.bodyGradient !== !1, p = g ?
|
|
1631
|
+
const g = this.options.bodyGradient !== !1, p = g ? an(l, 0.2) : l, m = g ? on(l, 0.15) : l;
|
|
1632
1632
|
g || (t.fillStyle = l);
|
|
1633
1633
|
for (const v of e) {
|
|
1634
1634
|
const y = (c == null ? void 0 : c.get(v.time)) ?? 1, x = i.timeToBitmapX(v.time), S = n.valueToBitmapY(v.open), M = n.valueToBitmapY(v.close), C = Math.min(S, M), R = Math.max(S, M), b = Math.max(1, R - C), k = y < 1 && d !== "none";
|
|
@@ -1680,7 +1680,7 @@ function _e(s, t, e) {
|
|
|
1680
1680
|
};
|
|
1681
1681
|
}
|
|
1682
1682
|
}
|
|
1683
|
-
const
|
|
1683
|
+
const cn = {
|
|
1684
1684
|
colors: ["#2962FF"],
|
|
1685
1685
|
strokeWidth: 1,
|
|
1686
1686
|
area: { visible: !0 },
|
|
@@ -1692,9 +1692,9 @@ function Si(s) {
|
|
|
1692
1692
|
const t = { ...s };
|
|
1693
1693
|
return s.areaFill !== void 0 && s.area === void 0 && (t.area = { visible: !!s.areaFill }), s.enterAnimation !== void 0 && s.entryAnimation === void 0 && (t.entryAnimation = s.enterAnimation), s.enterMs !== void 0 && s.entryMs === void 0 && (t.entryMs = s.enterMs), t;
|
|
1694
1694
|
}
|
|
1695
|
-
class
|
|
1695
|
+
class un extends Vi {
|
|
1696
1696
|
constructor(t, e) {
|
|
1697
|
-
super(t), w(this, "options"), w(this, "areaGradientCache", /* @__PURE__ */ new Map()), this.options = { ...
|
|
1697
|
+
super(t), w(this, "options"), w(this, "areaGradientCache", /* @__PURE__ */ new Map()), this.options = { ...cn, ...Si(e) };
|
|
1698
1698
|
}
|
|
1699
1699
|
/** Back-compat: first store. */
|
|
1700
1700
|
get store() {
|
|
@@ -2001,7 +2001,7 @@ const Ei = {
|
|
|
2001
2001
|
// that PAV collapses into a centered block on dense datasets.
|
|
2002
2002
|
labelGap: 1.8,
|
|
2003
2003
|
balanceSides: !0
|
|
2004
|
-
},
|
|
2004
|
+
}, dn = {
|
|
2005
2005
|
innerRadiusRatio: 0,
|
|
2006
2006
|
// 1.15° ≈ 0.02 rad — same visual default as before the radians→degrees switch.
|
|
2007
2007
|
padAngle: 1.15,
|
|
@@ -2009,17 +2009,17 @@ const Ei = {
|
|
|
2009
2009
|
// Motion off by default: label draw-in + hover explode both skipped.
|
|
2010
2010
|
animate: !1
|
|
2011
2011
|
}, Oe = Math.PI / 180;
|
|
2012
|
-
function
|
|
2012
|
+
function fn(s, t) {
|
|
2013
2013
|
return { ...s ?? {}, ...t };
|
|
2014
2014
|
}
|
|
2015
|
-
function
|
|
2015
|
+
function gn(s) {
|
|
2016
2016
|
return { ...Ei, ...s ?? {} };
|
|
2017
2017
|
}
|
|
2018
|
-
function
|
|
2018
|
+
function mn(s) {
|
|
2019
2019
|
const t = { color: "rgba(0, 0, 0, 0.22)", blur: 24, offsetX: 0, offsetY: 10 };
|
|
2020
2020
|
return s === !0 || s === !1 ? t : { ...t, ...s };
|
|
2021
2021
|
}
|
|
2022
|
-
function
|
|
2022
|
+
function pn(s) {
|
|
2023
2023
|
const t = { color: "rgba(0, 0, 0, 0.1)", depth: 0.3 };
|
|
2024
2024
|
return s === !0 || s === !1 ? t : { ...t, ...s };
|
|
2025
2025
|
}
|
|
@@ -2028,12 +2028,12 @@ function wi(s) {
|
|
|
2028
2028
|
const { bitmapWidth: t, bitmapHeight: e, padTop: i, padBottom: n } = s, r = Math.max(0, s.labelReserve ?? 0), a = Math.min(Math.max(0, i), e), o = Math.min(Math.max(0, n), e - a), l = e - a - o, u = Math.max(0, t - 2 * r), c = t / 2, d = a + l / 2, f = Math.max(0, Math.min(u, l) / 2 * _i);
|
|
2029
2029
|
return { cx: c, cy: d, maxR: f };
|
|
2030
2030
|
}
|
|
2031
|
-
function
|
|
2031
|
+
function bn(s) {
|
|
2032
2032
|
if (!s.startsWith("#")) return !1;
|
|
2033
2033
|
const t = parseInt(s.slice(1, 3), 16), e = parseInt(s.slice(3, 5), 16), i = parseInt(s.slice(5, 7), 16);
|
|
2034
2034
|
return t * 0.299 + e * 0.587 + i * 0.114 > 150;
|
|
2035
2035
|
}
|
|
2036
|
-
function
|
|
2036
|
+
function vn(s, t) {
|
|
2037
2037
|
if (!s.startsWith("#")) return s;
|
|
2038
2038
|
const e = Math.min(255, parseInt(s.slice(1, 3), 16) + Math.round(255 * t)), i = Math.min(255, parseInt(s.slice(3, 5), 16) + Math.round(255 * t)), n = Math.min(255, parseInt(s.slice(5, 7), 16) + Math.round(255 * t));
|
|
2039
2039
|
return `#${e.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}${n.toString(16).padStart(2, "0")}`;
|
|
@@ -2058,14 +2058,14 @@ function Ci(s) {
|
|
|
2058
2058
|
}
|
|
2059
2059
|
return { r: 0, g: 0, b: 0, a: 1 };
|
|
2060
2060
|
}
|
|
2061
|
-
function
|
|
2061
|
+
function yn(s, t) {
|
|
2062
2062
|
const e = Ci(s), i = Ci(t), n = i.a, r = Math.round(i.r * n + e.r * (1 - n)), a = Math.round(i.g * n + e.g * (1 - n)), o = Math.round(i.b * n + e.b * (1 - n));
|
|
2063
2063
|
return `#${r.toString(16).padStart(2, "0")}${a.toString(16).padStart(2, "0")}${o.toString(16).padStart(2, "0")}`;
|
|
2064
2064
|
}
|
|
2065
2065
|
var _, $, xt, et, jt, Pt, pt, Ot, wt, $e, xe, Hi, Oi, $i;
|
|
2066
2066
|
class Se {
|
|
2067
2067
|
constructor(t) {
|
|
2068
|
-
P(this, wt), P(this, _, []), P(this, $), P(this, xt, -1), P(this, et, []), P(this, jt, 0), P(this, Pt, 1), P(this, pt, null), P(this, Ot, []), D(this, $, E(this, wt, $e).call(this,
|
|
2068
|
+
P(this, wt), P(this, _, []), P(this, $), P(this, xt, -1), P(this, et, []), P(this, jt, 0), P(this, Pt, 1), P(this, pt, null), P(this, Ot, []), D(this, $, E(this, wt, $e).call(this, dn, t ?? {}));
|
|
2069
2069
|
}
|
|
2070
2070
|
getData() {
|
|
2071
2071
|
return h(this, _);
|
|
@@ -2193,7 +2193,7 @@ class Se {
|
|
|
2193
2193
|
const Z = A === h(this, xt) ? 1 : 0;
|
|
2194
2194
|
h(this, et)[A] = Yt(h(this, et)[A], Z, f, c);
|
|
2195
2195
|
}
|
|
2196
|
-
const g =
|
|
2196
|
+
const g = gn(h(this, $).sliceLabels);
|
|
2197
2197
|
r.font = `${g.fontSize * o}px ${i.typography.fontFamily}`, g.mode === "outside" && h(this, $).animate && D(this, Pt, Yt(h(this, Pt), 1, 6, c));
|
|
2198
2198
|
const p = h(this, $).colors ?? i.seriesColors, m = g.mode === "outside" ? E(this, wt, Hi).call(this, r, g, d, o) : 0, { cx: v, cy: y, maxR: x } = wi({
|
|
2199
2199
|
bitmapWidth: a.width,
|
|
@@ -2201,7 +2201,7 @@ class Se {
|
|
|
2201
2201
|
padTop: n.top * l,
|
|
2202
2202
|
padBottom: n.bottom * l,
|
|
2203
2203
|
labelReserve: m
|
|
2204
|
-
}), S = x, M = S * h(this, $).innerRadiusRatio, C = h(this, $).padAngle * Oe, R = 8 * o, b = h(this, $).shadow ?? !1, k =
|
|
2204
|
+
}), S = x, M = S * h(this, $).innerRadiusRatio, C = h(this, $).padAngle * Oe, R = 8 * o, b = h(this, $).shadow ?? !1, k = mn(b), T = h(this, $).innerShadow ?? !1, I = pn(T);
|
|
2205
2205
|
let F = -Math.PI / 2;
|
|
2206
2206
|
for (let A = 0; A < h(this, _).length; A++) {
|
|
2207
2207
|
const Z = h(this, _)[A], U = Z.value / d * Qt, O = F + C / 2, st = F + U - C / 2, lt = F + U / 2, nt = Z.color ?? p[A % p.length];
|
|
@@ -2212,9 +2212,9 @@ class Se {
|
|
|
2212
2212
|
const Mt = h(this, et)[A] * R, Ft = Math.cos(lt) * Mt, Bt = Math.sin(lt) * Mt, ht = v + Ft, rt = y + Bt;
|
|
2213
2213
|
r.beginPath(), r.arc(ht, rt, S, O, st), M > 0 ? r.arc(ht, rt, M, st, O, !0) : r.lineTo(ht, rt), r.closePath();
|
|
2214
2214
|
const ct = r.createRadialGradient(ht, rt, M || 0, ht, rt, S);
|
|
2215
|
-
if (ct.addColorStop(0,
|
|
2215
|
+
if (ct.addColorStop(0, vn(nt, 0.15)), T) {
|
|
2216
2216
|
const vt = Math.max(0, Math.min(0.999, 1 - I.depth));
|
|
2217
|
-
ct.addColorStop(vt, nt), ct.addColorStop(1,
|
|
2217
|
+
ct.addColorStop(vt, nt), ct.addColorStop(1, yn(nt, I.color));
|
|
2218
2218
|
} else
|
|
2219
2219
|
ct.addColorStop(1, nt);
|
|
2220
2220
|
r.fillStyle = ct;
|
|
@@ -2263,7 +2263,7 @@ class Se {
|
|
|
2263
2263
|
const O = F + U / 2, st = h(this, et)[A] * R, lt = Z.color ?? p[A % p.length], nt = E(this, wt, xe).call(this, Z, d, g.content), Mt = r.measureText(nt).width, Ft = g.fontSize * 1.2 * o, Bt = U < Math.PI ? 2 * V * Math.sin(U / 2) : 2 * V, ht = Mt > Bt - 4 * o, rt = M > 0 && V - M < Ft;
|
|
2264
2264
|
if (!ht && !rt) {
|
|
2265
2265
|
const ct = v + Math.cos(O) * (V + st), kt = y + Math.sin(O) * (V + st);
|
|
2266
|
-
r.fillStyle =
|
|
2266
|
+
r.fillStyle = bn(lt) ? "#000000" : "#ffffff", r.fillText(nt, ct, kt);
|
|
2267
2267
|
}
|
|
2268
2268
|
}
|
|
2269
2269
|
F += U;
|
|
@@ -2276,7 +2276,7 @@ _ = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), xt = /* @_
|
|
|
2276
2276
|
*/
|
|
2277
2277
|
$e = function(s, t) {
|
|
2278
2278
|
const e = { ...s, ...t };
|
|
2279
|
-
return t.sliceLabels !== void 0 && (e.sliceLabels =
|
|
2279
|
+
return t.sliceLabels !== void 0 && (e.sliceLabels = fn(s.sliceLabels, t.sliceLabels)), e;
|
|
2280
2280
|
}, /** Build the text shown for one slice given the resolved content mode. */
|
|
2281
2281
|
xe = function(s, t, e) {
|
|
2282
2282
|
const i = t > 0 ? s.value / t * 100 : 0, n = `${i.toFixed(i >= 10 ? 0 : 1)}%`;
|
|
@@ -2415,7 +2415,7 @@ $i = function(s) {
|
|
|
2415
2415
|
}
|
|
2416
2416
|
return u;
|
|
2417
2417
|
};
|
|
2418
|
-
const
|
|
2418
|
+
const xn = {
|
|
2419
2419
|
background: "#131722",
|
|
2420
2420
|
chartGradient: ["#1a1f2e", "#101318"],
|
|
2421
2421
|
typography: {
|
|
@@ -2479,8 +2479,8 @@ const Sn = {
|
|
|
2479
2479
|
bottom: 20,
|
|
2480
2480
|
right: { intervals: 3 },
|
|
2481
2481
|
left: { intervals: 0 }
|
|
2482
|
-
},
|
|
2483
|
-
class
|
|
2482
|
+
}, Sn = 0.1, wn = 0.3, Cn = 0.4, Mn = 0.5, kn = 4;
|
|
2483
|
+
class Tn extends pe {
|
|
2484
2484
|
constructor({ padding: t, reboundMs: e } = {}) {
|
|
2485
2485
|
super(), w(this, "_visibleRange", { from: 0, to: 0 }), w(this, "_yRange", { min: 0, max: 0 }), w(this, "_autoScroll", !0), w(this, "padding"), w(this, "reboundMs"), w(this, "dataInterval", 6e4), w(this, "_dataStart", null), w(this, "_dataEnd", null), w(this, "_prevDataEnd", null), w(this, "_animating", !1), w(this, "animStartTime", 0), w(this, "animDuration", 0), w(this, "animFrom", { from: 0, to: 0 }), w(this, "animTo", { from: 0, to: 0 }), w(this, "_lastChartWidth", 0), this.padding = {
|
|
2486
2486
|
top: (t == null ? void 0 : t.top) ?? zt.top,
|
|
@@ -2633,7 +2633,7 @@ class Rn extends pe {
|
|
|
2633
2633
|
if (a <= 0) return;
|
|
2634
2634
|
const o = this.softMinRange, { left: l, right: u } = this.getSoftBounds(a, i), c = l !== null && u !== null ? u - l : this.softMaxRange();
|
|
2635
2635
|
let d = e;
|
|
2636
|
-
const f = o *
|
|
2636
|
+
const f = o * Cn;
|
|
2637
2637
|
if (e < 1 && a < o) {
|
|
2638
2638
|
const y = o - a, x = (1 - Math.min(1, y / f)) ** 2;
|
|
2639
2639
|
d = 1 - (1 - e) * x;
|
|
@@ -2668,7 +2668,7 @@ class Rn extends pe {
|
|
|
2668
2668
|
this.cancelAnimation(), e > 0 && (this._lastChartWidth = e);
|
|
2669
2669
|
const { from: i, to: n } = this._visibleRange, r = n - i;
|
|
2670
2670
|
if (r <= 0) return;
|
|
2671
|
-
const { left: a, right: o } = this.getSoftBounds(r, e), l = r *
|
|
2671
|
+
const { left: a, right: o } = this.getSoftBounds(r, e), l = r * wn;
|
|
2672
2672
|
let u = t;
|
|
2673
2673
|
if (t > 0 && o !== null) {
|
|
2674
2674
|
const g = Math.max(0, n - o);
|
|
@@ -2717,7 +2717,7 @@ class Rn extends pe {
|
|
|
2717
2717
|
}
|
|
2718
2718
|
const f = Math.abs(l - e), g = Math.abs(u - i);
|
|
2719
2719
|
if (f < 1 && g < 1) return;
|
|
2720
|
-
const p = n *
|
|
2720
|
+
const p = n * Sn;
|
|
2721
2721
|
let m = null, v = 0, y = 0;
|
|
2722
2722
|
d !== null && i - d > p ? (m = "right", v = i - d, y = d) : c !== null && c - e > p && (m = "left", v = c - e, y = c), this.reboundMs <= 0 ? this.applyRange(l, u) : this.animateTo(l, u, this.reboundMs), m !== null && this.emit("edgeReached", {
|
|
2723
2723
|
side: m,
|
|
@@ -2750,7 +2750,7 @@ class Rn extends pe {
|
|
|
2750
2750
|
if (i <= 0) return;
|
|
2751
2751
|
const n = this.resolveHPad(this.padding.right, i, e), r = this._animating ? this.animTo.to : this._visibleRange.to, a = this._prevDataEnd !== null ? r - this._prevDataEnd : n, o = Math.max(0, Math.min(n, a)), l = t + o, u = l - i;
|
|
2752
2752
|
this._autoScroll = !0;
|
|
2753
|
-
const c =
|
|
2753
|
+
const c = Mn * this.dataInterval, d = e > 0 ? kn / e * i : c, f = Math.min(c, d);
|
|
2754
2754
|
if (this._animating) {
|
|
2755
2755
|
if (Math.abs(l - this.animTo.to) < f) return;
|
|
2756
2756
|
this.animFrom = { ...this._visibleRange }, this.animTo = { from: u, to: l }, this._prevDataEnd = this._dataEnd;
|
|
@@ -2770,7 +2770,7 @@ class Rn extends pe {
|
|
|
2770
2770
|
function ee(s, t) {
|
|
2771
2771
|
return s === !1 || s === 0 ? 0 : s === void 0 ? t : s;
|
|
2772
2772
|
}
|
|
2773
|
-
function
|
|
2773
|
+
function Rn(s) {
|
|
2774
2774
|
if (s === !1)
|
|
2775
2775
|
return {
|
|
2776
2776
|
points: { enterMs: 0, smoothMs: 0, pulseMs: 0 },
|
|
@@ -2786,7 +2786,7 @@ function Ln(s) {
|
|
|
2786
2786
|
};
|
|
2787
2787
|
return { points: n, viewport: r };
|
|
2788
2788
|
}
|
|
2789
|
-
function
|
|
2789
|
+
function Ln(s) {
|
|
2790
2790
|
if (!s) return { monitor: null, ownsMonitor: !1, showHud: !1 };
|
|
2791
2791
|
if (s === !0) return { monitor: new Ee(), ownsMonitor: !0, showHud: !0 };
|
|
2792
2792
|
if (s instanceof Ee) return { monitor: s, ownsMonitor: !1, showHud: !1 };
|
|
@@ -2797,17 +2797,17 @@ function In(s) {
|
|
|
2797
2797
|
showHud: t ?? !n
|
|
2798
2798
|
};
|
|
2799
2799
|
}
|
|
2800
|
-
let
|
|
2800
|
+
let In = 0;
|
|
2801
2801
|
var J, W, j, Tt, re, z, G, ae, at, Rt, tt, Wt, Xe, Kt, St, we, Ce, It, oe, $t, fe, Te, Xt, Lt, le, he, X, Vt, Mi, Me, ce, ue, Xi, Ni, ke, gt, mt, Jt;
|
|
2802
|
-
class
|
|
2802
|
+
class Dn extends pe {
|
|
2803
2803
|
constructor(t, e) {
|
|
2804
2804
|
var i, n, r, a;
|
|
2805
|
-
super(), P(this, X), P(this, J), P(this, W), P(this, j), P(this, Tt), w(this, "timeScale"), w(this, "yScale"), P(this, re), P(this, z, []), P(this, G), P(this, ae), P(this, at, 6e4), P(this, Rt, null), P(this, tt, {}), P(this, Wt, null), P(this, Xe, !1), P(this, Kt, {}), P(this, St, { left: "idle", right: "idle" }), P(this, we, { left: null, right: null }), P(this, Ce), P(this, It, 0), P(this, oe, !1), P(this, $t, !1), P(this, fe, !1), P(this, Te, 0), P(this, Xt), P(this, Lt), P(this, le, !1), P(this, he, null), P(this, ke, 0), P(this, gt, 0), P(this, mt, 0), P(this, Jt, !1), e != null && e.axis && (D(this, Kt, e.axis), D(this, tt, { min: (i = e.axis.y) == null ? void 0 : i.min, max: (n = e.axis.y) == null ? void 0 : n.max })), D(this, G, (e == null ? void 0 : e.theme) ??
|
|
2806
|
-
const o =
|
|
2807
|
-
D(this, Lt, o.monitor), D(this, le, o.ownsMonitor), D(this, J, new
|
|
2805
|
+
super(), P(this, X), P(this, J), P(this, W), P(this, j), P(this, Tt), w(this, "timeScale"), w(this, "yScale"), P(this, re), P(this, z, []), P(this, G), P(this, ae), P(this, at, 6e4), P(this, Rt, null), P(this, tt, {}), P(this, Wt, null), P(this, Xe, !1), P(this, Kt, {}), P(this, St, { left: "idle", right: "idle" }), P(this, we, { left: null, right: null }), P(this, Ce), P(this, It, 0), P(this, oe, !1), P(this, $t, !1), P(this, fe, !1), P(this, Te, 0), P(this, Xt), P(this, Lt), P(this, le, !1), P(this, he, null), P(this, ke, 0), P(this, gt, 0), P(this, mt, 0), P(this, Jt, !1), e != null && e.axis && (D(this, Kt, e.axis), D(this, tt, { min: (i = e.axis.y) == null ? void 0 : i.min, max: (n = e.axis.y) == null ? void 0 : n.max })), D(this, G, (e == null ? void 0 : e.theme) ?? xn), D(this, ae, ((r = e == null ? void 0 : e.grid) == null ? void 0 : r.visible) !== !1), D(this, Xt, Rn(e == null ? void 0 : e.animations)), D(this, Ce, e == null ? void 0 : e.onEdgeReached);
|
|
2806
|
+
const o = Ln(e == null ? void 0 : e.perf);
|
|
2807
|
+
D(this, Lt, o.monitor), D(this, le, o.ownsMonitor), D(this, J, new as(t, h(this, Lt) ?? void 0)), D(this, W, new Tn({
|
|
2808
2808
|
padding: e == null ? void 0 : e.padding,
|
|
2809
2809
|
reboundMs: h(this, Xt).viewport.reboundMs
|
|
2810
|
-
})),
|
|
2810
|
+
})), Ms(this, h(this, W)), this.timeScale = new Hs(), this.yScale = new js();
|
|
2811
2811
|
const l = h(this, Lt);
|
|
2812
2812
|
l ? (D(this, j, new be((c) => {
|
|
2813
2813
|
l.resetDrawCalls("main");
|
|
@@ -2817,9 +2817,9 @@ class Fn extends pe {
|
|
|
2817
2817
|
l.resetDrawCalls("overlay");
|
|
2818
2818
|
const d = performance.now();
|
|
2819
2819
|
this.renderOverlay(c), l.recordFrame("overlay", performance.now() - d, c);
|
|
2820
|
-
})), o.showHud && D(this, he, new
|
|
2820
|
+
})), o.showHud && D(this, he, new Ds(t, l))) : (D(this, j, new be((c) => this.renderMain(c))), D(this, Tt, new be((c) => this.renderOverlay(c))));
|
|
2821
2821
|
const u = (e == null ? void 0 : e.interactive) !== !1;
|
|
2822
|
-
D(this, re, u ? new
|
|
2822
|
+
D(this, re, u ? new ws(h(this, J).canvas, h(this, W), this.timeScale, this.yScale) : null), h(this, W).on("change", () => {
|
|
2823
2823
|
this.syncScales(), h(this, j).markDirty(), this.emit("viewportChange");
|
|
2824
2824
|
}), h(this, W).on("edgeReached", (c) => {
|
|
2825
2825
|
var d;
|
|
@@ -2851,7 +2851,7 @@ class Fn extends pe {
|
|
|
2851
2851
|
}
|
|
2852
2852
|
/** Add a candlestick (OHLC) series and return its unique ID. */
|
|
2853
2853
|
addCandlestickSeries(t) {
|
|
2854
|
-
const e = new zi(), i = new
|
|
2854
|
+
const e = new zi(), i = new hn(e, {
|
|
2855
2855
|
upColor: h(this, G).candlestick.upColor,
|
|
2856
2856
|
downColor: h(this, G).candlestick.downColor,
|
|
2857
2857
|
wickUpColor: h(this, G).candlestick.wickUpColor,
|
|
@@ -2865,7 +2865,7 @@ class Fn extends pe {
|
|
|
2865
2865
|
}
|
|
2866
2866
|
/** Add a line series and return its unique ID. */
|
|
2867
2867
|
addLineSeries(t) {
|
|
2868
|
-
const { layers: e, ...i } = t ?? {}, n = e ?? 1, r = new
|
|
2868
|
+
const { layers: e, ...i } = t ?? {}, n = e ?? 1, r = new un(n, {
|
|
2869
2869
|
colors: n === 1 ? [h(this, G).line.color] : h(this, G).seriesColors.slice(0, n),
|
|
2870
2870
|
strokeWidth: h(this, G).line.width,
|
|
2871
2871
|
area: { visible: !0 },
|
|
@@ -2877,7 +2877,7 @@ class Fn extends pe {
|
|
|
2877
2877
|
}
|
|
2878
2878
|
/** Add a bar series and return its unique ID. */
|
|
2879
2879
|
addBarSeries(t) {
|
|
2880
|
-
const { layers: e, ...i } = t ?? {}, n = e ?? 1, r = new
|
|
2880
|
+
const { layers: e, ...i } = t ?? {}, n = e ?? 1, r = new sn(n, {
|
|
2881
2881
|
colors: h(this, G).seriesColors.slice(0, n),
|
|
2882
2882
|
barWidthRatio: 0.6,
|
|
2883
2883
|
...E(this, X, Me).call(this, "bar"),
|
|
@@ -3215,7 +3215,7 @@ class Fn extends pe {
|
|
|
3215
3215
|
* — vertical padding only affects the Y-range computation, so touching it
|
|
3216
3216
|
* shouldn't reset the user's zoom / auto-scroll state. This matters when
|
|
3217
3217
|
* a wrapper re-applies padding reactively (e.g. in response to a Title /
|
|
3218
|
-
*
|
|
3218
|
+
* InfoBar ResizeObserver).
|
|
3219
3219
|
*/
|
|
3220
3220
|
setPadding(t) {
|
|
3221
3221
|
const e = h(this, W).getPadding();
|
|
@@ -3300,7 +3300,7 @@ class Fn extends pe {
|
|
|
3300
3300
|
const e = t.store.getAll();
|
|
3301
3301
|
if (e.length >= 2) {
|
|
3302
3302
|
const i = e.slice(0, 20).map((n) => n.time);
|
|
3303
|
-
D(this, at,
|
|
3303
|
+
D(this, at, Ws(i)), h(this, W).setDataInterval(h(this, at));
|
|
3304
3304
|
break;
|
|
3305
3305
|
}
|
|
3306
3306
|
}
|
|
@@ -3381,7 +3381,7 @@ class Fn extends pe {
|
|
|
3381
3381
|
const i = typeof t == "number" ? t : performance.now();
|
|
3382
3382
|
h(this, W).tick(i) && h(this, j).markDirty(), this.updateScales(), h(this, J).useMainLayer((n) => {
|
|
3383
3383
|
const { context: r, bitmapSize: a } = n, o = (e.media.width - this.yAxisWidth) * e.horizontalPixelRatio, l = (e.media.height - this.xAxisHeight) * e.verticalPixelRatio;
|
|
3384
|
-
r.clearRect(0, 0, a.width, a.height), r.save(), r.beginPath(), r.rect(0, 0, o, l), r.clip(), h(this, ae) &&
|
|
3384
|
+
r.clearRect(0, 0, a.width, a.height), r.save(), r.beginPath(), r.rect(0, 0, o, l), r.clip(), h(this, ae) && bs(n, this.timeScale, this.yScale, h(this, G), h(this, at));
|
|
3385
3385
|
const u = h(this, W).getPadding(), c = { top: u.top, bottom: u.bottom }, d = h(this, Lt);
|
|
3386
3386
|
for (const f of h(this, z)) {
|
|
3387
3387
|
if (!f.visible) continue;
|
|
@@ -3426,7 +3426,7 @@ class Fn extends pe {
|
|
|
3426
3426
|
const d = (n.media.width - this.yAxisWidth) * n.horizontalPixelRatio, f = (n.media.height - this.xAxisHeight) * n.verticalPixelRatio;
|
|
3427
3427
|
if (l.context.save(), l.context.beginPath(), l.context.rect(0, 0, d, f), l.context.clip(), h(this, Rt) && E(this, X, Xi).call(this)) {
|
|
3428
3428
|
const m = h(this, Rt).mediaX * n.horizontalPixelRatio, v = h(this, Rt).mediaY * n.verticalPixelRatio;
|
|
3429
|
-
|
|
3429
|
+
os(l, m, v, h(this, G));
|
|
3430
3430
|
}
|
|
3431
3431
|
const g = h(this, W).getPadding(), p = { top: g.top, bottom: g.bottom };
|
|
3432
3432
|
for (const m of h(this, z))
|
|
@@ -3458,7 +3458,7 @@ class Fn extends pe {
|
|
|
3458
3458
|
const r = h(this, St)[n];
|
|
3459
3459
|
if (r === "idle" || r === "has-more") continue;
|
|
3460
3460
|
const a = this.resolveEdgeBoundary(n);
|
|
3461
|
-
a !== null &&
|
|
3461
|
+
a !== null && gs({
|
|
3462
3462
|
scope: t,
|
|
3463
3463
|
timeScale: this.timeScale,
|
|
3464
3464
|
theme: h(this, G),
|
|
@@ -3512,7 +3512,7 @@ Mi = function(s) {
|
|
|
3512
3512
|
return s;
|
|
3513
3513
|
let t;
|
|
3514
3514
|
do
|
|
3515
|
-
t = `series_${++
|
|
3515
|
+
t = `series_${++In}`;
|
|
3516
3516
|
while (h(this, z).some((e) => e.id === t));
|
|
3517
3517
|
return t;
|
|
3518
3518
|
}, /**
|
|
@@ -3650,7 +3650,7 @@ function Ki(s, t) {
|
|
|
3650
3650
|
const a = Object.freeze(ji(r, e));
|
|
3651
3651
|
return Gi(s, t.cacheKey, { version: i, time: t.time, sort: e, data: a }), a;
|
|
3652
3652
|
}
|
|
3653
|
-
function
|
|
3653
|
+
function Fn(s, t) {
|
|
3654
3654
|
const e = t.sort ?? "none", i = s.getOverlayVersion(), n = Ui(s, t.cacheKey);
|
|
3655
3655
|
if (n && n.version === i && n.time === null && n.sort === e)
|
|
3656
3656
|
return n.data;
|
|
@@ -3743,16 +3743,16 @@ const wr = {
|
|
|
3743
3743
|
borderColor: "rgba(0, 0, 0, 0.1)"
|
|
3744
3744
|
}
|
|
3745
3745
|
};
|
|
3746
|
-
function
|
|
3746
|
+
function Bn(s) {
|
|
3747
3747
|
return parseInt(s.slice(1, 3), 16) * 0.299 + parseInt(s.slice(3, 5), 16) * 0.587 + parseInt(s.slice(5, 7), 16) * 0.114 < 128;
|
|
3748
3748
|
}
|
|
3749
3749
|
function K(s) {
|
|
3750
3750
|
var t, e, i, n, r, a, o, l, u, c, d, f, g, p, m, v, y, x, S, M, C, R, b, k, T, I, F, Y, V;
|
|
3751
|
-
const { background: B, name: A = "Custom", description: Z, fontUrl: U = null } = s, O =
|
|
3751
|
+
const { background: B, name: A = "Custom", description: Z, fontUrl: U = null } = s, O = Bn(B), st = O ? "#d1d4dc" : "#24292f", lt = O ? "#787b86" : "#8b949e", nt = O ? "#26a69a" : "#2da44e", Mt = O ? "#ef5350" : "#cf222e", Ft = O ? "#2962ff" : "#0969da", Bt = O ? "rgba(42,46,57,0.6)" : "rgba(200,200,200,0.5)", ht = O ? "rgba(150,150,150,0.5)" : "rgba(170,170,170,0.3)", rt = O ? ve(B, 0.1) : Ri(B, 0.05), ct = O ? ie(B, 0.92) : ie(B, 0.95), kt = O ? ie(ve(B, 0.15), 0.6) : "rgba(200,200,200,0.5)", vt = Fe, yt = ((t = s.candlestick) == null ? void 0 : t.upColor) ?? nt, q = ((e = s.candlestick) == null ? void 0 : e.downColor) ?? Mt, it = ((i = s.line) == null ? void 0 : i.color) ?? Ft, _t = ((n = s.tooltip) == null ? void 0 : n.textColor) ?? st, ts = ((r = s.axis) == null ? void 0 : r.textColor) ?? lt, es = ((a = s.typography) == null ? void 0 : a.fontFamily) ?? vt, is = {
|
|
3752
3752
|
background: B,
|
|
3753
3753
|
chartGradient: s.chartGradient ?? (O ? [ve(B, 0.04), Ri(B, 0.06)] : [ve(B, 0.06), B]),
|
|
3754
3754
|
typography: {
|
|
3755
|
-
fontFamily:
|
|
3755
|
+
fontFamily: es,
|
|
3756
3756
|
fontSize: ((o = s.typography) == null ? void 0 : o.fontSize) ?? 12,
|
|
3757
3757
|
axisFontSize: ((l = s.typography) == null ? void 0 : l.axisFontSize) ?? 10,
|
|
3758
3758
|
yFontSize: ((u = s.typography) == null ? void 0 : u.yFontSize) ?? 11,
|
|
@@ -3784,7 +3784,7 @@ function K(s) {
|
|
|
3784
3784
|
labelBackground: ((R = s.crosshair) == null ? void 0 : R.labelBackground) ?? rt,
|
|
3785
3785
|
labelTextColor: ((b = s.crosshair) == null ? void 0 : b.labelTextColor) ?? _t
|
|
3786
3786
|
},
|
|
3787
|
-
axis: { textColor:
|
|
3787
|
+
axis: { textColor: ts },
|
|
3788
3788
|
yLabel: {
|
|
3789
3789
|
upBackground: ((k = s.yLabel) == null ? void 0 : k.upBackground) ?? yt,
|
|
3790
3790
|
downBackground: ((T = s.yLabel) == null ? void 0 : T.downBackground) ?? q,
|
|
@@ -3797,7 +3797,7 @@ function K(s) {
|
|
|
3797
3797
|
borderColor: ((V = s.tooltip) == null ? void 0 : V.borderColor) ?? kt
|
|
3798
3798
|
}
|
|
3799
3799
|
};
|
|
3800
|
-
return { name: A, description: Z, fontUrl: U, dark: O, theme:
|
|
3800
|
+
return { name: A, description: Z, fontUrl: U, dark: O, theme: is };
|
|
3801
3801
|
}
|
|
3802
3802
|
function ie(s, t) {
|
|
3803
3803
|
const e = parseInt(s.slice(1, 3), 16), i = parseInt(s.slice(3, 5), 16), n = parseInt(s.slice(5, 7), 16);
|
|
@@ -3813,7 +3813,7 @@ function Ri(s, t) {
|
|
|
3813
3813
|
const e = Math.max(0, Math.round(parseInt(s.slice(1, 3), 16) * (1 - t))), i = Math.max(0, Math.round(parseInt(s.slice(3, 5), 16) * (1 - t))), n = Math.max(0, Math.round(parseInt(s.slice(5, 7), 16) * (1 - t)));
|
|
3814
3814
|
return `#${e.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}${n.toString(16).padStart(2, "0")}`;
|
|
3815
3815
|
}
|
|
3816
|
-
const Ie = "'JetBrains Mono', 'Fira Code', monospace", De = "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap", Fe = "'Outfit', -apple-system, BlinkMacSystemFont, sans-serif", qe = "https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600&display=swap", Ji = "'Roboto Mono', monospace", qi = "https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;600&display=swap",
|
|
3816
|
+
const Ie = "'JetBrains Mono', 'Fira Code', monospace", De = "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap", Fe = "'Outfit', -apple-system, BlinkMacSystemFont, sans-serif", qe = "https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600&display=swap", Ji = "'Roboto Mono', monospace", qi = "https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;600&display=swap", zn = "'IBM Plex Mono', monospace", Pn = "https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap", Qe = "'Fira Code', monospace", Ze = "https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap", Qi = "'Source Code Pro', monospace", Zi = "https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500;600&display=swap", An = "'Space Mono', monospace", Wn = "https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap", ti = "'Plus Jakarta Sans', sans-serif", ei = "https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap", Vn = "'Caveat', 'Comic Sans MS', cursive", Yn = "https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&display=swap", Cr = K({
|
|
3817
3817
|
name: "Andromeda",
|
|
3818
3818
|
description: "Deep space purples and cosmic blues",
|
|
3819
3819
|
background: "#23262e",
|
|
@@ -3967,13 +3967,13 @@ const Ie = "'JetBrains Mono', 'Fira Code', monospace", De = "https://fonts.googl
|
|
|
3967
3967
|
}), Ir = {
|
|
3968
3968
|
name: "Handwritten",
|
|
3969
3969
|
description: "Sketch-style with a personal touch",
|
|
3970
|
-
fontUrl:
|
|
3970
|
+
fontUrl: Yn,
|
|
3971
3971
|
dark: !1,
|
|
3972
3972
|
theme: {
|
|
3973
3973
|
background: "#fdf5e6",
|
|
3974
3974
|
chartGradient: ["#fef6e3", "#fdf5e6"],
|
|
3975
3975
|
typography: {
|
|
3976
|
-
fontFamily:
|
|
3976
|
+
fontFamily: Vn,
|
|
3977
3977
|
fontSize: 18,
|
|
3978
3978
|
axisFontSize: 13,
|
|
3979
3979
|
yFontSize: 15,
|
|
@@ -4029,7 +4029,7 @@ const Ie = "'JetBrains Mono', 'Fira Code', monospace", De = "https://fonts.googl
|
|
|
4029
4029
|
borderColor: "rgba(180,170,150,0.4)"
|
|
4030
4030
|
}
|
|
4031
4031
|
}
|
|
4032
|
-
},
|
|
4032
|
+
}, En = "'Silkscreen', cursive", _n = "https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap", Dr = K({
|
|
4033
4033
|
name: "Matrix",
|
|
4034
4034
|
background: "#000000",
|
|
4035
4035
|
candlestick: { upColor: "#00ff41", downColor: "#00802a" },
|
|
@@ -4051,8 +4051,8 @@ const Ie = "'JetBrains Mono', 'Fira Code', monospace", De = "https://fonts.googl
|
|
|
4051
4051
|
axis: { textColor: "#00cc33" },
|
|
4052
4052
|
crosshair: { color: "rgba(0,255,65,0.3)", labelBackground: "#0a1a0a" },
|
|
4053
4053
|
tooltip: { background: "rgba(0,10,0,0.95)", textColor: "#00ff41", borderColor: "rgba(0,255,65,0.2)" },
|
|
4054
|
-
typography: { fontFamily:
|
|
4055
|
-
fontUrl:
|
|
4054
|
+
typography: { fontFamily: En },
|
|
4055
|
+
fontUrl: _n,
|
|
4056
4056
|
chartGradient: ["#010a01", "#000000"]
|
|
4057
4057
|
}), Fr = K({
|
|
4058
4058
|
name: "Lavender Mist",
|
|
@@ -4130,7 +4130,7 @@ const Ie = "'JetBrains Mono', 'Fira Code', monospace", De = "https://fonts.googl
|
|
|
4130
4130
|
tooltip: { background: "rgba(41,45,62,0.92)", textColor: "#a6accd", borderColor: "rgba(55,59,75,0.6)" },
|
|
4131
4131
|
typography: { fontFamily: Ji },
|
|
4132
4132
|
fontUrl: qi
|
|
4133
|
-
}),
|
|
4133
|
+
}), Hn = "'Silkscreen', cursive", On = "https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap", Pr = K({
|
|
4134
4134
|
name: "Monochrome",
|
|
4135
4135
|
description: "Pure black and white, pixel font",
|
|
4136
4136
|
background: "#ffffff",
|
|
@@ -4154,8 +4154,8 @@ const Ie = "'JetBrains Mono', 'Fira Code', monospace", De = "https://fonts.googl
|
|
|
4154
4154
|
crosshair: { color: "rgba(0,0,0,0.08)", labelBackground: "#f0f0f0" },
|
|
4155
4155
|
axis: { textColor: "#b0b0b0" },
|
|
4156
4156
|
tooltip: { background: "rgba(255,255,255,0.97)", textColor: "#222222", borderColor: "rgba(0,0,0,0.08)" },
|
|
4157
|
-
typography: { fontFamily:
|
|
4158
|
-
fontUrl:
|
|
4157
|
+
typography: { fontFamily: Hn, tooltipFontSize: 9 },
|
|
4158
|
+
fontUrl: On
|
|
4159
4159
|
}), Ar = K({
|
|
4160
4160
|
name: "Mint Breeze",
|
|
4161
4161
|
background: "#f6f5ee",
|
|
@@ -4178,8 +4178,8 @@ const Ie = "'JetBrains Mono', 'Fira Code', monospace", De = "https://fonts.googl
|
|
|
4178
4178
|
axis: { textColor: "#80a098" },
|
|
4179
4179
|
crosshair: { color: "rgba(120,140,120,0.18)", labelBackground: "#ece8de" },
|
|
4180
4180
|
tooltip: { background: "rgba(246,245,238,0.95)", textColor: "#2a3530", borderColor: "rgba(130,140,115,0.2)" },
|
|
4181
|
-
typography: { fontFamily:
|
|
4182
|
-
fontUrl:
|
|
4181
|
+
typography: { fontFamily: An },
|
|
4182
|
+
fontUrl: Wn,
|
|
4183
4183
|
chartGradient: ["#f8f7f0", "#f6f5ee"]
|
|
4184
4184
|
}), Wr = K({
|
|
4185
4185
|
name: "Monokai Pro",
|
|
@@ -4329,8 +4329,8 @@ const Ie = "'JetBrains Mono', 'Fira Code', monospace", De = "https://fonts.googl
|
|
|
4329
4329
|
crosshair: { color: "rgba(170,170,170,0.3)", labelBackground: "#e8e8e8" },
|
|
4330
4330
|
axis: { textColor: "#aaaaaa" },
|
|
4331
4331
|
tooltip: { background: "rgba(245,245,245,0.95)", textColor: "#333333", borderColor: "rgba(200,200,200,0.5)" },
|
|
4332
|
-
typography: { fontFamily:
|
|
4333
|
-
fontUrl:
|
|
4332
|
+
typography: { fontFamily: zn },
|
|
4333
|
+
fontUrl: Pn
|
|
4334
4334
|
}), Or = K({
|
|
4335
4335
|
name: "Rosé Pine Dawn",
|
|
4336
4336
|
description: "Dawn-inspired warm neutrals",
|
|
@@ -4422,8 +4422,8 @@ function ot() {
|
|
|
4422
4422
|
throw new Error("useChartInstance must be used within <ChartContainer>");
|
|
4423
4423
|
return s;
|
|
4424
4424
|
}
|
|
4425
|
-
const
|
|
4426
|
-
function
|
|
4425
|
+
const $n = 20;
|
|
4426
|
+
function Xn({ data: s, options: t, id: e }) {
|
|
4427
4427
|
var l;
|
|
4428
4428
|
const i = ot(), n = N(null), r = N([]), a = N([]), o = N([]);
|
|
4429
4429
|
return Q(() => {
|
|
@@ -4443,7 +4443,7 @@ function Nn({ data: s, options: t, id: e }) {
|
|
|
4443
4443
|
const p = ft(d[0].time), m = ft(d[d.length - 1].time), v = o.current[c] ?? null, y = g !== null && g !== p, x = d.length - f;
|
|
4444
4444
|
if (y && x === 0 && (v !== null && v !== m))
|
|
4445
4445
|
i.setSeriesData(u, d.slice(0, -1), c), i.appendData(u, d[d.length - 1], c);
|
|
4446
|
-
else if (f === 0 || d.length < f || x >
|
|
4446
|
+
else if (f === 0 || d.length < f || x > $n || y)
|
|
4447
4447
|
i.setSeriesData(u, d, c);
|
|
4448
4448
|
else if (d.length === f)
|
|
4449
4449
|
i.updateData(u, d[d.length - 1], c);
|
|
@@ -4467,7 +4467,7 @@ function Nn({ data: s, options: t, id: e }) {
|
|
|
4467
4467
|
t == null ? void 0 : t.smoothMs
|
|
4468
4468
|
]), null;
|
|
4469
4469
|
}
|
|
4470
|
-
const
|
|
4470
|
+
const Nn = 20;
|
|
4471
4471
|
function Nr({ data: s, options: t, id: e }) {
|
|
4472
4472
|
const i = ot(), n = N(null), r = N(0), a = N(null), o = N(null);
|
|
4473
4473
|
return Q(() => {
|
|
@@ -4485,7 +4485,7 @@ function Nr({ data: s, options: t, id: e }) {
|
|
|
4485
4485
|
const u = r.current, c = a.current, d = o.current, f = ft(s[0].time), g = ft(s[s.length - 1].time), p = c !== null && c !== f, m = s.length - u;
|
|
4486
4486
|
if (p && m === 0 && (d !== null && d !== g))
|
|
4487
4487
|
i.setSeriesData(l, s.slice(0, -1)), i.appendData(l, s[s.length - 1]);
|
|
4488
|
-
else if (u === 0 || s.length < u || m >
|
|
4488
|
+
else if (u === 0 || s.length < u || m > Nn || p)
|
|
4489
4489
|
i.setSeriesData(l, s);
|
|
4490
4490
|
else if (s.length === u)
|
|
4491
4491
|
i.updateData(l, s[s.length - 1]);
|
|
@@ -4518,7 +4518,7 @@ function si() {
|
|
|
4518
4518
|
throw new Error("useTheme must be used within <ThemeProvider>");
|
|
4519
4519
|
return s;
|
|
4520
4520
|
}
|
|
4521
|
-
function
|
|
4521
|
+
function Un() {
|
|
4522
4522
|
return Ue(ii);
|
|
4523
4523
|
}
|
|
4524
4524
|
function ze(s, t, e) {
|
|
@@ -4534,14 +4534,14 @@ function ze(s, t, e) {
|
|
|
4534
4534
|
getSnapshot: e
|
|
4535
4535
|
};
|
|
4536
4536
|
}
|
|
4537
|
-
function
|
|
4537
|
+
function Gn(s) {
|
|
4538
4538
|
const t = Dt(
|
|
4539
4539
|
() => ze(s, ["viewportChange", "dataUpdate", "seriesChange"], () => s.getVisibleRange()),
|
|
4540
4540
|
[s]
|
|
4541
4541
|
);
|
|
4542
4542
|
return me(t.subscribe, t.getSnapshot);
|
|
4543
4543
|
}
|
|
4544
|
-
function
|
|
4544
|
+
function jn(s) {
|
|
4545
4545
|
const t = Dt(
|
|
4546
4546
|
() => ze(s, ["viewportChange", "dataUpdate", "seriesChange"], () => s.getYRange()),
|
|
4547
4547
|
[s]
|
|
@@ -4581,8 +4581,8 @@ function Pe(s) {
|
|
|
4581
4581
|
const t = Dt(() => ze(s, "crosshairMove", () => s.getCrosshairPosition()), [s]);
|
|
4582
4582
|
return me(t.subscribe, t.getSnapshot);
|
|
4583
4583
|
}
|
|
4584
|
-
const
|
|
4585
|
-
function
|
|
4584
|
+
const Kn = (s, t) => t === "volume" ? Nt(s) : Wi(s);
|
|
4585
|
+
function Jn({ sort: s = "none", format: t = Kn, children: e }) {
|
|
4586
4586
|
const i = ot(), n = si(), r = Pe(i), [, a] = bt(0);
|
|
4587
4587
|
Q(() => {
|
|
4588
4588
|
const f = () => a((g) => g + 1);
|
|
@@ -4590,7 +4590,7 @@ function ts({ sort: s = "none", format: t = Jn, children: e }) {
|
|
|
4590
4590
|
i.off("overlayChange", f);
|
|
4591
4591
|
};
|
|
4592
4592
|
}, [i]);
|
|
4593
|
-
const o =
|
|
4593
|
+
const o = Fn(i, { sort: s, cacheKey: "infobar-last" });
|
|
4594
4594
|
let l = o, u = o.length === 0 ? 0 : Math.max(...o.map((f) => f.data.time)), c = !1;
|
|
4595
4595
|
if (r !== null) {
|
|
4596
4596
|
const f = Ki(i, { time: r.time, sort: s, cacheKey: "infobar-hover" });
|
|
@@ -4683,7 +4683,6 @@ function se({ label: s, display: t, color: e, dim: i }) {
|
|
|
4683
4683
|
/* @__PURE__ */ L("span", { style: { color: e, fontWeight: 500, marginLeft: 2 }, children: t })
|
|
4684
4684
|
] });
|
|
4685
4685
|
}
|
|
4686
|
-
const jr = ts;
|
|
4687
4686
|
function qn({ chart: s, isolatedIdRef: t, setIsolatedId: e }) {
|
|
4688
4687
|
const i = [], n = s.getSeriesIds();
|
|
4689
4688
|
for (const r of n) {
|
|
@@ -4931,7 +4930,7 @@ function er({ children: s, sub: t, style: e }) {
|
|
|
4931
4930
|
function ir(s) {
|
|
4932
4931
|
let t = null, e = null, i = null, n = null;
|
|
4933
4932
|
const r = [], a = (o) => {
|
|
4934
|
-
if (ri(o) && o.type ===
|
|
4933
|
+
if (ri(o) && o.type === ss) {
|
|
4935
4934
|
ni.forEach(o.props.children, a);
|
|
4936
4935
|
return;
|
|
4937
4936
|
}
|
|
@@ -4949,7 +4948,7 @@ function ir(s) {
|
|
|
4949
4948
|
l.props.position === "overlay" ? r.push(o) : i = l;
|
|
4950
4949
|
return;
|
|
4951
4950
|
}
|
|
4952
|
-
if (o.type ===
|
|
4951
|
+
if (o.type === Jn) {
|
|
4953
4952
|
n = o;
|
|
4954
4953
|
return;
|
|
4955
4954
|
}
|
|
@@ -4972,11 +4971,11 @@ function sr({
|
|
|
4972
4971
|
className: c
|
|
4973
4972
|
}) {
|
|
4974
4973
|
var ht, rt, ct, kt, vt, yt;
|
|
4975
|
-
const d = N(l), f =
|
|
4974
|
+
const d = N(l), f = Un(), g = t ?? f ?? void 0, p = N(null), m = N(null), [v, y] = bt(0);
|
|
4976
4975
|
Q(() => {
|
|
4977
4976
|
if (!p.current || m.current) return;
|
|
4978
4977
|
const q = {};
|
|
4979
|
-
return e && (q.axis = e), g && (q.theme = g), i && (q.padding = i), r !== void 0 && (q.interactive = r), a !== void 0 && (q.grid = a), d.current !== void 0 && (q.perf = d.current), m.current = new
|
|
4978
|
+
return e && (q.axis = e), g && (q.theme = g), i && (q.padding = i), r !== void 0 && (q.interactive = r), a !== void 0 && (q.grid = a), d.current !== void 0 && (q.perf = d.current), m.current = new Dn(p.current, q), y((it) => it + 1), () => {
|
|
4980
4979
|
var it;
|
|
4981
4980
|
(it = m.current) == null || it.destroy(), m.current = null;
|
|
4982
4981
|
};
|
|
@@ -5033,7 +5032,7 @@ function sr({
|
|
|
5033
5032
|
left: 0,
|
|
5034
5033
|
right: 0,
|
|
5035
5034
|
// Lower than the series-overlay layer below, so the floating
|
|
5036
|
-
// <Tooltip> glass panel renders *above* Title/
|
|
5035
|
+
// <Tooltip> glass panel renders *above* Title/InfoBar
|
|
5037
5036
|
// when the cursor hovers near them.
|
|
5038
5037
|
zIndex: 2,
|
|
5039
5038
|
pointerEvents: "none",
|
|
@@ -5170,7 +5169,7 @@ function rr({ data: s, options: t, id: e }) {
|
|
|
5170
5169
|
t == null ? void 0 : t.smoothMs
|
|
5171
5170
|
]), null;
|
|
5172
5171
|
}
|
|
5173
|
-
function
|
|
5172
|
+
function jr({ data: s, options: t, id: e }) {
|
|
5174
5173
|
var r, a, o, l, u, c, d, f, g, p;
|
|
5175
5174
|
const i = ot(), n = N(null);
|
|
5176
5175
|
return Q(() => {
|
|
@@ -5202,7 +5201,7 @@ function Kr({ data: s, options: t, id: e }) {
|
|
|
5202
5201
|
n.current && i.setSeriesData(n.current, s);
|
|
5203
5202
|
}, [i, s]), null;
|
|
5204
5203
|
}
|
|
5205
|
-
function
|
|
5204
|
+
function Kr() {
|
|
5206
5205
|
const s = ot(), t = Pe(s);
|
|
5207
5206
|
if (!t) return null;
|
|
5208
5207
|
const e = s.getTheme(), i = s.getDataInterval(), n = {
|
|
@@ -5326,7 +5325,7 @@ function cr(s, t) {
|
|
|
5326
5325
|
return e.length > 0 ? e[0] : null;
|
|
5327
5326
|
}
|
|
5328
5327
|
const ur = 160, dr = 70;
|
|
5329
|
-
function
|
|
5328
|
+
function Jr({ seriesId: s, format: t = Nt, children: e }) {
|
|
5330
5329
|
const i = ot(), n = Pe(i), [, r] = bt(0);
|
|
5331
5330
|
Q(() => {
|
|
5332
5331
|
const f = () => r((g) => g + 1);
|
|
@@ -5470,7 +5469,7 @@ function mr(s) {
|
|
|
5470
5469
|
const t = s[0].value, i = s[s.length - 1].value - t, n = t !== 0 ? i / t * 100 : 0;
|
|
5471
5470
|
return { value: i, pct: n, positive: i >= 0 };
|
|
5472
5471
|
}
|
|
5473
|
-
function
|
|
5472
|
+
function qr({
|
|
5474
5473
|
data: s,
|
|
5475
5474
|
theme: t,
|
|
5476
5475
|
variant: e = "line",
|
|
@@ -5584,7 +5583,7 @@ function Qr({
|
|
|
5584
5583
|
}
|
|
5585
5584
|
}
|
|
5586
5585
|
) : /* @__PURE__ */ L(
|
|
5587
|
-
|
|
5586
|
+
Xn,
|
|
5588
5587
|
{
|
|
5589
5588
|
data: [s],
|
|
5590
5589
|
options: {
|
|
@@ -5618,9 +5617,9 @@ function Qr({
|
|
|
5618
5617
|
}
|
|
5619
5618
|
);
|
|
5620
5619
|
}
|
|
5621
|
-
function
|
|
5620
|
+
function Qr({ labelCount: s, minLabelSpacing: t } = {}) {
|
|
5622
5621
|
const e = ot();
|
|
5623
|
-
|
|
5622
|
+
Gn(e), Q(() => (e.setTimeAxisLabelDensity({
|
|
5624
5623
|
labelCount: s ?? null,
|
|
5625
5624
|
minLabelSpacing: t ?? null
|
|
5626
5625
|
}), () => {
|
|
@@ -5674,7 +5673,7 @@ function Zr({ labelCount: s, minLabelSpacing: t } = {}) {
|
|
|
5674
5673
|
);
|
|
5675
5674
|
}
|
|
5676
5675
|
const pr = (s, t) => t === "volume" ? Nt(s) : Wi(s);
|
|
5677
|
-
function
|
|
5676
|
+
function Zr({ sort: s = "none", format: t = pr, children: e }) {
|
|
5678
5677
|
const i = ot(), n = Pe(i), [, r] = bt(0);
|
|
5679
5678
|
if (Q(() => {
|
|
5680
5679
|
const f = () => r((g) => g + 1);
|
|
@@ -5815,7 +5814,7 @@ function vr({
|
|
|
5815
5814
|
letterSpacing: "0.02em"
|
|
5816
5815
|
},
|
|
5817
5816
|
children: [
|
|
5818
|
-
|
|
5817
|
+
Vs(t),
|
|
5819
5818
|
" ",
|
|
5820
5819
|
Le(t, o)
|
|
5821
5820
|
]
|
|
@@ -5860,9 +5859,9 @@ function ne({ label: s, color: t, display: e }) {
|
|
|
5860
5859
|
/* @__PURE__ */ L("span", { style: { fontWeight: 600, color: t, textAlign: "right" }, children: e })
|
|
5861
5860
|
] });
|
|
5862
5861
|
}
|
|
5863
|
-
function
|
|
5862
|
+
function ta({ format: s, labelCount: t, minLabelSpacing: e } = {}) {
|
|
5864
5863
|
const i = ot();
|
|
5865
|
-
|
|
5864
|
+
jn(i), Q(() => (i.yScale.setFormat(s ?? null), () => i.yScale.setFormat(null)), [i, s]), Q(() => (i.setYAxisLabelDensity({
|
|
5866
5865
|
labelCount: t ?? null,
|
|
5867
5866
|
minLabelSpacing: e ?? null
|
|
5868
5867
|
}), () => {
|
|
@@ -5921,7 +5920,7 @@ function yr(s, t) {
|
|
|
5921
5920
|
const i = s.getSeriesIdsByType("time", { visibleOnly: !0 });
|
|
5922
5921
|
return i.length > 0 ? i[0] : null;
|
|
5923
5922
|
}
|
|
5924
|
-
function
|
|
5923
|
+
function ea({ seriesId: s, color: t, format: e, children: i }) {
|
|
5925
5924
|
const n = ot();
|
|
5926
5925
|
dt(() => (n.setYLabel(!0), () => n.setYLabel(!1)), [n]);
|
|
5927
5926
|
const [, r] = bt(0);
|
|
@@ -5985,39 +5984,38 @@ function ia({ seriesId: s, color: t, format: e, children: i }) {
|
|
|
5985
5984
|
] });
|
|
5986
5985
|
}
|
|
5987
5986
|
export {
|
|
5988
|
-
|
|
5987
|
+
Xn as BarSeries,
|
|
5989
5988
|
Nr as CandlestickSeries,
|
|
5990
5989
|
sr as ChartContainer,
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5990
|
+
Dn as ChartInstance,
|
|
5991
|
+
Kr as Crosshair,
|
|
5992
|
+
Jn as InfoBar,
|
|
5994
5993
|
Qn as Legend,
|
|
5995
5994
|
rr as LineSeries,
|
|
5996
5995
|
lr as NumberFlow,
|
|
5997
5996
|
tr as PieLegend,
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
5997
|
+
jr as PieSeries,
|
|
5998
|
+
Jr as PieTooltip,
|
|
5999
|
+
qr as Sparkline,
|
|
6001
6000
|
ye as ThemeProvider,
|
|
6002
|
-
|
|
6001
|
+
Qr as TimeAxis,
|
|
6003
6002
|
er as Title,
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
ea as
|
|
6008
|
-
ia as YLabel,
|
|
6003
|
+
Zr as Tooltip,
|
|
6004
|
+
Qr as XAxis,
|
|
6005
|
+
ta as YAxis,
|
|
6006
|
+
ea as YLabel,
|
|
6009
6007
|
Cr as andromeda,
|
|
6010
6008
|
Mr as ayuMirage,
|
|
6011
6009
|
Ki as buildHoverSnapshots,
|
|
6012
|
-
|
|
6010
|
+
Fn as buildLastSnapshots,
|
|
6013
6011
|
kr as catppuccin,
|
|
6014
6012
|
Be as computeTooltipPosition,
|
|
6015
6013
|
K as createTheme,
|
|
6016
|
-
|
|
6017
|
-
|
|
6014
|
+
xn as darkTheme,
|
|
6015
|
+
Ws as detectInterval,
|
|
6018
6016
|
Tr as dracula,
|
|
6019
6017
|
Nt as formatCompact,
|
|
6020
|
-
|
|
6018
|
+
Vs as formatDate,
|
|
6021
6019
|
Wi as formatPriceAdaptive,
|
|
6022
6020
|
Le as formatTime,
|
|
6023
6021
|
Rr as githubLight,
|
|
@@ -6045,6 +6043,6 @@ export {
|
|
|
6045
6043
|
Ur as useLastYValue,
|
|
6046
6044
|
Gr as usePreviousClose,
|
|
6047
6045
|
si as useTheme,
|
|
6048
|
-
|
|
6049
|
-
|
|
6046
|
+
Gn as useVisibleRange,
|
|
6047
|
+
jn as useYRange
|
|
6050
6048
|
};
|