@wick-charts/react 0.1.0 → 0.1.1
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.cjs +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +561 -557
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createContext as
|
|
2
|
-
import { jsx as S, jsxs as F, Fragment as
|
|
3
|
-
var
|
|
1
|
+
import { createContext as xe, useContext as Nt, useRef as it, useLayoutEffect as ot, useEffect as j, useState as Tt, Children as _e, isValidElement as Ue, useMemo as ut, useSyncExternalStore as Dt } from "react";
|
|
2
|
+
import { jsx as S, jsxs as F, Fragment as Bt } from "react/jsx-runtime";
|
|
3
|
+
var Oe = Object.defineProperty, Ce = (r) => {
|
|
4
4
|
throw TypeError(r);
|
|
5
|
-
}, Ee = (r, t, i) => t in r ?
|
|
5
|
+
}, Ee = (r, t, i) => t in r ? Oe(r, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[t] = i, w = (r, t, i) => Ee(r, typeof t != "symbol" ? t + "" : t, i), jt = (r, t, i) => t.has(r) || Ce("Cannot " + i), c = (r, t, i) => (jt(r, t, "read from private field"), i ? i.call(r) : t.get(r)), L = (r, t, i) => t.has(r) ? Ce("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, i), R = (r, t, i, e) => (jt(r, t, "write to private field"), t.set(r, i), i), Pt = (r, t, i) => (jt(r, t, "access private method"), i), le = (r, t, i, e) => ({
|
|
6
6
|
set _(a) {
|
|
7
7
|
R(r, t, a);
|
|
8
8
|
},
|
|
@@ -10,7 +10,7 @@ var Ue = Object.defineProperty, xe = (r) => {
|
|
|
10
10
|
return c(r, t, e);
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
class
|
|
13
|
+
class zt {
|
|
14
14
|
constructor() {
|
|
15
15
|
w(this, "listeners", /* @__PURE__ */ new Map());
|
|
16
16
|
}
|
|
@@ -30,13 +30,13 @@ class Bt {
|
|
|
30
30
|
this.listeners.clear();
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function ce(r, t, i) {
|
|
34
34
|
const e = document.createElement("canvas");
|
|
35
35
|
return e.style.position = "absolute", e.style.inset = "0", e.style.width = "100%", e.style.height = "100%", e.style.display = "block", e.style.zIndex = String(t), r.appendChild(e), e;
|
|
36
36
|
}
|
|
37
|
-
class
|
|
37
|
+
class $e extends zt {
|
|
38
38
|
constructor(t) {
|
|
39
|
-
super(), w(this, "mainCanvas"), w(this, "mainCtx"), w(this, "overlayCanvas"), w(this, "overlayCtx"), w(this, "resizeObserver"), w(this, "_size"), w(this, "supportsDevicePixelContentBox", !1), this.mainCanvas =
|
|
39
|
+
super(), w(this, "mainCanvas"), w(this, "mainCtx"), w(this, "overlayCanvas"), w(this, "overlayCtx"), w(this, "resizeObserver"), w(this, "_size"), w(this, "supportsDevicePixelContentBox", !1), this.mainCanvas = ce(t, 0), this.overlayCanvas = ce(t, 1), this.mainCtx = this.mainCanvas.getContext("2d", { alpha: !0 }), this.overlayCtx = this.overlayCanvas.getContext("2d", { alpha: !0 });
|
|
40
40
|
const i = window.devicePixelRatio || 1;
|
|
41
41
|
this._size = {
|
|
42
42
|
media: { width: 0, height: 0 },
|
|
@@ -123,13 +123,13 @@ class Oe extends Bt {
|
|
|
123
123
|
this.resizeObserver.disconnect(), this.mainCanvas.remove(), this.overlayCanvas.remove(), this.removeAllListeners();
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function Xe(r, t, i, e) {
|
|
127
127
|
const { context: a, bitmapSize: o, horizontalPixelRatio: s } = r;
|
|
128
128
|
a.strokeStyle = e.crosshair.color, a.lineWidth = 1, a.setLineDash([4 * s, 4 * s]);
|
|
129
129
|
const n = Math.round(t) + 0.5, l = Math.round(i) + 0.5;
|
|
130
130
|
a.beginPath(), a.moveTo(n, 0), a.lineTo(n, o.height), a.moveTo(0, l), a.lineTo(o.width, l), a.stroke(), a.setLineDash([]);
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function He(r, t, i, e, a) {
|
|
133
133
|
const { context: o, bitmapSize: s, horizontalPixelRatio: n, verticalPixelRatio: l } = r;
|
|
134
134
|
o.strokeStyle = e.grid.color, o.lineWidth = 1, e.grid.style === "dashed" ? o.setLineDash([4 * n, 4 * n]) : e.grid.style === "dotted" && o.setLineDash([1 * n, 3 * n]);
|
|
135
135
|
const h = i.niceTickValues();
|
|
@@ -147,7 +147,7 @@ function Xe(r, t, i, e, a) {
|
|
|
147
147
|
}
|
|
148
148
|
o.stroke(), o.setLineDash([]);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function he(r, t, i) {
|
|
151
151
|
return r + (t - r) * i;
|
|
152
152
|
}
|
|
153
153
|
function Et(r, t, i) {
|
|
@@ -160,7 +160,7 @@ function Et(r, t, i) {
|
|
|
160
160
|
}
|
|
161
161
|
return e;
|
|
162
162
|
}
|
|
163
|
-
class
|
|
163
|
+
class Jt extends zt {
|
|
164
164
|
constructor() {
|
|
165
165
|
super(...arguments), w(this, "data", []), w(this, "_visible", !0), w(this, "cachedRange", null), w(this, "cachedResult", []);
|
|
166
166
|
}
|
|
@@ -221,7 +221,7 @@ class jt extends Bt {
|
|
|
221
221
|
return a;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
class
|
|
224
|
+
class Ge {
|
|
225
225
|
constructor(t, i, e) {
|
|
226
226
|
w(this, "dragging", !1), w(this, "lastX", 0), this.viewport = t, this.timeScale = i, this.canvas = e;
|
|
227
227
|
}
|
|
@@ -242,20 +242,20 @@ class He {
|
|
|
242
242
|
return this.dragging;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
class
|
|
245
|
+
class Ne {
|
|
246
246
|
constructor(t, i) {
|
|
247
247
|
this.viewport = t, this.timeScale = i;
|
|
248
248
|
}
|
|
249
249
|
handleWheel(t) {
|
|
250
250
|
t.preventDefault();
|
|
251
|
-
const i =
|
|
251
|
+
const i = je(t.deltaY, t.deltaMode), e = Math.exp(i * 5e-3), a = this.timeScale.getMediaWidth(), o = Math.min(t.offsetX, a), s = this.timeScale.xToTime(o);
|
|
252
252
|
this.viewport.zoomAt(s, e);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function je(r, t) {
|
|
256
256
|
return t === WheelEvent.DOM_DELTA_LINE ? r * 8 : t === WheelEvent.DOM_DELTA_PAGE ? r * 24 : r;
|
|
257
257
|
}
|
|
258
|
-
class
|
|
258
|
+
class Je extends zt {
|
|
259
259
|
constructor(t, i, e, a) {
|
|
260
260
|
super(), w(this, "zoom"), w(this, "pan"), w(this, "canvas"), w(this, "timeScale"), w(this, "yScale"), w(this, "viewport"), w(this, "onWheel", (o) => {
|
|
261
261
|
this.zoom.handleWheel(o);
|
|
@@ -290,7 +290,7 @@ class je extends Bt {
|
|
|
290
290
|
}
|
|
291
291
|
}), w(this, "onTouchEnd", (o) => {
|
|
292
292
|
o.touches.length === 0 && (this.pan.handleMouseUp(), this.touchCount = 0, this.lastTouchDist = 0);
|
|
293
|
-
}), this.canvas = t, this.viewport = i, this.timeScale = e, this.yScale = a, this.zoom = new
|
|
293
|
+
}), this.canvas = t, this.viewport = i, this.timeScale = e, this.yScale = a, this.zoom = new Ne(i, e), this.pan = new Ge(i, e, 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);
|
|
294
294
|
}
|
|
295
295
|
emitCrosshair(t, i) {
|
|
296
296
|
const e = this.timeScale.xToTime(t), a = this.yScale.yToValue(i);
|
|
@@ -305,7 +305,7 @@ class je extends Bt {
|
|
|
305
305
|
this.canvas.removeEventListener("wheel", this.onWheel), this.canvas.removeEventListener("mousedown", this.onMouseDown), this.canvas.removeEventListener("mousemove", this.onMouseMove), this.canvas.removeEventListener("mouseup", this.onMouseUp), this.canvas.removeEventListener("mouseleave", this.onMouseLeave), this.canvas.removeEventListener("dblclick", this.onDblClick), this.canvas.removeEventListener("touchstart", this.onTouchStart), this.canvas.removeEventListener("touchmove", this.onTouchMove), this.canvas.removeEventListener("touchend", this.onTouchEnd), this.removeAllListeners();
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
class
|
|
308
|
+
class de {
|
|
309
309
|
constructor(t) {
|
|
310
310
|
w(this, "dirty", !1), w(this, "rafId", null), w(this, "callback"), w(this, "render", (i) => {
|
|
311
311
|
this.dirty = !1, this.rafId = null, this.callback(i);
|
|
@@ -318,18 +318,18 @@ class he {
|
|
|
318
318
|
this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.dirty = !1;
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
-
const
|
|
322
|
-
function
|
|
321
|
+
const ft = 6e4, ht = 36e5, nt = 864e5;
|
|
322
|
+
function ue(r) {
|
|
323
323
|
return r instanceof Date ? r.getTime() : r;
|
|
324
324
|
}
|
|
325
|
-
function Je(r) {
|
|
326
|
-
return r.length === 0 || typeof r[0].time == "number" ? r : r.map((t) => ({ ...t, time: t.time.getTime() }));
|
|
327
|
-
}
|
|
328
325
|
function Ke(r) {
|
|
329
326
|
return r.length === 0 || typeof r[0].time == "number" ? r : r.map((t) => ({ ...t, time: t.time.getTime() }));
|
|
330
327
|
}
|
|
331
328
|
function qe(r) {
|
|
332
|
-
|
|
329
|
+
return r.length === 0 || typeof r[0].time == "number" ? r : r.map((t) => ({ ...t, time: t.time.getTime() }));
|
|
330
|
+
}
|
|
331
|
+
function Qe(r) {
|
|
332
|
+
if (r.length < 2) return nt;
|
|
333
333
|
const t = [];
|
|
334
334
|
for (let i = 1; i < Math.min(r.length, 20); i++)
|
|
335
335
|
t.push(r[i] - r[i - 1]);
|
|
@@ -337,21 +337,21 @@ function qe(r) {
|
|
|
337
337
|
}
|
|
338
338
|
function At(r, t) {
|
|
339
339
|
const i = new Date(r);
|
|
340
|
-
return t >=
|
|
340
|
+
return t >= nt ? i.toLocaleDateString("en-US", { month: "short", day: "numeric" }) : t >= ht ? i.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit", hour12: !1 }) : i.toLocaleTimeString("en-US", {
|
|
341
341
|
hour: "2-digit",
|
|
342
342
|
minute: "2-digit",
|
|
343
343
|
second: "2-digit",
|
|
344
344
|
hour12: !1
|
|
345
345
|
});
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function Ze(r) {
|
|
348
348
|
return new Date(r).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
349
349
|
}
|
|
350
|
-
function
|
|
351
|
-
const t = [1e3, 5e3, 1e4, 15e3, 3e4], i = [
|
|
352
|
-
return r <
|
|
350
|
+
function ti(r) {
|
|
351
|
+
const t = [1e3, 5e3, 1e4, 15e3, 3e4], i = [ft, 5 * ft, 10 * ft, 15 * ft, 30 * ft], e = [ht, 2 * ht, 4 * ht, 6 * ht, 12 * ht], a = [nt, 7 * nt, 30 * nt, 90 * nt, 365 * nt];
|
|
352
|
+
return r < ft ? [...t, ...i, ...e, ...a] : r < ht ? [...i, ...e, ...a] : r < nt ? [...e, ...a] : a;
|
|
353
353
|
}
|
|
354
|
-
class
|
|
354
|
+
class ei {
|
|
355
355
|
constructor() {
|
|
356
356
|
w(this, "from", 0), w(this, "to", 0), w(this, "width", 1), w(this, "pixelRatio", 1);
|
|
357
357
|
}
|
|
@@ -378,7 +378,7 @@ class ti {
|
|
|
378
378
|
}
|
|
379
379
|
niceTickValues(t) {
|
|
380
380
|
if (this.to <= this.from) return { ticks: [], tickInterval: 0 };
|
|
381
|
-
const i =
|
|
381
|
+
const i = ti(t), e = (this.to - this.from) / this.width * 80;
|
|
382
382
|
let a = i[i.length - 1];
|
|
383
383
|
for (const n of i)
|
|
384
384
|
if (n >= e) {
|
|
@@ -397,7 +397,7 @@ class ti {
|
|
|
397
397
|
return this.width;
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
const
|
|
400
|
+
const $t = [
|
|
401
401
|
1e-4,
|
|
402
402
|
2e-4,
|
|
403
403
|
5e-4,
|
|
@@ -426,7 +426,7 @@ const Ot = [
|
|
|
426
426
|
2e4,
|
|
427
427
|
5e4
|
|
428
428
|
];
|
|
429
|
-
class
|
|
429
|
+
class ii {
|
|
430
430
|
constructor() {
|
|
431
431
|
w(this, "min", 0), w(this, "max", 0), w(this, "height", 1), w(this, "pixelRatio", 1);
|
|
432
432
|
}
|
|
@@ -450,8 +450,8 @@ class ei {
|
|
|
450
450
|
niceTickValues() {
|
|
451
451
|
if (this.max <= this.min) return [];
|
|
452
452
|
const t = (this.max - this.min) / this.height * 50;
|
|
453
|
-
let i =
|
|
454
|
-
for (const o of
|
|
453
|
+
let i = $t[$t.length - 1];
|
|
454
|
+
for (const o of $t)
|
|
455
455
|
if (o >= t) {
|
|
456
456
|
i = o;
|
|
457
457
|
break;
|
|
@@ -473,14 +473,14 @@ class ei {
|
|
|
473
473
|
return i < 0.01 ? t.toFixed(6) : i < 0.1 ? t.toFixed(4) : i < 10 ? t.toFixed(2) : i < 1e3 ? t.toFixed(1) : t.toFixed(0);
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
const
|
|
476
|
+
const oi = {
|
|
477
477
|
colors: ["#26a69a", "#ef5350"],
|
|
478
478
|
barWidthRatio: 0.6,
|
|
479
479
|
stacking: "off"
|
|
480
480
|
};
|
|
481
|
-
class
|
|
481
|
+
class tt {
|
|
482
482
|
constructor(t, i) {
|
|
483
|
-
w(this, "stores"), w(this, "options"), this.stores = Array.from({ length: t }, () => new
|
|
483
|
+
w(this, "stores"), w(this, "options"), this.stores = Array.from({ length: t }, () => new Jt()), this.options = { ...oi, ...i };
|
|
484
484
|
}
|
|
485
485
|
/** For chart compatibility — returns first store */
|
|
486
486
|
get store() {
|
|
@@ -604,11 +604,11 @@ class Z {
|
|
|
604
604
|
for (const z of v)
|
|
605
605
|
z > 0 ? k += z : D += z;
|
|
606
606
|
if (y > 0 && k > 0) {
|
|
607
|
-
const z = C / k * 100,
|
|
608
|
-
this.fillBar(n, x - g, P, d,
|
|
607
|
+
const z = C / k * 100, Y = (C + y) / k * 100, P = o.valueToBitmapY(Y), $ = o.valueToBitmapY(z), X = Math.max(1, $ - P);
|
|
608
|
+
this.fillBar(n, x - g, P, d, X, b);
|
|
609
609
|
} else if (y < 0 && D < 0) {
|
|
610
|
-
const z = T / D * -100,
|
|
611
|
-
n.fillStyle = b, n.fillRect(x - g, P, d,
|
|
610
|
+
const z = T / D * -100, Y = (T + y) / D * -100, P = o.valueToBitmapY(z), $ = o.valueToBitmapY(Y), X = Math.max(1, $ - P);
|
|
611
|
+
n.fillStyle = b, n.fillRect(x - g, P, d, X);
|
|
612
612
|
}
|
|
613
613
|
} else if (y > 0) {
|
|
614
614
|
const k = o.valueToBitmapY(C + y), D = o.valueToBitmapY(C), z = Math.max(1, D - k);
|
|
@@ -624,15 +624,15 @@ class Z {
|
|
|
624
624
|
t.fillStyle = s, t.fillRect(i, e, a, o);
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
function
|
|
628
|
-
return r.length <= t ? r :
|
|
627
|
+
function fe(r, t) {
|
|
628
|
+
return r.length <= t ? r : ai(
|
|
629
629
|
r,
|
|
630
630
|
t,
|
|
631
631
|
(i) => i.time,
|
|
632
632
|
(i) => i.value
|
|
633
633
|
);
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function ri(r, t) {
|
|
636
636
|
if (r.length <= t) return r;
|
|
637
637
|
const i = Math.ceil(r.length / t), e = [];
|
|
638
638
|
for (let a = 0; a < r.length; a += i) {
|
|
@@ -651,7 +651,7 @@ function oi(r, t) {
|
|
|
651
651
|
}
|
|
652
652
|
return e;
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function ai(r, t, i, e) {
|
|
655
655
|
if (t >= r.length || t < 3) return r;
|
|
656
656
|
const a = [r[0]], o = (r.length - 2) / (t - 2);
|
|
657
657
|
let s = 0;
|
|
@@ -674,54 +674,54 @@ function ri(r, t, i, e) {
|
|
|
674
674
|
}
|
|
675
675
|
return a.push(r[r.length - 1]), a;
|
|
676
676
|
}
|
|
677
|
-
const
|
|
678
|
-
function
|
|
677
|
+
const ge = /* @__PURE__ */ new Map(), pe = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map();
|
|
678
|
+
function Kt(r) {
|
|
679
679
|
return [parseInt(r.slice(1, 3), 16), parseInt(r.slice(3, 5), 16), parseInt(r.slice(5, 7), 16)];
|
|
680
680
|
}
|
|
681
|
-
function
|
|
681
|
+
function we(r, t, i) {
|
|
682
682
|
return `#${r.toString(16).padStart(2, "0")}${t.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}`;
|
|
683
683
|
}
|
|
684
|
-
function
|
|
684
|
+
function vt(r, t) {
|
|
685
685
|
if (r.startsWith("rgba")) return r.replace(/[\d.]+\)\s*$/, `${t})`);
|
|
686
686
|
if (r.startsWith("rgb(")) return r.replace(/^rgb\((.*)\)$/i, `rgba($1, ${t})`);
|
|
687
687
|
const i = r + t;
|
|
688
|
-
let e =
|
|
688
|
+
let e = ge.get(i);
|
|
689
689
|
if (e) return e;
|
|
690
|
-
const [a, o, s] =
|
|
691
|
-
return e = `rgba(${a}, ${o}, ${s}, ${t})`,
|
|
690
|
+
const [a, o, s] = Kt(r);
|
|
691
|
+
return e = `rgba(${a}, ${o}, ${s}, ${t})`, ge.set(i, e), e;
|
|
692
692
|
}
|
|
693
|
-
function
|
|
693
|
+
function si(r, t) {
|
|
694
694
|
const i = r + t;
|
|
695
|
-
let e =
|
|
695
|
+
let e = pe.get(i);
|
|
696
696
|
if (e) return e;
|
|
697
|
-
const [a, o, s] =
|
|
698
|
-
return e =
|
|
697
|
+
const [a, o, s] = Kt(r);
|
|
698
|
+
return e = we(
|
|
699
699
|
Math.min(255, Math.round(a + (255 - a) * t)),
|
|
700
700
|
Math.min(255, Math.round(o + (255 - o) * t)),
|
|
701
701
|
Math.min(255, Math.round(s + (255 - s) * t))
|
|
702
|
-
),
|
|
702
|
+
), pe.set(i, e), e;
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function ni(r, t) {
|
|
705
705
|
const i = r + t;
|
|
706
|
-
let e =
|
|
706
|
+
let e = me.get(i);
|
|
707
707
|
if (e) return e;
|
|
708
|
-
const [a, o, s] =
|
|
709
|
-
return e =
|
|
708
|
+
const [a, o, s] = Kt(r);
|
|
709
|
+
return e = we(
|
|
710
710
|
Math.max(0, Math.round(a * (1 - t))),
|
|
711
711
|
Math.max(0, Math.round(o * (1 - t))),
|
|
712
712
|
Math.max(0, Math.round(s * (1 - t)))
|
|
713
|
-
),
|
|
713
|
+
), me.set(i, e), e;
|
|
714
714
|
}
|
|
715
|
-
const
|
|
715
|
+
const li = {
|
|
716
716
|
upColor: "#26a69a",
|
|
717
717
|
downColor: "#ef5350",
|
|
718
718
|
wickUpColor: "#26a69a",
|
|
719
719
|
wickDownColor: "#ef5350",
|
|
720
720
|
bodyWidthRatio: 0.6
|
|
721
721
|
};
|
|
722
|
-
class
|
|
722
|
+
class Xt {
|
|
723
723
|
constructor(t, i) {
|
|
724
|
-
w(this, "store"), w(this, "options"), this.store = t, this.options = { ...
|
|
724
|
+
w(this, "store"), w(this, "options"), this.store = t, this.options = { ...li, ...i };
|
|
725
725
|
}
|
|
726
726
|
updateOptions(t) {
|
|
727
727
|
this.options = { ...this.options, ...t };
|
|
@@ -733,7 +733,7 @@ class $t {
|
|
|
733
733
|
const { scope: i, timeScale: e, yScale: a, dataInterval: o } = t, { context: s, horizontalPixelRatio: n } = i, l = e.getRange();
|
|
734
734
|
let h = this.store.getVisibleData(l.from, l.to);
|
|
735
735
|
const d = i.mediaSize.width;
|
|
736
|
-
if (h.length > d * 2 && (h =
|
|
736
|
+
if (h.length > d * 2 && (h = ri(h, Math.round(d * 1.5))), h.length === 0) return;
|
|
737
737
|
const g = e.barWidthBitmap(o), f = Math.max(1, Math.round(g * this.options.bodyWidthRatio) - 2), p = Math.floor(f / 2), m = Math.max(1, Math.round(n)), b = Math.round(a.getMediaHeight() * i.verticalPixelRatio);
|
|
738
738
|
this.drawVolume(s, h, e, b, g, o);
|
|
739
739
|
const u = [], v = [];
|
|
@@ -766,7 +766,7 @@ class $t {
|
|
|
766
766
|
for (const p of i)
|
|
767
767
|
p.volume !== void 0 && p.volume > n && (n = p.volume);
|
|
768
768
|
if (n === 0) return;
|
|
769
|
-
const l = a * 0.2, h = Math.max(1, o - 2), d = Math.floor(h / 2), g =
|
|
769
|
+
const l = a * 0.2, h = Math.max(1, o - 2), d = Math.floor(h / 2), g = vt(this.options.upColor, 0.2), f = vt(this.options.downColor, 0.2);
|
|
770
770
|
for (const p of i) {
|
|
771
771
|
if (p.volume === void 0 || p.volume === 0) continue;
|
|
772
772
|
const m = e.timeToBitmapX(p.time), b = Math.max(1, p.volume / n * l), u = p.close >= p.open;
|
|
@@ -780,7 +780,7 @@ class $t {
|
|
|
780
780
|
const m = e.timeToBitmapX(p.time), b = a.valueToBitmapY(p.high), u = a.valueToBitmapY(p.low), v = m - Math.floor(n / 2);
|
|
781
781
|
t.fillRect(v, b, n, u - b);
|
|
782
782
|
}
|
|
783
|
-
const d = this.options.candleGradient !== !1, g = d ?
|
|
783
|
+
const d = this.options.candleGradient !== !1, g = d ? si(l, 0.2) : l, f = d ? ni(l, 0.15) : l;
|
|
784
784
|
d || (t.fillStyle = l);
|
|
785
785
|
for (const p of i) {
|
|
786
786
|
const m = e.timeToBitmapX(p.time), b = a.valueToBitmapY(p.open), u = a.valueToBitmapY(p.close), v = Math.min(b, u), y = Math.max(1, Math.abs(u - b));
|
|
@@ -792,16 +792,16 @@ class $t {
|
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
794
|
}
|
|
795
|
-
const
|
|
795
|
+
const ci = {
|
|
796
796
|
colors: ["#2962FF"],
|
|
797
797
|
lineWidth: 1,
|
|
798
798
|
areaFill: !0,
|
|
799
799
|
pulse: !0,
|
|
800
800
|
stacking: "off"
|
|
801
801
|
};
|
|
802
|
-
class
|
|
802
|
+
class H {
|
|
803
803
|
constructor(t, i) {
|
|
804
|
-
w(this, "stores"), w(this, "options"), w(this, "areaGradientCache", /* @__PURE__ */ new Map()), this.stores = Array.from({ length: t }, () => new
|
|
804
|
+
w(this, "stores"), w(this, "options"), w(this, "areaGradientCache", /* @__PURE__ */ new Map()), this.stores = Array.from({ length: t }, () => new Jt()), this.options = { ...ci, ...i };
|
|
805
805
|
}
|
|
806
806
|
get store() {
|
|
807
807
|
return this.stores[0];
|
|
@@ -860,7 +860,7 @@ class G {
|
|
|
860
860
|
if (!this.stores[d].isVisible()) continue;
|
|
861
861
|
let g = this.stores[d].getVisibleData(s.from, s.to);
|
|
862
862
|
const f = i.mediaSize.width;
|
|
863
|
-
if (g.length > f * 2 && (g =
|
|
863
|
+
if (g.length > f * 2 && (g = fe(g, Math.round(f * 1.5))), g.length < 2) continue;
|
|
864
864
|
const p = this.options.colors[d % this.options.colors.length];
|
|
865
865
|
o.beginPath(), o.moveTo(e.timeToBitmapX(g[0].time), a.valueToBitmapY(g[0].value));
|
|
866
866
|
for (let m = 1; m < g.length; m++)
|
|
@@ -870,7 +870,7 @@ class G {
|
|
|
870
870
|
o.lineTo(b, u), o.lineTo(m, u), o.closePath();
|
|
871
871
|
const v = String(d), y = this.areaGradientCache.get(v);
|
|
872
872
|
let x;
|
|
873
|
-
y && y.bottomY === u && y.color === p ? x = y.gradient : (x = o.createLinearGradient(0, 0, 0, u), x.addColorStop(0,
|
|
873
|
+
y && y.bottomY === u && y.color === p ? x = y.gradient : (x = o.createLinearGradient(0, 0, 0, u), x.addColorStop(0, vt(p, 0.12)), x.addColorStop(1, vt(p, 0.01)), this.areaGradientCache.set(v, { gradient: x, bottomY: u, color: p })), o.fillStyle = x, o.fill();
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
876
|
}
|
|
@@ -878,7 +878,7 @@ class G {
|
|
|
878
878
|
renderStacked(t, i) {
|
|
879
879
|
const { scope: e, timeScale: a, yScale: o } = t, { context: s } = e, n = a.getRange(), { verticalPixelRatio: l } = e, h = Math.max(1, Math.round(this.options.lineWidth * l)), d = e.mediaSize.width, g = this.stores.map((u) => {
|
|
880
880
|
let v = u.getVisibleData(n.from, n.to);
|
|
881
|
-
return v.length > d * 2 && (v =
|
|
881
|
+
return v.length > d * 2 && (v = fe(v, Math.round(d * 1.5))), v;
|
|
882
882
|
}), f = /* @__PURE__ */ new Set();
|
|
883
883
|
for (const u of g)
|
|
884
884
|
for (const v of u) f.add(v.time);
|
|
@@ -917,7 +917,7 @@ class G {
|
|
|
917
917
|
s.lineTo(y[C][0], y[C][1]);
|
|
918
918
|
for (let C = x.length - 1; C >= 0; C--)
|
|
919
919
|
s.lineTo(x[C][0], x[C][1]);
|
|
920
|
-
s.closePath(), s.fillStyle =
|
|
920
|
+
s.closePath(), s.fillStyle = vt(v, 0.25), s.fill();
|
|
921
921
|
}
|
|
922
922
|
s.beginPath(), s.moveTo(y[0][0], y[0][1]);
|
|
923
923
|
for (let C = 1; C < y.length; C++)
|
|
@@ -943,31 +943,31 @@ class G {
|
|
|
943
943
|
}
|
|
944
944
|
drawPulse(t, i, e, a, o) {
|
|
945
945
|
const s = 3 * o, n = 0.4 + 0.6 * Math.abs(Math.sin(performance.now() / 600)), l = s + 4 * o * n;
|
|
946
|
-
t.beginPath(), t.arc(i, e, l, 0, Math.PI * 2), t.fillStyle =
|
|
946
|
+
t.beginPath(), t.arc(i, e, l, 0, Math.PI * 2), t.fillStyle = vt(a, n * 0.3), t.fill(), t.beginPath(), t.arc(i, e, s, 0, Math.PI * 2), t.fillStyle = a, t.fill();
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
|
-
const
|
|
949
|
+
const hi = {
|
|
950
950
|
innerRadiusRatio: 0,
|
|
951
951
|
padAngle: 0.02,
|
|
952
952
|
strokeColor: "transparent",
|
|
953
953
|
strokeWidth: 0
|
|
954
|
-
},
|
|
955
|
-
function
|
|
954
|
+
}, Lt = Math.PI * 2;
|
|
955
|
+
function di(r) {
|
|
956
956
|
if (!r.startsWith("#")) return !1;
|
|
957
957
|
const t = parseInt(r.slice(1, 3), 16), i = parseInt(r.slice(3, 5), 16), e = parseInt(r.slice(5, 7), 16);
|
|
958
958
|
return t * 0.299 + i * 0.587 + e * 0.114 > 150;
|
|
959
959
|
}
|
|
960
|
-
function
|
|
960
|
+
function ui(r, t) {
|
|
961
961
|
if (!r.startsWith("#")) return r;
|
|
962
962
|
const i = Math.min(255, parseInt(r.slice(1, 3), 16) + Math.round(255 * t)), e = Math.min(255, parseInt(r.slice(3, 5), 16) + Math.round(255 * t)), a = Math.min(255, parseInt(r.slice(5, 7), 16) + Math.round(255 * t));
|
|
963
963
|
return `#${i.toString(16).padStart(2, "0")}${e.toString(16).padStart(2, "0")}${a.toString(16).padStart(2, "0")}`;
|
|
964
964
|
}
|
|
965
|
-
function
|
|
965
|
+
function fi(r, t, i) {
|
|
966
966
|
return r + (t - r) * Math.min(1, i);
|
|
967
967
|
}
|
|
968
|
-
class
|
|
968
|
+
class ct {
|
|
969
969
|
constructor(t) {
|
|
970
|
-
w(this, "data", []), w(this, "options"), w(this, "hoverIndex", -1), w(this, "sliceOffsets", []), w(this, "lastRenderTime", 0), this.options = { ...
|
|
970
|
+
w(this, "data", []), w(this, "options"), w(this, "hoverIndex", -1), w(this, "sliceOffsets", []), w(this, "lastRenderTime", 0), this.options = { ...hi, ...t };
|
|
971
971
|
}
|
|
972
972
|
getData() {
|
|
973
973
|
return this.data;
|
|
@@ -990,10 +990,10 @@ class lt {
|
|
|
990
990
|
const s = e / 2, n = a / 2, l = Math.min(e, a) / 2 * 0.85, h = l * this.options.innerRadiusRatio, d = t - s, g = i - n, f = Math.sqrt(d * d + g * g);
|
|
991
991
|
if (f > l || f < h) return -1;
|
|
992
992
|
let p = Math.atan2(g, d) + Math.PI / 2;
|
|
993
|
-
p < 0 && (p +=
|
|
993
|
+
p < 0 && (p += Lt);
|
|
994
994
|
let m = 0;
|
|
995
995
|
for (let b = 0; b < this.data.length; b++) {
|
|
996
|
-
const u = this.data[b].value / o *
|
|
996
|
+
const u = this.data[b].value / o * Lt;
|
|
997
997
|
if (p >= m && p < m + u) return b;
|
|
998
998
|
m += u;
|
|
999
999
|
}
|
|
@@ -1017,30 +1017,30 @@ class lt {
|
|
|
1017
1017
|
for (; this.sliceOffsets.length < this.data.length; ) this.sliceOffsets.push(0);
|
|
1018
1018
|
for (let k = 0; k < this.data.length; k++) {
|
|
1019
1019
|
const D = k === this.hoverIndex ? 1 : 0;
|
|
1020
|
-
this.sliceOffsets[k] =
|
|
1020
|
+
this.sliceOffsets[k] = fi(this.sliceOffsets[k], D, d * l);
|
|
1021
1021
|
}
|
|
1022
1022
|
const g = this.options.colors ?? e.seriesColors, f = o.width / 2, p = o.height / 2, m = Math.min(o.width, o.height) / 2 * 0.85, b = m * this.options.innerRadiusRatio, u = this.options.padAngle, { strokeColor: v, strokeWidth: y } = this.options, x = 8 * s;
|
|
1023
1023
|
let C = -Math.PI / 2;
|
|
1024
1024
|
for (let k = 0; k < this.data.length; k++) {
|
|
1025
|
-
const D = this.data[k], z = D.value / h *
|
|
1026
|
-
a.beginPath(), a.arc(
|
|
1027
|
-
const
|
|
1028
|
-
|
|
1025
|
+
const D = this.data[k], z = D.value / h * Lt, Y = C + u / 2, P = C + z - u / 2, $ = C + z / 2, X = D.color ?? g[k % g.length], Q = this.sliceOffsets[k] * x, _ = Math.cos($) * Q, lt = Math.sin($) * Q, U = f + _, O = p + lt;
|
|
1026
|
+
a.beginPath(), a.arc(U, O, m, Y, P), b > 0 ? a.arc(U, O, b, P, Y, !0) : a.lineTo(U, O), a.closePath();
|
|
1027
|
+
const Z = a.createRadialGradient(U, O, b || 0, U, O, m);
|
|
1028
|
+
Z.addColorStop(0, ui(X, 0.15)), Z.addColorStop(1, X), a.fillStyle = Z, this.sliceOffsets[k] > 0.01 && (a.shadowColor = "rgba(0,0,0,0.25)", a.shadowBlur = 12 * s * this.sliceOffsets[k], a.shadowOffsetX = _ * 0.3, a.shadowOffsetY = lt * 0.3), a.fill(), a.shadowColor = "transparent", a.shadowBlur = 0, a.shadowOffsetX = 0, a.shadowOffsetY = 0, y > 0 && v !== "transparent" && (a.strokeStyle = v, a.lineWidth = y, a.stroke()), C += z;
|
|
1029
1029
|
}
|
|
1030
1030
|
C = -Math.PI / 2;
|
|
1031
1031
|
const T = b > 0 ? (m + b) / 2 : m * 0.65;
|
|
1032
1032
|
a.textAlign = "center", a.textBaseline = "middle", a.font = `${11 * s}px ${e.typography.fontFamily}`;
|
|
1033
1033
|
for (let k = 0; k < this.data.length; k++) {
|
|
1034
|
-
const D = this.data[k], z = D.value / h *
|
|
1034
|
+
const D = this.data[k], z = D.value / h * Lt;
|
|
1035
1035
|
if (z > 0.3) {
|
|
1036
|
-
const
|
|
1037
|
-
a.fillStyle =
|
|
1036
|
+
const Y = C + z / 2, P = this.sliceOffsets[k] * x, $ = f + Math.cos(Y) * (T + P), X = p + Math.sin(Y) * (T + P), Q = D.color ?? g[k % g.length];
|
|
1037
|
+
a.fillStyle = di(Q) ? "#000000" : "#ffffff", a.fillText(D.label, $, X);
|
|
1038
1038
|
}
|
|
1039
1039
|
C += z;
|
|
1040
1040
|
}
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
|
-
const
|
|
1043
|
+
const gi = {
|
|
1044
1044
|
background: "#131722",
|
|
1045
1045
|
chartGradient: ["#1a1f2e", "#101318"],
|
|
1046
1046
|
typography: {
|
|
@@ -1099,19 +1099,19 @@ const fi = {
|
|
|
1099
1099
|
textColor: "#d1d4dc",
|
|
1100
1100
|
borderColor: "rgba(42, 46, 57, 0.8)"
|
|
1101
1101
|
}
|
|
1102
|
-
},
|
|
1102
|
+
}, at = {
|
|
1103
1103
|
top: 20,
|
|
1104
1104
|
bottom: 20,
|
|
1105
1105
|
right: { intervals: 3 },
|
|
1106
1106
|
left: { intervals: 0 }
|
|
1107
1107
|
};
|
|
1108
|
-
class
|
|
1108
|
+
class pi extends zt {
|
|
1109
1109
|
constructor({ padding: t } = {}) {
|
|
1110
1110
|
super(), w(this, "_visibleRange", { from: 0, to: 0 }), w(this, "_yRange", { min: 0, max: 0 }), w(this, "_autoScroll", !0), w(this, "padding"), w(this, "dataInterval", 6e4), w(this, "_dataStart", null), w(this, "_dataEnd", null), w(this, "_animating", !1), w(this, "animStartTime", 0), w(this, "animDuration", 0), w(this, "animFrom", { from: 0, to: 0 }), w(this, "animTo", { from: 0, to: 0 }), this.padding = {
|
|
1111
|
-
top: (t == null ? void 0 : t.top) ??
|
|
1112
|
-
bottom: (t == null ? void 0 : t.bottom) ??
|
|
1113
|
-
right: (t == null ? void 0 : t.right) ??
|
|
1114
|
-
left: (t == null ? void 0 : t.left) ??
|
|
1111
|
+
top: (t == null ? void 0 : t.top) ?? at.top,
|
|
1112
|
+
bottom: (t == null ? void 0 : t.bottom) ?? at.bottom,
|
|
1113
|
+
right: (t == null ? void 0 : t.right) ?? at.right,
|
|
1114
|
+
left: (t == null ? void 0 : t.left) ?? at.left
|
|
1115
1115
|
};
|
|
1116
1116
|
}
|
|
1117
1117
|
/**
|
|
@@ -1140,10 +1140,10 @@ class gi extends Bt {
|
|
|
1140
1140
|
/** Replace padding configuration. Only updates fields that are provided; others keep defaults. */
|
|
1141
1141
|
setPadding(t) {
|
|
1142
1142
|
this.padding = {
|
|
1143
|
-
top: (t == null ? void 0 : t.top) ??
|
|
1144
|
-
bottom: (t == null ? void 0 : t.bottom) ??
|
|
1145
|
-
right: (t == null ? void 0 : t.right) ??
|
|
1146
|
-
left: (t == null ? void 0 : t.left) ??
|
|
1143
|
+
top: (t == null ? void 0 : t.top) ?? at.top,
|
|
1144
|
+
bottom: (t == null ? void 0 : t.bottom) ?? at.bottom,
|
|
1145
|
+
right: (t == null ? void 0 : t.right) ?? at.right,
|
|
1146
|
+
left: (t == null ? void 0 : t.left) ?? at.left
|
|
1147
1147
|
};
|
|
1148
1148
|
}
|
|
1149
1149
|
setDataStart(t) {
|
|
@@ -1174,7 +1174,7 @@ class gi extends Bt {
|
|
|
1174
1174
|
/** Called by the render loop before each frame. Returns true if still animating. */
|
|
1175
1175
|
tick(t) {
|
|
1176
1176
|
if (!this._animating) return !1;
|
|
1177
|
-
const i = t - this.animStartTime, e = Math.min(1, i / this.animDuration), a = 1 - (1 - e) ** 3, o =
|
|
1177
|
+
const i = t - this.animStartTime, e = Math.min(1, i / this.animDuration), a = 1 - (1 - e) ** 3, o = he(this.animFrom.from, this.animTo.from, a), s = he(this.animFrom.to, this.animTo.to, a);
|
|
1178
1178
|
return s > o && this.applyRange(o, s), e >= 1 && (this._animating = !1), this._animating;
|
|
1179
1179
|
}
|
|
1180
1180
|
/** Set the Y-axis range. Adds pixel-based padding unless a side has a fixed (explicit) bound. */
|
|
@@ -1223,42 +1223,42 @@ class gi extends Bt {
|
|
|
1223
1223
|
this.cancelAnimation(), this.removeAllListeners();
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
|
-
let
|
|
1227
|
-
var
|
|
1228
|
-
class
|
|
1226
|
+
let mi = 0;
|
|
1227
|
+
var V, B, A, gt, St, M, W, kt, N, rt, E, et, Ht, pt, st, Mt, dt, mt, Rt, It, K, q, bt;
|
|
1228
|
+
class bi extends zt {
|
|
1229
1229
|
constructor(t, i) {
|
|
1230
1230
|
var e, a, o;
|
|
1231
|
-
super(), L(this,
|
|
1231
|
+
super(), L(this, mt), L(this, V), L(this, B), L(this, A), L(this, gt), w(this, "timeScale"), w(this, "yScale"), L(this, St), L(this, M, []), L(this, W), L(this, kt), L(this, N, 6e4), L(this, rt, null), L(this, E, {}), L(this, et, null), L(this, Ht, !1), L(this, pt, {}), L(this, st, 0), L(this, Mt, !1), L(this, dt, !1), L(this, It, 0), L(this, K, 0), L(this, q, 0), L(this, bt, !1), i != null && i.axis && (R(this, pt, i.axis), R(this, E, { min: (e = i.axis.y) == null ? void 0 : e.min, max: (a = i.axis.y) == null ? void 0 : a.max })), R(this, W, (i == null ? void 0 : i.theme) ?? gi), R(this, kt, (i == null ? void 0 : i.grid) !== !1), R(this, V, new $e(t)), R(this, B, new pi({ padding: i == null ? void 0 : i.padding })), this.timeScale = new ei(), this.yScale = new ii(), R(this, A, new de(() => this.renderMain())), R(this, gt, new de(() => this.renderOverlay()));
|
|
1232
1232
|
const s = (i == null ? void 0 : i.interactive) !== !1;
|
|
1233
|
-
R(this,
|
|
1234
|
-
this.syncScales(), c(this,
|
|
1235
|
-
}), c(this,
|
|
1233
|
+
R(this, St, s ? new Je(c(this, V).canvas, c(this, B), this.timeScale, this.yScale) : null), c(this, B).on("change", () => {
|
|
1234
|
+
this.syncScales(), c(this, A).markDirty(), this.emit("viewportChange");
|
|
1235
|
+
}), c(this, V).on("resize", () => {
|
|
1236
1236
|
this.updateScales(!0), this.renderMain(), this.emit("viewportChange");
|
|
1237
|
-
}), (o = c(this,
|
|
1238
|
-
R(this,
|
|
1237
|
+
}), (o = c(this, St)) == null || o.on("crosshairMove", (n) => {
|
|
1238
|
+
R(this, rt, n), c(this, gt).markDirty(), this.emit("crosshairMove", n), this.updatePieHover(n);
|
|
1239
1239
|
});
|
|
1240
1240
|
}
|
|
1241
1241
|
get yAxisWidth() {
|
|
1242
|
-
const t = c(this,
|
|
1242
|
+
const t = c(this, pt).y;
|
|
1243
1243
|
return (t == null ? void 0 : t.visible) === !1 ? 0 : (t == null ? void 0 : t.width) ?? 55;
|
|
1244
1244
|
}
|
|
1245
1245
|
get xAxisHeight() {
|
|
1246
|
-
const t = c(this,
|
|
1246
|
+
const t = c(this, pt).x;
|
|
1247
1247
|
return (t == null ? void 0 : t.visible) === !1 ? 0 : (t == null ? void 0 : t.height) ?? 30;
|
|
1248
1248
|
}
|
|
1249
1249
|
/** Add a candlestick (OHLC) series and return its unique ID. */
|
|
1250
1250
|
addCandlestickSeries(t) {
|
|
1251
|
-
const i = new
|
|
1251
|
+
const i = new Jt(), e = new Xt(i, {
|
|
1252
1252
|
upColor: c(this, W).candlestick.upColor,
|
|
1253
1253
|
downColor: c(this, W).candlestick.downColor,
|
|
1254
1254
|
wickUpColor: c(this, W).candlestick.wickUpColor,
|
|
1255
1255
|
wickDownColor: c(this, W).candlestick.wickDownColor,
|
|
1256
1256
|
bodyWidthRatio: 0.6,
|
|
1257
1257
|
...t
|
|
1258
|
-
}), a =
|
|
1258
|
+
}), a = Pt(this, mt, Rt).call(this, t == null ? void 0 : t.id);
|
|
1259
1259
|
return i.on("update", () => {
|
|
1260
1260
|
this.onDataChanged();
|
|
1261
|
-
}), c(this, M).push({ id: a, renderer: e, store: i, visible: !0 }), R(this,
|
|
1261
|
+
}), c(this, M).push({ id: a, renderer: e, store: i, visible: !0 }), R(this, et, null), this.updateViewportPadding(), this.emit("seriesChange"), a;
|
|
1262
1262
|
}
|
|
1263
1263
|
addLineSeries(t, i) {
|
|
1264
1264
|
let e, a;
|
|
@@ -1268,20 +1268,20 @@ class mi extends Bt {
|
|
|
1268
1268
|
const { layers: n, ...l } = t ?? {};
|
|
1269
1269
|
e = n ?? 1, a = l;
|
|
1270
1270
|
}
|
|
1271
|
-
const o = new
|
|
1271
|
+
const o = new H(e, {
|
|
1272
1272
|
colors: e === 1 ? [c(this, W).line.color] : c(this, W).seriesColors.slice(0, e),
|
|
1273
1273
|
lineWidth: c(this, W).line.width,
|
|
1274
1274
|
areaFill: !0,
|
|
1275
1275
|
...a
|
|
1276
|
-
}), s =
|
|
1276
|
+
}), s = Pt(this, mt, Rt).call(this, a == null ? void 0 : a.id);
|
|
1277
1277
|
for (const n of o.stores)
|
|
1278
1278
|
n.on("update", () => this.onDataChanged());
|
|
1279
|
-
return c(this, M).push({ id: s, label: a == null ? void 0 : a.label, renderer: o, store: o.stores[0], visible: !0 }), R(this,
|
|
1279
|
+
return c(this, M).push({ id: s, label: a == null ? void 0 : a.label, renderer: o, store: o.stores[0], visible: !0 }), R(this, et, null), this.updateViewportPadding(), this.emit("seriesChange"), s;
|
|
1280
1280
|
}
|
|
1281
1281
|
/** Set data for a specific layer within a line series. */
|
|
1282
1282
|
setLineLayerData(t, i, e) {
|
|
1283
1283
|
const a = c(this, M).find((s) => s.id === t);
|
|
1284
|
-
if (!a || !(a.renderer instanceof
|
|
1284
|
+
if (!a || !(a.renderer instanceof H)) return;
|
|
1285
1285
|
const o = a.renderer.stores[i];
|
|
1286
1286
|
o && o.setData(e);
|
|
1287
1287
|
}
|
|
@@ -1293,69 +1293,69 @@ class mi extends Bt {
|
|
|
1293
1293
|
const { layers: n, ...l } = t ?? {};
|
|
1294
1294
|
e = n ?? 1, a = l;
|
|
1295
1295
|
}
|
|
1296
|
-
const o = new
|
|
1296
|
+
const o = new tt(e, {
|
|
1297
1297
|
colors: c(this, W).seriesColors.slice(0, e),
|
|
1298
1298
|
barWidthRatio: 0.6,
|
|
1299
1299
|
...a
|
|
1300
|
-
}), s =
|
|
1300
|
+
}), s = Pt(this, mt, Rt).call(this, a == null ? void 0 : a.id);
|
|
1301
1301
|
for (const n of o.stores)
|
|
1302
1302
|
n.on("update", () => this.onDataChanged());
|
|
1303
|
-
return c(this, M).push({ id: s, label: a == null ? void 0 : a.label, renderer: o, store: o.stores[0], visible: !0 }), R(this,
|
|
1303
|
+
return c(this, M).push({ id: s, label: a == null ? void 0 : a.label, renderer: o, store: o.stores[0], visible: !0 }), R(this, et, null), this.updateViewportPadding(), this.emit("seriesChange"), s;
|
|
1304
1304
|
}
|
|
1305
1305
|
/** Set data for a specific layer within a bar series. */
|
|
1306
1306
|
setBarLayerData(t, i, e) {
|
|
1307
1307
|
const a = c(this, M).find((s) => s.id === t);
|
|
1308
|
-
if (!a || !(a.renderer instanceof
|
|
1308
|
+
if (!a || !(a.renderer instanceof tt)) return;
|
|
1309
1309
|
const o = a.renderer.stores[i];
|
|
1310
1310
|
o && o.setData(e);
|
|
1311
1311
|
}
|
|
1312
1312
|
/** Add a pie/donut series. Set `innerRadiusRatio > 0` for donut. */
|
|
1313
1313
|
addPieSeries(t) {
|
|
1314
|
-
const i = new
|
|
1315
|
-
return c(this, M).push({ id: e, label: t == null ? void 0 : t.label, renderer: i, store: null, visible: !0 }), R(this,
|
|
1314
|
+
const i = new ct(t), e = Pt(this, mt, Rt).call(this, t == null ? void 0 : t.id);
|
|
1315
|
+
return c(this, M).push({ id: e, label: t == null ? void 0 : t.label, renderer: i, store: null, visible: !0 }), R(this, et, null), this.updateViewportPadding(), this.emit("seriesChange"), e;
|
|
1316
1316
|
}
|
|
1317
1317
|
/** Set data for a pie/donut series. */
|
|
1318
1318
|
setPieData(t, i) {
|
|
1319
1319
|
const e = c(this, M).find((a) => a.id === t);
|
|
1320
|
-
!e || !(e.renderer instanceof
|
|
1320
|
+
!e || !(e.renderer instanceof ct) || (e.renderer.setData(i), c(this, A).markDirty(), this.emit("dataUpdate"));
|
|
1321
1321
|
}
|
|
1322
1322
|
/** Remove a series by ID and clean up its resources. */
|
|
1323
1323
|
removeSeries(t) {
|
|
1324
1324
|
const i = c(this, M).findIndex((e) => e.id === t);
|
|
1325
1325
|
if (i >= 0) {
|
|
1326
1326
|
const { renderer: e, store: a } = c(this, M)[i];
|
|
1327
|
-
if (e instanceof
|
|
1327
|
+
if (e instanceof H || e instanceof tt)
|
|
1328
1328
|
for (const o of e.stores) o.removeAllListeners();
|
|
1329
1329
|
else
|
|
1330
1330
|
a == null || a.removeAllListeners();
|
|
1331
|
-
c(this, M).splice(i, 1), R(this,
|
|
1331
|
+
c(this, M).splice(i, 1), R(this, et, null), this.updateViewportPadding(), c(this, A).markDirty(), this.emit("seriesChange");
|
|
1332
1332
|
}
|
|
1333
1333
|
}
|
|
1334
1334
|
/** Replace all data for a series (batch load). Accepts `Date` objects for time fields. */
|
|
1335
1335
|
setSeriesData(t, i) {
|
|
1336
1336
|
const e = c(this, M).find((o) => o.id === t);
|
|
1337
1337
|
if (!(e != null && e.store)) return;
|
|
1338
|
-
const a = i.length > 0 && "open" in i[0] ?
|
|
1338
|
+
const a = i.length > 0 && "open" in i[0] ? Ke(i) : qe(i);
|
|
1339
1339
|
e.store.setData(a);
|
|
1340
1340
|
}
|
|
1341
1341
|
/** Append a new data point to the end of a series (real-time tick). */
|
|
1342
1342
|
appendData(t, i) {
|
|
1343
1343
|
const e = c(this, M).find((o) => o.id === t);
|
|
1344
1344
|
if (!(e != null && e.store)) return;
|
|
1345
|
-
const a = { ...i, time:
|
|
1345
|
+
const a = { ...i, time: ue(i.time) };
|
|
1346
1346
|
e.store.append(a);
|
|
1347
1347
|
}
|
|
1348
1348
|
/** Update the last data point of a series in place (e.g. live candle update). */
|
|
1349
1349
|
updateData(t, i) {
|
|
1350
1350
|
const e = c(this, M).find((o) => o.id === t);
|
|
1351
1351
|
if (!(e != null && e.store)) return;
|
|
1352
|
-
const a = { ...i, time:
|
|
1352
|
+
const a = { ...i, time: ue(i.time) };
|
|
1353
1353
|
e.store.updateLast(a);
|
|
1354
1354
|
}
|
|
1355
1355
|
/** Update visual options (color, width, etc.) for an existing series. */
|
|
1356
1356
|
updateSeriesOptions(t, i) {
|
|
1357
1357
|
const e = c(this, M).find((a) => a.id === t);
|
|
1358
|
-
e && ((e.renderer instanceof
|
|
1358
|
+
e && ((e.renderer instanceof Xt || e.renderer instanceof H || e.renderer instanceof tt || e.renderer instanceof ct) && e.renderer.updateOptions(i), "label" in i && typeof i.label == "string" && (e.label = i.label), c(this, A).markDirty());
|
|
1359
1359
|
}
|
|
1360
1360
|
/**
|
|
1361
1361
|
* Batch multiple updates: suppress recomputes until `fn` returns.
|
|
@@ -1371,21 +1371,21 @@ class mi extends Bt {
|
|
|
1371
1371
|
}
|
|
1372
1372
|
/** @deprecated Use {@link batch} instead. */
|
|
1373
1373
|
beginUpdate() {
|
|
1374
|
-
|
|
1374
|
+
le(this, st)._++;
|
|
1375
1375
|
}
|
|
1376
1376
|
/** @deprecated Use {@link batch} instead. */
|
|
1377
1377
|
endUpdate() {
|
|
1378
|
-
--
|
|
1378
|
+
--le(this, st)._ <= 0 && (R(this, st, 0), c(this, Mt) ? (R(this, Mt, !1), R(this, dt, !1), this.onDataChanged()) : c(this, dt) && (R(this, dt, !1), this.updateYRange(!0), c(this, A).markDirty()));
|
|
1379
1379
|
}
|
|
1380
1380
|
/** Show or hide a series. Hidden series are not rendered and excluded from Y-range. */
|
|
1381
1381
|
setSeriesVisible(t, i) {
|
|
1382
1382
|
const e = c(this, M).find((a) => a.id === t);
|
|
1383
1383
|
if (!(!e || e.visible === i)) {
|
|
1384
|
-
if (e.visible = i, c(this,
|
|
1385
|
-
R(this,
|
|
1384
|
+
if (e.visible = i, c(this, st) > 0) {
|
|
1385
|
+
R(this, dt, !0);
|
|
1386
1386
|
return;
|
|
1387
1387
|
}
|
|
1388
|
-
this.updateYRange(!0), c(this,
|
|
1388
|
+
this.updateYRange(!0), c(this, A).markDirty();
|
|
1389
1389
|
}
|
|
1390
1390
|
}
|
|
1391
1391
|
isSeriesVisible(t) {
|
|
@@ -1397,15 +1397,15 @@ class mi extends Bt {
|
|
|
1397
1397
|
const a = c(this, M).find((s) => s.id === t);
|
|
1398
1398
|
if (!a) return;
|
|
1399
1399
|
const o = a.renderer;
|
|
1400
|
-
if (o instanceof
|
|
1400
|
+
if (o instanceof tt || o instanceof H) {
|
|
1401
1401
|
const s = o.stores[i];
|
|
1402
1402
|
if (s) {
|
|
1403
1403
|
if (s.isVisible() === e) return;
|
|
1404
|
-
if (s.setVisible(e), c(this,
|
|
1405
|
-
R(this,
|
|
1404
|
+
if (s.setVisible(e), c(this, st) > 0) {
|
|
1405
|
+
R(this, dt, !0);
|
|
1406
1406
|
return;
|
|
1407
1407
|
}
|
|
1408
|
-
this.updateYRange(!0), c(this,
|
|
1408
|
+
this.updateYRange(!0), c(this, A).markDirty();
|
|
1409
1409
|
}
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
@@ -1414,13 +1414,13 @@ class mi extends Bt {
|
|
|
1414
1414
|
const a = c(this, M).find((s) => s.id === t);
|
|
1415
1415
|
if (!a) return !0;
|
|
1416
1416
|
const o = a.renderer;
|
|
1417
|
-
return o instanceof
|
|
1417
|
+
return o instanceof tt || o instanceof H ? ((e = o.stores[i]) == null ? void 0 : e.isVisible()) ?? !0 : !0;
|
|
1418
1418
|
}
|
|
1419
1419
|
/** Auto-fit the viewport to show all data across every series. */
|
|
1420
1420
|
fitContent() {
|
|
1421
1421
|
const { first: t, last: i } = this.getDataBounds();
|
|
1422
1422
|
if (t === void 0 || i === void 0) return;
|
|
1423
|
-
const e = c(this,
|
|
1423
|
+
const e = c(this, V).size.media.width - this.yAxisWidth;
|
|
1424
1424
|
c(this, B).fitToData(t, i, e, !0);
|
|
1425
1425
|
}
|
|
1426
1426
|
getVisibleRange() {
|
|
@@ -1430,7 +1430,7 @@ class mi extends Bt {
|
|
|
1430
1430
|
return c(this, B).yRange;
|
|
1431
1431
|
}
|
|
1432
1432
|
getCrosshairPosition() {
|
|
1433
|
-
return c(this,
|
|
1433
|
+
return c(this, rt);
|
|
1434
1434
|
}
|
|
1435
1435
|
/** Get the last visible value and whether the absolute last point is on screen. */
|
|
1436
1436
|
getLastValue(t) {
|
|
@@ -1475,7 +1475,7 @@ class mi extends Bt {
|
|
|
1475
1475
|
const e = c(this, M).find((n) => n.id === t);
|
|
1476
1476
|
if (!e || !e.visible) return null;
|
|
1477
1477
|
const a = e.renderer;
|
|
1478
|
-
if (!(a instanceof
|
|
1478
|
+
if (!(a instanceof tt) && !(a instanceof H) || a.stores.length <= 1) return null;
|
|
1479
1479
|
const o = a.getColors(), s = [];
|
|
1480
1480
|
for (let n = 0; n < a.stores.length; n++) {
|
|
1481
1481
|
if (!a.stores[n].isVisible()) continue;
|
|
@@ -1494,7 +1494,7 @@ class mi extends Bt {
|
|
|
1494
1494
|
return s.length > 0 ? s : null;
|
|
1495
1495
|
}
|
|
1496
1496
|
getSeriesIds() {
|
|
1497
|
-
return c(this,
|
|
1497
|
+
return c(this, et) || R(this, et, c(this, M).map((t) => t.id)), c(this, et).slice();
|
|
1498
1498
|
}
|
|
1499
1499
|
/** Get the primary display color for a series. */
|
|
1500
1500
|
getSeriesColor(t) {
|
|
@@ -1510,7 +1510,7 @@ class mi extends Bt {
|
|
|
1510
1510
|
const i = c(this, M).find((o) => o.id === t);
|
|
1511
1511
|
if (!i) return null;
|
|
1512
1512
|
const e = i.renderer;
|
|
1513
|
-
if (!(e instanceof
|
|
1513
|
+
if (!(e instanceof tt) && !(e instanceof H)) return null;
|
|
1514
1514
|
const a = e.getColors();
|
|
1515
1515
|
return e.stores.map((o, s) => ({
|
|
1516
1516
|
color: a[s % a.length]
|
|
@@ -1519,7 +1519,7 @@ class mi extends Bt {
|
|
|
1519
1519
|
/** Get all pie slices with computed colors and percentages. Returns null for non-pie series. */
|
|
1520
1520
|
getPieSlices(t) {
|
|
1521
1521
|
const i = c(this, M).find((s) => s.id === t);
|
|
1522
|
-
if (!i || !(i.renderer instanceof
|
|
1522
|
+
if (!i || !(i.renderer instanceof ct)) return null;
|
|
1523
1523
|
const e = i.renderer.getData();
|
|
1524
1524
|
if (e.length === 0) return null;
|
|
1525
1525
|
const a = e.reduce((s, n) => s + n.value, 0), o = c(this, W).seriesColors;
|
|
@@ -1533,7 +1533,7 @@ class mi extends Bt {
|
|
|
1533
1533
|
/** Get the hovered pie slice info (label, value, percentage, color). Returns null if no hover. */
|
|
1534
1534
|
getPieHoverInfo(t) {
|
|
1535
1535
|
const i = c(this, M).find((l) => l.id === t);
|
|
1536
|
-
if (!i || !(i.renderer instanceof
|
|
1536
|
+
if (!i || !(i.renderer instanceof ct)) return null;
|
|
1537
1537
|
const e = i.renderer;
|
|
1538
1538
|
if (e.hoverIndex < 0) return null;
|
|
1539
1539
|
const a = e.getData(), o = a[e.hoverIndex];
|
|
@@ -1551,17 +1551,17 @@ class mi extends Bt {
|
|
|
1551
1551
|
const i = c(this, W).line.color;
|
|
1552
1552
|
R(this, W, t);
|
|
1553
1553
|
for (const e of c(this, M))
|
|
1554
|
-
e.renderer instanceof
|
|
1554
|
+
e.renderer instanceof Xt ? e.renderer.updateOptions({
|
|
1555
1555
|
upColor: t.candlestick.upColor,
|
|
1556
1556
|
downColor: t.candlestick.downColor,
|
|
1557
1557
|
wickUpColor: t.candlestick.wickUpColor,
|
|
1558
1558
|
wickDownColor: t.candlestick.wickDownColor
|
|
1559
|
-
}) : e.renderer instanceof
|
|
1559
|
+
}) : e.renderer instanceof tt ? e.renderer.updateOptions({
|
|
1560
1560
|
colors: t.seriesColors.slice(0, e.renderer.stores.length)
|
|
1561
|
-
}) : e.renderer instanceof
|
|
1561
|
+
}) : e.renderer instanceof H && (e.renderer.stores.length === 1 ? e.renderer.getColor() === i && e.renderer.updateOptions({ colors: [t.line.color] }) : e.renderer.updateOptions({
|
|
1562
1562
|
colors: t.seriesColors.slice(0, e.renderer.stores.length)
|
|
1563
1563
|
}));
|
|
1564
|
-
c(this,
|
|
1564
|
+
c(this, A).markDirty();
|
|
1565
1565
|
}
|
|
1566
1566
|
getTheme() {
|
|
1567
1567
|
return c(this, W);
|
|
@@ -1570,16 +1570,16 @@ class mi extends Bt {
|
|
|
1570
1570
|
setAxis(t) {
|
|
1571
1571
|
var i, e;
|
|
1572
1572
|
const a = this.yAxisWidth, o = this.xAxisHeight;
|
|
1573
|
-
R(this,
|
|
1573
|
+
R(this, pt, t);
|
|
1574
1574
|
const s = { min: (i = t.y) == null ? void 0 : i.min, max: (e = t.y) == null ? void 0 : e.max };
|
|
1575
|
-
R(this,
|
|
1575
|
+
R(this, E, s), R(this, bt, !1), this.updateYRange(!0), (this.yAxisWidth !== a || this.xAxisHeight !== o) && this.updateScales(!0), c(this, A).markDirty();
|
|
1576
1576
|
}
|
|
1577
1577
|
getMediaSize() {
|
|
1578
|
-
return c(this,
|
|
1578
|
+
return c(this, V).size.media;
|
|
1579
1579
|
}
|
|
1580
1580
|
/** Returns layout metrics for the chart area, Y axis, and time axis. */
|
|
1581
1581
|
getLayout() {
|
|
1582
|
-
const t = c(this,
|
|
1582
|
+
const t = c(this, V).size.media, i = this.yAxisWidth, e = this.xAxisHeight;
|
|
1583
1583
|
return {
|
|
1584
1584
|
chartArea: { x: 0, y: 0, width: t.width - i, height: t.height - e },
|
|
1585
1585
|
yAxisWidth: i,
|
|
@@ -1594,30 +1594,30 @@ class mi extends Bt {
|
|
|
1594
1594
|
c(this, B).setPadding(t);
|
|
1595
1595
|
const { first: i, last: e } = this.getDataBounds();
|
|
1596
1596
|
if (i !== void 0 && e !== void 0) {
|
|
1597
|
-
const a = c(this,
|
|
1597
|
+
const a = c(this, V).size.media.width - this.yAxisWidth;
|
|
1598
1598
|
c(this, B).fitToData(i, e, a, !1);
|
|
1599
1599
|
}
|
|
1600
|
-
this.syncScales(), c(this,
|
|
1600
|
+
this.syncScales(), c(this, A).markDirty();
|
|
1601
1601
|
}
|
|
1602
1602
|
/** Show or hide the background grid. Takes effect on the next render frame. */
|
|
1603
1603
|
setGrid(t) {
|
|
1604
|
-
R(this,
|
|
1604
|
+
R(this, kt, t), c(this, A).markDirty();
|
|
1605
1605
|
}
|
|
1606
1606
|
/** Notify chart that a YLabel is present (affects right padding). */
|
|
1607
1607
|
setYLabel(t) {
|
|
1608
|
-
R(this,
|
|
1608
|
+
R(this, Ht, t), this.updateViewportPadding();
|
|
1609
1609
|
}
|
|
1610
1610
|
updatePieHover(t) {
|
|
1611
|
-
const i = c(this,
|
|
1611
|
+
const i = c(this, V).size;
|
|
1612
1612
|
for (const e of c(this, M))
|
|
1613
|
-
if (e.renderer instanceof
|
|
1613
|
+
if (e.renderer instanceof ct) {
|
|
1614
1614
|
const a = e.renderer.hoverIndex;
|
|
1615
1615
|
if (t) {
|
|
1616
1616
|
const o = t.mediaX * i.horizontalPixelRatio, s = t.mediaY * i.verticalPixelRatio;
|
|
1617
1617
|
e.renderer.hoverIndex = e.renderer.hitTest(o, s, i.bitmap.width, i.bitmap.height);
|
|
1618
1618
|
} else
|
|
1619
1619
|
e.renderer.hoverIndex = -1;
|
|
1620
|
-
e.renderer.hoverIndex !== a && c(this,
|
|
1620
|
+
e.renderer.hoverIndex !== a && c(this, A).markDirty();
|
|
1621
1621
|
}
|
|
1622
1622
|
}
|
|
1623
1623
|
updateViewportPadding() {
|
|
@@ -1625,7 +1625,7 @@ class mi extends Bt {
|
|
|
1625
1625
|
/** Tear down the chart: cancel animations, remove listeners, and detach the canvas. */
|
|
1626
1626
|
destroy() {
|
|
1627
1627
|
var t;
|
|
1628
|
-
c(this, B).destroy(), c(this,
|
|
1628
|
+
c(this, B).destroy(), c(this, A).destroy(), c(this, gt).destroy(), (t = c(this, St)) == null || t.destroy(), c(this, V).destroy(), this.removeAllListeners();
|
|
1629
1629
|
}
|
|
1630
1630
|
/** Compute the earliest and latest timestamps across all series. */
|
|
1631
1631
|
getDataBounds() {
|
|
@@ -1638,8 +1638,8 @@ class mi extends Bt {
|
|
|
1638
1638
|
return { first: t, last: i };
|
|
1639
1639
|
}
|
|
1640
1640
|
onDataChanged() {
|
|
1641
|
-
if (c(this,
|
|
1642
|
-
R(this,
|
|
1641
|
+
if (c(this, st) > 0) {
|
|
1642
|
+
R(this, Mt, !0);
|
|
1643
1643
|
return;
|
|
1644
1644
|
}
|
|
1645
1645
|
this.updateDataInterval();
|
|
@@ -1647,15 +1647,15 @@ class mi extends Bt {
|
|
|
1647
1647
|
t !== void 0 && c(this, B).setDataStart(t), i !== void 0 && c(this, B).setDataEnd(i);
|
|
1648
1648
|
let e = 0;
|
|
1649
1649
|
for (const o of c(this, M))
|
|
1650
|
-
if (o.renderer instanceof
|
|
1650
|
+
if (o.renderer instanceof H || o.renderer instanceof tt)
|
|
1651
1651
|
for (const s of o.renderer.stores) e += s.length;
|
|
1652
1652
|
else o.store && (e += o.store.length);
|
|
1653
|
-
const a = e - c(this,
|
|
1654
|
-
if (R(this,
|
|
1655
|
-
const { from: o, to: s } = c(this, B).visibleRange, n = o === 0 && s === 0, l = c(this,
|
|
1653
|
+
const a = e - c(this, It) > 5;
|
|
1654
|
+
if (R(this, It, e), t !== void 0 && i !== void 0) {
|
|
1655
|
+
const { from: o, to: s } = c(this, B).visibleRange, n = o === 0 && s === 0, l = c(this, V).size.media.width - this.yAxisWidth;
|
|
1656
1656
|
n ? c(this, B).fitToData(t, i, l, !1) : a && c(this, B).autoScroll ? c(this, B).fitToData(t, i, l, !0) : !a && this.isLastPointVisible() && c(this, B).scrollToEnd(i, l);
|
|
1657
1657
|
}
|
|
1658
|
-
this.updateYRange(a), this.syncScales(), c(this,
|
|
1658
|
+
this.updateYRange(a), this.syncScales(), c(this, A).markDirty(), this.emit("dataUpdate");
|
|
1659
1659
|
}
|
|
1660
1660
|
/** Check whether the last data point of any series falls within the visible time range. */
|
|
1661
1661
|
isLastPointVisible() {
|
|
@@ -1673,7 +1673,7 @@ class mi extends Bt {
|
|
|
1673
1673
|
const i = t.store.getAll();
|
|
1674
1674
|
if (i.length >= 2) {
|
|
1675
1675
|
const e = i.slice(0, 20).map((a) => a.time);
|
|
1676
|
-
R(this, N,
|
|
1676
|
+
R(this, N, Qe(e)), c(this, B).setDataInterval(c(this, N));
|
|
1677
1677
|
break;
|
|
1678
1678
|
}
|
|
1679
1679
|
}
|
|
@@ -1681,7 +1681,7 @@ class mi extends Bt {
|
|
|
1681
1681
|
updateYRange(t = !1) {
|
|
1682
1682
|
let i = 1 / 0, e = -1 / 0;
|
|
1683
1683
|
const a = c(this, B).visibleRange;
|
|
1684
|
-
let o = c(this,
|
|
1684
|
+
let o = c(this, E).min !== void 0 && c(this, E).min !== "auto" && typeof c(this, E).min != "number" || c(this, E).max !== void 0 && c(this, E).max !== "auto" && typeof c(this, E).max != "number" ? [] : null;
|
|
1685
1685
|
for (const h of c(this, M)) {
|
|
1686
1686
|
if (!h.visible) continue;
|
|
1687
1687
|
if (h.renderer.getValueRange) {
|
|
@@ -1703,17 +1703,17 @@ class mi extends Bt {
|
|
|
1703
1703
|
}
|
|
1704
1704
|
}
|
|
1705
1705
|
if (i === 1 / 0 || e === -1 / 0) {
|
|
1706
|
-
R(this,
|
|
1706
|
+
R(this, bt, !1);
|
|
1707
1707
|
return;
|
|
1708
1708
|
}
|
|
1709
|
-
if (i = this.resolveBound(c(this,
|
|
1710
|
-
R(this, K, i), R(this, q, e), R(this,
|
|
1709
|
+
if (i = this.resolveBound(c(this, E).min, i, e, o ?? [], "min"), e = this.resolveBound(c(this, E).max, e, i, o ?? [], "max"), !c(this, bt) || t)
|
|
1710
|
+
R(this, K, i), R(this, q, e), R(this, bt, !0);
|
|
1711
1711
|
else {
|
|
1712
1712
|
R(this, K, c(this, K) + (i - c(this, K)) * 0.2), R(this, q, c(this, q) + (e - c(this, q)) * 0.2), i < c(this, K) && R(this, K, i), e > c(this, q) && R(this, q, e);
|
|
1713
1713
|
const h = Math.max(Math.abs(c(this, q) - c(this, K)) * 1e-4, 1e-3);
|
|
1714
|
-
(Math.abs(c(this, K) - i) > h || Math.abs(c(this, q) - e) > h) && c(this,
|
|
1714
|
+
(Math.abs(c(this, K) - i) > h || Math.abs(c(this, q) - e) > h) && c(this, A).markDirty();
|
|
1715
1715
|
}
|
|
1716
|
-
const s = c(this,
|
|
1716
|
+
const s = c(this, E).min !== void 0 && c(this, E).min !== "auto", n = c(this, E).max !== void 0 && c(this, E).max !== "auto", l = c(this, V).size.media.height - this.xAxisHeight;
|
|
1717
1717
|
c(this, B).setYRange(c(this, K), c(this, q), l, s, n);
|
|
1718
1718
|
}
|
|
1719
1719
|
/** Resolve an {@link AxisBound} to a concrete numeric value. */
|
|
@@ -1734,24 +1734,24 @@ class mi extends Bt {
|
|
|
1734
1734
|
* handler so DOM axis components always read fresh coordinates on re-render.
|
|
1735
1735
|
*/
|
|
1736
1736
|
syncScales() {
|
|
1737
|
-
const t = c(this,
|
|
1737
|
+
const t = c(this, V).size;
|
|
1738
1738
|
if (t.media.width === 0 || t.media.height === 0) return;
|
|
1739
1739
|
const i = t.media.width - this.yAxisWidth, e = t.media.height - this.xAxisHeight;
|
|
1740
1740
|
this.timeScale.update(c(this, B).visibleRange, i, t.horizontalPixelRatio), this.yScale.update(c(this, B).yRange, e, t.verticalPixelRatio);
|
|
1741
1741
|
}
|
|
1742
1742
|
updateScales(t = !1) {
|
|
1743
|
-
const i = c(this,
|
|
1743
|
+
const i = c(this, V).size;
|
|
1744
1744
|
if (i.media.width === 0 || i.media.height === 0) return;
|
|
1745
1745
|
const e = i.media.width - this.yAxisWidth, a = i.media.height - this.xAxisHeight;
|
|
1746
1746
|
this.timeScale.update(c(this, B).visibleRange, e, i.horizontalPixelRatio), this.yScale.update(c(this, B).yRange, a, i.verticalPixelRatio), this.updateYRange(t), this.yScale.update(c(this, B).yRange, a, i.verticalPixelRatio);
|
|
1747
1747
|
}
|
|
1748
1748
|
/** Expensive: background, grid, all series. Only on data/viewport/resize change. */
|
|
1749
1749
|
renderMain() {
|
|
1750
|
-
const t = c(this,
|
|
1750
|
+
const t = c(this, V).size;
|
|
1751
1751
|
if (!(t.media.width === 0 || t.media.height === 0)) {
|
|
1752
|
-
c(this, B).tick(performance.now()) && c(this,
|
|
1752
|
+
c(this, B).tick(performance.now()) && c(this, A).markDirty(), this.updateScales(), c(this, V).useMainLayer((i) => {
|
|
1753
1753
|
const { context: e, bitmapSize: a } = i, o = (t.media.width - this.yAxisWidth) * t.horizontalPixelRatio, s = (t.media.height - this.xAxisHeight) * t.verticalPixelRatio;
|
|
1754
|
-
e.clearRect(0, 0, a.width, a.height), e.save(), e.beginPath(), e.rect(0, 0, o, s), e.clip(), c(this,
|
|
1754
|
+
e.clearRect(0, 0, a.width, a.height), e.save(), e.beginPath(), e.rect(0, 0, o, s), e.clip(), c(this, kt) && He(i, this.timeScale, this.yScale, c(this, W), c(this, N));
|
|
1755
1755
|
for (const n of c(this, M))
|
|
1756
1756
|
n.visible && n.renderer.render({
|
|
1757
1757
|
scope: i,
|
|
@@ -1763,8 +1763,8 @@ class mi extends Bt {
|
|
|
1763
1763
|
e.restore();
|
|
1764
1764
|
});
|
|
1765
1765
|
for (const i of c(this, M))
|
|
1766
|
-
if (i.renderer instanceof
|
|
1767
|
-
c(this,
|
|
1766
|
+
if (i.renderer instanceof ct && i.renderer.needsAnimation) {
|
|
1767
|
+
c(this, A).markDirty();
|
|
1768
1768
|
break;
|
|
1769
1769
|
}
|
|
1770
1770
|
this.renderOverlay();
|
|
@@ -1772,25 +1772,25 @@ class mi extends Bt {
|
|
|
1772
1772
|
}
|
|
1773
1773
|
/** Cheap overlay: crosshair, nearest-point dots, pulse animation. */
|
|
1774
1774
|
renderOverlay() {
|
|
1775
|
-
const t = c(this,
|
|
1775
|
+
const t = c(this, V).size;
|
|
1776
1776
|
if (t.media.width === 0 || t.media.height === 0) return;
|
|
1777
1777
|
let i = !1;
|
|
1778
1778
|
for (const e of c(this, M))
|
|
1779
|
-
if (e.visible && e.renderer instanceof
|
|
1779
|
+
if (e.visible && e.renderer instanceof H && e.renderer.hasPulse) {
|
|
1780
1780
|
i = !0;
|
|
1781
1781
|
break;
|
|
1782
1782
|
}
|
|
1783
|
-
if (c(this,
|
|
1784
|
-
if (!c(this,
|
|
1783
|
+
if (c(this, V).useOverlayLayer((e) => {
|
|
1784
|
+
if (!c(this, rt) && !i) return;
|
|
1785
1785
|
const a = (t.media.width - this.yAxisWidth) * t.horizontalPixelRatio, o = (t.media.height - this.xAxisHeight) * t.verticalPixelRatio;
|
|
1786
|
-
if (e.context.save(), e.context.beginPath(), e.context.rect(0, 0, a, o), e.context.clip(), c(this,
|
|
1787
|
-
const s = c(this,
|
|
1788
|
-
|
|
1786
|
+
if (e.context.save(), e.context.beginPath(), e.context.rect(0, 0, a, o), e.context.clip(), c(this, rt)) {
|
|
1787
|
+
const s = c(this, rt).mediaX * t.horizontalPixelRatio, n = c(this, rt).mediaY * t.verticalPixelRatio;
|
|
1788
|
+
Xe(e, s, n, c(this, W));
|
|
1789
1789
|
for (const l of c(this, M))
|
|
1790
|
-
if (l.visible && l.renderer instanceof
|
|
1790
|
+
if (l.visible && l.renderer instanceof H) {
|
|
1791
1791
|
const h = l.renderer, d = h.getColors(), g = h.getStacking(), f = 4 * t.horizontalPixelRatio, p = [], m = [];
|
|
1792
1792
|
for (let u = 0; u < h.stores.length; u++) {
|
|
1793
|
-
const v = h.stores[u].findNearest(c(this,
|
|
1793
|
+
const v = h.stores[u].findNearest(c(this, rt).time, c(this, N));
|
|
1794
1794
|
v ? (p.push(v.value), m.push(v.time)) : (p.push(0), m.push(0));
|
|
1795
1795
|
}
|
|
1796
1796
|
const b = [];
|
|
@@ -1814,7 +1814,7 @@ class mi extends Bt {
|
|
|
1814
1814
|
}
|
|
1815
1815
|
}
|
|
1816
1816
|
for (const s of c(this, M))
|
|
1817
|
-
s.visible && s.renderer instanceof
|
|
1817
|
+
s.visible && s.renderer instanceof H && s.renderer.hasPulse && s.renderer.drawPulseOverlay(
|
|
1818
1818
|
e.context,
|
|
1819
1819
|
this.timeScale,
|
|
1820
1820
|
this.yScale,
|
|
@@ -1825,7 +1825,7 @@ class mi extends Bt {
|
|
|
1825
1825
|
const { from: e, to: a } = this.timeScale.getRange();
|
|
1826
1826
|
let o = !1;
|
|
1827
1827
|
for (const s of c(this, M))
|
|
1828
|
-
if (!(!s.visible || !(s.renderer instanceof
|
|
1828
|
+
if (!(!s.visible || !(s.renderer instanceof H) || !s.renderer.hasPulse)) {
|
|
1829
1829
|
for (const n of s.renderer.stores) {
|
|
1830
1830
|
const l = n.last();
|
|
1831
1831
|
if (l && l.time >= e && l.time <= a) {
|
|
@@ -1835,25 +1835,25 @@ class mi extends Bt {
|
|
|
1835
1835
|
}
|
|
1836
1836
|
if (o) break;
|
|
1837
1837
|
}
|
|
1838
|
-
o && c(this,
|
|
1838
|
+
o && c(this, gt).markDirty();
|
|
1839
1839
|
}
|
|
1840
1840
|
}
|
|
1841
1841
|
}
|
|
1842
|
-
|
|
1842
|
+
V = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), rt = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakSet(), /**
|
|
1843
1843
|
* Return a series ID: use the provided hint if it's non-empty and not already taken,
|
|
1844
1844
|
* otherwise generate a new auto ID. Auto-generated IDs never collide with each other
|
|
1845
1845
|
* or with user-provided IDs because they use a monotonically increasing counter.
|
|
1846
1846
|
*/
|
|
1847
|
-
|
|
1847
|
+
Rt = function(r) {
|
|
1848
1848
|
if (r && !c(this, M).some((i) => i.id === r))
|
|
1849
1849
|
return r;
|
|
1850
1850
|
let t;
|
|
1851
1851
|
do
|
|
1852
|
-
t = `series_${++
|
|
1852
|
+
t = `series_${++mi}`;
|
|
1853
1853
|
while (c(this, M).some((i) => i.id === t));
|
|
1854
1854
|
return t;
|
|
1855
|
-
},
|
|
1856
|
-
const
|
|
1855
|
+
}, It = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakMap();
|
|
1856
|
+
const xo = {
|
|
1857
1857
|
background: "#ffffff",
|
|
1858
1858
|
chartGradient: ["#ffffff", "#f5f6f8"],
|
|
1859
1859
|
typography: {
|
|
@@ -1910,77 +1910,83 @@ const yo = {
|
|
|
1910
1910
|
borderColor: "rgba(0, 0, 0, 0.1)"
|
|
1911
1911
|
}
|
|
1912
1912
|
};
|
|
1913
|
-
function
|
|
1913
|
+
function vi(r) {
|
|
1914
1914
|
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;
|
|
1915
1915
|
}
|
|
1916
1916
|
function I(r) {
|
|
1917
|
-
var t, i, e, a, o, s, n, l, h, d, g, f, p, m, b, u, v, y, x, C, T, k, D, z,
|
|
1918
|
-
const { background:
|
|
1919
|
-
|
|
1920
|
-
|
|
1917
|
+
var t, i, e, a, o, s, n, l, h, d, g, f, p, m, b, u, v, y, x, C, T, k, D, z, Y, P, $, X, Q;
|
|
1918
|
+
const { background: _, name: lt = "Custom", description: U, fontUrl: O = null, backgroundImage: Z, backgroundSize: De } = r, G = vi(_), Be = G ? "#d1d4dc" : "#24292f", ze = G ? "#787b86" : "#8b949e", re = G ? "#26a69a" : "#2da44e", ae = G ? "#ef5350" : "#cf222e", Fe = G ? "#2962ff" : "#0969da", Pe = G ? "rgba(42,46,57,0.6)" : "rgba(200,200,200,0.5)", Le = G ? "rgba(150,150,150,0.5)" : "rgba(170,170,170,0.3)", se = G ? Wt(_, 0.1) : be(_, 0.05), We = G ? xt(_, 0.92) : xt(_, 0.95), Ie = G ? xt(Wt(_, 0.15), 0.6) : "rgba(200,200,200,0.5)", Ae = _t, Ot = ((t = r.candlestick) == null ? void 0 : t.upColor) ?? re, Ft = ((i = r.candlestick) == null ? void 0 : i.downColor) ?? ae, yt = ((e = r.line) == null ? void 0 : e.color) ?? Fe, ne = ((a = r.tooltip) == null ? void 0 : a.textColor) ?? Be, Ve = ((o = r.axis) == null ? void 0 : o.textColor) ?? ze, Ye = ((s = r.typography) == null ? void 0 : s.fontFamily) ?? Ae;
|
|
1919
|
+
return {
|
|
1920
|
+
name: lt,
|
|
1921
|
+
description: U,
|
|
1922
|
+
dark: G,
|
|
1923
|
+
fontUrl: O,
|
|
1924
|
+
backgroundImage: Z,
|
|
1925
|
+
backgroundSize: De,
|
|
1926
|
+
background: _,
|
|
1927
|
+
chartGradient: r.chartGradient ?? (G ? [Wt(_, 0.04), be(_, 0.06)] : [Wt(_, 0.06), _]),
|
|
1921
1928
|
typography: {
|
|
1922
|
-
fontFamily:
|
|
1929
|
+
fontFamily: Ye,
|
|
1923
1930
|
fontSize: ((n = r.typography) == null ? void 0 : n.fontSize) ?? 12,
|
|
1924
1931
|
axisFontSize: ((l = r.typography) == null ? void 0 : l.axisFontSize) ?? 10,
|
|
1925
1932
|
yFontSize: ((h = r.typography) == null ? void 0 : h.yFontSize) ?? 11,
|
|
1926
1933
|
tooltipFontSize: ((d = r.typography) == null ? void 0 : d.tooltipFontSize) ?? ((g = r.typography) == null ? void 0 : g.fontSize) ?? 12
|
|
1927
1934
|
},
|
|
1928
1935
|
grid: {
|
|
1929
|
-
color: ((f = r.grid) == null ? void 0 : f.color) ??
|
|
1936
|
+
color: ((f = r.grid) == null ? void 0 : f.color) ?? Pe,
|
|
1930
1937
|
style: ((p = r.grid) == null ? void 0 : p.style) ?? "dashed"
|
|
1931
1938
|
},
|
|
1932
1939
|
candlestick: {
|
|
1933
|
-
upColor:
|
|
1934
|
-
downColor:
|
|
1935
|
-
wickUpColor: ((m = r.candlestick) == null ? void 0 : m.wickUpColor) ??
|
|
1936
|
-
wickDownColor: ((b = r.candlestick) == null ? void 0 : b.wickDownColor) ??
|
|
1940
|
+
upColor: Ot,
|
|
1941
|
+
downColor: Ft,
|
|
1942
|
+
wickUpColor: ((m = r.candlestick) == null ? void 0 : m.wickUpColor) ?? Ot,
|
|
1943
|
+
wickDownColor: ((b = r.candlestick) == null ? void 0 : b.wickDownColor) ?? Ft
|
|
1937
1944
|
},
|
|
1938
1945
|
line: {
|
|
1939
|
-
color:
|
|
1946
|
+
color: yt,
|
|
1940
1947
|
width: ((u = r.line) == null ? void 0 : u.width) ?? 1,
|
|
1941
|
-
areaTopColor: ((v = r.line) == null ? void 0 : v.areaTopColor) ?? yt
|
|
1942
|
-
areaBottomColor: ((y = r.line) == null ? void 0 : y.areaBottomColor) ?? yt
|
|
1948
|
+
areaTopColor: ((v = r.line) == null ? void 0 : v.areaTopColor) ?? xt(yt, 0.08),
|
|
1949
|
+
areaBottomColor: ((y = r.line) == null ? void 0 : y.areaBottomColor) ?? xt(yt, 0.01)
|
|
1943
1950
|
},
|
|
1944
|
-
seriesColors: r.seriesColors ?? [
|
|
1951
|
+
seriesColors: r.seriesColors ?? [yt, re, ae],
|
|
1945
1952
|
bands: {
|
|
1946
|
-
upper: ((x = r.bands) == null ? void 0 : x.upper) ??
|
|
1947
|
-
lower: ((C = r.bands) == null ? void 0 : C.lower) ??
|
|
1953
|
+
upper: ((x = r.bands) == null ? void 0 : x.upper) ?? yt,
|
|
1954
|
+
lower: ((C = r.bands) == null ? void 0 : C.lower) ?? Ft
|
|
1948
1955
|
},
|
|
1949
1956
|
crosshair: {
|
|
1950
|
-
color: ((T = r.crosshair) == null ? void 0 : T.color) ??
|
|
1951
|
-
labelBackground: ((k = r.crosshair) == null ? void 0 : k.labelBackground) ??
|
|
1952
|
-
labelTextColor: ((D = r.crosshair) == null ? void 0 : D.labelTextColor) ??
|
|
1957
|
+
color: ((T = r.crosshair) == null ? void 0 : T.color) ?? Le,
|
|
1958
|
+
labelBackground: ((k = r.crosshair) == null ? void 0 : k.labelBackground) ?? se,
|
|
1959
|
+
labelTextColor: ((D = r.crosshair) == null ? void 0 : D.labelTextColor) ?? ne
|
|
1953
1960
|
},
|
|
1954
|
-
axis: { textColor:
|
|
1961
|
+
axis: { textColor: Ve },
|
|
1955
1962
|
yLabel: {
|
|
1956
|
-
upBackground: ((z = r.yLabel) == null ? void 0 : z.upBackground) ??
|
|
1957
|
-
downBackground: ((
|
|
1958
|
-
neutralBackground: ((P = r.yLabel) == null ? void 0 : P.neutralBackground) ??
|
|
1959
|
-
textColor: ((
|
|
1963
|
+
upBackground: ((z = r.yLabel) == null ? void 0 : z.upBackground) ?? Ot,
|
|
1964
|
+
downBackground: ((Y = r.yLabel) == null ? void 0 : Y.downBackground) ?? Ft,
|
|
1965
|
+
neutralBackground: ((P = r.yLabel) == null ? void 0 : P.neutralBackground) ?? se,
|
|
1966
|
+
textColor: (($ = r.yLabel) == null ? void 0 : $.textColor) ?? "#ffffff"
|
|
1960
1967
|
},
|
|
1961
1968
|
tooltip: {
|
|
1962
|
-
background: ((
|
|
1963
|
-
textColor:
|
|
1964
|
-
borderColor: ((Q = r.tooltip) == null ? void 0 : Q.borderColor) ??
|
|
1969
|
+
background: ((X = r.tooltip) == null ? void 0 : X.background) ?? We,
|
|
1970
|
+
textColor: ne,
|
|
1971
|
+
borderColor: ((Q = r.tooltip) == null ? void 0 : Q.borderColor) ?? Ie
|
|
1965
1972
|
}
|
|
1966
1973
|
};
|
|
1967
|
-
return { name: nt, description: E, fontUrl: O, dark: A, theme: Ve };
|
|
1968
1974
|
}
|
|
1969
|
-
function
|
|
1975
|
+
function xt(r, t) {
|
|
1970
1976
|
const i = parseInt(r.slice(1, 3), 16), e = parseInt(r.slice(3, 5), 16), a = parseInt(r.slice(5, 7), 16);
|
|
1971
1977
|
return `rgba(${i}, ${e}, ${a}, ${t})`;
|
|
1972
1978
|
}
|
|
1973
|
-
function
|
|
1979
|
+
function Wt(r, t) {
|
|
1974
1980
|
if (!r.startsWith("#")) return r;
|
|
1975
1981
|
const i = Math.min(255, Math.round(parseInt(r.slice(1, 3), 16) + 255 * t)), e = Math.min(255, Math.round(parseInt(r.slice(3, 5), 16) + 255 * t)), a = Math.min(255, Math.round(parseInt(r.slice(5, 7), 16) + 255 * t));
|
|
1976
1982
|
return `#${i.toString(16).padStart(2, "0")}${e.toString(16).padStart(2, "0")}${a.toString(16).padStart(2, "0")}`;
|
|
1977
1983
|
}
|
|
1978
|
-
function
|
|
1984
|
+
function be(r, t) {
|
|
1979
1985
|
if (!r.startsWith("#")) return r;
|
|
1980
1986
|
const i = Math.max(0, Math.round(parseInt(r.slice(1, 3), 16) * (1 - t))), e = Math.max(0, Math.round(parseInt(r.slice(3, 5), 16) * (1 - t))), a = Math.max(0, Math.round(parseInt(r.slice(5, 7), 16) * (1 - t)));
|
|
1981
1987
|
return `#${i.toString(16).padStart(2, "0")}${e.toString(16).padStart(2, "0")}${a.toString(16).padStart(2, "0")}`;
|
|
1982
1988
|
}
|
|
1983
|
-
const
|
|
1989
|
+
const Vt = "'JetBrains Mono', 'Fira Code', monospace", Yt = "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", ke = "https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;600&display=swap", yi = "'IBM Plex Mono', monospace", xi = "https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap", Qt = "'Fira Code', monospace", Zt = "https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap", Me = "'Source Code Pro', monospace", Re = "https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500;600&display=swap", Ci = "'Space Mono', monospace", wi = "https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap", te = "'Plus Jakarta Sans', sans-serif", ee = "https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap", Si = "'Caveat', 'Comic Sans MS', cursive", ki = "https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&display=swap", Mi = I({
|
|
1984
1990
|
name: "Andromeda",
|
|
1985
1991
|
description: "Deep space purples and cosmic blues",
|
|
1986
1992
|
background: "#23262e",
|
|
@@ -2003,9 +2009,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2003
2009
|
crosshair: { color: "rgba(102,94,110,0.4)", labelBackground: "#2e3038" },
|
|
2004
2010
|
axis: { textColor: "#665e6e" },
|
|
2005
2011
|
tooltip: { background: "rgba(35,38,46,0.92)", textColor: "#d5ced9", borderColor: "rgba(50,48,56,0.6)" },
|
|
2006
|
-
typography: { fontFamily:
|
|
2007
|
-
fontUrl:
|
|
2008
|
-
}),
|
|
2012
|
+
typography: { fontFamily: Se },
|
|
2013
|
+
fontUrl: ke
|
|
2014
|
+
}), Ri = I({
|
|
2009
2015
|
name: "Ayu Mirage",
|
|
2010
2016
|
description: "Warm dark with amber accents",
|
|
2011
2017
|
background: "#1f2430",
|
|
@@ -2028,9 +2034,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2028
2034
|
crosshair: { color: "rgba(92,103,115,0.4)", labelBackground: "#2a3040" },
|
|
2029
2035
|
axis: { textColor: "#5c6773" },
|
|
2030
2036
|
tooltip: { background: "rgba(31,36,48,0.92)", textColor: "#cbccc6", borderColor: "rgba(42,48,60,0.6)" },
|
|
2031
|
-
typography: { fontFamily:
|
|
2032
|
-
fontUrl:
|
|
2033
|
-
}),
|
|
2037
|
+
typography: { fontFamily: _t },
|
|
2038
|
+
fontUrl: qt
|
|
2039
|
+
}), Ti = I({
|
|
2034
2040
|
name: "Catppuccin",
|
|
2035
2041
|
description: "Pastel tones on a mocha base",
|
|
2036
2042
|
background: "#1e1e2e",
|
|
@@ -2053,9 +2059,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2053
2059
|
crosshair: { color: "rgba(108,112,134,0.4)", labelBackground: "#313244" },
|
|
2054
2060
|
axis: { textColor: "#6c7086" },
|
|
2055
2061
|
tooltip: { background: "rgba(30,30,46,0.92)", textColor: "#cdd6f4", borderColor: "rgba(49,50,68,0.6)" },
|
|
2056
|
-
typography: { fontFamily:
|
|
2057
|
-
fontUrl:
|
|
2058
|
-
}),
|
|
2062
|
+
typography: { fontFamily: _t },
|
|
2063
|
+
fontUrl: qt
|
|
2064
|
+
}), Di = I({
|
|
2059
2065
|
name: "Dracula",
|
|
2060
2066
|
description: "Classic dark with vibrant highlights",
|
|
2061
2067
|
background: "#282a36",
|
|
@@ -2078,9 +2084,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2078
2084
|
crosshair: { color: "rgba(98,114,164,0.4)", labelBackground: "#44475a" },
|
|
2079
2085
|
axis: { textColor: "#6272a4" },
|
|
2080
2086
|
tooltip: { background: "rgba(40,42,54,0.92)", textColor: "#f8f8f2", borderColor: "rgba(68,71,90,0.6)" },
|
|
2081
|
-
typography: { fontFamily:
|
|
2082
|
-
fontUrl:
|
|
2083
|
-
}),
|
|
2087
|
+
typography: { fontFamily: Qt },
|
|
2088
|
+
fontUrl: Zt
|
|
2089
|
+
}), Bi = I({
|
|
2084
2090
|
name: "GitHub Light",
|
|
2085
2091
|
description: "Clean and familiar, GitHub-inspired",
|
|
2086
2092
|
background: "#fafbfc",
|
|
@@ -2104,9 +2110,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2104
2110
|
crosshair: { color: "rgba(208,215,222,0.3)", labelBackground: "#f0f3f6" },
|
|
2105
2111
|
axis: { textColor: "#8b949e" },
|
|
2106
2112
|
tooltip: { background: "rgba(250,251,252,0.95)", textColor: "#24292f", borderColor: "rgba(216,222,228,0.5)" },
|
|
2107
|
-
typography: { fontFamily:
|
|
2108
|
-
fontUrl:
|
|
2109
|
-
}),
|
|
2113
|
+
typography: { fontFamily: yi },
|
|
2114
|
+
fontUrl: xi
|
|
2115
|
+
}), zi = I({
|
|
2110
2116
|
name: "Gruvbox",
|
|
2111
2117
|
description: "Retro warm with earthy tones",
|
|
2112
2118
|
background: "#282828",
|
|
@@ -2129,74 +2135,72 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2129
2135
|
crosshair: { color: "rgba(146,131,116,0.4)", labelBackground: "#3c3836" },
|
|
2130
2136
|
axis: { textColor: "#928374" },
|
|
2131
2137
|
tooltip: { background: "rgba(40,40,40,0.92)", textColor: "#ebdbb2", borderColor: "rgba(60,56,54,0.6)" },
|
|
2132
|
-
typography: { fontFamily:
|
|
2133
|
-
fontUrl:
|
|
2134
|
-
}),
|
|
2138
|
+
typography: { fontFamily: Vt },
|
|
2139
|
+
fontUrl: Yt
|
|
2140
|
+
}), Fi = {
|
|
2135
2141
|
name: "Handwritten",
|
|
2136
2142
|
description: "Sketch-style with a personal touch",
|
|
2137
|
-
fontUrl:
|
|
2143
|
+
fontUrl: ki,
|
|
2138
2144
|
dark: !1,
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
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
|
-
borderColor: "rgba(180,170,150,0.4)"
|
|
2197
|
-
}
|
|
2145
|
+
background: "#fdf5e6",
|
|
2146
|
+
chartGradient: ["#fef6e3", "#fdf5e6"],
|
|
2147
|
+
typography: {
|
|
2148
|
+
fontFamily: Si,
|
|
2149
|
+
fontSize: 18,
|
|
2150
|
+
axisFontSize: 13,
|
|
2151
|
+
yFontSize: 15,
|
|
2152
|
+
tooltipFontSize: 14
|
|
2153
|
+
},
|
|
2154
|
+
grid: {
|
|
2155
|
+
color: "rgba(180,170,150,0.3)",
|
|
2156
|
+
style: "dashed"
|
|
2157
|
+
},
|
|
2158
|
+
candlestick: {
|
|
2159
|
+
upColor: "#7a9a5e",
|
|
2160
|
+
downColor: "#b07060",
|
|
2161
|
+
wickUpColor: "#7a9a5e",
|
|
2162
|
+
wickDownColor: "#b07060"
|
|
2163
|
+
},
|
|
2164
|
+
line: {
|
|
2165
|
+
color: "#6a8fa0",
|
|
2166
|
+
width: 1,
|
|
2167
|
+
areaTopColor: "rgba(106,143,160,0.08)",
|
|
2168
|
+
areaBottomColor: "rgba(106,143,160,0.01)"
|
|
2169
|
+
},
|
|
2170
|
+
seriesColors: [
|
|
2171
|
+
"#6a8fa0",
|
|
2172
|
+
"#c09050",
|
|
2173
|
+
"#7a9a5e",
|
|
2174
|
+
"#8a7098",
|
|
2175
|
+
"#b07060",
|
|
2176
|
+
"#a09030",
|
|
2177
|
+
"#508878",
|
|
2178
|
+
"#a06878",
|
|
2179
|
+
"#6888a0",
|
|
2180
|
+
"#8870a0"
|
|
2181
|
+
],
|
|
2182
|
+
bands: {
|
|
2183
|
+
upper: "#6888a0",
|
|
2184
|
+
lower: "#a06878"
|
|
2185
|
+
},
|
|
2186
|
+
crosshair: {
|
|
2187
|
+
color: "rgba(160,152,128,0.3)",
|
|
2188
|
+
labelBackground: "#f5edd8",
|
|
2189
|
+
labelTextColor: "#5c5040"
|
|
2190
|
+
},
|
|
2191
|
+
axis: { textColor: "#a09880" },
|
|
2192
|
+
yLabel: {
|
|
2193
|
+
upBackground: "#7a9a5e",
|
|
2194
|
+
downBackground: "#b07060",
|
|
2195
|
+
neutralBackground: "#e8dcc8",
|
|
2196
|
+
textColor: "#fdf5e6"
|
|
2197
|
+
},
|
|
2198
|
+
tooltip: {
|
|
2199
|
+
background: "rgba(253,245,230,0.95)",
|
|
2200
|
+
textColor: "#5c5040",
|
|
2201
|
+
borderColor: "rgba(180,170,150,0.4)"
|
|
2198
2202
|
}
|
|
2199
|
-
},
|
|
2203
|
+
}, Pi = "'Silkscreen', cursive", Li = "https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap", Wi = I({
|
|
2200
2204
|
name: "Matrix",
|
|
2201
2205
|
background: "#000000",
|
|
2202
2206
|
candlestick: { upColor: "#00ff41", downColor: "#00802a" },
|
|
@@ -2218,10 +2222,10 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2218
2222
|
axis: { textColor: "#00cc33" },
|
|
2219
2223
|
crosshair: { color: "rgba(0,255,65,0.3)", labelBackground: "#0a1a0a" },
|
|
2220
2224
|
tooltip: { background: "rgba(0,10,0,0.95)", textColor: "#00ff41", borderColor: "rgba(0,255,65,0.2)" },
|
|
2221
|
-
typography: { fontFamily:
|
|
2222
|
-
fontUrl:
|
|
2225
|
+
typography: { fontFamily: Pi },
|
|
2226
|
+
fontUrl: Li,
|
|
2223
2227
|
chartGradient: ["#010a01", "#000000"]
|
|
2224
|
-
}),
|
|
2228
|
+
}), Ii = I({
|
|
2225
2229
|
name: "Lavender Mist",
|
|
2226
2230
|
background: "#f5f0f4",
|
|
2227
2231
|
candlestick: { upColor: "#6b8e5e", downColor: "#b85468" },
|
|
@@ -2243,8 +2247,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2243
2247
|
axis: { textColor: "#9a88a0" },
|
|
2244
2248
|
crosshair: { color: "rgba(150,130,155,0.2)", labelBackground: "#ebe4e8" },
|
|
2245
2249
|
tooltip: { background: "rgba(245,240,244,0.95)", textColor: "#3a3050", borderColor: "rgba(150,130,155,0.25)" },
|
|
2246
|
-
typography: { fontFamily:
|
|
2247
|
-
fontUrl:
|
|
2250
|
+
typography: { fontFamily: te },
|
|
2251
|
+
fontUrl: ee,
|
|
2248
2252
|
chartGradient: ["#f8f4f7", "#f5f0f4"]
|
|
2249
2253
|
}), Ai = I({
|
|
2250
2254
|
name: "Love",
|
|
@@ -2270,9 +2274,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2270
2274
|
crosshair: { color: "rgba(180,140,155,0.3)", labelBackground: "#f0dce2" },
|
|
2271
2275
|
axis: { textColor: "#b08898" },
|
|
2272
2276
|
tooltip: { background: "rgba(253,242,244,0.95)", textColor: "#4a3040", borderColor: "rgba(200,160,175,0.35)" },
|
|
2273
|
-
typography: { fontFamily:
|
|
2274
|
-
fontUrl:
|
|
2275
|
-
}),
|
|
2277
|
+
typography: { fontFamily: _t },
|
|
2278
|
+
fontUrl: qt
|
|
2279
|
+
}), Vi = I({
|
|
2276
2280
|
name: "Material Palenight",
|
|
2277
2281
|
description: "Material Design in moonlit hues",
|
|
2278
2282
|
background: "#292d3e",
|
|
@@ -2295,9 +2299,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2295
2299
|
crosshair: { color: "rgba(103,110,149,0.4)", labelBackground: "#34324a" },
|
|
2296
2300
|
axis: { textColor: "#676e95" },
|
|
2297
2301
|
tooltip: { background: "rgba(41,45,62,0.92)", textColor: "#a6accd", borderColor: "rgba(55,59,75,0.6)" },
|
|
2298
|
-
typography: { fontFamily:
|
|
2299
|
-
fontUrl:
|
|
2300
|
-
}),
|
|
2302
|
+
typography: { fontFamily: Se },
|
|
2303
|
+
fontUrl: ke
|
|
2304
|
+
}), Yi = "'Silkscreen', cursive", _i = "https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap", Ui = I({
|
|
2301
2305
|
name: "Monochrome",
|
|
2302
2306
|
description: "Pure black and white, pixel font",
|
|
2303
2307
|
background: "#ffffff",
|
|
@@ -2321,9 +2325,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2321
2325
|
crosshair: { color: "rgba(0,0,0,0.08)", labelBackground: "#f0f0f0" },
|
|
2322
2326
|
axis: { textColor: "#b0b0b0" },
|
|
2323
2327
|
tooltip: { background: "rgba(255,255,255,0.97)", textColor: "#222222", borderColor: "rgba(0,0,0,0.08)" },
|
|
2324
|
-
typography: { fontFamily:
|
|
2325
|
-
fontUrl:
|
|
2326
|
-
}),
|
|
2328
|
+
typography: { fontFamily: Yi, tooltipFontSize: 9 },
|
|
2329
|
+
fontUrl: _i
|
|
2330
|
+
}), Oi = I({
|
|
2327
2331
|
name: "Mint Breeze",
|
|
2328
2332
|
background: "#f6f5ee",
|
|
2329
2333
|
candlestick: { upColor: "#2e9070", downColor: "#d04848" },
|
|
@@ -2345,8 +2349,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2345
2349
|
axis: { textColor: "#80a098" },
|
|
2346
2350
|
crosshair: { color: "rgba(120,140,120,0.18)", labelBackground: "#ece8de" },
|
|
2347
2351
|
tooltip: { background: "rgba(246,245,238,0.95)", textColor: "#2a3530", borderColor: "rgba(130,140,115,0.2)" },
|
|
2348
|
-
typography: { fontFamily:
|
|
2349
|
-
fontUrl:
|
|
2352
|
+
typography: { fontFamily: Ci },
|
|
2353
|
+
fontUrl: wi,
|
|
2350
2354
|
chartGradient: ["#f8f7f0", "#f6f5ee"]
|
|
2351
2355
|
}), Ei = I({
|
|
2352
2356
|
name: "Monokai Pro",
|
|
@@ -2371,9 +2375,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2371
2375
|
crosshair: { color: "rgba(114,112,114,0.4)", labelBackground: "#403e42" },
|
|
2372
2376
|
axis: { textColor: "#727072" },
|
|
2373
2377
|
tooltip: { background: "rgba(45,42,46,0.92)", textColor: "#fcfcfa", borderColor: "rgba(64,60,62,0.6)" },
|
|
2374
|
-
typography: { fontFamily:
|
|
2375
|
-
fontUrl:
|
|
2376
|
-
}),
|
|
2378
|
+
typography: { fontFamily: Qt },
|
|
2379
|
+
fontUrl: Zt
|
|
2380
|
+
}), $i = I({
|
|
2377
2381
|
name: "Night Owl",
|
|
2378
2382
|
description: "Crafted for late-night coding",
|
|
2379
2383
|
background: "#011627",
|
|
@@ -2396,9 +2400,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2396
2400
|
crosshair: { color: "rgba(99,119,119,0.4)", labelBackground: "#1d3b53" },
|
|
2397
2401
|
axis: { textColor: "#495a5a" },
|
|
2398
2402
|
tooltip: { background: "rgba(1,22,39,0.92)", textColor: "#d6deeb", borderColor: "rgba(31,52,72,0.6)" },
|
|
2399
|
-
typography: { fontFamily:
|
|
2400
|
-
fontUrl:
|
|
2401
|
-
}),
|
|
2403
|
+
typography: { fontFamily: Vt },
|
|
2404
|
+
fontUrl: Yt
|
|
2405
|
+
}), Xi = I({
|
|
2402
2406
|
name: "One Dark Pro",
|
|
2403
2407
|
description: "Atom editor's iconic dark palette",
|
|
2404
2408
|
background: "#282c34",
|
|
@@ -2421,9 +2425,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2421
2425
|
crosshair: { color: "rgba(99,110,123,0.4)", labelBackground: "#3e4451" },
|
|
2422
2426
|
axis: { textColor: "#5c6370" },
|
|
2423
2427
|
tooltip: { background: "rgba(40,44,52,0.92)", textColor: "#abb2bf", borderColor: "rgba(59,64,72,0.6)" },
|
|
2424
|
-
typography: { fontFamily:
|
|
2425
|
-
fontUrl:
|
|
2426
|
-
}),
|
|
2428
|
+
typography: { fontFamily: Vt },
|
|
2429
|
+
fontUrl: Yt
|
|
2430
|
+
}), Hi = I({
|
|
2427
2431
|
name: "Panda",
|
|
2428
2432
|
description: "Playful neons on charcoal",
|
|
2429
2433
|
background: "#292a2b",
|
|
@@ -2446,9 +2450,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2446
2450
|
crosshair: { color: "rgba(117,117,117,0.4)", labelBackground: "#3a3a3c" },
|
|
2447
2451
|
axis: { textColor: "#757575" },
|
|
2448
2452
|
tooltip: { background: "rgba(41,42,43,0.92)", textColor: "#e6e6e6", borderColor: "rgba(58,58,60,0.6)" },
|
|
2449
|
-
typography: { fontFamily:
|
|
2450
|
-
fontUrl:
|
|
2451
|
-
}),
|
|
2453
|
+
typography: { fontFamily: Qt },
|
|
2454
|
+
fontUrl: Zt
|
|
2455
|
+
}), Gi = I({
|
|
2452
2456
|
name: "Peach Cream",
|
|
2453
2457
|
background: "#fef6f0",
|
|
2454
2458
|
candlestick: { upColor: "#5a9a68", downColor: "#d06848" },
|
|
@@ -2470,10 +2474,10 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2470
2474
|
axis: { textColor: "#b09080" },
|
|
2471
2475
|
crosshair: { color: "rgba(180,140,120,0.2)", labelBackground: "#f0e4d8" },
|
|
2472
2476
|
tooltip: { background: "rgba(254,246,240,0.95)", textColor: "#4a3028", borderColor: "rgba(180,140,120,0.25)" },
|
|
2473
|
-
typography: { fontFamily:
|
|
2474
|
-
fontUrl:
|
|
2477
|
+
typography: { fontFamily: te },
|
|
2478
|
+
fontUrl: ee,
|
|
2475
2479
|
chartGradient: ["#fff8f2", "#fef6f0"]
|
|
2476
|
-
}),
|
|
2480
|
+
}), Ni = I({
|
|
2477
2481
|
name: "Quiet Light",
|
|
2478
2482
|
description: "Subdued and easy on the eyes",
|
|
2479
2483
|
background: "#f5f5f5",
|
|
@@ -2496,9 +2500,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2496
2500
|
crosshair: { color: "rgba(170,170,170,0.3)", labelBackground: "#e8e8e8" },
|
|
2497
2501
|
axis: { textColor: "#aaaaaa" },
|
|
2498
2502
|
tooltip: { background: "rgba(245,245,245,0.95)", textColor: "#333333", borderColor: "rgba(200,200,200,0.5)" },
|
|
2499
|
-
typography: { fontFamily:
|
|
2500
|
-
fontUrl:
|
|
2501
|
-
}),
|
|
2503
|
+
typography: { fontFamily: te },
|
|
2504
|
+
fontUrl: ee
|
|
2505
|
+
}), ji = I({
|
|
2502
2506
|
name: "Rosé Pine Dawn",
|
|
2503
2507
|
description: "Dawn-inspired warm neutrals",
|
|
2504
2508
|
background: "#faf4ed",
|
|
@@ -2521,9 +2525,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2521
2525
|
crosshair: { color: "rgba(152,147,165,0.3)", labelBackground: "#f2e9e1" },
|
|
2522
2526
|
axis: { textColor: "#9893a5" },
|
|
2523
2527
|
tooltip: { background: "rgba(250,244,237,0.95)", textColor: "#575279", borderColor: "rgba(152,147,165,0.3)" },
|
|
2524
|
-
typography: { fontFamily:
|
|
2525
|
-
fontUrl:
|
|
2526
|
-
}),
|
|
2528
|
+
typography: { fontFamily: Me },
|
|
2529
|
+
fontUrl: Re
|
|
2530
|
+
}), Ji = I({
|
|
2527
2531
|
name: "Sand Dune",
|
|
2528
2532
|
background: "#f4f0e8",
|
|
2529
2533
|
candlestick: { upColor: "#5a8a50", downColor: "#b85040" },
|
|
@@ -2545,10 +2549,10 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2545
2549
|
axis: { textColor: "#9a8a70" },
|
|
2546
2550
|
crosshair: { color: "rgba(150,130,100,0.2)", labelBackground: "#e8e0d0" },
|
|
2547
2551
|
tooltip: { background: "rgba(244,240,232,0.95)", textColor: "#3a3020", borderColor: "rgba(150,130,100,0.3)" },
|
|
2548
|
-
typography: { fontFamily:
|
|
2549
|
-
fontUrl:
|
|
2552
|
+
typography: { fontFamily: Me },
|
|
2553
|
+
fontUrl: Re,
|
|
2550
2554
|
chartGradient: ["#f8f4ec", "#f4f0e8"]
|
|
2551
|
-
}),
|
|
2555
|
+
}), Ki = I({
|
|
2552
2556
|
name: "Solarized Light",
|
|
2553
2557
|
description: "Ethan Schoonover's precision palette",
|
|
2554
2558
|
background: "#fdf6e3",
|
|
@@ -2572,51 +2576,51 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2572
2576
|
crosshair: { color: "rgba(147,161,161,0.3)", labelBackground: "#eee8d5" },
|
|
2573
2577
|
axis: { textColor: "#93a1a1" },
|
|
2574
2578
|
tooltip: { background: "rgba(253,246,227,0.95)", textColor: "#586e75", borderColor: "rgba(238,232,213,0.6)" },
|
|
2575
|
-
typography: { fontFamily:
|
|
2576
|
-
fontUrl:
|
|
2577
|
-
}),
|
|
2578
|
-
Dracula:
|
|
2579
|
-
"One Dark Pro":
|
|
2579
|
+
typography: { fontFamily: Vt },
|
|
2580
|
+
fontUrl: Yt
|
|
2581
|
+
}), ve = {
|
|
2582
|
+
Dracula: Di,
|
|
2583
|
+
"One Dark Pro": Xi,
|
|
2580
2584
|
"Monokai Pro": Ei,
|
|
2581
|
-
"Night Owl":
|
|
2582
|
-
"Material Palenight":
|
|
2583
|
-
Gruvbox:
|
|
2584
|
-
Catppuccin:
|
|
2585
|
-
"Ayu Mirage":
|
|
2586
|
-
Panda:
|
|
2587
|
-
Andromeda:
|
|
2588
|
-
Matrix:
|
|
2589
|
-
Handwritten:
|
|
2590
|
-
"GitHub Light":
|
|
2591
|
-
"Solarized Light":
|
|
2592
|
-
"Rosé Pine Dawn":
|
|
2593
|
-
"Quiet Light":
|
|
2594
|
-
"Lavender Mist":
|
|
2595
|
-
"Mint Breeze":
|
|
2596
|
-
"Sand Dune":
|
|
2597
|
-
"Peach Cream":
|
|
2598
|
-
Monochrome:
|
|
2585
|
+
"Night Owl": $i,
|
|
2586
|
+
"Material Palenight": Vi,
|
|
2587
|
+
Gruvbox: zi,
|
|
2588
|
+
Catppuccin: Ti,
|
|
2589
|
+
"Ayu Mirage": Ri,
|
|
2590
|
+
Panda: Hi,
|
|
2591
|
+
Andromeda: Mi,
|
|
2592
|
+
Matrix: Wi,
|
|
2593
|
+
Handwritten: Fi,
|
|
2594
|
+
"GitHub Light": Bi,
|
|
2595
|
+
"Solarized Light": Ki,
|
|
2596
|
+
"Rosé Pine Dawn": ji,
|
|
2597
|
+
"Quiet Light": Ni,
|
|
2598
|
+
"Lavender Mist": Ii,
|
|
2599
|
+
"Mint Breeze": Oi,
|
|
2600
|
+
"Sand Dune": Ji,
|
|
2601
|
+
"Peach Cream": Gi,
|
|
2602
|
+
Monochrome: Ui,
|
|
2599
2603
|
Love: Ai
|
|
2600
2604
|
};
|
|
2601
|
-
function
|
|
2602
|
-
return
|
|
2605
|
+
function Co(r) {
|
|
2606
|
+
return ve[r] ?? ve["One Dark Pro"];
|
|
2603
2607
|
}
|
|
2604
|
-
const
|
|
2608
|
+
const Gt = xe(null);
|
|
2605
2609
|
function J() {
|
|
2606
|
-
const r = Gt
|
|
2610
|
+
const r = Nt(Gt);
|
|
2607
2611
|
if (!r)
|
|
2608
2612
|
throw new Error("useChartInstance must be used within <ChartContainer>");
|
|
2609
2613
|
return r;
|
|
2610
2614
|
}
|
|
2611
|
-
function
|
|
2615
|
+
function qi({ data: r, options: t, label: i, id: e, onSeriesId: a }) {
|
|
2612
2616
|
var n;
|
|
2613
|
-
const o = J(), s =
|
|
2614
|
-
return
|
|
2617
|
+
const o = J(), s = it(null);
|
|
2618
|
+
return ot(() => {
|
|
2615
2619
|
const l = o.addBarSeries({ ...t, label: i ?? (t == null ? void 0 : t.label), layers: r.length, id: e });
|
|
2616
2620
|
return s.current = l, a == null || a(l), () => {
|
|
2617
2621
|
o.removeSeries(l), s.current = null;
|
|
2618
2622
|
};
|
|
2619
|
-
}, [o, r.length, e]),
|
|
2623
|
+
}, [o, r.length, e]), ot(() => {
|
|
2620
2624
|
const l = s.current;
|
|
2621
2625
|
l && o.batch(() => {
|
|
2622
2626
|
for (let h = 0; h < r.length; h++)
|
|
@@ -2626,14 +2630,14 @@ function Ki({ data: r, options: t, label: i, id: e, onSeriesId: a }) {
|
|
|
2626
2630
|
s.current && t && o.updateSeriesOptions(s.current, t);
|
|
2627
2631
|
}, [o, (n = t == null ? void 0 : t.colors) == null ? void 0 : n.join(","), t == null ? void 0 : t.barWidthRatio, t == null ? void 0 : t.stacking]), null;
|
|
2628
2632
|
}
|
|
2629
|
-
function
|
|
2630
|
-
const a = J(), o =
|
|
2631
|
-
return
|
|
2633
|
+
function wo({ data: r, options: t, id: i, onSeriesId: e }) {
|
|
2634
|
+
const a = J(), o = it(null), s = it(0);
|
|
2635
|
+
return ot(() => {
|
|
2632
2636
|
const n = a.addCandlestickSeries({ ...t, id: i });
|
|
2633
2637
|
return o.current = n, e == null || e(n), () => {
|
|
2634
2638
|
a.removeSeries(n), o.current = null, s.current = 0;
|
|
2635
2639
|
};
|
|
2636
|
-
}, [a, i]),
|
|
2640
|
+
}, [a, i]), ot(() => {
|
|
2637
2641
|
const n = o.current;
|
|
2638
2642
|
if (!n) return;
|
|
2639
2643
|
if (r.length === 0) {
|
|
@@ -2661,19 +2665,19 @@ function Co({ data: r, options: t, id: i, onSeriesId: e }) {
|
|
|
2661
2665
|
t == null ? void 0 : t.candleGradient
|
|
2662
2666
|
]), null;
|
|
2663
2667
|
}
|
|
2664
|
-
const
|
|
2665
|
-
function
|
|
2666
|
-
const r =
|
|
2668
|
+
const ie = xe(null), ye = ie.Provider;
|
|
2669
|
+
function Qi() {
|
|
2670
|
+
const r = Nt(ie);
|
|
2667
2671
|
if (!r)
|
|
2668
2672
|
throw new Error("useTheme must be used within <ThemeProvider>");
|
|
2669
2673
|
return r;
|
|
2670
2674
|
}
|
|
2671
|
-
function
|
|
2672
|
-
return
|
|
2675
|
+
function Zi() {
|
|
2676
|
+
return Nt(ie);
|
|
2673
2677
|
}
|
|
2674
|
-
function
|
|
2675
|
-
const e = J(), a =
|
|
2676
|
-
|
|
2678
|
+
function to({ items: r, position: t = "bottom", mode: i = "toggle" }) {
|
|
2679
|
+
const e = J(), a = Qi(), [o, s] = Tt(/* @__PURE__ */ new Set()), [, n] = Tt(0);
|
|
2680
|
+
ot(() => {
|
|
2677
2681
|
const f = () => {
|
|
2678
2682
|
n((m) => m + 1), s(/* @__PURE__ */ new Set());
|
|
2679
2683
|
}, p = () => n((m) => m + 1);
|
|
@@ -2778,13 +2782,13 @@ function Zi({ items: r, position: t = "bottom", mode: i = "toggle" }) {
|
|
|
2778
2782
|
}
|
|
2779
2783
|
);
|
|
2780
2784
|
}
|
|
2781
|
-
function
|
|
2782
|
-
var
|
|
2783
|
-
const h =
|
|
2784
|
-
|
|
2785
|
+
function eo({ children: r, theme: t, axis: i, padding: e, gradient: a = !0, interactive: o, grid: s, style: n, className: l }) {
|
|
2786
|
+
var Y, P, $, X, Q, _, lt;
|
|
2787
|
+
const h = Zi(), d = t ?? h ?? void 0, g = it(null), f = it(null), [p, m] = Tt(0);
|
|
2788
|
+
ot(() => {
|
|
2785
2789
|
if (!g.current || f.current) return;
|
|
2786
|
-
const
|
|
2787
|
-
return i && (
|
|
2790
|
+
const U = {};
|
|
2791
|
+
return i && (U.axis = i), d && (U.theme = d), e && (U.padding = e), o !== void 0 && (U.interactive = o), s !== void 0 && (U.grid = s), f.current = new bi(g.current, U), m((O) => O + 1), () => {
|
|
2788
2792
|
const O = f.current;
|
|
2789
2793
|
f.current = null, setTimeout(() => {
|
|
2790
2794
|
f.current || O == null || O.destroy();
|
|
@@ -2794,7 +2798,7 @@ function to({ children: r, theme: t, axis: i, padding: e, gradient: a = !0, inte
|
|
|
2794
2798
|
f.current && d && f.current.setTheme(d);
|
|
2795
2799
|
}, [d]), j(() => {
|
|
2796
2800
|
f.current && i && f.current.setAxis(i);
|
|
2797
|
-
}, [(
|
|
2801
|
+
}, [(Y = i == null ? void 0 : i.y) == null ? void 0 : Y.width, (P = i == null ? void 0 : i.y) == null ? void 0 : P.min, ($ = i == null ? void 0 : i.y) == null ? void 0 : $.max, (X = i == null ? void 0 : i.y) == null ? void 0 : X.visible, (Q = i == null ? void 0 : i.x) == null ? void 0 : Q.height, (_ = i == null ? void 0 : i.x) == null ? void 0 : _.visible]), j(() => {
|
|
2798
2802
|
f.current && e && f.current.setPadding(e);
|
|
2799
2803
|
}, [
|
|
2800
2804
|
e == null ? void 0 : e.top,
|
|
@@ -2805,12 +2809,12 @@ function to({ children: r, theme: t, axis: i, padding: e, gradient: a = !0, inte
|
|
|
2805
2809
|
f.current && s !== void 0 && f.current.setGrid(s);
|
|
2806
2810
|
}, [s]);
|
|
2807
2811
|
const b = f.current, { legendEl: u, overlay: v } = (() => {
|
|
2808
|
-
let
|
|
2812
|
+
let U = null;
|
|
2809
2813
|
const O = [];
|
|
2810
|
-
return
|
|
2811
|
-
|
|
2812
|
-
}), { legendEl:
|
|
2813
|
-
})(), x = (((
|
|
2814
|
+
return _e.forEach(r, (Z) => {
|
|
2815
|
+
Ue(Z) && Z.type === to ? U = Z : O.push(Z);
|
|
2816
|
+
}), { legendEl: U, overlay: O };
|
|
2817
|
+
})(), x = (((lt = u == null ? void 0 : u.props) == null ? void 0 : lt.position) ?? "bottom") === "right", C = d ?? (b == null ? void 0 : b.getTheme()), [T, k] = (C == null ? void 0 : C.chartGradient) ?? ["transparent", "transparent"], D = (C == null ? void 0 : C.background) ?? "transparent", z = a ? `linear-gradient(to bottom, ${T} 0%, ${D} 70%, ${k} 100%)` : D;
|
|
2814
2818
|
return /* @__PURE__ */ F(
|
|
2815
2819
|
"div",
|
|
2816
2820
|
{
|
|
@@ -2836,7 +2840,7 @@ function to({ children: r, theme: t, axis: i, padding: e, gradient: a = !0, inte
|
|
|
2836
2840
|
minHeight: 0,
|
|
2837
2841
|
overflow: "hidden"
|
|
2838
2842
|
},
|
|
2839
|
-
children: b && /* @__PURE__ */ S(
|
|
2843
|
+
children: b && /* @__PURE__ */ S(Gt.Provider, { value: b, children: /* @__PURE__ */ S(ye, { value: d ?? b.getTheme(), children: /* @__PURE__ */ S(
|
|
2840
2844
|
"div",
|
|
2841
2845
|
{
|
|
2842
2846
|
style: {
|
|
@@ -2850,20 +2854,20 @@ function to({ children: r, theme: t, axis: i, padding: e, gradient: a = !0, inte
|
|
|
2850
2854
|
) }) })
|
|
2851
2855
|
}
|
|
2852
2856
|
),
|
|
2853
|
-
b && u && /* @__PURE__ */ S(
|
|
2857
|
+
b && u && /* @__PURE__ */ S(Gt.Provider, { value: b, children: /* @__PURE__ */ S(ye, { value: d ?? b.getTheme(), children: u }) })
|
|
2854
2858
|
]
|
|
2855
2859
|
}
|
|
2856
2860
|
);
|
|
2857
2861
|
}
|
|
2858
|
-
function
|
|
2862
|
+
function io({ data: r, options: t, label: i, id: e, onSeriesId: a }) {
|
|
2859
2863
|
var n;
|
|
2860
|
-
const o = J(), s =
|
|
2861
|
-
return
|
|
2864
|
+
const o = J(), s = it(null);
|
|
2865
|
+
return ot(() => {
|
|
2862
2866
|
const l = o.addLineSeries({ ...t, label: i ?? (t == null ? void 0 : t.label), layers: r.length, id: e });
|
|
2863
2867
|
return s.current = l, a == null || a(l), () => {
|
|
2864
2868
|
o.removeSeries(l), s.current = null;
|
|
2865
2869
|
};
|
|
2866
|
-
}, [o, r.length, e]),
|
|
2870
|
+
}, [o, r.length, e]), ot(() => {
|
|
2867
2871
|
const l = s.current;
|
|
2868
2872
|
l && o.batch(() => {
|
|
2869
2873
|
for (let h = 0; h < r.length; h++)
|
|
@@ -2873,9 +2877,9 @@ function eo({ data: r, options: t, label: i, id: e, onSeriesId: a }) {
|
|
|
2873
2877
|
s.current && t && o.updateSeriesOptions(s.current, t);
|
|
2874
2878
|
}, [o, (n = t == null ? void 0 : t.colors) == null ? void 0 : n.join(","), t == null ? void 0 : t.lineWidth, t == null ? void 0 : t.areaFill, t == null ? void 0 : t.pulse, t == null ? void 0 : t.stacking]), null;
|
|
2875
2879
|
}
|
|
2876
|
-
function
|
|
2877
|
-
const a = J(), o =
|
|
2878
|
-
return
|
|
2880
|
+
function So({ data: r, options: t, id: i, onSeriesId: e }) {
|
|
2881
|
+
const a = J(), o = it(null);
|
|
2882
|
+
return ot(() => {
|
|
2879
2883
|
const s = a.addPieSeries({ ...t, id: i });
|
|
2880
2884
|
return o.current = s, e == null || e(s), () => {
|
|
2881
2885
|
a.removeSeries(s), o.current = null;
|
|
@@ -2889,11 +2893,11 @@ function wo({ data: r, options: t, id: i, onSeriesId: e }) {
|
|
|
2889
2893
|
t == null ? void 0 : t.strokeColor,
|
|
2890
2894
|
t == null ? void 0 : t.strokeWidth,
|
|
2891
2895
|
t == null ? void 0 : t.colors
|
|
2892
|
-
]),
|
|
2896
|
+
]), ot(() => {
|
|
2893
2897
|
o.current && a.setPieData(o.current, r);
|
|
2894
2898
|
}, [a, r]), null;
|
|
2895
2899
|
}
|
|
2896
|
-
function
|
|
2900
|
+
function Ut(r, t, i) {
|
|
2897
2901
|
const e = Array.isArray(t) ? t : [t];
|
|
2898
2902
|
return {
|
|
2899
2903
|
subscribe: (a) => {
|
|
@@ -2905,16 +2909,16 @@ function _t(r, t, i) {
|
|
|
2905
2909
|
getSnapshot: i
|
|
2906
2910
|
};
|
|
2907
2911
|
}
|
|
2908
|
-
function io(r) {
|
|
2909
|
-
const t = dt(() => _t(r, ["viewportChange", "dataUpdate", "seriesChange"], () => r.getVisibleRange()), [r]);
|
|
2910
|
-
return Tt(t.subscribe, t.getSnapshot);
|
|
2911
|
-
}
|
|
2912
2912
|
function oo(r) {
|
|
2913
|
-
const t =
|
|
2914
|
-
return
|
|
2913
|
+
const t = ut(() => Ut(r, ["viewportChange", "dataUpdate", "seriesChange"], () => r.getVisibleRange()), [r]);
|
|
2914
|
+
return Dt(t.subscribe, t.getSnapshot);
|
|
2915
2915
|
}
|
|
2916
|
-
function ro(r
|
|
2917
|
-
const
|
|
2916
|
+
function ro(r) {
|
|
2917
|
+
const t = ut(() => Ut(r, ["viewportChange", "dataUpdate", "seriesChange"], () => r.getYRange()), [r]);
|
|
2918
|
+
return Dt(t.subscribe, t.getSnapshot);
|
|
2919
|
+
}
|
|
2920
|
+
function ao(r, t) {
|
|
2921
|
+
const i = ut(() => {
|
|
2918
2922
|
let e = r.getLastValue(t);
|
|
2919
2923
|
return {
|
|
2920
2924
|
subscribe: (o) => {
|
|
@@ -2932,21 +2936,21 @@ function ro(r, t) {
|
|
|
2932
2936
|
getSnapshot: () => e
|
|
2933
2937
|
};
|
|
2934
2938
|
}, [r, t]);
|
|
2935
|
-
return
|
|
2939
|
+
return Dt(i.subscribe, i.getSnapshot);
|
|
2936
2940
|
}
|
|
2937
|
-
function
|
|
2938
|
-
const i =
|
|
2939
|
-
() =>
|
|
2941
|
+
function so(r, t) {
|
|
2942
|
+
const i = ut(
|
|
2943
|
+
() => Ut(r, "dataUpdate", () => r.getPreviousClose(t)),
|
|
2940
2944
|
[r, t]
|
|
2941
2945
|
);
|
|
2942
|
-
return
|
|
2946
|
+
return Dt(i.subscribe, i.getSnapshot);
|
|
2943
2947
|
}
|
|
2944
|
-
function
|
|
2945
|
-
const t =
|
|
2946
|
-
return
|
|
2948
|
+
function oe(r) {
|
|
2949
|
+
const t = ut(() => Ut(r, "crosshairMove", () => r.getCrosshairPosition()), [r]);
|
|
2950
|
+
return Dt(t.subscribe, t.getSnapshot);
|
|
2947
2951
|
}
|
|
2948
|
-
function
|
|
2949
|
-
const r = J(), t =
|
|
2952
|
+
function ko() {
|
|
2953
|
+
const r = J(), t = oe(r);
|
|
2950
2954
|
if (!t) return null;
|
|
2951
2955
|
const i = r.getTheme(), e = r.getDataInterval(), a = {
|
|
2952
2956
|
background: i.crosshair.labelBackground,
|
|
@@ -2958,7 +2962,7 @@ function So() {
|
|
|
2958
2962
|
whiteSpace: "nowrap",
|
|
2959
2963
|
pointerEvents: "none"
|
|
2960
2964
|
};
|
|
2961
|
-
return /* @__PURE__ */ F(
|
|
2965
|
+
return /* @__PURE__ */ F(Bt, { children: [
|
|
2962
2966
|
/* @__PURE__ */ S(
|
|
2963
2967
|
"div",
|
|
2964
2968
|
{
|
|
@@ -2987,15 +2991,15 @@ function So() {
|
|
|
2987
2991
|
)
|
|
2988
2992
|
] });
|
|
2989
2993
|
}
|
|
2990
|
-
const
|
|
2991
|
-
function
|
|
2994
|
+
const no = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
2995
|
+
function lo(r) {
|
|
2992
2996
|
const t = [];
|
|
2993
2997
|
for (const i of r)
|
|
2994
2998
|
i >= "0" && i <= "9" ? t.push({ type: "digit", value: i }) : t.push({ type: "symbol", value: i });
|
|
2995
2999
|
return t;
|
|
2996
3000
|
}
|
|
2997
|
-
function
|
|
2998
|
-
const n =
|
|
3001
|
+
function co({ value: r, format: t, locale: i = "en-US", spinDuration: e = 350, className: a, style: o }) {
|
|
3002
|
+
const n = ut(() => new Intl.NumberFormat(i, t), [i, t]).format(r), l = lo(n);
|
|
2999
3003
|
return /* @__PURE__ */ S(
|
|
3000
3004
|
"span",
|
|
3001
3005
|
{
|
|
@@ -3007,13 +3011,13 @@ function lo({ value: r, format: t, locale: i = "en-US", spinDuration: e = 350, c
|
|
|
3007
3011
|
...o
|
|
3008
3012
|
},
|
|
3009
3013
|
children: l.map(
|
|
3010
|
-
(h, d) => h.type === "digit" ? /* @__PURE__ */ S(
|
|
3014
|
+
(h, d) => h.type === "digit" ? /* @__PURE__ */ S(ho, { digit: parseInt(h.value), duration: e }, `d${d}`) : /* @__PURE__ */ S("span", { style: { display: "inline-block" }, children: h.value }, `s${d}`)
|
|
3011
3015
|
)
|
|
3012
3016
|
}
|
|
3013
3017
|
);
|
|
3014
3018
|
}
|
|
3015
|
-
function
|
|
3016
|
-
const i =
|
|
3019
|
+
function ho({ digit: r, duration: t }) {
|
|
3020
|
+
const i = it(!1);
|
|
3017
3021
|
return j(() => {
|
|
3018
3022
|
i.current = !0;
|
|
3019
3023
|
}, []), /* @__PURE__ */ S(
|
|
@@ -3034,7 +3038,7 @@ function co({ digit: r, duration: t }) {
|
|
|
3034
3038
|
transform: `translateY(${-r * 1.2}em)`,
|
|
3035
3039
|
transition: i.current ? `transform ${t}ms cubic-bezier(0.16, 1, 0.3, 1)` : "none"
|
|
3036
3040
|
},
|
|
3037
|
-
children:
|
|
3041
|
+
children: no.map((e) => /* @__PURE__ */ S(
|
|
3038
3042
|
"span",
|
|
3039
3043
|
{
|
|
3040
3044
|
style: {
|
|
@@ -3052,11 +3056,11 @@ function co({ digit: r, duration: t }) {
|
|
|
3052
3056
|
}
|
|
3053
3057
|
);
|
|
3054
3058
|
}
|
|
3055
|
-
function
|
|
3059
|
+
function uo(r) {
|
|
3056
3060
|
return r >= 1e9 ? (r / 1e9).toFixed(1) + "B" : r >= 1e6 ? (r / 1e6).toFixed(1) + "M" : r >= 1e3 ? (r / 1e3).toFixed(1) + "K" : r.toLocaleString();
|
|
3057
3061
|
}
|
|
3058
|
-
function
|
|
3059
|
-
const i = J(), e = i.getTheme(), [, a] =
|
|
3062
|
+
function Mo({ seriesId: r, format: t = "value" }) {
|
|
3063
|
+
const i = J(), e = i.getTheme(), [, a] = Tt(0);
|
|
3060
3064
|
j(() => {
|
|
3061
3065
|
const s = () => a((n) => n + 1);
|
|
3062
3066
|
return i.on("dataUpdate", s), () => {
|
|
@@ -3099,7 +3103,7 @@ function ko({ seriesId: r, format: t = "value" }) {
|
|
|
3099
3103
|
}
|
|
3100
3104
|
),
|
|
3101
3105
|
/* @__PURE__ */ S("span", { style: { flex: 1, opacity: 0.8 }, children: s.label }),
|
|
3102
|
-
t === "value" && /* @__PURE__ */ S("span", { style: { fontWeight: 600, fontVariantNumeric: "tabular-nums" }, children:
|
|
3106
|
+
t === "value" && /* @__PURE__ */ S("span", { style: { fontWeight: 600, fontVariantNumeric: "tabular-nums" }, children: uo(s.value) }),
|
|
3103
3107
|
/* @__PURE__ */ F(
|
|
3104
3108
|
"span",
|
|
3105
3109
|
{
|
|
@@ -3124,8 +3128,8 @@ function ko({ seriesId: r, format: t = "value" }) {
|
|
|
3124
3128
|
}
|
|
3125
3129
|
);
|
|
3126
3130
|
}
|
|
3127
|
-
function
|
|
3128
|
-
const t = J(), i =
|
|
3131
|
+
function Ro({ seriesId: r }) {
|
|
3132
|
+
const t = J(), i = oe(t), e = t.getPieHoverInfo(r);
|
|
3129
3133
|
if (!e || !i) return null;
|
|
3130
3134
|
const a = t.getTheme(), o = t.getMediaSize(), s = 160, n = 70, l = 16, h = 16, d = i.mediaX + l + s > o.width ? i.mediaX - l - s : i.mediaX + l, g = i.mediaY + h + n > o.height ? i.mediaY - h - n : i.mediaY + h;
|
|
3131
3135
|
return /* @__PURE__ */ F(
|
|
@@ -3178,25 +3182,25 @@ function Mo({ seriesId: r }) {
|
|
|
3178
3182
|
}
|
|
3179
3183
|
);
|
|
3180
3184
|
}
|
|
3181
|
-
function
|
|
3185
|
+
function fo(r, t) {
|
|
3182
3186
|
if (r.startsWith("rgba") || !r.startsWith("#")) return r;
|
|
3183
3187
|
const i = parseInt(r.slice(1, 3), 16), e = parseInt(r.slice(3, 5), 16), a = parseInt(r.slice(5, 7), 16);
|
|
3184
3188
|
return `rgba(${i}, ${e}, ${a}, ${t})`;
|
|
3185
3189
|
}
|
|
3186
|
-
function
|
|
3190
|
+
function go(r) {
|
|
3187
3191
|
return Math.abs(r) >= 1e6 ? `${(r / 1e6).toFixed(1)}M` : Math.abs(r) >= 1e4 ? `${(r / 1e3).toFixed(1)}K` : Math.abs(r) >= 1e3 ? `${(r / 1e3).toFixed(2)}K` : Math.abs(r) < 1 ? r.toFixed(4) : Math.abs(r) < 10 ? r.toFixed(2) : r.toFixed(1);
|
|
3188
3192
|
}
|
|
3189
|
-
function
|
|
3193
|
+
function po(r) {
|
|
3190
3194
|
if (r.length < 2) return { value: 0, pct: 0, positive: !0 };
|
|
3191
3195
|
const t = r[0].value, e = r[r.length - 1].value - t, a = t !== 0 ? e / t * 100 : 0;
|
|
3192
3196
|
return { value: e, pct: a, positive: e >= 0 };
|
|
3193
3197
|
}
|
|
3194
|
-
function
|
|
3198
|
+
function To({
|
|
3195
3199
|
data: r,
|
|
3196
3200
|
theme: t,
|
|
3197
3201
|
variant: i = "line",
|
|
3198
3202
|
valuePosition: e = "right",
|
|
3199
|
-
formatValue: a =
|
|
3203
|
+
formatValue: a = go,
|
|
3200
3204
|
label: o,
|
|
3201
3205
|
sublabel: s,
|
|
3202
3206
|
color: n,
|
|
@@ -3208,7 +3212,7 @@ function Ro({
|
|
|
3208
3212
|
gradient: p = !0,
|
|
3209
3213
|
style: m
|
|
3210
3214
|
}) {
|
|
3211
|
-
const b = r.length > 0 ? r[r.length - 1].value : 0, u =
|
|
3215
|
+
const b = r.length > 0 ? r[r.length - 1].value : 0, u = ut(() => po(r), [r]), v = n ?? t.seriesColors[0], y = l ?? t.candlestick.downColor, x = u.positive ? t.candlestick.upColor : t.candlestick.downColor, C = e !== "none" && /* @__PURE__ */ F(
|
|
3212
3216
|
"div",
|
|
3213
3217
|
{
|
|
3214
3218
|
style: {
|
|
@@ -3280,7 +3284,7 @@ function Ro({
|
|
|
3280
3284
|
]
|
|
3281
3285
|
}
|
|
3282
3286
|
), T = /* @__PURE__ */ S("div", { style: { width: d, height: g, flexShrink: 0, borderRadius: 4, overflow: "hidden" }, children: /* @__PURE__ */ S(
|
|
3283
|
-
|
|
3287
|
+
eo,
|
|
3284
3288
|
{
|
|
3285
3289
|
theme: t,
|
|
3286
3290
|
axis: {
|
|
@@ -3292,7 +3296,7 @@ function Ro({
|
|
|
3292
3296
|
interactive: !1,
|
|
3293
3297
|
grid: !1,
|
|
3294
3298
|
children: i === "line" ? /* @__PURE__ */ S(
|
|
3295
|
-
|
|
3299
|
+
io,
|
|
3296
3300
|
{
|
|
3297
3301
|
data: [r],
|
|
3298
3302
|
options: {
|
|
@@ -3304,7 +3308,7 @@ function Ro({
|
|
|
3304
3308
|
}
|
|
3305
3309
|
}
|
|
3306
3310
|
) : /* @__PURE__ */ S(
|
|
3307
|
-
|
|
3311
|
+
qi,
|
|
3308
3312
|
{
|
|
3309
3313
|
data: [r],
|
|
3310
3314
|
options: {
|
|
@@ -3325,7 +3329,7 @@ function Ro({
|
|
|
3325
3329
|
gap: 12,
|
|
3326
3330
|
padding: "8px 12px",
|
|
3327
3331
|
borderRadius: 8,
|
|
3328
|
-
background:
|
|
3332
|
+
background: fo(t.tooltip.background, 0.7),
|
|
3329
3333
|
border: `1px solid ${t.tooltip.borderColor}`,
|
|
3330
3334
|
fontFamily: t.typography.fontFamily,
|
|
3331
3335
|
...m
|
|
@@ -3338,10 +3342,10 @@ function Ro({
|
|
|
3338
3342
|
}
|
|
3339
3343
|
);
|
|
3340
3344
|
}
|
|
3341
|
-
function
|
|
3345
|
+
function Do() {
|
|
3342
3346
|
const r = J();
|
|
3343
|
-
|
|
3344
|
-
const t = r.getTheme(), i = r.getDataInterval(), { ticks: e, tickInterval: a } = r.timeScale.niceTickValues(i), o = new Set(e), n =
|
|
3347
|
+
oo(r);
|
|
3348
|
+
const t = r.getTheme(), i = r.getDataInterval(), { ticks: e, tickInterval: a } = r.timeScale.niceTickValues(i), o = new Set(e), n = it(/* @__PURE__ */ new Map()).current, l = performance.now();
|
|
3345
3349
|
for (const d of e)
|
|
3346
3350
|
n.has(d) ? n.get(d).opacity = 1 : n.set(d, { opacity: 1, addedAt: l });
|
|
3347
3351
|
for (const [d, g] of n)
|
|
@@ -3388,14 +3392,14 @@ function To() {
|
|
|
3388
3392
|
}
|
|
3389
3393
|
);
|
|
3390
3394
|
}
|
|
3391
|
-
function
|
|
3395
|
+
function mo(r, t) {
|
|
3392
3396
|
return t === "none" || r.length <= 1 ? r : [...r].sort((i, e) => {
|
|
3393
3397
|
const a = "value" in i.data ? i.data.value : i.data.close, o = "value" in e.data ? e.data.value : e.data.close;
|
|
3394
3398
|
return t === "asc" ? a - o : o - a;
|
|
3395
3399
|
});
|
|
3396
3400
|
}
|
|
3397
|
-
function
|
|
3398
|
-
const a = i ?? e ?? !0, o = J(), s =
|
|
3401
|
+
function Bo({ seriesId: r, sort: t = "none", showLegend: i, legend: e }) {
|
|
3402
|
+
const a = i ?? e ?? !0, o = J(), s = oe(o), n = r ? [r] : o.getSeriesIds(), [, l] = Tt(0);
|
|
3399
3403
|
j(() => {
|
|
3400
3404
|
const u = () => l((v) => v + 1);
|
|
3401
3405
|
return o.on("dataUpdate", u), () => o.off("dataUpdate", u);
|
|
@@ -3444,10 +3448,10 @@ function Do({ seriesId: r, sort: t = "none", showLegend: i, legend: e }) {
|
|
|
3444
3448
|
}
|
|
3445
3449
|
d = u;
|
|
3446
3450
|
}
|
|
3447
|
-
const g =
|
|
3451
|
+
const g = mo(d, t), f = o.getTheme();
|
|
3448
3452
|
if (g.length === 0) return null;
|
|
3449
3453
|
const p = o.getDataInterval(), m = o.getMediaSize(), b = g[0].data.time;
|
|
3450
|
-
return /* @__PURE__ */ F(
|
|
3454
|
+
return /* @__PURE__ */ F(Bt, { children: [
|
|
3451
3455
|
a && /* @__PURE__ */ F(
|
|
3452
3456
|
"div",
|
|
3453
3457
|
{
|
|
@@ -3473,12 +3477,12 @@ function Do({ seriesId: r, sort: t = "none", showLegend: i, legend: e }) {
|
|
|
3473
3477
|
if ("open" in u.data) {
|
|
3474
3478
|
const x = u.data, T = x.close >= x.open ? f.candlestick.upColor : f.candlestick.downColor;
|
|
3475
3479
|
return /* @__PURE__ */ F("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
|
|
3476
|
-
/* @__PURE__ */ S(
|
|
3477
|
-
/* @__PURE__ */ S(
|
|
3478
|
-
/* @__PURE__ */ S(
|
|
3479
|
-
/* @__PURE__ */ S(
|
|
3480
|
+
/* @__PURE__ */ S(Ct, { label: "O", value: x.open, color: T, dim: f.axis.textColor }),
|
|
3481
|
+
/* @__PURE__ */ S(Ct, { label: "H", value: x.high, color: T, dim: f.axis.textColor }),
|
|
3482
|
+
/* @__PURE__ */ S(Ct, { label: "L", value: x.low, color: T, dim: f.axis.textColor }),
|
|
3483
|
+
/* @__PURE__ */ S(Ct, { label: "C", value: x.close, color: T, dim: f.axis.textColor }),
|
|
3480
3484
|
x.volume != null && /* @__PURE__ */ S(
|
|
3481
|
-
|
|
3485
|
+
Ct,
|
|
3482
3486
|
{
|
|
3483
3487
|
label: "V",
|
|
3484
3488
|
value: x.volume,
|
|
@@ -3510,7 +3514,7 @@ function Do({ seriesId: r, sort: t = "none", showLegend: i, legend: e }) {
|
|
|
3510
3514
|
}
|
|
3511
3515
|
),
|
|
3512
3516
|
s && h.length > 0 && /* @__PURE__ */ S(
|
|
3513
|
-
|
|
3517
|
+
bo,
|
|
3514
3518
|
{
|
|
3515
3519
|
snapshots: g,
|
|
3516
3520
|
x: s.mediaX,
|
|
@@ -3523,19 +3527,19 @@ function Do({ seriesId: r, sort: t = "none", showLegend: i, legend: e }) {
|
|
|
3523
3527
|
)
|
|
3524
3528
|
] });
|
|
3525
3529
|
}
|
|
3526
|
-
function
|
|
3530
|
+
function Ct({
|
|
3527
3531
|
label: r,
|
|
3528
3532
|
value: t,
|
|
3529
3533
|
color: i,
|
|
3530
3534
|
dim: e,
|
|
3531
3535
|
volume: a
|
|
3532
3536
|
}) {
|
|
3533
|
-
return /* @__PURE__ */ F(
|
|
3537
|
+
return /* @__PURE__ */ F(Bt, { children: [
|
|
3534
3538
|
/* @__PURE__ */ S("span", { style: { color: e, opacity: 0.5, marginLeft: 5 }, children: r }),
|
|
3535
|
-
/* @__PURE__ */ S("span", { style: { color: i, fontWeight: 500, marginLeft: 2 }, children: a ?
|
|
3539
|
+
/* @__PURE__ */ S("span", { style: { color: i, fontWeight: 500, marginLeft: 2 }, children: a ? Te(t) : t.toFixed(2) })
|
|
3536
3540
|
] });
|
|
3537
3541
|
}
|
|
3538
|
-
function
|
|
3542
|
+
function bo({
|
|
3539
3543
|
snapshots: r,
|
|
3540
3544
|
x: t,
|
|
3541
3545
|
y: i,
|
|
@@ -3581,7 +3585,7 @@ function mo({
|
|
|
3581
3585
|
letterSpacing: "0.02em"
|
|
3582
3586
|
},
|
|
3583
3587
|
children: [
|
|
3584
|
-
|
|
3588
|
+
Ze(y),
|
|
3585
3589
|
" ",
|
|
3586
3590
|
At(y, s)
|
|
3587
3591
|
]
|
|
@@ -3589,13 +3593,13 @@ function mo({
|
|
|
3589
3593
|
),
|
|
3590
3594
|
r.map((x) => {
|
|
3591
3595
|
if ("open" in x.data) {
|
|
3592
|
-
const k = x.data, D = k.close >= k.open, z = o.candlestick.upColor,
|
|
3596
|
+
const k = x.data, D = k.close >= k.open, z = o.candlestick.upColor, Y = o.candlestick.downColor, P = D ? z : Y;
|
|
3593
3597
|
return /* @__PURE__ */ F("div", { style: { display: "grid", gridTemplateColumns: "auto 1fr", gap: "4px 12px" }, children: [
|
|
3594
|
-
/* @__PURE__ */ S(
|
|
3595
|
-
/* @__PURE__ */ S(
|
|
3596
|
-
/* @__PURE__ */ S(
|
|
3597
|
-
/* @__PURE__ */ S(
|
|
3598
|
-
k.volume != null && /* @__PURE__ */ S(
|
|
3598
|
+
/* @__PURE__ */ S(wt, { label: "Open", value: k.open, color: P }),
|
|
3599
|
+
/* @__PURE__ */ S(wt, { label: "High", value: k.high, color: P }),
|
|
3600
|
+
/* @__PURE__ */ S(wt, { label: "Low", value: k.low, color: P }),
|
|
3601
|
+
/* @__PURE__ */ S(wt, { label: "Close", value: k.close, color: P }),
|
|
3602
|
+
k.volume != null && /* @__PURE__ */ S(wt, { label: "Volume", value: k.volume, color: o.tooltip.textColor, volume: !0 })
|
|
3599
3603
|
] }, x.id);
|
|
3600
3604
|
}
|
|
3601
3605
|
const T = x.data;
|
|
@@ -3620,24 +3624,24 @@ function mo({
|
|
|
3620
3624
|
}
|
|
3621
3625
|
);
|
|
3622
3626
|
}
|
|
3623
|
-
function
|
|
3627
|
+
function wt({
|
|
3624
3628
|
label: r,
|
|
3625
3629
|
value: t,
|
|
3626
3630
|
color: i,
|
|
3627
3631
|
volume: e
|
|
3628
3632
|
}) {
|
|
3629
|
-
return /* @__PURE__ */ F(
|
|
3633
|
+
return /* @__PURE__ */ F(Bt, { children: [
|
|
3630
3634
|
/* @__PURE__ */ S("span", { style: { opacity: 0.5 }, children: r }),
|
|
3631
|
-
/* @__PURE__ */ S("span", { style: { fontWeight: 600, color: i, textAlign: "right" }, children: e ?
|
|
3635
|
+
/* @__PURE__ */ S("span", { style: { fontWeight: 600, color: i, textAlign: "right" }, children: e ? Te(t) : t.toFixed(2) })
|
|
3632
3636
|
] });
|
|
3633
3637
|
}
|
|
3634
|
-
function
|
|
3638
|
+
function Te(r) {
|
|
3635
3639
|
return r >= 1e9 ? (r / 1e9).toFixed(2) + "B" : r >= 1e6 ? (r / 1e6).toFixed(2) + "M" : r >= 1e3 ? (r / 1e3).toFixed(1) + "K" : r.toFixed(0);
|
|
3636
3640
|
}
|
|
3637
|
-
function
|
|
3641
|
+
function zo() {
|
|
3638
3642
|
const r = J();
|
|
3639
|
-
|
|
3640
|
-
const t = r.getTheme(), i = r.yScale.niceTickValues(), e = new Set(i), o =
|
|
3643
|
+
ro(r);
|
|
3644
|
+
const t = r.getTheme(), i = r.yScale.niceTickValues(), e = new Set(i), o = it(/* @__PURE__ */ new Map()).current, s = performance.now();
|
|
3641
3645
|
for (const l of i)
|
|
3642
3646
|
o.has(l) ? o.get(l).opacity = 1 : o.set(l, { opacity: 1, addedAt: s });
|
|
3643
3647
|
for (const [l, h] of o)
|
|
@@ -3683,10 +3687,10 @@ function Bo() {
|
|
|
3683
3687
|
}
|
|
3684
3688
|
);
|
|
3685
3689
|
}
|
|
3686
|
-
function
|
|
3690
|
+
function Fo({ seriesId: r, color: t }) {
|
|
3687
3691
|
const i = J();
|
|
3688
3692
|
j(() => (i.setYLabel(!0), () => i.setYLabel(!1)), [i]);
|
|
3689
|
-
const e =
|
|
3693
|
+
const e = ao(i, r), a = so(i, r);
|
|
3690
3694
|
if (!e) return null;
|
|
3691
3695
|
const { value: o, isLive: s } = e, n = i.getTheme(), l = i.yScale.valueToY(o);
|
|
3692
3696
|
let h;
|
|
@@ -3699,7 +3703,7 @@ function zo({ seriesId: r, color: t }) {
|
|
|
3699
3703
|
h = p === "up" ? n.yLabel.upBackground : p === "down" ? n.yLabel.downBackground : n.yLabel.neutralBackground;
|
|
3700
3704
|
}
|
|
3701
3705
|
const d = i.yScale.getRange(), g = d.max - d.min, f = g < 0.1 ? 6 : g < 10 ? 4 : g < 1e3 ? 2 : 0;
|
|
3702
|
-
return /* @__PURE__ */ F(
|
|
3706
|
+
return /* @__PURE__ */ F(Bt, { children: [
|
|
3703
3707
|
/* @__PURE__ */ S(
|
|
3704
3708
|
"div",
|
|
3705
3709
|
{
|
|
@@ -3736,7 +3740,7 @@ function zo({ seriesId: r, color: t }) {
|
|
|
3736
3740
|
transition: "background-color 0.3s ease"
|
|
3737
3741
|
},
|
|
3738
3742
|
children: /* @__PURE__ */ S(
|
|
3739
|
-
|
|
3743
|
+
co,
|
|
3740
3744
|
{
|
|
3741
3745
|
value: o,
|
|
3742
3746
|
format: { minimumFractionDigits: f, maximumFractionDigits: f, useGrouping: !1 },
|
|
@@ -3748,60 +3752,60 @@ function zo({ seriesId: r, color: t }) {
|
|
|
3748
3752
|
] });
|
|
3749
3753
|
}
|
|
3750
3754
|
export {
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3755
|
+
qi as BarSeries,
|
|
3756
|
+
wo as CandlestickSeries,
|
|
3757
|
+
eo as ChartContainer,
|
|
3758
|
+
bi as ChartInstance,
|
|
3759
|
+
ko as Crosshair,
|
|
3760
|
+
to as Legend,
|
|
3761
|
+
io as LineSeries,
|
|
3762
|
+
co as NumberFlow,
|
|
3763
|
+
Mo as PieLegend,
|
|
3764
|
+
So as PieSeries,
|
|
3765
|
+
Ro as PieTooltip,
|
|
3766
|
+
To as Sparkline,
|
|
3767
|
+
ye as ThemeProvider,
|
|
3768
|
+
Do as TimeAxis,
|
|
3769
|
+
Bo as Tooltip,
|
|
3770
|
+
Do as XAxis,
|
|
3771
|
+
zo as YAxis,
|
|
3772
|
+
Fo as YLabel,
|
|
3773
|
+
Mi as andromeda,
|
|
3774
|
+
Ri as ayuMirage,
|
|
3775
|
+
Co as buildTheme,
|
|
3776
|
+
Ti as catppuccin,
|
|
3773
3777
|
I as createTheme,
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
+
gi as darkTheme,
|
|
3779
|
+
Qe as detectInterval,
|
|
3780
|
+
Di as dracula,
|
|
3781
|
+
Ze as formatDate,
|
|
3778
3782
|
At as formatTime,
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3783
|
+
Bi as githubLight,
|
|
3784
|
+
zi as gruvbox,
|
|
3785
|
+
Fi as handwritten,
|
|
3786
|
+
Wi as highContrast,
|
|
3787
|
+
Ii as lavenderMist,
|
|
3784
3788
|
Ai as lightPink,
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
+
xo as lightTheme,
|
|
3790
|
+
Vi as materialPalenight,
|
|
3791
|
+
Ui as minimalLight,
|
|
3792
|
+
Oi as mintBreeze,
|
|
3789
3793
|
Ei as monokaiPro,
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3794
|
+
$i as nightOwl,
|
|
3795
|
+
ue as normalizeTime,
|
|
3796
|
+
Xi as oneDarkPro,
|
|
3797
|
+
Hi as panda,
|
|
3798
|
+
Gi as peachCream,
|
|
3799
|
+
Ni as quietLight,
|
|
3800
|
+
ji as rosePineDawn,
|
|
3801
|
+
Ji as sandDune,
|
|
3802
|
+
Ki as solarizedLight,
|
|
3803
|
+
ve as themes,
|
|
3800
3804
|
J as useChartInstance,
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3805
|
+
oe as useCrosshairPosition,
|
|
3806
|
+
ao as useLastYValue,
|
|
3807
|
+
so as usePreviousClose,
|
|
3808
|
+
Qi as useTheme,
|
|
3809
|
+
oo as useVisibleRange,
|
|
3810
|
+
ro as useYRange
|
|
3807
3811
|
};
|