@wick-charts/vue 0.1.1 → 0.1.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/dist/index.d.ts +554 -129
- package/dist/index.js +438 -451
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
var
|
|
1
|
+
import { inject as xe, defineComponent as Z, ref as tt, onMounted as q, onUnmounted as et, watch as st, createCommentVNode as K, shallowRef as le, provide as he, computed as P, openBlock as R, createElementBlock as T, normalizeStyle as z, renderSlot as Oe, unref as W, Fragment as O, createElementVNode as _, toDisplayString as I, renderList as ct, createVNode as $e } from "vue";
|
|
2
|
+
var Xe = Object.defineProperty, Ce = (r) => {
|
|
3
3
|
throw TypeError(r);
|
|
4
|
-
},
|
|
4
|
+
}, He = (r, t, e) => t in r ? Xe(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, x = (r, t, e) => He(r, typeof t != "symbol" ? t + "" : t, e), jt = (r, t, e) => t.has(r) || Ce("Cannot " + e), h = (r, t, e) => (jt(r, t, "read from private field"), e ? e.call(r) : t.get(r)), A = (r, t, e) => t.has(r) ? Ce("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), M = (r, t, e, o) => (jt(r, t, "write to private field"), t.set(r, e), e), It = (r, t, e) => (jt(r, t, "access private method"), e), ce = (r, t, e, o) => ({
|
|
5
5
|
set _(i) {
|
|
6
6
|
M(r, t, i);
|
|
7
7
|
},
|
|
@@ -9,7 +9,7 @@ var He = Object.defineProperty, we = (r) => {
|
|
|
9
9
|
return h(r, t, o);
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
class
|
|
12
|
+
class Pt {
|
|
13
13
|
constructor() {
|
|
14
14
|
x(this, "listeners", /* @__PURE__ */ new Map());
|
|
15
15
|
}
|
|
@@ -33,7 +33,7 @@ function de(r, t, e) {
|
|
|
33
33
|
const o = document.createElement("canvas");
|
|
34
34
|
return o.style.position = "absolute", o.style.inset = "0", o.style.width = "100%", o.style.height = "100%", o.style.display = "block", o.style.zIndex = String(t), r.appendChild(o), o;
|
|
35
35
|
}
|
|
36
|
-
class
|
|
36
|
+
class Ge extends Pt {
|
|
37
37
|
constructor(t) {
|
|
38
38
|
super(), x(this, "mainCanvas"), x(this, "mainCtx"), x(this, "overlayCanvas"), x(this, "overlayCtx"), x(this, "resizeObserver"), x(this, "_size"), x(this, "supportsDevicePixelContentBox", !1), this.mainCanvas = de(t, 0), this.overlayCanvas = de(t, 1), this.mainCtx = this.mainCanvas.getContext("2d", { alpha: !0 }), this.overlayCtx = this.overlayCanvas.getContext("2d", { alpha: !0 });
|
|
39
39
|
const e = window.devicePixelRatio || 1;
|
|
@@ -122,13 +122,13 @@ class Ne extends Ft {
|
|
|
122
122
|
this.resizeObserver.disconnect(), this.mainCanvas.remove(), this.overlayCanvas.remove(), this.removeAllListeners();
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Ne(r, t, e, o) {
|
|
126
126
|
const { context: i, bitmapSize: a, horizontalPixelRatio: s } = r;
|
|
127
127
|
i.strokeStyle = o.crosshair.color, i.lineWidth = 1, i.setLineDash([4 * s, 4 * s]);
|
|
128
128
|
const n = Math.round(t) + 0.5, l = Math.round(e) + 0.5;
|
|
129
129
|
i.beginPath(), i.moveTo(n, 0), i.lineTo(n, a.height), i.moveTo(0, l), i.lineTo(a.width, l), i.stroke(), i.setLineDash([]);
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function Je(r, t, e, o, i) {
|
|
132
132
|
const { context: a, bitmapSize: s, horizontalPixelRatio: n, verticalPixelRatio: l } = r;
|
|
133
133
|
a.strokeStyle = o.grid.color, a.lineWidth = 1, o.grid.style === "dashed" ? a.setLineDash([4 * n, 4 * n]) : o.grid.style === "dotted" && a.setLineDash([1 * n, 3 * n]);
|
|
134
134
|
const c = e.niceTickValues();
|
|
@@ -159,7 +159,7 @@ function Ht(r, t, e) {
|
|
|
159
159
|
}
|
|
160
160
|
return o;
|
|
161
161
|
}
|
|
162
|
-
class Kt extends
|
|
162
|
+
class Kt extends Pt {
|
|
163
163
|
constructor() {
|
|
164
164
|
super(...arguments), x(this, "data", []), x(this, "_visible", !0), x(this, "cachedRange", null), x(this, "cachedResult", []);
|
|
165
165
|
}
|
|
@@ -220,7 +220,7 @@ class Kt extends Ft {
|
|
|
220
220
|
return i;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
class
|
|
223
|
+
class je {
|
|
224
224
|
constructor(t, e, o) {
|
|
225
225
|
x(this, "dragging", !1), x(this, "lastX", 0), this.viewport = t, this.timeScale = e, this.canvas = o;
|
|
226
226
|
}
|
|
@@ -241,20 +241,20 @@ class Ke {
|
|
|
241
241
|
return this.dragging;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
class
|
|
244
|
+
class Ke {
|
|
245
245
|
constructor(t, e) {
|
|
246
246
|
this.viewport = t, this.timeScale = e;
|
|
247
247
|
}
|
|
248
248
|
handleWheel(t) {
|
|
249
249
|
t.preventDefault();
|
|
250
|
-
const e =
|
|
250
|
+
const e = qe(t.deltaY, t.deltaMode), o = Math.exp(e * 5e-3), i = this.timeScale.getMediaWidth(), a = Math.min(t.offsetX, i), s = this.timeScale.xToTime(a);
|
|
251
251
|
this.viewport.zoomAt(s, o);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function qe(r, t) {
|
|
255
255
|
return t === WheelEvent.DOM_DELTA_LINE ? r * 8 : t === WheelEvent.DOM_DELTA_PAGE ? r * 24 : r;
|
|
256
256
|
}
|
|
257
|
-
class
|
|
257
|
+
class Qe extends Pt {
|
|
258
258
|
constructor(t, e, o, i) {
|
|
259
259
|
super(), x(this, "zoom"), x(this, "pan"), x(this, "canvas"), x(this, "timeScale"), x(this, "yScale"), x(this, "viewport"), x(this, "onWheel", (a) => {
|
|
260
260
|
this.zoom.handleWheel(a);
|
|
@@ -289,7 +289,7 @@ class Ze extends Ft {
|
|
|
289
289
|
}
|
|
290
290
|
}), x(this, "onTouchEnd", (a) => {
|
|
291
291
|
a.touches.length === 0 && (this.pan.handleMouseUp(), this.touchCount = 0, this.lastTouchDist = 0);
|
|
292
|
-
}), this.canvas = t, this.viewport = e, this.timeScale = o, this.yScale = i, this.zoom = new
|
|
292
|
+
}), this.canvas = t, this.viewport = e, this.timeScale = o, this.yScale = i, this.zoom = new Ke(e, o), this.pan = new je(e, o, 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);
|
|
293
293
|
}
|
|
294
294
|
emitCrosshair(t, e) {
|
|
295
295
|
const o = this.timeScale.xToTime(t), i = this.yScale.yToValue(e);
|
|
@@ -318,16 +318,16 @@ class fe {
|
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
const xt = 6e4, vt = 36e5, ft = 864e5;
|
|
321
|
-
function
|
|
321
|
+
function Yt(r) {
|
|
322
322
|
return r instanceof Date ? r.getTime() : r;
|
|
323
323
|
}
|
|
324
|
+
function Ze(r) {
|
|
325
|
+
return r.length === 0 || !r.some((t) => t.time instanceof Date) ? r : r.map((t) => ({ ...t, time: Yt(t.time) }));
|
|
326
|
+
}
|
|
324
327
|
function to(r) {
|
|
325
|
-
return r.length === 0 ||
|
|
328
|
+
return r.length === 0 || !r.some((t) => t.time instanceof Date) ? r : r.map((t) => ({ ...t, time: Yt(t.time) }));
|
|
326
329
|
}
|
|
327
330
|
function eo(r) {
|
|
328
|
-
return r.length === 0 || typeof r[0].time == "number" ? r : r.map((t) => ({ ...t, time: t.time.getTime() }));
|
|
329
|
-
}
|
|
330
|
-
function oo(r) {
|
|
331
331
|
if (r.length < 2) return ft;
|
|
332
332
|
const t = [];
|
|
333
333
|
for (let e = 1; e < Math.min(r.length, 20); e++)
|
|
@@ -343,14 +343,14 @@ function Ut(r, t) {
|
|
|
343
343
|
hour12: !1
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function oo(r) {
|
|
347
347
|
return new Date(r).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function io(r) {
|
|
350
350
|
const t = [1e3, 5e3, 1e4, 15e3, 3e4], e = [xt, 5 * xt, 10 * xt, 15 * xt, 30 * xt], o = [vt, 2 * vt, 4 * vt, 6 * vt, 12 * vt], i = [ft, 7 * ft, 30 * ft, 90 * ft, 365 * ft];
|
|
351
351
|
return r < xt ? [...t, ...e, ...o, ...i] : r < vt ? [...e, ...o, ...i] : r < ft ? [...o, ...i] : i;
|
|
352
352
|
}
|
|
353
|
-
class
|
|
353
|
+
class ao {
|
|
354
354
|
constructor() {
|
|
355
355
|
x(this, "from", 0), x(this, "to", 0), x(this, "width", 1), x(this, "pixelRatio", 1);
|
|
356
356
|
}
|
|
@@ -377,7 +377,7 @@ class so {
|
|
|
377
377
|
}
|
|
378
378
|
niceTickValues(t) {
|
|
379
379
|
if (this.to <= this.from) return { ticks: [], tickInterval: 0 };
|
|
380
|
-
const e =
|
|
380
|
+
const e = io(t), o = (this.to - this.from) / this.width * 80;
|
|
381
381
|
let i = e[e.length - 1];
|
|
382
382
|
for (const n of e)
|
|
383
383
|
if (n >= o) {
|
|
@@ -425,7 +425,7 @@ const Gt = [
|
|
|
425
425
|
2e4,
|
|
426
426
|
5e4
|
|
427
427
|
];
|
|
428
|
-
class
|
|
428
|
+
class so {
|
|
429
429
|
constructor() {
|
|
430
430
|
x(this, "min", 0), x(this, "max", 0), x(this, "height", 1), x(this, "pixelRatio", 1);
|
|
431
431
|
}
|
|
@@ -472,14 +472,14 @@ class ro {
|
|
|
472
472
|
return e < 0.01 ? t.toFixed(6) : e < 0.1 ? t.toFixed(4) : e < 10 ? t.toFixed(2) : e < 1e3 ? t.toFixed(1) : t.toFixed(0);
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
const
|
|
475
|
+
const ro = {
|
|
476
476
|
colors: ["#26a69a", "#ef5350"],
|
|
477
477
|
barWidthRatio: 0.6,
|
|
478
478
|
stacking: "off"
|
|
479
479
|
};
|
|
480
480
|
class nt {
|
|
481
481
|
constructor(t, e) {
|
|
482
|
-
x(this, "stores"), x(this, "options"), this.stores = Array.from({ length: t }, () => new Kt()), this.options = { ...
|
|
482
|
+
x(this, "stores"), x(this, "options"), this.stores = Array.from({ length: t }, () => new Kt()), this.options = { ...ro, ...e };
|
|
483
483
|
}
|
|
484
484
|
/** For chart compatibility — returns first store */
|
|
485
485
|
get store() {
|
|
@@ -600,21 +600,21 @@ class nt {
|
|
|
600
600
|
}
|
|
601
601
|
if (e) {
|
|
602
602
|
let k = 0, D = 0;
|
|
603
|
-
for (const
|
|
604
|
-
|
|
603
|
+
for (const L of p)
|
|
604
|
+
L > 0 ? k += L : D += L;
|
|
605
605
|
if (m > 0 && k > 0) {
|
|
606
|
-
const
|
|
607
|
-
this.fillBar(n, f - u, $, d,
|
|
606
|
+
const L = y / k * 100, N = (y + m) / k * 100, $ = a.valueToBitmapY(N), Q = a.valueToBitmapY(L), G = Math.max(1, Q - $);
|
|
607
|
+
this.fillBar(n, f - u, $, d, G, w);
|
|
608
608
|
} else if (m < 0 && D < 0) {
|
|
609
|
-
const
|
|
610
|
-
n.fillStyle = w, n.fillRect(f - u, $, d,
|
|
609
|
+
const L = F / D * -100, N = (F + m) / D * -100, $ = a.valueToBitmapY(L), Q = a.valueToBitmapY(N), G = Math.max(1, Q - $);
|
|
610
|
+
n.fillStyle = w, n.fillRect(f - u, $, d, G);
|
|
611
611
|
}
|
|
612
612
|
} else if (m > 0) {
|
|
613
|
-
const k = a.valueToBitmapY(y + m), D = a.valueToBitmapY(y),
|
|
614
|
-
this.fillBar(n, f - u, k, d,
|
|
613
|
+
const k = a.valueToBitmapY(y + m), D = a.valueToBitmapY(y), L = Math.max(1, D - k);
|
|
614
|
+
this.fillBar(n, f - u, k, d, L, w);
|
|
615
615
|
} else {
|
|
616
|
-
const k = a.valueToBitmapY(F), D = a.valueToBitmapY(F + m),
|
|
617
|
-
n.fillStyle = w, n.fillRect(f - u, k, d,
|
|
616
|
+
const k = a.valueToBitmapY(F), D = a.valueToBitmapY(F + m), L = Math.max(1, D - k);
|
|
617
|
+
n.fillStyle = w, n.fillRect(f - u, k, d, L);
|
|
618
618
|
}
|
|
619
619
|
}
|
|
620
620
|
}
|
|
@@ -623,15 +623,15 @@ class nt {
|
|
|
623
623
|
t.fillStyle = s, t.fillRect(e, o, i, a);
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
function
|
|
627
|
-
return r.length <= t ? r :
|
|
626
|
+
function pe(r, t) {
|
|
627
|
+
return r.length <= t ? r : lo(
|
|
628
628
|
r,
|
|
629
629
|
t,
|
|
630
630
|
(e) => e.time,
|
|
631
631
|
(e) => e.value
|
|
632
632
|
);
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function no(r, t) {
|
|
635
635
|
if (r.length <= t) return r;
|
|
636
636
|
const e = Math.ceil(r.length / t), o = [];
|
|
637
637
|
for (let i = 0; i < r.length; i += e) {
|
|
@@ -650,7 +650,7 @@ function lo(r, t) {
|
|
|
650
650
|
}
|
|
651
651
|
return o;
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function lo(r, t, e, o) {
|
|
654
654
|
if (t >= r.length || t < 3) return r;
|
|
655
655
|
const i = [r[0]], a = (r.length - 2) / (t - 2);
|
|
656
656
|
let s = 0;
|
|
@@ -673,45 +673,45 @@ function ho(r, t, e, o) {
|
|
|
673
673
|
}
|
|
674
674
|
return i.push(r[r.length - 1]), i;
|
|
675
675
|
}
|
|
676
|
-
const
|
|
676
|
+
const ge = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map(), be = /* @__PURE__ */ new Map();
|
|
677
677
|
function qt(r) {
|
|
678
678
|
return [parseInt(r.slice(1, 3), 16), parseInt(r.slice(3, 5), 16), parseInt(r.slice(5, 7), 16)];
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function we(r, t, e) {
|
|
681
681
|
return `#${r.toString(16).padStart(2, "0")}${t.toString(16).padStart(2, "0")}${e.toString(16).padStart(2, "0")}`;
|
|
682
682
|
}
|
|
683
683
|
function Mt(r, t) {
|
|
684
684
|
if (r.startsWith("rgba")) return r.replace(/[\d.]+\)\s*$/, `${t})`);
|
|
685
685
|
if (r.startsWith("rgb(")) return r.replace(/^rgb\((.*)\)$/i, `rgba($1, ${t})`);
|
|
686
686
|
const e = r + t;
|
|
687
|
-
let o =
|
|
687
|
+
let o = ge.get(e);
|
|
688
688
|
if (o) return o;
|
|
689
689
|
const [i, a, s] = qt(r);
|
|
690
|
-
return o = `rgba(${i}, ${a}, ${s}, ${t})`,
|
|
690
|
+
return o = `rgba(${i}, ${a}, ${s}, ${t})`, ge.set(e, o), o;
|
|
691
691
|
}
|
|
692
|
-
function
|
|
692
|
+
function ho(r, t) {
|
|
693
693
|
const e = r + t;
|
|
694
|
-
let o =
|
|
694
|
+
let o = me.get(e);
|
|
695
695
|
if (o) return o;
|
|
696
696
|
const [i, a, s] = qt(r);
|
|
697
|
-
return o =
|
|
697
|
+
return o = we(
|
|
698
698
|
Math.min(255, Math.round(i + (255 - i) * t)),
|
|
699
699
|
Math.min(255, Math.round(a + (255 - a) * t)),
|
|
700
700
|
Math.min(255, Math.round(s + (255 - s) * t))
|
|
701
|
-
),
|
|
701
|
+
), me.set(e, o), o;
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function co(r, t) {
|
|
704
704
|
const e = r + t;
|
|
705
|
-
let o =
|
|
705
|
+
let o = be.get(e);
|
|
706
706
|
if (o) return o;
|
|
707
707
|
const [i, a, s] = qt(r);
|
|
708
|
-
return o =
|
|
708
|
+
return o = we(
|
|
709
709
|
Math.max(0, Math.round(i * (1 - t))),
|
|
710
710
|
Math.max(0, Math.round(a * (1 - t))),
|
|
711
711
|
Math.max(0, Math.round(s * (1 - t)))
|
|
712
|
-
),
|
|
712
|
+
), be.set(e, o), o;
|
|
713
713
|
}
|
|
714
|
-
const
|
|
714
|
+
const uo = {
|
|
715
715
|
upColor: "#26a69a",
|
|
716
716
|
downColor: "#ef5350",
|
|
717
717
|
wickUpColor: "#26a69a",
|
|
@@ -720,7 +720,7 @@ const fo = {
|
|
|
720
720
|
};
|
|
721
721
|
class Nt {
|
|
722
722
|
constructor(t, e) {
|
|
723
|
-
x(this, "store"), x(this, "options"), this.store = t, this.options = { ...
|
|
723
|
+
x(this, "store"), x(this, "options"), this.store = t, this.options = { ...uo, ...e };
|
|
724
724
|
}
|
|
725
725
|
updateOptions(t) {
|
|
726
726
|
this.options = { ...this.options, ...t };
|
|
@@ -732,7 +732,7 @@ class Nt {
|
|
|
732
732
|
const { scope: e, timeScale: o, yScale: i, dataInterval: a } = t, { context: s, horizontalPixelRatio: n } = e, l = o.getRange();
|
|
733
733
|
let c = this.store.getVisibleData(l.from, l.to);
|
|
734
734
|
const d = e.mediaSize.width;
|
|
735
|
-
if (c.length > d * 2 && (c =
|
|
735
|
+
if (c.length > d * 2 && (c = no(c, Math.round(d * 1.5))), c.length === 0) return;
|
|
736
736
|
const u = o.barWidthBitmap(a), b = Math.max(1, Math.round(u * this.options.bodyWidthRatio) - 2), v = Math.floor(b / 2), C = Math.max(1, Math.round(n)), w = Math.round(i.getMediaHeight() * e.verticalPixelRatio);
|
|
737
737
|
this.drawVolume(s, c, o, w, u, a);
|
|
738
738
|
const g = [], p = [];
|
|
@@ -779,7 +779,7 @@ class Nt {
|
|
|
779
779
|
const C = o.timeToBitmapX(v.time), w = i.valueToBitmapY(v.high), g = i.valueToBitmapY(v.low), p = C - Math.floor(n / 2);
|
|
780
780
|
t.fillRect(p, w, n, g - w);
|
|
781
781
|
}
|
|
782
|
-
const d = this.options.candleGradient !== !1, u = d ?
|
|
782
|
+
const d = this.options.candleGradient !== !1, u = d ? ho(l, 0.2) : l, b = d ? co(l, 0.15) : l;
|
|
783
783
|
d || (t.fillStyle = l);
|
|
784
784
|
for (const v of e) {
|
|
785
785
|
const C = o.timeToBitmapX(v.time), w = i.valueToBitmapY(v.open), g = i.valueToBitmapY(v.close), p = Math.min(w, g), m = Math.max(1, Math.abs(g - w));
|
|
@@ -791,16 +791,16 @@ class Nt {
|
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
|
-
const
|
|
794
|
+
const fo = {
|
|
795
795
|
colors: ["#2962FF"],
|
|
796
796
|
lineWidth: 1,
|
|
797
797
|
areaFill: !0,
|
|
798
798
|
pulse: !0,
|
|
799
799
|
stacking: "off"
|
|
800
800
|
};
|
|
801
|
-
class
|
|
801
|
+
class j {
|
|
802
802
|
constructor(t, e) {
|
|
803
|
-
x(this, "stores"), x(this, "options"), x(this, "areaGradientCache", /* @__PURE__ */ new Map()), this.stores = Array.from({ length: t }, () => new Kt()), this.options = { ...
|
|
803
|
+
x(this, "stores"), x(this, "options"), x(this, "areaGradientCache", /* @__PURE__ */ new Map()), this.stores = Array.from({ length: t }, () => new Kt()), this.options = { ...fo, ...e };
|
|
804
804
|
}
|
|
805
805
|
get store() {
|
|
806
806
|
return this.stores[0];
|
|
@@ -859,7 +859,7 @@ class J {
|
|
|
859
859
|
if (!this.stores[d].isVisible()) continue;
|
|
860
860
|
let u = this.stores[d].getVisibleData(s.from, s.to);
|
|
861
861
|
const b = e.mediaSize.width;
|
|
862
|
-
if (u.length > b * 2 && (u =
|
|
862
|
+
if (u.length > b * 2 && (u = pe(u, Math.round(b * 1.5))), u.length < 2) continue;
|
|
863
863
|
const v = this.options.colors[d % this.options.colors.length];
|
|
864
864
|
a.beginPath(), a.moveTo(o.timeToBitmapX(u[0].time), i.valueToBitmapY(u[0].value));
|
|
865
865
|
for (let C = 1; C < u.length; C++)
|
|
@@ -877,7 +877,7 @@ class J {
|
|
|
877
877
|
renderStacked(t, e) {
|
|
878
878
|
const { scope: o, timeScale: i, yScale: a } = t, { context: s } = o, n = i.getRange(), { verticalPixelRatio: l } = o, c = Math.max(1, Math.round(this.options.lineWidth * l)), d = o.mediaSize.width, u = this.stores.map((g) => {
|
|
879
879
|
let p = g.getVisibleData(n.from, n.to);
|
|
880
|
-
return p.length > d * 2 && (p =
|
|
880
|
+
return p.length > d * 2 && (p = pe(p, Math.round(d * 1.5))), p;
|
|
881
881
|
}), b = /* @__PURE__ */ new Set();
|
|
882
882
|
for (const g of u)
|
|
883
883
|
for (const p of g) b.add(p.time);
|
|
@@ -931,13 +931,7 @@ class J {
|
|
|
931
931
|
const s = this.stores[a].last();
|
|
932
932
|
if (!s) continue;
|
|
933
933
|
const n = this.options.colors[a % this.options.colors.length];
|
|
934
|
-
this.drawPulse(
|
|
935
|
-
t,
|
|
936
|
-
e.timeToBitmapX(s.time),
|
|
937
|
-
o.valueToBitmapY(s.value),
|
|
938
|
-
n,
|
|
939
|
-
i
|
|
940
|
-
);
|
|
934
|
+
this.drawPulse(t, e.timeToBitmapX(s.time), o.valueToBitmapY(s.value), n, i);
|
|
941
935
|
}
|
|
942
936
|
}
|
|
943
937
|
drawPulse(t, e, o, i, a) {
|
|
@@ -945,28 +939,28 @@ class J {
|
|
|
945
939
|
t.beginPath(), t.arc(e, o, l, 0, Math.PI * 2), t.fillStyle = Mt(i, n * 0.3), t.fill(), t.beginPath(), t.arc(e, o, s, 0, Math.PI * 2), t.fillStyle = i, t.fill();
|
|
946
940
|
}
|
|
947
941
|
}
|
|
948
|
-
const
|
|
942
|
+
const po = {
|
|
949
943
|
innerRadiusRatio: 0,
|
|
950
944
|
padAngle: 0.02,
|
|
951
945
|
strokeColor: "transparent",
|
|
952
946
|
strokeWidth: 0
|
|
953
|
-
},
|
|
954
|
-
function
|
|
947
|
+
}, Wt = Math.PI * 2;
|
|
948
|
+
function go(r) {
|
|
955
949
|
if (!r.startsWith("#")) return !1;
|
|
956
950
|
const t = parseInt(r.slice(1, 3), 16), e = parseInt(r.slice(3, 5), 16), o = parseInt(r.slice(5, 7), 16);
|
|
957
951
|
return t * 0.299 + e * 0.587 + o * 0.114 > 150;
|
|
958
952
|
}
|
|
959
|
-
function
|
|
953
|
+
function mo(r, t) {
|
|
960
954
|
if (!r.startsWith("#")) return r;
|
|
961
955
|
const e = Math.min(255, parseInt(r.slice(1, 3), 16) + Math.round(255 * t)), o = Math.min(255, parseInt(r.slice(3, 5), 16) + Math.round(255 * t)), i = Math.min(255, parseInt(r.slice(5, 7), 16) + Math.round(255 * t));
|
|
962
956
|
return `#${e.toString(16).padStart(2, "0")}${o.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}`;
|
|
963
957
|
}
|
|
964
|
-
function
|
|
958
|
+
function bo(r, t, e) {
|
|
965
959
|
return r + (t - r) * Math.min(1, e);
|
|
966
960
|
}
|
|
967
961
|
class bt {
|
|
968
962
|
constructor(t) {
|
|
969
|
-
x(this, "data", []), x(this, "options"), x(this, "hoverIndex", -1), x(this, "sliceOffsets", []), x(this, "lastRenderTime", 0), this.options = { ...
|
|
963
|
+
x(this, "data", []), x(this, "options"), x(this, "hoverIndex", -1), x(this, "sliceOffsets", []), x(this, "lastRenderTime", 0), this.options = { ...po, ...t };
|
|
970
964
|
}
|
|
971
965
|
getData() {
|
|
972
966
|
return this.data;
|
|
@@ -989,10 +983,10 @@ class bt {
|
|
|
989
983
|
const s = o / 2, n = i / 2, l = Math.min(o, i) / 2 * 0.85, c = l * this.options.innerRadiusRatio, d = t - s, u = e - n, b = Math.sqrt(d * d + u * u);
|
|
990
984
|
if (b > l || b < c) return -1;
|
|
991
985
|
let v = Math.atan2(u, d) + Math.PI / 2;
|
|
992
|
-
v < 0 && (v +=
|
|
986
|
+
v < 0 && (v += Wt);
|
|
993
987
|
let C = 0;
|
|
994
988
|
for (let w = 0; w < this.data.length; w++) {
|
|
995
|
-
const g = this.data[w].value / a *
|
|
989
|
+
const g = this.data[w].value / a * Wt;
|
|
996
990
|
if (v >= C && v < C + g) return w;
|
|
997
991
|
C += g;
|
|
998
992
|
}
|
|
@@ -1016,30 +1010,30 @@ class bt {
|
|
|
1016
1010
|
for (; this.sliceOffsets.length < this.data.length; ) this.sliceOffsets.push(0);
|
|
1017
1011
|
for (let k = 0; k < this.data.length; k++) {
|
|
1018
1012
|
const D = k === this.hoverIndex ? 1 : 0;
|
|
1019
|
-
this.sliceOffsets[k] =
|
|
1013
|
+
this.sliceOffsets[k] = bo(this.sliceOffsets[k], D, d * l);
|
|
1020
1014
|
}
|
|
1021
1015
|
const u = this.options.colors ?? o.seriesColors, b = a.width / 2, v = a.height / 2, C = Math.min(a.width, a.height) / 2 * 0.85, w = C * this.options.innerRadiusRatio, g = this.options.padAngle, { strokeColor: p, strokeWidth: m } = this.options, f = 8 * s;
|
|
1022
1016
|
let y = -Math.PI / 2;
|
|
1023
1017
|
for (let k = 0; k < this.data.length; k++) {
|
|
1024
|
-
const D = this.data[k],
|
|
1025
|
-
i.beginPath(), i.arc(gt, mt, C,
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1018
|
+
const D = this.data[k], L = D.value / c * Wt, N = y + g / 2, $ = y + L - g / 2, Q = y + L / 2, G = D.color ?? u[k % u.length], pt = this.sliceOffsets[k] * f, J = Math.cos(Q) * pt, Ft = Math.sin(Q) * pt, gt = b + J, mt = v + Ft;
|
|
1019
|
+
i.beginPath(), i.arc(gt, mt, C, N, $), w > 0 ? i.arc(gt, mt, w, $, N, !0) : i.lineTo(gt, mt), i.closePath();
|
|
1020
|
+
const X = i.createRadialGradient(gt, mt, w || 0, gt, mt, C);
|
|
1021
|
+
X.addColorStop(0, mo(G, 0.15)), X.addColorStop(1, G), i.fillStyle = X, this.sliceOffsets[k] > 0.01 && (i.shadowColor = "rgba(0,0,0,0.25)", i.shadowBlur = 12 * s * this.sliceOffsets[k], i.shadowOffsetX = J * 0.3, i.shadowOffsetY = Ft * 0.3), i.fill(), i.shadowColor = "transparent", i.shadowBlur = 0, i.shadowOffsetX = 0, i.shadowOffsetY = 0, m > 0 && p !== "transparent" && (i.strokeStyle = p, i.lineWidth = m, i.stroke()), y += L;
|
|
1028
1022
|
}
|
|
1029
1023
|
y = -Math.PI / 2;
|
|
1030
1024
|
const F = w > 0 ? (C + w) / 2 : C * 0.65;
|
|
1031
1025
|
i.textAlign = "center", i.textBaseline = "middle", i.font = `${11 * s}px ${o.typography.fontFamily}`;
|
|
1032
1026
|
for (let k = 0; k < this.data.length; k++) {
|
|
1033
|
-
const D = this.data[k],
|
|
1034
|
-
if (
|
|
1035
|
-
const
|
|
1036
|
-
i.fillStyle =
|
|
1027
|
+
const D = this.data[k], L = D.value / c * Wt;
|
|
1028
|
+
if (L > 0.3) {
|
|
1029
|
+
const N = y + L / 2, $ = this.sliceOffsets[k] * f, Q = b + Math.cos(N) * (F + $), G = v + Math.sin(N) * (F + $), pt = D.color ?? u[k % u.length];
|
|
1030
|
+
i.fillStyle = go(pt) ? "#000000" : "#ffffff", i.fillText(D.label, Q, G);
|
|
1037
1031
|
}
|
|
1038
|
-
y +=
|
|
1032
|
+
y += L;
|
|
1039
1033
|
}
|
|
1040
1034
|
}
|
|
1041
1035
|
}
|
|
1042
|
-
const
|
|
1036
|
+
const ke = {
|
|
1043
1037
|
background: "#131722",
|
|
1044
1038
|
chartGradient: ["#1a1f2e", "#101318"],
|
|
1045
1039
|
typography: {
|
|
@@ -1104,7 +1098,7 @@ const Se = {
|
|
|
1104
1098
|
right: { intervals: 3 },
|
|
1105
1099
|
left: { intervals: 0 }
|
|
1106
1100
|
};
|
|
1107
|
-
class
|
|
1101
|
+
class vo extends Pt {
|
|
1108
1102
|
constructor({ padding: t } = {}) {
|
|
1109
1103
|
super(), x(this, "_visibleRange", { from: 0, to: 0 }), x(this, "_yRange", { min: 0, max: 0 }), x(this, "_autoScroll", !0), x(this, "padding"), x(this, "dataInterval", 6e4), x(this, "_dataStart", null), x(this, "_dataEnd", null), x(this, "_animating", !1), x(this, "animStartTime", 0), x(this, "animDuration", 0), x(this, "animFrom", { from: 0, to: 0 }), x(this, "animTo", { from: 0, to: 0 }), this.padding = {
|
|
1110
1104
|
top: (t == null ? void 0 : t.top) ?? dt.top,
|
|
@@ -1222,18 +1216,18 @@ class yo extends Ft {
|
|
|
1222
1216
|
this.cancelAnimation(), this.removeAllListeners();
|
|
1223
1217
|
}
|
|
1224
1218
|
}
|
|
1225
|
-
let
|
|
1226
|
-
var E, B, U, Ct,
|
|
1227
|
-
class
|
|
1219
|
+
let yo = 0;
|
|
1220
|
+
var E, B, U, Ct, _t, S, V, Dt, ot, ht, H, lt, Jt, wt, ut, Bt, yt, kt, zt, Vt, it, at, St;
|
|
1221
|
+
class xo extends Pt {
|
|
1228
1222
|
constructor(t, e) {
|
|
1229
1223
|
var o, i, a;
|
|
1230
|
-
super(), A(this, kt), A(this, E), A(this, B), A(this, U), A(this, Ct), x(this, "timeScale"), x(this, "yScale"), A(this,
|
|
1224
|
+
super(), A(this, kt), A(this, E), A(this, B), A(this, U), A(this, Ct), x(this, "timeScale"), x(this, "yScale"), A(this, _t), A(this, S, []), A(this, V), A(this, Dt), A(this, ot, 6e4), A(this, ht, null), A(this, H, {}), A(this, lt, null), A(this, Jt, !1), A(this, wt, {}), A(this, ut, 0), A(this, Bt, !1), A(this, yt, !1), A(this, Vt, 0), A(this, it, 0), A(this, at, 0), A(this, St, !1), e != null && e.axis && (M(this, wt, e.axis), M(this, H, { min: (o = e.axis.y) == null ? void 0 : o.min, max: (i = e.axis.y) == null ? void 0 : i.max })), M(this, V, (e == null ? void 0 : e.theme) ?? ke), M(this, Dt, (e == null ? void 0 : e.grid) !== !1), M(this, E, new Ge(t)), M(this, B, new vo({ padding: e == null ? void 0 : e.padding })), this.timeScale = new ao(), this.yScale = new so(), M(this, U, new fe(() => this.renderMain())), M(this, Ct, new fe(() => this.renderOverlay()));
|
|
1231
1225
|
const s = (e == null ? void 0 : e.interactive) !== !1;
|
|
1232
|
-
M(this,
|
|
1226
|
+
M(this, _t, s ? new Qe(h(this, E).canvas, h(this, B), this.timeScale, this.yScale) : null), h(this, B).on("change", () => {
|
|
1233
1227
|
this.syncScales(), h(this, U).markDirty(), this.emit("viewportChange");
|
|
1234
1228
|
}), h(this, E).on("resize", () => {
|
|
1235
1229
|
this.updateScales(!0), this.renderMain(), this.emit("viewportChange");
|
|
1236
|
-
}), (a = h(this,
|
|
1230
|
+
}), (a = h(this, _t)) == null || a.on("crosshairMove", (n) => {
|
|
1237
1231
|
M(this, ht, n), h(this, Ct).markDirty(), this.emit("crosshairMove", n), this.updatePieHover(n);
|
|
1238
1232
|
});
|
|
1239
1233
|
}
|
|
@@ -1254,7 +1248,7 @@ class Co extends Ft {
|
|
|
1254
1248
|
wickDownColor: h(this, V).candlestick.wickDownColor,
|
|
1255
1249
|
bodyWidthRatio: 0.6,
|
|
1256
1250
|
...t
|
|
1257
|
-
}), i =
|
|
1251
|
+
}), i = It(this, kt, zt).call(this, t == null ? void 0 : t.id);
|
|
1258
1252
|
return e.on("update", () => {
|
|
1259
1253
|
this.onDataChanged();
|
|
1260
1254
|
}), h(this, S).push({ id: i, renderer: o, store: e, visible: !0 }), M(this, lt, null), this.updateViewportPadding(), this.emit("seriesChange"), i;
|
|
@@ -1267,12 +1261,12 @@ class Co extends Ft {
|
|
|
1267
1261
|
const { layers: n, ...l } = t ?? {};
|
|
1268
1262
|
o = n ?? 1, i = l;
|
|
1269
1263
|
}
|
|
1270
|
-
const a = new
|
|
1264
|
+
const a = new j(o, {
|
|
1271
1265
|
colors: o === 1 ? [h(this, V).line.color] : h(this, V).seriesColors.slice(0, o),
|
|
1272
1266
|
lineWidth: h(this, V).line.width,
|
|
1273
1267
|
areaFill: !0,
|
|
1274
1268
|
...i
|
|
1275
|
-
}), s =
|
|
1269
|
+
}), s = It(this, kt, zt).call(this, i == null ? void 0 : i.id);
|
|
1276
1270
|
for (const n of a.stores)
|
|
1277
1271
|
n.on("update", () => this.onDataChanged());
|
|
1278
1272
|
return h(this, S).push({ id: s, label: i == null ? void 0 : i.label, renderer: a, store: a.stores[0], visible: !0 }), M(this, lt, null), this.updateViewportPadding(), this.emit("seriesChange"), s;
|
|
@@ -1280,7 +1274,7 @@ class Co extends Ft {
|
|
|
1280
1274
|
/** Set data for a specific layer within a line series. */
|
|
1281
1275
|
setLineLayerData(t, e, o) {
|
|
1282
1276
|
const i = h(this, S).find((s) => s.id === t);
|
|
1283
|
-
if (!i || !(i.renderer instanceof
|
|
1277
|
+
if (!i || !(i.renderer instanceof j)) return;
|
|
1284
1278
|
const a = i.renderer.stores[e];
|
|
1285
1279
|
a && a.setData(o);
|
|
1286
1280
|
}
|
|
@@ -1296,7 +1290,7 @@ class Co extends Ft {
|
|
|
1296
1290
|
colors: h(this, V).seriesColors.slice(0, o),
|
|
1297
1291
|
barWidthRatio: 0.6,
|
|
1298
1292
|
...i
|
|
1299
|
-
}), s =
|
|
1293
|
+
}), s = It(this, kt, zt).call(this, i == null ? void 0 : i.id);
|
|
1300
1294
|
for (const n of a.stores)
|
|
1301
1295
|
n.on("update", () => this.onDataChanged());
|
|
1302
1296
|
return h(this, S).push({ id: s, label: i == null ? void 0 : i.label, renderer: a, store: a.stores[0], visible: !0 }), M(this, lt, null), this.updateViewportPadding(), this.emit("seriesChange"), s;
|
|
@@ -1310,7 +1304,7 @@ class Co extends Ft {
|
|
|
1310
1304
|
}
|
|
1311
1305
|
/** Add a pie/donut series. Set `innerRadiusRatio > 0` for donut. */
|
|
1312
1306
|
addPieSeries(t) {
|
|
1313
|
-
const e = new bt(t), o =
|
|
1307
|
+
const e = new bt(t), o = It(this, kt, zt).call(this, t == null ? void 0 : t.id);
|
|
1314
1308
|
return h(this, S).push({ id: o, label: t == null ? void 0 : t.label, renderer: e, store: null, visible: !0 }), M(this, lt, null), this.updateViewportPadding(), this.emit("seriesChange"), o;
|
|
1315
1309
|
}
|
|
1316
1310
|
/** Set data for a pie/donut series. */
|
|
@@ -1323,7 +1317,7 @@ class Co extends Ft {
|
|
|
1323
1317
|
const e = h(this, S).findIndex((o) => o.id === t);
|
|
1324
1318
|
if (e >= 0) {
|
|
1325
1319
|
const { renderer: o, store: i } = h(this, S)[e];
|
|
1326
|
-
if (o instanceof
|
|
1320
|
+
if (o instanceof j || o instanceof nt)
|
|
1327
1321
|
for (const a of o.stores) a.removeAllListeners();
|
|
1328
1322
|
else
|
|
1329
1323
|
i == null || i.removeAllListeners();
|
|
@@ -1334,27 +1328,27 @@ class Co extends Ft {
|
|
|
1334
1328
|
setSeriesData(t, e) {
|
|
1335
1329
|
const o = h(this, S).find((a) => a.id === t);
|
|
1336
1330
|
if (!(o != null && o.store)) return;
|
|
1337
|
-
const i = e.length > 0 && "open" in e[0] ?
|
|
1331
|
+
const i = e.length > 0 && "open" in e[0] ? Ze(e) : to(e);
|
|
1338
1332
|
o.store.setData(i);
|
|
1339
1333
|
}
|
|
1340
1334
|
/** Append a new data point to the end of a series (real-time tick). */
|
|
1341
1335
|
appendData(t, e) {
|
|
1342
1336
|
const o = h(this, S).find((a) => a.id === t);
|
|
1343
1337
|
if (!(o != null && o.store)) return;
|
|
1344
|
-
const i = { ...e, time:
|
|
1338
|
+
const i = { ...e, time: Yt(e.time) };
|
|
1345
1339
|
o.store.append(i);
|
|
1346
1340
|
}
|
|
1347
1341
|
/** Update the last data point of a series in place (e.g. live candle update). */
|
|
1348
1342
|
updateData(t, e) {
|
|
1349
1343
|
const o = h(this, S).find((a) => a.id === t);
|
|
1350
1344
|
if (!(o != null && o.store)) return;
|
|
1351
|
-
const i = { ...e, time:
|
|
1345
|
+
const i = { ...e, time: Yt(e.time) };
|
|
1352
1346
|
o.store.updateLast(i);
|
|
1353
1347
|
}
|
|
1354
1348
|
/** Update visual options (color, width, etc.) for an existing series. */
|
|
1355
1349
|
updateSeriesOptions(t, e) {
|
|
1356
1350
|
const o = h(this, S).find((i) => i.id === t);
|
|
1357
|
-
o && ((o.renderer instanceof Nt || o.renderer instanceof
|
|
1351
|
+
o && ((o.renderer instanceof Nt || o.renderer instanceof j || o.renderer instanceof nt || o.renderer instanceof bt) && o.renderer.updateOptions(e), "label" in e && typeof e.label == "string" && (o.label = e.label), h(this, U).markDirty());
|
|
1358
1352
|
}
|
|
1359
1353
|
/**
|
|
1360
1354
|
* Batch multiple updates: suppress recomputes until `fn` returns.
|
|
@@ -1374,7 +1368,7 @@ class Co extends Ft {
|
|
|
1374
1368
|
}
|
|
1375
1369
|
/** @deprecated Use {@link batch} instead. */
|
|
1376
1370
|
endUpdate() {
|
|
1377
|
-
--ce(this, ut)._ <= 0 && (M(this, ut, 0), h(this,
|
|
1371
|
+
--ce(this, ut)._ <= 0 && (M(this, ut, 0), h(this, Bt) ? (M(this, Bt, !1), M(this, yt, !1), this.onDataChanged()) : h(this, yt) && (M(this, yt, !1), this.updateYRange(!0), h(this, U).markDirty()));
|
|
1378
1372
|
}
|
|
1379
1373
|
/** Show or hide a series. Hidden series are not rendered and excluded from Y-range. */
|
|
1380
1374
|
setSeriesVisible(t, e) {
|
|
@@ -1396,7 +1390,7 @@ class Co extends Ft {
|
|
|
1396
1390
|
const i = h(this, S).find((s) => s.id === t);
|
|
1397
1391
|
if (!i) return;
|
|
1398
1392
|
const a = i.renderer;
|
|
1399
|
-
if (a instanceof nt || a instanceof
|
|
1393
|
+
if (a instanceof nt || a instanceof j) {
|
|
1400
1394
|
const s = a.stores[e];
|
|
1401
1395
|
if (s) {
|
|
1402
1396
|
if (s.isVisible() === o) return;
|
|
@@ -1413,7 +1407,7 @@ class Co extends Ft {
|
|
|
1413
1407
|
const i = h(this, S).find((s) => s.id === t);
|
|
1414
1408
|
if (!i) return !0;
|
|
1415
1409
|
const a = i.renderer;
|
|
1416
|
-
return a instanceof nt || a instanceof
|
|
1410
|
+
return a instanceof nt || a instanceof j ? ((o = a.stores[e]) == null ? void 0 : o.isVisible()) ?? !0 : !0;
|
|
1417
1411
|
}
|
|
1418
1412
|
/** Auto-fit the viewport to show all data across every series. */
|
|
1419
1413
|
fitContent() {
|
|
@@ -1474,7 +1468,7 @@ class Co extends Ft {
|
|
|
1474
1468
|
const o = h(this, S).find((n) => n.id === t);
|
|
1475
1469
|
if (!o || !o.visible) return null;
|
|
1476
1470
|
const i = o.renderer;
|
|
1477
|
-
if (!(i instanceof nt) && !(i instanceof
|
|
1471
|
+
if (!(i instanceof nt) && !(i instanceof j) || i.stores.length <= 1) return null;
|
|
1478
1472
|
const a = i.getColors(), s = [];
|
|
1479
1473
|
for (let n = 0; n < i.stores.length; n++) {
|
|
1480
1474
|
if (!i.stores[n].isVisible()) continue;
|
|
@@ -1509,7 +1503,7 @@ class Co extends Ft {
|
|
|
1509
1503
|
const e = h(this, S).find((a) => a.id === t);
|
|
1510
1504
|
if (!e) return null;
|
|
1511
1505
|
const o = e.renderer;
|
|
1512
|
-
if (!(o instanceof nt) && !(o instanceof
|
|
1506
|
+
if (!(o instanceof nt) && !(o instanceof j)) return null;
|
|
1513
1507
|
const i = o.getColors();
|
|
1514
1508
|
return o.stores.map((a, s) => ({
|
|
1515
1509
|
color: i[s % i.length]
|
|
@@ -1557,7 +1551,7 @@ class Co extends Ft {
|
|
|
1557
1551
|
wickDownColor: t.candlestick.wickDownColor
|
|
1558
1552
|
}) : o.renderer instanceof nt ? o.renderer.updateOptions({
|
|
1559
1553
|
colors: t.seriesColors.slice(0, o.renderer.stores.length)
|
|
1560
|
-
}) : o.renderer instanceof
|
|
1554
|
+
}) : o.renderer instanceof j && (o.renderer.stores.length === 1 ? o.renderer.getColor() === e && o.renderer.updateOptions({ colors: [t.line.color] }) : o.renderer.updateOptions({
|
|
1561
1555
|
colors: t.seriesColors.slice(0, o.renderer.stores.length)
|
|
1562
1556
|
}));
|
|
1563
1557
|
h(this, U).markDirty();
|
|
@@ -1571,7 +1565,7 @@ class Co extends Ft {
|
|
|
1571
1565
|
const i = this.yAxisWidth, a = this.xAxisHeight;
|
|
1572
1566
|
M(this, wt, t);
|
|
1573
1567
|
const s = { min: (e = t.y) == null ? void 0 : e.min, max: (o = t.y) == null ? void 0 : o.max };
|
|
1574
|
-
M(this,
|
|
1568
|
+
M(this, H, s), M(this, St, !1), this.updateYRange(!0), (this.yAxisWidth !== i || this.xAxisHeight !== a) && this.updateScales(!0), h(this, U).markDirty();
|
|
1575
1569
|
}
|
|
1576
1570
|
getMediaSize() {
|
|
1577
1571
|
return h(this, E).size.media;
|
|
@@ -1600,7 +1594,7 @@ class Co extends Ft {
|
|
|
1600
1594
|
}
|
|
1601
1595
|
/** Show or hide the background grid. Takes effect on the next render frame. */
|
|
1602
1596
|
setGrid(t) {
|
|
1603
|
-
M(this,
|
|
1597
|
+
M(this, Dt, t), h(this, U).markDirty();
|
|
1604
1598
|
}
|
|
1605
1599
|
/** Notify chart that a YLabel is present (affects right padding). */
|
|
1606
1600
|
setYLabel(t) {
|
|
@@ -1624,7 +1618,7 @@ class Co extends Ft {
|
|
|
1624
1618
|
/** Tear down the chart: cancel animations, remove listeners, and detach the canvas. */
|
|
1625
1619
|
destroy() {
|
|
1626
1620
|
var t;
|
|
1627
|
-
h(this, B).destroy(), h(this, U).destroy(), h(this, Ct).destroy(), (t = h(this,
|
|
1621
|
+
h(this, B).destroy(), h(this, U).destroy(), h(this, Ct).destroy(), (t = h(this, _t)) == null || t.destroy(), h(this, E).destroy(), this.removeAllListeners();
|
|
1628
1622
|
}
|
|
1629
1623
|
/** Compute the earliest and latest timestamps across all series. */
|
|
1630
1624
|
getDataBounds() {
|
|
@@ -1638,7 +1632,7 @@ class Co extends Ft {
|
|
|
1638
1632
|
}
|
|
1639
1633
|
onDataChanged() {
|
|
1640
1634
|
if (h(this, ut) > 0) {
|
|
1641
|
-
M(this,
|
|
1635
|
+
M(this, Bt, !0);
|
|
1642
1636
|
return;
|
|
1643
1637
|
}
|
|
1644
1638
|
this.updateDataInterval();
|
|
@@ -1646,11 +1640,11 @@ class Co extends Ft {
|
|
|
1646
1640
|
t !== void 0 && h(this, B).setDataStart(t), e !== void 0 && h(this, B).setDataEnd(e);
|
|
1647
1641
|
let o = 0;
|
|
1648
1642
|
for (const a of h(this, S))
|
|
1649
|
-
if (a.renderer instanceof
|
|
1643
|
+
if (a.renderer instanceof j || a.renderer instanceof nt)
|
|
1650
1644
|
for (const s of a.renderer.stores) o += s.length;
|
|
1651
1645
|
else a.store && (o += a.store.length);
|
|
1652
|
-
const i = o - h(this,
|
|
1653
|
-
if (M(this,
|
|
1646
|
+
const i = o - h(this, Vt) > 5;
|
|
1647
|
+
if (M(this, Vt, o), t !== void 0 && e !== void 0) {
|
|
1654
1648
|
const { from: a, to: s } = h(this, B).visibleRange, n = a === 0 && s === 0, l = h(this, E).size.media.width - this.yAxisWidth;
|
|
1655
1649
|
n ? h(this, B).fitToData(t, e, l, !1) : i && h(this, B).autoScroll ? h(this, B).fitToData(t, e, l, !0) : !i && this.isLastPointVisible() && h(this, B).scrollToEnd(e, l);
|
|
1656
1650
|
}
|
|
@@ -1672,7 +1666,7 @@ class Co extends Ft {
|
|
|
1672
1666
|
const e = t.store.getAll();
|
|
1673
1667
|
if (e.length >= 2) {
|
|
1674
1668
|
const o = e.slice(0, 20).map((i) => i.time);
|
|
1675
|
-
M(this, ot,
|
|
1669
|
+
M(this, ot, eo(o)), h(this, B).setDataInterval(h(this, ot));
|
|
1676
1670
|
break;
|
|
1677
1671
|
}
|
|
1678
1672
|
}
|
|
@@ -1680,7 +1674,7 @@ class Co extends Ft {
|
|
|
1680
1674
|
updateYRange(t = !1) {
|
|
1681
1675
|
let e = 1 / 0, o = -1 / 0;
|
|
1682
1676
|
const i = h(this, B).visibleRange;
|
|
1683
|
-
let a = h(this,
|
|
1677
|
+
let a = h(this, H).min !== void 0 && h(this, H).min !== "auto" && typeof h(this, H).min != "number" || h(this, H).max !== void 0 && h(this, H).max !== "auto" && typeof h(this, H).max != "number" ? [] : null;
|
|
1684
1678
|
for (const c of h(this, S)) {
|
|
1685
1679
|
if (!c.visible) continue;
|
|
1686
1680
|
if (c.renderer.getValueRange) {
|
|
@@ -1705,14 +1699,14 @@ class Co extends Ft {
|
|
|
1705
1699
|
M(this, St, !1);
|
|
1706
1700
|
return;
|
|
1707
1701
|
}
|
|
1708
|
-
if (e = this.resolveBound(h(this,
|
|
1702
|
+
if (e = this.resolveBound(h(this, H).min, e, o, a ?? [], "min"), o = this.resolveBound(h(this, H).max, o, e, a ?? [], "max"), !h(this, St) || t)
|
|
1709
1703
|
M(this, it, e), M(this, at, o), M(this, St, !0);
|
|
1710
1704
|
else {
|
|
1711
1705
|
M(this, it, h(this, it) + (e - h(this, it)) * 0.2), M(this, at, h(this, at) + (o - h(this, at)) * 0.2), e < h(this, it) && M(this, it, e), o > h(this, at) && M(this, at, o);
|
|
1712
1706
|
const c = Math.max(Math.abs(h(this, at) - h(this, it)) * 1e-4, 1e-3);
|
|
1713
1707
|
(Math.abs(h(this, it) - e) > c || Math.abs(h(this, at) - o) > c) && h(this, U).markDirty();
|
|
1714
1708
|
}
|
|
1715
|
-
const s = h(this,
|
|
1709
|
+
const s = h(this, H).min !== void 0 && h(this, H).min !== "auto", n = h(this, H).max !== void 0 && h(this, H).max !== "auto", l = h(this, E).size.media.height - this.xAxisHeight;
|
|
1716
1710
|
h(this, B).setYRange(h(this, it), h(this, at), l, s, n);
|
|
1717
1711
|
}
|
|
1718
1712
|
/** Resolve an {@link AxisBound} to a concrete numeric value. */
|
|
@@ -1750,7 +1744,7 @@ class Co extends Ft {
|
|
|
1750
1744
|
if (!(t.media.width === 0 || t.media.height === 0)) {
|
|
1751
1745
|
h(this, B).tick(performance.now()) && h(this, U).markDirty(), this.updateScales(), h(this, E).useMainLayer((e) => {
|
|
1752
1746
|
const { context: o, bitmapSize: i } = e, a = (t.media.width - this.yAxisWidth) * t.horizontalPixelRatio, s = (t.media.height - this.xAxisHeight) * t.verticalPixelRatio;
|
|
1753
|
-
o.clearRect(0, 0, i.width, i.height), o.save(), o.beginPath(), o.rect(0, 0, a, s), o.clip(), h(this,
|
|
1747
|
+
o.clearRect(0, 0, i.width, i.height), o.save(), o.beginPath(), o.rect(0, 0, a, s), o.clip(), h(this, Dt) && Je(e, this.timeScale, this.yScale, h(this, V), h(this, ot));
|
|
1754
1748
|
for (const n of h(this, S))
|
|
1755
1749
|
n.visible && n.renderer.render({
|
|
1756
1750
|
scope: e,
|
|
@@ -1775,7 +1769,7 @@ class Co extends Ft {
|
|
|
1775
1769
|
if (t.media.width === 0 || t.media.height === 0) return;
|
|
1776
1770
|
let e = !1;
|
|
1777
1771
|
for (const o of h(this, S))
|
|
1778
|
-
if (o.visible && o.renderer instanceof
|
|
1772
|
+
if (o.visible && o.renderer instanceof j && o.renderer.hasPulse) {
|
|
1779
1773
|
e = !0;
|
|
1780
1774
|
break;
|
|
1781
1775
|
}
|
|
@@ -1784,9 +1778,9 @@ class Co extends Ft {
|
|
|
1784
1778
|
const i = (t.media.width - this.yAxisWidth) * t.horizontalPixelRatio, a = (t.media.height - this.xAxisHeight) * t.verticalPixelRatio;
|
|
1785
1779
|
if (o.context.save(), o.context.beginPath(), o.context.rect(0, 0, i, a), o.context.clip(), h(this, ht)) {
|
|
1786
1780
|
const s = h(this, ht).mediaX * t.horizontalPixelRatio, n = h(this, ht).mediaY * t.verticalPixelRatio;
|
|
1787
|
-
|
|
1781
|
+
Ne(o, s, n, h(this, V));
|
|
1788
1782
|
for (const l of h(this, S))
|
|
1789
|
-
if (l.visible && l.renderer instanceof
|
|
1783
|
+
if (l.visible && l.renderer instanceof j) {
|
|
1790
1784
|
const c = l.renderer, d = c.getColors(), u = c.getStacking(), b = 4 * t.horizontalPixelRatio, v = [], C = [];
|
|
1791
1785
|
for (let g = 0; g < c.stores.length; g++) {
|
|
1792
1786
|
const p = c.stores[g].findNearest(h(this, ht).time, h(this, ot));
|
|
@@ -1813,7 +1807,7 @@ class Co extends Ft {
|
|
|
1813
1807
|
}
|
|
1814
1808
|
}
|
|
1815
1809
|
for (const s of h(this, S))
|
|
1816
|
-
s.visible && s.renderer instanceof
|
|
1810
|
+
s.visible && s.renderer instanceof j && s.renderer.hasPulse && s.renderer.drawPulseOverlay(
|
|
1817
1811
|
o.context,
|
|
1818
1812
|
this.timeScale,
|
|
1819
1813
|
this.yScale,
|
|
@@ -1824,7 +1818,7 @@ class Co extends Ft {
|
|
|
1824
1818
|
const { from: o, to: i } = this.timeScale.getRange();
|
|
1825
1819
|
let a = !1;
|
|
1826
1820
|
for (const s of h(this, S))
|
|
1827
|
-
if (!(!s.visible || !(s.renderer instanceof
|
|
1821
|
+
if (!(!s.visible || !(s.renderer instanceof j) || !s.renderer.hasPulse)) {
|
|
1828
1822
|
for (const n of s.renderer.stores) {
|
|
1829
1823
|
const l = n.last();
|
|
1830
1824
|
if (l && l.time >= o && l.time <= i) {
|
|
@@ -1838,21 +1832,21 @@ class Co extends Ft {
|
|
|
1838
1832
|
}
|
|
1839
1833
|
}
|
|
1840
1834
|
}
|
|
1841
|
-
E = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(),
|
|
1835
|
+
E = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(), _t = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), Jt = /* @__PURE__ */ new WeakMap(), wt = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), Bt = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakSet(), /**
|
|
1842
1836
|
* Return a series ID: use the provided hint if it's non-empty and not already taken,
|
|
1843
1837
|
* otherwise generate a new auto ID. Auto-generated IDs never collide with each other
|
|
1844
1838
|
* or with user-provided IDs because they use a monotonically increasing counter.
|
|
1845
1839
|
*/
|
|
1846
|
-
|
|
1840
|
+
zt = function(r) {
|
|
1847
1841
|
if (r && !h(this, S).some((e) => e.id === r))
|
|
1848
1842
|
return r;
|
|
1849
1843
|
let t;
|
|
1850
1844
|
do
|
|
1851
|
-
t = `series_${++
|
|
1845
|
+
t = `series_${++yo}`;
|
|
1852
1846
|
while (h(this, S).some((e) => e.id === t));
|
|
1853
1847
|
return t;
|
|
1854
|
-
},
|
|
1855
|
-
const
|
|
1848
|
+
}, Vt = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakMap();
|
|
1849
|
+
const wi = {
|
|
1856
1850
|
background: "#ffffff",
|
|
1857
1851
|
chartGradient: ["#ffffff", "#f5f6f8"],
|
|
1858
1852
|
typography: {
|
|
@@ -1909,30 +1903,23 @@ const ki = {
|
|
|
1909
1903
|
borderColor: "rgba(0, 0, 0, 0.1)"
|
|
1910
1904
|
}
|
|
1911
1905
|
};
|
|
1912
|
-
function
|
|
1906
|
+
function Co(r) {
|
|
1913
1907
|
return parseInt(r.slice(1, 3), 16) * 0.299 + parseInt(r.slice(3, 5), 16) * 0.587 + parseInt(r.slice(5, 7), 16) * 0.114 < 128;
|
|
1914
1908
|
}
|
|
1915
1909
|
function Y(r) {
|
|
1916
|
-
var t, e, o, i, a, s, n, l, c, d, u, b, v, C, w, g, p, m, f, y, F, k, D,
|
|
1917
|
-
const { background:
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
description: gt,
|
|
1921
|
-
dark: et,
|
|
1922
|
-
fontUrl: mt,
|
|
1923
|
-
backgroundImage: Rt,
|
|
1924
|
-
backgroundSize: Pe,
|
|
1925
|
-
background: N,
|
|
1926
|
-
chartGradient: r.chartGradient ?? (et ? [Vt(N, 0.04), ye(N, 0.06)] : [Vt(N, 0.06), N]),
|
|
1910
|
+
var t, e, o, i, a, s, n, l, c, d, u, b, v, C, w, g, p, m, f, y, F, k, D, L, N, $, Q, G, pt;
|
|
1911
|
+
const { background: J, name: Ft = "Custom", description: gt, fontUrl: mt = null } = r, X = Co(J), ze = X ? "#d1d4dc" : "#24292f", Pe = X ? "#787b86" : "#8b949e", ae = X ? "#26a69a" : "#2da44e", se = X ? "#ef5350" : "#cf222e", Fe = X ? "#2962ff" : "#0969da", Le = X ? "rgba(42,46,57,0.6)" : "rgba(200,200,200,0.5)", Ie = X ? "rgba(150,150,150,0.5)" : "rgba(170,170,170,0.3)", re = X ? At(J, 0.1) : ve(J, 0.05), We = X ? Tt(J, 0.92) : Tt(J, 0.95), Ae = X ? Tt(At(J, 0.15), 0.6) : "rgba(200,200,200,0.5)", Ve = $t, Xt = ((t = r.candlestick) == null ? void 0 : t.upColor) ?? ae, Lt = ((e = r.candlestick) == null ? void 0 : e.downColor) ?? se, Rt = ((o = r.line) == null ? void 0 : o.color) ?? Fe, ne = ((i = r.tooltip) == null ? void 0 : i.textColor) ?? ze, Ye = ((a = r.axis) == null ? void 0 : a.textColor) ?? Pe, Ue = ((s = r.typography) == null ? void 0 : s.fontFamily) ?? Ve, Ee = {
|
|
1912
|
+
background: J,
|
|
1913
|
+
chartGradient: r.chartGradient ?? (X ? [At(J, 0.04), ve(J, 0.06)] : [At(J, 0.06), J]),
|
|
1927
1914
|
typography: {
|
|
1928
|
-
fontFamily:
|
|
1915
|
+
fontFamily: Ue,
|
|
1929
1916
|
fontSize: ((n = r.typography) == null ? void 0 : n.fontSize) ?? 12,
|
|
1930
1917
|
axisFontSize: ((l = r.typography) == null ? void 0 : l.axisFontSize) ?? 10,
|
|
1931
1918
|
yFontSize: ((c = r.typography) == null ? void 0 : c.yFontSize) ?? 11,
|
|
1932
1919
|
tooltipFontSize: ((d = r.typography) == null ? void 0 : d.tooltipFontSize) ?? ((u = r.typography) == null ? void 0 : u.fontSize) ?? 12
|
|
1933
1920
|
},
|
|
1934
1921
|
grid: {
|
|
1935
|
-
color: ((b = r.grid) == null ? void 0 : b.color) ??
|
|
1922
|
+
color: ((b = r.grid) == null ? void 0 : b.color) ?? Le,
|
|
1936
1923
|
style: ((v = r.grid) == null ? void 0 : v.style) ?? "dashed"
|
|
1937
1924
|
},
|
|
1938
1925
|
candlestick: {
|
|
@@ -1942,50 +1929,51 @@ function Y(r) {
|
|
|
1942
1929
|
wickDownColor: ((w = r.candlestick) == null ? void 0 : w.wickDownColor) ?? Lt
|
|
1943
1930
|
},
|
|
1944
1931
|
line: {
|
|
1945
|
-
color:
|
|
1932
|
+
color: Rt,
|
|
1946
1933
|
width: ((g = r.line) == null ? void 0 : g.width) ?? 1,
|
|
1947
|
-
areaTopColor: ((p = r.line) == null ? void 0 : p.areaTopColor) ??
|
|
1948
|
-
areaBottomColor: ((m = r.line) == null ? void 0 : m.areaBottomColor) ??
|
|
1934
|
+
areaTopColor: ((p = r.line) == null ? void 0 : p.areaTopColor) ?? Tt(Rt, 0.08),
|
|
1935
|
+
areaBottomColor: ((m = r.line) == null ? void 0 : m.areaBottomColor) ?? Tt(Rt, 0.01)
|
|
1949
1936
|
},
|
|
1950
|
-
seriesColors: r.seriesColors ?? [
|
|
1937
|
+
seriesColors: r.seriesColors ?? [Rt, ae, se],
|
|
1951
1938
|
bands: {
|
|
1952
|
-
upper: ((f = r.bands) == null ? void 0 : f.upper) ??
|
|
1939
|
+
upper: ((f = r.bands) == null ? void 0 : f.upper) ?? Rt,
|
|
1953
1940
|
lower: ((y = r.bands) == null ? void 0 : y.lower) ?? Lt
|
|
1954
1941
|
},
|
|
1955
1942
|
crosshair: {
|
|
1956
|
-
color: ((F = r.crosshair) == null ? void 0 : F.color) ??
|
|
1943
|
+
color: ((F = r.crosshair) == null ? void 0 : F.color) ?? Ie,
|
|
1957
1944
|
labelBackground: ((k = r.crosshair) == null ? void 0 : k.labelBackground) ?? re,
|
|
1958
1945
|
labelTextColor: ((D = r.crosshair) == null ? void 0 : D.labelTextColor) ?? ne
|
|
1959
1946
|
},
|
|
1960
|
-
axis: { textColor:
|
|
1947
|
+
axis: { textColor: Ye },
|
|
1961
1948
|
yLabel: {
|
|
1962
|
-
upBackground: ((
|
|
1963
|
-
downBackground: ((
|
|
1949
|
+
upBackground: ((L = r.yLabel) == null ? void 0 : L.upBackground) ?? Xt,
|
|
1950
|
+
downBackground: ((N = r.yLabel) == null ? void 0 : N.downBackground) ?? Lt,
|
|
1964
1951
|
neutralBackground: (($ = r.yLabel) == null ? void 0 : $.neutralBackground) ?? re,
|
|
1965
|
-
textColor: ((
|
|
1952
|
+
textColor: ((Q = r.yLabel) == null ? void 0 : Q.textColor) ?? "#ffffff"
|
|
1966
1953
|
},
|
|
1967
1954
|
tooltip: {
|
|
1968
|
-
background: ((
|
|
1955
|
+
background: ((G = r.tooltip) == null ? void 0 : G.background) ?? We,
|
|
1969
1956
|
textColor: ne,
|
|
1970
|
-
borderColor: ((pt = r.tooltip) == null ? void 0 : pt.borderColor) ??
|
|
1957
|
+
borderColor: ((pt = r.tooltip) == null ? void 0 : pt.borderColor) ?? Ae
|
|
1971
1958
|
}
|
|
1972
1959
|
};
|
|
1960
|
+
return { name: Ft, description: gt, fontUrl: mt, dark: X, theme: Ee };
|
|
1973
1961
|
}
|
|
1974
|
-
function
|
|
1962
|
+
function Tt(r, t) {
|
|
1975
1963
|
const e = parseInt(r.slice(1, 3), 16), o = parseInt(r.slice(3, 5), 16), i = parseInt(r.slice(5, 7), 16);
|
|
1976
1964
|
return `rgba(${e}, ${o}, ${i}, ${t})`;
|
|
1977
1965
|
}
|
|
1978
|
-
function
|
|
1966
|
+
function At(r, t) {
|
|
1979
1967
|
if (!r.startsWith("#")) return r;
|
|
1980
1968
|
const e = Math.min(255, Math.round(parseInt(r.slice(1, 3), 16) + 255 * t)), o = Math.min(255, Math.round(parseInt(r.slice(3, 5), 16) + 255 * t)), i = Math.min(255, Math.round(parseInt(r.slice(5, 7), 16) + 255 * t));
|
|
1981
1969
|
return `#${e.toString(16).padStart(2, "0")}${o.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}`;
|
|
1982
1970
|
}
|
|
1983
|
-
function
|
|
1971
|
+
function ve(r, t) {
|
|
1984
1972
|
if (!r.startsWith("#")) return r;
|
|
1985
1973
|
const e = Math.max(0, Math.round(parseInt(r.slice(1, 3), 16) * (1 - t))), o = Math.max(0, Math.round(parseInt(r.slice(3, 5), 16) * (1 - t))), i = Math.max(0, Math.round(parseInt(r.slice(5, 7), 16) * (1 - t)));
|
|
1986
1974
|
return `#${e.toString(16).padStart(2, "0")}${o.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}`;
|
|
1987
1975
|
}
|
|
1988
|
-
const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap", $t = "'Outfit', -apple-system, BlinkMacSystemFont, sans-serif", Qt = "https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600&display=swap",
|
|
1976
|
+
const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap", $t = "'Outfit', -apple-system, BlinkMacSystemFont, sans-serif", Qt = "https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600&display=swap", Se = "'Roboto Mono', monospace", Me = "https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;600&display=swap", wo = "'IBM Plex Mono', monospace", ko = "https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap", Zt = "'Fira Code', monospace", te = "https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap", Re = "'Source Code Pro', monospace", Te = "https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500;600&display=swap", So = "'Space Mono', monospace", Mo = "https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap", ee = "'Plus Jakarta Sans', sans-serif", oe = "https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap", Ro = "'Caveat', 'Comic Sans MS', cursive", To = "https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&display=swap", _o = Y({
|
|
1989
1977
|
name: "Andromeda",
|
|
1990
1978
|
description: "Deep space purples and cosmic blues",
|
|
1991
1979
|
background: "#23262e",
|
|
@@ -2008,9 +1996,9 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2008
1996
|
crosshair: { color: "rgba(102,94,110,0.4)", labelBackground: "#2e3038" },
|
|
2009
1997
|
axis: { textColor: "#665e6e" },
|
|
2010
1998
|
tooltip: { background: "rgba(35,38,46,0.92)", textColor: "#d5ced9", borderColor: "rgba(50,48,56,0.6)" },
|
|
2011
|
-
typography: { fontFamily:
|
|
2012
|
-
fontUrl:
|
|
2013
|
-
}),
|
|
1999
|
+
typography: { fontFamily: Se },
|
|
2000
|
+
fontUrl: Me
|
|
2001
|
+
}), Do = Y({
|
|
2014
2002
|
name: "Ayu Mirage",
|
|
2015
2003
|
description: "Warm dark with amber accents",
|
|
2016
2004
|
background: "#1f2430",
|
|
@@ -2035,7 +2023,7 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2035
2023
|
tooltip: { background: "rgba(31,36,48,0.92)", textColor: "#cbccc6", borderColor: "rgba(42,48,60,0.6)" },
|
|
2036
2024
|
typography: { fontFamily: $t },
|
|
2037
2025
|
fontUrl: Qt
|
|
2038
|
-
}),
|
|
2026
|
+
}), Bo = Y({
|
|
2039
2027
|
name: "Catppuccin",
|
|
2040
2028
|
description: "Pastel tones on a mocha base",
|
|
2041
2029
|
background: "#1e1e2e",
|
|
@@ -2060,7 +2048,7 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2060
2048
|
tooltip: { background: "rgba(30,30,46,0.92)", textColor: "#cdd6f4", borderColor: "rgba(49,50,68,0.6)" },
|
|
2061
2049
|
typography: { fontFamily: $t },
|
|
2062
2050
|
fontUrl: Qt
|
|
2063
|
-
}),
|
|
2051
|
+
}), zo = Y({
|
|
2064
2052
|
name: "Dracula",
|
|
2065
2053
|
description: "Classic dark with vibrant highlights",
|
|
2066
2054
|
background: "#282a36",
|
|
@@ -2085,7 +2073,7 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2085
2073
|
tooltip: { background: "rgba(40,42,54,0.92)", textColor: "#f8f8f2", borderColor: "rgba(68,71,90,0.6)" },
|
|
2086
2074
|
typography: { fontFamily: Zt },
|
|
2087
2075
|
fontUrl: te
|
|
2088
|
-
}),
|
|
2076
|
+
}), Po = Y({
|
|
2089
2077
|
name: "GitHub Light",
|
|
2090
2078
|
description: "Clean and familiar, GitHub-inspired",
|
|
2091
2079
|
background: "#fafbfc",
|
|
@@ -2109,9 +2097,9 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2109
2097
|
crosshair: { color: "rgba(208,215,222,0.3)", labelBackground: "#f0f3f6" },
|
|
2110
2098
|
axis: { textColor: "#8b949e" },
|
|
2111
2099
|
tooltip: { background: "rgba(250,251,252,0.95)", textColor: "#24292f", borderColor: "rgba(216,222,228,0.5)" },
|
|
2112
|
-
typography: { fontFamily:
|
|
2113
|
-
fontUrl:
|
|
2114
|
-
}),
|
|
2100
|
+
typography: { fontFamily: wo },
|
|
2101
|
+
fontUrl: ko
|
|
2102
|
+
}), Fo = Y({
|
|
2115
2103
|
name: "Gruvbox",
|
|
2116
2104
|
description: "Retro warm with earthy tones",
|
|
2117
2105
|
background: "#282828",
|
|
@@ -2139,67 +2127,69 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2139
2127
|
}), Lo = {
|
|
2140
2128
|
name: "Handwritten",
|
|
2141
2129
|
description: "Sketch-style with a personal touch",
|
|
2142
|
-
fontUrl:
|
|
2130
|
+
fontUrl: To,
|
|
2143
2131
|
dark: !1,
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2132
|
+
theme: {
|
|
2133
|
+
background: "#fdf5e6",
|
|
2134
|
+
chartGradient: ["#fef6e3", "#fdf5e6"],
|
|
2135
|
+
typography: {
|
|
2136
|
+
fontFamily: Ro,
|
|
2137
|
+
fontSize: 18,
|
|
2138
|
+
axisFontSize: 13,
|
|
2139
|
+
yFontSize: 15,
|
|
2140
|
+
tooltipFontSize: 14
|
|
2141
|
+
},
|
|
2142
|
+
grid: {
|
|
2143
|
+
color: "rgba(180,170,150,0.3)",
|
|
2144
|
+
style: "dashed"
|
|
2145
|
+
},
|
|
2146
|
+
candlestick: {
|
|
2147
|
+
upColor: "#7a9a5e",
|
|
2148
|
+
downColor: "#b07060",
|
|
2149
|
+
wickUpColor: "#7a9a5e",
|
|
2150
|
+
wickDownColor: "#b07060"
|
|
2151
|
+
},
|
|
2152
|
+
line: {
|
|
2153
|
+
color: "#6a8fa0",
|
|
2154
|
+
width: 1,
|
|
2155
|
+
areaTopColor: "rgba(106,143,160,0.08)",
|
|
2156
|
+
areaBottomColor: "rgba(106,143,160,0.01)"
|
|
2157
|
+
},
|
|
2158
|
+
seriesColors: [
|
|
2159
|
+
"#6a8fa0",
|
|
2160
|
+
"#c09050",
|
|
2161
|
+
"#7a9a5e",
|
|
2162
|
+
"#8a7098",
|
|
2163
|
+
"#b07060",
|
|
2164
|
+
"#a09030",
|
|
2165
|
+
"#508878",
|
|
2166
|
+
"#a06878",
|
|
2167
|
+
"#6888a0",
|
|
2168
|
+
"#8870a0"
|
|
2169
|
+
],
|
|
2170
|
+
bands: {
|
|
2171
|
+
upper: "#6888a0",
|
|
2172
|
+
lower: "#a06878"
|
|
2173
|
+
},
|
|
2174
|
+
crosshair: {
|
|
2175
|
+
color: "rgba(160,152,128,0.3)",
|
|
2176
|
+
labelBackground: "#f5edd8",
|
|
2177
|
+
labelTextColor: "#5c5040"
|
|
2178
|
+
},
|
|
2179
|
+
axis: { textColor: "#a09880" },
|
|
2180
|
+
yLabel: {
|
|
2181
|
+
upBackground: "#7a9a5e",
|
|
2182
|
+
downBackground: "#b07060",
|
|
2183
|
+
neutralBackground: "#e8dcc8",
|
|
2184
|
+
textColor: "#fdf5e6"
|
|
2185
|
+
},
|
|
2186
|
+
tooltip: {
|
|
2187
|
+
background: "rgba(253,245,230,0.95)",
|
|
2188
|
+
textColor: "#5c5040",
|
|
2189
|
+
borderColor: "rgba(180,170,150,0.4)"
|
|
2190
|
+
}
|
|
2201
2191
|
}
|
|
2202
|
-
},
|
|
2192
|
+
}, Io = "'Silkscreen', cursive", Wo = "https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap", Ao = Y({
|
|
2203
2193
|
name: "Matrix",
|
|
2204
2194
|
background: "#000000",
|
|
2205
2195
|
candlestick: { upColor: "#00ff41", downColor: "#00802a" },
|
|
@@ -2221,10 +2211,10 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2221
2211
|
axis: { textColor: "#00cc33" },
|
|
2222
2212
|
crosshair: { color: "rgba(0,255,65,0.3)", labelBackground: "#0a1a0a" },
|
|
2223
2213
|
tooltip: { background: "rgba(0,10,0,0.95)", textColor: "#00ff41", borderColor: "rgba(0,255,65,0.2)" },
|
|
2224
|
-
typography: { fontFamily:
|
|
2225
|
-
fontUrl:
|
|
2214
|
+
typography: { fontFamily: Io },
|
|
2215
|
+
fontUrl: Wo,
|
|
2226
2216
|
chartGradient: ["#010a01", "#000000"]
|
|
2227
|
-
}),
|
|
2217
|
+
}), Vo = Y({
|
|
2228
2218
|
name: "Lavender Mist",
|
|
2229
2219
|
background: "#f5f0f4",
|
|
2230
2220
|
candlestick: { upColor: "#6b8e5e", downColor: "#b85468" },
|
|
@@ -2249,7 +2239,7 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2249
2239
|
typography: { fontFamily: ee },
|
|
2250
2240
|
fontUrl: oe,
|
|
2251
2241
|
chartGradient: ["#f8f4f7", "#f5f0f4"]
|
|
2252
|
-
}),
|
|
2242
|
+
}), Yo = Y({
|
|
2253
2243
|
name: "Love",
|
|
2254
2244
|
description: "Soft romantic pinks and roses",
|
|
2255
2245
|
background: "#fef7f8",
|
|
@@ -2275,7 +2265,7 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2275
2265
|
tooltip: { background: "rgba(253,242,244,0.95)", textColor: "#4a3040", borderColor: "rgba(200,160,175,0.35)" },
|
|
2276
2266
|
typography: { fontFamily: $t },
|
|
2277
2267
|
fontUrl: Qt
|
|
2278
|
-
}),
|
|
2268
|
+
}), Uo = Y({
|
|
2279
2269
|
name: "Material Palenight",
|
|
2280
2270
|
description: "Material Design in moonlit hues",
|
|
2281
2271
|
background: "#292d3e",
|
|
@@ -2298,9 +2288,9 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2298
2288
|
crosshair: { color: "rgba(103,110,149,0.4)", labelBackground: "#34324a" },
|
|
2299
2289
|
axis: { textColor: "#676e95" },
|
|
2300
2290
|
tooltip: { background: "rgba(41,45,62,0.92)", textColor: "#a6accd", borderColor: "rgba(55,59,75,0.6)" },
|
|
2301
|
-
typography: { fontFamily:
|
|
2302
|
-
fontUrl:
|
|
2303
|
-
}),
|
|
2291
|
+
typography: { fontFamily: Se },
|
|
2292
|
+
fontUrl: Me
|
|
2293
|
+
}), Eo = "'Silkscreen', cursive", Oo = "https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap", $o = Y({
|
|
2304
2294
|
name: "Monochrome",
|
|
2305
2295
|
description: "Pure black and white, pixel font",
|
|
2306
2296
|
background: "#ffffff",
|
|
@@ -2324,9 +2314,9 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2324
2314
|
crosshair: { color: "rgba(0,0,0,0.08)", labelBackground: "#f0f0f0" },
|
|
2325
2315
|
axis: { textColor: "#b0b0b0" },
|
|
2326
2316
|
tooltip: { background: "rgba(255,255,255,0.97)", textColor: "#222222", borderColor: "rgba(0,0,0,0.08)" },
|
|
2327
|
-
typography: { fontFamily:
|
|
2328
|
-
fontUrl:
|
|
2329
|
-
}),
|
|
2317
|
+
typography: { fontFamily: Eo, tooltipFontSize: 9 },
|
|
2318
|
+
fontUrl: Oo
|
|
2319
|
+
}), Xo = Y({
|
|
2330
2320
|
name: "Mint Breeze",
|
|
2331
2321
|
background: "#f6f5ee",
|
|
2332
2322
|
candlestick: { upColor: "#2e9070", downColor: "#d04848" },
|
|
@@ -2348,10 +2338,10 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2348
2338
|
axis: { textColor: "#80a098" },
|
|
2349
2339
|
crosshair: { color: "rgba(120,140,120,0.18)", labelBackground: "#ece8de" },
|
|
2350
2340
|
tooltip: { background: "rgba(246,245,238,0.95)", textColor: "#2a3530", borderColor: "rgba(130,140,115,0.2)" },
|
|
2351
|
-
typography: { fontFamily:
|
|
2352
|
-
fontUrl:
|
|
2341
|
+
typography: { fontFamily: So },
|
|
2342
|
+
fontUrl: Mo,
|
|
2353
2343
|
chartGradient: ["#f8f7f0", "#f6f5ee"]
|
|
2354
|
-
}),
|
|
2344
|
+
}), Ho = Y({
|
|
2355
2345
|
name: "Monokai Pro",
|
|
2356
2346
|
description: "Bold syntax colors on dark gray",
|
|
2357
2347
|
background: "#2d2a2e",
|
|
@@ -2376,7 +2366,7 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2376
2366
|
tooltip: { background: "rgba(45,42,46,0.92)", textColor: "#fcfcfa", borderColor: "rgba(64,60,62,0.6)" },
|
|
2377
2367
|
typography: { fontFamily: Zt },
|
|
2378
2368
|
fontUrl: te
|
|
2379
|
-
}),
|
|
2369
|
+
}), Go = Y({
|
|
2380
2370
|
name: "Night Owl",
|
|
2381
2371
|
description: "Crafted for late-night coding",
|
|
2382
2372
|
background: "#011627",
|
|
@@ -2401,7 +2391,7 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2401
2391
|
tooltip: { background: "rgba(1,22,39,0.92)", textColor: "#d6deeb", borderColor: "rgba(31,52,72,0.6)" },
|
|
2402
2392
|
typography: { fontFamily: Et },
|
|
2403
2393
|
fontUrl: Ot
|
|
2404
|
-
}),
|
|
2394
|
+
}), No = Y({
|
|
2405
2395
|
name: "One Dark Pro",
|
|
2406
2396
|
description: "Atom editor's iconic dark palette",
|
|
2407
2397
|
background: "#282c34",
|
|
@@ -2426,7 +2416,7 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2426
2416
|
tooltip: { background: "rgba(40,44,52,0.92)", textColor: "#abb2bf", borderColor: "rgba(59,64,72,0.6)" },
|
|
2427
2417
|
typography: { fontFamily: Et },
|
|
2428
2418
|
fontUrl: Ot
|
|
2429
|
-
}),
|
|
2419
|
+
}), Jo = Y({
|
|
2430
2420
|
name: "Panda",
|
|
2431
2421
|
description: "Playful neons on charcoal",
|
|
2432
2422
|
background: "#292a2b",
|
|
@@ -2451,7 +2441,7 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2451
2441
|
tooltip: { background: "rgba(41,42,43,0.92)", textColor: "#e6e6e6", borderColor: "rgba(58,58,60,0.6)" },
|
|
2452
2442
|
typography: { fontFamily: Zt },
|
|
2453
2443
|
fontUrl: te
|
|
2454
|
-
}),
|
|
2444
|
+
}), jo = Y({
|
|
2455
2445
|
name: "Peach Cream",
|
|
2456
2446
|
background: "#fef6f0",
|
|
2457
2447
|
candlestick: { upColor: "#5a9a68", downColor: "#d06848" },
|
|
@@ -2476,7 +2466,7 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2476
2466
|
typography: { fontFamily: ee },
|
|
2477
2467
|
fontUrl: oe,
|
|
2478
2468
|
chartGradient: ["#fff8f2", "#fef6f0"]
|
|
2479
|
-
}),
|
|
2469
|
+
}), Ko = Y({
|
|
2480
2470
|
name: "Quiet Light",
|
|
2481
2471
|
description: "Subdued and easy on the eyes",
|
|
2482
2472
|
background: "#f5f5f5",
|
|
@@ -2501,7 +2491,7 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2501
2491
|
tooltip: { background: "rgba(245,245,245,0.95)", textColor: "#333333", borderColor: "rgba(200,200,200,0.5)" },
|
|
2502
2492
|
typography: { fontFamily: ee },
|
|
2503
2493
|
fontUrl: oe
|
|
2504
|
-
}),
|
|
2494
|
+
}), qo = Y({
|
|
2505
2495
|
name: "Rosé Pine Dawn",
|
|
2506
2496
|
description: "Dawn-inspired warm neutrals",
|
|
2507
2497
|
background: "#faf4ed",
|
|
@@ -2524,9 +2514,9 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2524
2514
|
crosshair: { color: "rgba(152,147,165,0.3)", labelBackground: "#f2e9e1" },
|
|
2525
2515
|
axis: { textColor: "#9893a5" },
|
|
2526
2516
|
tooltip: { background: "rgba(250,244,237,0.95)", textColor: "#575279", borderColor: "rgba(152,147,165,0.3)" },
|
|
2527
|
-
typography: { fontFamily:
|
|
2528
|
-
fontUrl:
|
|
2529
|
-
}),
|
|
2517
|
+
typography: { fontFamily: Re },
|
|
2518
|
+
fontUrl: Te
|
|
2519
|
+
}), Qo = Y({
|
|
2530
2520
|
name: "Sand Dune",
|
|
2531
2521
|
background: "#f4f0e8",
|
|
2532
2522
|
candlestick: { upColor: "#5a8a50", downColor: "#b85040" },
|
|
@@ -2548,10 +2538,10 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2548
2538
|
axis: { textColor: "#9a8a70" },
|
|
2549
2539
|
crosshair: { color: "rgba(150,130,100,0.2)", labelBackground: "#e8e0d0" },
|
|
2550
2540
|
tooltip: { background: "rgba(244,240,232,0.95)", textColor: "#3a3020", borderColor: "rgba(150,130,100,0.3)" },
|
|
2551
|
-
typography: { fontFamily:
|
|
2552
|
-
fontUrl:
|
|
2541
|
+
typography: { fontFamily: Re },
|
|
2542
|
+
fontUrl: Te,
|
|
2553
2543
|
chartGradient: ["#f8f4ec", "#f4f0e8"]
|
|
2554
|
-
}),
|
|
2544
|
+
}), Zo = Y({
|
|
2555
2545
|
name: "Solarized Light",
|
|
2556
2546
|
description: "Ethan Schoonover's precision palette",
|
|
2557
2547
|
background: "#fdf6e3",
|
|
@@ -2577,47 +2567,47 @@ const Et = "'JetBrains Mono', 'Fira Code', monospace", Ot = "https://fonts.googl
|
|
|
2577
2567
|
tooltip: { background: "rgba(253,246,227,0.95)", textColor: "#586e75", borderColor: "rgba(238,232,213,0.6)" },
|
|
2578
2568
|
typography: { fontFamily: Et },
|
|
2579
2569
|
fontUrl: Ot
|
|
2580
|
-
}),
|
|
2581
|
-
Dracula:
|
|
2582
|
-
"One Dark Pro":
|
|
2583
|
-
"Monokai Pro":
|
|
2584
|
-
"Night Owl":
|
|
2585
|
-
"Material Palenight":
|
|
2586
|
-
Gruvbox:
|
|
2587
|
-
Catppuccin:
|
|
2588
|
-
"Ayu Mirage":
|
|
2589
|
-
Panda:
|
|
2590
|
-
Andromeda:
|
|
2591
|
-
Matrix:
|
|
2570
|
+
}), ye = {
|
|
2571
|
+
Dracula: zo,
|
|
2572
|
+
"One Dark Pro": No,
|
|
2573
|
+
"Monokai Pro": Ho,
|
|
2574
|
+
"Night Owl": Go,
|
|
2575
|
+
"Material Palenight": Uo,
|
|
2576
|
+
Gruvbox: Fo,
|
|
2577
|
+
Catppuccin: Bo,
|
|
2578
|
+
"Ayu Mirage": Do,
|
|
2579
|
+
Panda: Jo,
|
|
2580
|
+
Andromeda: _o,
|
|
2581
|
+
Matrix: Ao,
|
|
2592
2582
|
Handwritten: Lo,
|
|
2593
|
-
"GitHub Light":
|
|
2594
|
-
"Solarized Light":
|
|
2595
|
-
"Rosé Pine Dawn":
|
|
2596
|
-
"Quiet Light":
|
|
2597
|
-
"Lavender Mist":
|
|
2598
|
-
"Mint Breeze":
|
|
2599
|
-
"Sand Dune":
|
|
2600
|
-
"Peach Cream":
|
|
2601
|
-
Monochrome:
|
|
2602
|
-
Love:
|
|
2583
|
+
"GitHub Light": Po,
|
|
2584
|
+
"Solarized Light": Zo,
|
|
2585
|
+
"Rosé Pine Dawn": qo,
|
|
2586
|
+
"Quiet Light": Ko,
|
|
2587
|
+
"Lavender Mist": Vo,
|
|
2588
|
+
"Mint Breeze": Xo,
|
|
2589
|
+
"Sand Dune": Qo,
|
|
2590
|
+
"Peach Cream": jo,
|
|
2591
|
+
Monochrome: $o,
|
|
2592
|
+
Love: Yo
|
|
2603
2593
|
};
|
|
2604
|
-
function
|
|
2605
|
-
return
|
|
2594
|
+
function ki(r) {
|
|
2595
|
+
return (ye[r] ?? ye["One Dark Pro"]).theme;
|
|
2606
2596
|
}
|
|
2607
|
-
const
|
|
2597
|
+
const _e = Symbol("wick-chart"), De = Symbol("wick-theme");
|
|
2608
2598
|
function rt() {
|
|
2609
|
-
const r =
|
|
2599
|
+
const r = xe(_e);
|
|
2610
2600
|
if (!r || !r.value)
|
|
2611
2601
|
throw new Error("useChartInstance must be used within <ChartContainer>");
|
|
2612
2602
|
return r.value;
|
|
2613
2603
|
}
|
|
2614
|
-
function
|
|
2615
|
-
const r =
|
|
2604
|
+
function ti() {
|
|
2605
|
+
const r = xe(De);
|
|
2616
2606
|
if (!r)
|
|
2617
2607
|
throw new Error("useTheme must be used within <ChartContainer>");
|
|
2618
2608
|
return r;
|
|
2619
2609
|
}
|
|
2620
|
-
const
|
|
2610
|
+
const Si = /* @__PURE__ */ Z({
|
|
2621
2611
|
__name: "BarSeries",
|
|
2622
2612
|
props: {
|
|
2623
2613
|
data: {},
|
|
@@ -2626,12 +2616,12 @@ const Mi = /* @__PURE__ */ Q({
|
|
|
2626
2616
|
},
|
|
2627
2617
|
emits: ["seriesId"],
|
|
2628
2618
|
setup(r, { emit: t }) {
|
|
2629
|
-
const e = r, o = t, i = rt(), a =
|
|
2630
|
-
return
|
|
2619
|
+
const e = r, o = t, i = rt(), a = tt(null);
|
|
2620
|
+
return q(() => {
|
|
2631
2621
|
var n;
|
|
2632
2622
|
const s = i.addBarSeries({ ...e.options, label: e.label ?? ((n = e.options) == null ? void 0 : n.label), layers: e.data.length });
|
|
2633
2623
|
a.value = s, o("seriesId", s);
|
|
2634
|
-
}),
|
|
2624
|
+
}), et(() => {
|
|
2635
2625
|
a.value && i.removeSeries(a.value);
|
|
2636
2626
|
}), st(
|
|
2637
2627
|
() => e.data,
|
|
@@ -2647,9 +2637,9 @@ const Mi = /* @__PURE__ */ Q({
|
|
|
2647
2637
|
a.value && s && i.updateSeriesOptions(a.value, s);
|
|
2648
2638
|
},
|
|
2649
2639
|
{ deep: !0 }
|
|
2650
|
-
), (s, n) =>
|
|
2640
|
+
), (s, n) => K("", !0);
|
|
2651
2641
|
}
|
|
2652
|
-
}),
|
|
2642
|
+
}), Mi = /* @__PURE__ */ Z({
|
|
2653
2643
|
__name: "CandlestickSeries",
|
|
2654
2644
|
props: {
|
|
2655
2645
|
data: {},
|
|
@@ -2657,12 +2647,12 @@ const Mi = /* @__PURE__ */ Q({
|
|
|
2657
2647
|
},
|
|
2658
2648
|
emits: ["seriesId"],
|
|
2659
2649
|
setup(r, { emit: t }) {
|
|
2660
|
-
const e = r, o = t, i = rt(), a =
|
|
2650
|
+
const e = r, o = t, i = rt(), a = tt(null);
|
|
2661
2651
|
let s = 0;
|
|
2662
|
-
return
|
|
2652
|
+
return q(() => {
|
|
2663
2653
|
const n = i.addCandlestickSeries(e.options);
|
|
2664
2654
|
a.value = n, o("seriesId", n);
|
|
2665
|
-
}),
|
|
2655
|
+
}), et(() => {
|
|
2666
2656
|
a.value && i.removeSeries(a.value);
|
|
2667
2657
|
}), st(
|
|
2668
2658
|
() => e.data,
|
|
@@ -2689,24 +2679,24 @@ const Mi = /* @__PURE__ */ Q({
|
|
|
2689
2679
|
a.value && n && i.updateSeriesOptions(a.value, n);
|
|
2690
2680
|
},
|
|
2691
2681
|
{ deep: !0 }
|
|
2692
|
-
), (n, l) =>
|
|
2682
|
+
), (n, l) => K("", !0);
|
|
2693
2683
|
}
|
|
2694
|
-
}),
|
|
2684
|
+
}), ei = {
|
|
2695
2685
|
key: 0,
|
|
2696
2686
|
style: { position: "absolute", inset: "0", "pointer-events": "none", "z-index": "2" }
|
|
2697
|
-
},
|
|
2687
|
+
}, Ri = /* @__PURE__ */ Z({
|
|
2698
2688
|
__name: "ChartContainer",
|
|
2699
2689
|
props: {
|
|
2700
|
-
theme: { default: () =>
|
|
2690
|
+
theme: { default: () => ke },
|
|
2701
2691
|
axis: {}
|
|
2702
2692
|
},
|
|
2703
2693
|
setup(r) {
|
|
2704
|
-
const t = r, e =
|
|
2705
|
-
he(
|
|
2694
|
+
const t = r, e = tt(), o = le(null), i = le(t.theme);
|
|
2695
|
+
he(_e, o), he(De, i), q(() => {
|
|
2706
2696
|
if (!e.value) return;
|
|
2707
2697
|
const s = {};
|
|
2708
|
-
t.axis && (s.axis = t.axis), t.theme && (s.theme = t.theme), o.value = new
|
|
2709
|
-
}),
|
|
2698
|
+
t.axis && (s.axis = t.axis), t.theme && (s.theme = t.theme), o.value = new xo(e.value, s);
|
|
2699
|
+
}), et(() => {
|
|
2710
2700
|
var s;
|
|
2711
2701
|
(s = o.value) == null || s.destroy(), o.value = null;
|
|
2712
2702
|
}), st(
|
|
@@ -2730,49 +2720,49 @@ const Mi = /* @__PURE__ */ Q({
|
|
|
2730
2720
|
ref: e,
|
|
2731
2721
|
style: z(a.value)
|
|
2732
2722
|
}, [
|
|
2733
|
-
o.value ? (R(), T("div",
|
|
2734
|
-
|
|
2735
|
-
])) :
|
|
2723
|
+
o.value ? (R(), T("div", ei, [
|
|
2724
|
+
Oe(s.$slots, "default")
|
|
2725
|
+
])) : K("", !0)
|
|
2736
2726
|
], 4));
|
|
2737
2727
|
}
|
|
2738
2728
|
});
|
|
2739
|
-
function
|
|
2740
|
-
const t =
|
|
2729
|
+
function Be(r) {
|
|
2730
|
+
const t = tt(r.getVisibleRange()), e = () => {
|
|
2741
2731
|
t.value = r.getVisibleRange();
|
|
2742
2732
|
};
|
|
2743
|
-
return
|
|
2733
|
+
return q(() => r.on("viewportChange", e)), et(() => r.off("viewportChange", e)), t;
|
|
2744
2734
|
}
|
|
2745
|
-
function
|
|
2746
|
-
const t =
|
|
2735
|
+
function Ti(r) {
|
|
2736
|
+
const t = tt(r.getYRange()), e = () => {
|
|
2747
2737
|
t.value = r.getYRange();
|
|
2748
2738
|
};
|
|
2749
|
-
return
|
|
2739
|
+
return q(() => r.on("viewportChange", e)), et(() => r.off("viewportChange", e)), t;
|
|
2750
2740
|
}
|
|
2751
|
-
function
|
|
2752
|
-
const e =
|
|
2741
|
+
function oi(r, t) {
|
|
2742
|
+
const e = tt(r.getLastValue(t)), o = () => {
|
|
2753
2743
|
var a, s;
|
|
2754
2744
|
const i = r.getLastValue(t);
|
|
2755
2745
|
((a = e.value) == null ? void 0 : a.value) === (i == null ? void 0 : i.value) && ((s = e.value) == null ? void 0 : s.isLive) === (i == null ? void 0 : i.isLive) || (e.value = i);
|
|
2756
2746
|
};
|
|
2757
|
-
return
|
|
2747
|
+
return q(() => {
|
|
2758
2748
|
r.on("dataUpdate", o), r.on("viewportChange", o);
|
|
2759
|
-
}),
|
|
2749
|
+
}), et(() => {
|
|
2760
2750
|
r.off("dataUpdate", o), r.off("viewportChange", o);
|
|
2761
2751
|
}), e;
|
|
2762
2752
|
}
|
|
2763
|
-
function
|
|
2764
|
-
const e =
|
|
2753
|
+
function ii(r, t) {
|
|
2754
|
+
const e = tt(r.getPreviousClose(t)), o = () => {
|
|
2765
2755
|
e.value = r.getPreviousClose(t);
|
|
2766
2756
|
};
|
|
2767
|
-
return
|
|
2757
|
+
return q(() => r.on("dataUpdate", o)), et(() => r.off("dataUpdate", o)), e;
|
|
2768
2758
|
}
|
|
2769
2759
|
function ie(r) {
|
|
2770
|
-
const t =
|
|
2760
|
+
const t = tt(r.getCrosshairPosition()), e = () => {
|
|
2771
2761
|
t.value = r.getCrosshairPosition();
|
|
2772
2762
|
};
|
|
2773
|
-
return
|
|
2763
|
+
return q(() => r.on("crosshairMove", e)), et(() => r.off("crosshairMove", e)), t;
|
|
2774
2764
|
}
|
|
2775
|
-
const
|
|
2765
|
+
const _i = /* @__PURE__ */ Z({
|
|
2776
2766
|
__name: "LineSeries",
|
|
2777
2767
|
props: {
|
|
2778
2768
|
data: {},
|
|
@@ -2781,12 +2771,12 @@ const Di = /* @__PURE__ */ Q({
|
|
|
2781
2771
|
},
|
|
2782
2772
|
emits: ["seriesId"],
|
|
2783
2773
|
setup(r, { emit: t }) {
|
|
2784
|
-
const e = r, o = t, i = rt(), a =
|
|
2785
|
-
return
|
|
2774
|
+
const e = r, o = t, i = rt(), a = tt(null);
|
|
2775
|
+
return q(() => {
|
|
2786
2776
|
var n;
|
|
2787
2777
|
const s = i.addLineSeries({ ...e.options, label: e.label ?? ((n = e.options) == null ? void 0 : n.label), layers: e.data.length });
|
|
2788
2778
|
a.value = s, o("seriesId", s);
|
|
2789
|
-
}),
|
|
2779
|
+
}), et(() => {
|
|
2790
2780
|
a.value && i.removeSeries(a.value);
|
|
2791
2781
|
}), st(
|
|
2792
2782
|
() => e.data,
|
|
@@ -2802,9 +2792,9 @@ const Di = /* @__PURE__ */ Q({
|
|
|
2802
2792
|
a.value && s && i.updateSeriesOptions(a.value, s);
|
|
2803
2793
|
},
|
|
2804
2794
|
{ deep: !0 }
|
|
2805
|
-
), (s, n) =>
|
|
2795
|
+
), (s, n) => K("", !0);
|
|
2806
2796
|
}
|
|
2807
|
-
}),
|
|
2797
|
+
}), Di = /* @__PURE__ */ Z({
|
|
2808
2798
|
__name: "PieSeries",
|
|
2809
2799
|
props: {
|
|
2810
2800
|
data: {},
|
|
@@ -2812,11 +2802,11 @@ const Di = /* @__PURE__ */ Q({
|
|
|
2812
2802
|
},
|
|
2813
2803
|
emits: ["seriesId"],
|
|
2814
2804
|
setup(r, { emit: t }) {
|
|
2815
|
-
const e = r, o = t, i = rt(), a =
|
|
2816
|
-
return
|
|
2805
|
+
const e = r, o = t, i = rt(), a = tt(null);
|
|
2806
|
+
return q(() => {
|
|
2817
2807
|
const s = i.addPieSeries(e.options);
|
|
2818
2808
|
a.value = s, o("seriesId", s);
|
|
2819
|
-
}),
|
|
2809
|
+
}), et(() => {
|
|
2820
2810
|
a.value && i.removeSeries(a.value);
|
|
2821
2811
|
}), st(
|
|
2822
2812
|
() => e.data,
|
|
@@ -2829,9 +2819,9 @@ const Di = /* @__PURE__ */ Q({
|
|
|
2829
2819
|
a.value && s && i.updateSeriesOptions(a.value, s);
|
|
2830
2820
|
},
|
|
2831
2821
|
{ deep: !0 }
|
|
2832
|
-
), (s, n) =>
|
|
2822
|
+
), (s, n) => K("", !0);
|
|
2833
2823
|
}
|
|
2834
|
-
}),
|
|
2824
|
+
}), Bi = /* @__PURE__ */ Z({
|
|
2835
2825
|
__name: "Crosshair",
|
|
2836
2826
|
setup(r) {
|
|
2837
2827
|
const t = rt(), e = ie(t), o = P(() => t.getTheme()), i = P(() => t.getDataInterval()), a = P(() => ({
|
|
@@ -2853,7 +2843,7 @@ const Di = /* @__PURE__ */ Q({
|
|
|
2853
2843
|
transform: "translateY(-50%)",
|
|
2854
2844
|
...a.value
|
|
2855
2845
|
})
|
|
2856
|
-
},
|
|
2846
|
+
}, I(W(t).yScale.formatY(W(e).y)), 5),
|
|
2857
2847
|
_("div", {
|
|
2858
2848
|
style: z({
|
|
2859
2849
|
position: "absolute",
|
|
@@ -2862,14 +2852,14 @@ const Di = /* @__PURE__ */ Q({
|
|
|
2862
2852
|
transform: "translateX(-50%)",
|
|
2863
2853
|
...a.value
|
|
2864
2854
|
})
|
|
2865
|
-
},
|
|
2866
|
-
], 64)) :
|
|
2855
|
+
}, I(W(Ut)(W(e).time, i.value)), 5)
|
|
2856
|
+
], 64)) : K("", !0);
|
|
2867
2857
|
}
|
|
2868
|
-
}),
|
|
2858
|
+
}), ai = { style: {
|
|
2869
2859
|
display: "inline-flex",
|
|
2870
2860
|
fontVariantNumeric: "tabular-nums",
|
|
2871
2861
|
lineHeight: 1.2
|
|
2872
|
-
} },
|
|
2862
|
+
} }, si = {
|
|
2873
2863
|
key: 0,
|
|
2874
2864
|
style: {
|
|
2875
2865
|
display: "inline-block",
|
|
@@ -2877,10 +2867,10 @@ const Di = /* @__PURE__ */ Q({
|
|
|
2877
2867
|
overflow: "hidden",
|
|
2878
2868
|
position: "relative"
|
|
2879
2869
|
}
|
|
2880
|
-
},
|
|
2870
|
+
}, ri = {
|
|
2881
2871
|
key: 1,
|
|
2882
2872
|
style: { display: "inline-block" }
|
|
2883
|
-
},
|
|
2873
|
+
}, ni = /* @__PURE__ */ Z({
|
|
2884
2874
|
__name: "NumberFlow",
|
|
2885
2875
|
props: {
|
|
2886
2876
|
value: {},
|
|
@@ -2889,8 +2879,8 @@ const Di = /* @__PURE__ */ Q({
|
|
|
2889
2879
|
spinDuration: { default: 350 }
|
|
2890
2880
|
},
|
|
2891
2881
|
setup(r) {
|
|
2892
|
-
const t = r, e =
|
|
2893
|
-
|
|
2882
|
+
const t = r, e = tt(!1);
|
|
2883
|
+
q(() => {
|
|
2894
2884
|
e.value = !0;
|
|
2895
2885
|
});
|
|
2896
2886
|
const o = P(() => new Intl.NumberFormat(t.locale, t.format)), i = P(() => {
|
|
@@ -2899,9 +2889,9 @@ const Di = /* @__PURE__ */ Q({
|
|
|
2899
2889
|
l >= "0" && l <= "9" ? n.push({ type: "digit", value: l }) : n.push({ type: "symbol", value: l });
|
|
2900
2890
|
return n;
|
|
2901
2891
|
}), a = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
2902
|
-
return (s, n) => (R(), T("span",
|
|
2892
|
+
return (s, n) => (R(), T("span", ai, [
|
|
2903
2893
|
(R(!0), T(O, null, ct(i.value, (l, c) => (R(), T(O, { key: c }, [
|
|
2904
|
-
l.type === "digit" ? (R(), T("span",
|
|
2894
|
+
l.type === "digit" ? (R(), T("span", si, [
|
|
2905
2895
|
_("span", {
|
|
2906
2896
|
style: z({
|
|
2907
2897
|
display: "flex",
|
|
@@ -2918,28 +2908,28 @@ const Di = /* @__PURE__ */ Q({
|
|
|
2918
2908
|
justifyContent: "center",
|
|
2919
2909
|
height: "1.2em"
|
|
2920
2910
|
}
|
|
2921
|
-
},
|
|
2911
|
+
}, I(d), 1)), 64))
|
|
2922
2912
|
], 4)
|
|
2923
|
-
])) : (R(), T("span",
|
|
2913
|
+
])) : (R(), T("span", ri, I(l.value), 1))
|
|
2924
2914
|
], 64))), 128))
|
|
2925
2915
|
]));
|
|
2926
2916
|
}
|
|
2927
|
-
}),
|
|
2917
|
+
}), li = { style: { flex: 1, opacity: 0.8 } }, hi = {
|
|
2928
2918
|
key: 0,
|
|
2929
2919
|
style: { fontWeight: 600, fontVariantNumeric: "tabular-nums" }
|
|
2930
|
-
},
|
|
2920
|
+
}, zi = /* @__PURE__ */ Z({
|
|
2931
2921
|
__name: "PieLegend",
|
|
2932
2922
|
props: {
|
|
2933
2923
|
seriesId: {},
|
|
2934
2924
|
format: { default: "value" }
|
|
2935
2925
|
},
|
|
2936
2926
|
setup(r) {
|
|
2937
|
-
const t = r, e = rt(), o =
|
|
2927
|
+
const t = r, e = rt(), o = ti(), i = tt(0), a = () => {
|
|
2938
2928
|
i.value++;
|
|
2939
2929
|
};
|
|
2940
|
-
|
|
2930
|
+
q(() => {
|
|
2941
2931
|
e.on("dataUpdate", a);
|
|
2942
|
-
}),
|
|
2932
|
+
}), et(() => {
|
|
2943
2933
|
e.off("dataUpdate", a);
|
|
2944
2934
|
});
|
|
2945
2935
|
const s = P(() => o.value), n = P(() => (i.value, e.getPieSlices(t.seriesId) ?? []));
|
|
@@ -2966,8 +2956,8 @@ const Di = /* @__PURE__ */ Q({
|
|
|
2966
2956
|
_("span", {
|
|
2967
2957
|
style: z({ width: "10px", height: "10px", borderRadius: "50%", background: u.color, flexShrink: 0 })
|
|
2968
2958
|
}, null, 4),
|
|
2969
|
-
_("span",
|
|
2970
|
-
r.format === "value" ? (R(), T("span",
|
|
2959
|
+
_("span", li, I(u.label), 1),
|
|
2960
|
+
r.format === "value" ? (R(), T("span", hi, I(l(u.value)), 1)) : K("", !0),
|
|
2971
2961
|
_("span", {
|
|
2972
2962
|
style: z({
|
|
2973
2963
|
opacity: r.format === "percent" ? 1 : 0.5,
|
|
@@ -2977,11 +2967,11 @@ const Di = /* @__PURE__ */ Q({
|
|
|
2977
2967
|
minWidth: "40px",
|
|
2978
2968
|
textAlign: "right"
|
|
2979
2969
|
})
|
|
2980
|
-
},
|
|
2970
|
+
}, I(u.percent.toFixed(1)) + "% ", 5)
|
|
2981
2971
|
]))), 128))
|
|
2982
|
-
], 4)) :
|
|
2972
|
+
], 4)) : K("", !0);
|
|
2983
2973
|
}
|
|
2984
|
-
}),
|
|
2974
|
+
}), ci = { style: { display: "flex", alignItems: "center", gap: "8px" } }, di = { style: { fontWeight: 600 } }, ui = { style: { display: "flex", justifyContent: "space-between", gap: "16px" } }, fi = { style: { opacity: 0.6 } }, pi = { style: { fontWeight: 600 } }, Pi = /* @__PURE__ */ Z({
|
|
2985
2975
|
__name: "PieTooltip",
|
|
2986
2976
|
props: {
|
|
2987
2977
|
seriesId: {}
|
|
@@ -3015,7 +3005,7 @@ const Di = /* @__PURE__ */ Q({
|
|
|
3015
3005
|
gap: "6px"
|
|
3016
3006
|
})
|
|
3017
3007
|
}, [
|
|
3018
|
-
_("div",
|
|
3008
|
+
_("div", ci, [
|
|
3019
3009
|
_("span", {
|
|
3020
3010
|
style: z({
|
|
3021
3011
|
width: "10px",
|
|
@@ -3025,18 +3015,18 @@ const Di = /* @__PURE__ */ Q({
|
|
|
3025
3015
|
flexShrink: 0
|
|
3026
3016
|
})
|
|
3027
3017
|
}, null, 4),
|
|
3028
|
-
_("span",
|
|
3018
|
+
_("span", di, I(a.value.label), 1)
|
|
3029
3019
|
]),
|
|
3030
|
-
_("div",
|
|
3031
|
-
_("span",
|
|
3032
|
-
_("span",
|
|
3020
|
+
_("div", ui, [
|
|
3021
|
+
_("span", fi, I(a.value.value.toLocaleString()), 1),
|
|
3022
|
+
_("span", pi, I(a.value.percent.toFixed(1)) + "%", 1)
|
|
3033
3023
|
])
|
|
3034
|
-
], 4)) :
|
|
3024
|
+
], 4)) : K("", !0);
|
|
3035
3025
|
}
|
|
3036
|
-
}),
|
|
3026
|
+
}), Fi = /* @__PURE__ */ Z({
|
|
3037
3027
|
__name: "TimeAxis",
|
|
3038
3028
|
setup(r) {
|
|
3039
|
-
const t = rt(), e =
|
|
3029
|
+
const t = rt(), e = Be(t), o = /* @__PURE__ */ new Map(), i = P(() => t.getTheme()), a = P(() => {
|
|
3040
3030
|
e.value;
|
|
3041
3031
|
const s = t.getDataInterval(), { ticks: n, tickInterval: l } = t.timeScale.niceTickValues(s), c = new Set(n), d = performance.now();
|
|
3042
3032
|
for (const u of n)
|
|
@@ -3077,35 +3067,35 @@ const Di = /* @__PURE__ */ Q({
|
|
|
3077
3067
|
transition: "opacity 0.3s ease",
|
|
3078
3068
|
willChange: "opacity"
|
|
3079
3069
|
})
|
|
3080
|
-
},
|
|
3070
|
+
}, I(W(Ut)(l, a.value.tickInterval)), 5))), 128))
|
|
3081
3071
|
], 4));
|
|
3082
3072
|
}
|
|
3083
|
-
}),
|
|
3073
|
+
}), gi = {
|
|
3084
3074
|
key: 0,
|
|
3085
3075
|
style: { display: "inline-flex", alignItems: "center", gap: "4px" }
|
|
3086
|
-
},
|
|
3076
|
+
}, mi = {
|
|
3087
3077
|
key: 1,
|
|
3088
3078
|
style: { display: "inline-flex", alignItems: "center", gap: "3px" }
|
|
3089
|
-
},
|
|
3079
|
+
}, bi = {
|
|
3090
3080
|
key: 0,
|
|
3091
3081
|
style: { display: "grid", gridTemplateColumns: "auto 1fr", gap: "4px 12px" }
|
|
3092
|
-
},
|
|
3082
|
+
}, vi = { style: { opacity: 0.5 } }, yi = {
|
|
3093
3083
|
key: 1,
|
|
3094
3084
|
style: { display: "flex", alignItems: "center", gap: "8px", padding: "2px 0" }
|
|
3095
|
-
},
|
|
3085
|
+
}, xi = { style: { opacity: 0.6, flex: "1" } }, Li = /* @__PURE__ */ Z({
|
|
3096
3086
|
__name: "Tooltip",
|
|
3097
3087
|
props: {
|
|
3098
3088
|
seriesId: {},
|
|
3099
3089
|
sort: { default: "none" }
|
|
3100
3090
|
},
|
|
3101
3091
|
setup(r) {
|
|
3102
|
-
const t = r, e = rt(), o = ie(e), i = P(() => t.seriesId ? [t.seriesId] : e.getSeriesIds()), a = P(() => i.value[0] ?? ""), s =
|
|
3092
|
+
const t = r, e = rt(), o = ie(e), i = P(() => t.seriesId ? [t.seriesId] : e.getSeriesIds()), a = P(() => i.value[0] ?? ""), s = tt(
|
|
3103
3093
|
a.value ? e.getLastValue(a.value) : null
|
|
3104
3094
|
), n = () => {
|
|
3105
3095
|
const p = a.value;
|
|
3106
3096
|
s.value = p ? e.getLastValue(p) : null;
|
|
3107
3097
|
};
|
|
3108
|
-
|
|
3098
|
+
q(() => e.on("dataUpdate", n)), et(() => e.off("dataUpdate", n)), st(a, () => n());
|
|
3109
3099
|
const l = P(() => e.getTheme()), c = P(() => e.getDataInterval());
|
|
3110
3100
|
function d(p, m) {
|
|
3111
3101
|
return m === "none" || p.length <= 1 ? p : [...p].sort((f, y) => {
|
|
@@ -3145,8 +3135,8 @@ const Di = /* @__PURE__ */ Q({
|
|
|
3145
3135
|
return d(p, t.sort);
|
|
3146
3136
|
}), C = P(() => v.value.length === 0 ? 0 : v.value[0].data.time), w = P(() => {
|
|
3147
3137
|
if (!o.value || b.value.length === 0) return null;
|
|
3148
|
-
const p = e.getMediaSize(), m = b.value.some((
|
|
3149
|
-
return { left: $, top:
|
|
3138
|
+
const p = e.getMediaSize(), m = b.value.some((G) => "open" in G.data), f = b.value.filter((G) => !("open" in G.data)).length, y = 160, F = m ? 140 : 40 + f * 22, k = 16, D = 16, L = p.width - e.yAxisWidth, N = p.height - e.xAxisHeight, $ = o.value.mediaX + k + y > L ? o.value.mediaX - k - y : o.value.mediaX + k, Q = o.value.mediaY + D + F > N ? o.value.mediaY - D - F : o.value.mediaY + D;
|
|
3139
|
+
return { left: $, top: Q };
|
|
3150
3140
|
});
|
|
3151
3141
|
function g(p) {
|
|
3152
3142
|
return "open" in p;
|
|
@@ -3172,22 +3162,22 @@ const Di = /* @__PURE__ */ Q({
|
|
|
3172
3162
|
}, [
|
|
3173
3163
|
_("span", {
|
|
3174
3164
|
style: z({ color: l.value.axis.textColor, marginRight: "2px" })
|
|
3175
|
-
},
|
|
3165
|
+
}, I(W(Ut)(C.value, c.value)), 5),
|
|
3176
3166
|
(R(!0), T(O, null, ct(v.value, (f) => (R(), T(O, {
|
|
3177
3167
|
key: f.id
|
|
3178
3168
|
}, [
|
|
3179
|
-
g(f.data) ? (R(), T("span",
|
|
3169
|
+
g(f.data) ? (R(), T("span", gi, [
|
|
3180
3170
|
(R(), T(O, null, ct(["O", "H", "L", "C"], (y) => (R(), T(O, { key: y }, [
|
|
3181
3171
|
_("span", {
|
|
3182
3172
|
style: z({ color: l.value.axis.textColor, opacity: 0.5, marginLeft: "5px" })
|
|
3183
|
-
},
|
|
3173
|
+
}, I(y), 5),
|
|
3184
3174
|
_("span", {
|
|
3185
3175
|
style: z({
|
|
3186
3176
|
color: f.data.close >= f.data.open ? l.value.candlestick.upColor : l.value.candlestick.downColor,
|
|
3187
3177
|
fontWeight: 500,
|
|
3188
3178
|
marginLeft: "2px"
|
|
3189
3179
|
})
|
|
3190
|
-
},
|
|
3180
|
+
}, I({ O: f.data.open, H: f.data.high, L: f.data.low, C: f.data.close }[y].toFixed(2)), 5)
|
|
3191
3181
|
], 64))), 64)),
|
|
3192
3182
|
f.data.volume != null ? (R(), T(O, { key: 0 }, [
|
|
3193
3183
|
_("span", {
|
|
@@ -3195,9 +3185,9 @@ const Di = /* @__PURE__ */ Q({
|
|
|
3195
3185
|
}, "V", 4),
|
|
3196
3186
|
_("span", {
|
|
3197
3187
|
style: z({ color: l.value.axis.textColor, fontWeight: 500, marginLeft: "2px" })
|
|
3198
|
-
},
|
|
3199
|
-
], 64)) :
|
|
3200
|
-
])) : (R(), T("span",
|
|
3188
|
+
}, I(u(f.data.volume)), 5)
|
|
3189
|
+
], 64)) : K("", !0)
|
|
3190
|
+
])) : (R(), T("span", mi, [
|
|
3201
3191
|
_("span", {
|
|
3202
3192
|
style: z({
|
|
3203
3193
|
width: "6px",
|
|
@@ -3209,7 +3199,7 @@ const Di = /* @__PURE__ */ Q({
|
|
|
3209
3199
|
}, null, 4),
|
|
3210
3200
|
_("span", {
|
|
3211
3201
|
style: z({ color: f.color, fontWeight: 500 })
|
|
3212
|
-
},
|
|
3202
|
+
}, I(f.data.value.toFixed(2)), 5)
|
|
3213
3203
|
]))
|
|
3214
3204
|
], 64))), 128))
|
|
3215
3205
|
], 4),
|
|
@@ -3245,11 +3235,11 @@ const Di = /* @__PURE__ */ Q({
|
|
|
3245
3235
|
borderBottom: "1px solid " + l.value.tooltip.borderColor,
|
|
3246
3236
|
letterSpacing: "0.02em"
|
|
3247
3237
|
})
|
|
3248
|
-
},
|
|
3238
|
+
}, I(W(oo)(C.value)) + " " + I(W(Ut)(C.value, c.value)), 5),
|
|
3249
3239
|
(R(!0), T(O, null, ct(v.value, (f) => (R(), T(O, {
|
|
3250
3240
|
key: f.id
|
|
3251
3241
|
}, [
|
|
3252
|
-
g(f.data) ? (R(), T("div",
|
|
3242
|
+
g(f.data) ? (R(), T("div", bi, [
|
|
3253
3243
|
(R(!0), T(O, null, ct([
|
|
3254
3244
|
{ label: "Open", val: f.data.open },
|
|
3255
3245
|
{ label: "High", val: f.data.high },
|
|
@@ -3258,22 +3248,22 @@ const Di = /* @__PURE__ */ Q({
|
|
|
3258
3248
|
], (y) => (R(), T(O, {
|
|
3259
3249
|
key: y.label
|
|
3260
3250
|
}, [
|
|
3261
|
-
_("span",
|
|
3251
|
+
_("span", vi, I(y.label), 1),
|
|
3262
3252
|
_("span", {
|
|
3263
3253
|
style: z({
|
|
3264
3254
|
fontWeight: 600,
|
|
3265
3255
|
color: f.data.close >= f.data.open ? l.value.candlestick.upColor : l.value.candlestick.downColor,
|
|
3266
3256
|
textAlign: "right"
|
|
3267
3257
|
})
|
|
3268
|
-
},
|
|
3258
|
+
}, I(y.val.toFixed(2)), 5)
|
|
3269
3259
|
], 64))), 128)),
|
|
3270
3260
|
f.data.volume != null ? (R(), T(O, { key: 0 }, [
|
|
3271
3261
|
m[0] || (m[0] = _("span", { style: { opacity: 0.5 } }, "Volume", -1)),
|
|
3272
3262
|
_("span", {
|
|
3273
3263
|
style: z({ fontWeight: 600, color: l.value.tooltip.textColor, textAlign: "right" })
|
|
3274
|
-
},
|
|
3275
|
-
], 64)) :
|
|
3276
|
-
])) : (R(), T("div",
|
|
3264
|
+
}, I(u(f.data.volume)), 5)
|
|
3265
|
+
], 64)) : K("", !0)
|
|
3266
|
+
])) : (R(), T("div", yi, [
|
|
3277
3267
|
_("span", {
|
|
3278
3268
|
style: z({
|
|
3279
3269
|
width: "8px",
|
|
@@ -3283,19 +3273,19 @@ const Di = /* @__PURE__ */ Q({
|
|
|
3283
3273
|
flexShrink: 0
|
|
3284
3274
|
})
|
|
3285
3275
|
}, null, 4),
|
|
3286
|
-
_("span",
|
|
3276
|
+
_("span", xi, I(f.label ?? "Value"), 1),
|
|
3287
3277
|
_("span", {
|
|
3288
3278
|
style: z({ fontWeight: 600, color: f.color })
|
|
3289
|
-
},
|
|
3279
|
+
}, I(f.data.value.toFixed(2)), 5)
|
|
3290
3280
|
]))
|
|
3291
3281
|
], 64))), 128))
|
|
3292
|
-
], 4)) :
|
|
3293
|
-
], 64)) :
|
|
3282
|
+
], 4)) : K("", !0)
|
|
3283
|
+
], 64)) : K("", !0);
|
|
3294
3284
|
}
|
|
3295
|
-
}),
|
|
3285
|
+
}), Ii = /* @__PURE__ */ Z({
|
|
3296
3286
|
__name: "YAxis",
|
|
3297
3287
|
setup(r) {
|
|
3298
|
-
const t = rt(), e =
|
|
3288
|
+
const t = rt(), e = Be(t), o = /* @__PURE__ */ new Map(), i = P(() => t.getTheme()), a = P(() => {
|
|
3299
3289
|
e.value;
|
|
3300
3290
|
const s = t.yScale.niceTickValues(), n = new Set(s), l = performance.now();
|
|
3301
3291
|
for (const c of s)
|
|
@@ -3332,25 +3322,22 @@ const Di = /* @__PURE__ */ Q({
|
|
|
3332
3322
|
transition: "opacity 0.3s ease",
|
|
3333
3323
|
willChange: "opacity"
|
|
3334
3324
|
})
|
|
3335
|
-
},
|
|
3325
|
+
}, I(W(t).yScale.formatY(l)), 5))), 128))
|
|
3336
3326
|
], 4));
|
|
3337
3327
|
}
|
|
3338
|
-
}),
|
|
3328
|
+
}), Wi = /* @__PURE__ */ Z({
|
|
3339
3329
|
__name: "YLabel",
|
|
3340
3330
|
props: {
|
|
3341
3331
|
seriesId: {},
|
|
3342
3332
|
color: {}
|
|
3343
3333
|
},
|
|
3344
3334
|
setup(r) {
|
|
3345
|
-
const t = r, e = rt(), o =
|
|
3346
|
-
|
|
3347
|
-
const a = P(() => e.getTheme()), s = P(() => {
|
|
3348
|
-
const d = o.value;
|
|
3349
|
-
return d === null ? 0 : e.yScale.valueToY(d.value);
|
|
3350
|
-
}), n = P(() => {
|
|
3335
|
+
const t = r, e = rt(), o = oi(e, t.seriesId), i = ii(e, t.seriesId);
|
|
3336
|
+
q(() => e.setYLabel(!0)), et(() => e.setYLabel(!1));
|
|
3337
|
+
const a = P(() => e.getTheme()), s = P(() => o.value === null ? 0 : e.yScale.valueToY(o.value.value)), n = P(() => {
|
|
3351
3338
|
if (t.color) return t.color;
|
|
3352
|
-
const d = a.value
|
|
3353
|
-
return i.value === null ||
|
|
3339
|
+
const d = a.value;
|
|
3340
|
+
return i.value === null || o.value === null ? d.yLabel.neutralBackground : o.value.value > i.value ? d.yLabel.upBackground : o.value.value < i.value ? d.yLabel.downBackground : d.yLabel.neutralBackground;
|
|
3354
3341
|
}), l = P(() => {
|
|
3355
3342
|
const d = e.yScale.getRange(), u = d.max - d.min;
|
|
3356
3343
|
return u < 0.1 ? 6 : u < 10 ? 4 : u < 1e3 ? 2 : 0;
|
|
@@ -3391,66 +3378,66 @@ const Di = /* @__PURE__ */ Q({
|
|
|
3391
3378
|
transition: "background-color 0.3s ease"
|
|
3392
3379
|
})
|
|
3393
3380
|
}, [
|
|
3394
|
-
|
|
3381
|
+
$e(ni, {
|
|
3395
3382
|
value: W(o).value,
|
|
3396
3383
|
format: c.value,
|
|
3397
3384
|
"spin-duration": 350
|
|
3398
3385
|
}, null, 8, ["value", "format"])
|
|
3399
3386
|
], 4)
|
|
3400
|
-
], 64)) :
|
|
3387
|
+
], 64)) : K("", !0);
|
|
3401
3388
|
}
|
|
3402
3389
|
});
|
|
3403
3390
|
export {
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3391
|
+
Si as BarSeries,
|
|
3392
|
+
Mi as CandlestickSeries,
|
|
3393
|
+
Ri as ChartContainer,
|
|
3394
|
+
xo as ChartInstance,
|
|
3395
|
+
Bi as Crosshair,
|
|
3396
|
+
_i as LineSeries,
|
|
3397
|
+
ni as NumberFlow,
|
|
3398
|
+
zi as PieLegend,
|
|
3399
|
+
Di as PieSeries,
|
|
3400
|
+
Pi as PieTooltip,
|
|
3401
|
+
Fi as TimeAxis,
|
|
3415
3402
|
Li as Tooltip,
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3403
|
+
Ii as YAxis,
|
|
3404
|
+
Wi as YLabel,
|
|
3405
|
+
_o as andromeda,
|
|
3406
|
+
Do as ayuMirage,
|
|
3407
|
+
ki as buildTheme,
|
|
3408
|
+
Bo as catppuccin,
|
|
3422
3409
|
Y as createTheme,
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3410
|
+
ke as darkTheme,
|
|
3411
|
+
eo as detectInterval,
|
|
3412
|
+
zo as dracula,
|
|
3413
|
+
oo as formatDate,
|
|
3427
3414
|
Ut as formatTime,
|
|
3428
|
-
|
|
3429
|
-
|
|
3415
|
+
Po as githubLight,
|
|
3416
|
+
Fo as gruvbox,
|
|
3430
3417
|
Lo as handwritten,
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3418
|
+
Ao as highContrast,
|
|
3419
|
+
Vo as lavenderMist,
|
|
3420
|
+
Yo as lightPink,
|
|
3421
|
+
wi as lightTheme,
|
|
3422
|
+
Uo as materialPalenight,
|
|
3423
|
+
$o as minimalLight,
|
|
3424
|
+
Xo as mintBreeze,
|
|
3425
|
+
Ho as monokaiPro,
|
|
3426
|
+
Go as nightOwl,
|
|
3427
|
+
Yt as normalizeTime,
|
|
3428
|
+
No as oneDarkPro,
|
|
3429
|
+
Jo as panda,
|
|
3430
|
+
jo as peachCream,
|
|
3431
|
+
Ko as quietLight,
|
|
3432
|
+
qo as rosePineDawn,
|
|
3433
|
+
Qo as sandDune,
|
|
3434
|
+
Zo as solarizedLight,
|
|
3435
|
+
ye as themes,
|
|
3449
3436
|
rt as useChartInstance,
|
|
3450
3437
|
ie as useCrosshairPosition,
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3438
|
+
oi as useLastYValue,
|
|
3439
|
+
ii as usePreviousClose,
|
|
3440
|
+
ti as useTheme,
|
|
3441
|
+
Be as useVisibleRange,
|
|
3442
|
+
Ti as useYRange
|
|
3456
3443
|
};
|