@wick-charts/react 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +545 -123
- package/dist/index.js +96 -102
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createContext as ye, useContext as
|
|
1
|
+
import { createContext as ye, useContext as Nt, useRef as et, useLayoutEffect as it, useEffect as j, useState as Rt, Children as Ye, isValidElement as _e, useMemo as dt, useSyncExternalStore as Tt } from "react";
|
|
2
2
|
import { jsx as S, jsxs as F, Fragment as Dt } from "react/jsx-runtime";
|
|
3
3
|
var Ue = Object.defineProperty, xe = (r) => {
|
|
4
4
|
throw TypeError(r);
|
|
5
|
-
}, Ee = (r, t, i) => t in r ? Ue(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),
|
|
5
|
+
}, Ee = (r, t, i) => t in r ? Ue(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) || xe("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) ? xe("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), Ft = (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
|
},
|
|
@@ -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
37
|
class Oe extends Bt {
|
|
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 },
|
|
@@ -147,10 +147,10 @@ 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
|
-
function
|
|
153
|
+
function Ot(r, t, i) {
|
|
154
154
|
let e = 0, a = r.length - 1;
|
|
155
155
|
for (; e <= a; ) {
|
|
156
156
|
const o = e + a >>> 1, s = i(r[o]);
|
|
@@ -160,7 +160,7 @@ function Et(r, t, i) {
|
|
|
160
160
|
}
|
|
161
161
|
return e;
|
|
162
162
|
}
|
|
163
|
-
class
|
|
163
|
+
class Jt extends Bt {
|
|
164
164
|
constructor() {
|
|
165
165
|
super(...arguments), w(this, "data", []), w(this, "_visible", !0), w(this, "cachedRange", null), w(this, "cachedResult", []);
|
|
166
166
|
}
|
|
@@ -195,7 +195,7 @@ class jt extends Bt {
|
|
|
195
195
|
getVisibleData(t, i) {
|
|
196
196
|
if (this.data.length === 0) return [];
|
|
197
197
|
if (this.cachedRange && this.cachedRange.from === t && this.cachedRange.to === i) return this.cachedResult;
|
|
198
|
-
const e = Math.max(0,
|
|
198
|
+
const e = Math.max(0, Ot(this.data, t, (o) => o.time) - 1), a = Math.min(this.data.length, Ot(this.data, i, (o) => o.time) + 1);
|
|
199
199
|
return this.cachedResult = this.data.slice(e, a), this.cachedRange = { from: t, to: i }, this.cachedResult;
|
|
200
200
|
}
|
|
201
201
|
first() {
|
|
@@ -212,7 +212,7 @@ class jt extends Bt {
|
|
|
212
212
|
}
|
|
213
213
|
findNearest(t, i) {
|
|
214
214
|
if (this.data.length === 0) return null;
|
|
215
|
-
const e =
|
|
215
|
+
const e = Ot(this.data, t, (s) => s.time);
|
|
216
216
|
let a = null, o = i;
|
|
217
217
|
for (let s = Math.max(0, e - 1); s <= Math.min(this.data.length - 1, e + 1); s++) {
|
|
218
218
|
const n = Math.abs(this.data[s].time - t);
|
|
@@ -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);
|
|
@@ -319,14 +319,14 @@ class he {
|
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
const ut = 6e4, ct = 36e5, st = 864e5;
|
|
322
|
-
function
|
|
322
|
+
function At(r) {
|
|
323
323
|
return r instanceof Date ? r.getTime() : r;
|
|
324
324
|
}
|
|
325
325
|
function Je(r) {
|
|
326
|
-
return r.length === 0 ||
|
|
326
|
+
return r.length === 0 || !r.some((t) => t.time instanceof Date) ? r : r.map((t) => ({ ...t, time: At(t.time) }));
|
|
327
327
|
}
|
|
328
328
|
function Ke(r) {
|
|
329
|
-
return r.length === 0 ||
|
|
329
|
+
return r.length === 0 || !r.some((t) => t.time instanceof Date) ? r : r.map((t) => ({ ...t, time: At(t.time) }));
|
|
330
330
|
}
|
|
331
331
|
function qe(r) {
|
|
332
332
|
if (r.length < 2) return st;
|
|
@@ -335,7 +335,7 @@ function qe(r) {
|
|
|
335
335
|
t.push(r[i] - r[i - 1]);
|
|
336
336
|
return t.sort((i, e) => i - e), t[Math.floor(t.length / 2)];
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function It(r, t) {
|
|
339
339
|
const i = new Date(r);
|
|
340
340
|
return t >= st ? i.toLocaleDateString("en-US", { month: "short", day: "numeric" }) : t >= ct ? i.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit", hour12: !1 }) : i.toLocaleTimeString("en-US", {
|
|
341
341
|
hour: "2-digit",
|
|
@@ -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,
|
|
@@ -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;
|
|
@@ -480,7 +480,7 @@ const ii = {
|
|
|
480
480
|
};
|
|
481
481
|
class Z {
|
|
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 = { ...ii, ...i };
|
|
484
484
|
}
|
|
485
485
|
/** For chart compatibility — returns first store */
|
|
486
486
|
get store() {
|
|
@@ -675,7 +675,7 @@ function ri(r, t, i, e) {
|
|
|
675
675
|
return a.push(r[r.length - 1]), a;
|
|
676
676
|
}
|
|
677
677
|
const fe = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map(), pe = /* @__PURE__ */ new Map();
|
|
678
|
-
function
|
|
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
681
|
function Ce(r, t, i) {
|
|
@@ -687,14 +687,14 @@ function bt(r, t) {
|
|
|
687
687
|
const i = r + t;
|
|
688
688
|
let e = fe.get(i);
|
|
689
689
|
if (e) return e;
|
|
690
|
-
const [a, o, s] =
|
|
690
|
+
const [a, o, s] = Kt(r);
|
|
691
691
|
return e = `rgba(${a}, ${o}, ${s}, ${t})`, fe.set(i, e), e;
|
|
692
692
|
}
|
|
693
693
|
function ai(r, t) {
|
|
694
694
|
const i = r + t;
|
|
695
695
|
let e = ge.get(i);
|
|
696
696
|
if (e) return e;
|
|
697
|
-
const [a, o, s] =
|
|
697
|
+
const [a, o, s] = Kt(r);
|
|
698
698
|
return e = Ce(
|
|
699
699
|
Math.min(255, Math.round(a + (255 - a) * t)),
|
|
700
700
|
Math.min(255, Math.round(o + (255 - o) * t)),
|
|
@@ -705,7 +705,7 @@ function si(r, t) {
|
|
|
705
705
|
const i = r + t;
|
|
706
706
|
let e = pe.get(i);
|
|
707
707
|
if (e) return e;
|
|
708
|
-
const [a, o, s] =
|
|
708
|
+
const [a, o, s] = Kt(r);
|
|
709
709
|
return e = Ce(
|
|
710
710
|
Math.max(0, Math.round(a * (1 - t))),
|
|
711
711
|
Math.max(0, Math.round(o * (1 - t))),
|
|
@@ -719,7 +719,7 @@ const ni = {
|
|
|
719
719
|
wickDownColor: "#ef5350",
|
|
720
720
|
bodyWidthRatio: 0.6
|
|
721
721
|
};
|
|
722
|
-
class
|
|
722
|
+
class Xt {
|
|
723
723
|
constructor(t, i) {
|
|
724
724
|
w(this, "store"), w(this, "options"), this.store = t, this.options = { ...ni, ...i };
|
|
725
725
|
}
|
|
@@ -801,7 +801,7 @@ const li = {
|
|
|
801
801
|
};
|
|
802
802
|
class G {
|
|
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 = { ...li, ...i };
|
|
805
805
|
}
|
|
806
806
|
get store() {
|
|
807
807
|
return this.stores[0];
|
|
@@ -932,13 +932,7 @@ class G {
|
|
|
932
932
|
const s = this.stores[o].last();
|
|
933
933
|
if (!s) continue;
|
|
934
934
|
const n = this.options.colors[o % this.options.colors.length];
|
|
935
|
-
this.drawPulse(
|
|
936
|
-
t,
|
|
937
|
-
i.timeToBitmapX(s.time),
|
|
938
|
-
e.valueToBitmapY(s.value),
|
|
939
|
-
n,
|
|
940
|
-
a
|
|
941
|
-
);
|
|
935
|
+
this.drawPulse(t, i.timeToBitmapX(s.time), e.valueToBitmapY(s.value), n, a);
|
|
942
936
|
}
|
|
943
937
|
}
|
|
944
938
|
drawPulse(t, i, e, a, o) {
|
|
@@ -1174,7 +1168,7 @@ class gi extends Bt {
|
|
|
1174
1168
|
/** Called by the render loop before each frame. Returns true if still animating. */
|
|
1175
1169
|
tick(t) {
|
|
1176
1170
|
if (!this._animating) return !1;
|
|
1177
|
-
const i = t - this.animStartTime, e = Math.min(1, i / this.animDuration), a = 1 - (1 - e) ** 3, o =
|
|
1171
|
+
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
1172
|
return s > o && this.applyRange(o, s), e >= 1 && (this._animating = !1), this._animating;
|
|
1179
1173
|
}
|
|
1180
1174
|
/** Set the Y-axis range. Adds pixel-based padding unless a side has a fixed (explicit) bound. */
|
|
@@ -1224,11 +1218,11 @@ class gi extends Bt {
|
|
|
1224
1218
|
}
|
|
1225
1219
|
}
|
|
1226
1220
|
let pi = 0;
|
|
1227
|
-
var Y, B, V, ft, wt, M, W, St, N, ot, $, tt,
|
|
1221
|
+
var Y, B, V, ft, wt, M, W, St, N, ot, $, tt, Ht, gt, at, kt, ht, pt, Mt, Wt, K, q, mt;
|
|
1228
1222
|
class mi extends Bt {
|
|
1229
1223
|
constructor(t, i) {
|
|
1230
1224
|
var e, a, o;
|
|
1231
|
-
super(), L(this, pt), L(this, Y), L(this, B), L(this, V), L(this, ft), w(this, "timeScale"), w(this, "yScale"), L(this, wt), L(this, M, []), L(this, W), L(this, St), L(this, N, 6e4), L(this, ot, null), L(this, $, {}), L(this, tt, null), L(this,
|
|
1225
|
+
super(), L(this, pt), L(this, Y), L(this, B), L(this, V), L(this, ft), w(this, "timeScale"), w(this, "yScale"), L(this, wt), L(this, M, []), L(this, W), L(this, St), L(this, N, 6e4), L(this, ot, null), L(this, $, {}), L(this, tt, null), L(this, Ht, !1), L(this, gt, {}), L(this, at, 0), L(this, kt, !1), L(this, ht, !1), L(this, Wt, 0), L(this, K, 0), L(this, q, 0), L(this, mt, !1), i != null && i.axis && (R(this, gt, i.axis), R(this, $, { 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) ?? fi), R(this, St, (i == null ? void 0 : i.grid) !== !1), R(this, Y, new Oe(t)), R(this, B, new gi({ padding: i == null ? void 0 : i.padding })), this.timeScale = new ti(), this.yScale = new ei(), R(this, V, new de(() => this.renderMain())), R(this, ft, new de(() => this.renderOverlay()));
|
|
1232
1226
|
const s = (i == null ? void 0 : i.interactive) !== !1;
|
|
1233
1227
|
R(this, wt, s ? new je(c(this, Y).canvas, c(this, B), this.timeScale, this.yScale) : null), c(this, B).on("change", () => {
|
|
1234
1228
|
this.syncScales(), c(this, V).markDirty(), this.emit("viewportChange");
|
|
@@ -1248,7 +1242,7 @@ class mi extends Bt {
|
|
|
1248
1242
|
}
|
|
1249
1243
|
/** Add a candlestick (OHLC) series and return its unique ID. */
|
|
1250
1244
|
addCandlestickSeries(t) {
|
|
1251
|
-
const i = new
|
|
1245
|
+
const i = new Jt(), e = new Xt(i, {
|
|
1252
1246
|
upColor: c(this, W).candlestick.upColor,
|
|
1253
1247
|
downColor: c(this, W).candlestick.downColor,
|
|
1254
1248
|
wickUpColor: c(this, W).candlestick.wickUpColor,
|
|
@@ -1342,20 +1336,20 @@ class mi extends Bt {
|
|
|
1342
1336
|
appendData(t, i) {
|
|
1343
1337
|
const e = c(this, M).find((o) => o.id === t);
|
|
1344
1338
|
if (!(e != null && e.store)) return;
|
|
1345
|
-
const a = { ...i, time:
|
|
1339
|
+
const a = { ...i, time: At(i.time) };
|
|
1346
1340
|
e.store.append(a);
|
|
1347
1341
|
}
|
|
1348
1342
|
/** Update the last data point of a series in place (e.g. live candle update). */
|
|
1349
1343
|
updateData(t, i) {
|
|
1350
1344
|
const e = c(this, M).find((o) => o.id === t);
|
|
1351
1345
|
if (!(e != null && e.store)) return;
|
|
1352
|
-
const a = { ...i, time:
|
|
1346
|
+
const a = { ...i, time: At(i.time) };
|
|
1353
1347
|
e.store.updateLast(a);
|
|
1354
1348
|
}
|
|
1355
1349
|
/** Update visual options (color, width, etc.) for an existing series. */
|
|
1356
1350
|
updateSeriesOptions(t, i) {
|
|
1357
1351
|
const e = c(this, M).find((a) => a.id === t);
|
|
1358
|
-
e && ((e.renderer instanceof
|
|
1352
|
+
e && ((e.renderer instanceof Xt || e.renderer instanceof G || e.renderer instanceof Z || e.renderer instanceof lt) && e.renderer.updateOptions(i), "label" in i && typeof i.label == "string" && (e.label = i.label), c(this, V).markDirty());
|
|
1359
1353
|
}
|
|
1360
1354
|
/**
|
|
1361
1355
|
* Batch multiple updates: suppress recomputes until `fn` returns.
|
|
@@ -1371,11 +1365,11 @@ class mi extends Bt {
|
|
|
1371
1365
|
}
|
|
1372
1366
|
/** @deprecated Use {@link batch} instead. */
|
|
1373
1367
|
beginUpdate() {
|
|
1374
|
-
|
|
1368
|
+
le(this, at)._++;
|
|
1375
1369
|
}
|
|
1376
1370
|
/** @deprecated Use {@link batch} instead. */
|
|
1377
1371
|
endUpdate() {
|
|
1378
|
-
--
|
|
1372
|
+
--le(this, at)._ <= 0 && (R(this, at, 0), c(this, kt) ? (R(this, kt, !1), R(this, ht, !1), this.onDataChanged()) : c(this, ht) && (R(this, ht, !1), this.updateYRange(!0), c(this, V).markDirty()));
|
|
1379
1373
|
}
|
|
1380
1374
|
/** Show or hide a series. Hidden series are not rendered and excluded from Y-range. */
|
|
1381
1375
|
setSeriesVisible(t, i) {
|
|
@@ -1551,7 +1545,7 @@ class mi extends Bt {
|
|
|
1551
1545
|
const i = c(this, W).line.color;
|
|
1552
1546
|
R(this, W, t);
|
|
1553
1547
|
for (const e of c(this, M))
|
|
1554
|
-
e.renderer instanceof
|
|
1548
|
+
e.renderer instanceof Xt ? e.renderer.updateOptions({
|
|
1555
1549
|
upColor: t.candlestick.upColor,
|
|
1556
1550
|
downColor: t.candlestick.downColor,
|
|
1557
1551
|
wickUpColor: t.candlestick.wickUpColor,
|
|
@@ -1605,7 +1599,7 @@ class mi extends Bt {
|
|
|
1605
1599
|
}
|
|
1606
1600
|
/** Notify chart that a YLabel is present (affects right padding). */
|
|
1607
1601
|
setYLabel(t) {
|
|
1608
|
-
R(this,
|
|
1602
|
+
R(this, Ht, t), this.updateViewportPadding();
|
|
1609
1603
|
}
|
|
1610
1604
|
updatePieHover(t) {
|
|
1611
1605
|
const i = c(this, Y).size;
|
|
@@ -1839,7 +1833,7 @@ class mi extends Bt {
|
|
|
1839
1833
|
}
|
|
1840
1834
|
}
|
|
1841
1835
|
}
|
|
1842
|
-
Y = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), wt = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(),
|
|
1836
|
+
Y = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), wt = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakSet(), /**
|
|
1843
1837
|
* Return a series ID: use the provided hint if it's non-empty and not already taken,
|
|
1844
1838
|
* otherwise generate a new auto ID. Auto-generated IDs never collide with each other
|
|
1845
1839
|
* or with user-provided IDs because they use a monotonically increasing counter.
|
|
@@ -1915,7 +1909,7 @@ function bi(r) {
|
|
|
1915
1909
|
}
|
|
1916
1910
|
function I(r) {
|
|
1917
1911
|
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, _, P, X, H, Q;
|
|
1918
|
-
const { background: U, name: nt = "Custom", description: E, fontUrl: O = null } = r, A = bi(U), Te = A ? "#d1d4dc" : "#24292f", De = A ? "#787b86" : "#8b949e",
|
|
1912
|
+
const { background: U, name: nt = "Custom", description: E, fontUrl: O = null } = r, A = bi(U), Te = A ? "#d1d4dc" : "#24292f", De = A ? "#787b86" : "#8b949e", re = A ? "#26a69a" : "#2da44e", ae = A ? "#ef5350" : "#cf222e", Be = A ? "#2962ff" : "#0969da", ze = A ? "rgba(42,46,57,0.6)" : "rgba(200,200,200,0.5)", Fe = A ? "rgba(150,150,150,0.5)" : "rgba(170,170,170,0.3)", se = A ? Lt(U, 0.1) : me(U, 0.05), Pe = A ? yt(U, 0.92) : yt(U, 0.95), Le = A ? yt(Lt(U, 0.15), 0.6) : "rgba(200,200,200,0.5)", We = _t, Et = ((t = r.candlestick) == null ? void 0 : t.upColor) ?? re, zt = ((i = r.candlestick) == null ? void 0 : i.downColor) ?? ae, vt = ((e = r.line) == null ? void 0 : e.color) ?? Be, ne = ((a = r.tooltip) == null ? void 0 : a.textColor) ?? Te, Ae = ((o = r.axis) == null ? void 0 : o.textColor) ?? De, Ie = ((s = r.typography) == null ? void 0 : s.fontFamily) ?? We, Ve = {
|
|
1919
1913
|
background: U,
|
|
1920
1914
|
chartGradient: r.chartGradient ?? (A ? [Lt(U, 0.04), me(U, 0.06)] : [Lt(U, 0.06), U]),
|
|
1921
1915
|
typography: {
|
|
@@ -1930,9 +1924,9 @@ function I(r) {
|
|
|
1930
1924
|
style: ((p = r.grid) == null ? void 0 : p.style) ?? "dashed"
|
|
1931
1925
|
},
|
|
1932
1926
|
candlestick: {
|
|
1933
|
-
upColor:
|
|
1927
|
+
upColor: Et,
|
|
1934
1928
|
downColor: zt,
|
|
1935
|
-
wickUpColor: ((m = r.candlestick) == null ? void 0 : m.wickUpColor) ??
|
|
1929
|
+
wickUpColor: ((m = r.candlestick) == null ? void 0 : m.wickUpColor) ?? Et,
|
|
1936
1930
|
wickDownColor: ((b = r.candlestick) == null ? void 0 : b.wickDownColor) ?? zt
|
|
1937
1931
|
},
|
|
1938
1932
|
line: {
|
|
@@ -1941,26 +1935,26 @@ function I(r) {
|
|
|
1941
1935
|
areaTopColor: ((v = r.line) == null ? void 0 : v.areaTopColor) ?? yt(vt, 0.08),
|
|
1942
1936
|
areaBottomColor: ((y = r.line) == null ? void 0 : y.areaBottomColor) ?? yt(vt, 0.01)
|
|
1943
1937
|
},
|
|
1944
|
-
seriesColors: r.seriesColors ?? [vt,
|
|
1938
|
+
seriesColors: r.seriesColors ?? [vt, re, ae],
|
|
1945
1939
|
bands: {
|
|
1946
1940
|
upper: ((x = r.bands) == null ? void 0 : x.upper) ?? vt,
|
|
1947
1941
|
lower: ((C = r.bands) == null ? void 0 : C.lower) ?? zt
|
|
1948
1942
|
},
|
|
1949
1943
|
crosshair: {
|
|
1950
1944
|
color: ((T = r.crosshair) == null ? void 0 : T.color) ?? Fe,
|
|
1951
|
-
labelBackground: ((k = r.crosshair) == null ? void 0 : k.labelBackground) ??
|
|
1952
|
-
labelTextColor: ((D = r.crosshair) == null ? void 0 : D.labelTextColor) ??
|
|
1945
|
+
labelBackground: ((k = r.crosshair) == null ? void 0 : k.labelBackground) ?? se,
|
|
1946
|
+
labelTextColor: ((D = r.crosshair) == null ? void 0 : D.labelTextColor) ?? ne
|
|
1953
1947
|
},
|
|
1954
1948
|
axis: { textColor: Ae },
|
|
1955
1949
|
yLabel: {
|
|
1956
|
-
upBackground: ((z = r.yLabel) == null ? void 0 : z.upBackground) ??
|
|
1950
|
+
upBackground: ((z = r.yLabel) == null ? void 0 : z.upBackground) ?? Et,
|
|
1957
1951
|
downBackground: ((_ = r.yLabel) == null ? void 0 : _.downBackground) ?? zt,
|
|
1958
|
-
neutralBackground: ((P = r.yLabel) == null ? void 0 : P.neutralBackground) ??
|
|
1952
|
+
neutralBackground: ((P = r.yLabel) == null ? void 0 : P.neutralBackground) ?? se,
|
|
1959
1953
|
textColor: ((X = r.yLabel) == null ? void 0 : X.textColor) ?? "#ffffff"
|
|
1960
1954
|
},
|
|
1961
1955
|
tooltip: {
|
|
1962
1956
|
background: ((H = r.tooltip) == null ? void 0 : H.background) ?? Pe,
|
|
1963
|
-
textColor:
|
|
1957
|
+
textColor: ne,
|
|
1964
1958
|
borderColor: ((Q = r.tooltip) == null ? void 0 : Q.borderColor) ?? Le
|
|
1965
1959
|
}
|
|
1966
1960
|
};
|
|
@@ -1980,7 +1974,7 @@ function me(r, t) {
|
|
|
1980
1974
|
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
1975
|
return `#${i.toString(16).padStart(2, "0")}${e.toString(16).padStart(2, "0")}${a.toString(16).padStart(2, "0")}`;
|
|
1982
1976
|
}
|
|
1983
|
-
const
|
|
1977
|
+
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", we = "'Roboto Mono', monospace", Se = "https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;600&display=swap", vi = "'IBM Plex Mono', monospace", yi = "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", ke = "'Source Code Pro', monospace", Me = "https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500;600&display=swap", xi = "'Space Mono', monospace", Ci = "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", wi = "'Caveat', 'Comic Sans MS', cursive", Si = "https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&display=swap", ki = I({
|
|
1984
1978
|
name: "Andromeda",
|
|
1985
1979
|
description: "Deep space purples and cosmic blues",
|
|
1986
1980
|
background: "#23262e",
|
|
@@ -2028,8 +2022,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2028
2022
|
crosshair: { color: "rgba(92,103,115,0.4)", labelBackground: "#2a3040" },
|
|
2029
2023
|
axis: { textColor: "#5c6773" },
|
|
2030
2024
|
tooltip: { background: "rgba(31,36,48,0.92)", textColor: "#cbccc6", borderColor: "rgba(42,48,60,0.6)" },
|
|
2031
|
-
typography: { fontFamily:
|
|
2032
|
-
fontUrl:
|
|
2025
|
+
typography: { fontFamily: _t },
|
|
2026
|
+
fontUrl: qt
|
|
2033
2027
|
}), Ri = I({
|
|
2034
2028
|
name: "Catppuccin",
|
|
2035
2029
|
description: "Pastel tones on a mocha base",
|
|
@@ -2053,8 +2047,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2053
2047
|
crosshair: { color: "rgba(108,112,134,0.4)", labelBackground: "#313244" },
|
|
2054
2048
|
axis: { textColor: "#6c7086" },
|
|
2055
2049
|
tooltip: { background: "rgba(30,30,46,0.92)", textColor: "#cdd6f4", borderColor: "rgba(49,50,68,0.6)" },
|
|
2056
|
-
typography: { fontFamily:
|
|
2057
|
-
fontUrl:
|
|
2050
|
+
typography: { fontFamily: _t },
|
|
2051
|
+
fontUrl: qt
|
|
2058
2052
|
}), Ti = I({
|
|
2059
2053
|
name: "Dracula",
|
|
2060
2054
|
description: "Classic dark with vibrant highlights",
|
|
@@ -2078,8 +2072,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2078
2072
|
crosshair: { color: "rgba(98,114,164,0.4)", labelBackground: "#44475a" },
|
|
2079
2073
|
axis: { textColor: "#6272a4" },
|
|
2080
2074
|
tooltip: { background: "rgba(40,42,54,0.92)", textColor: "#f8f8f2", borderColor: "rgba(68,71,90,0.6)" },
|
|
2081
|
-
typography: { fontFamily:
|
|
2082
|
-
fontUrl:
|
|
2075
|
+
typography: { fontFamily: Qt },
|
|
2076
|
+
fontUrl: Zt
|
|
2083
2077
|
}), Di = I({
|
|
2084
2078
|
name: "GitHub Light",
|
|
2085
2079
|
description: "Clean and familiar, GitHub-inspired",
|
|
@@ -2129,8 +2123,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2129
2123
|
crosshair: { color: "rgba(146,131,116,0.4)", labelBackground: "#3c3836" },
|
|
2130
2124
|
axis: { textColor: "#928374" },
|
|
2131
2125
|
tooltip: { background: "rgba(40,40,40,0.92)", textColor: "#ebdbb2", borderColor: "rgba(60,56,54,0.6)" },
|
|
2132
|
-
typography: { fontFamily:
|
|
2133
|
-
fontUrl:
|
|
2126
|
+
typography: { fontFamily: Vt },
|
|
2127
|
+
fontUrl: Yt
|
|
2134
2128
|
}), zi = {
|
|
2135
2129
|
name: "Handwritten",
|
|
2136
2130
|
description: "Sketch-style with a personal touch",
|
|
@@ -2243,8 +2237,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2243
2237
|
axis: { textColor: "#9a88a0" },
|
|
2244
2238
|
crosshair: { color: "rgba(150,130,155,0.2)", labelBackground: "#ebe4e8" },
|
|
2245
2239
|
tooltip: { background: "rgba(245,240,244,0.95)", textColor: "#3a3050", borderColor: "rgba(150,130,155,0.25)" },
|
|
2246
|
-
typography: { fontFamily:
|
|
2247
|
-
fontUrl:
|
|
2240
|
+
typography: { fontFamily: te },
|
|
2241
|
+
fontUrl: ee,
|
|
2248
2242
|
chartGradient: ["#f8f4f7", "#f5f0f4"]
|
|
2249
2243
|
}), Ai = I({
|
|
2250
2244
|
name: "Love",
|
|
@@ -2270,8 +2264,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2270
2264
|
crosshair: { color: "rgba(180,140,155,0.3)", labelBackground: "#f0dce2" },
|
|
2271
2265
|
axis: { textColor: "#b08898" },
|
|
2272
2266
|
tooltip: { background: "rgba(253,242,244,0.95)", textColor: "#4a3040", borderColor: "rgba(200,160,175,0.35)" },
|
|
2273
|
-
typography: { fontFamily:
|
|
2274
|
-
fontUrl:
|
|
2267
|
+
typography: { fontFamily: _t },
|
|
2268
|
+
fontUrl: qt
|
|
2275
2269
|
}), Ii = I({
|
|
2276
2270
|
name: "Material Palenight",
|
|
2277
2271
|
description: "Material Design in moonlit hues",
|
|
@@ -2371,8 +2365,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2371
2365
|
crosshair: { color: "rgba(114,112,114,0.4)", labelBackground: "#403e42" },
|
|
2372
2366
|
axis: { textColor: "#727072" },
|
|
2373
2367
|
tooltip: { background: "rgba(45,42,46,0.92)", textColor: "#fcfcfa", borderColor: "rgba(64,60,62,0.6)" },
|
|
2374
|
-
typography: { fontFamily:
|
|
2375
|
-
fontUrl:
|
|
2368
|
+
typography: { fontFamily: Qt },
|
|
2369
|
+
fontUrl: Zt
|
|
2376
2370
|
}), Oi = I({
|
|
2377
2371
|
name: "Night Owl",
|
|
2378
2372
|
description: "Crafted for late-night coding",
|
|
@@ -2396,8 +2390,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2396
2390
|
crosshair: { color: "rgba(99,119,119,0.4)", labelBackground: "#1d3b53" },
|
|
2397
2391
|
axis: { textColor: "#495a5a" },
|
|
2398
2392
|
tooltip: { background: "rgba(1,22,39,0.92)", textColor: "#d6deeb", borderColor: "rgba(31,52,72,0.6)" },
|
|
2399
|
-
typography: { fontFamily:
|
|
2400
|
-
fontUrl:
|
|
2393
|
+
typography: { fontFamily: Vt },
|
|
2394
|
+
fontUrl: Yt
|
|
2401
2395
|
}), $i = I({
|
|
2402
2396
|
name: "One Dark Pro",
|
|
2403
2397
|
description: "Atom editor's iconic dark palette",
|
|
@@ -2421,8 +2415,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2421
2415
|
crosshair: { color: "rgba(99,110,123,0.4)", labelBackground: "#3e4451" },
|
|
2422
2416
|
axis: { textColor: "#5c6370" },
|
|
2423
2417
|
tooltip: { background: "rgba(40,44,52,0.92)", textColor: "#abb2bf", borderColor: "rgba(59,64,72,0.6)" },
|
|
2424
|
-
typography: { fontFamily:
|
|
2425
|
-
fontUrl:
|
|
2418
|
+
typography: { fontFamily: Vt },
|
|
2419
|
+
fontUrl: Yt
|
|
2426
2420
|
}), Xi = I({
|
|
2427
2421
|
name: "Panda",
|
|
2428
2422
|
description: "Playful neons on charcoal",
|
|
@@ -2446,8 +2440,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2446
2440
|
crosshair: { color: "rgba(117,117,117,0.4)", labelBackground: "#3a3a3c" },
|
|
2447
2441
|
axis: { textColor: "#757575" },
|
|
2448
2442
|
tooltip: { background: "rgba(41,42,43,0.92)", textColor: "#e6e6e6", borderColor: "rgba(58,58,60,0.6)" },
|
|
2449
|
-
typography: { fontFamily:
|
|
2450
|
-
fontUrl:
|
|
2443
|
+
typography: { fontFamily: Qt },
|
|
2444
|
+
fontUrl: Zt
|
|
2451
2445
|
}), Hi = I({
|
|
2452
2446
|
name: "Peach Cream",
|
|
2453
2447
|
background: "#fef6f0",
|
|
@@ -2470,8 +2464,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2470
2464
|
axis: { textColor: "#b09080" },
|
|
2471
2465
|
crosshair: { color: "rgba(180,140,120,0.2)", labelBackground: "#f0e4d8" },
|
|
2472
2466
|
tooltip: { background: "rgba(254,246,240,0.95)", textColor: "#4a3028", borderColor: "rgba(180,140,120,0.25)" },
|
|
2473
|
-
typography: { fontFamily:
|
|
2474
|
-
fontUrl:
|
|
2467
|
+
typography: { fontFamily: te },
|
|
2468
|
+
fontUrl: ee,
|
|
2475
2469
|
chartGradient: ["#fff8f2", "#fef6f0"]
|
|
2476
2470
|
}), Gi = I({
|
|
2477
2471
|
name: "Quiet Light",
|
|
@@ -2496,8 +2490,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2496
2490
|
crosshair: { color: "rgba(170,170,170,0.3)", labelBackground: "#e8e8e8" },
|
|
2497
2491
|
axis: { textColor: "#aaaaaa" },
|
|
2498
2492
|
tooltip: { background: "rgba(245,245,245,0.95)", textColor: "#333333", borderColor: "rgba(200,200,200,0.5)" },
|
|
2499
|
-
typography: { fontFamily:
|
|
2500
|
-
fontUrl:
|
|
2493
|
+
typography: { fontFamily: te },
|
|
2494
|
+
fontUrl: ee
|
|
2501
2495
|
}), Ni = I({
|
|
2502
2496
|
name: "Rosé Pine Dawn",
|
|
2503
2497
|
description: "Dawn-inspired warm neutrals",
|
|
@@ -2572,8 +2566,8 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2572
2566
|
crosshair: { color: "rgba(147,161,161,0.3)", labelBackground: "#eee8d5" },
|
|
2573
2567
|
axis: { textColor: "#93a1a1" },
|
|
2574
2568
|
tooltip: { background: "rgba(253,246,227,0.95)", textColor: "#586e75", borderColor: "rgba(238,232,213,0.6)" },
|
|
2575
|
-
typography: { fontFamily:
|
|
2576
|
-
fontUrl:
|
|
2569
|
+
typography: { fontFamily: Vt },
|
|
2570
|
+
fontUrl: Yt
|
|
2577
2571
|
}), be = {
|
|
2578
2572
|
Dracula: Ti,
|
|
2579
2573
|
"One Dark Pro": $i,
|
|
@@ -2601,9 +2595,9 @@ const It = "'JetBrains Mono', 'Fira Code', monospace", Vt = "https://fonts.googl
|
|
|
2601
2595
|
function xo(r) {
|
|
2602
2596
|
return (be[r] ?? be["One Dark Pro"]).theme;
|
|
2603
2597
|
}
|
|
2604
|
-
const
|
|
2598
|
+
const Gt = ye(null);
|
|
2605
2599
|
function J() {
|
|
2606
|
-
const r = Gt
|
|
2600
|
+
const r = Nt(Gt);
|
|
2607
2601
|
if (!r)
|
|
2608
2602
|
throw new Error("useChartInstance must be used within <ChartContainer>");
|
|
2609
2603
|
return r;
|
|
@@ -2661,15 +2655,15 @@ function Co({ data: r, options: t, id: i, onSeriesId: e }) {
|
|
|
2661
2655
|
t == null ? void 0 : t.candleGradient
|
|
2662
2656
|
]), null;
|
|
2663
2657
|
}
|
|
2664
|
-
const
|
|
2658
|
+
const ie = ye(null), ve = ie.Provider;
|
|
2665
2659
|
function qi() {
|
|
2666
|
-
const r =
|
|
2660
|
+
const r = Nt(ie);
|
|
2667
2661
|
if (!r)
|
|
2668
2662
|
throw new Error("useTheme must be used within <ThemeProvider>");
|
|
2669
2663
|
return r;
|
|
2670
2664
|
}
|
|
2671
2665
|
function Qi() {
|
|
2672
|
-
return
|
|
2666
|
+
return Nt(ie);
|
|
2673
2667
|
}
|
|
2674
2668
|
function Zi({ items: r, position: t = "bottom", mode: i = "toggle" }) {
|
|
2675
2669
|
const e = J(), a = qi(), [o, s] = Rt(/* @__PURE__ */ new Set()), [, n] = Rt(0);
|
|
@@ -2836,7 +2830,7 @@ function to({ children: r, theme: t, axis: i, padding: e, gradient: a = !0, inte
|
|
|
2836
2830
|
minHeight: 0,
|
|
2837
2831
|
overflow: "hidden"
|
|
2838
2832
|
},
|
|
2839
|
-
children: b && /* @__PURE__ */ S(
|
|
2833
|
+
children: b && /* @__PURE__ */ S(Gt.Provider, { value: b, children: /* @__PURE__ */ S(ve, { value: d ?? b.getTheme(), children: /* @__PURE__ */ S(
|
|
2840
2834
|
"div",
|
|
2841
2835
|
{
|
|
2842
2836
|
style: {
|
|
@@ -2850,7 +2844,7 @@ function to({ children: r, theme: t, axis: i, padding: e, gradient: a = !0, inte
|
|
|
2850
2844
|
) }) })
|
|
2851
2845
|
}
|
|
2852
2846
|
),
|
|
2853
|
-
b && u && /* @__PURE__ */ S(
|
|
2847
|
+
b && u && /* @__PURE__ */ S(Gt.Provider, { value: b, children: /* @__PURE__ */ S(ve, { value: d ?? b.getTheme(), children: u }) })
|
|
2854
2848
|
]
|
|
2855
2849
|
}
|
|
2856
2850
|
);
|
|
@@ -2893,7 +2887,7 @@ function wo({ data: r, options: t, id: i, onSeriesId: e }) {
|
|
|
2893
2887
|
o.current && a.setPieData(o.current, r);
|
|
2894
2888
|
}, [a, r]), null;
|
|
2895
2889
|
}
|
|
2896
|
-
function
|
|
2890
|
+
function Ut(r, t, i) {
|
|
2897
2891
|
const e = Array.isArray(t) ? t : [t];
|
|
2898
2892
|
return {
|
|
2899
2893
|
subscribe: (a) => {
|
|
@@ -2906,11 +2900,11 @@ function _t(r, t, i) {
|
|
|
2906
2900
|
};
|
|
2907
2901
|
}
|
|
2908
2902
|
function io(r) {
|
|
2909
|
-
const t = dt(() =>
|
|
2903
|
+
const t = dt(() => Ut(r, ["viewportChange", "dataUpdate", "seriesChange"], () => r.getVisibleRange()), [r]);
|
|
2910
2904
|
return Tt(t.subscribe, t.getSnapshot);
|
|
2911
2905
|
}
|
|
2912
2906
|
function oo(r) {
|
|
2913
|
-
const t = dt(() =>
|
|
2907
|
+
const t = dt(() => Ut(r, ["viewportChange", "dataUpdate", "seriesChange"], () => r.getYRange()), [r]);
|
|
2914
2908
|
return Tt(t.subscribe, t.getSnapshot);
|
|
2915
2909
|
}
|
|
2916
2910
|
function ro(r, t) {
|
|
@@ -2936,17 +2930,17 @@ function ro(r, t) {
|
|
|
2936
2930
|
}
|
|
2937
2931
|
function ao(r, t) {
|
|
2938
2932
|
const i = dt(
|
|
2939
|
-
() =>
|
|
2933
|
+
() => Ut(r, "dataUpdate", () => r.getPreviousClose(t)),
|
|
2940
2934
|
[r, t]
|
|
2941
2935
|
);
|
|
2942
2936
|
return Tt(i.subscribe, i.getSnapshot);
|
|
2943
2937
|
}
|
|
2944
|
-
function
|
|
2945
|
-
const t = dt(() =>
|
|
2938
|
+
function oe(r) {
|
|
2939
|
+
const t = dt(() => Ut(r, "crosshairMove", () => r.getCrosshairPosition()), [r]);
|
|
2946
2940
|
return Tt(t.subscribe, t.getSnapshot);
|
|
2947
2941
|
}
|
|
2948
2942
|
function So() {
|
|
2949
|
-
const r = J(), t =
|
|
2943
|
+
const r = J(), t = oe(r);
|
|
2950
2944
|
if (!t) return null;
|
|
2951
2945
|
const i = r.getTheme(), e = r.getDataInterval(), a = {
|
|
2952
2946
|
background: i.crosshair.labelBackground,
|
|
@@ -2982,7 +2976,7 @@ function So() {
|
|
|
2982
2976
|
transform: "translateX(-50%)",
|
|
2983
2977
|
...a
|
|
2984
2978
|
},
|
|
2985
|
-
children:
|
|
2979
|
+
children: It(t.time, e)
|
|
2986
2980
|
}
|
|
2987
2981
|
)
|
|
2988
2982
|
] });
|
|
@@ -3125,7 +3119,7 @@ function ko({ seriesId: r, format: t = "value" }) {
|
|
|
3125
3119
|
);
|
|
3126
3120
|
}
|
|
3127
3121
|
function Mo({ seriesId: r }) {
|
|
3128
|
-
const t = J(), i =
|
|
3122
|
+
const t = J(), i = oe(t), e = t.getPieHoverInfo(r);
|
|
3129
3123
|
if (!e || !i) return null;
|
|
3130
3124
|
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
3125
|
return /* @__PURE__ */ F(
|
|
@@ -3380,7 +3374,7 @@ function To() {
|
|
|
3380
3374
|
transition: "opacity 0.3s ease",
|
|
3381
3375
|
willChange: "opacity"
|
|
3382
3376
|
},
|
|
3383
|
-
children:
|
|
3377
|
+
children: It(d, a)
|
|
3384
3378
|
},
|
|
3385
3379
|
d
|
|
3386
3380
|
);
|
|
@@ -3395,7 +3389,7 @@ function po(r, t) {
|
|
|
3395
3389
|
});
|
|
3396
3390
|
}
|
|
3397
3391
|
function Do({ seriesId: r, sort: t = "none", showLegend: i, legend: e }) {
|
|
3398
|
-
const a = i ?? e ?? !0, o = J(), s =
|
|
3392
|
+
const a = i ?? e ?? !0, o = J(), s = oe(o), n = r ? [r] : o.getSeriesIds(), [, l] = Rt(0);
|
|
3399
3393
|
j(() => {
|
|
3400
3394
|
const u = () => l((v) => v + 1);
|
|
3401
3395
|
return o.on("dataUpdate", u), () => o.off("dataUpdate", u);
|
|
@@ -3468,7 +3462,7 @@ function Do({ seriesId: r, sort: t = "none", showLegend: i, legend: e }) {
|
|
|
3468
3462
|
transition: "opacity 0.2s ease"
|
|
3469
3463
|
},
|
|
3470
3464
|
children: [
|
|
3471
|
-
/* @__PURE__ */ S("span", { style: { color: f.axis.textColor, marginRight: 2 }, children:
|
|
3465
|
+
/* @__PURE__ */ S("span", { style: { color: f.axis.textColor, marginRight: 2 }, children: It(b, p) }),
|
|
3472
3466
|
g.map((u) => {
|
|
3473
3467
|
if ("open" in u.data) {
|
|
3474
3468
|
const x = u.data, T = x.close >= x.open ? f.candlestick.upColor : f.candlestick.downColor;
|
|
@@ -3583,7 +3577,7 @@ function mo({
|
|
|
3583
3577
|
children: [
|
|
3584
3578
|
Qe(y),
|
|
3585
3579
|
" ",
|
|
3586
|
-
|
|
3580
|
+
It(y, s)
|
|
3587
3581
|
]
|
|
3588
3582
|
}
|
|
3589
3583
|
),
|
|
@@ -3775,7 +3769,7 @@ export {
|
|
|
3775
3769
|
qe as detectInterval,
|
|
3776
3770
|
Ti as dracula,
|
|
3777
3771
|
Qe as formatDate,
|
|
3778
|
-
|
|
3772
|
+
It as formatTime,
|
|
3779
3773
|
Di as githubLight,
|
|
3780
3774
|
Bi as gruvbox,
|
|
3781
3775
|
zi as handwritten,
|
|
@@ -3788,7 +3782,7 @@ export {
|
|
|
3788
3782
|
Ui as mintBreeze,
|
|
3789
3783
|
Ei as monokaiPro,
|
|
3790
3784
|
Oi as nightOwl,
|
|
3791
|
-
|
|
3785
|
+
At as normalizeTime,
|
|
3792
3786
|
$i as oneDarkPro,
|
|
3793
3787
|
Xi as panda,
|
|
3794
3788
|
Hi as peachCream,
|
|
@@ -3798,7 +3792,7 @@ export {
|
|
|
3798
3792
|
Ji as solarizedLight,
|
|
3799
3793
|
be as themes,
|
|
3800
3794
|
J as useChartInstance,
|
|
3801
|
-
|
|
3795
|
+
oe as useCrosshairPosition,
|
|
3802
3796
|
ro as useLastYValue,
|
|
3803
3797
|
ao as usePreviousClose,
|
|
3804
3798
|
qi as useTheme,
|