@wick-charts/vue 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 +7 -9
- package/dist/index.d.ts +5 -36
- package/dist/index.js +536 -550
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { inject as Ft, defineComponent as
|
|
2
|
-
var
|
|
1
|
+
import { inject as Ft, defineComponent as lt, ref as G, onMounted as at, onUnmounted as nt, watch as ft, createCommentVNode as tt, shallowRef as hi, provide as qt, nextTick as fs, computed as D, openBlock as B, createElementBlock as P, normalizeStyle as E, createElementVNode as W, renderSlot as Et, unref as F, Fragment as j, toDisplayString as U, useSlots as re, createBlock as qe, Teleport as Qe, renderList as bt, watchEffect as Bi, createVNode as ps } from "vue";
|
|
2
|
+
var ms = Object.defineProperty, Di = (s) => {
|
|
3
3
|
throw TypeError(s);
|
|
4
|
-
},
|
|
4
|
+
}, gs = (s, t, e) => t in s ? ms(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, M = (s, t, e) => gs(s, typeof t != "symbol" ? t + "" : t, e), Ze = (s, t, e) => t.has(s) || Di("Cannot " + e), l = (s, t, e) => (Ze(s, t, "read from private field"), e ? e.call(s) : t.get(s)), Y = (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), _ = (s, t, e, i) => (Ze(s, t, "write to private field"), t.set(s, e), e), X = (s, t, e) => (Ze(s, t, "access private method"), e), Ue = (s, t, e, i) => ({
|
|
5
5
|
set _(a) {
|
|
6
6
|
_(s, t, a);
|
|
7
7
|
},
|
|
@@ -29,7 +29,7 @@ class we {
|
|
|
29
29
|
this.listeners.clear();
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function ci(s, t) {
|
|
33
33
|
const e = /* @__PURE__ */ new Map();
|
|
34
34
|
return new Proxy(s, {
|
|
35
35
|
get(i, a) {
|
|
@@ -45,17 +45,17 @@ function di(s, t) {
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function ui(s, t, e) {
|
|
49
49
|
const i = document.createElement("canvas");
|
|
50
50
|
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;
|
|
51
51
|
}
|
|
52
|
-
class
|
|
52
|
+
class vs extends we {
|
|
53
53
|
constructor(t, e) {
|
|
54
|
-
super(), M(this, "mainCanvas"), M(this, "mainCtx"), M(this, "overlayCanvas"), M(this, "overlayCtx"), M(this, "resizeObserver"), M(this, "_size"), M(this, "supportsDevicePixelContentBox", !1), this.mainCanvas =
|
|
54
|
+
super(), M(this, "mainCanvas"), M(this, "mainCtx"), M(this, "overlayCanvas"), M(this, "overlayCtx"), M(this, "resizeObserver"), M(this, "_size"), M(this, "supportsDevicePixelContentBox", !1), this.mainCanvas = ui(t, 0), this.overlayCanvas = ui(t, 1);
|
|
55
55
|
const i = this.mainCanvas.getContext("2d", { alpha: !0 }), a = this.overlayCanvas.getContext("2d", { alpha: !0 });
|
|
56
56
|
if (!i || !a)
|
|
57
57
|
throw new Error("CanvasManager: failed to acquire 2D rendering context");
|
|
58
|
-
this.mainCtx = e ?
|
|
58
|
+
this.mainCtx = e ? ci(i, e.drawCallsMain) : i, this.overlayCtx = e ? ci(a, e.drawCallsOverlay) : a;
|
|
59
59
|
const n = window.devicePixelRatio || 1;
|
|
60
60
|
this._size = {
|
|
61
61
|
media: { width: 0, height: 0 },
|
|
@@ -142,27 +142,27 @@ class ws extends we {
|
|
|
142
142
|
this.resizeObserver.disconnect(), this.mainCanvas.remove(), this.overlayCanvas.remove(), this.removeAllListeners();
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function bs(s, t, e, i) {
|
|
146
146
|
const { context: a, bitmapSize: n, horizontalPixelRatio: o } = s;
|
|
147
147
|
a.strokeStyle = i.crosshair.color, a.lineWidth = 1, a.setLineDash([4 * o, 4 * o]);
|
|
148
148
|
const r = Math.round(t) + 0.5, h = Math.round(e) + 0.5;
|
|
149
149
|
a.beginPath(), a.moveTo(r, 0), a.lineTo(r, n.height), a.moveTo(0, h), a.lineTo(n.width, h), a.stroke(), a.setLineDash([]);
|
|
150
150
|
}
|
|
151
|
-
const
|
|
152
|
-
function
|
|
151
|
+
const ys = 3, xs = 8, di = 900, ws = 24, Ss = 11, Cs = 10, Ms = 18;
|
|
152
|
+
function ks(s) {
|
|
153
153
|
const { state: t } = s;
|
|
154
154
|
if (t === "idle" || t === "has-more") return;
|
|
155
155
|
const e = s.timeScale.timeToX(s.boundaryTime);
|
|
156
156
|
if (Number.isFinite(e)) {
|
|
157
157
|
if (t === "loading") {
|
|
158
|
-
|
|
158
|
+
Ts(s, e);
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
|
-
t === "no-data" &&
|
|
161
|
+
t === "no-data" && Is(s, e);
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
const { context: o, horizontalPixelRatio: r, verticalPixelRatio: h } = s, d =
|
|
164
|
+
function Ts({ scope: s, theme: t, chartMediaHeight: e, side: i, now: a }, n) {
|
|
165
|
+
const { context: o, horizontalPixelRatio: r, verticalPixelRatio: h } = s, d = ys * r, c = xs * r, u = ws * r, g = n * r, f = i === "right" ? g + u : g - u, y = e / 2 * h, x = a % di / di, v = Math.floor(x * 3), p = Pi(t.axis.textColor ?? "#787b86", 0.3), C = t.axis.textColor ?? "#787b86";
|
|
166
166
|
o.save();
|
|
167
167
|
for (let b = 0; b < 3; b++) {
|
|
168
168
|
const w = (b - 1) * c, S = f + w;
|
|
@@ -170,19 +170,19 @@ function _s({ scope: s, theme: t, chartMediaHeight: e, side: i, now: a }, n) {
|
|
|
170
170
|
}
|
|
171
171
|
o.restore();
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function Is({ scope: s, theme: t, chartMediaHeight: e, side: i }, a) {
|
|
174
174
|
const { context: n, horizontalPixelRatio: o, verticalPixelRatio: r } = s, h = Math.round(a * o) + 0.5;
|
|
175
|
-
n.save(), n.strokeStyle =
|
|
176
|
-
const d =
|
|
177
|
-
n.fillStyle = t.axis.textColor ?? "#787b86", n.font = `${
|
|
175
|
+
n.save(), n.strokeStyle = Pi(t.axis.textColor ?? "#787b86", 0.6), n.lineWidth = 1, n.setLineDash([4 * o, 4 * o]), n.beginPath(), n.moveTo(h, 0), n.lineTo(h, e * r), n.stroke(), n.setLineDash([]);
|
|
176
|
+
const d = Cs * o, c = i === "right" ? h - d : h + d, u = Ms * r;
|
|
177
|
+
n.fillStyle = t.axis.textColor ?? "#787b86", n.font = `${Ss * o}px ${t.typography.fontFamily}`, n.textAlign = i === "right" ? "right" : "left", n.textBaseline = "top", n.fillText("No more data", c, u), n.restore();
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function Pi(s, t) {
|
|
180
180
|
const e = /^#([0-9a-f]{6})$/i.exec(s.trim());
|
|
181
181
|
if (!e) return s;
|
|
182
182
|
const i = parseInt(e[1].slice(0, 2), 16), a = parseInt(e[1].slice(2, 4), 16), n = parseInt(e[1].slice(4, 6), 16);
|
|
183
183
|
return `rgba(${i}, ${a}, ${n}, ${t})`;
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Rs(s, t, e, i, a) {
|
|
186
186
|
const { context: n, bitmapSize: o, horizontalPixelRatio: r, verticalPixelRatio: h } = s;
|
|
187
187
|
n.strokeStyle = i.grid.color, n.lineWidth = 1, i.grid.style === "dashed" ? n.setLineDash([4 * r, 4 * r]) : i.grid.style === "dotted" && n.setLineDash([1 * r, 3 * r]);
|
|
188
188
|
const d = e.niceTickValues();
|
|
@@ -206,14 +206,14 @@ function ne(s, t, e) {
|
|
|
206
206
|
function dt(s, t, e) {
|
|
207
207
|
return s + (t - s) * e;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Vt(s, t, e, i) {
|
|
210
210
|
const a = Math.exp(-e * i);
|
|
211
211
|
return t + (s - t) * a;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function zi(s) {
|
|
214
214
|
return 1 - (1 - s) ** 3;
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function Ee(s, t, e) {
|
|
217
217
|
let i = 0, a = s.length - 1;
|
|
218
218
|
for (; i <= a; ) {
|
|
219
219
|
const n = i + a >>> 1, o = e(s[n]);
|
|
@@ -223,7 +223,7 @@ function $e(s, t, e) {
|
|
|
223
223
|
}
|
|
224
224
|
return i;
|
|
225
225
|
}
|
|
226
|
-
class
|
|
226
|
+
class Ai extends we {
|
|
227
227
|
constructor() {
|
|
228
228
|
super(...arguments), M(this, "data", []), M(this, "_visible", !0), M(this, "cachedRange", null), M(this, "cachedResult", []);
|
|
229
229
|
}
|
|
@@ -258,7 +258,7 @@ class Vi extends we {
|
|
|
258
258
|
getVisibleData(t, e) {
|
|
259
259
|
if (this.data.length === 0) return [];
|
|
260
260
|
if (this.cachedRange && this.cachedRange.from === t && this.cachedRange.to === e) return this.cachedResult;
|
|
261
|
-
const i = Math.max(0,
|
|
261
|
+
const i = Math.max(0, Ee(this.data, t, (n) => n.time) - 1), a = Math.min(this.data.length, Ee(this.data, e, (n) => n.time) + 1);
|
|
262
262
|
return this.cachedResult = this.data.slice(i, a), this.cachedRange = { from: t, to: e }, this.cachedResult;
|
|
263
263
|
}
|
|
264
264
|
first() {
|
|
@@ -275,7 +275,7 @@ class Vi extends we {
|
|
|
275
275
|
}
|
|
276
276
|
findNearest(t, e) {
|
|
277
277
|
if (this.data.length === 0) return null;
|
|
278
|
-
const i =
|
|
278
|
+
const i = Ee(this.data, t, (o) => o.time);
|
|
279
279
|
let a = null, n = e;
|
|
280
280
|
for (let o = Math.max(0, i - 1); o <= Math.min(this.data.length - 1, i + 1); o++) {
|
|
281
281
|
const r = Math.abs(this.data[o].time - t);
|
|
@@ -284,7 +284,7 @@ class Vi extends we {
|
|
|
284
284
|
return a;
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
class
|
|
287
|
+
class Ls {
|
|
288
288
|
constructor(t, e, i) {
|
|
289
289
|
M(this, "dragging", !1), M(this, "lastX", 0), this.viewport = t, this.timeScale = e, this.canvas = i;
|
|
290
290
|
}
|
|
@@ -305,17 +305,17 @@ class Ds {
|
|
|
305
305
|
return this.dragging;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
const
|
|
309
|
-
class
|
|
308
|
+
const _s = 150;
|
|
309
|
+
class Fs {
|
|
310
310
|
constructor(t, e) {
|
|
311
311
|
M(this, "reboundTimer", null), this.viewport = t, this.timeScale = e;
|
|
312
312
|
}
|
|
313
313
|
handleWheel(t) {
|
|
314
314
|
t.preventDefault();
|
|
315
|
-
const e =
|
|
315
|
+
const e = Bs(t.deltaY, t.deltaMode), i = Math.exp(e * 5e-3), a = this.timeScale.getMediaWidth(), n = Math.min(t.offsetX, a), o = this.timeScale.xToTime(n);
|
|
316
316
|
this.viewport.zoomAt(o, i, a), this.reboundTimer !== null && clearTimeout(this.reboundTimer), this.reboundTimer = setTimeout(() => {
|
|
317
317
|
this.reboundTimer = null, this.viewport.startRebound(a);
|
|
318
|
-
},
|
|
318
|
+
}, _s);
|
|
319
319
|
}
|
|
320
320
|
/** Cancel any pending rebound — called by InteractionHandler.destroy and when
|
|
321
321
|
* a competing gesture (mousedown, touchstart) takes over. */
|
|
@@ -323,10 +323,10 @@ class zs {
|
|
|
323
323
|
this.reboundTimer !== null && (clearTimeout(this.reboundTimer), this.reboundTimer = null);
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function Bs(s, t) {
|
|
327
327
|
return t === WheelEvent.DOM_DELTA_LINE ? s * 8 : t === WheelEvent.DOM_DELTA_PAGE ? s * 24 : s;
|
|
328
328
|
}
|
|
329
|
-
class
|
|
329
|
+
class Ds extends we {
|
|
330
330
|
constructor(t, e, i, a) {
|
|
331
331
|
super(), M(this, "zoom"), M(this, "pan"), M(this, "canvas"), M(this, "timeScale"), M(this, "yScale"), M(this, "viewport"), M(this, "onWheel", (n) => {
|
|
332
332
|
this.zoom.handleWheel(n);
|
|
@@ -364,7 +364,7 @@ class Ws extends we {
|
|
|
364
364
|
const o = this.touchCount === 2;
|
|
365
365
|
this.pan.handleMouseUp(), o && this.viewport.startRebound(this.timeScale.getMediaWidth()), this.touchCount = 0, this.lastTouchDist = 0;
|
|
366
366
|
}
|
|
367
|
-
}), this.canvas = t, this.viewport = e, this.timeScale = i, this.yScale = a, this.zoom = new
|
|
367
|
+
}), this.canvas = t, this.viewport = e, this.timeScale = i, this.yScale = a, this.zoom = new Fs(e, i), this.pan = new Ls(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);
|
|
368
368
|
}
|
|
369
369
|
emitCrosshair(t, e) {
|
|
370
370
|
const i = this.timeScale.xToTime(t), a = this.yScale.yToValue(e);
|
|
@@ -379,11 +379,11 @@ class Ws extends we {
|
|
|
379
379
|
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();
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
const
|
|
383
|
-
function
|
|
384
|
-
|
|
382
|
+
const Ps = /* @__PURE__ */ new WeakMap();
|
|
383
|
+
function zs(s, t) {
|
|
384
|
+
Ps.set(s, t);
|
|
385
385
|
}
|
|
386
|
-
const
|
|
386
|
+
const As = 100, Ws = {
|
|
387
387
|
position: "absolute",
|
|
388
388
|
top: "4px",
|
|
389
389
|
right: "4px",
|
|
@@ -397,25 +397,25 @@ const Es = 100, $s = {
|
|
|
397
397
|
whiteSpace: "pre",
|
|
398
398
|
letterSpacing: "0.01em"
|
|
399
399
|
};
|
|
400
|
-
function
|
|
400
|
+
function fi(s) {
|
|
401
401
|
let t = 0;
|
|
402
402
|
for (const e of Object.values(s)) t += e;
|
|
403
403
|
return t;
|
|
404
404
|
}
|
|
405
405
|
const xe = 9, ti = 7, Mt = 6, ei = 9;
|
|
406
|
-
function
|
|
406
|
+
function Vs(s, t) {
|
|
407
407
|
return Math.round(s * t).toLocaleString("en-US");
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function pi(s, t, e, i, a) {
|
|
410
410
|
return [
|
|
411
411
|
s.padEnd(xe),
|
|
412
412
|
t.toFixed(1).padStart(ti),
|
|
413
413
|
e.toFixed(2).padStart(Mt),
|
|
414
414
|
i.toFixed(2).padStart(Mt),
|
|
415
|
-
|
|
415
|
+
Vs(a, t).padStart(ei)
|
|
416
416
|
].join(" ");
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function mi(s) {
|
|
419
419
|
return [
|
|
420
420
|
s.padEnd(xe),
|
|
421
421
|
"—".padStart(ti),
|
|
@@ -424,7 +424,7 @@ function vi(s) {
|
|
|
424
424
|
"idle".padStart(ei)
|
|
425
425
|
].join(" ");
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function Ys() {
|
|
428
428
|
return [
|
|
429
429
|
"".padEnd(xe),
|
|
430
430
|
"FPS".padStart(ti),
|
|
@@ -433,8 +433,8 @@ function Os() {
|
|
|
433
433
|
"calls/s".padStart(ei)
|
|
434
434
|
].join(" ");
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
const t =
|
|
436
|
+
function Es(s) {
|
|
437
|
+
const t = fi(s.drawCalls.main), e = fi(s.drawCalls.overlay), i = s.frameCount.main === 0 ? mi("Main") : pi("Main", s.mainRendersPerSec, s.mainFrameMs.last, s.mainFrameMs.p95, t), a = s.frameCount.overlay === 0 ? mi("Overlay") : pi("Overlay", s.overlayRendersPerSec, s.overlayFrameMs.last, s.overlayFrameMs.p95, e), n = [Ys(), i, a], o = Object.keys(s.perSeries);
|
|
438
438
|
if (o.length > 1) {
|
|
439
439
|
n.push(""), n.push("Per series (main pass)"), n.push(["".padEnd(xe), "ms".padStart(Mt), "worst".padStart(Mt)].join(" "));
|
|
440
440
|
for (const r of o) {
|
|
@@ -447,32 +447,32 @@ function Xs(s) {
|
|
|
447
447
|
return n.join(`
|
|
448
448
|
`);
|
|
449
449
|
}
|
|
450
|
-
class
|
|
451
|
-
constructor(t, e, i =
|
|
450
|
+
class $s {
|
|
451
|
+
constructor(t, e, i = As) {
|
|
452
452
|
M(this, "element"), M(this, "unsubscribe"), M(this, "updateIntervalMs"), M(this, "lastUpdate", 0), this.updateIntervalMs = i;
|
|
453
453
|
for (const a of t.querySelectorAll("[data-chart-perf-hud]"))
|
|
454
454
|
a.remove();
|
|
455
|
-
this.element = document.createElement("div"), this.element.setAttribute("data-chart-perf-hud", ""), Object.assign(this.element.style,
|
|
455
|
+
this.element = document.createElement("div"), this.element.setAttribute("data-chart-perf-hud", ""), Object.assign(this.element.style, Ws), this.element.textContent = "perf: waiting for first frame…", t.appendChild(this.element), this.unsubscribe = e.onFrame((a) => this.onFrame(a));
|
|
456
456
|
}
|
|
457
457
|
destroy() {
|
|
458
458
|
this.unsubscribe(), this.element.remove();
|
|
459
459
|
}
|
|
460
460
|
onFrame(t) {
|
|
461
461
|
const e = performance.now();
|
|
462
|
-
e - this.lastUpdate < this.updateIntervalMs || (this.lastUpdate = e, this.element.textContent =
|
|
462
|
+
e - this.lastUpdate < this.updateIntervalMs || (this.lastUpdate = e, this.element.textContent = Es(t));
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
|
-
const
|
|
466
|
-
function
|
|
465
|
+
const Hs = 5e3, Os = 2e3, Xs = 30;
|
|
466
|
+
function $e(s, t, e) {
|
|
467
467
|
let i = 0;
|
|
468
468
|
for (; i < t.length && t[i] < e; ) i++;
|
|
469
469
|
i > 0 && (s.splice(0, i), t.splice(0, i));
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function He(s, t, e) {
|
|
472
472
|
const i = s.length - e;
|
|
473
473
|
i > 0 && (s.splice(0, i), t.splice(0, i));
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function Oe(s) {
|
|
476
476
|
if (s.length === 0) return { last: 0, p50: 0, p95: 0 };
|
|
477
477
|
const t = [...s].sort((e, i) => e - i);
|
|
478
478
|
return {
|
|
@@ -481,19 +481,19 @@ function Xe(s) {
|
|
|
481
481
|
p95: t[Math.floor(t.length * 0.95)] ?? 0
|
|
482
482
|
};
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function gi(s) {
|
|
485
485
|
if (s.length < 2) return 0;
|
|
486
486
|
const t = s[s.length - 1] - s[0];
|
|
487
487
|
return t <= 0 ? 0 : (s.length - 1) * 1e3 / t;
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function vi(s) {
|
|
490
490
|
const t = {};
|
|
491
491
|
for (const [e, i] of s) t[e] = i;
|
|
492
492
|
return t;
|
|
493
493
|
}
|
|
494
|
-
class
|
|
494
|
+
class Xe {
|
|
495
495
|
constructor(t = {}) {
|
|
496
|
-
M(this, "drawCallsMain", /* @__PURE__ */ new Map()), M(this, "drawCallsOverlay", /* @__PURE__ */ new Map()), M(this, "mainMs", []), M(this, "overlayMs", []), M(this, "mainStamps", []), M(this, "overlayStamps", []), M(this, "perSeriesMs", /* @__PURE__ */ new Map()), M(this, "perSeriesStamps", /* @__PURE__ */ new Map()), M(this, "listeners", /* @__PURE__ */ new Set()), M(this, "windowMs"), M(this, "maxSamples"), M(this, "heapInterval"), M(this, "heapCounter", 0), M(this, "heapMb", null), M(this, "mainFrameCount", 0), M(this, "overlayFrameCount", 0), M(this, "lastStamp", 0), this.windowMs = t.windowMs ??
|
|
496
|
+
M(this, "drawCallsMain", /* @__PURE__ */ new Map()), M(this, "drawCallsOverlay", /* @__PURE__ */ new Map()), M(this, "mainMs", []), M(this, "overlayMs", []), M(this, "mainStamps", []), M(this, "overlayStamps", []), M(this, "perSeriesMs", /* @__PURE__ */ new Map()), M(this, "perSeriesStamps", /* @__PURE__ */ new Map()), M(this, "listeners", /* @__PURE__ */ new Set()), M(this, "windowMs"), M(this, "maxSamples"), M(this, "heapInterval"), M(this, "heapCounter", 0), M(this, "heapMb", null), M(this, "mainFrameCount", 0), M(this, "overlayFrameCount", 0), M(this, "lastStamp", 0), this.windowMs = t.windowMs ?? Hs, this.maxSamples = t.maxSamples ?? Os, this.heapInterval = t.heapSampleEveryNFrames ?? Xs;
|
|
497
497
|
}
|
|
498
498
|
/** Clear the draw-call tally for the given layer. Call at the start of each frame. */
|
|
499
499
|
resetDrawCalls(t) {
|
|
@@ -514,10 +514,10 @@ class Ne {
|
|
|
514
514
|
/** Drop samples older than `windowMs` behind the newest recorded stamp, and enforce the hard per-layer cap. */
|
|
515
515
|
trimAll(t) {
|
|
516
516
|
const e = t - this.windowMs;
|
|
517
|
-
|
|
517
|
+
$e(this.mainMs, this.mainStamps, e), $e(this.overlayMs, this.overlayStamps, e), He(this.mainMs, this.mainStamps, this.maxSamples), He(this.overlayMs, this.overlayStamps, this.maxSamples);
|
|
518
518
|
for (const i of this.perSeriesMs.keys()) {
|
|
519
519
|
const a = this.perSeriesMs.get(i), n = this.perSeriesStamps.get(i);
|
|
520
|
-
!a || !n || (
|
|
520
|
+
!a || !n || ($e(a, n, e), He(a, n, this.maxSamples));
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
523
|
/** Subscribe to per-frame stat snapshots. Returns an unsubscribe function. */
|
|
@@ -529,18 +529,18 @@ class Ne {
|
|
|
529
529
|
/** Snapshot current stats. Safe to call outside frames. */
|
|
530
530
|
getStats() {
|
|
531
531
|
const t = {};
|
|
532
|
-
for (const [i, a] of this.perSeriesMs) t[i] =
|
|
533
|
-
const e =
|
|
532
|
+
for (const [i, a] of this.perSeriesMs) t[i] = Oe(a);
|
|
533
|
+
const e = gi(this.mainStamps);
|
|
534
534
|
return {
|
|
535
535
|
mainRendersPerSec: e,
|
|
536
|
-
overlayRendersPerSec:
|
|
536
|
+
overlayRendersPerSec: gi(this.overlayStamps),
|
|
537
537
|
fps: e,
|
|
538
|
-
mainFrameMs:
|
|
539
|
-
overlayFrameMs:
|
|
538
|
+
mainFrameMs: Oe(this.mainMs),
|
|
539
|
+
overlayFrameMs: Oe(this.overlayMs),
|
|
540
540
|
frameCount: { main: this.mainFrameCount, overlay: this.overlayFrameCount },
|
|
541
541
|
drawCalls: {
|
|
542
|
-
main:
|
|
543
|
-
overlay:
|
|
542
|
+
main: vi(this.drawCallsMain),
|
|
543
|
+
overlay: vi(this.drawCallsOverlay)
|
|
544
544
|
},
|
|
545
545
|
perSeries: t,
|
|
546
546
|
heapMb: this.heapMb
|
|
@@ -569,41 +569,41 @@ class Me {
|
|
|
569
569
|
this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.dirty = !1;
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
const Qt = 6e4, Xt = 36e5,
|
|
572
|
+
const Qt = 6e4, Xt = 36e5, zt = 864e5;
|
|
573
573
|
function oe(s) {
|
|
574
574
|
return s instanceof Date ? s.getTime() : s;
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function Ns(s) {
|
|
577
577
|
return s.length === 0 || !s.some((t) => t.time instanceof Date) ? s : s.map((t) => ({ ...t, time: oe(t.time) }));
|
|
578
578
|
}
|
|
579
|
-
function
|
|
579
|
+
function Us(s) {
|
|
580
580
|
return s.length === 0 || !s.some((t) => t.time instanceof Date) ? s : s.map((t) => ({ ...t, time: oe(t.time) }));
|
|
581
581
|
}
|
|
582
|
-
function
|
|
583
|
-
if (s.length < 2) return
|
|
582
|
+
function Gs(s) {
|
|
583
|
+
if (s.length < 2) return zt;
|
|
584
584
|
const t = [];
|
|
585
585
|
for (let e = 1; e < Math.min(s.length, 20); e++)
|
|
586
586
|
t.push(s[e] - s[e - 1]);
|
|
587
587
|
return t.sort((e, i) => e - i), t[Math.floor(t.length / 2)];
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function ze(s, t) {
|
|
590
590
|
const e = new Date(s);
|
|
591
|
-
return t >=
|
|
591
|
+
return t >= zt ? e.toLocaleDateString("en-US", { month: "short", day: "numeric" }) : t >= Xt ? e.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit", hour12: !1 }) : e.toLocaleTimeString("en-US", {
|
|
592
592
|
hour: "2-digit",
|
|
593
593
|
minute: "2-digit",
|
|
594
594
|
second: "2-digit",
|
|
595
595
|
hour12: !1
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function js(s) {
|
|
599
599
|
return new Date(s).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
600
600
|
}
|
|
601
|
-
function
|
|
602
|
-
const t = [1e3, 5e3, 1e4, 15e3, 3e4], e = [Qt, 5 * Qt, 10 * Qt, 15 * Qt, 30 * Qt], i = [Xt, 2 * Xt, 4 * Xt, 6 * Xt, 12 * Xt], a = [
|
|
603
|
-
return s < Qt ? [...t, ...e, ...i, ...a] : s < Xt ? [...e, ...i, ...a] : s <
|
|
601
|
+
function Ks(s) {
|
|
602
|
+
const t = [1e3, 5e3, 1e4, 15e3, 3e4], e = [Qt, 5 * Qt, 10 * Qt, 15 * Qt, 30 * Qt], i = [Xt, 2 * Xt, 4 * Xt, 6 * Xt, 12 * Xt], a = [zt, 7 * zt, 30 * zt, 90 * zt, 365 * zt];
|
|
603
|
+
return s < Qt ? [...t, ...e, ...i, ...a] : s < Xt ? [...e, ...i, ...a] : s < zt ? [...i, ...a] : a;
|
|
604
604
|
}
|
|
605
|
-
const
|
|
606
|
-
class
|
|
605
|
+
const Js = 50, qs = 80;
|
|
606
|
+
class Qs {
|
|
607
607
|
constructor() {
|
|
608
608
|
M(this, "from", 0), M(this, "to", 0), M(this, "width", 1), M(this, "pixelRatio", 1), M(this, "dataInterval", null), M(this, "labelCountHintValue", null), M(this, "minSpacingValue", null), M(this, "resolvedInterval", null), M(this, "lastInterval", null), M(this, "lastWant", null), M(this, "lastBucketKey", null);
|
|
609
609
|
}
|
|
@@ -611,20 +611,20 @@ class ia {
|
|
|
611
611
|
return this.labelCountHintValue;
|
|
612
612
|
}
|
|
613
613
|
get minLabelSpacing() {
|
|
614
|
-
return this.minSpacingValue ??
|
|
614
|
+
return this.minSpacingValue ?? qs;
|
|
615
615
|
}
|
|
616
616
|
update(t, e, i, a) {
|
|
617
617
|
if (this.from = t.from, this.to = t.to, this.width = e, this.pixelRatio = i, a !== void 0 && a > 0) {
|
|
618
|
-
const n =
|
|
618
|
+
const n = bi(a);
|
|
619
619
|
this.lastBucketKey !== null && this.lastBucketKey !== n && this.resetHysteresis(), this.lastBucketKey = n, this.dataInterval = a;
|
|
620
620
|
}
|
|
621
621
|
this.resolveInterval();
|
|
622
622
|
}
|
|
623
623
|
setLabelCount(t) {
|
|
624
|
-
this.labelCountHintValue =
|
|
624
|
+
this.labelCountHintValue = Zs(t), this.resetHysteresis(), this.resolveInterval();
|
|
625
625
|
}
|
|
626
626
|
setMinSpacing(t) {
|
|
627
|
-
this.minSpacingValue =
|
|
627
|
+
this.minSpacingValue = ta(t), this.resetHysteresis(), this.resolveInterval();
|
|
628
628
|
}
|
|
629
629
|
resetHysteresis() {
|
|
630
630
|
this.lastInterval = null, this.lastWant = null;
|
|
@@ -655,11 +655,11 @@ class ia {
|
|
|
655
655
|
niceTickValues(t) {
|
|
656
656
|
if (this.to <= this.from) return { ticks: [], tickInterval: 0 };
|
|
657
657
|
if (this.dataInterval !== t) {
|
|
658
|
-
const o =
|
|
658
|
+
const o = bi(t);
|
|
659
659
|
this.lastBucketKey !== null && this.lastBucketKey !== o && this.resetHysteresis(), this.lastBucketKey = o, this.dataInterval = t, this.resolveInterval();
|
|
660
660
|
}
|
|
661
661
|
if (this.resolvedInterval == null) return { ticks: [], tickInterval: 0 };
|
|
662
|
-
const e = this.resolvedInterval, i = Math.ceil(this.from / e) * e, a = Math.max(0, Math.min(
|
|
662
|
+
const e = this.resolvedInterval, i = Math.ceil(this.from / e) * e, a = Math.max(0, Math.min(Js, Math.floor((this.to - i) / e) + 1)), n = [];
|
|
663
663
|
for (let o = 0; o < a; o++) n.push(i + o * e);
|
|
664
664
|
return { ticks: n, tickInterval: e };
|
|
665
665
|
}
|
|
@@ -679,7 +679,7 @@ class ia {
|
|
|
679
679
|
this.resolvedInterval = null;
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
682
|
-
const t =
|
|
682
|
+
const t = Ks(this.dataInterval), e = this.to - this.from, i = e / this.width * this.minLabelSpacing;
|
|
683
683
|
let a;
|
|
684
684
|
if (this.labelCountHint != null) {
|
|
685
685
|
const r = Math.max(1, this.labelCountHint);
|
|
@@ -711,52 +711,52 @@ class ia {
|
|
|
711
711
|
return Math.max(0, Math.floor((this.to - e) / t) + 1);
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
|
-
function
|
|
714
|
+
function bi(s) {
|
|
715
715
|
return s < 6e4 ? 0 : s < 36e5 ? 1 : s < 864e5 ? 2 : 3;
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function Zs(s) {
|
|
718
718
|
return typeof s == "number" && Number.isFinite(s) && s >= 2 ? Math.floor(s) : null;
|
|
719
719
|
}
|
|
720
|
-
function
|
|
720
|
+
function ta(s) {
|
|
721
721
|
return typeof s == "number" && Number.isFinite(s) && s > 0 ? s : null;
|
|
722
722
|
}
|
|
723
|
-
function
|
|
723
|
+
function Wi(s) {
|
|
724
724
|
const t = Math.abs(s);
|
|
725
725
|
if (t === 0) return "0";
|
|
726
726
|
if (t < 1e-12) return s.toExponential(2);
|
|
727
727
|
const e = Math.max(0, Math.ceil(-Math.log10(t)) - 1), i = Math.min(12, e + 4), a = s.toFixed(i);
|
|
728
728
|
return a.includes(".") ? a.replace(/\.?0+$/, "") : a;
|
|
729
729
|
}
|
|
730
|
-
function
|
|
730
|
+
function Vi(s) {
|
|
731
731
|
return Number.isNaN(s) ? "—" : s === 1 / 0 ? "∞" : s === -1 / 0 ? "−∞" : null;
|
|
732
732
|
}
|
|
733
733
|
function le(s, t) {
|
|
734
|
-
const e =
|
|
734
|
+
const e = Vi(s);
|
|
735
735
|
if (e !== null) return e;
|
|
736
736
|
const i = Math.abs(s), a = (t == null ? void 0 : t.decimals) ?? 2, n = (o, r, h) => {
|
|
737
737
|
const d = o / r, c = Number.parseFloat(d.toFixed(a));
|
|
738
738
|
return Math.abs(c) >= 1e3 ? null : `${d.toFixed(a)}${h}`;
|
|
739
739
|
};
|
|
740
|
-
return i >= 1e15 ? s.toExponential(2) : i >= 1e12 ? n(s, 1e12, "T") ?? s.toExponential(2) : i >= 1e9 ? n(s, 1e9, "B") ?? `${(s / 1e12).toFixed(a)}T` : i >= 1e6 ? n(s, 1e6, "M") ?? `${(s / 1e9).toFixed(a)}B` : i >= 1e3 ? n(s, 1e3, "K") ?? `${(s / 1e6).toFixed(a)}M` : i < 1 ?
|
|
740
|
+
return i >= 1e15 ? s.toExponential(2) : i >= 1e12 ? n(s, 1e12, "T") ?? s.toExponential(2) : i >= 1e9 ? n(s, 1e9, "B") ?? `${(s / 1e12).toFixed(a)}T` : i >= 1e6 ? n(s, 1e6, "M") ?? `${(s / 1e9).toFixed(a)}B` : i >= 1e3 ? n(s, 1e3, "K") ?? `${(s / 1e6).toFixed(a)}M` : i < 1 ? Wi(s) : i < 100 ? s.toFixed(2) : s.toFixed(0);
|
|
741
741
|
}
|
|
742
|
-
function
|
|
743
|
-
const t =
|
|
742
|
+
function Yi(s) {
|
|
743
|
+
const t = Vi(s);
|
|
744
744
|
if (t !== null) return t;
|
|
745
745
|
const e = Math.abs(s);
|
|
746
|
-
return e === 0 ? "0" : e < 1 ?
|
|
746
|
+
return e === 0 ? "0" : e < 1 ? Wi(s) : e < 100 ? s.toFixed(4) : e >= 1e7 ? le(s) : e < 1e4 ? s.toFixed(2) : s.toFixed(0);
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function ea(s) {
|
|
749
749
|
if (!Number.isFinite(s) || s <= 0) return 1;
|
|
750
750
|
const t = 10 ** Math.floor(Math.log10(s)), e = s / t;
|
|
751
751
|
return (e <= 1 ? 1 : e <= 2 ? 2 : e <= 5 ? 5 : 10) * t;
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function ia(s) {
|
|
754
754
|
if (!Number.isFinite(s) || s <= 0) return 1;
|
|
755
755
|
const t = 10 ** Math.floor(Math.log10(s)), e = s / t;
|
|
756
756
|
return (e >= 5 ? 5 : e >= 2 ? 2 : 1) * t;
|
|
757
757
|
}
|
|
758
|
-
const
|
|
759
|
-
class
|
|
758
|
+
const sa = 50, aa = 50;
|
|
759
|
+
class na {
|
|
760
760
|
constructor() {
|
|
761
761
|
M(this, "min", 0), M(this, "max", 0), M(this, "height", 1), M(this, "pixelRatio", 1), M(this, "labelCountHintValue", null), M(this, "minSpacingValue", null), M(this, "resolvedInterval", null), M(this, "lastInterval", null), M(this, "lastRawInterval", null), M(this, "customFormat", null);
|
|
762
762
|
}
|
|
@@ -764,7 +764,7 @@ class ha {
|
|
|
764
764
|
return this.labelCountHintValue;
|
|
765
765
|
}
|
|
766
766
|
get minLabelSpacing() {
|
|
767
|
-
return this.minSpacingValue ??
|
|
767
|
+
return this.minSpacingValue ?? aa;
|
|
768
768
|
}
|
|
769
769
|
/** Recalculate the scale with a new Y range, chart height, and device pixel ratio. */
|
|
770
770
|
update(t, e, i) {
|
|
@@ -772,11 +772,11 @@ class ha {
|
|
|
772
772
|
}
|
|
773
773
|
/** Desired label count. Invalid values (NaN, <2, Infinity) clear the hint. */
|
|
774
774
|
setLabelCount(t) {
|
|
775
|
-
this.labelCountHintValue =
|
|
775
|
+
this.labelCountHintValue = oa(t), this.resetHysteresis(), this.resolveInterval();
|
|
776
776
|
}
|
|
777
777
|
/** Minimum pixel gap between adjacent labels. */
|
|
778
778
|
setMinSpacing(t) {
|
|
779
|
-
this.minSpacingValue =
|
|
779
|
+
this.minSpacingValue = ra(t), this.resetHysteresis(), this.resolveInterval();
|
|
780
780
|
}
|
|
781
781
|
resetHysteresis() {
|
|
782
782
|
this.lastInterval = null, this.lastRawInterval = null;
|
|
@@ -809,7 +809,7 @@ class ha {
|
|
|
809
809
|
*/
|
|
810
810
|
niceTickValues() {
|
|
811
811
|
if (this.resolvedInterval == null) return [];
|
|
812
|
-
const t = this.resolvedInterval, e = Math.ceil(this.min / t) * t, i = Math.max(0, Math.min(
|
|
812
|
+
const t = this.resolvedInterval, e = Math.ceil(this.min / t) * t, i = Math.max(0, Math.min(sa, Math.floor((this.max - e) / t) + 1)), a = [];
|
|
813
813
|
for (let n = 0; n < i; n++) a.push(e + n * t);
|
|
814
814
|
return a;
|
|
815
815
|
}
|
|
@@ -857,9 +857,9 @@ class ha {
|
|
|
857
857
|
return;
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
|
-
let n =
|
|
860
|
+
let n = ea(a);
|
|
861
861
|
if (this.labelCountHint != null && this.countTicks(n) < this.labelCountHint) {
|
|
862
|
-
const o =
|
|
862
|
+
const o = ia(a);
|
|
863
863
|
o >= e && o > 0 && (n = o);
|
|
864
864
|
}
|
|
865
865
|
this.resolvedInterval = n, this.lastInterval = n, this.lastRawInterval = a;
|
|
@@ -870,42 +870,42 @@ class ha {
|
|
|
870
870
|
return Math.max(0, Math.floor((this.max - e) / t) + 1);
|
|
871
871
|
}
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function oa(s) {
|
|
874
874
|
return typeof s == "number" && Number.isFinite(s) && s >= 2 ? Math.floor(s) : null;
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function ra(s) {
|
|
877
877
|
return typeof s == "number" && Number.isFinite(s) && s > 0 ? s : null;
|
|
878
878
|
}
|
|
879
|
-
function
|
|
879
|
+
function Yt(s, t) {
|
|
880
880
|
return s === !1 ? 0 : s === void 0 ? t : s;
|
|
881
881
|
}
|
|
882
882
|
function Zt(s, t) {
|
|
883
883
|
const e = Math.max(1e-4, Math.abs(t) * 1e-5);
|
|
884
884
|
return Math.abs(s - t) > e;
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function la(s, t, e, i) {
|
|
887
887
|
const a = s == null ? void 0 : s.get(t);
|
|
888
888
|
if (!a) return 1;
|
|
889
889
|
if (i <= 0)
|
|
890
890
|
return s == null || s.delete(t), 1;
|
|
891
|
-
const n = ne((e - a.startTime) / i, 0, 1), o =
|
|
891
|
+
const n = ne((e - a.startTime) / i, 0, 1), o = zi(n);
|
|
892
892
|
return n >= 1 && (s == null || s.delete(t)), o;
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function ha(s) {
|
|
895
895
|
let t = 0, e = 0;
|
|
896
896
|
for (const i of s)
|
|
897
897
|
i > 0 ? t += i : i < 0 && (e += i);
|
|
898
898
|
return { positive: t, negative: e };
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function ca(s) {
|
|
901
901
|
return s.positive > 0 ? s.positive : s.negative < 0 ? s.negative : 0;
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function ua(s) {
|
|
904
904
|
return s.positive > 0 ? 100 : s.negative < 0 ? -100 : 0;
|
|
905
905
|
}
|
|
906
|
-
class
|
|
906
|
+
class Ei {
|
|
907
907
|
constructor(t) {
|
|
908
|
-
M(this, "stores"), M(this, "displayedLastValues"), M(this, "lastSeededTimes"), M(this, "entries"), M(this, "lastRenderTime", 0), this.stores = Array.from({ length: t }, () => new
|
|
908
|
+
M(this, "stores"), M(this, "displayedLastValues"), M(this, "lastSeededTimes"), M(this, "entries"), M(this, "lastRenderTime", 0), this.stores = Array.from({ length: t }, () => new Ai()), this.displayedLastValues = new Array(t).fill(null), this.lastSeededTimes = new Array(t).fill(Number.NaN), this.entries = Array.from({ length: t }, () => /* @__PURE__ */ new Map());
|
|
909
909
|
}
|
|
910
910
|
// --- Color accessors ------------------------------------------------------
|
|
911
911
|
getColor() {
|
|
@@ -919,7 +919,7 @@ class Hi {
|
|
|
919
919
|
var i;
|
|
920
920
|
const a = this.stores[e];
|
|
921
921
|
if (!a) return;
|
|
922
|
-
const n =
|
|
922
|
+
const n = Us(t ?? []);
|
|
923
923
|
a.setData(n), (i = this.entries[e]) == null || i.clear();
|
|
924
924
|
}
|
|
925
925
|
appendPoint(t, e = 0) {
|
|
@@ -990,7 +990,7 @@ class Hi {
|
|
|
990
990
|
if (t === this.lastRenderTime) return;
|
|
991
991
|
const e = this.lastRenderTime ? Math.min(0.05, (t - this.lastRenderTime) / 1e3) : 0;
|
|
992
992
|
this.lastRenderTime = t;
|
|
993
|
-
const i =
|
|
993
|
+
const i = Yt(this.getCommonOptions().smoothMs, 70), a = i > 0 ? 1e3 / i : 0;
|
|
994
994
|
for (let n = 0; n < this.stores.length; n++) {
|
|
995
995
|
const o = this.stores[n].last();
|
|
996
996
|
if (!o) {
|
|
@@ -1002,12 +1002,12 @@ class Hi {
|
|
|
1002
1002
|
this.displayedLastValues[n] = o.value, this.lastSeededTimes[n] = o.time;
|
|
1003
1003
|
continue;
|
|
1004
1004
|
}
|
|
1005
|
-
this.displayedLastValues[n] =
|
|
1005
|
+
this.displayedLastValues[n] = Vt(r, o.value, a, e);
|
|
1006
1006
|
}
|
|
1007
1007
|
}
|
|
1008
1008
|
entranceProgress(t, e, i) {
|
|
1009
|
-
const a =
|
|
1010
|
-
return
|
|
1009
|
+
const a = Yt(this.getCommonOptions().entryMs, 400);
|
|
1010
|
+
return la(this.entries[t], e, i, a);
|
|
1011
1011
|
}
|
|
1012
1012
|
/** The effective Y-value to render for (layer, time) — substitutes smoothed value for the live last point. */
|
|
1013
1013
|
effectiveValue(t, e, i) {
|
|
@@ -1075,8 +1075,8 @@ class Hi {
|
|
|
1075
1075
|
const r = o.last();
|
|
1076
1076
|
a.push(r && r.time === e ? r.value : 0);
|
|
1077
1077
|
}
|
|
1078
|
-
const n =
|
|
1079
|
-
return { value: i === "percent" ?
|
|
1078
|
+
const n = ha(a);
|
|
1079
|
+
return { value: i === "percent" ? ua(n) : ca(n), isLive: !0 };
|
|
1080
1080
|
}
|
|
1081
1081
|
getLayerLastSnapshots() {
|
|
1082
1082
|
if (this.stores.length <= 1) return null;
|
|
@@ -1128,32 +1128,32 @@ class Hi {
|
|
|
1128
1128
|
return r > o ? { min: o, max: r } : null;
|
|
1129
1129
|
}
|
|
1130
1130
|
}
|
|
1131
|
-
const
|
|
1131
|
+
const da = {
|
|
1132
1132
|
colors: ["#26a69a", "#ef5350"],
|
|
1133
1133
|
barWidthRatio: 0.6,
|
|
1134
1134
|
stacking: "off"
|
|
1135
1135
|
};
|
|
1136
|
-
function
|
|
1136
|
+
function yi(s) {
|
|
1137
1137
|
if (!s) return {};
|
|
1138
1138
|
const t = { ...s };
|
|
1139
1139
|
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;
|
|
1140
1140
|
}
|
|
1141
|
-
class
|
|
1141
|
+
class fa extends Ei {
|
|
1142
1142
|
constructor(t, e) {
|
|
1143
|
-
super(t), M(this, "options"), this.options = { ...
|
|
1143
|
+
super(t), M(this, "options"), this.options = { ...da, ...yi(e) };
|
|
1144
1144
|
}
|
|
1145
1145
|
/** For chart compatibility — returns first store */
|
|
1146
1146
|
get store() {
|
|
1147
1147
|
return this.stores[0];
|
|
1148
1148
|
}
|
|
1149
1149
|
updateOptions(t) {
|
|
1150
|
-
this.options = { ...this.options, ...
|
|
1150
|
+
this.options = { ...this.options, ...yi(t) };
|
|
1151
1151
|
}
|
|
1152
1152
|
getCommonOptions() {
|
|
1153
1153
|
return this.options;
|
|
1154
1154
|
}
|
|
1155
1155
|
createEntry(t, e, i) {
|
|
1156
|
-
const a = this.options.entryAnimation ?? "fade-grow", n =
|
|
1156
|
+
const a = this.options.entryAnimation ?? "fade-grow", n = Yt(this.options.entryMs, 400);
|
|
1157
1157
|
return a === "none" || n <= 0 ? null : { startTime: i };
|
|
1158
1158
|
}
|
|
1159
1159
|
applyTheme(t, e) {
|
|
@@ -1304,15 +1304,15 @@ class va extends Hi {
|
|
|
1304
1304
|
t.save(), t.globalAlpha = c.alpha, t.fillStyle = h, t.fillRect(c.x, c.topY, c.barWidth, c.barHeight), t.restore();
|
|
1305
1305
|
}
|
|
1306
1306
|
}
|
|
1307
|
-
function
|
|
1308
|
-
return s.length <= t ? s :
|
|
1307
|
+
function xi(s, t) {
|
|
1308
|
+
return s.length <= t ? s : ma(
|
|
1309
1309
|
s,
|
|
1310
1310
|
t,
|
|
1311
1311
|
(e) => e.time,
|
|
1312
1312
|
(e) => e.value
|
|
1313
1313
|
);
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function pa(s, t) {
|
|
1316
1316
|
if (s.length <= t) return s;
|
|
1317
1317
|
const e = Math.ceil(s.length / t), i = [];
|
|
1318
1318
|
for (let a = 0; a < s.length; a += e) {
|
|
@@ -1331,7 +1331,7 @@ function ba(s, t) {
|
|
|
1331
1331
|
}
|
|
1332
1332
|
return i;
|
|
1333
1333
|
}
|
|
1334
|
-
function
|
|
1334
|
+
function ma(s, t, e, i) {
|
|
1335
1335
|
if (t >= s.length || t < 3) return s;
|
|
1336
1336
|
const a = [s[0]], n = (s.length - 2) / (t - 2);
|
|
1337
1337
|
let o = 0;
|
|
@@ -1354,74 +1354,74 @@ function ya(s, t, e, i) {
|
|
|
1354
1354
|
}
|
|
1355
1355
|
return a.push(s[s.length - 1]), a;
|
|
1356
1356
|
}
|
|
1357
|
-
const
|
|
1357
|
+
const wi = /* @__PURE__ */ new Map(), Si = /* @__PURE__ */ new Map(), Ci = /* @__PURE__ */ new Map();
|
|
1358
1358
|
function ii(s) {
|
|
1359
1359
|
return [parseInt(s.slice(1, 3), 16), parseInt(s.slice(3, 5), 16), parseInt(s.slice(5, 7), 16)];
|
|
1360
1360
|
}
|
|
1361
|
-
function
|
|
1361
|
+
function $i(s, t, e) {
|
|
1362
1362
|
return `#${s.toString(16).padStart(2, "0")}${t.toString(16).padStart(2, "0")}${e.toString(16).padStart(2, "0")}`;
|
|
1363
1363
|
}
|
|
1364
1364
|
function se(s, t) {
|
|
1365
1365
|
if (s.startsWith("rgba")) return s.replace(/[\d.]+\)\s*$/, `${t})`);
|
|
1366
1366
|
if (s.startsWith("rgb(")) return s.replace(/^rgb\((.*)\)$/i, `rgba($1, ${t})`);
|
|
1367
1367
|
const e = s + t;
|
|
1368
|
-
let i =
|
|
1368
|
+
let i = wi.get(e);
|
|
1369
1369
|
if (i) return i;
|
|
1370
1370
|
const [a, n, o] = ii(s);
|
|
1371
|
-
return i = `rgba(${a}, ${n}, ${o}, ${t})`,
|
|
1371
|
+
return i = `rgba(${a}, ${n}, ${o}, ${t})`, wi.set(e, i), i;
|
|
1372
1372
|
}
|
|
1373
|
-
function
|
|
1373
|
+
function ga(s, t) {
|
|
1374
1374
|
const e = s + t;
|
|
1375
|
-
let i =
|
|
1375
|
+
let i = Si.get(e);
|
|
1376
1376
|
if (i) return i;
|
|
1377
1377
|
const [a, n, o] = ii(s);
|
|
1378
|
-
return i =
|
|
1378
|
+
return i = $i(
|
|
1379
1379
|
Math.min(255, Math.round(a + (255 - a) * t)),
|
|
1380
1380
|
Math.min(255, Math.round(n + (255 - n) * t)),
|
|
1381
1381
|
Math.min(255, Math.round(o + (255 - o) * t))
|
|
1382
|
-
),
|
|
1382
|
+
), Si.set(e, i), i;
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1384
|
+
function va(s, t) {
|
|
1385
1385
|
const e = s + t;
|
|
1386
|
-
let i =
|
|
1386
|
+
let i = Ci.get(e);
|
|
1387
1387
|
if (i) return i;
|
|
1388
1388
|
const [a, n, o] = ii(s);
|
|
1389
|
-
return i =
|
|
1389
|
+
return i = $i(
|
|
1390
1390
|
Math.max(0, Math.round(a * (1 - t))),
|
|
1391
1391
|
Math.max(0, Math.round(n * (1 - t))),
|
|
1392
1392
|
Math.max(0, Math.round(o * (1 - t)))
|
|
1393
|
-
),
|
|
1393
|
+
), Ci.set(e, i), i;
|
|
1394
1394
|
}
|
|
1395
|
-
const
|
|
1395
|
+
const ba = {
|
|
1396
1396
|
upColor: "#26a69a",
|
|
1397
1397
|
downColor: "#ef5350",
|
|
1398
1398
|
wickUpColor: "#26a69a",
|
|
1399
1399
|
wickDownColor: "#ef5350",
|
|
1400
1400
|
bodyWidthRatio: 0.6
|
|
1401
1401
|
};
|
|
1402
|
-
function
|
|
1402
|
+
function Mi(s) {
|
|
1403
1403
|
if (!s) return {};
|
|
1404
1404
|
const t = { ...s };
|
|
1405
1405
|
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;
|
|
1406
1406
|
}
|
|
1407
|
-
class
|
|
1407
|
+
class ya {
|
|
1408
1408
|
constructor(t, e) {
|
|
1409
|
-
M(this, "store"), M(this, "options"), M(this, "displayedLast", null), M(this, "lastSeededTime", Number.NaN), M(this, "lastRenderTime", 0), M(this, "entries", /* @__PURE__ */ new Map()), this.store = t, this.options = { ...
|
|
1409
|
+
M(this, "store"), M(this, "options"), M(this, "displayedLast", null), M(this, "lastSeededTime", Number.NaN), M(this, "lastRenderTime", 0), M(this, "entries", /* @__PURE__ */ new Map()), this.store = t, this.options = { ...ba, ...Mi(e) };
|
|
1410
1410
|
}
|
|
1411
1411
|
updateOptions(t) {
|
|
1412
|
-
this.options = { ...this.options, ...
|
|
1412
|
+
this.options = { ...this.options, ...Mi(t) };
|
|
1413
1413
|
}
|
|
1414
1414
|
getColor() {
|
|
1415
1415
|
return this.options.upColor;
|
|
1416
1416
|
}
|
|
1417
1417
|
// --- SeriesRenderer interface implementation ------------------------------
|
|
1418
1418
|
setData(t) {
|
|
1419
|
-
this.store.setData(
|
|
1419
|
+
this.store.setData(Ns(t ?? [])), this.entries.clear();
|
|
1420
1420
|
}
|
|
1421
1421
|
appendPoint(t) {
|
|
1422
1422
|
const e = t, i = oe(e.time);
|
|
1423
1423
|
this.store.append({ ...e, time: i });
|
|
1424
|
-
const a = this.options.entryAnimation ?? "unfold", n =
|
|
1424
|
+
const a = this.options.entryAnimation ?? "unfold", n = Yt(this.options.entryMs, 400);
|
|
1425
1425
|
a !== "none" && n > 0 && this.entries.set(i, { startTime: performance.now() });
|
|
1426
1426
|
}
|
|
1427
1427
|
updateLastPoint(t) {
|
|
@@ -1484,10 +1484,10 @@ class Ca {
|
|
|
1484
1484
|
entranceProgress(t, e) {
|
|
1485
1485
|
const i = this.entries.get(t);
|
|
1486
1486
|
if (!i) return 1;
|
|
1487
|
-
const a =
|
|
1487
|
+
const a = Yt(this.options.entryMs, 400);
|
|
1488
1488
|
if (a <= 0)
|
|
1489
1489
|
return this.entries.delete(t), 1;
|
|
1490
|
-
const n = ne((e - i.startTime) / a, 0, 1), o =
|
|
1490
|
+
const n = ne((e - i.startTime) / a, 0, 1), o = zi(n);
|
|
1491
1491
|
return n >= 1 && this.entries.delete(t), o;
|
|
1492
1492
|
}
|
|
1493
1493
|
/**
|
|
@@ -1503,7 +1503,7 @@ class Ca {
|
|
|
1503
1503
|
this.displayedLast = null, this.lastSeededTime = Number.NaN;
|
|
1504
1504
|
return;
|
|
1505
1505
|
}
|
|
1506
|
-
const a = this.lastSeededTime !== i.time, n =
|
|
1506
|
+
const a = this.lastSeededTime !== i.time, n = Yt(this.options.smoothMs, 70), o = n > 0 ? 1e3 / n : 0;
|
|
1507
1507
|
if (this.displayedLast === null || a || o <= 0) {
|
|
1508
1508
|
this.displayedLast = { ...i }, this.lastSeededTime = i.time;
|
|
1509
1509
|
return;
|
|
@@ -1511,11 +1511,11 @@ class Ca {
|
|
|
1511
1511
|
const r = this.displayedLast, h = r.volume ?? 0, d = i.volume ?? 0;
|
|
1512
1512
|
this.displayedLast = {
|
|
1513
1513
|
time: i.time,
|
|
1514
|
-
open:
|
|
1515
|
-
high:
|
|
1516
|
-
low:
|
|
1517
|
-
close:
|
|
1518
|
-
volume: i.volume === void 0 ? void 0 :
|
|
1514
|
+
open: Vt(r.open, i.open, o, e),
|
|
1515
|
+
high: Vt(r.high, i.high, o, e),
|
|
1516
|
+
low: Vt(r.low, i.low, o, e),
|
|
1517
|
+
close: Vt(r.close, i.close, o, e),
|
|
1518
|
+
volume: i.volume === void 0 ? void 0 : Vt(h, d, o, e)
|
|
1519
1519
|
};
|
|
1520
1520
|
}
|
|
1521
1521
|
render(t) {
|
|
@@ -1523,7 +1523,7 @@ class Ca {
|
|
|
1523
1523
|
this.advanceLiveTracking(d);
|
|
1524
1524
|
let c = this.store.getVisibleData(h.from, h.to);
|
|
1525
1525
|
const u = e.mediaSize.width, g = c.length > u * 2;
|
|
1526
|
-
if (g && (c =
|
|
1526
|
+
if (g && (c = pa(c, Math.round(u * 1.5)), this.entries.clear()), c.length === 0) return;
|
|
1527
1527
|
if (!g && this.displayedLast) {
|
|
1528
1528
|
const T = c.length - 1;
|
|
1529
1529
|
c[T].time === this.displayedLast.time && (c = [...c.slice(0, T), this.displayedLast]);
|
|
@@ -1587,7 +1587,7 @@ class Ca {
|
|
|
1587
1587
|
t.fillRect(x - c, a - v, d, v);
|
|
1588
1588
|
continue;
|
|
1589
1589
|
}
|
|
1590
|
-
const b =
|
|
1590
|
+
const b = Ne(C, f, {
|
|
1591
1591
|
x: x - c,
|
|
1592
1592
|
barWidth: d,
|
|
1593
1593
|
anchorY: a,
|
|
@@ -1618,7 +1618,7 @@ class Ca {
|
|
|
1618
1618
|
t.fillRect(T, w, r, S - w);
|
|
1619
1619
|
continue;
|
|
1620
1620
|
}
|
|
1621
|
-
const m =
|
|
1621
|
+
const m = Ne(p, u, {
|
|
1622
1622
|
x: T,
|
|
1623
1623
|
barWidth: g,
|
|
1624
1624
|
anchorY: b,
|
|
@@ -1627,13 +1627,13 @@ class Ca {
|
|
|
1627
1627
|
});
|
|
1628
1628
|
t.save(), t.globalAlpha = m.alpha, t.fillRect(m.x, m.topY, r, Math.max(1, m.bottomY - m.topY)), t.restore();
|
|
1629
1629
|
}
|
|
1630
|
-
const f = this.options.bodyGradient !== !1, y = f ?
|
|
1630
|
+
const f = this.options.bodyGradient !== !1, y = f ? ga(h, 0.2) : h, x = f ? va(h, 0.15) : h;
|
|
1631
1631
|
f || (t.fillStyle = h);
|
|
1632
1632
|
for (const v of e) {
|
|
1633
1633
|
const p = (c == null ? void 0 : c.get(v.time)) ?? 1, C = i.timeToBitmapX(v.time), b = a.valueToBitmapY(v.open), w = a.valueToBitmapY(v.close), S = Math.min(b, w), T = Math.max(b, w), m = Math.max(1, T - S), k = p < 1 && u !== "none";
|
|
1634
1634
|
let I = C - n, R = S, L = m, V = 1;
|
|
1635
1635
|
if (k) {
|
|
1636
|
-
const H =
|
|
1636
|
+
const H = Ne(p, u, {
|
|
1637
1637
|
x: C - n,
|
|
1638
1638
|
barWidth: g,
|
|
1639
1639
|
anchorY: b,
|
|
@@ -1650,7 +1650,7 @@ class Ca {
|
|
|
1650
1650
|
}
|
|
1651
1651
|
}
|
|
1652
1652
|
}
|
|
1653
|
-
function
|
|
1653
|
+
function Ne(s, t, e) {
|
|
1654
1654
|
switch (t) {
|
|
1655
1655
|
case "none":
|
|
1656
1656
|
return { x: e.x, topY: e.topY, bottomY: e.bottomY, alpha: 1 };
|
|
@@ -1679,28 +1679,28 @@ function Ue(s, t, e) {
|
|
|
1679
1679
|
};
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
1682
|
-
const
|
|
1682
|
+
const xa = {
|
|
1683
1683
|
colors: ["#2962FF"],
|
|
1684
1684
|
strokeWidth: 1,
|
|
1685
1685
|
area: { visible: !0 },
|
|
1686
1686
|
pulse: !0,
|
|
1687
1687
|
stacking: "off"
|
|
1688
1688
|
};
|
|
1689
|
-
function
|
|
1689
|
+
function ki(s) {
|
|
1690
1690
|
if (!s) return {};
|
|
1691
1691
|
const t = { ...s };
|
|
1692
1692
|
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;
|
|
1693
1693
|
}
|
|
1694
|
-
class
|
|
1694
|
+
class wa extends Ei {
|
|
1695
1695
|
constructor(t, e) {
|
|
1696
|
-
super(t), M(this, "options"), M(this, "areaGradientCache", /* @__PURE__ */ new Map()), this.options = { ...
|
|
1696
|
+
super(t), M(this, "options"), M(this, "areaGradientCache", /* @__PURE__ */ new Map()), this.options = { ...xa, ...ki(e) };
|
|
1697
1697
|
}
|
|
1698
1698
|
/** Back-compat: first store. */
|
|
1699
1699
|
get store() {
|
|
1700
1700
|
return this.stores[0];
|
|
1701
1701
|
}
|
|
1702
1702
|
updateOptions(t) {
|
|
1703
|
-
this.options = { ...this.options, ...
|
|
1703
|
+
this.options = { ...this.options, ...ki(t) };
|
|
1704
1704
|
}
|
|
1705
1705
|
getStacking() {
|
|
1706
1706
|
return this.options.stacking;
|
|
@@ -1710,7 +1710,7 @@ class ka extends Hi {
|
|
|
1710
1710
|
}
|
|
1711
1711
|
createEntry(t, e, i) {
|
|
1712
1712
|
var a;
|
|
1713
|
-
const n = this.options.entryAnimation ?? "grow", o =
|
|
1713
|
+
const n = this.options.entryAnimation ?? "grow", o = Yt(this.options.entryMs, 400);
|
|
1714
1714
|
if (n === "none" || o <= 0) return null;
|
|
1715
1715
|
const r = (a = this.stores[t]) == null ? void 0 : a.last();
|
|
1716
1716
|
return {
|
|
@@ -1729,7 +1729,7 @@ class ka extends Hi {
|
|
|
1729
1729
|
}
|
|
1730
1730
|
/** Resolved pulse period in ms. 0 disables the pulse entirely. */
|
|
1731
1731
|
resolvedPulseMs() {
|
|
1732
|
-
return
|
|
1732
|
+
return Yt(this.options.pulseMs, 600);
|
|
1733
1733
|
}
|
|
1734
1734
|
get hasPulse() {
|
|
1735
1735
|
return this.options.pulse && this.resolvedPulseMs() > 0 && this.stores.some((t) => t.isVisible() && t.length > 0);
|
|
@@ -1783,7 +1783,7 @@ class ka extends Hi {
|
|
|
1783
1783
|
if (!this.stores[g].isVisible()) continue;
|
|
1784
1784
|
let f = this.stores[g].getVisibleData(o.from, o.to);
|
|
1785
1785
|
const y = e.mediaSize.width;
|
|
1786
|
-
if (f.length > y * 2 && (f =
|
|
1786
|
+
if (f.length > y * 2 && (f = xi(f, Math.round(y * 1.5))), f.length < 2) continue;
|
|
1787
1787
|
const x = this.options.colors[g % this.options.colors.length], v = f[f.length - 1], p = this.peekEntry(g, v.time), C = this.entranceProgress(g, v.time, c), b = p && u === "fade" && C < 1, w = this.trailingEndpoint(g, i, a, c) ?? {
|
|
1788
1788
|
x: i.timeToBitmapX(v.time),
|
|
1789
1789
|
y: a.valueToBitmapY(this.effectiveValue(g, v.time, v.value))
|
|
@@ -1805,7 +1805,7 @@ class ka extends Hi {
|
|
|
1805
1805
|
renderStacked(t, e) {
|
|
1806
1806
|
const { scope: i, timeScale: a, yScale: n } = t, { context: o } = i, r = a.getRange(), { verticalPixelRatio: h } = i, d = this.options.strokeWidth > 0, c = Math.max(1, Math.round(this.options.strokeWidth * h)), u = i.mediaSize.width, g = this.stores.map((m) => {
|
|
1807
1807
|
let k = m.getVisibleData(r.from, r.to);
|
|
1808
|
-
return k.length > u * 2 && (k =
|
|
1808
|
+
return k.length > u * 2 && (k = xi(k, Math.round(u * 1.5))), k;
|
|
1809
1809
|
}), f = /* @__PURE__ */ new Set();
|
|
1810
1810
|
for (const m of g)
|
|
1811
1811
|
for (const k of m) f.add(k.time);
|
|
@@ -1981,7 +1981,7 @@ class ka extends Hi {
|
|
|
1981
1981
|
t.beginPath(), t.arc(e, i, d, 0, Math.PI * 2), t.fillStyle = se(a, h * 0.3), t.fill(), t.beginPath(), t.arc(e, i, r, 0, Math.PI * 2), t.fillStyle = a, t.fill();
|
|
1982
1982
|
}
|
|
1983
1983
|
}
|
|
1984
|
-
const
|
|
1984
|
+
const Hi = {
|
|
1985
1985
|
mode: "outside",
|
|
1986
1986
|
content: "both",
|
|
1987
1987
|
fontSize: 11,
|
|
@@ -2000,44 +2000,44 @@ const Xi = {
|
|
|
2000
2000
|
// that PAV collapses into a centered block on dense datasets.
|
|
2001
2001
|
labelGap: 1.8,
|
|
2002
2002
|
balanceSides: !0
|
|
2003
|
-
},
|
|
2003
|
+
}, Sa = {
|
|
2004
2004
|
innerRadiusRatio: 0,
|
|
2005
2005
|
// 1.15° ≈ 0.02 rad — same visual default as before the radians→degrees switch.
|
|
2006
2006
|
padAngle: 1.15,
|
|
2007
|
-
sliceLabels: { ...
|
|
2007
|
+
sliceLabels: { ...Hi },
|
|
2008
2008
|
// Motion off by default: label draw-in + hover explode both skipped.
|
|
2009
2009
|
animate: !1
|
|
2010
|
-
},
|
|
2011
|
-
function
|
|
2010
|
+
}, Ge = Math.PI / 180;
|
|
2011
|
+
function Ca(s, t) {
|
|
2012
2012
|
return { ...s ?? {}, ...t };
|
|
2013
2013
|
}
|
|
2014
|
-
function
|
|
2015
|
-
return { ...
|
|
2014
|
+
function Ma(s) {
|
|
2015
|
+
return { ...Hi, ...s ?? {} };
|
|
2016
2016
|
}
|
|
2017
|
-
function
|
|
2017
|
+
function ka(s) {
|
|
2018
2018
|
const t = { color: "rgba(0, 0, 0, 0.22)", blur: 24, offsetX: 0, offsetY: 10 };
|
|
2019
2019
|
return s === !0 || s === !1 ? t : { ...t, ...s };
|
|
2020
2020
|
}
|
|
2021
|
-
function
|
|
2021
|
+
function Ta(s) {
|
|
2022
2022
|
const t = { color: "rgba(0, 0, 0, 0.1)", depth: 0.3 };
|
|
2023
2023
|
return s === !0 || s === !1 ? t : { ...t, ...s };
|
|
2024
2024
|
}
|
|
2025
|
-
const ae = Math.PI * 2,
|
|
2026
|
-
function
|
|
2027
|
-
const { bitmapWidth: t, bitmapHeight: e, padTop: i, padBottom: a } = s, n = Math.max(0, s.labelReserve ?? 0), o = Math.min(Math.max(0, i), e), r = Math.min(Math.max(0, a), e - o), h = e - o - r, d = Math.max(0, t - 2 * n), c = t / 2, u = o + h / 2, g = Math.max(0, Math.min(d, h) / 2 *
|
|
2025
|
+
const ae = Math.PI * 2, Oi = 0.85;
|
|
2026
|
+
function Ti(s) {
|
|
2027
|
+
const { bitmapWidth: t, bitmapHeight: e, padTop: i, padBottom: a } = s, n = Math.max(0, s.labelReserve ?? 0), o = Math.min(Math.max(0, i), e), r = Math.min(Math.max(0, a), e - o), h = e - o - r, d = Math.max(0, t - 2 * n), c = t / 2, u = o + h / 2, g = Math.max(0, Math.min(d, h) / 2 * Oi);
|
|
2028
2028
|
return { cx: c, cy: u, maxR: g };
|
|
2029
2029
|
}
|
|
2030
|
-
function
|
|
2030
|
+
function Ia(s) {
|
|
2031
2031
|
if (!s.startsWith("#")) return !1;
|
|
2032
2032
|
const t = parseInt(s.slice(1, 3), 16), e = parseInt(s.slice(3, 5), 16), i = parseInt(s.slice(5, 7), 16);
|
|
2033
2033
|
return t * 0.299 + e * 0.587 + i * 0.114 > 150;
|
|
2034
2034
|
}
|
|
2035
|
-
function
|
|
2035
|
+
function Ra(s, t) {
|
|
2036
2036
|
if (!s.startsWith("#")) return s;
|
|
2037
2037
|
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)), a = Math.min(255, parseInt(s.slice(5, 7), 16) + Math.round(255 * t));
|
|
2038
2038
|
return `#${e.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}${a.toString(16).padStart(2, "0")}`;
|
|
2039
2039
|
}
|
|
2040
|
-
function
|
|
2040
|
+
function Ii(s) {
|
|
2041
2041
|
if (s.startsWith("#"))
|
|
2042
2042
|
return {
|
|
2043
2043
|
r: parseInt(s.slice(1, 3), 16) || 0,
|
|
@@ -2057,21 +2057,21 @@ function Li(s) {
|
|
|
2057
2057
|
}
|
|
2058
2058
|
return { r: 0, g: 0, b: 0, a: 1 };
|
|
2059
2059
|
}
|
|
2060
|
-
function
|
|
2061
|
-
const e =
|
|
2060
|
+
function La(s, t) {
|
|
2061
|
+
const e = Ii(s), i = Ii(t), a = i.a, n = Math.round(i.r * a + e.r * (1 - a)), o = Math.round(i.g * a + e.g * (1 - a)), r = Math.round(i.b * a + e.b * (1 - a));
|
|
2062
2062
|
return `#${n.toString(16).padStart(2, "0")}${o.toString(16).padStart(2, "0")}${r.toString(16).padStart(2, "0")}`;
|
|
2063
2063
|
}
|
|
2064
|
-
var N, K, wt, ht, te,
|
|
2064
|
+
var N, K, wt, ht, te, Pt, vt, Nt, Ct, je, Te, Xi, Ni, Ui;
|
|
2065
2065
|
class Ie {
|
|
2066
2066
|
constructor(t) {
|
|
2067
|
-
Y(this, Ct), Y(this, N, []), Y(this, K), Y(this, wt, -1), Y(this, ht, []), Y(this, te, 0), Y(this,
|
|
2067
|
+
Y(this, Ct), Y(this, N, []), Y(this, K), Y(this, wt, -1), Y(this, ht, []), Y(this, te, 0), Y(this, Pt, 1), Y(this, vt, null), Y(this, Nt, []), _(this, K, X(this, Ct, je).call(this, Sa, t ?? {}));
|
|
2068
2068
|
}
|
|
2069
2069
|
getData() {
|
|
2070
2070
|
return l(this, N);
|
|
2071
2071
|
}
|
|
2072
2072
|
setData(t) {
|
|
2073
2073
|
const e = t ?? [];
|
|
2074
|
-
_(this, N, e), _(this, ht, new Array(e.length).fill(0)), _(this,
|
|
2074
|
+
_(this, N, e), _(this, ht, new Array(e.length).fill(0)), _(this, Pt, l(this, K).animate ? 0 : 1), _(this, vt, null);
|
|
2075
2075
|
for (const i of l(this, Nt))
|
|
2076
2076
|
i();
|
|
2077
2077
|
}
|
|
@@ -2084,7 +2084,7 @@ class Ie {
|
|
|
2084
2084
|
updateOptions(t) {
|
|
2085
2085
|
var e, i;
|
|
2086
2086
|
const a = (e = l(this, K).sliceLabels) == null ? void 0 : e.mode;
|
|
2087
|
-
_(this, K, X(this, Ct,
|
|
2087
|
+
_(this, K, X(this, Ct, je).call(this, l(this, K), t ?? {})), ((i = l(this, K).sliceLabels) == null ? void 0 : i.mode) === "outside" && a !== "outside" && _(this, Pt, l(this, K).animate ? 0 : 1), _(this, vt, null);
|
|
2088
2088
|
}
|
|
2089
2089
|
getColor() {
|
|
2090
2090
|
var t, e;
|
|
@@ -2110,7 +2110,7 @@ class Ie {
|
|
|
2110
2110
|
if (l(this, N).length === 0) return -1;
|
|
2111
2111
|
const r = l(this, N).reduce((b, w) => b + w.value, 0);
|
|
2112
2112
|
if (r <= 0) return -1;
|
|
2113
|
-
const h = ((o = l(this, vt)) == null ? void 0 : o.reserve) ?? 0, { cx: d, cy: c, maxR: u } =
|
|
2113
|
+
const h = ((o = l(this, vt)) == null ? void 0 : o.reserve) ?? 0, { cx: d, cy: c, maxR: u } = Ti({
|
|
2114
2114
|
bitmapWidth: i,
|
|
2115
2115
|
bitmapHeight: a,
|
|
2116
2116
|
padTop: (n == null ? void 0 : n.top) ?? 0,
|
|
@@ -2164,7 +2164,7 @@ class Ie {
|
|
|
2164
2164
|
const i = e === l(this, wt) ? 1 : 0;
|
|
2165
2165
|
if (Math.abs(l(this, ht)[e] - i) > 0.01) return !0;
|
|
2166
2166
|
}
|
|
2167
|
-
return ((t = l(this, K).sliceLabels) == null ? void 0 : t.mode) === "outside" && l(this,
|
|
2167
|
+
return ((t = l(this, K).sliceLabels) == null ? void 0 : t.mode) === "outside" && l(this, Pt) < 0.99;
|
|
2168
2168
|
}
|
|
2169
2169
|
dispose() {
|
|
2170
2170
|
_(this, Nt, []), _(this, N, []), _(this, ht, []), _(this, te, 0);
|
|
@@ -2182,38 +2182,38 @@ class Ie {
|
|
|
2182
2182
|
if (l(this, N).length === 0) return;
|
|
2183
2183
|
const { scope: e, theme: i, padding: a } = t, { context: n, bitmapSize: o, horizontalPixelRatio: r, verticalPixelRatio: h } = e, d = performance.now(), c = l(this, te) ? Math.min(0.05, (d - l(this, te)) / 1e3) : 0;
|
|
2184
2184
|
_(this, te, d);
|
|
2185
|
-
const u = l(this, N).reduce((O,
|
|
2185
|
+
const u = l(this, N).reduce((O, ot) => O + ot.value, 0);
|
|
2186
2186
|
if (u <= 0) return;
|
|
2187
2187
|
const g = 12;
|
|
2188
2188
|
for (; l(this, ht).length < l(this, N).length; )
|
|
2189
2189
|
l(this, ht).push(0);
|
|
2190
2190
|
if (l(this, K).animate)
|
|
2191
2191
|
for (let O = 0; O < l(this, N).length; O++) {
|
|
2192
|
-
const
|
|
2193
|
-
l(this, ht)[O] =
|
|
2192
|
+
const ot = O === l(this, wt) ? 1 : 0;
|
|
2193
|
+
l(this, ht)[O] = Vt(l(this, ht)[O], ot, g, c);
|
|
2194
2194
|
}
|
|
2195
|
-
const f =
|
|
2196
|
-
n.font = `${f.fontSize * r}px ${i.typography.fontFamily}`, f.mode === "outside" && l(this, K).animate && _(this,
|
|
2197
|
-
const y = l(this, K).colors ?? i.seriesColors, x = f.mode === "outside" ? X(this, Ct,
|
|
2195
|
+
const f = Ma(l(this, K).sliceLabels);
|
|
2196
|
+
n.font = `${f.fontSize * r}px ${i.typography.fontFamily}`, f.mode === "outside" && l(this, K).animate && _(this, Pt, Vt(l(this, Pt), 1, 6, c));
|
|
2197
|
+
const y = l(this, K).colors ?? i.seriesColors, x = f.mode === "outside" ? X(this, Ct, Xi).call(this, n, f, u, r) : 0, { cx: v, cy: p, maxR: C } = Ti({
|
|
2198
2198
|
bitmapWidth: o.width,
|
|
2199
2199
|
bitmapHeight: o.height,
|
|
2200
2200
|
padTop: a.top * h,
|
|
2201
2201
|
padBottom: a.bottom * h,
|
|
2202
2202
|
labelReserve: x
|
|
2203
|
-
}), b = C, w = b * l(this, K).innerRadiusRatio, S = l(this, K).padAngle *
|
|
2203
|
+
}), b = C, w = b * l(this, K).innerRadiusRatio, S = l(this, K).padAngle * Ge, T = 8 * r, m = l(this, K).shadow ?? !1, k = ka(m), I = l(this, K).innerShadow ?? !1, R = Ta(I);
|
|
2204
2204
|
let L = -Math.PI / 2;
|
|
2205
2205
|
for (let O = 0; O < l(this, N).length; O++) {
|
|
2206
|
-
const
|
|
2206
|
+
const ot = l(this, N)[O], it = ot.value / u * ae, q = L + S / 2, pt = L + it - S / 2, Bt = L + it / 2, yt = ot.color ?? y[O % y.length];
|
|
2207
2207
|
if (pt <= q) {
|
|
2208
2208
|
L += it;
|
|
2209
2209
|
continue;
|
|
2210
2210
|
}
|
|
2211
|
-
const $t = l(this, ht)[O] * T, jt = Math.cos(
|
|
2211
|
+
const $t = l(this, ht)[O] * T, jt = Math.cos(Bt) * $t, Kt = Math.sin(Bt) * $t, kt = v + jt, xt = p + Kt;
|
|
2212
2212
|
n.beginPath(), n.arc(kt, xt, b, q, pt), w > 0 ? n.arc(kt, xt, w, pt, q, !0) : n.lineTo(kt, xt), n.closePath();
|
|
2213
2213
|
const Tt = n.createRadialGradient(kt, xt, w || 0, kt, xt, b);
|
|
2214
|
-
if (Tt.addColorStop(0,
|
|
2214
|
+
if (Tt.addColorStop(0, Ra(yt, 0.15)), I) {
|
|
2215
2215
|
const Ht = Math.max(0, Math.min(0.999, 1 - R.depth));
|
|
2216
|
-
Tt.addColorStop(Ht, yt), Tt.addColorStop(1,
|
|
2216
|
+
Tt.addColorStop(Ht, yt), Tt.addColorStop(1, La(yt, R.color));
|
|
2217
2217
|
} else
|
|
2218
2218
|
Tt.addColorStop(1, yt);
|
|
2219
2219
|
n.fillStyle = Tt;
|
|
@@ -2228,7 +2228,7 @@ class Ie {
|
|
|
2228
2228
|
L = -Math.PI / 2;
|
|
2229
2229
|
const V = i.tooltip.textColor;
|
|
2230
2230
|
if (f.mode === "outside") {
|
|
2231
|
-
const O = X(this, Ct,
|
|
2231
|
+
const O = X(this, Ct, Ui).call(this, {
|
|
2232
2232
|
cx: v,
|
|
2233
2233
|
cy: p,
|
|
2234
2234
|
outerR: b,
|
|
@@ -2237,45 +2237,45 @@ class Ie {
|
|
|
2237
2237
|
labels: f,
|
|
2238
2238
|
hpr: r,
|
|
2239
2239
|
bitmapHeight: o.height
|
|
2240
|
-
}),
|
|
2240
|
+
}), ot = O.length > 1 ? Math.min(0.06, 0.9 / (O.length - 1)) : 0;
|
|
2241
2241
|
for (let it = 0; it < O.length; it++) {
|
|
2242
2242
|
const q = O[it];
|
|
2243
2243
|
if (q === null) continue;
|
|
2244
|
-
const pt = it *
|
|
2245
|
-
X(this, Ct,
|
|
2244
|
+
const pt = it * ot, Bt = ne((l(this, Pt) - pt) / (1 - pt), 0, 1);
|
|
2245
|
+
X(this, Ct, Ni).call(this, {
|
|
2246
2246
|
context: n,
|
|
2247
2247
|
entry: q,
|
|
2248
2248
|
textColor: V,
|
|
2249
2249
|
labels: f,
|
|
2250
2250
|
hpr: r,
|
|
2251
|
-
progress:
|
|
2251
|
+
progress: Bt
|
|
2252
2252
|
});
|
|
2253
2253
|
}
|
|
2254
2254
|
return;
|
|
2255
2255
|
}
|
|
2256
2256
|
const H = w > 0 ? (b + w) / 2 : b * 0.65;
|
|
2257
2257
|
n.textAlign = "center", n.textBaseline = "middle";
|
|
2258
|
-
const A = f.minSliceAngle *
|
|
2258
|
+
const A = f.minSliceAngle * Ge;
|
|
2259
2259
|
for (let O = 0; O < l(this, N).length; O++) {
|
|
2260
|
-
const
|
|
2260
|
+
const ot = l(this, N)[O], it = ot.value / u * ae;
|
|
2261
2261
|
if (it >= A) {
|
|
2262
|
-
const q = L + it / 2, pt = l(this, ht)[O] * T,
|
|
2262
|
+
const q = L + it / 2, pt = l(this, ht)[O] * T, Bt = ot.color ?? y[O % y.length], yt = X(this, Ct, Te).call(this, ot, u, f.content), $t = n.measureText(yt).width, jt = f.fontSize * 1.2 * r, Kt = it < Math.PI ? 2 * H * Math.sin(it / 2) : 2 * H, kt = $t > Kt - 4 * r, xt = w > 0 && H - w < jt;
|
|
2263
2263
|
if (!kt && !xt) {
|
|
2264
2264
|
const Tt = v + Math.cos(q) * (H + pt), Jt = p + Math.sin(q) * (H + pt);
|
|
2265
|
-
n.fillStyle =
|
|
2265
|
+
n.fillStyle = Ia(Bt) ? "#000000" : "#ffffff", n.fillText(yt, Tt, Jt);
|
|
2266
2266
|
}
|
|
2267
2267
|
}
|
|
2268
2268
|
L += it;
|
|
2269
2269
|
}
|
|
2270
2270
|
}
|
|
2271
2271
|
}
|
|
2272
|
-
N = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), wt = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(),
|
|
2272
|
+
N = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), wt = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakSet(), /**
|
|
2273
2273
|
* Merge partial options onto a base, deep-merging `sliceLabels` so callers
|
|
2274
2274
|
* can override one field (e.g. `mode`) without dropping sibling defaults.
|
|
2275
2275
|
*/
|
|
2276
|
-
|
|
2276
|
+
je = function(s, t) {
|
|
2277
2277
|
const e = { ...s, ...t };
|
|
2278
|
-
return t.sliceLabels !== void 0 && (e.sliceLabels =
|
|
2278
|
+
return t.sliceLabels !== void 0 && (e.sliceLabels = Ca(s.sliceLabels, t.sliceLabels)), e;
|
|
2279
2279
|
}, /** Build the text shown for one slice given the resolved content mode. */
|
|
2280
2280
|
Te = function(s, t, e) {
|
|
2281
2281
|
const i = t > 0 ? s.value / t * 100 : 0, a = `${i.toFixed(i >= 10 ? 0 : 1)}%`;
|
|
@@ -2289,7 +2289,7 @@ Te = function(s, t, e) {
|
|
|
2289
2289
|
* the active `context.font` string so a theme swap that changes the font
|
|
2290
2290
|
* family / size busts the cache and triggers a fresh measurement.
|
|
2291
2291
|
*/
|
|
2292
|
-
|
|
2292
|
+
Xi = function(s, t, e, i) {
|
|
2293
2293
|
const a = s.font;
|
|
2294
2294
|
if (l(this, vt) && l(this, vt).fontScale === i && l(this, vt).font === a)
|
|
2295
2295
|
return l(this, vt).reserve;
|
|
@@ -2298,7 +2298,7 @@ Ui = function(s, t, e, i) {
|
|
|
2298
2298
|
const d = X(this, Ct, Te).call(this, h, e, t.content), c = s.measureText(d).width;
|
|
2299
2299
|
c > n && (n = c);
|
|
2300
2300
|
}
|
|
2301
|
-
const o = Math.max(t.distance, t.elbowLen), r = (n + (o + Math.max(0, t.railWidth) + t.legPad + 4) * i) /
|
|
2301
|
+
const o = Math.max(t.distance, t.elbowLen), r = (n + (o + Math.max(0, t.railWidth) + t.legPad + 4) * i) / Oi;
|
|
2302
2302
|
return _(this, vt, { fontScale: i, font: a, reserve: r }), r;
|
|
2303
2303
|
}, /**
|
|
2304
2304
|
* Draw one outside label: anchor dot → radial elbow (per-slice, at slice
|
|
@@ -2307,7 +2307,7 @@ Ui = function(s, t, e, i) {
|
|
|
2307
2307
|
* lines from cutting across the pie when several small slices cluster near
|
|
2308
2308
|
* 12 o'clock or 6 o'clock.
|
|
2309
2309
|
*/
|
|
2310
|
-
|
|
2310
|
+
Ni = function(s) {
|
|
2311
2311
|
const { context: t, entry: e, textColor: i, labels: a, hpr: n, progress: o } = s;
|
|
2312
2312
|
if (o <= 0) return;
|
|
2313
2313
|
const { anchorX: r, anchorY: h, elbowX: d, elbowY: c, side: u, text: g, color: f, labelX: y, labelY: x } = e, v = y + u * a.legPad * n, p = ne(o / 0.15, 0, 1), C = ne((o - 0.15) / 0.45, 0, 1), b = ne((o - 0.6) / 0.4, 0, 1);
|
|
@@ -2336,21 +2336,21 @@ Gi = function(s) {
|
|
|
2336
2336
|
* to the opposite side would mean flipping text direction without moving
|
|
2337
2337
|
* the label, which would push text across the pie.
|
|
2338
2338
|
*/
|
|
2339
|
-
|
|
2339
|
+
Ui = function(s) {
|
|
2340
2340
|
const { cx: t, cy: e, outerR: i, total: a, palette: n, labels: o, hpr: r, bitmapHeight: h } = s, d = new Array(l(this, N).length).fill(null), c = o.elbowLen * r, u = Math.max(o.distance, o.elbowLen) * r, g = Math.max(0, o.railWidth) * r, f = [];
|
|
2341
2341
|
let y = -Math.PI / 2;
|
|
2342
|
-
const x = o.minSliceAngle *
|
|
2342
|
+
const x = o.minSliceAngle * Ge;
|
|
2343
2343
|
for (let b = 0; b < l(this, N).length; b++) {
|
|
2344
2344
|
const w = l(this, N)[b], S = w.value / a * ae;
|
|
2345
2345
|
if (S >= x) {
|
|
2346
|
-
const T = y + S / 2, m = l(this, ht)[b] * (8 * r), k = Math.cos(T), I = Math.sin(T), R = k >= 0 ? 1 : -1, L = t + k * (i + m), V = e + I * (i + m), H = t + k * (i + m + c), A = e + I * (i + m + c), O = t + k * (i + m + u) + R * g,
|
|
2346
|
+
const T = y + S / 2, m = l(this, ht)[b] * (8 * r), k = Math.cos(T), I = Math.sin(T), R = k >= 0 ? 1 : -1, L = t + k * (i + m), V = e + I * (i + m), H = t + k * (i + m + c), A = e + I * (i + m + c), O = t + k * (i + m + u) + R * g, ot = e + I * (i + m + u), it = {
|
|
2347
2347
|
anchorX: L,
|
|
2348
2348
|
anchorY: V,
|
|
2349
2349
|
elbowX: H,
|
|
2350
2350
|
elbowY: A,
|
|
2351
2351
|
side: R,
|
|
2352
2352
|
labelX: O,
|
|
2353
|
-
labelY:
|
|
2353
|
+
labelY: ot,
|
|
2354
2354
|
text: X(this, Ct, Te).call(this, w, a, o.content),
|
|
2355
2355
|
color: w.color ?? n[b % n.length]
|
|
2356
2356
|
};
|
|
@@ -2414,7 +2414,7 @@ ji = function(s) {
|
|
|
2414
2414
|
}
|
|
2415
2415
|
return d;
|
|
2416
2416
|
};
|
|
2417
|
-
const
|
|
2417
|
+
const Gi = {
|
|
2418
2418
|
background: "#131722",
|
|
2419
2419
|
chartGradient: ["#1a1f2e", "#101318"],
|
|
2420
2420
|
typography: {
|
|
@@ -2473,19 +2473,19 @@ const Ki = {
|
|
|
2473
2473
|
textColor: "#d1d4dc",
|
|
2474
2474
|
borderColor: "rgba(42, 46, 57, 0.8)"
|
|
2475
2475
|
}
|
|
2476
|
-
},
|
|
2476
|
+
}, Dt = {
|
|
2477
2477
|
top: 20,
|
|
2478
2478
|
bottom: 20,
|
|
2479
2479
|
right: { intervals: 3 },
|
|
2480
2480
|
left: { intervals: 0 }
|
|
2481
|
-
},
|
|
2482
|
-
class
|
|
2481
|
+
}, _a = 0.1, Fa = 0.3, Ba = 0.4, Da = 0.5, Pa = 4;
|
|
2482
|
+
class za extends we {
|
|
2483
2483
|
constructor({ padding: t, reboundMs: e } = {}) {
|
|
2484
2484
|
super(), M(this, "_visibleRange", { from: 0, to: 0 }), M(this, "_yRange", { min: 0, max: 0 }), M(this, "_autoScroll", !0), M(this, "padding"), M(this, "reboundMs"), M(this, "dataInterval", 6e4), M(this, "_dataStart", null), M(this, "_dataEnd", null), M(this, "_prevDataEnd", null), M(this, "_animating", !1), M(this, "animStartTime", 0), M(this, "animDuration", 0), M(this, "animFrom", { from: 0, to: 0 }), M(this, "animTo", { from: 0, to: 0 }), M(this, "_lastChartWidth", 0), this.padding = {
|
|
2485
|
-
top: (t == null ? void 0 : t.top) ??
|
|
2486
|
-
bottom: (t == null ? void 0 : t.bottom) ??
|
|
2487
|
-
right: (t == null ? void 0 : t.right) ??
|
|
2488
|
-
left: (t == null ? void 0 : t.left) ??
|
|
2485
|
+
top: (t == null ? void 0 : t.top) ?? Dt.top,
|
|
2486
|
+
bottom: (t == null ? void 0 : t.bottom) ?? Dt.bottom,
|
|
2487
|
+
right: (t == null ? void 0 : t.right) ?? Dt.right,
|
|
2488
|
+
left: (t == null ? void 0 : t.left) ?? Dt.left
|
|
2489
2489
|
}, this.reboundMs = e ?? 350;
|
|
2490
2490
|
}
|
|
2491
2491
|
/**
|
|
@@ -2521,10 +2521,10 @@ class Ya extends we {
|
|
|
2521
2521
|
/** Replace padding configuration. Only updates fields that are provided; others keep defaults. */
|
|
2522
2522
|
setPadding(t) {
|
|
2523
2523
|
this.padding = {
|
|
2524
|
-
top: (t == null ? void 0 : t.top) ??
|
|
2525
|
-
bottom: (t == null ? void 0 : t.bottom) ??
|
|
2526
|
-
right: (t == null ? void 0 : t.right) ??
|
|
2527
|
-
left: (t == null ? void 0 : t.left) ??
|
|
2524
|
+
top: (t == null ? void 0 : t.top) ?? Dt.top,
|
|
2525
|
+
bottom: (t == null ? void 0 : t.bottom) ?? Dt.bottom,
|
|
2526
|
+
right: (t == null ? void 0 : t.right) ?? Dt.right,
|
|
2527
|
+
left: (t == null ? void 0 : t.left) ?? Dt.left
|
|
2528
2528
|
};
|
|
2529
2529
|
}
|
|
2530
2530
|
/** Read the currently-resolved padding — used by `ChartInstance.setPadding`
|
|
@@ -2632,7 +2632,7 @@ class Ya extends we {
|
|
|
2632
2632
|
if (o <= 0) return;
|
|
2633
2633
|
const r = this.softMinRange, { left: h, right: d } = this.getSoftBounds(o, i), c = h !== null && d !== null ? d - h : this.softMaxRange();
|
|
2634
2634
|
let u = e;
|
|
2635
|
-
const g = r *
|
|
2635
|
+
const g = r * Ba;
|
|
2636
2636
|
if (e < 1 && o < r) {
|
|
2637
2637
|
const p = r - o, C = (1 - Math.min(1, p / g)) ** 2;
|
|
2638
2638
|
u = 1 - (1 - e) * C;
|
|
@@ -2667,7 +2667,7 @@ class Ya extends we {
|
|
|
2667
2667
|
this.cancelAnimation(), e > 0 && (this._lastChartWidth = e);
|
|
2668
2668
|
const { from: i, to: a } = this._visibleRange, n = a - i;
|
|
2669
2669
|
if (n <= 0) return;
|
|
2670
|
-
const { left: o, right: r } = this.getSoftBounds(n, e), h = n *
|
|
2670
|
+
const { left: o, right: r } = this.getSoftBounds(n, e), h = n * Fa;
|
|
2671
2671
|
let d = t;
|
|
2672
2672
|
if (t > 0 && r !== null) {
|
|
2673
2673
|
const f = Math.max(0, a - r);
|
|
@@ -2716,7 +2716,7 @@ class Ya extends we {
|
|
|
2716
2716
|
}
|
|
2717
2717
|
const g = Math.abs(h - e), f = Math.abs(d - i);
|
|
2718
2718
|
if (g < 1 && f < 1) return;
|
|
2719
|
-
const y = a *
|
|
2719
|
+
const y = a * _a;
|
|
2720
2720
|
let x = null, v = 0, p = 0;
|
|
2721
2721
|
u !== null && i - u > y ? (x = "right", v = i - u, p = u) : c !== null && c - e > y && (x = "left", v = c - e, p = c), this.reboundMs <= 0 ? this.applyRange(h, d) : this.animateTo(h, d, this.reboundMs), x !== null && this.emit("edgeReached", {
|
|
2722
2722
|
side: x,
|
|
@@ -2749,7 +2749,7 @@ class Ya extends we {
|
|
|
2749
2749
|
if (i <= 0) return;
|
|
2750
2750
|
const a = this.resolveHPad(this.padding.right, i, e), n = this._animating ? this.animTo.to : this._visibleRange.to, o = this._prevDataEnd !== null ? n - this._prevDataEnd : a, r = Math.max(0, Math.min(a, o)), h = t + r, d = h - i;
|
|
2751
2751
|
this._autoScroll = !0;
|
|
2752
|
-
const c =
|
|
2752
|
+
const c = Da * this.dataInterval, u = e > 0 ? Pa / e * i : c, g = Math.min(c, u);
|
|
2753
2753
|
if (this._animating) {
|
|
2754
2754
|
if (Math.abs(h - this.animTo.to) < g) return;
|
|
2755
2755
|
this.animFrom = { ...this._visibleRange }, this.animTo = { from: d, to: h }, this._prevDataEnd = this._dataEnd;
|
|
@@ -2769,7 +2769,7 @@ class Ya extends we {
|
|
|
2769
2769
|
function ce(s, t) {
|
|
2770
2770
|
return s === !1 || s === 0 ? 0 : s === void 0 ? t : s;
|
|
2771
2771
|
}
|
|
2772
|
-
function
|
|
2772
|
+
function Aa(s) {
|
|
2773
2773
|
if (s === !1)
|
|
2774
2774
|
return {
|
|
2775
2775
|
points: { enterMs: 0, smoothMs: 0, pulseMs: 0 },
|
|
@@ -2785,28 +2785,28 @@ function Ea(s) {
|
|
|
2785
2785
|
};
|
|
2786
2786
|
return { points: a, viewport: n };
|
|
2787
2787
|
}
|
|
2788
|
-
function
|
|
2788
|
+
function Wa(s) {
|
|
2789
2789
|
if (!s) return { monitor: null, ownsMonitor: !1, showHud: !1 };
|
|
2790
|
-
if (s === !0) return { monitor: new
|
|
2791
|
-
if (s instanceof
|
|
2790
|
+
if (s === !0) return { monitor: new Xe(), ownsMonitor: !0, showHud: !0 };
|
|
2791
|
+
if (s instanceof Xe) return { monitor: s, ownsMonitor: !1, showHud: !1 };
|
|
2792
2792
|
const { hud: t, monitor: e, ...i } = s, a = e !== void 0;
|
|
2793
2793
|
return {
|
|
2794
|
-
monitor: e ?? new
|
|
2794
|
+
monitor: e ?? new Xe(i),
|
|
2795
2795
|
ownsMonitor: !a,
|
|
2796
2796
|
showHud: t ?? !a
|
|
2797
2797
|
};
|
|
2798
2798
|
}
|
|
2799
|
-
let
|
|
2800
|
-
var st, $, Z, It, de, z, Q, fe, ct, Rt,
|
|
2801
|
-
class
|
|
2799
|
+
let Va = 0;
|
|
2800
|
+
var st, $, Z, It, de, z, Q, fe, ct, Rt, rt, At, Ke, ee, St, Re, Le, _t, pe, Ut, ye, Be, Gt, Lt, me, ge, J, Wt, Ri, _e, ve, be, ji, Ki, Fe, mt, gt, ie;
|
|
2801
|
+
class Ya extends we {
|
|
2802
2802
|
constructor(t, e) {
|
|
2803
2803
|
var i, a, n, o;
|
|
2804
|
-
super(), Y(this, J), Y(this, st), Y(this, $), Y(this, Z), Y(this, It), M(this, "timeScale"), M(this, "yScale"), Y(this, de), Y(this, z, []), Y(this, Q), Y(this, fe), Y(this, ct, 6e4), Y(this, Rt, null), Y(this,
|
|
2805
|
-
const r =
|
|
2806
|
-
_(this, Lt, r.monitor), _(this, me, r.ownsMonitor), _(this, st, new
|
|
2804
|
+
super(), Y(this, J), Y(this, st), Y(this, $), Y(this, Z), Y(this, It), M(this, "timeScale"), M(this, "yScale"), Y(this, de), Y(this, z, []), Y(this, Q), Y(this, fe), Y(this, ct, 6e4), Y(this, Rt, null), Y(this, rt, {}), Y(this, At, null), Y(this, Ke, !1), Y(this, ee, {}), Y(this, St, { left: "idle", right: "idle" }), Y(this, Re, { left: null, right: null }), Y(this, Le), Y(this, _t, 0), Y(this, pe, !1), Y(this, Ut, !1), Y(this, ye, !1), Y(this, Be, 0), Y(this, Gt), Y(this, Lt), Y(this, me, !1), Y(this, ge, null), Y(this, Fe, 0), Y(this, mt, 0), Y(this, gt, 0), Y(this, ie, !1), e != null && e.axis && (_(this, ee, e.axis), _(this, rt, { min: (i = e.axis.y) == null ? void 0 : i.min, max: (a = e.axis.y) == null ? void 0 : a.max })), _(this, Q, (e == null ? void 0 : e.theme) ?? Gi), _(this, fe, ((n = e == null ? void 0 : e.grid) == null ? void 0 : n.visible) !== !1), _(this, Gt, Aa(e == null ? void 0 : e.animations)), _(this, Le, e == null ? void 0 : e.onEdgeReached);
|
|
2805
|
+
const r = Wa(e == null ? void 0 : e.perf);
|
|
2806
|
+
_(this, Lt, r.monitor), _(this, me, r.ownsMonitor), _(this, st, new vs(t, l(this, Lt) ?? void 0)), _(this, $, new za({
|
|
2807
2807
|
padding: e == null ? void 0 : e.padding,
|
|
2808
2808
|
reboundMs: l(this, Gt).viewport.reboundMs
|
|
2809
|
-
})),
|
|
2809
|
+
})), zs(this, l(this, $)), this.timeScale = new Qs(), this.yScale = new na();
|
|
2810
2810
|
const h = l(this, Lt);
|
|
2811
2811
|
h ? (_(this, Z, new Me((c) => {
|
|
2812
2812
|
h.resetDrawCalls("main");
|
|
@@ -2816,9 +2816,9 @@ class Oa extends we {
|
|
|
2816
2816
|
h.resetDrawCalls("overlay");
|
|
2817
2817
|
const u = performance.now();
|
|
2818
2818
|
this.renderOverlay(c), h.recordFrame("overlay", performance.now() - u, c);
|
|
2819
|
-
})), r.showHud && _(this, ge, new
|
|
2819
|
+
})), r.showHud && _(this, ge, new $s(t, h))) : (_(this, Z, new Me((c) => this.renderMain(c))), _(this, It, new Me((c) => this.renderOverlay(c))));
|
|
2820
2820
|
const d = (e == null ? void 0 : e.interactive) !== !1;
|
|
2821
|
-
_(this, de, d ? new
|
|
2821
|
+
_(this, de, d ? new Ds(l(this, st).canvas, l(this, $), this.timeScale, this.yScale) : null), l(this, $).on("change", () => {
|
|
2822
2822
|
this.syncScales(), l(this, Z).markDirty(), this.emit("viewportChange");
|
|
2823
2823
|
}), l(this, $).on("edgeReached", (c) => {
|
|
2824
2824
|
var u;
|
|
@@ -2826,7 +2826,7 @@ class Oa extends we {
|
|
|
2826
2826
|
}), l(this, st).on("resize", () => {
|
|
2827
2827
|
this.updateScales(!0), this.renderMain(), this.emit("viewportChange");
|
|
2828
2828
|
}), (o = l(this, de)) == null || o.on("crosshairMove", (c) => {
|
|
2829
|
-
_(this, Rt, c), l(this, It).markDirty(), this.emit("crosshairMove", c), X(this, J,
|
|
2829
|
+
_(this, Rt, c), l(this, It).markDirty(), this.emit("crosshairMove", c), X(this, J, Ki).call(this, c);
|
|
2830
2830
|
});
|
|
2831
2831
|
}
|
|
2832
2832
|
get yAxisWidth() {
|
|
@@ -2850,7 +2850,7 @@ class Oa extends we {
|
|
|
2850
2850
|
}
|
|
2851
2851
|
/** Add a candlestick (OHLC) series and return its unique ID. */
|
|
2852
2852
|
addCandlestickSeries(t) {
|
|
2853
|
-
const e = new
|
|
2853
|
+
const e = new Ai(), i = new ya(e, {
|
|
2854
2854
|
upColor: l(this, Q).candlestick.upColor,
|
|
2855
2855
|
downColor: l(this, Q).candlestick.downColor,
|
|
2856
2856
|
wickUpColor: l(this, Q).candlestick.wickUpColor,
|
|
@@ -2864,7 +2864,7 @@ class Oa extends we {
|
|
|
2864
2864
|
}
|
|
2865
2865
|
/** Add a line series and return its unique ID. */
|
|
2866
2866
|
addLineSeries(t) {
|
|
2867
|
-
const { layers: e, ...i } = t ?? {}, a = e ?? 1, n = new
|
|
2867
|
+
const { layers: e, ...i } = t ?? {}, a = e ?? 1, n = new wa(a, {
|
|
2868
2868
|
colors: a === 1 ? [l(this, Q).line.color] : l(this, Q).seriesColors.slice(0, a),
|
|
2869
2869
|
strokeWidth: l(this, Q).line.width,
|
|
2870
2870
|
area: { visible: !0 },
|
|
@@ -2876,7 +2876,7 @@ class Oa extends we {
|
|
|
2876
2876
|
}
|
|
2877
2877
|
/** Add a bar series and return its unique ID. */
|
|
2878
2878
|
addBarSeries(t) {
|
|
2879
|
-
const { layers: e, ...i } = t ?? {}, a = e ?? 1, n = new
|
|
2879
|
+
const { layers: e, ...i } = t ?? {}, a = e ?? 1, n = new fa(a, {
|
|
2880
2880
|
colors: l(this, Q).seriesColors.slice(0, a),
|
|
2881
2881
|
barWidthRatio: 0.6,
|
|
2882
2882
|
...X(this, J, _e).call(this, "bar"),
|
|
@@ -2893,7 +2893,7 @@ class Oa extends we {
|
|
|
2893
2893
|
/** Remove a series by ID and clean up its resources. */
|
|
2894
2894
|
removeSeries(t) {
|
|
2895
2895
|
const e = l(this, z).findIndex((i) => i.id === t);
|
|
2896
|
-
e >= 0 && (l(this, z)[e].renderer.dispose(), l(this, z).splice(e, 1), _(this,
|
|
2896
|
+
e >= 0 && (l(this, z)[e].renderer.dispose(), l(this, z).splice(e, 1), _(this, At, null), this.updateViewportPadding(), l(this, Z).markDirty(), this.emit("seriesChange"), X(this, J, Wt).call(this));
|
|
2897
2897
|
}
|
|
2898
2898
|
/**
|
|
2899
2899
|
* Replace all data for a series.
|
|
@@ -2927,25 +2927,25 @@ class Oa extends we {
|
|
|
2927
2927
|
const a = i.label, n = i.renderer.getLayerColors().slice();
|
|
2928
2928
|
i.renderer.updateOptions({ ...e, ...X(this, J, ve).call(this) }), "label" in e && typeof e.label == "string" && (i.label = e.label), l(this, Z).markDirty();
|
|
2929
2929
|
const o = i.renderer.getLayerColors(), r = n.length !== o.length || n.some((d, c) => d !== o[c]), h = a !== i.label;
|
|
2930
|
-
(r || h) && X(this, J,
|
|
2930
|
+
(r || h) && X(this, J, Wt).call(this);
|
|
2931
2931
|
}
|
|
2932
2932
|
/**
|
|
2933
2933
|
* Batch multiple updates: suppress recomputes until `fn` returns. Exceptions
|
|
2934
2934
|
* inside `fn` still flush the batch so counters don't leak across calls.
|
|
2935
2935
|
*/
|
|
2936
2936
|
batch(t) {
|
|
2937
|
-
|
|
2937
|
+
Ue(this, _t)._++;
|
|
2938
2938
|
try {
|
|
2939
2939
|
t();
|
|
2940
2940
|
} finally {
|
|
2941
|
-
--
|
|
2941
|
+
--Ue(this, _t)._ <= 0 && (_(this, _t, 0), l(this, pe) ? (_(this, pe, !1), _(this, Ut, !1), this.onDataChanged()) : l(this, Ut) && (_(this, Ut, !1), this.updateYRange(!0), l(this, Z).markDirty()), l(this, ye) && (_(this, ye, !1), this.emit("overlayChange")));
|
|
2942
2942
|
}
|
|
2943
2943
|
}
|
|
2944
2944
|
/** Show or hide a series. Hidden series are not rendered and excluded from Y-range. */
|
|
2945
2945
|
setSeriesVisible(t, e) {
|
|
2946
2946
|
const i = l(this, z).find((a) => a.id === t);
|
|
2947
2947
|
if (!(!i || i.visible === e)) {
|
|
2948
|
-
if (i.visible = e, X(this, J,
|
|
2948
|
+
if (i.visible = e, X(this, J, Wt).call(this), l(this, _t) > 0) {
|
|
2949
2949
|
_(this, Ut, !0);
|
|
2950
2950
|
return;
|
|
2951
2951
|
}
|
|
@@ -2960,7 +2960,7 @@ class Oa extends we {
|
|
|
2960
2960
|
setLayerVisible(t, e, i) {
|
|
2961
2961
|
const a = l(this, z).find((n) => n.id === t);
|
|
2962
2962
|
if (a && !(a.renderer.getLayerCount() <= 1) && a.renderer.isLayerVisible(e) !== i) {
|
|
2963
|
-
if (a.renderer.setLayerVisible(e, i), X(this, J,
|
|
2963
|
+
if (a.renderer.setLayerVisible(e, i), X(this, J, Wt).call(this), l(this, _t) > 0) {
|
|
2964
2964
|
_(this, Ut, !0);
|
|
2965
2965
|
return;
|
|
2966
2966
|
}
|
|
@@ -3056,7 +3056,7 @@ class Oa extends we {
|
|
|
3056
3056
|
return n != null && n.visible ? ((a = (i = n.renderer).getLayerSnapshots) == null ? void 0 : a.call(i, e, l(this, ct))) ?? null : null;
|
|
3057
3057
|
}
|
|
3058
3058
|
getSeriesIds() {
|
|
3059
|
-
return l(this,
|
|
3059
|
+
return l(this, At) || _(this, At, l(this, z).map((t) => t.id)), l(this, At).slice();
|
|
3060
3060
|
}
|
|
3061
3061
|
/**
|
|
3062
3062
|
* Type of a registered series, or `null` for unknown ids. `'pie'` for
|
|
@@ -3167,7 +3167,7 @@ class Oa extends we {
|
|
|
3167
3167
|
_(this, Q, t);
|
|
3168
3168
|
for (const i of l(this, z))
|
|
3169
3169
|
i.renderer.applyTheme(t, e);
|
|
3170
|
-
l(this, Z).markDirty(), X(this, J,
|
|
3170
|
+
l(this, Z).markDirty(), X(this, J, Wt).call(this);
|
|
3171
3171
|
}
|
|
3172
3172
|
getTheme() {
|
|
3173
3173
|
return l(this, Q);
|
|
@@ -3176,7 +3176,7 @@ class Oa extends we {
|
|
|
3176
3176
|
setAxis(t) {
|
|
3177
3177
|
var e, i;
|
|
3178
3178
|
const a = this.yAxisWidth, n = this.xAxisHeight;
|
|
3179
|
-
_(this, ee, t), _(this,
|
|
3179
|
+
_(this, ee, t), _(this, rt, { min: (e = t.y) == null ? void 0 : e.min, max: (i = t.y) == null ? void 0 : i.max }), _(this, ie, !1), this.updateYRange(!0), (this.yAxisWidth !== a || this.xAxisHeight !== n) && this.updateScales(!0), l(this, Z).markDirty();
|
|
3180
3180
|
}
|
|
3181
3181
|
/**
|
|
3182
3182
|
* Apply label-density knobs driven by `<YAxis labelCount=… minLabelSpacing=…>`
|
|
@@ -3214,12 +3214,12 @@ class Oa extends we {
|
|
|
3214
3214
|
* — vertical padding only affects the Y-range computation, so touching it
|
|
3215
3215
|
* shouldn't reset the user's zoom / auto-scroll state. This matters when
|
|
3216
3216
|
* a wrapper re-applies padding reactively (e.g. in response to a Title /
|
|
3217
|
-
*
|
|
3217
|
+
* InfoBar ResizeObserver).
|
|
3218
3218
|
*/
|
|
3219
3219
|
setPadding(t) {
|
|
3220
3220
|
const e = l(this, $).getPadding();
|
|
3221
3221
|
l(this, $).setPadding(t);
|
|
3222
|
-
const i = l(this, $).getPadding(), a = !
|
|
3222
|
+
const i = l(this, $).getPadding(), a = !Li(e.left, i.left) || !Li(e.right, i.right), n = e.top !== i.top || e.bottom !== i.bottom;
|
|
3223
3223
|
if (a) {
|
|
3224
3224
|
const { first: o, last: r } = this.getDataBounds();
|
|
3225
3225
|
if (o !== void 0 && r !== void 0) {
|
|
@@ -3251,7 +3251,7 @@ class Oa extends we {
|
|
|
3251
3251
|
}
|
|
3252
3252
|
/** Notify chart that a YLabel is present (affects right padding). */
|
|
3253
3253
|
setYLabel(t) {
|
|
3254
|
-
_(this,
|
|
3254
|
+
_(this, Ke, t), this.updateViewportPadding();
|
|
3255
3255
|
}
|
|
3256
3256
|
updateViewportPadding() {
|
|
3257
3257
|
}
|
|
@@ -3259,7 +3259,7 @@ class Oa extends we {
|
|
|
3259
3259
|
destroy() {
|
|
3260
3260
|
var t, e, i;
|
|
3261
3261
|
for (const a of l(this, z)) a.renderer.dispose();
|
|
3262
|
-
_(this, z, []), _(this,
|
|
3262
|
+
_(this, z, []), _(this, At, null), l(this, $).destroy(), l(this, Z).destroy(), l(this, It).destroy(), (t = l(this, de)) == null || t.destroy(), l(this, st).destroy(), (e = l(this, ge)) == null || e.destroy(), _(this, ge, null), l(this, me) && ((i = l(this, Lt)) == null || i.destroy()), _(this, Lt, null), _(this, me, !1), this.removeAllListeners();
|
|
3263
3263
|
}
|
|
3264
3264
|
/** The attached performance monitor, or `null` when instrumentation is disabled. */
|
|
3265
3265
|
getPerfMonitor() {
|
|
@@ -3291,7 +3291,7 @@ class Oa extends we {
|
|
|
3291
3291
|
const { from: n, to: o } = l(this, $).visibleRange, r = n === 0 && o === 0, h = l(this, st).size.media.width - this.yAxisWidth;
|
|
3292
3292
|
r ? l(this, $).fitToData(t, e, h, !1) : a && l(this, $).autoScroll ? l(this, $).fitToData(t, e, h, !0) : !a && l(this, $).autoScroll && l(this, $).scrollToEnd(e, h);
|
|
3293
3293
|
}
|
|
3294
|
-
this.updateYRange(a), this.syncScales(), l(this, Z).markDirty(), this.emit("dataUpdate"), X(this, J,
|
|
3294
|
+
this.updateYRange(a), this.syncScales(), l(this, Z).markDirty(), this.emit("dataUpdate"), X(this, J, Wt).call(this);
|
|
3295
3295
|
}
|
|
3296
3296
|
updateDataInterval() {
|
|
3297
3297
|
for (const t of l(this, z)) {
|
|
@@ -3299,14 +3299,14 @@ class Oa extends we {
|
|
|
3299
3299
|
const e = t.store.getAll();
|
|
3300
3300
|
if (e.length >= 2) {
|
|
3301
3301
|
const i = e.slice(0, 20).map((a) => a.time);
|
|
3302
|
-
_(this, ct,
|
|
3302
|
+
_(this, ct, Gs(i)), l(this, $).setDataInterval(l(this, ct));
|
|
3303
3303
|
break;
|
|
3304
3304
|
}
|
|
3305
3305
|
}
|
|
3306
3306
|
}
|
|
3307
3307
|
updateYRange(t = !1) {
|
|
3308
3308
|
let e = 1 / 0, i = -1 / 0;
|
|
3309
|
-
const a = l(this, $).visibleRange, n = l(this,
|
|
3309
|
+
const a = l(this, $).visibleRange, n = l(this, rt).min !== void 0 && l(this, rt).min !== "auto" && typeof l(this, rt).min != "number" || l(this, rt).max !== void 0 && l(this, rt).max !== "auto" && typeof l(this, rt).max != "number" ? [] : null;
|
|
3310
3310
|
for (const c of l(this, z)) {
|
|
3311
3311
|
if (!c.visible) continue;
|
|
3312
3312
|
if (c.renderer.getValueRange) {
|
|
@@ -3331,7 +3331,7 @@ class Oa extends we {
|
|
|
3331
3331
|
_(this, ie, !1);
|
|
3332
3332
|
return;
|
|
3333
3333
|
}
|
|
3334
|
-
e = this.resolveBound(l(this,
|
|
3334
|
+
e = this.resolveBound(l(this, rt).min, e, i, n ?? [], "min"), i = this.resolveBound(l(this, rt).max, i, e, n ?? [], "max");
|
|
3335
3335
|
const o = l(this, Gt).viewport.yAxisMs;
|
|
3336
3336
|
if (!l(this, ie) || t || o <= 0)
|
|
3337
3337
|
_(this, mt, e), _(this, gt, i), _(this, ie, !0);
|
|
@@ -3341,7 +3341,7 @@ class Oa extends we {
|
|
|
3341
3341
|
const u = Math.max(Math.abs(l(this, gt) - l(this, mt)) * 1e-4, 1e-3);
|
|
3342
3342
|
(Math.abs(l(this, mt) - e) > u || Math.abs(l(this, gt) - i) > u) && l(this, Z).markDirty();
|
|
3343
3343
|
}
|
|
3344
|
-
const r = l(this,
|
|
3344
|
+
const r = l(this, rt).min !== void 0 && l(this, rt).min !== "auto", h = l(this, rt).max !== void 0 && l(this, rt).max !== "auto", d = l(this, st).size.media.height - this.xAxisHeight;
|
|
3345
3345
|
l(this, $).setYRange(l(this, mt), l(this, gt), d, r, h);
|
|
3346
3346
|
}
|
|
3347
3347
|
/** Resolve an {@link AxisBound} to a concrete numeric value. */
|
|
@@ -3380,7 +3380,7 @@ class Oa extends we {
|
|
|
3380
3380
|
const i = typeof t == "number" ? t : performance.now();
|
|
3381
3381
|
l(this, $).tick(i) && l(this, Z).markDirty(), this.updateScales(), l(this, st).useMainLayer((a) => {
|
|
3382
3382
|
const { context: n, bitmapSize: o } = a, r = (e.media.width - this.yAxisWidth) * e.horizontalPixelRatio, h = (e.media.height - this.xAxisHeight) * e.verticalPixelRatio;
|
|
3383
|
-
n.clearRect(0, 0, o.width, o.height), n.save(), n.beginPath(), n.rect(0, 0, r, h), n.clip(), l(this, fe) &&
|
|
3383
|
+
n.clearRect(0, 0, o.width, o.height), n.save(), n.beginPath(), n.rect(0, 0, r, h), n.clip(), l(this, fe) && Rs(a, this.timeScale, this.yScale, l(this, Q), l(this, ct));
|
|
3384
3384
|
const d = l(this, $).getPadding(), c = { top: d.top, bottom: d.bottom }, u = l(this, Lt);
|
|
3385
3385
|
for (const g of l(this, z)) {
|
|
3386
3386
|
if (!g.visible) continue;
|
|
@@ -3423,9 +3423,9 @@ class Oa extends we {
|
|
|
3423
3423
|
var d, c;
|
|
3424
3424
|
if (!l(this, Rt) && !n && !r) return;
|
|
3425
3425
|
const u = (a.media.width - this.yAxisWidth) * a.horizontalPixelRatio, g = (a.media.height - this.xAxisHeight) * a.verticalPixelRatio;
|
|
3426
|
-
if (h.context.save(), h.context.beginPath(), h.context.rect(0, 0, u, g), h.context.clip(), l(this, Rt) && X(this, J,
|
|
3426
|
+
if (h.context.save(), h.context.beginPath(), h.context.rect(0, 0, u, g), h.context.clip(), l(this, Rt) && X(this, J, ji).call(this)) {
|
|
3427
3427
|
const x = l(this, Rt).mediaX * a.horizontalPixelRatio, v = l(this, Rt).mediaY * a.verticalPixelRatio;
|
|
3428
|
-
|
|
3428
|
+
bs(h, x, v, l(this, Q));
|
|
3429
3429
|
}
|
|
3430
3430
|
const f = l(this, $).getPadding(), y = { top: f.top, bottom: f.bottom };
|
|
3431
3431
|
for (const x of l(this, z))
|
|
@@ -3457,7 +3457,7 @@ class Oa extends we {
|
|
|
3457
3457
|
const n = l(this, St)[a];
|
|
3458
3458
|
if (n === "idle" || n === "has-more") continue;
|
|
3459
3459
|
const o = this.resolveEdgeBoundary(a);
|
|
3460
|
-
o !== null &&
|
|
3460
|
+
o !== null && ks({
|
|
3461
3461
|
scope: t,
|
|
3462
3462
|
timeScale: this.timeScale,
|
|
3463
3463
|
theme: l(this, Q),
|
|
@@ -3483,7 +3483,7 @@ class Oa extends we {
|
|
|
3483
3483
|
return t === "left" ? i ?? null : a ?? null;
|
|
3484
3484
|
}
|
|
3485
3485
|
}
|
|
3486
|
-
st = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), de = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(),
|
|
3486
|
+
st = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), de = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), rt = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), ee = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), _t = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap(), Ut = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakSet(), /**
|
|
3487
3487
|
* Bump overlay version + emit `overlayChange`. Call from every mutation
|
|
3488
3488
|
* path whose output overlay components care about: data, series list,
|
|
3489
3489
|
* per-series/layer visibility, options, theme.
|
|
@@ -3495,8 +3495,8 @@ st = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), Z = /* @_
|
|
|
3495
3495
|
* `setSeriesVisible` / `setLayerVisible` calls — produce one overlay
|
|
3496
3496
|
* render instead of N.
|
|
3497
3497
|
*/
|
|
3498
|
-
|
|
3499
|
-
if (
|
|
3498
|
+
Wt = function() {
|
|
3499
|
+
if (Ue(this, Be)._++, l(this, _t) > 0) {
|
|
3500
3500
|
_(this, ye, !0);
|
|
3501
3501
|
return;
|
|
3502
3502
|
}
|
|
@@ -3506,12 +3506,12 @@ Vt = function() {
|
|
|
3506
3506
|
* otherwise generate a new auto ID. Auto-generated IDs never collide with each other
|
|
3507
3507
|
* or with user-provided IDs because they use a monotonically increasing counter.
|
|
3508
3508
|
*/
|
|
3509
|
-
|
|
3509
|
+
Ri = function(s) {
|
|
3510
3510
|
if (s && !l(this, z).some((e) => e.id === s))
|
|
3511
3511
|
return s;
|
|
3512
3512
|
let t;
|
|
3513
3513
|
do
|
|
3514
|
-
t = `series_${++
|
|
3514
|
+
t = `series_${++Va}`;
|
|
3515
3515
|
while (l(this, z).some((e) => e.id === t));
|
|
3516
3516
|
return t;
|
|
3517
3517
|
}, /**
|
|
@@ -3544,14 +3544,14 @@ ve = function() {
|
|
|
3544
3544
|
*/
|
|
3545
3545
|
be = function(s, t, e) {
|
|
3546
3546
|
var i;
|
|
3547
|
-
const a = X(this, J,
|
|
3548
|
-
return (i = s.onDataChanged) == null || i.call(s, () => this.onDataChanged()), l(this, z).push({ id: a, label: e.label, renderer: s, store: t, visible: !0 }), _(this,
|
|
3547
|
+
const a = X(this, J, Ri).call(this, e.id);
|
|
3548
|
+
return (i = s.onDataChanged) == null || i.call(s, () => this.onDataChanged()), l(this, z).push({ id: a, label: e.label, renderer: s, store: t, visible: !0 }), _(this, At, null), this.updateViewportPadding(), this.emit("seriesChange"), X(this, J, Wt).call(this), a;
|
|
3549
3549
|
}, /**
|
|
3550
3550
|
* True if any visible series is non-pie (line / bar / candlestick). Used
|
|
3551
3551
|
* to gate crosshair rendering — a pie-only chart has no meaningful x/y
|
|
3552
3552
|
* coordinate system, so the dashed hairlines would just be visual noise.
|
|
3553
3553
|
*/
|
|
3554
|
-
|
|
3554
|
+
ji = function() {
|
|
3555
3555
|
for (const s of l(this, z))
|
|
3556
3556
|
if (s.visible && !(s.renderer instanceof Ie))
|
|
3557
3557
|
return !0;
|
|
@@ -3560,7 +3560,7 @@ Ji = function() {
|
|
|
3560
3560
|
* Dispatch a crosshair move to every renderer that supports spatial hover
|
|
3561
3561
|
* (currently: pie). Any change in hover index schedules a main-layer redraw.
|
|
3562
3562
|
*/
|
|
3563
|
-
|
|
3563
|
+
Ki = function(s) {
|
|
3564
3564
|
const t = l(this, st).size, e = l(this, $).getPadding(), i = {
|
|
3565
3565
|
top: e.top * t.verticalPixelRatio,
|
|
3566
3566
|
bottom: e.bottom * t.verticalPixelRatio
|
|
@@ -3577,26 +3577,26 @@ qi = function(s) {
|
|
|
3577
3577
|
}
|
|
3578
3578
|
a && l(this, Z).markDirty();
|
|
3579
3579
|
}, Fe = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap();
|
|
3580
|
-
function
|
|
3580
|
+
function Li(s, t) {
|
|
3581
3581
|
return typeof s == "number" && typeof t == "number" ? s === t : typeof s == "object" && typeof t == "object" ? s.intervals === t.intervals : !1;
|
|
3582
3582
|
}
|
|
3583
|
-
const
|
|
3584
|
-
function
|
|
3583
|
+
const Je = /* @__PURE__ */ new WeakMap();
|
|
3584
|
+
function Ji(s, t) {
|
|
3585
3585
|
var e;
|
|
3586
|
-
return (e =
|
|
3586
|
+
return (e = Je.get(s)) == null ? void 0 : e.get(t);
|
|
3587
3587
|
}
|
|
3588
|
-
function
|
|
3589
|
-
let i =
|
|
3590
|
-
i || (i = /* @__PURE__ */ new Map(),
|
|
3588
|
+
function qi(s, t, e) {
|
|
3589
|
+
let i = Je.get(s);
|
|
3590
|
+
i || (i = /* @__PURE__ */ new Map(), Je.set(s, i)), i.set(t, e);
|
|
3591
3591
|
}
|
|
3592
|
-
function
|
|
3592
|
+
function _i(s) {
|
|
3593
3593
|
return "close" in s ? s.close : s.value;
|
|
3594
3594
|
}
|
|
3595
|
-
function
|
|
3595
|
+
function Qi(s, t) {
|
|
3596
3596
|
if (t === "none" || s.length <= 1) return s;
|
|
3597
3597
|
const e = [...s];
|
|
3598
3598
|
return e.sort((i, a) => {
|
|
3599
|
-
const n =
|
|
3599
|
+
const n = _i(i.data), o = _i(a.data);
|
|
3600
3600
|
return t === "asc" ? n - o : o - n;
|
|
3601
3601
|
}), e;
|
|
3602
3602
|
}
|
|
@@ -3611,8 +3611,8 @@ function De(s) {
|
|
|
3611
3611
|
};
|
|
3612
3612
|
return Object.freeze(e);
|
|
3613
3613
|
}
|
|
3614
|
-
function
|
|
3615
|
-
const e = t.sort ?? "none", i = s.getOverlayVersion(), a =
|
|
3614
|
+
function Zi(s, t) {
|
|
3615
|
+
const e = t.sort ?? "none", i = s.getOverlayVersion(), a = Ji(s, t.cacheKey);
|
|
3616
3616
|
if (a && a.version === i && a.time === t.time && a.sort === e)
|
|
3617
3617
|
return a.data;
|
|
3618
3618
|
const n = [];
|
|
@@ -3646,11 +3646,11 @@ function es(s, t) {
|
|
|
3646
3646
|
})
|
|
3647
3647
|
);
|
|
3648
3648
|
}
|
|
3649
|
-
const o = Object.freeze(
|
|
3650
|
-
return
|
|
3649
|
+
const o = Object.freeze(Qi(n, e));
|
|
3650
|
+
return qi(s, t.cacheKey, { version: i, time: t.time, sort: e, data: o }), o;
|
|
3651
3651
|
}
|
|
3652
|
-
function
|
|
3653
|
-
const e = t.sort ?? "none", i = s.getOverlayVersion(), a =
|
|
3652
|
+
function Ea(s, t) {
|
|
3653
|
+
const e = t.sort ?? "none", i = s.getOverlayVersion(), a = Ji(s, t.cacheKey);
|
|
3654
3654
|
if (a && a.version === i && a.time === null && a.sort === e)
|
|
3655
3655
|
return a.data;
|
|
3656
3656
|
const n = [];
|
|
@@ -3682,10 +3682,10 @@ function Xa(s, t) {
|
|
|
3682
3682
|
})
|
|
3683
3683
|
);
|
|
3684
3684
|
}
|
|
3685
|
-
const o = Object.freeze(
|
|
3686
|
-
return
|
|
3685
|
+
const o = Object.freeze(Qi(n, e));
|
|
3686
|
+
return qi(s, t.cacheKey, { version: i, time: null, sort: e, data: o }), o;
|
|
3687
3687
|
}
|
|
3688
|
-
const
|
|
3688
|
+
const Ln = {
|
|
3689
3689
|
background: "#ffffff",
|
|
3690
3690
|
chartGradient: ["#ffffff", "#f5f6f8"],
|
|
3691
3691
|
typography: {
|
|
@@ -3742,16 +3742,16 @@ const Pn = {
|
|
|
3742
3742
|
borderColor: "rgba(0, 0, 0, 0.1)"
|
|
3743
3743
|
}
|
|
3744
3744
|
};
|
|
3745
|
-
function
|
|
3745
|
+
function $a(s) {
|
|
3746
3746
|
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;
|
|
3747
3747
|
}
|
|
3748
3748
|
function et(s) {
|
|
3749
3749
|
var t, e, i, a, n, o, r, h, d, c, u, g, f, y, x, v, p, C, b, w, S, T, m, k, I, R, L, V, H;
|
|
3750
|
-
const { background: A, name: O = "Custom", description:
|
|
3750
|
+
const { background: A, name: O = "Custom", description: ot, fontUrl: it = null } = s, q = $a(A), pt = q ? "#d1d4dc" : "#24292f", Bt = q ? "#787b86" : "#8b949e", yt = q ? "#26a69a" : "#2da44e", $t = q ? "#ef5350" : "#cf222e", jt = q ? "#2962ff" : "#0969da", Kt = q ? "rgba(42,46,57,0.6)" : "rgba(200,200,200,0.5)", kt = q ? "rgba(150,150,150,0.5)" : "rgba(170,170,170,0.3)", xt = q ? ke(A, 0.1) : Fi(A, 0.05), Tt = q ? ue(A, 0.92) : ue(A, 0.95), Jt = q ? ue(ke(A, 0.15), 0.6) : "rgba(200,200,200,0.5)", Ht = Ve, Ot = ((t = s.candlestick) == null ? void 0 : t.upColor) ?? yt, Ce = ((e = s.candlestick) == null ? void 0 : e.downColor) ?? $t, he = ((i = s.line) == null ? void 0 : i.color) ?? jt, li = ((a = s.tooltip) == null ? void 0 : a.textColor) ?? pt, cs = ((n = s.axis) == null ? void 0 : n.textColor) ?? Bt, us = ((o = s.typography) == null ? void 0 : o.fontFamily) ?? Ht, ds = {
|
|
3751
3751
|
background: A,
|
|
3752
|
-
chartGradient: s.chartGradient ?? (q ? [ke(A, 0.04),
|
|
3752
|
+
chartGradient: s.chartGradient ?? (q ? [ke(A, 0.04), Fi(A, 0.06)] : [ke(A, 0.06), A]),
|
|
3753
3753
|
typography: {
|
|
3754
|
-
fontFamily:
|
|
3754
|
+
fontFamily: us,
|
|
3755
3755
|
fontSize: ((r = s.typography) == null ? void 0 : r.fontSize) ?? 12,
|
|
3756
3756
|
axisFontSize: ((h = s.typography) == null ? void 0 : h.axisFontSize) ?? 10,
|
|
3757
3757
|
yFontSize: ((d = s.typography) == null ? void 0 : d.yFontSize) ?? 11,
|
|
@@ -3783,7 +3783,7 @@ function et(s) {
|
|
|
3783
3783
|
labelBackground: ((T = s.crosshair) == null ? void 0 : T.labelBackground) ?? xt,
|
|
3784
3784
|
labelTextColor: ((m = s.crosshair) == null ? void 0 : m.labelTextColor) ?? li
|
|
3785
3785
|
},
|
|
3786
|
-
axis: { textColor:
|
|
3786
|
+
axis: { textColor: cs },
|
|
3787
3787
|
yLabel: {
|
|
3788
3788
|
upBackground: ((k = s.yLabel) == null ? void 0 : k.upBackground) ?? Ot,
|
|
3789
3789
|
downBackground: ((I = s.yLabel) == null ? void 0 : I.downBackground) ?? Ce,
|
|
@@ -3796,7 +3796,7 @@ function et(s) {
|
|
|
3796
3796
|
borderColor: ((H = s.tooltip) == null ? void 0 : H.borderColor) ?? Jt
|
|
3797
3797
|
}
|
|
3798
3798
|
};
|
|
3799
|
-
return { name: O, description:
|
|
3799
|
+
return { name: O, description: ot, fontUrl: it, dark: q, theme: ds };
|
|
3800
3800
|
}
|
|
3801
3801
|
function ue(s, t) {
|
|
3802
3802
|
const e = parseInt(s.slice(1, 3), 16), i = parseInt(s.slice(3, 5), 16), a = parseInt(s.slice(5, 7), 16);
|
|
@@ -3807,12 +3807,12 @@ function ke(s, t) {
|
|
|
3807
3807
|
const e = Math.min(255, Math.round(parseInt(s.slice(1, 3), 16) + 255 * t)), i = Math.min(255, Math.round(parseInt(s.slice(3, 5), 16) + 255 * t)), a = Math.min(255, Math.round(parseInt(s.slice(5, 7), 16) + 255 * t));
|
|
3808
3808
|
return `#${e.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}${a.toString(16).padStart(2, "0")}`;
|
|
3809
3809
|
}
|
|
3810
|
-
function
|
|
3810
|
+
function Fi(s, t) {
|
|
3811
3811
|
if (!s.startsWith("#")) return s;
|
|
3812
3812
|
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))), a = Math.max(0, Math.round(parseInt(s.slice(5, 7), 16) * (1 - t)));
|
|
3813
3813
|
return `#${e.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}${a.toString(16).padStart(2, "0")}`;
|
|
3814
3814
|
}
|
|
3815
|
-
const
|
|
3815
|
+
const Ae = "'JetBrains Mono', 'Fira Code', monospace", We = "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap", Ve = "'Outfit', -apple-system, BlinkMacSystemFont, sans-serif", si = "https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600&display=swap", ts = "'Roboto Mono', monospace", es = "https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;600&display=swap", Ha = "'IBM Plex Mono', monospace", Oa = "https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap", ai = "'Fira Code', monospace", ni = "https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap", is = "'Source Code Pro', monospace", ss = "https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500;600&display=swap", Xa = "'Space Mono', monospace", Na = "https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap", oi = "'Plus Jakarta Sans', sans-serif", ri = "https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap", Ua = "'Caveat', 'Comic Sans MS', cursive", Ga = "https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&display=swap", _n = et({
|
|
3816
3816
|
name: "Andromeda",
|
|
3817
3817
|
description: "Deep space purples and cosmic blues",
|
|
3818
3818
|
background: "#23262e",
|
|
@@ -3835,9 +3835,9 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
3835
3835
|
crosshair: { color: "rgba(102,94,110,0.4)", labelBackground: "#2e3038" },
|
|
3836
3836
|
axis: { textColor: "#665e6e" },
|
|
3837
3837
|
tooltip: { background: "rgba(35,38,46,0.92)", textColor: "#d5ced9", borderColor: "rgba(50,48,56,0.6)" },
|
|
3838
|
-
typography: { fontFamily:
|
|
3839
|
-
fontUrl:
|
|
3840
|
-
}),
|
|
3838
|
+
typography: { fontFamily: ts },
|
|
3839
|
+
fontUrl: es
|
|
3840
|
+
}), Fn = et({
|
|
3841
3841
|
name: "Ayu Mirage",
|
|
3842
3842
|
description: "Warm dark with amber accents",
|
|
3843
3843
|
background: "#1f2430",
|
|
@@ -3860,9 +3860,9 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
3860
3860
|
crosshair: { color: "rgba(92,103,115,0.4)", labelBackground: "#2a3040" },
|
|
3861
3861
|
axis: { textColor: "#5c6773" },
|
|
3862
3862
|
tooltip: { background: "rgba(31,36,48,0.92)", textColor: "#cbccc6", borderColor: "rgba(42,48,60,0.6)" },
|
|
3863
|
-
typography: { fontFamily:
|
|
3863
|
+
typography: { fontFamily: Ve },
|
|
3864
3864
|
fontUrl: si
|
|
3865
|
-
}),
|
|
3865
|
+
}), Bn = et({
|
|
3866
3866
|
name: "Catppuccin",
|
|
3867
3867
|
description: "Pastel tones on a mocha base",
|
|
3868
3868
|
background: "#1e1e2e",
|
|
@@ -3885,9 +3885,9 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
3885
3885
|
crosshair: { color: "rgba(108,112,134,0.4)", labelBackground: "#313244" },
|
|
3886
3886
|
axis: { textColor: "#6c7086" },
|
|
3887
3887
|
tooltip: { background: "rgba(30,30,46,0.92)", textColor: "#cdd6f4", borderColor: "rgba(49,50,68,0.6)" },
|
|
3888
|
-
typography: { fontFamily:
|
|
3888
|
+
typography: { fontFamily: Ve },
|
|
3889
3889
|
fontUrl: si
|
|
3890
|
-
}),
|
|
3890
|
+
}), Dn = et({
|
|
3891
3891
|
name: "Dracula",
|
|
3892
3892
|
description: "Classic dark with vibrant highlights",
|
|
3893
3893
|
background: "#282a36",
|
|
@@ -3912,7 +3912,7 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
3912
3912
|
tooltip: { background: "rgba(40,42,54,0.92)", textColor: "#f8f8f2", borderColor: "rgba(68,71,90,0.6)" },
|
|
3913
3913
|
typography: { fontFamily: ai },
|
|
3914
3914
|
fontUrl: ni
|
|
3915
|
-
}),
|
|
3915
|
+
}), Pn = et({
|
|
3916
3916
|
name: "GitHub Light",
|
|
3917
3917
|
description: "Clean and familiar, GitHub-inspired",
|
|
3918
3918
|
background: "#fafbfc",
|
|
@@ -3938,7 +3938,7 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
3938
3938
|
tooltip: { background: "rgba(250,251,252,0.95)", textColor: "#24292f", borderColor: "rgba(216,222,228,0.5)" },
|
|
3939
3939
|
typography: { fontFamily: oi },
|
|
3940
3940
|
fontUrl: ri
|
|
3941
|
-
}),
|
|
3941
|
+
}), zn = et({
|
|
3942
3942
|
name: "Gruvbox",
|
|
3943
3943
|
description: "Retro warm with earthy tones",
|
|
3944
3944
|
background: "#282828",
|
|
@@ -3961,18 +3961,18 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
3961
3961
|
crosshair: { color: "rgba(146,131,116,0.4)", labelBackground: "#3c3836" },
|
|
3962
3962
|
axis: { textColor: "#928374" },
|
|
3963
3963
|
tooltip: { background: "rgba(40,40,40,0.92)", textColor: "#ebdbb2", borderColor: "rgba(60,56,54,0.6)" },
|
|
3964
|
-
typography: { fontFamily:
|
|
3965
|
-
fontUrl:
|
|
3966
|
-
}),
|
|
3964
|
+
typography: { fontFamily: Ae },
|
|
3965
|
+
fontUrl: We
|
|
3966
|
+
}), An = {
|
|
3967
3967
|
name: "Handwritten",
|
|
3968
3968
|
description: "Sketch-style with a personal touch",
|
|
3969
|
-
fontUrl:
|
|
3969
|
+
fontUrl: Ga,
|
|
3970
3970
|
dark: !1,
|
|
3971
3971
|
theme: {
|
|
3972
3972
|
background: "#fdf5e6",
|
|
3973
3973
|
chartGradient: ["#fef6e3", "#fdf5e6"],
|
|
3974
3974
|
typography: {
|
|
3975
|
-
fontFamily:
|
|
3975
|
+
fontFamily: Ua,
|
|
3976
3976
|
fontSize: 18,
|
|
3977
3977
|
axisFontSize: 13,
|
|
3978
3978
|
yFontSize: 15,
|
|
@@ -4028,7 +4028,7 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4028
4028
|
borderColor: "rgba(180,170,150,0.4)"
|
|
4029
4029
|
}
|
|
4030
4030
|
}
|
|
4031
|
-
},
|
|
4031
|
+
}, ja = "'Silkscreen', cursive", Ka = "https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap", Wn = et({
|
|
4032
4032
|
name: "Matrix",
|
|
4033
4033
|
background: "#000000",
|
|
4034
4034
|
candlestick: { upColor: "#00ff41", downColor: "#00802a" },
|
|
@@ -4050,10 +4050,10 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4050
4050
|
axis: { textColor: "#00cc33" },
|
|
4051
4051
|
crosshair: { color: "rgba(0,255,65,0.3)", labelBackground: "#0a1a0a" },
|
|
4052
4052
|
tooltip: { background: "rgba(0,10,0,0.95)", textColor: "#00ff41", borderColor: "rgba(0,255,65,0.2)" },
|
|
4053
|
-
typography: { fontFamily:
|
|
4054
|
-
fontUrl:
|
|
4053
|
+
typography: { fontFamily: ja },
|
|
4054
|
+
fontUrl: Ka,
|
|
4055
4055
|
chartGradient: ["#010a01", "#000000"]
|
|
4056
|
-
}),
|
|
4056
|
+
}), Vn = et({
|
|
4057
4057
|
name: "Lavender Mist",
|
|
4058
4058
|
background: "#f5f0f4",
|
|
4059
4059
|
candlestick: { upColor: "#6b8e5e", downColor: "#b85468" },
|
|
@@ -4078,7 +4078,7 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4078
4078
|
typography: { fontFamily: oi },
|
|
4079
4079
|
fontUrl: ri,
|
|
4080
4080
|
chartGradient: ["#f8f4f7", "#f5f0f4"]
|
|
4081
|
-
}),
|
|
4081
|
+
}), Yn = et({
|
|
4082
4082
|
name: "Love",
|
|
4083
4083
|
description: "Soft romantic pinks and roses",
|
|
4084
4084
|
background: "#fef7f8",
|
|
@@ -4102,9 +4102,9 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4102
4102
|
crosshair: { color: "rgba(180,140,155,0.3)", labelBackground: "#f0dce2" },
|
|
4103
4103
|
axis: { textColor: "#b08898" },
|
|
4104
4104
|
tooltip: { background: "rgba(253,242,244,0.95)", textColor: "#4a3040", borderColor: "rgba(200,160,175,0.35)" },
|
|
4105
|
-
typography: { fontFamily:
|
|
4105
|
+
typography: { fontFamily: Ve },
|
|
4106
4106
|
fontUrl: si
|
|
4107
|
-
}),
|
|
4107
|
+
}), En = et({
|
|
4108
4108
|
name: "Material Palenight",
|
|
4109
4109
|
description: "Material Design in moonlit hues",
|
|
4110
4110
|
background: "#292d3e",
|
|
@@ -4127,9 +4127,9 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4127
4127
|
crosshair: { color: "rgba(103,110,149,0.4)", labelBackground: "#34324a" },
|
|
4128
4128
|
axis: { textColor: "#676e95" },
|
|
4129
4129
|
tooltip: { background: "rgba(41,45,62,0.92)", textColor: "#a6accd", borderColor: "rgba(55,59,75,0.6)" },
|
|
4130
|
-
typography: { fontFamily:
|
|
4131
|
-
fontUrl:
|
|
4132
|
-
}),
|
|
4130
|
+
typography: { fontFamily: ts },
|
|
4131
|
+
fontUrl: es
|
|
4132
|
+
}), Ja = "'Silkscreen', cursive", qa = "https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap", $n = et({
|
|
4133
4133
|
name: "Monochrome",
|
|
4134
4134
|
description: "Pure black and white, pixel font",
|
|
4135
4135
|
background: "#ffffff",
|
|
@@ -4153,9 +4153,9 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4153
4153
|
crosshair: { color: "rgba(0,0,0,0.08)", labelBackground: "#f0f0f0" },
|
|
4154
4154
|
axis: { textColor: "#b0b0b0" },
|
|
4155
4155
|
tooltip: { background: "rgba(255,255,255,0.97)", textColor: "#222222", borderColor: "rgba(0,0,0,0.08)" },
|
|
4156
|
-
typography: { fontFamily:
|
|
4157
|
-
fontUrl:
|
|
4158
|
-
}),
|
|
4156
|
+
typography: { fontFamily: Ja, tooltipFontSize: 9 },
|
|
4157
|
+
fontUrl: qa
|
|
4158
|
+
}), Hn = et({
|
|
4159
4159
|
name: "Mint Breeze",
|
|
4160
4160
|
background: "#f6f5ee",
|
|
4161
4161
|
candlestick: { upColor: "#2e9070", downColor: "#d04848" },
|
|
@@ -4177,10 +4177,10 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4177
4177
|
axis: { textColor: "#80a098" },
|
|
4178
4178
|
crosshair: { color: "rgba(120,140,120,0.18)", labelBackground: "#ece8de" },
|
|
4179
4179
|
tooltip: { background: "rgba(246,245,238,0.95)", textColor: "#2a3530", borderColor: "rgba(130,140,115,0.2)" },
|
|
4180
|
-
typography: { fontFamily:
|
|
4181
|
-
fontUrl:
|
|
4180
|
+
typography: { fontFamily: Xa },
|
|
4181
|
+
fontUrl: Na,
|
|
4182
4182
|
chartGradient: ["#f8f7f0", "#f6f5ee"]
|
|
4183
|
-
}),
|
|
4183
|
+
}), On = et({
|
|
4184
4184
|
name: "Monokai Pro",
|
|
4185
4185
|
description: "Bold syntax colors on dark gray",
|
|
4186
4186
|
background: "#2d2a2e",
|
|
@@ -4205,7 +4205,7 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4205
4205
|
tooltip: { background: "rgba(45,42,46,0.92)", textColor: "#fcfcfa", borderColor: "rgba(64,60,62,0.6)" },
|
|
4206
4206
|
typography: { fontFamily: ai },
|
|
4207
4207
|
fontUrl: ni
|
|
4208
|
-
}),
|
|
4208
|
+
}), Xn = et({
|
|
4209
4209
|
name: "Night Owl",
|
|
4210
4210
|
description: "Crafted for late-night coding",
|
|
4211
4211
|
background: "#011627",
|
|
@@ -4228,9 +4228,9 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4228
4228
|
crosshair: { color: "rgba(99,119,119,0.4)", labelBackground: "#1d3b53" },
|
|
4229
4229
|
axis: { textColor: "#495a5a" },
|
|
4230
4230
|
tooltip: { background: "rgba(1,22,39,0.92)", textColor: "#d6deeb", borderColor: "rgba(31,52,72,0.6)" },
|
|
4231
|
-
typography: { fontFamily:
|
|
4232
|
-
fontUrl:
|
|
4233
|
-
}),
|
|
4231
|
+
typography: { fontFamily: Ae },
|
|
4232
|
+
fontUrl: We
|
|
4233
|
+
}), Nn = et({
|
|
4234
4234
|
name: "One Dark Pro",
|
|
4235
4235
|
description: "Atom editor's iconic dark palette",
|
|
4236
4236
|
background: "#282c34",
|
|
@@ -4253,9 +4253,9 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4253
4253
|
crosshair: { color: "rgba(99,110,123,0.4)", labelBackground: "#3e4451" },
|
|
4254
4254
|
axis: { textColor: "#5c6370" },
|
|
4255
4255
|
tooltip: { background: "rgba(40,44,52,0.92)", textColor: "#abb2bf", borderColor: "rgba(59,64,72,0.6)" },
|
|
4256
|
-
typography: { fontFamily:
|
|
4257
|
-
fontUrl:
|
|
4258
|
-
}),
|
|
4256
|
+
typography: { fontFamily: Ae },
|
|
4257
|
+
fontUrl: We
|
|
4258
|
+
}), Un = et({
|
|
4259
4259
|
name: "Panda",
|
|
4260
4260
|
description: "Playful neons on charcoal",
|
|
4261
4261
|
background: "#292a2b",
|
|
@@ -4280,7 +4280,7 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4280
4280
|
tooltip: { background: "rgba(41,42,43,0.92)", textColor: "#e6e6e6", borderColor: "rgba(58,58,60,0.6)" },
|
|
4281
4281
|
typography: { fontFamily: ai },
|
|
4282
4282
|
fontUrl: ni
|
|
4283
|
-
}),
|
|
4283
|
+
}), Gn = et({
|
|
4284
4284
|
name: "Peach Cream",
|
|
4285
4285
|
background: "#fef6f0",
|
|
4286
4286
|
candlestick: { upColor: "#5a9a68", downColor: "#d06848" },
|
|
@@ -4305,7 +4305,7 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4305
4305
|
typography: { fontFamily: oi },
|
|
4306
4306
|
fontUrl: ri,
|
|
4307
4307
|
chartGradient: ["#fff8f2", "#fef6f0"]
|
|
4308
|
-
}),
|
|
4308
|
+
}), jn = et({
|
|
4309
4309
|
name: "Quiet Light",
|
|
4310
4310
|
description: "Subdued and easy on the eyes",
|
|
4311
4311
|
background: "#f5f5f5",
|
|
@@ -4328,9 +4328,9 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4328
4328
|
crosshair: { color: "rgba(170,170,170,0.3)", labelBackground: "#e8e8e8" },
|
|
4329
4329
|
axis: { textColor: "#aaaaaa" },
|
|
4330
4330
|
tooltip: { background: "rgba(245,245,245,0.95)", textColor: "#333333", borderColor: "rgba(200,200,200,0.5)" },
|
|
4331
|
-
typography: { fontFamily:
|
|
4332
|
-
fontUrl:
|
|
4333
|
-
}),
|
|
4331
|
+
typography: { fontFamily: Ha },
|
|
4332
|
+
fontUrl: Oa
|
|
4333
|
+
}), Kn = et({
|
|
4334
4334
|
name: "Rosé Pine Dawn",
|
|
4335
4335
|
description: "Dawn-inspired warm neutrals",
|
|
4336
4336
|
background: "#faf4ed",
|
|
@@ -4353,9 +4353,9 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4353
4353
|
crosshair: { color: "rgba(152,147,165,0.3)", labelBackground: "#f2e9e1" },
|
|
4354
4354
|
axis: { textColor: "#9893a5" },
|
|
4355
4355
|
tooltip: { background: "rgba(250,244,237,0.95)", textColor: "#575279", borderColor: "rgba(152,147,165,0.3)" },
|
|
4356
|
-
typography: { fontFamily:
|
|
4357
|
-
fontUrl:
|
|
4358
|
-
}),
|
|
4356
|
+
typography: { fontFamily: is },
|
|
4357
|
+
fontUrl: ss
|
|
4358
|
+
}), Jn = et({
|
|
4359
4359
|
name: "Sand Dune",
|
|
4360
4360
|
background: "#f4f0e8",
|
|
4361
4361
|
candlestick: { upColor: "#5a8a50", downColor: "#b85040" },
|
|
@@ -4377,10 +4377,10 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4377
4377
|
axis: { textColor: "#9a8a70" },
|
|
4378
4378
|
crosshair: { color: "rgba(150,130,100,0.2)", labelBackground: "#e8e0d0" },
|
|
4379
4379
|
tooltip: { background: "rgba(244,240,232,0.95)", textColor: "#3a3020", borderColor: "rgba(150,130,100,0.3)" },
|
|
4380
|
-
typography: { fontFamily:
|
|
4381
|
-
fontUrl:
|
|
4380
|
+
typography: { fontFamily: is },
|
|
4381
|
+
fontUrl: ss,
|
|
4382
4382
|
chartGradient: ["#f8f4ec", "#f4f0e8"]
|
|
4383
|
-
}),
|
|
4383
|
+
}), qn = et({
|
|
4384
4384
|
name: "Solarized Light",
|
|
4385
4385
|
description: "Ethan Schoonover's precision palette",
|
|
4386
4386
|
background: "#fdf6e3",
|
|
@@ -4404,8 +4404,8 @@ const We = "'JetBrains Mono', 'Fira Code', monospace", Ve = "https://fonts.googl
|
|
|
4404
4404
|
crosshair: { color: "rgba(147,161,161,0.3)", labelBackground: "#eee8d5" },
|
|
4405
4405
|
axis: { textColor: "#93a1a1" },
|
|
4406
4406
|
tooltip: { background: "rgba(253,246,227,0.95)", textColor: "#586e75", borderColor: "rgba(238,232,213,0.6)" },
|
|
4407
|
-
typography: { fontFamily:
|
|
4408
|
-
fontUrl:
|
|
4407
|
+
typography: { fontFamily: Ae },
|
|
4408
|
+
fontUrl: We
|
|
4409
4409
|
});
|
|
4410
4410
|
function Pe(s) {
|
|
4411
4411
|
const { x: t, y: e, chartWidth: i, chartHeight: a, tooltipWidth: n, tooltipHeight: o, offsetX: r = 16, offsetY: h = 16 } = s, d = t + r + n > i ? t - r - n : t + r, c = e + h + o > a ? e - h - o : e + h, u = Math.max(0, i - n), g = Math.max(0, a - o);
|
|
@@ -4414,20 +4414,20 @@ function Pe(s) {
|
|
|
4414
4414
|
top: Math.max(0, Math.min(g, c))
|
|
4415
4415
|
};
|
|
4416
4416
|
}
|
|
4417
|
-
const
|
|
4417
|
+
const as = Symbol("wick-chart"), Se = Symbol("wick-theme"), ns = Symbol("wick-title-anchor"), os = Symbol("wick-info-bar-anchor"), rs = Symbol("wick-legend-anchor"), ls = Symbol("wick-legend-right-anchor");
|
|
4418
4418
|
function ut() {
|
|
4419
|
-
const s = Ft(
|
|
4419
|
+
const s = Ft(as);
|
|
4420
4420
|
if (!s || !s.value)
|
|
4421
4421
|
throw new Error("useChartInstance must be used within <ChartContainer>");
|
|
4422
4422
|
return s.value;
|
|
4423
4423
|
}
|
|
4424
|
-
function
|
|
4424
|
+
function Qa() {
|
|
4425
4425
|
const s = Ft(Se);
|
|
4426
4426
|
if (!s)
|
|
4427
4427
|
throw new Error("useTheme must be used within <ChartContainer>");
|
|
4428
4428
|
return s;
|
|
4429
4429
|
}
|
|
4430
|
-
const
|
|
4430
|
+
const Qn = /* @__PURE__ */ lt({
|
|
4431
4431
|
__name: "BarSeries",
|
|
4432
4432
|
props: {
|
|
4433
4433
|
data: {},
|
|
@@ -4446,7 +4446,7 @@ const so = /* @__PURE__ */ nt({
|
|
|
4446
4446
|
for (let n = 0; n < t.data.length; n++)
|
|
4447
4447
|
e.setSeriesData(a, t.data[n], n);
|
|
4448
4448
|
});
|
|
4449
|
-
}),
|
|
4449
|
+
}), nt(() => {
|
|
4450
4450
|
i.value && e.removeSeries(i.value);
|
|
4451
4451
|
}), ft(
|
|
4452
4452
|
() => t.data,
|
|
@@ -4464,7 +4464,7 @@ const so = /* @__PURE__ */ nt({
|
|
|
4464
4464
|
{ deep: !0 }
|
|
4465
4465
|
), (a, n) => tt("", !0);
|
|
4466
4466
|
}
|
|
4467
|
-
}),
|
|
4467
|
+
}), Zn = /* @__PURE__ */ lt({
|
|
4468
4468
|
__name: "CandlestickSeries",
|
|
4469
4469
|
props: {
|
|
4470
4470
|
data: {},
|
|
@@ -4477,7 +4477,7 @@ const so = /* @__PURE__ */ nt({
|
|
|
4477
4477
|
return at(() => {
|
|
4478
4478
|
const n = e.addCandlestickSeries({ ...t.options, id: t.id });
|
|
4479
4479
|
i.value = n, t.data.length > 0 && (e.setSeriesData(n, t.data), a = t.data.length);
|
|
4480
|
-
}),
|
|
4480
|
+
}), nt(() => {
|
|
4481
4481
|
i.value && e.removeSeries(i.value);
|
|
4482
4482
|
}), ft(
|
|
4483
4483
|
() => t.data,
|
|
@@ -4506,20 +4506,20 @@ const so = /* @__PURE__ */ nt({
|
|
|
4506
4506
|
{ deep: !0 }
|
|
4507
4507
|
), (n, o) => tt("", !0);
|
|
4508
4508
|
}
|
|
4509
|
-
}),
|
|
4509
|
+
}), Za = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-height": "0" } }, tn = {
|
|
4510
4510
|
key: 0,
|
|
4511
4511
|
"data-chart-series-overlay": "",
|
|
4512
4512
|
style: { position: "absolute", inset: "0", "pointer-events": "none", "z-index": "3" }
|
|
4513
|
-
},
|
|
4513
|
+
}, to = /* @__PURE__ */ lt({
|
|
4514
4514
|
__name: "ChartContainer",
|
|
4515
4515
|
props: {
|
|
4516
|
-
theme: { default: () =>
|
|
4516
|
+
theme: { default: () => Gi },
|
|
4517
4517
|
axis: {},
|
|
4518
4518
|
grid: {}
|
|
4519
4519
|
},
|
|
4520
4520
|
setup(s) {
|
|
4521
4521
|
const t = s, e = G(), i = hi(null), a = hi(t.theme), n = G(null), o = G(null), r = G(null), h = G(null), d = G(null);
|
|
4522
|
-
qt(
|
|
4522
|
+
qt(as, i), qt(Se, a), qt(ns, o), qt(os, r), qt(rs, h), qt(ls, d);
|
|
4523
4523
|
let c = null, u = 0;
|
|
4524
4524
|
function g() {
|
|
4525
4525
|
i.value && i.value.setPadding({ top: 20 + u });
|
|
@@ -4527,13 +4527,13 @@ const so = /* @__PURE__ */ nt({
|
|
|
4527
4527
|
at(async () => {
|
|
4528
4528
|
if (!e.value) return;
|
|
4529
4529
|
const y = {};
|
|
4530
|
-
if (t.axis && (y.axis = t.axis), t.theme && (y.theme = t.theme), t.grid !== void 0 && (y.grid = t.grid), i.value = new
|
|
4530
|
+
if (t.axis && (y.axis = t.axis), t.theme && (y.theme = t.theme), t.grid !== void 0 && (y.grid = t.grid), i.value = new Ya(e.value, y), await fs(), !n.value) return;
|
|
4531
4531
|
const x = () => {
|
|
4532
4532
|
var v;
|
|
4533
4533
|
u = ((v = n.value) == null ? void 0 : v.getBoundingClientRect().height) ?? 0, g();
|
|
4534
4534
|
};
|
|
4535
4535
|
x(), c = new ResizeObserver(x), c.observe(n.value);
|
|
4536
|
-
}),
|
|
4536
|
+
}), nt(() => {
|
|
4537
4537
|
var y;
|
|
4538
4538
|
c == null || c.disconnect(), c = null, (y = i.value) == null || y.destroy(), i.value = null;
|
|
4539
4539
|
}), ft(
|
|
@@ -4563,7 +4563,7 @@ const so = /* @__PURE__ */ nt({
|
|
|
4563
4563
|
return (y, x) => (B(), P("div", {
|
|
4564
4564
|
style: E(f.value)
|
|
4565
4565
|
}, [
|
|
4566
|
-
W("div",
|
|
4566
|
+
W("div", Za, [
|
|
4567
4567
|
W("div", {
|
|
4568
4568
|
ref_key: "containerRef",
|
|
4569
4569
|
ref: e,
|
|
@@ -4586,8 +4586,8 @@ const so = /* @__PURE__ */ nt({
|
|
|
4586
4586
|
"data-tooltip-legend-anchor": ""
|
|
4587
4587
|
}, null, 512)
|
|
4588
4588
|
], 512),
|
|
4589
|
-
i.value ? (B(), P("div",
|
|
4590
|
-
|
|
4589
|
+
i.value ? (B(), P("div", tn, [
|
|
4590
|
+
Et(y.$slots, "default")
|
|
4591
4591
|
])) : tt("", !0)
|
|
4592
4592
|
], 512),
|
|
4593
4593
|
W("div", {
|
|
@@ -4606,19 +4606,19 @@ const so = /* @__PURE__ */ nt({
|
|
|
4606
4606
|
], 4));
|
|
4607
4607
|
}
|
|
4608
4608
|
});
|
|
4609
|
-
function
|
|
4609
|
+
function hs(s) {
|
|
4610
4610
|
const t = G(s.getVisibleRange()), e = () => {
|
|
4611
4611
|
t.value = s.getVisibleRange();
|
|
4612
4612
|
};
|
|
4613
|
-
return at(() => s.on("viewportChange", e)),
|
|
4613
|
+
return at(() => s.on("viewportChange", e)), nt(() => s.off("viewportChange", e)), t;
|
|
4614
4614
|
}
|
|
4615
|
-
function
|
|
4615
|
+
function eo(s) {
|
|
4616
4616
|
const t = G(s.getYRange()), e = () => {
|
|
4617
4617
|
t.value = s.getYRange();
|
|
4618
4618
|
};
|
|
4619
|
-
return at(() => s.on("viewportChange", e)),
|
|
4619
|
+
return at(() => s.on("viewportChange", e)), nt(() => s.off("viewportChange", e)), t;
|
|
4620
4620
|
}
|
|
4621
|
-
function
|
|
4621
|
+
function io(s, t) {
|
|
4622
4622
|
const e = G(s.getLastValue(t)), i = () => {
|
|
4623
4623
|
var n, o;
|
|
4624
4624
|
const a = s.getLastValue(t);
|
|
@@ -4626,23 +4626,23 @@ function ro(s, t) {
|
|
|
4626
4626
|
};
|
|
4627
4627
|
return at(() => {
|
|
4628
4628
|
s.on("dataUpdate", i), s.on("viewportChange", i);
|
|
4629
|
-
}),
|
|
4629
|
+
}), nt(() => {
|
|
4630
4630
|
s.off("dataUpdate", i), s.off("viewportChange", i);
|
|
4631
4631
|
}), e;
|
|
4632
4632
|
}
|
|
4633
|
-
function
|
|
4633
|
+
function so(s, t) {
|
|
4634
4634
|
const e = G(s.getPreviousClose(t)), i = () => {
|
|
4635
4635
|
e.value = s.getPreviousClose(t);
|
|
4636
4636
|
};
|
|
4637
|
-
return at(() => s.on("dataUpdate", i)),
|
|
4637
|
+
return at(() => s.on("dataUpdate", i)), nt(() => s.off("dataUpdate", i)), e;
|
|
4638
4638
|
}
|
|
4639
|
-
function
|
|
4639
|
+
function Ye(s) {
|
|
4640
4640
|
const t = G(s.getCrosshairPosition()), e = () => {
|
|
4641
4641
|
t.value = s.getCrosshairPosition();
|
|
4642
4642
|
};
|
|
4643
|
-
return at(() => s.on("crosshairMove", e)),
|
|
4643
|
+
return at(() => s.on("crosshairMove", e)), nt(() => s.off("crosshairMove", e)), t;
|
|
4644
4644
|
}
|
|
4645
|
-
const
|
|
4645
|
+
const ao = /* @__PURE__ */ lt({
|
|
4646
4646
|
__name: "LineSeries",
|
|
4647
4647
|
props: {
|
|
4648
4648
|
data: {},
|
|
@@ -4661,7 +4661,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4661
4661
|
for (let n = 0; n < t.data.length; n++)
|
|
4662
4662
|
e.setSeriesData(a, t.data[n], n);
|
|
4663
4663
|
});
|
|
4664
|
-
}),
|
|
4664
|
+
}), nt(() => {
|
|
4665
4665
|
i.value && e.removeSeries(i.value);
|
|
4666
4666
|
}), ft(
|
|
4667
4667
|
() => t.data,
|
|
@@ -4679,7 +4679,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4679
4679
|
{ deep: !0 }
|
|
4680
4680
|
), (a, n) => tt("", !0);
|
|
4681
4681
|
}
|
|
4682
|
-
}),
|
|
4682
|
+
}), no = /* @__PURE__ */ lt({
|
|
4683
4683
|
__name: "PieSeries",
|
|
4684
4684
|
props: {
|
|
4685
4685
|
data: {},
|
|
@@ -4691,7 +4691,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4691
4691
|
return at(() => {
|
|
4692
4692
|
const a = e.addPieSeries({ ...t.options, id: t.id });
|
|
4693
4693
|
i.value = a, t.data.length > 0 && e.setSeriesData(a, t.data);
|
|
4694
|
-
}),
|
|
4694
|
+
}), nt(() => {
|
|
4695
4695
|
i.value && e.removeSeries(i.value);
|
|
4696
4696
|
}), ft(
|
|
4697
4697
|
() => t.data,
|
|
@@ -4706,10 +4706,10 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4706
4706
|
{ deep: !0 }
|
|
4707
4707
|
), (a, n) => tt("", !0);
|
|
4708
4708
|
}
|
|
4709
|
-
}),
|
|
4709
|
+
}), oo = /* @__PURE__ */ lt({
|
|
4710
4710
|
__name: "Crosshair",
|
|
4711
4711
|
setup(s) {
|
|
4712
|
-
const t = ut(), e =
|
|
4712
|
+
const t = ut(), e = Ye(t), i = D(() => t.getTheme()), a = D(() => t.getDataInterval()), n = D(() => ({
|
|
4713
4713
|
// Blend the theme's labelBackground at 80% opacity so the axis grid
|
|
4714
4714
|
// shows through — keeps the badge from looking like an opaque block
|
|
4715
4715
|
// while still masking whatever tick sits underneath.
|
|
@@ -4744,16 +4744,16 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4744
4744
|
transform: "translateX(-50%)",
|
|
4745
4745
|
...n.value
|
|
4746
4746
|
})
|
|
4747
|
-
}, U(F(
|
|
4747
|
+
}, U(F(ze)(F(e).time, a.value)), 5)
|
|
4748
4748
|
], 64)) : tt("", !0);
|
|
4749
4749
|
}
|
|
4750
|
-
}),
|
|
4750
|
+
}), en = {
|
|
4751
4751
|
key: 0,
|
|
4752
4752
|
style: { display: "inline-flex", alignItems: "center", gap: "4px" }
|
|
4753
|
-
},
|
|
4753
|
+
}, sn = {
|
|
4754
4754
|
key: 1,
|
|
4755
4755
|
style: { display: "inline-flex", alignItems: "center", gap: "3px" }
|
|
4756
|
-
},
|
|
4756
|
+
}, ro = /* @__PURE__ */ lt({
|
|
4757
4757
|
__name: "InfoBar",
|
|
4758
4758
|
props: {
|
|
4759
4759
|
sort: {},
|
|
@@ -4761,8 +4761,8 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4761
4761
|
},
|
|
4762
4762
|
setup(s) {
|
|
4763
4763
|
const t = s, e = D(() => t.sort ?? "none"), i = D(
|
|
4764
|
-
() => t.format ?? ((b, w) => w === "volume" ? le(b) :
|
|
4765
|
-
), a = ut(), n =
|
|
4764
|
+
() => t.format ?? ((b, w) => w === "volume" ? le(b) : Yi(b))
|
|
4765
|
+
), a = ut(), n = Ye(a), o = Ft(Se), r = Ft(os);
|
|
4766
4766
|
if (!o)
|
|
4767
4767
|
throw new Error("<InfoBar> must be used within <ChartContainer>: missing ThemeKey.");
|
|
4768
4768
|
if (!r)
|
|
@@ -4772,20 +4772,20 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4772
4772
|
};
|
|
4773
4773
|
at(() => {
|
|
4774
4774
|
a.on("overlayChange", d), a.getSeriesIds().length > 0 && h.value++;
|
|
4775
|
-
}),
|
|
4775
|
+
}), nt(() => {
|
|
4776
4776
|
a.off("overlayChange", d);
|
|
4777
4777
|
});
|
|
4778
4778
|
const c = D(() => {
|
|
4779
4779
|
h.value;
|
|
4780
4780
|
const b = n.value;
|
|
4781
|
-
return b === null ? null :
|
|
4782
|
-
}), u = D(() => (h.value,
|
|
4781
|
+
return b === null ? null : Zi(a, { time: b.time, sort: e.value, cacheKey: "infobar-hover" });
|
|
4782
|
+
}), u = D(() => (h.value, Ea(a, { sort: e.value, cacheKey: "infobar-last" }))), g = D(() => c.value !== null && c.value.length > 0), f = D(
|
|
4783
4783
|
() => g.value ? c.value : u.value
|
|
4784
4784
|
), y = D(() => a.getDataInterval()), x = D(() => f.value.length === 0 ? 0 : g.value && n.value ? n.value.time : Math.max(...f.value.map((b) => b.data.time))), v = re(), p = D(() => typeof v.default == "function");
|
|
4785
4785
|
function C(b) {
|
|
4786
4786
|
return "open" in b;
|
|
4787
4787
|
}
|
|
4788
|
-
return (b, w) => F(r) && F(o) && f.value.length > 0 ? (B(),
|
|
4788
|
+
return (b, w) => F(r) && F(o) && f.value.length > 0 ? (B(), qe(Qe, {
|
|
4789
4789
|
key: 0,
|
|
4790
4790
|
to: F(r)
|
|
4791
4791
|
}, [
|
|
@@ -4818,7 +4818,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4818
4818
|
}
|
|
4819
4819
|
)
|
|
4820
4820
|
}, [
|
|
4821
|
-
p.value ?
|
|
4821
|
+
p.value ? Et(b.$slots, "default", {
|
|
4822
4822
|
key: 0,
|
|
4823
4823
|
snapshots: f.value,
|
|
4824
4824
|
time: x.value,
|
|
@@ -4826,11 +4826,11 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4826
4826
|
}) : (B(), P(j, { key: 1 }, [
|
|
4827
4827
|
W("span", {
|
|
4828
4828
|
style: E({ color: F(o).axis.textColor, marginRight: "2px" })
|
|
4829
|
-
}, U(F(
|
|
4829
|
+
}, U(F(ze)(x.value, y.value)), 5),
|
|
4830
4830
|
(B(!0), P(j, null, bt(f.value, (S) => (B(), P(j, {
|
|
4831
4831
|
key: S.id
|
|
4832
4832
|
}, [
|
|
4833
|
-
C(S.data) ? (B(), P("span",
|
|
4833
|
+
C(S.data) ? (B(), P("span", en, [
|
|
4834
4834
|
(B(!0), P(j, null, bt([
|
|
4835
4835
|
{ label: "O", field: "open", val: S.data.open },
|
|
4836
4836
|
{ label: "H", field: "high", val: S.data.high },
|
|
@@ -4858,7 +4858,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4858
4858
|
style: E({ color: F(o).axis.textColor, fontWeight: 500, marginLeft: "2px" })
|
|
4859
4859
|
}, U(i.value(S.data.volume, "volume")), 5)
|
|
4860
4860
|
], 64)) : tt("", !0)
|
|
4861
|
-
])) : (B(), P("span",
|
|
4861
|
+
])) : (B(), P("span", sn, [
|
|
4862
4862
|
W("span", {
|
|
4863
4863
|
style: E({
|
|
4864
4864
|
width: "6px",
|
|
@@ -4877,7 +4877,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4877
4877
|
], 4)
|
|
4878
4878
|
], 8, ["to"])) : tt("", !0);
|
|
4879
4879
|
}
|
|
4880
|
-
}),
|
|
4880
|
+
}), an = ["data-legend"], nn = ["data-legend"], on = { style: { "white-space": "nowrap" } }, rn = ["data-legend"], ln = ["onClick"], hn = { style: { "white-space": "nowrap" } }, lo = /* @__PURE__ */ lt({
|
|
4881
4881
|
__name: "Legend",
|
|
4882
4882
|
props: {
|
|
4883
4883
|
items: {},
|
|
@@ -4885,7 +4885,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4885
4885
|
mode: { default: "toggle" }
|
|
4886
4886
|
},
|
|
4887
4887
|
setup(s) {
|
|
4888
|
-
const t = s, e = ut(), i = Ft(Se), a = Ft(
|
|
4888
|
+
const t = s, e = ut(), i = Ft(Se), a = Ft(rs), n = Ft(ls);
|
|
4889
4889
|
if (!i)
|
|
4890
4890
|
throw new Error("<Legend> must be used within <ChartContainer>: missing ThemeKey.");
|
|
4891
4891
|
if (!a || !n)
|
|
@@ -4897,7 +4897,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4897
4897
|
};
|
|
4898
4898
|
at(() => {
|
|
4899
4899
|
e.on("overlayChange", d), e.on("seriesChange", c), e.getSeriesIds().length > 0 && h.value++;
|
|
4900
|
-
}),
|
|
4900
|
+
}), nt(() => {
|
|
4901
4901
|
e.off("overlayChange", d), e.off("seriesChange", c);
|
|
4902
4902
|
});
|
|
4903
4903
|
function u(p) {
|
|
@@ -4970,7 +4970,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4970
4970
|
function v(p) {
|
|
4971
4971
|
t.mode === "isolate" || t.mode === "solo" ? p.isolate() : p.toggle();
|
|
4972
4972
|
}
|
|
4973
|
-
return (p, C) => o.value && F(i) ? (B(),
|
|
4973
|
+
return (p, C) => o.value && F(i) ? (B(), qe(Qe, {
|
|
4974
4974
|
key: 0,
|
|
4975
4975
|
to: o.value
|
|
4976
4976
|
}, [
|
|
@@ -4992,8 +4992,8 @@ const ho = /* @__PURE__ */ nt({
|
|
|
4992
4992
|
flexShrink: 0
|
|
4993
4993
|
})
|
|
4994
4994
|
}, [
|
|
4995
|
-
|
|
4996
|
-
], 12,
|
|
4995
|
+
Et(p.$slots, "default", { items: f.value })
|
|
4996
|
+
], 12, an)) : s.items && s.items.length > 0 ? (B(), P("div", {
|
|
4997
4997
|
key: 1,
|
|
4998
4998
|
"data-legend": s.position,
|
|
4999
4999
|
style: E({
|
|
@@ -5029,9 +5029,9 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5029
5029
|
flexShrink: 0
|
|
5030
5030
|
})
|
|
5031
5031
|
}, null, 4),
|
|
5032
|
-
W("span",
|
|
5032
|
+
W("span", on, U(b.label), 1)
|
|
5033
5033
|
]))), 128))
|
|
5034
|
-
], 12,
|
|
5034
|
+
], 12, nn)) : f.value.length > 0 ? (B(), P("div", {
|
|
5035
5035
|
key: 2,
|
|
5036
5036
|
"data-legend": s.position,
|
|
5037
5037
|
style: E({
|
|
@@ -5079,16 +5079,16 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5079
5079
|
flexShrink: 0
|
|
5080
5080
|
})
|
|
5081
5081
|
}, null, 4),
|
|
5082
|
-
W("span",
|
|
5083
|
-
], 12,
|
|
5084
|
-
], 12,
|
|
5082
|
+
W("span", hn, U(b.label), 1)
|
|
5083
|
+
], 12, ln))), 128))
|
|
5084
|
+
], 12, rn)) : tt("", !0)
|
|
5085
5085
|
], 8, ["to"])) : tt("", !0);
|
|
5086
5086
|
}
|
|
5087
|
-
}),
|
|
5087
|
+
}), cn = { style: {
|
|
5088
5088
|
display: "inline-flex",
|
|
5089
5089
|
fontVariantNumeric: "tabular-nums",
|
|
5090
5090
|
lineHeight: 1.2
|
|
5091
|
-
} },
|
|
5091
|
+
} }, un = {
|
|
5092
5092
|
key: 0,
|
|
5093
5093
|
style: {
|
|
5094
5094
|
display: "inline-block",
|
|
@@ -5096,10 +5096,10 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5096
5096
|
overflow: "hidden",
|
|
5097
5097
|
position: "relative"
|
|
5098
5098
|
}
|
|
5099
|
-
},
|
|
5099
|
+
}, dn = {
|
|
5100
5100
|
key: 1,
|
|
5101
5101
|
style: { display: "inline-block" }
|
|
5102
|
-
},
|
|
5102
|
+
}, fn = /* @__PURE__ */ lt({
|
|
5103
5103
|
__name: "NumberFlow",
|
|
5104
5104
|
props: {
|
|
5105
5105
|
value: {},
|
|
@@ -5121,9 +5121,9 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5121
5121
|
d >= "0" && d <= "9" ? h.push({ type: "digit", value: d }) : h.push({ type: "symbol", value: d });
|
|
5122
5122
|
return h;
|
|
5123
5123
|
}), n = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
5124
|
-
return (o, r) => (B(), P("span",
|
|
5124
|
+
return (o, r) => (B(), P("span", cn, [
|
|
5125
5125
|
(B(!0), P(j, null, bt(a.value, (h, d) => (B(), P(j, { key: d }, [
|
|
5126
|
-
h.type === "digit" ? (B(), P("span",
|
|
5126
|
+
h.type === "digit" ? (B(), P("span", un, [
|
|
5127
5127
|
W("span", {
|
|
5128
5128
|
style: E({
|
|
5129
5129
|
display: "flex",
|
|
@@ -5142,11 +5142,11 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5142
5142
|
}
|
|
5143
5143
|
}, U(c), 1)), 64))
|
|
5144
5144
|
], 4)
|
|
5145
|
-
])) : (B(), P("span",
|
|
5145
|
+
])) : (B(), P("span", dn, U(h.value), 1))
|
|
5146
5146
|
], 64))), 128))
|
|
5147
5147
|
]));
|
|
5148
5148
|
}
|
|
5149
|
-
}),
|
|
5149
|
+
}), pn = { style: { flex: 1, opacity: 0.8 } }, ho = /* @__PURE__ */ lt({
|
|
5150
5150
|
__name: "PieLegend",
|
|
5151
5151
|
props: {
|
|
5152
5152
|
seriesId: {},
|
|
@@ -5154,12 +5154,12 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5154
5154
|
format: { type: Function, default: void 0 }
|
|
5155
5155
|
},
|
|
5156
5156
|
setup(s) {
|
|
5157
|
-
const t = s, e = D(() => t.mode ?? "both"), i = D(() => t.format ?? le), a = ut(), n =
|
|
5157
|
+
const t = s, e = D(() => t.mode ?? "both"), i = D(() => t.format ?? le), a = ut(), n = Qa(), o = re(), r = D(() => typeof o.default == "function"), h = G(0), d = () => {
|
|
5158
5158
|
h.value++;
|
|
5159
5159
|
};
|
|
5160
5160
|
at(() => {
|
|
5161
5161
|
a.on("overlayChange", d), a.getSeriesIds().length > 0 && h.value++;
|
|
5162
|
-
}),
|
|
5162
|
+
}), nt(() => {
|
|
5163
5163
|
a.off("overlayChange", d);
|
|
5164
5164
|
});
|
|
5165
5165
|
function c(y, x) {
|
|
@@ -5168,7 +5168,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5168
5168
|
return v.length > 0 ? v[0] : null;
|
|
5169
5169
|
}
|
|
5170
5170
|
const u = D(() => n.value), g = D(() => (h.value, c(a, t.seriesId))), f = D(() => (h.value, g.value === null ? [] : a.getSliceInfo(g.value) ?? []));
|
|
5171
|
-
return (y, x) => r.value && f.value.length > 0 ?
|
|
5171
|
+
return (y, x) => r.value && f.value.length > 0 ? Et(y.$slots, "default", {
|
|
5172
5172
|
key: 0,
|
|
5173
5173
|
slices: f.value,
|
|
5174
5174
|
mode: e.value,
|
|
@@ -5193,7 +5193,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5193
5193
|
W("span", {
|
|
5194
5194
|
style: E({ width: "10px", height: "10px", borderRadius: "50%", background: v.color, flexShrink: 0 })
|
|
5195
5195
|
}, null, 4),
|
|
5196
|
-
W("span",
|
|
5196
|
+
W("span", pn, U(v.label), 1),
|
|
5197
5197
|
e.value === "value" || e.value === "both" ? (B(), P("span", {
|
|
5198
5198
|
key: 0,
|
|
5199
5199
|
style: E({
|
|
@@ -5217,19 +5217,19 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5217
5217
|
]))), 128))
|
|
5218
5218
|
], 4)) : tt("", !0);
|
|
5219
5219
|
}
|
|
5220
|
-
}),
|
|
5220
|
+
}), mn = { style: { display: "flex", alignItems: "center", gap: "8px" } }, gn = { style: { fontWeight: 600 } }, vn = { style: { display: "flex", justifyContent: "space-between", gap: "16px" } }, bn = { style: { opacity: 0.6 } }, yn = { style: { fontWeight: 600 } }, xn = ["data-measured"], wn = 160, Sn = 70, co = /* @__PURE__ */ lt({
|
|
5221
5221
|
__name: "PieTooltip",
|
|
5222
5222
|
props: {
|
|
5223
5223
|
seriesId: {},
|
|
5224
5224
|
format: { type: Function }
|
|
5225
5225
|
},
|
|
5226
5226
|
setup(s) {
|
|
5227
|
-
const t = s, e = D(() => t.format ?? le), i = ut(), a =
|
|
5227
|
+
const t = s, e = D(() => t.format ?? le), i = ut(), a = Ye(i), n = re(), o = D(() => typeof n.default == "function"), r = G(0), h = () => {
|
|
5228
5228
|
r.value++;
|
|
5229
5229
|
};
|
|
5230
5230
|
at(() => {
|
|
5231
5231
|
i.on("overlayChange", h);
|
|
5232
|
-
}),
|
|
5232
|
+
}), nt(() => {
|
|
5233
5233
|
i.off("overlayChange", h);
|
|
5234
5234
|
});
|
|
5235
5235
|
function d(p, C) {
|
|
@@ -5239,7 +5239,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5239
5239
|
}
|
|
5240
5240
|
const c = D(() => (r.value, i.getTheme())), u = D(() => (r.value, d(i, t.seriesId))), g = D(() => (a.value, r.value, u.value === null ? null : i.getHoverInfo(u.value))), f = G(null), y = G(null);
|
|
5241
5241
|
let x = null;
|
|
5242
|
-
|
|
5242
|
+
Bi((p) => {
|
|
5243
5243
|
if (!o.value) return;
|
|
5244
5244
|
const C = f.value;
|
|
5245
5245
|
!C || typeof ResizeObserver > "u" || (x = new ResizeObserver((b) => {
|
|
@@ -5273,8 +5273,8 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5273
5273
|
y: a.value.mediaY,
|
|
5274
5274
|
chartWidth: p.width,
|
|
5275
5275
|
chartHeight: p.height,
|
|
5276
|
-
tooltipWidth:
|
|
5277
|
-
tooltipHeight:
|
|
5276
|
+
tooltipWidth: wn,
|
|
5277
|
+
tooltipHeight: Sn,
|
|
5278
5278
|
offsetX: 16,
|
|
5279
5279
|
offsetY: 16
|
|
5280
5280
|
});
|
|
@@ -5303,7 +5303,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5303
5303
|
gap: "6px"
|
|
5304
5304
|
})
|
|
5305
5305
|
}, [
|
|
5306
|
-
W("div",
|
|
5306
|
+
W("div", mn, [
|
|
5307
5307
|
W("span", {
|
|
5308
5308
|
style: E({
|
|
5309
5309
|
width: "10px",
|
|
@@ -5313,11 +5313,11 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5313
5313
|
flexShrink: 0
|
|
5314
5314
|
})
|
|
5315
5315
|
}, null, 4),
|
|
5316
|
-
W("span",
|
|
5316
|
+
W("span", gn, U(g.value.label), 1)
|
|
5317
5317
|
]),
|
|
5318
|
-
W("div",
|
|
5319
|
-
W("span",
|
|
5320
|
-
W("span",
|
|
5318
|
+
W("div", vn, [
|
|
5319
|
+
W("span", bn, U(e.value(g.value.value)), 1),
|
|
5320
|
+
W("span", yn, U(g.value.percent.toFixed(1)) + "%", 1)
|
|
5321
5321
|
])
|
|
5322
5322
|
], 4)) : tt("", !0),
|
|
5323
5323
|
g.value && F(a) && v.value && o.value ? (B(), P("div", {
|
|
@@ -5337,17 +5337,17 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5337
5337
|
visibility: y.value !== null ? "visible" : "hidden"
|
|
5338
5338
|
})
|
|
5339
5339
|
}, [
|
|
5340
|
-
|
|
5340
|
+
Et(p.$slots, "default", {
|
|
5341
5341
|
info: g.value,
|
|
5342
5342
|
format: e.value
|
|
5343
5343
|
})
|
|
5344
|
-
], 12,
|
|
5344
|
+
], 12, xn)) : tt("", !0)
|
|
5345
5345
|
], 64));
|
|
5346
5346
|
}
|
|
5347
|
-
}),
|
|
5347
|
+
}), uo = /* @__PURE__ */ lt({
|
|
5348
5348
|
__name: "TimeAxis",
|
|
5349
5349
|
setup(s) {
|
|
5350
|
-
const t = ut(), e =
|
|
5350
|
+
const t = ut(), e = hs(t), i = /* @__PURE__ */ new Map(), a = D(() => t.getTheme()), n = D(() => {
|
|
5351
5351
|
e.value;
|
|
5352
5352
|
const o = t.getDataInterval(), { ticks: r, tickInterval: h } = t.timeScale.niceTickValues(o), d = new Set(r), c = performance.now();
|
|
5353
5353
|
for (const u of r)
|
|
@@ -5388,21 +5388,21 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5388
5388
|
transition: "opacity 0.3s ease",
|
|
5389
5389
|
willChange: "opacity"
|
|
5390
5390
|
})
|
|
5391
|
-
}, U(F(
|
|
5391
|
+
}, U(F(ze)(h, n.value.tickInterval)), 5))), 128))
|
|
5392
5392
|
], 4));
|
|
5393
5393
|
}
|
|
5394
|
-
}),
|
|
5394
|
+
}), fo = /* @__PURE__ */ lt({
|
|
5395
5395
|
__name: "Title",
|
|
5396
5396
|
props: {
|
|
5397
5397
|
sub: {}
|
|
5398
5398
|
},
|
|
5399
5399
|
setup(s) {
|
|
5400
|
-
const t = Ft(
|
|
5400
|
+
const t = Ft(ns), e = Ft(Se);
|
|
5401
5401
|
if (!t)
|
|
5402
5402
|
throw new Error("<Title> must be used within <ChartContainer>: missing TitleAnchorKey.");
|
|
5403
5403
|
if (!e)
|
|
5404
5404
|
throw new Error("<Title> must be used within <ChartContainer>: missing ThemeKey.");
|
|
5405
|
-
return (i, a) => F(t) ? (B(),
|
|
5405
|
+
return (i, a) => F(t) ? (B(), qe(Qe, {
|
|
5406
5406
|
key: 0,
|
|
5407
5407
|
to: F(t)
|
|
5408
5408
|
}, [
|
|
@@ -5422,7 +5422,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5422
5422
|
})
|
|
5423
5423
|
}, [
|
|
5424
5424
|
W("span", null, [
|
|
5425
|
-
|
|
5425
|
+
Et(i.$slots, "default")
|
|
5426
5426
|
]),
|
|
5427
5427
|
s.sub ? (B(), P("span", {
|
|
5428
5428
|
key: 0,
|
|
@@ -5435,13 +5435,13 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5435
5435
|
], 4)
|
|
5436
5436
|
], 8, ["to"])) : tt("", !0);
|
|
5437
5437
|
}
|
|
5438
|
-
}),
|
|
5438
|
+
}), Cn = {
|
|
5439
5439
|
key: 0,
|
|
5440
5440
|
style: { display: "grid", gridTemplateColumns: "auto 1fr", gap: "4px 12px" }
|
|
5441
|
-
},
|
|
5441
|
+
}, Mn = { style: { opacity: 0.5 } }, kn = {
|
|
5442
5442
|
key: 1,
|
|
5443
5443
|
style: { display: "flex", alignItems: "center", gap: "8px", padding: "2px 0" }
|
|
5444
|
-
},
|
|
5444
|
+
}, Tn = { style: { opacity: 0.6, flex: "1" } }, In = ["data-measured"], po = /* @__PURE__ */ lt({
|
|
5445
5445
|
__name: "Tooltip",
|
|
5446
5446
|
props: {
|
|
5447
5447
|
sort: {},
|
|
@@ -5449,16 +5449,16 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5449
5449
|
},
|
|
5450
5450
|
setup(s) {
|
|
5451
5451
|
const t = s, e = D(() => t.sort ?? "none"), i = D(
|
|
5452
|
-
() => t.format ?? ((w, S) => S === "volume" ? le(w) :
|
|
5453
|
-
), a = ut(), n =
|
|
5452
|
+
() => t.format ?? ((w, S) => S === "volume" ? le(w) : Yi(w))
|
|
5453
|
+
), a = ut(), n = Ye(a), o = G(0), r = () => {
|
|
5454
5454
|
o.value++;
|
|
5455
5455
|
};
|
|
5456
5456
|
at(() => {
|
|
5457
5457
|
a.on("overlayChange", r), a.getSeriesIds().length > 0 && o.value++;
|
|
5458
|
-
}),
|
|
5458
|
+
}), nt(() => {
|
|
5459
5459
|
a.off("overlayChange", r);
|
|
5460
5460
|
});
|
|
5461
|
-
const h = D(() => a.getTheme()), d = D(() => a.getDataInterval()), c = D(() => (o.value, n.value ?
|
|
5461
|
+
const h = D(() => a.getTheme()), d = D(() => a.getDataInterval()), c = D(() => (o.value, n.value ? Zi(a, {
|
|
5462
5462
|
time: n.value.time,
|
|
5463
5463
|
sort: e.value,
|
|
5464
5464
|
cacheKey: "tooltip"
|
|
@@ -5467,7 +5467,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5467
5467
|
return ((w = n.value) == null ? void 0 : w.time) ?? 0;
|
|
5468
5468
|
}), g = re(), f = D(() => typeof g.default == "function"), y = G(null), x = G(null);
|
|
5469
5469
|
let v = null;
|
|
5470
|
-
|
|
5470
|
+
Bi((w) => {
|
|
5471
5471
|
if (!f.value) return;
|
|
5472
5472
|
const S = y.value;
|
|
5473
5473
|
!S || typeof ResizeObserver > "u" || (v = new ResizeObserver((T) => {
|
|
@@ -5540,11 +5540,11 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5540
5540
|
borderBottom: "1px solid " + h.value.tooltip.borderColor,
|
|
5541
5541
|
letterSpacing: "0.02em"
|
|
5542
5542
|
})
|
|
5543
|
-
}, U(F(
|
|
5543
|
+
}, U(F(js)(u.value)) + " " + U(F(ze)(u.value, d.value)), 5),
|
|
5544
5544
|
(B(!0), P(j, null, bt(c.value, (T) => (B(), P(j, {
|
|
5545
5545
|
key: T.id
|
|
5546
5546
|
}, [
|
|
5547
|
-
b(T.data) ? (B(), P("div",
|
|
5547
|
+
b(T.data) ? (B(), P("div", Cn, [
|
|
5548
5548
|
(B(!0), P(j, null, bt([
|
|
5549
5549
|
{ label: "Open", val: T.data.open, field: "open" },
|
|
5550
5550
|
{ label: "High", val: T.data.high, field: "high" },
|
|
@@ -5553,7 +5553,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5553
5553
|
], (m) => (B(), P(j, {
|
|
5554
5554
|
key: m.label
|
|
5555
5555
|
}, [
|
|
5556
|
-
W("span",
|
|
5556
|
+
W("span", Mn, U(m.label), 1),
|
|
5557
5557
|
W("span", {
|
|
5558
5558
|
style: E({
|
|
5559
5559
|
fontWeight: 600,
|
|
@@ -5568,7 +5568,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5568
5568
|
style: E({ fontWeight: 600, color: h.value.tooltip.textColor, textAlign: "right" })
|
|
5569
5569
|
}, U(i.value(T.data.volume, "volume")), 5)
|
|
5570
5570
|
], 64)) : tt("", !0)
|
|
5571
|
-
])) : (B(), P("div",
|
|
5571
|
+
])) : (B(), P("div", kn, [
|
|
5572
5572
|
W("span", {
|
|
5573
5573
|
style: E({
|
|
5574
5574
|
width: "8px",
|
|
@@ -5578,7 +5578,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5578
5578
|
flexShrink: 0
|
|
5579
5579
|
})
|
|
5580
5580
|
}, null, 4),
|
|
5581
|
-
W("span",
|
|
5581
|
+
W("span", Tn, U(T.label ?? "Value"), 1),
|
|
5582
5582
|
W("span", {
|
|
5583
5583
|
style: E({ fontWeight: 600, color: T.color })
|
|
5584
5584
|
}, U(i.value(T.data.value, "value")), 5)
|
|
@@ -5613,34 +5613,21 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5613
5613
|
visibility: x.value !== null ? "visible" : "hidden"
|
|
5614
5614
|
})
|
|
5615
5615
|
}, [
|
|
5616
|
-
|
|
5616
|
+
Et(w.$slots, "default", {
|
|
5617
5617
|
snapshots: c.value,
|
|
5618
5618
|
time: u.value
|
|
5619
5619
|
})
|
|
5620
|
-
], 12,
|
|
5620
|
+
], 12, In)) : tt("", !0)
|
|
5621
5621
|
], 64));
|
|
5622
5622
|
}
|
|
5623
|
-
}),
|
|
5624
|
-
__name: "TooltipLegend",
|
|
5625
|
-
setup(s) {
|
|
5626
|
-
return (t, e) => (B(), ze(ln, ci(ui(t.$attrs)), gs({ _: 2 }, [
|
|
5627
|
-
t.$slots.default ? {
|
|
5628
|
-
name: "default",
|
|
5629
|
-
fn: vs((i) => [
|
|
5630
|
-
Bt(t.$slots, "default", ci(ui(i)))
|
|
5631
|
-
]),
|
|
5632
|
-
key: "0"
|
|
5633
|
-
} : void 0
|
|
5634
|
-
]), 1040));
|
|
5635
|
-
}
|
|
5636
|
-
}), xo = /* @__PURE__ */ nt({
|
|
5623
|
+
}), mo = /* @__PURE__ */ lt({
|
|
5637
5624
|
__name: "YAxis",
|
|
5638
5625
|
props: {
|
|
5639
5626
|
format: { type: Function }
|
|
5640
5627
|
},
|
|
5641
5628
|
setup(s) {
|
|
5642
|
-
const t = s, e = ut(), i =
|
|
5643
|
-
at(a), ft(() => t.format, a),
|
|
5629
|
+
const t = s, e = ut(), i = hs(e), a = () => e.yScale.setFormat(t.format ?? null);
|
|
5630
|
+
at(a), ft(() => t.format, a), nt(() => e.yScale.setFormat(null));
|
|
5644
5631
|
const n = /* @__PURE__ */ new Map(), o = D(() => e.getTheme()), r = D(() => {
|
|
5645
5632
|
i.value;
|
|
5646
5633
|
const h = e.yScale.niceTickValues(), d = new Set(h), c = performance.now();
|
|
@@ -5681,7 +5668,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5681
5668
|
}, U(F(e).yScale.formatY(c)), 5))), 128))
|
|
5682
5669
|
], 4));
|
|
5683
5670
|
}
|
|
5684
|
-
}),
|
|
5671
|
+
}), go = /* @__PURE__ */ lt({
|
|
5685
5672
|
__name: "YLabel",
|
|
5686
5673
|
props: {
|
|
5687
5674
|
seriesId: {},
|
|
@@ -5694,7 +5681,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5694
5681
|
};
|
|
5695
5682
|
at(() => {
|
|
5696
5683
|
e.setYLabel(!0), e.on("overlayChange", o), e.on("viewportChange", o), e.getSeriesIds().length > 0 && n.value++;
|
|
5697
|
-
}),
|
|
5684
|
+
}), nt(() => {
|
|
5698
5685
|
e.setYLabel(!1), e.off("overlayChange", o), e.off("viewportChange", o);
|
|
5699
5686
|
});
|
|
5700
5687
|
function r(p, C) {
|
|
@@ -5730,7 +5717,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5730
5717
|
return (C) => p.format(C);
|
|
5731
5718
|
});
|
|
5732
5719
|
return (p, C) => d.value !== null ? (B(), P(j, { key: 0 }, [
|
|
5733
|
-
a.value ?
|
|
5720
|
+
a.value ? Et(p.$slots, "default", {
|
|
5734
5721
|
key: 0,
|
|
5735
5722
|
value: d.value.value,
|
|
5736
5723
|
y: g.value,
|
|
@@ -5770,7 +5757,7 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5770
5757
|
transition: "background-color 0.3s ease"
|
|
5771
5758
|
})
|
|
5772
5759
|
}, [
|
|
5773
|
-
|
|
5760
|
+
ps(fn, {
|
|
5774
5761
|
value: d.value.value,
|
|
5775
5762
|
format: v.value,
|
|
5776
5763
|
"spin-duration": 350
|
|
@@ -5781,63 +5768,62 @@ const ho = /* @__PURE__ */ nt({
|
|
|
5781
5768
|
}
|
|
5782
5769
|
});
|
|
5783
5770
|
export {
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
Wn as catppuccin,
|
|
5771
|
+
Qn as BarSeries,
|
|
5772
|
+
Zn as CandlestickSeries,
|
|
5773
|
+
to as ChartContainer,
|
|
5774
|
+
Ya as ChartInstance,
|
|
5775
|
+
oo as Crosshair,
|
|
5776
|
+
ro as InfoBar,
|
|
5777
|
+
lo as Legend,
|
|
5778
|
+
ao as LineSeries,
|
|
5779
|
+
fn as NumberFlow,
|
|
5780
|
+
ho as PieLegend,
|
|
5781
|
+
no as PieSeries,
|
|
5782
|
+
co as PieTooltip,
|
|
5783
|
+
uo as TimeAxis,
|
|
5784
|
+
fo as Title,
|
|
5785
|
+
po as Tooltip,
|
|
5786
|
+
mo as YAxis,
|
|
5787
|
+
go as YLabel,
|
|
5788
|
+
_n as andromeda,
|
|
5789
|
+
Fn as ayuMirage,
|
|
5790
|
+
Zi as buildHoverSnapshots,
|
|
5791
|
+
Ea as buildLastSnapshots,
|
|
5792
|
+
Bn as catppuccin,
|
|
5807
5793
|
Pe as computeTooltipPosition,
|
|
5808
5794
|
et as createTheme,
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5795
|
+
Gi as darkTheme,
|
|
5796
|
+
Gs as detectInterval,
|
|
5797
|
+
Dn as dracula,
|
|
5812
5798
|
le as formatCompact,
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5799
|
+
js as formatDate,
|
|
5800
|
+
Yi as formatPriceAdaptive,
|
|
5801
|
+
ze as formatTime,
|
|
5802
|
+
Pn as githubLight,
|
|
5803
|
+
zn as gruvbox,
|
|
5804
|
+
An as handwritten,
|
|
5805
|
+
Wn as highContrast,
|
|
5806
|
+
Vn as lavenderMist,
|
|
5807
|
+
Yn as lightPink,
|
|
5808
|
+
Ln as lightTheme,
|
|
5809
|
+
En as materialPalenight,
|
|
5810
|
+
$n as minimalLight,
|
|
5811
|
+
Hn as mintBreeze,
|
|
5812
|
+
On as monokaiPro,
|
|
5813
|
+
Xn as nightOwl,
|
|
5828
5814
|
oe as normalizeTime,
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5815
|
+
Nn as oneDarkPro,
|
|
5816
|
+
Un as panda,
|
|
5817
|
+
Gn as peachCream,
|
|
5818
|
+
jn as quietLight,
|
|
5819
|
+
Kn as rosePineDawn,
|
|
5820
|
+
Jn as sandDune,
|
|
5821
|
+
qn as solarizedLight,
|
|
5836
5822
|
ut as useChartInstance,
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5823
|
+
Ye as useCrosshairPosition,
|
|
5824
|
+
io as useLastYValue,
|
|
5825
|
+
so as usePreviousClose,
|
|
5826
|
+
Qa as useTheme,
|
|
5827
|
+
hs as useVisibleRange,
|
|
5828
|
+
eo as useYRange
|
|
5843
5829
|
};
|