@tradecanvas/core 1.0.3 → 1.1.0
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 +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +180 -173
- package/dist/index.js.map +1 -1
- package/dist/ui/SessionShading.d.ts.map +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/sessionHours.d.ts +26 -3
- package/dist/ui/sessionHours.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9638,19 +9638,22 @@ function Yi(e, t) {
|
|
|
9638
9638
|
let n = ((e + t * 6e4) % Ji + Ji) % Ji;
|
|
9639
9639
|
return Math.floor(n / 6e4);
|
|
9640
9640
|
}
|
|
9641
|
-
function Xi(e, t) {
|
|
9642
|
-
|
|
9643
|
-
|
|
9641
|
+
function Xi(e, t, n) {
|
|
9642
|
+
return t === n ? !0 : t < n ? e >= t && e < n : e >= t || e < n;
|
|
9643
|
+
}
|
|
9644
|
+
function Zi(e, t) {
|
|
9645
|
+
let n = Yi(e, t.tzOffsetMinutes);
|
|
9646
|
+
return t.windows && t.windows.length > 0 ? t.windows.some((e) => Xi(n, e.startMinute, e.endMinute)) : Xi(n, t.startMinute, t.endMinute);
|
|
9644
9647
|
}
|
|
9645
9648
|
//#endregion
|
|
9646
9649
|
//#region src/ui/SessionShading.ts
|
|
9647
|
-
var
|
|
9650
|
+
var Qi = {
|
|
9648
9651
|
startMinute: 570,
|
|
9649
9652
|
endMinute: 960,
|
|
9650
9653
|
tzOffsetMinutes: -300
|
|
9651
|
-
},
|
|
9654
|
+
}, $i = class {
|
|
9652
9655
|
visible = !1;
|
|
9653
|
-
config = { ...
|
|
9656
|
+
config = { ...Qi };
|
|
9654
9657
|
setVisible(e) {
|
|
9655
9658
|
this.visible = e;
|
|
9656
9659
|
}
|
|
@@ -9658,13 +9661,17 @@ var Zi = {
|
|
|
9658
9661
|
return this.visible;
|
|
9659
9662
|
}
|
|
9660
9663
|
setConfig(e) {
|
|
9661
|
-
|
|
9664
|
+
let t = {
|
|
9662
9665
|
...this.config,
|
|
9663
9666
|
...e
|
|
9664
9667
|
};
|
|
9668
|
+
t.windows = t.windows ? t.windows.map((e) => ({ ...e })) : void 0, this.config = t;
|
|
9665
9669
|
}
|
|
9666
9670
|
getConfig() {
|
|
9667
|
-
return {
|
|
9671
|
+
return {
|
|
9672
|
+
...this.config,
|
|
9673
|
+
windows: this.config.windows?.map((e) => ({ ...e }))
|
|
9674
|
+
};
|
|
9668
9675
|
}
|
|
9669
9676
|
render(e, t, n, r) {
|
|
9670
9677
|
if (!this.visible || t.length === 0) return;
|
|
@@ -9677,12 +9684,12 @@ var Zi = {
|
|
|
9677
9684
|
e.fillRect(a, i.y, o - a, i.height);
|
|
9678
9685
|
};
|
|
9679
9686
|
for (let e = s; e <= c; e++) {
|
|
9680
|
-
let n = !
|
|
9687
|
+
let n = !Zi(t[e].time, this.config);
|
|
9681
9688
|
n && d === -1 ? d = e : !n && d !== -1 && (f(d, e - 1), d = -1);
|
|
9682
9689
|
}
|
|
9683
9690
|
d !== -1 && f(d, c), e.restore();
|
|
9684
9691
|
}
|
|
9685
|
-
},
|
|
9692
|
+
}, ea = 1, ta = class extends G {
|
|
9686
9693
|
alerts = [];
|
|
9687
9694
|
lastValues = /* @__PURE__ */ new Map();
|
|
9688
9695
|
requestRender = null;
|
|
@@ -9694,7 +9701,7 @@ var Zi = {
|
|
|
9694
9701
|
this.pricePrecision = e;
|
|
9695
9702
|
}
|
|
9696
9703
|
addAlert(e, t = "crossing", n, r = !1, i = "price", a) {
|
|
9697
|
-
let o = `tc_alert_${
|
|
9704
|
+
let o = `tc_alert_${ea++}`, s = {
|
|
9698
9705
|
id: o,
|
|
9699
9706
|
price: e,
|
|
9700
9707
|
condition: t,
|
|
@@ -9803,7 +9810,7 @@ var Zi = {
|
|
|
9803
9810
|
e.fillText(s, r.x + r.width - 4, a - 2);
|
|
9804
9811
|
}
|
|
9805
9812
|
}
|
|
9806
|
-
},
|
|
9813
|
+
}, na = class extends G {
|
|
9807
9814
|
data = [];
|
|
9808
9815
|
currentIndex = 0;
|
|
9809
9816
|
timer = null;
|
|
@@ -9872,13 +9879,13 @@ function X(e) {
|
|
|
9872
9879
|
function Z(e) {
|
|
9873
9880
|
return Array.isArray(e) ? e : [];
|
|
9874
9881
|
}
|
|
9875
|
-
function
|
|
9882
|
+
function ra(e, t) {
|
|
9876
9883
|
return typeof e == "string" ? e : t;
|
|
9877
9884
|
}
|
|
9878
|
-
function
|
|
9885
|
+
function ia(e, t) {
|
|
9879
9886
|
return typeof e == "number" && Number.isFinite(e) ? e : t;
|
|
9880
9887
|
}
|
|
9881
|
-
function
|
|
9888
|
+
function aa(e) {
|
|
9882
9889
|
if (!X(e) || typeof e.id != "string" || typeof e.type != "string" || !Array.isArray(e.anchors) || e.anchors.length === 0 || !X(e.style)) return null;
|
|
9883
9890
|
let t = [];
|
|
9884
9891
|
for (let n of e.anchors) {
|
|
@@ -9899,14 +9906,14 @@ function ia(e) {
|
|
|
9899
9906
|
meta: X(e.meta) ? e.meta : void 0
|
|
9900
9907
|
};
|
|
9901
9908
|
}
|
|
9902
|
-
function
|
|
9909
|
+
function oa(e) {
|
|
9903
9910
|
return !X(e) || typeof e.id != "string" || typeof e.side != "string" || typeof e.type != "string" || typeof e.price != "number" || typeof e.quantity != "number" ? null : e;
|
|
9904
9911
|
}
|
|
9905
|
-
function
|
|
9912
|
+
function sa(e) {
|
|
9906
9913
|
return !X(e) || typeof e.id != "string" || typeof e.side != "string" || typeof e.entryPrice != "number" || typeof e.quantity != "number" ? null : e;
|
|
9907
9914
|
}
|
|
9908
|
-
function
|
|
9909
|
-
if (!X(e)) return
|
|
9915
|
+
function ca(e) {
|
|
9916
|
+
if (!X(e)) return la();
|
|
9910
9917
|
typeof e.version == "number" && e.version !== Y && console.warn(`Chart state version mismatch: ${e.version} vs ${Y}`);
|
|
9911
9918
|
let t = X(e.viewport) ? e.viewport : {}, n = [];
|
|
9912
9919
|
for (let t of Z(e.indicators)) X(t) && (typeof t.id != "string" || typeof t.instanceId != "string" || X(t.params) && n.push({
|
|
@@ -9917,31 +9924,31 @@ function sa(e) {
|
|
|
9917
9924
|
}));
|
|
9918
9925
|
let r = [];
|
|
9919
9926
|
for (let t of Z(e.drawings)) {
|
|
9920
|
-
let e =
|
|
9927
|
+
let e = aa(t);
|
|
9921
9928
|
e && r.push(e);
|
|
9922
9929
|
}
|
|
9923
9930
|
let i = [];
|
|
9924
9931
|
for (let t of Z(e.orders)) {
|
|
9925
|
-
let e =
|
|
9932
|
+
let e = oa(t);
|
|
9926
9933
|
e && i.push(e);
|
|
9927
9934
|
}
|
|
9928
9935
|
let a = [];
|
|
9929
9936
|
for (let t of Z(e.positions)) {
|
|
9930
|
-
let e =
|
|
9937
|
+
let e = sa(t);
|
|
9931
9938
|
e && a.push(e);
|
|
9932
9939
|
}
|
|
9933
9940
|
let o = [];
|
|
9934
9941
|
for (let t of Z(e.alerts)) X(t) && typeof t.id == "string" && o.push(t);
|
|
9935
9942
|
return {
|
|
9936
9943
|
version: typeof e.version == "number" ? e.version : Y,
|
|
9937
|
-
timestamp:
|
|
9944
|
+
timestamp: ia(e.timestamp, Date.now()),
|
|
9938
9945
|
symbol: typeof e.symbol == "string" ? e.symbol : void 0,
|
|
9939
9946
|
timeframe: typeof e.timeframe == "string" ? e.timeframe : void 0,
|
|
9940
|
-
chartType:
|
|
9947
|
+
chartType: ra(e.chartType, "candlestick"),
|
|
9941
9948
|
viewport: {
|
|
9942
|
-
barWidth:
|
|
9943
|
-
barSpacing:
|
|
9944
|
-
offset:
|
|
9949
|
+
barWidth: ia(t.barWidth, 8),
|
|
9950
|
+
barSpacing: ia(t.barSpacing, 2),
|
|
9951
|
+
offset: ia(t.offset, 0)
|
|
9945
9952
|
},
|
|
9946
9953
|
theme: typeof e.theme == "string" ? e.theme : void 0,
|
|
9947
9954
|
locale: typeof e.locale == "string" ? e.locale : void 0,
|
|
@@ -9952,7 +9959,7 @@ function sa(e) {
|
|
|
9952
9959
|
alerts: o
|
|
9953
9960
|
};
|
|
9954
9961
|
}
|
|
9955
|
-
function
|
|
9962
|
+
function la() {
|
|
9956
9963
|
return {
|
|
9957
9964
|
version: Y,
|
|
9958
9965
|
timestamp: Date.now(),
|
|
@@ -9969,7 +9976,7 @@ function ca() {
|
|
|
9969
9976
|
alerts: []
|
|
9970
9977
|
};
|
|
9971
9978
|
}
|
|
9972
|
-
var
|
|
9979
|
+
var ua = class {
|
|
9973
9980
|
static capture(e, t) {
|
|
9974
9981
|
return {
|
|
9975
9982
|
version: Y,
|
|
@@ -9994,7 +10001,7 @@ var la = class {
|
|
|
9994
10001
|
return JSON.stringify(e);
|
|
9995
10002
|
}
|
|
9996
10003
|
static deserialize(e) {
|
|
9997
|
-
return
|
|
10004
|
+
return ca(JSON.parse(e));
|
|
9998
10005
|
}
|
|
9999
10006
|
static saveToStorage(e, t) {
|
|
10000
10007
|
localStorage.setItem(e, this.serialize(t));
|
|
@@ -10021,7 +10028,7 @@ var la = class {
|
|
|
10021
10028
|
}, n.click();
|
|
10022
10029
|
});
|
|
10023
10030
|
}
|
|
10024
|
-
},
|
|
10031
|
+
}, da = class {
|
|
10025
10032
|
undoStack = [];
|
|
10026
10033
|
redoStack = [];
|
|
10027
10034
|
maxHistory = 50;
|
|
@@ -10057,7 +10064,7 @@ var la = class {
|
|
|
10057
10064
|
redoCount: this.redoStack.length
|
|
10058
10065
|
};
|
|
10059
10066
|
}
|
|
10060
|
-
},
|
|
10067
|
+
}, fa = class {
|
|
10061
10068
|
static toCSV(e) {
|
|
10062
10069
|
return ["Time,Open,High,Low,Close,Volume", ...e.map((e) => `${new Date(e.time).toISOString()},${e.open},${e.high},${e.low},${e.close},${e.volume}`)].join("\n");
|
|
10063
10070
|
}
|
|
@@ -10075,7 +10082,7 @@ var la = class {
|
|
|
10075
10082
|
let r = new Blob([e], { type: n }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
10076
10083
|
a.href = i, a.download = t, document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(i);
|
|
10077
10084
|
}
|
|
10078
|
-
},
|
|
10085
|
+
}, pa = 1, ma = class extends G {
|
|
10079
10086
|
markers = [];
|
|
10080
10087
|
style = { ...i };
|
|
10081
10088
|
requestRender = null;
|
|
@@ -10096,7 +10103,7 @@ var la = class {
|
|
|
10096
10103
|
return { ...this.style };
|
|
10097
10104
|
}
|
|
10098
10105
|
addMarker(e) {
|
|
10099
|
-
let t = e.id ?? `tc_signal_${
|
|
10106
|
+
let t = e.id ?? `tc_signal_${pa++}`, n = {
|
|
10100
10107
|
...e,
|
|
10101
10108
|
id: t
|
|
10102
10109
|
};
|
|
@@ -10150,7 +10157,7 @@ var la = class {
|
|
|
10150
10157
|
renderArrow(e, t, n, r, i, a) {
|
|
10151
10158
|
e.fillStyle = a, e.beginPath(), r === "long" ? (e.moveTo(t, n - i), e.lineTo(t - i * .6, n), e.lineTo(t - i * .2, n), e.lineTo(t - i * .2, n + i * .4), e.lineTo(t + i * .2, n + i * .4), e.lineTo(t + i * .2, n), e.lineTo(t + i * .6, n)) : r === "short" ? (e.moveTo(t, n + i), e.lineTo(t - i * .6, n), e.lineTo(t - i * .2, n), e.lineTo(t - i * .2, n - i * .4), e.lineTo(t + i * .2, n - i * .4), e.lineTo(t + i * .2, n), e.lineTo(t + i * .6, n)) : e.arc(t, n, i * .4, 0, Math.PI * 2), e.closePath(), e.fill();
|
|
10152
10159
|
}
|
|
10153
|
-
},
|
|
10160
|
+
}, ha = 1, ga = class extends G {
|
|
10154
10161
|
zones = [];
|
|
10155
10162
|
style = { ...o };
|
|
10156
10163
|
requestRender = null;
|
|
@@ -10175,7 +10182,7 @@ var la = class {
|
|
|
10175
10182
|
return { ...this.style };
|
|
10176
10183
|
}
|
|
10177
10184
|
addZone(e) {
|
|
10178
|
-
let t = e.id ?? `tc_zone_${
|
|
10185
|
+
let t = e.id ?? `tc_zone_${ha++}`, n = {
|
|
10179
10186
|
...e,
|
|
10180
10187
|
id: t
|
|
10181
10188
|
};
|
|
@@ -10226,7 +10233,7 @@ var la = class {
|
|
|
10226
10233
|
}
|
|
10227
10234
|
a.showLabel && t.label && (e.font = `9px ${i.font.family}`, e.fillStyle = b, e.globalAlpha = .8, e.textBaseline = "top", e.textAlign = "left", e.fillText(t.label, f + 4, m + 3), e.globalAlpha = 1);
|
|
10228
10235
|
}
|
|
10229
|
-
},
|
|
10236
|
+
}, _a = class {
|
|
10230
10237
|
active = !1;
|
|
10231
10238
|
startBar = 0;
|
|
10232
10239
|
startPrice = 0;
|
|
@@ -10239,33 +10246,33 @@ var la = class {
|
|
|
10239
10246
|
}
|
|
10240
10247
|
begin(e, t, n) {
|
|
10241
10248
|
let r = Math.round(j(e.x, t)), i = M(e.y, t);
|
|
10242
|
-
this.startBar = r, this.startPrice = i, this.endBar = r, this.endPrice = i, this.startTime =
|
|
10249
|
+
this.startBar = r, this.startPrice = i, this.endBar = r, this.endPrice = i, this.startTime = va(r, n), this.endTime = this.startTime, this.active = !0;
|
|
10243
10250
|
}
|
|
10244
10251
|
update(e, t, n) {
|
|
10245
10252
|
if (!this.active) return;
|
|
10246
10253
|
let r = Math.round(j(e.x, t));
|
|
10247
|
-
this.endBar = r, this.endPrice = M(e.y, t), this.endTime =
|
|
10254
|
+
this.endBar = r, this.endPrice = M(e.y, t), this.endTime = va(r, n);
|
|
10248
10255
|
}
|
|
10249
10256
|
end() {
|
|
10250
10257
|
this.active = !1;
|
|
10251
10258
|
}
|
|
10252
10259
|
render(e, t, n) {
|
|
10253
10260
|
if (!this.active) return;
|
|
10254
|
-
let r = k(this.startBar, t), i = k(this.endBar, t), a = A(this.startPrice, t), o = A(this.endPrice, t), s = Math.min(r, i), c = Math.max(r, i), l = Math.min(a, o), u = Math.max(a, o), d = c - s, f = u - l, p = this.endPrice >= this.startPrice ? n.candleUp : n.candleDown, m =
|
|
10255
|
-
e.save(), e.fillStyle = m, e.fillRect(s, l, d, f), e.strokeStyle = p, e.lineWidth = 1, e.setLineDash([4, 3]), e.strokeRect(s + .5, l + .5, d, f), e.setLineDash([]), e.strokeStyle = p, e.lineWidth = 1.5, e.beginPath(), e.moveTo(r, a), e.lineTo(i, o), e.stroke(),
|
|
10256
|
-
let h = Math.abs(this.endBar - this.startBar), g = this.endPrice - this.startPrice, _ = this.startPrice === 0 ? 0 : g / this.startPrice * 100, v = this.startTime !== null && this.endTime !== null ?
|
|
10257
|
-
y.push(`${b}${
|
|
10261
|
+
let r = k(this.startBar, t), i = k(this.endBar, t), a = A(this.startPrice, t), o = A(this.endPrice, t), s = Math.min(r, i), c = Math.max(r, i), l = Math.min(a, o), u = Math.max(a, o), d = c - s, f = u - l, p = this.endPrice >= this.startPrice ? n.candleUp : n.candleDown, m = wa(p, .14);
|
|
10262
|
+
e.save(), e.fillStyle = m, e.fillRect(s, l, d, f), e.strokeStyle = p, e.lineWidth = 1, e.setLineDash([4, 3]), e.strokeRect(s + .5, l + .5, d, f), e.setLineDash([]), e.strokeStyle = p, e.lineWidth = 1.5, e.beginPath(), e.moveTo(r, a), e.lineTo(i, o), e.stroke(), xa(e, r, a, p), xa(e, i, o, p);
|
|
10263
|
+
let h = Math.abs(this.endBar - this.startBar), g = this.endPrice - this.startPrice, _ = this.startPrice === 0 ? 0 : g / this.startPrice * 100, v = this.startTime !== null && this.endTime !== null ? ba(Math.abs(this.endTime - this.startTime)) : null, y = [], b = g > 0 ? "+" : g < 0 ? "−" : "", x = Math.abs(g);
|
|
10264
|
+
y.push(`${b}${ya(x)} (${b}${Math.abs(_).toFixed(2)}%)`), y.push(`${h} bars${v ? " · " + v : ""}`), Sa(e, i, o, y, p, n), e.restore();
|
|
10258
10265
|
}
|
|
10259
10266
|
};
|
|
10260
|
-
function
|
|
10267
|
+
function va(e, t) {
|
|
10261
10268
|
if (e < 0 || e >= t.length) return null;
|
|
10262
10269
|
let n = t[e].time;
|
|
10263
10270
|
return n > 0xe8d4a51000 ? n : n * 1e3;
|
|
10264
10271
|
}
|
|
10265
|
-
function
|
|
10272
|
+
function ya(e) {
|
|
10266
10273
|
return e >= 1e3 ? e.toFixed(2) : e >= 1 ? e.toFixed(4) : e.toPrecision(4);
|
|
10267
10274
|
}
|
|
10268
|
-
function
|
|
10275
|
+
function ba(e) {
|
|
10269
10276
|
let t = e / 1e3;
|
|
10270
10277
|
if (t < 60) return `${t.toFixed(0)}s`;
|
|
10271
10278
|
let n = t / 60;
|
|
@@ -10277,10 +10284,10 @@ function ya(e) {
|
|
|
10277
10284
|
let a = i / 30;
|
|
10278
10285
|
return a < 12 ? `${a.toFixed(1)}mo` : `${(i / 365).toFixed(1)}y`;
|
|
10279
10286
|
}
|
|
10280
|
-
function
|
|
10287
|
+
function xa(e, t, n, r) {
|
|
10281
10288
|
e.fillStyle = r, e.beginPath(), e.arc(t, n, 3.5, 0, Math.PI * 2), e.fill(), e.fillStyle = "#fff", e.beginPath(), e.arc(t, n, 1.5, 0, Math.PI * 2), e.fill();
|
|
10282
10289
|
}
|
|
10283
|
-
function
|
|
10290
|
+
function Sa(e, t, n, r, i, a) {
|
|
10284
10291
|
e.font = `600 11px ${a.font.family}`;
|
|
10285
10292
|
let o = 0;
|
|
10286
10293
|
for (let t of r) {
|
|
@@ -10288,13 +10295,13 @@ function xa(e, t, n, r, i, a) {
|
|
|
10288
10295
|
n > o && (o = n);
|
|
10289
10296
|
}
|
|
10290
10297
|
let s = Math.ceil(o) + 16, c = r.length * 14 + 12, l = t + 8, u = n + 8, d = e.canvas.clientWidth || e.canvas.width;
|
|
10291
|
-
l + s > d - 4 && (l = t - s - 8), l < 4 && (l = 4), e.fillStyle = a.background, e.globalAlpha = .96,
|
|
10298
|
+
l + s > d - 4 && (l = t - s - 8), l < 4 && (l = 4), e.fillStyle = a.background, e.globalAlpha = .96, Ca(e, l, u, s, c, 6), e.fill(), e.globalAlpha = 1, e.strokeStyle = i, e.lineWidth = 1, Ca(e, l + .5, u + .5, s - 1, c - 1, 6), e.stroke(), e.fillStyle = a.text, e.textBaseline = "top", e.textAlign = "left";
|
|
10292
10299
|
for (let t = 0; t < r.length; t++) e.fillStyle = t === 0 ? i : a.textSecondary, e.fillText(r[t], l + 8, u + 6 + t * 14);
|
|
10293
10300
|
}
|
|
10294
|
-
function
|
|
10301
|
+
function Ca(e, t, n, r, i, a) {
|
|
10295
10302
|
e.beginPath(), e.moveTo(t + a, n), e.arcTo(t + r, n, t + r, n + i, a), e.arcTo(t + r, n + i, t, n + i, a), e.arcTo(t, n + i, t, n, a), e.arcTo(t, n, t + r, n, a), e.closePath();
|
|
10296
10303
|
}
|
|
10297
|
-
function
|
|
10304
|
+
function wa(e, t) {
|
|
10298
10305
|
if (e.startsWith("#")) {
|
|
10299
10306
|
let n = 0, r = 0, i = 0;
|
|
10300
10307
|
return e.length === 4 ? (n = parseInt(e[1] + e[1], 16), r = parseInt(e[2] + e[2], 16), i = parseInt(e[3] + e[3], 16)) : e.length >= 7 && (n = parseInt(e.slice(1, 3), 16), r = parseInt(e.slice(3, 5), 16), i = parseInt(e.slice(5, 7), 16)), `rgba(${n},${r},${i},${t})`;
|
|
@@ -10307,7 +10314,7 @@ function Ca(e, t) {
|
|
|
10307
10314
|
}
|
|
10308
10315
|
//#endregion
|
|
10309
10316
|
//#region src/animation/Animator.ts
|
|
10310
|
-
var
|
|
10317
|
+
var Ta = {
|
|
10311
10318
|
linear: (e) => e,
|
|
10312
10319
|
easeOutCubic: (e) => 1 - (1 - e) ** 3,
|
|
10313
10320
|
easeOutQuart: (e) => 1 - (1 - e) ** 4,
|
|
@@ -10315,7 +10322,7 @@ var wa = {
|
|
|
10315
10322
|
easeOutExpo: (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e),
|
|
10316
10323
|
easeOutElastic: (e) => e === 0 || e === 1 ? e : 2 ** (-10 * e) * Math.sin((e * 10 - .75) * (2 * Math.PI / 3)) + 1,
|
|
10317
10324
|
spring: (e) => 1 - Math.E ** (-6 * e) * Math.cos(8 * e)
|
|
10318
|
-
},
|
|
10325
|
+
}, Ea = class {
|
|
10319
10326
|
animations = /* @__PURE__ */ new Map();
|
|
10320
10327
|
frameId = 0;
|
|
10321
10328
|
running = !1;
|
|
@@ -10323,7 +10330,7 @@ var wa = {
|
|
|
10323
10330
|
this.animations.set(e, {
|
|
10324
10331
|
startTime: -1,
|
|
10325
10332
|
duration: t.duration,
|
|
10326
|
-
easing: t.easing ??
|
|
10333
|
+
easing: t.easing ?? Ta.easeOutCubic,
|
|
10327
10334
|
onUpdate: t.onUpdate,
|
|
10328
10335
|
onComplete: t.onComplete
|
|
10329
10336
|
}), this.running || (this.running = !0, this.tick());
|
|
@@ -10358,10 +10365,10 @@ var wa = {
|
|
|
10358
10365
|
};
|
|
10359
10366
|
//#endregion
|
|
10360
10367
|
//#region src/finance/BaseFinanceChart.ts
|
|
10361
|
-
function
|
|
10368
|
+
function Da(t) {
|
|
10362
10369
|
return !t || t === "dark" ? e : t === "light" ? c : t;
|
|
10363
10370
|
}
|
|
10364
|
-
var
|
|
10371
|
+
var Oa = class {
|
|
10365
10372
|
canvas;
|
|
10366
10373
|
ctx;
|
|
10367
10374
|
container;
|
|
@@ -10372,7 +10379,7 @@ var Da = class {
|
|
|
10372
10379
|
frameId = null;
|
|
10373
10380
|
resizeObserver;
|
|
10374
10381
|
constructor(e, t) {
|
|
10375
|
-
this.container = e, this.theme =
|
|
10382
|
+
this.container = e, this.theme = Da(t), this.canvas = document.createElement("canvas"), this.canvas.style.width = "100%", this.canvas.style.height = "100%", this.canvas.style.display = "block", e.appendChild(this.canvas), this.ctx = this.canvas.getContext("2d"), this.dpr = window.devicePixelRatio || 1, this.updateSize(), this.resizeObserver = new ResizeObserver(() => {
|
|
10376
10383
|
this.updateSize(), this.requestRender();
|
|
10377
10384
|
}), this.resizeObserver.observe(e);
|
|
10378
10385
|
}
|
|
@@ -10387,12 +10394,12 @@ var Da = class {
|
|
|
10387
10394
|
}));
|
|
10388
10395
|
}
|
|
10389
10396
|
setTheme(e) {
|
|
10390
|
-
this.theme =
|
|
10397
|
+
this.theme = Da(e), this.requestRender();
|
|
10391
10398
|
}
|
|
10392
10399
|
destroy() {
|
|
10393
10400
|
this.frameId !== null && cancelAnimationFrame(this.frameId), this.resizeObserver.disconnect(), this.canvas.remove();
|
|
10394
10401
|
}
|
|
10395
|
-
},
|
|
10402
|
+
}, ka = class {
|
|
10396
10403
|
pos = null;
|
|
10397
10404
|
canvas;
|
|
10398
10405
|
onUpdate;
|
|
@@ -10424,7 +10431,7 @@ var Da = class {
|
|
|
10424
10431
|
};
|
|
10425
10432
|
//#endregion
|
|
10426
10433
|
//#region src/finance/SparklineRenderer.ts
|
|
10427
|
-
function
|
|
10434
|
+
function Aa(e, t, n, r, i) {
|
|
10428
10435
|
let { data: a, mode: o = "area", lineWidth: s = 1.5, showLastPoint: c = !1, showMinMax: l = !1 } = r;
|
|
10429
10436
|
if (a.length < 2 || t <= 0 || n <= 0) return;
|
|
10430
10437
|
let u = r.color ?? i.lineColor, d = r.fillColor ?? u, f = t - 4, p = n - 4, m = Infinity, h = -Infinity, g = 0, _ = 0;
|
|
@@ -10449,8 +10456,8 @@ function ka(e, t, n, r, i) {
|
|
|
10449
10456
|
}
|
|
10450
10457
|
//#endregion
|
|
10451
10458
|
//#region src/finance/DepthChartRenderer.ts
|
|
10452
|
-
var
|
|
10453
|
-
function
|
|
10459
|
+
var ja = 50, Ma = 60, Na = 20, Pa = .2;
|
|
10460
|
+
function Fa(e) {
|
|
10454
10461
|
let t = [...e].sort((e, t) => t.price - e.price), n = [], r = 0;
|
|
10455
10462
|
for (let e of t) r += e.volume, n.push({
|
|
10456
10463
|
price: e.price,
|
|
@@ -10458,7 +10465,7 @@ function Pa(e) {
|
|
|
10458
10465
|
});
|
|
10459
10466
|
return n;
|
|
10460
10467
|
}
|
|
10461
|
-
function
|
|
10468
|
+
function Ia(e) {
|
|
10462
10469
|
let t = [...e].sort((e, t) => e.price - t.price), n = [], r = 0;
|
|
10463
10470
|
for (let e of t) r += e.volume, n.push({
|
|
10464
10471
|
price: e.price,
|
|
@@ -10466,20 +10473,20 @@ function Fa(e) {
|
|
|
10466
10473
|
});
|
|
10467
10474
|
return n;
|
|
10468
10475
|
}
|
|
10469
|
-
function
|
|
10476
|
+
function La(e, t) {
|
|
10470
10477
|
return {
|
|
10471
|
-
left:
|
|
10472
|
-
right: e -
|
|
10473
|
-
top:
|
|
10474
|
-
bottom: t -
|
|
10475
|
-
plotWidth: e -
|
|
10476
|
-
plotHeight: t -
|
|
10478
|
+
left: ja,
|
|
10479
|
+
right: e - Ma,
|
|
10480
|
+
top: Na,
|
|
10481
|
+
bottom: t - Na,
|
|
10482
|
+
plotWidth: e - ja - Ma,
|
|
10483
|
+
plotHeight: t - Na * 2
|
|
10477
10484
|
};
|
|
10478
10485
|
}
|
|
10479
|
-
function
|
|
10486
|
+
function Ra(e, t, n, r) {
|
|
10480
10487
|
e.fillStyle = r, e.fillRect(0, 0, t, n);
|
|
10481
10488
|
}
|
|
10482
|
-
function
|
|
10489
|
+
function za(e, t, n, r, i, a, o, s) {
|
|
10483
10490
|
let { left: c, right: l, top: u, bottom: d, plotWidth: f, plotHeight: p } = t;
|
|
10484
10491
|
e.save(), e.strokeStyle = a.grid, e.lineWidth = .5, e.fillStyle = a.axisLabel, e.font = `${a.font.sizeSmall}px ${a.font.family}`;
|
|
10485
10492
|
let h = m(0, i, 5);
|
|
@@ -10494,7 +10501,7 @@ function Ra(e, t, n, r, i, a, o, s) {
|
|
|
10494
10501
|
}
|
|
10495
10502
|
e.restore();
|
|
10496
10503
|
}
|
|
10497
|
-
function
|
|
10504
|
+
function Ba(e, t, n, r, i, a, o, s, c) {
|
|
10498
10505
|
if (t.length === 0) return;
|
|
10499
10506
|
let { left: l, bottom: u, plotWidth: d, plotHeight: f } = n, p = (e) => l + (e - r) / i * d, m = (e) => u - e / a * f;
|
|
10500
10507
|
if (e.beginPath(), c === "bid") {
|
|
@@ -10527,14 +10534,14 @@ function za(e, t, n, r, i, a, o, s, c) {
|
|
|
10527
10534
|
}
|
|
10528
10535
|
e.strokeStyle = s, e.lineWidth = 1.5, e.stroke();
|
|
10529
10536
|
}
|
|
10530
|
-
function
|
|
10537
|
+
function Va(e, t, n, r, i, a, o, s, c) {
|
|
10531
10538
|
let { left: l, top: u, bottom: d, plotWidth: f } = r, p = l + (t - i) / a * f;
|
|
10532
10539
|
if (e.save(), e.strokeStyle = o.textSecondary, e.lineWidth = 1, e.setLineDash([4, 4]), e.beginPath(), e.moveTo(p, u), e.lineTo(p, d), e.stroke(), e.restore(), s) {
|
|
10533
10540
|
let t = `Spread: ${c(n)}`;
|
|
10534
10541
|
e.save(), e.font = `${o.font.sizeSmall}px ${o.font.family}`, e.fillStyle = o.textSecondary, e.textAlign = "center", e.textBaseline = "bottom", e.fillText(t, p, u - 2), e.restore();
|
|
10535
10542
|
}
|
|
10536
10543
|
}
|
|
10537
|
-
function
|
|
10544
|
+
function Ha(e, t, n, r, i, a, o, s, c, l, u) {
|
|
10538
10545
|
let { left: d, top: f, bottom: p, plotWidth: m, plotHeight: h } = i, g = t.x;
|
|
10539
10546
|
if (g < d || g > i.right) return;
|
|
10540
10547
|
let _ = a + (g - d) / m * o, v = 0, y = "";
|
|
@@ -10560,47 +10567,47 @@ function Va(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
10560
10567
|
for (let t = 0; t < b.length; t++) e.fillText(b[t], C + 8, w + 6 + t * (c.font.sizeSmall + 4));
|
|
10561
10568
|
e.restore();
|
|
10562
10569
|
}
|
|
10563
|
-
function
|
|
10570
|
+
function Ua(e) {
|
|
10564
10571
|
return e.toFixed(2);
|
|
10565
10572
|
}
|
|
10566
|
-
function
|
|
10573
|
+
function Wa(e) {
|
|
10567
10574
|
return e >= 1e6 ? (e / 1e6).toFixed(2) + "M" : e >= 1e3 ? (e / 1e3).toFixed(1) + "K" : e.toFixed(0);
|
|
10568
10575
|
}
|
|
10569
|
-
function
|
|
10576
|
+
function Ga(e, t, n, r, i, a) {
|
|
10570
10577
|
let { data: o } = r;
|
|
10571
10578
|
if (o.bids.length === 0 && o.asks.length === 0 || t <= 0 || n <= 0) return;
|
|
10572
|
-
let s = r.bidColor ?? i.candleUp, c = r.askColor ?? i.candleDown, l = r.bidFillColor ?? s + "40", u = r.askFillColor ?? c + "40", d = r.midPriceLine !== !1, f = r.spreadLabel !== !1, p = r.priceFormat ??
|
|
10573
|
-
|
|
10579
|
+
let s = r.bidColor ?? i.candleUp, c = r.askColor ?? i.candleDown, l = r.bidFillColor ?? s + "40", u = r.askFillColor ?? c + "40", d = r.midPriceLine !== !1, f = r.spreadLabel !== !1, p = r.priceFormat ?? Ua, m = r.volumeFormat ?? Wa, h = Fa(o.bids), g = Ia(o.asks), _ = h.length > 0 ? h[0].price : 0, v = g.length > 0 ? g[0].price : 0, y = h.length > 0 && g.length > 0 ? (_ + v) / 2 : _ || v, b = g.length > 0 && h.length > 0 ? v - _ : 0, x = h.length > 0 ? h[h.length - 1].price : y, S = g.length > 0 ? g[g.length - 1].price : y, C = Math.max(y - x, S - y) * (1 + Pa), w = y - C, T = y + C, E = T - w, D = h.length > 0 ? h[h.length - 1].cumulativeVolume : 0, O = g.length > 0 ? g[g.length - 1].cumulativeVolume : 0, k = Math.max(D, O) || 1, A = La(t, n);
|
|
10580
|
+
Ra(e, t, n, i.background), za(e, A, w, T, k, i, p, m), Ba(e, h, A, w, E, k, l, s, "bid"), Ba(e, g, A, w, E, k, u, c, "ask"), d && Va(e, y, b, A, w, E, i, f, p), a && Ha(e, a, h, g, A, w, E, k, i, p, m);
|
|
10574
10581
|
}
|
|
10575
10582
|
//#endregion
|
|
10576
10583
|
//#region src/finance/EquityCurveRenderer.ts
|
|
10577
|
-
var
|
|
10578
|
-
function
|
|
10584
|
+
var Ka = 70, qa = 30, Ja = 20, Ya = 20, Xa = .05;
|
|
10585
|
+
function Za(e, t) {
|
|
10579
10586
|
return {
|
|
10580
|
-
left:
|
|
10581
|
-
right: e -
|
|
10582
|
-
top:
|
|
10583
|
-
bottom: t -
|
|
10584
|
-
plotWidth: e -
|
|
10585
|
-
plotHeight: t -
|
|
10587
|
+
left: Ka,
|
|
10588
|
+
right: e - Ja,
|
|
10589
|
+
top: Ya,
|
|
10590
|
+
bottom: t - qa,
|
|
10591
|
+
plotWidth: e - Ka - Ja,
|
|
10592
|
+
plotHeight: t - Ya - qa
|
|
10586
10593
|
};
|
|
10587
10594
|
}
|
|
10588
|
-
function
|
|
10595
|
+
function Qa(e, t) {
|
|
10589
10596
|
let n = Infinity, r = -Infinity;
|
|
10590
10597
|
for (let t of e) t.value < n && (n = t.value), t.value > r && (r = t.value);
|
|
10591
10598
|
if (t) for (let e of t) e.value < n && (n = e.value), e.value > r && (r = e.value);
|
|
10592
|
-
let i = (r - n) *
|
|
10599
|
+
let i = (r - n) * Xa;
|
|
10593
10600
|
return {
|
|
10594
10601
|
valMin: n - i,
|
|
10595
10602
|
valMax: r + i
|
|
10596
10603
|
};
|
|
10597
10604
|
}
|
|
10598
|
-
function
|
|
10605
|
+
function $a(e) {
|
|
10599
10606
|
let t = [], n = -Infinity;
|
|
10600
10607
|
for (let r of e) r.value > n && (n = r.value), t.push(n);
|
|
10601
10608
|
return t;
|
|
10602
10609
|
}
|
|
10603
|
-
function
|
|
10610
|
+
function eo(e) {
|
|
10604
10611
|
let t = 864e5;
|
|
10605
10612
|
if (365.25 * t, e < 7 * t) {
|
|
10606
10613
|
let e = new Intl.DateTimeFormat(void 0, {
|
|
@@ -10622,13 +10629,13 @@ function $a(e) {
|
|
|
10622
10629
|
});
|
|
10623
10630
|
return (e) => n.format(new Date(e));
|
|
10624
10631
|
}
|
|
10625
|
-
function
|
|
10632
|
+
function to(e) {
|
|
10626
10633
|
return Math.abs(e) >= 1e6 ? (e / 1e6).toFixed(2) + "M" : Math.abs(e) >= 1e3 ? (e / 1e3).toFixed(1) + "K" : e.toFixed(2);
|
|
10627
10634
|
}
|
|
10628
|
-
function
|
|
10635
|
+
function no(e, t, n, r) {
|
|
10629
10636
|
e.fillStyle = r, e.fillRect(0, 0, t, n);
|
|
10630
10637
|
}
|
|
10631
|
-
function
|
|
10638
|
+
function ro(e, t, n, r, i, a, o, s, c) {
|
|
10632
10639
|
let { left: l, right: u, top: d, bottom: f, plotWidth: p, plotHeight: h } = t;
|
|
10633
10640
|
e.save(), e.strokeStyle = o.grid, e.lineWidth = .5, e.fillStyle = o.axisLabel, e.font = `${o.font.sizeSmall}px ${o.font.family}`;
|
|
10634
10641
|
let g = m(n, r, 6), _ = Math.ceil(n / g) * g;
|
|
@@ -10643,21 +10650,21 @@ function no(e, t, n, r, i, a, o, s, c) {
|
|
|
10643
10650
|
}
|
|
10644
10651
|
e.restore();
|
|
10645
10652
|
}
|
|
10646
|
-
function
|
|
10653
|
+
function io(e, t, n, r, i, a, o, s, c) {
|
|
10647
10654
|
if (t.length < 2) return;
|
|
10648
10655
|
let { left: l, bottom: u, plotWidth: d, plotHeight: f } = n, p = (e) => l + (e - r) / i * d, m = (e) => u - (e - a) / o * f;
|
|
10649
10656
|
e.save(), e.beginPath(), e.moveTo(p(t[0].time), m(t[0].value));
|
|
10650
10657
|
for (let n = 1; n < t.length; n++) e.lineTo(p(t[n].time), m(t[n].value));
|
|
10651
10658
|
e.strokeStyle = s, e.lineWidth = c, e.lineJoin = "round", e.stroke(), e.restore();
|
|
10652
10659
|
}
|
|
10653
|
-
function
|
|
10660
|
+
function ao(e, t, n, r, i, a, o, s) {
|
|
10654
10661
|
if (t.length < 2) return;
|
|
10655
10662
|
let { left: c, bottom: l, plotWidth: u, plotHeight: d } = n, f = (e) => c + (e - r) / i * u, p = (e) => l - (e - a) / o * d, m = e.createLinearGradient(0, n.top, 0, l);
|
|
10656
10663
|
m.addColorStop(0, s + "40"), m.addColorStop(1, "transparent"), e.save(), e.beginPath(), e.moveTo(f(t[0].time), p(t[0].value));
|
|
10657
10664
|
for (let n = 1; n < t.length; n++) e.lineTo(f(t[n].time), p(t[n].value));
|
|
10658
10665
|
e.lineTo(f(t[t.length - 1].time), l), e.lineTo(f(t[0].time), l), e.closePath(), e.fillStyle = m, e.fill(), e.restore();
|
|
10659
10666
|
}
|
|
10660
|
-
function
|
|
10667
|
+
function oo(e, t, n, r, i, a, o, s, c) {
|
|
10661
10668
|
if (t.length < 2) return;
|
|
10662
10669
|
let { left: l, bottom: u, plotWidth: d, plotHeight: f } = r, p = (e) => l + (e - i) / a * d, m = (e) => u - (e - o) / s * f;
|
|
10663
10670
|
e.save(), e.fillStyle = c, e.beginPath(), e.moveTo(p(t[0].time), m(n[0]));
|
|
@@ -10665,12 +10672,12 @@ function ao(e, t, n, r, i, a, o, s, c) {
|
|
|
10665
10672
|
for (let n = t.length - 1; n >= 0; n--) e.lineTo(p(t[n].time), m(t[n].value));
|
|
10666
10673
|
e.closePath(), e.fill(), e.restore();
|
|
10667
10674
|
}
|
|
10668
|
-
function
|
|
10675
|
+
function so(e, t, n, r, i, a, o, s, c, l) {
|
|
10669
10676
|
if (t.length === 0) return;
|
|
10670
10677
|
let { left: u, bottom: d, plotWidth: f, plotHeight: p } = n, m = t[t.length - 1], h = u + (m.time - r) / i * f, g = d - (m.value - a) / o * p;
|
|
10671
10678
|
e.save(), e.font = `${l.font.sizeSmall}px ${l.font.family}`, e.fillStyle = c, e.textAlign = "left", e.textBaseline = "middle", e.fillText(s, h + 4, g), e.restore();
|
|
10672
10679
|
}
|
|
10673
|
-
function
|
|
10680
|
+
function co(e, t, n, r, i, a, o, s, c, l, u, d) {
|
|
10674
10681
|
let { left: f, top: p, bottom: m, plotWidth: h, plotHeight: g } = i, _ = t.x;
|
|
10675
10682
|
if (_ < f || _ > i.right) return;
|
|
10676
10683
|
e.save(), e.strokeStyle = l.crosshair, e.lineWidth = .5, e.setLineDash([4, 4]), e.beginPath(), e.moveTo(_, p), e.lineTo(_, m), e.stroke(), e.restore();
|
|
@@ -10688,15 +10695,15 @@ function so(e, t, n, r, i, a, o, s, c, l, u, d) {
|
|
|
10688
10695
|
for (let t = 0; t < S.length; t++) e.fillText(S[t], D + 8, O + 6 + t * (l.font.sizeSmall + 4));
|
|
10689
10696
|
e.restore();
|
|
10690
10697
|
}
|
|
10691
|
-
function
|
|
10698
|
+
function lo(e, t, n, r, i, a) {
|
|
10692
10699
|
let { data: o } = r;
|
|
10693
10700
|
if (o.length < 2 || t <= 0 || n <= 0) return;
|
|
10694
|
-
let s = r.lineColor ?? i.lineColor, c = r.lineWidth ?? 1.5, l = r.drawdown === !0, u = r.drawdownColor ?? i.candleDown + "30", d = r.fillArea === !0, f = r.benchmark, p = r.benchmarkColor ?? i.textSecondary, m = r.benchmarkLabel ?? "Benchmark", h = r.valueFormat ??
|
|
10695
|
-
|
|
10701
|
+
let s = r.lineColor ?? i.lineColor, c = r.lineWidth ?? 1.5, l = r.drawdown === !0, u = r.drawdownColor ?? i.candleDown + "30", d = r.fillArea === !0, f = r.benchmark, p = r.benchmarkColor ?? i.textSecondary, m = r.benchmarkLabel ?? "Benchmark", h = r.valueFormat ?? to, { valMin: g, valMax: _ } = Qa(o, f), v = _ - g || 1, y = o[0].time, b = o[o.length - 1].time, x = b - y || 1, S = r.timeFormat ?? eo(x), C = Za(t, n);
|
|
10702
|
+
no(e, t, n, i.background), ro(e, C, g, _, y, b, i, h, S), l && oo(e, o, $a(o), C, y, x, g, v, u), d && ao(e, o, C, y, x, g, v, s), io(e, o, C, y, x, g, v, s, c), f && f.length >= 2 && (io(e, f, C, y, x, g, v, p, 1), so(e, f, C, y, x, g, v, m, p, i)), a && co(e, a, o, f, C, y, x, g, v, i, S, h);
|
|
10696
10703
|
}
|
|
10697
10704
|
//#endregion
|
|
10698
10705
|
//#region src/finance/HeatmapLayout.ts
|
|
10699
|
-
function
|
|
10706
|
+
function uo(e, t, n) {
|
|
10700
10707
|
if (e.length === 0) return [];
|
|
10701
10708
|
let r = e.length, i = Math.ceil(Math.sqrt(r)), a = Math.ceil(r / i), o = t.width / i, s = t.height / a, c = [];
|
|
10702
10709
|
for (let a = 0; a < r; a++) {
|
|
@@ -10713,7 +10720,7 @@ function lo(e, t, n) {
|
|
|
10713
10720
|
}
|
|
10714
10721
|
return c;
|
|
10715
10722
|
}
|
|
10716
|
-
function
|
|
10723
|
+
function fo(e, t) {
|
|
10717
10724
|
let n = e.reduce((e, t) => e + t, 0);
|
|
10718
10725
|
if (n === 0 || t === 0) return Infinity;
|
|
10719
10726
|
let r = 0;
|
|
@@ -10723,7 +10730,7 @@ function uo(e, t) {
|
|
|
10723
10730
|
}
|
|
10724
10731
|
return r;
|
|
10725
10732
|
}
|
|
10726
|
-
function
|
|
10733
|
+
function po(e, t, n, r, i, a) {
|
|
10727
10734
|
let o = r ? n.height : n.width, s = e.reduce((e, t) => e + t, 0), c = o > 0 ? s / o : 0, l = 0;
|
|
10728
10735
|
for (let o = 0; o < e.length; o++) {
|
|
10729
10736
|
let s = c > 0 ? e[o] / c : 0, u;
|
|
@@ -10743,19 +10750,19 @@ function fo(e, t, n, r, i, a) {
|
|
|
10743
10750
|
}), l += s;
|
|
10744
10751
|
}
|
|
10745
10752
|
}
|
|
10746
|
-
function
|
|
10753
|
+
function mo(e, t, n, r, i) {
|
|
10747
10754
|
if (e.length === 0) return;
|
|
10748
10755
|
let a = n.width >= n.height, o = a ? n.height : n.width;
|
|
10749
10756
|
if (e.length === 1) {
|
|
10750
|
-
|
|
10757
|
+
po(e, t, n, a, r, i);
|
|
10751
10758
|
return;
|
|
10752
10759
|
}
|
|
10753
10760
|
let s = [], c = [], l = 0;
|
|
10754
10761
|
for (; l < e.length;) {
|
|
10755
10762
|
let u = [...s, e[l]];
|
|
10756
|
-
if (s.length === 0 ||
|
|
10763
|
+
if (s.length === 0 || fo(u, o) <= fo(s, o)) s.push(e[l]), c.push(t[l]), l++;
|
|
10757
10764
|
else {
|
|
10758
|
-
|
|
10765
|
+
po(s, c, n, a, r, i);
|
|
10759
10766
|
let u = s.reduce((e, t) => e + t, 0), d = o > 0 ? u / o : 0;
|
|
10760
10767
|
n = a ? {
|
|
10761
10768
|
x: n.x + d,
|
|
@@ -10767,28 +10774,28 @@ function po(e, t, n, r, i) {
|
|
|
10767
10774
|
y: n.y + d,
|
|
10768
10775
|
width: n.width,
|
|
10769
10776
|
height: n.height - d
|
|
10770
|
-
},
|
|
10777
|
+
}, mo(e.slice(l), t.slice(l), n, r, i);
|
|
10771
10778
|
return;
|
|
10772
10779
|
}
|
|
10773
10780
|
}
|
|
10774
|
-
s.length > 0 &&
|
|
10781
|
+
s.length > 0 && po(s, c, n, a, r, i);
|
|
10775
10782
|
}
|
|
10776
|
-
function
|
|
10783
|
+
function ho(e, t, n) {
|
|
10777
10784
|
if (e.length === 0) return [];
|
|
10778
10785
|
let r = [...e].sort((e, t) => t.weight - e.weight), i = r.reduce((e, t) => e + Math.max(0, t.weight), 0);
|
|
10779
10786
|
if (i === 0) return [];
|
|
10780
10787
|
let a = t.width * t.height, o = r.map((e) => Math.max(0, e.weight) / i * a), s = r.map((e) => e.id), c = [];
|
|
10781
|
-
return
|
|
10788
|
+
return mo(o, s, { ...t }, n, c), c;
|
|
10782
10789
|
}
|
|
10783
10790
|
//#endregion
|
|
10784
10791
|
//#region src/finance/HeatmapRenderer.ts
|
|
10785
|
-
function
|
|
10792
|
+
function go(e) {
|
|
10786
10793
|
return (e >= 0 ? "+" : "") + e.toFixed(2) + "%";
|
|
10787
10794
|
}
|
|
10788
|
-
function
|
|
10795
|
+
function _o(e) {
|
|
10789
10796
|
return e.label;
|
|
10790
10797
|
}
|
|
10791
|
-
function
|
|
10798
|
+
function vo(e, t) {
|
|
10792
10799
|
let n = t.min ?? -5, r = t.max ?? 5;
|
|
10793
10800
|
if (e <= n) return t.negative;
|
|
10794
10801
|
if (e >= r) return t.positive;
|
|
@@ -10799,11 +10806,11 @@ function _o(e, t) {
|
|
|
10799
10806
|
let i = e / r;
|
|
10800
10807
|
return v(t.zero, t.positive, i);
|
|
10801
10808
|
}
|
|
10802
|
-
function
|
|
10809
|
+
function yo(e, t, n, r, i, a) {
|
|
10803
10810
|
let o = Math.min(a, r / 2, i / 2);
|
|
10804
10811
|
e.beginPath(), e.moveTo(t + o, n), e.lineTo(t + r - o, n), e.arcTo(t + r, n, t + r, n + o, o), e.lineTo(t + r, n + i - o), e.arcTo(t + r, n + i, t + r - o, n + i, o), e.lineTo(t + o, n + i), e.arcTo(t, n + i, t, n + i - o, o), e.lineTo(t, n + o), e.arcTo(t, n, t + o, n, o), e.closePath();
|
|
10805
10812
|
}
|
|
10806
|
-
function
|
|
10813
|
+
function bo(e, t, n, r, i, a, o, s, c, l, u) {
|
|
10807
10814
|
if (i < 40 || a < 30) return;
|
|
10808
10815
|
let d = n + i / 2, f = r + a / 2;
|
|
10809
10816
|
if (e.save(), e.shadowColor = "rgba(0,0,0,0.6)", e.shadowBlur = 2, e.fillStyle = "#FFFFFF", e.textAlign = "center", s) {
|
|
@@ -10816,22 +10823,22 @@ function yo(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
10816
10823
|
}
|
|
10817
10824
|
e.restore();
|
|
10818
10825
|
}
|
|
10819
|
-
function
|
|
10826
|
+
function xo(e, t, n, r, i, a, o, s) {
|
|
10820
10827
|
let c = [o(t), s(t.value)];
|
|
10821
10828
|
if (t.meta) for (let [e, n] of Object.entries(t.meta)) c.push(e + ": " + String(n));
|
|
10822
10829
|
e.save(), e.font = a.font.sizeSmall + "px " + a.font.family;
|
|
10823
10830
|
let l = Math.max(...c.map((t) => e.measureText(t).width)) + 16, u = a.font.sizeSmall + 4, d = c.length * u + 12, f = n.x + 14, p = n.y - d / 2;
|
|
10824
|
-
f + l > r && (f = n.x - l - 14), p < 0 && (p = 0), p + d > i && (p = i - d), e.fillStyle = a.axisLabelBackground, e.globalAlpha = .92,
|
|
10831
|
+
f + l > r && (f = n.x - l - 14), p < 0 && (p = 0), p + d > i && (p = i - d), e.fillStyle = a.axisLabelBackground, e.globalAlpha = .92, yo(e, f, p, l, d, 4), e.fill(), e.globalAlpha = 1, e.fillStyle = a.text, e.textBaseline = "top", e.textAlign = "left";
|
|
10825
10832
|
for (let t = 0; t < c.length; t++) e.fillText(c[t], f + 8, p + 6 + t * u);
|
|
10826
10833
|
e.restore();
|
|
10827
10834
|
}
|
|
10828
|
-
function
|
|
10835
|
+
function So(e, t, n, r, i, a, o, s) {
|
|
10829
10836
|
if (r.length === 0 || i.length === 0 || t <= 0 || n <= 0) return null;
|
|
10830
10837
|
let c = a.colorScale ?? {
|
|
10831
10838
|
negative: "#EF5350",
|
|
10832
10839
|
zero: "#424242",
|
|
10833
10840
|
positive: "#26A69A"
|
|
10834
|
-
}, l = a.cellRadius ?? 4, u = a.showLabels !== !1, d = a.showValues !== !1, f = a.valueFormat ??
|
|
10841
|
+
}, l = a.cellRadius ?? 4, u = a.showLabels !== !1, d = a.showValues !== !1, f = a.valueFormat ?? go, p = a.labelFormat ?? _o, m = /* @__PURE__ */ new Map();
|
|
10835
10842
|
for (let e of r) m.set(e.id, e);
|
|
10836
10843
|
let h = null, g = null;
|
|
10837
10844
|
if (s) for (let e of i) {
|
|
@@ -10852,37 +10859,37 @@ function xo(e, t, n, r, i, a, o, s) {
|
|
|
10852
10859
|
if (!n) continue;
|
|
10853
10860
|
let { x: r, y: i, width: a, height: s } = t.rect;
|
|
10854
10861
|
if (a <= 0 || s <= 0) continue;
|
|
10855
|
-
let g =
|
|
10856
|
-
|
|
10862
|
+
let g = vo(n.value, c);
|
|
10863
|
+
yo(e, r, i, a, s, l), e.fillStyle = g, e.fill(), bo(e, n, r, i, a, s, o, u, d, p, f), t.id === h && (yo(e, r, i, a, s, l), e.strokeStyle = "#FFFFFF", e.lineWidth = 1.5, e.stroke());
|
|
10857
10864
|
}
|
|
10858
|
-
return g && s &&
|
|
10865
|
+
return g && s && xo(e, g.cell, s, t, n, o, p, f), g;
|
|
10859
10866
|
}
|
|
10860
10867
|
//#endregion
|
|
10861
10868
|
//#region src/finance/WaterfallRenderer.ts
|
|
10862
|
-
var
|
|
10863
|
-
function
|
|
10869
|
+
var Co = 60, wo = 12, To = 24, Eo = 40, Do = .7, Oo = 1;
|
|
10870
|
+
function ko(e) {
|
|
10864
10871
|
return e.type ? e.type : e.value > 0 ? "positive" : e.value < 0 ? "negative" : "subtotal";
|
|
10865
10872
|
}
|
|
10866
|
-
function
|
|
10873
|
+
function Ao(e) {
|
|
10867
10874
|
let t = Math.abs(e);
|
|
10868
10875
|
return t >= 1e6 ? (e / 1e6).toFixed(2) + "M" : t >= 1e3 ? (e / 1e3).toFixed(1) + "K" : e.toFixed(2);
|
|
10869
10876
|
}
|
|
10870
|
-
function
|
|
10877
|
+
function jo(e, t) {
|
|
10871
10878
|
return {
|
|
10872
|
-
left:
|
|
10873
|
-
right: e -
|
|
10874
|
-
top:
|
|
10875
|
-
bottom: t -
|
|
10876
|
-
plotWidth: e -
|
|
10877
|
-
plotHeight: t -
|
|
10879
|
+
left: Co,
|
|
10880
|
+
right: e - wo,
|
|
10881
|
+
top: To,
|
|
10882
|
+
bottom: t - Eo,
|
|
10883
|
+
plotWidth: e - Co - wo,
|
|
10884
|
+
plotHeight: t - To - Eo
|
|
10878
10885
|
};
|
|
10879
10886
|
}
|
|
10880
|
-
function
|
|
10887
|
+
function Mo(e, t, n, r, i) {
|
|
10881
10888
|
let a = Array(e.length), o = Array(e.length), s = t.plotWidth / e.length, c = s * n, l = (s - c) / 2, { left: u, bottom: d, plotHeight: f } = t, p = 0;
|
|
10882
10889
|
for (let t = 0; t < e.length; t++) {
|
|
10883
|
-
let n = e[t], m =
|
|
10890
|
+
let n = e[t], m = ko(n), h, g;
|
|
10884
10891
|
m === "total" || m === "subtotal" ? (h = 0, g = n.value, p = n.value) : (h = p, g = p + n.value, p = g);
|
|
10885
|
-
let _ = Math.min(h, g), v = Math.max(h, g), y = d - (_ - r) / i * f, b = d - (v - r) / i * f, x = Math.min(y, b), S = Math.max(Math.abs(b - y),
|
|
10892
|
+
let _ = Math.min(h, g), v = Math.max(h, g), y = d - (_ - r) / i * f, b = d - (v - r) / i * f, x = Math.min(y, b), S = Math.max(Math.abs(b - y), Oo), C = u + t * s, w = C + l;
|
|
10886
10893
|
a[t] = {
|
|
10887
10894
|
label: n.label,
|
|
10888
10895
|
value: n.value,
|
|
@@ -10902,14 +10909,14 @@ function jo(e, t, n, r, i) {
|
|
|
10902
10909
|
cumulatives: o
|
|
10903
10910
|
};
|
|
10904
10911
|
}
|
|
10905
|
-
function
|
|
10912
|
+
function No(e) {
|
|
10906
10913
|
if (e.length === 0) return {
|
|
10907
10914
|
valMin: 0,
|
|
10908
10915
|
valMax: 1
|
|
10909
10916
|
};
|
|
10910
10917
|
let t = 0, n = 0, r = 0;
|
|
10911
10918
|
for (let i = 0; i < e.length; i++) {
|
|
10912
|
-
let a = e[i], o =
|
|
10919
|
+
let a = e[i], o = ko(a), s, c;
|
|
10913
10920
|
o === "total" || o === "subtotal" ? (s = 0, c = a.value, r = a.value) : (s = r, c = r + a.value, r = c), s < t && (t = s), c < t && (t = c), s > n && (n = s), c > n && (n = c);
|
|
10914
10921
|
}
|
|
10915
10922
|
let i = (n - t || 1) * .1;
|
|
@@ -10918,10 +10925,10 @@ function Mo(e) {
|
|
|
10918
10925
|
valMax: n + i
|
|
10919
10926
|
};
|
|
10920
10927
|
}
|
|
10921
|
-
function
|
|
10928
|
+
function Po(e, t, n, r) {
|
|
10922
10929
|
e.fillStyle = r, e.fillRect(0, 0, t, n);
|
|
10923
10930
|
}
|
|
10924
|
-
function
|
|
10931
|
+
function Fo(e, t, n, r, i, a) {
|
|
10925
10932
|
let { left: o, right: s, top: c, bottom: l, plotHeight: u } = t, d = r - n || 1;
|
|
10926
10933
|
e.strokeStyle = i.grid, e.lineWidth = .5, e.fillStyle = i.axisLabel, e.font = `${i.font.sizeSmall}px ${i.font.family}`, e.textAlign = "right", e.textBaseline = "middle";
|
|
10927
10934
|
let f = m(n, r, 5), p = Math.ceil(n / f) * f;
|
|
@@ -10940,7 +10947,7 @@ function Po(e, t, n, r, i, a) {
|
|
|
10940
10947
|
e.strokeStyle = i.axisLine, e.lineWidth = 1, e.beginPath(), e.moveTo(o, t), e.lineTo(s, t), e.stroke();
|
|
10941
10948
|
}
|
|
10942
10949
|
}
|
|
10943
|
-
function
|
|
10950
|
+
function Io(e, t, n) {
|
|
10944
10951
|
let r = [
|
|
10945
10952
|
"positive",
|
|
10946
10953
|
"negative",
|
|
@@ -10959,7 +10966,7 @@ function Fo(e, t, n) {
|
|
|
10959
10966
|
s && (e.fillStyle = o, e.fill());
|
|
10960
10967
|
}
|
|
10961
10968
|
}
|
|
10962
|
-
function
|
|
10969
|
+
function Lo(e, t, n, r, i, a, o) {
|
|
10963
10970
|
if (o === "none" || t.length < 2) return;
|
|
10964
10971
|
let { bottom: s, plotHeight: c } = n;
|
|
10965
10972
|
e.strokeStyle = a, e.lineWidth = 1, o === "dashed" ? e.setLineDash([4, 4]) : e.setLineDash([]), e.beginPath();
|
|
@@ -10969,7 +10976,7 @@ function Io(e, t, n, r, i, a, o) {
|
|
|
10969
10976
|
}
|
|
10970
10977
|
e.stroke(), e.setLineDash([]);
|
|
10971
10978
|
}
|
|
10972
|
-
function
|
|
10979
|
+
function Ro(e, t, n, r, i, a) {
|
|
10973
10980
|
e.fillStyle = r.text, e.font = `${r.font.sizeSmall}px ${r.font.family}`, e.textAlign = "center";
|
|
10974
10981
|
for (let r = 0; r < t.length; r++) {
|
|
10975
10982
|
let o = t[r], s;
|
|
@@ -10978,7 +10985,7 @@ function Lo(e, t, n, r, i, a) {
|
|
|
10978
10985
|
o.end < o.start ? (e.textBaseline = "top", e.fillText(s, c, o.rectY + o.rectH + 4)) : (e.textBaseline = "bottom", e.fillText(s, c, o.rectY - 4));
|
|
10979
10986
|
}
|
|
10980
10987
|
}
|
|
10981
|
-
function
|
|
10988
|
+
function zo(e, t, n, r, i) {
|
|
10982
10989
|
e.fillStyle = r.axisLabel, e.font = `${r.font.sizeSmall}px ${r.font.family}`, e.textAlign = "center", e.textBaseline = "top";
|
|
10983
10990
|
let a = n.bottom + 6, o = t.length > 0 ? t[0].slotW - 4 : 0, s = !1;
|
|
10984
10991
|
for (let n = 0; n < t.length; n++) if (e.measureText(i(t[n].label)).width > o) {
|
|
@@ -10999,7 +11006,7 @@ function Ro(e, t, n, r, i) {
|
|
|
10999
11006
|
}
|
|
11000
11007
|
e.setTransform(1, 0, 0, 1, 0, 0), e.restore();
|
|
11001
11008
|
}
|
|
11002
|
-
function
|
|
11009
|
+
function Bo(e, t, n) {
|
|
11003
11010
|
if (t < n.left || t > n.right) return null;
|
|
11004
11011
|
for (let n = 0; n < e.length; n++) {
|
|
11005
11012
|
let r = e[n];
|
|
@@ -11007,7 +11014,7 @@ function zo(e, t, n) {
|
|
|
11007
11014
|
}
|
|
11008
11015
|
return null;
|
|
11009
11016
|
}
|
|
11010
|
-
function
|
|
11017
|
+
function Vo(e, t, n, r, i, a, o, s) {
|
|
11011
11018
|
let c = t[r], l = n[r], u = Math.round(c.slotX + c.slotW / 2) + .5;
|
|
11012
11019
|
e.strokeStyle = o.crosshair, e.lineWidth = .5, e.setLineDash([4, 4]), e.beginPath(), e.moveTo(u, a.top), e.lineTo(u, a.bottom), e.stroke(), e.setLineDash([]);
|
|
11013
11020
|
let d = [
|
|
@@ -11026,31 +11033,31 @@ function Bo(e, t, n, r, i, a, o, s) {
|
|
|
11026
11033
|
let _ = o.font.sizeSmall + 4;
|
|
11027
11034
|
for (let t = 0; t < d.length; t++) e.fillText(d[t], h + 8, g + 6 + t * _);
|
|
11028
11035
|
}
|
|
11029
|
-
function
|
|
11036
|
+
function Ho(e, t, n, r, i, a) {
|
|
11030
11037
|
let { data: o } = r;
|
|
11031
11038
|
if (!o || o.length === 0 || t <= 0 || n <= 0) return { hitBar: null };
|
|
11032
|
-
let s = r.positiveColor ?? i.candleUp, c = r.negativeColor ?? i.candleDown, l = r.totalColor ?? i.lineColor, u = r.subtotalColor ?? i.textSecondary, d = r.connectorColor ?? i.textSecondary, f = r.connectorStyle ?? "dashed", p = r.barWidth ??
|
|
11033
|
-
|
|
11039
|
+
let s = r.positiveColor ?? i.candleUp, c = r.negativeColor ?? i.candleDown, l = r.totalColor ?? i.lineColor, u = r.subtotalColor ?? i.textSecondary, d = r.connectorColor ?? i.textSecondary, f = r.connectorStyle ?? "dashed", p = r.barWidth ?? Do, m = r.showValues !== !1, h = r.showDelta !== !1, g = r.valueFormat ?? Ao, _ = r.labelFormat ?? ((e) => e), { valMin: v, valMax: y } = No(o), b = y - v || 1, x = jo(t, n), { bars: S, cumulatives: C } = Mo(o, x, p, v, b);
|
|
11040
|
+
Po(e, t, n, i.background), Fo(e, x, v, y, i, g), Lo(e, S, x, v, b, d, f), Io(e, S, {
|
|
11034
11041
|
positive: s,
|
|
11035
11042
|
negative: c,
|
|
11036
11043
|
total: l,
|
|
11037
11044
|
subtotal: u
|
|
11038
|
-
}), m &&
|
|
11039
|
-
let w = a ?
|
|
11040
|
-
return a && w !== null &&
|
|
11045
|
+
}), m && Ro(e, S, C, i, g, h), zo(e, S, x, i, _);
|
|
11046
|
+
let w = a ? Bo(S, a.x, x) : null;
|
|
11047
|
+
return a && w !== null && Vo(e, S, C, w, a, x, i, g), { hitBar: w };
|
|
11041
11048
|
}
|
|
11042
11049
|
//#endregion
|
|
11043
11050
|
//#region src/finance/GaugeRenderer.ts
|
|
11044
|
-
var
|
|
11045
|
-
function
|
|
11051
|
+
var Uo = Math.PI / 180, Wo = 135, Go = 405, Ko = .25;
|
|
11052
|
+
function qo(e) {
|
|
11046
11053
|
let t = Math.abs(e);
|
|
11047
11054
|
return t >= 1e6 ? (e / 1e6).toFixed(2) + "M" : t >= 1e3 ? (e / 1e3).toFixed(1) + "K" : Number.isInteger(e) ? e.toFixed(0) : e.toFixed(1);
|
|
11048
11055
|
}
|
|
11049
11056
|
function Q(e, t, n) {
|
|
11050
11057
|
return e < t ? t : e > n ? n : e;
|
|
11051
11058
|
}
|
|
11052
|
-
function
|
|
11053
|
-
let r = n.min ?? 0, i = n.max ?? 100, a = i - r || 1, o = (n.startAngle ??
|
|
11059
|
+
function Jo(e, t, n) {
|
|
11060
|
+
let r = n.min ?? 0, i = n.max ?? 100, a = i - r || 1, o = (n.startAngle ?? Wo) * Uo, s = (n.endAngle ?? Go) * Uo, c = n.thickness ?? Ko, l = e / 2, u = t / 2 + t * .05, d = Math.max(10, Math.min(e, t) / 2 - 24);
|
|
11054
11061
|
return {
|
|
11055
11062
|
cx: l,
|
|
11056
11063
|
cy: u,
|
|
@@ -11068,38 +11075,38 @@ function $(e, t) {
|
|
|
11068
11075
|
let n = Q((e - t.min) / t.range, 0, 1);
|
|
11069
11076
|
return t.startAngle + t.angleRange * n;
|
|
11070
11077
|
}
|
|
11071
|
-
function
|
|
11078
|
+
function Yo(e, t, n, r) {
|
|
11072
11079
|
e.fillStyle = r, e.fillRect(0, 0, t, n);
|
|
11073
11080
|
}
|
|
11074
|
-
function
|
|
11081
|
+
function Xo(e, t, n) {
|
|
11075
11082
|
e.beginPath(), e.arc(t.cx, t.cy, t.radius, t.startAngle, t.endAngle, !1), e.arc(t.cx, t.cy, t.innerRadius, t.endAngle, t.startAngle, !0), e.closePath(), e.fillStyle = n, e.fill();
|
|
11076
11083
|
}
|
|
11077
|
-
function
|
|
11084
|
+
function Zo(e, t, n) {
|
|
11078
11085
|
let r = Q(n.from, t.min, t.max), i = Q(n.to, t.min, t.max);
|
|
11079
11086
|
if (i <= r) return;
|
|
11080
11087
|
let a = $(r, t), o = $(i, t);
|
|
11081
11088
|
e.beginPath(), e.arc(t.cx, t.cy, t.radius, a, o, !1), e.arc(t.cx, t.cy, t.innerRadius, o, a, !0), e.closePath(), e.fillStyle = n.color, e.fill();
|
|
11082
11089
|
}
|
|
11083
|
-
function
|
|
11090
|
+
function Qo(e, t, n, r, i) {
|
|
11084
11091
|
let a = $(n, t);
|
|
11085
11092
|
a <= t.startAngle || (e.globalAlpha = i, e.beginPath(), e.arc(t.cx, t.cy, t.radius, t.startAngle, a, !1), e.arc(t.cx, t.cy, t.innerRadius, a, t.startAngle, !0), e.closePath(), e.fillStyle = r, e.fill(), e.globalAlpha = 1);
|
|
11086
11093
|
}
|
|
11087
|
-
function
|
|
11094
|
+
function $o(e, t, n, r) {
|
|
11088
11095
|
let i = $(n, t), a = Math.cos(i), o = Math.sin(i), s = t.radius - 2, c = t.innerRadius * .25, l = -o, u = a, d = t.cx + a * s, f = t.cy + o * s, p = t.cx + l * 4 - a * c, m = t.cy + u * 4 - o * c, h = t.cx - l * 4 - a * c, g = t.cy - u * 4 - o * c;
|
|
11089
11096
|
e.beginPath(), e.moveTo(d, f), e.lineTo(p, m), e.lineTo(h, g), e.closePath(), e.fillStyle = r, e.fill(), e.beginPath(), e.arc(t.cx, t.cy, Math.max(4, t.innerRadius * .12), 0, Math.PI * 2), e.fill();
|
|
11090
11097
|
}
|
|
11091
|
-
function
|
|
11098
|
+
function es(e, t, n, r, i) {
|
|
11092
11099
|
let a = Math.round(t.innerRadius * .55), o = Math.round(i.font.sizeMedium);
|
|
11093
11100
|
e.fillStyle = i.text, e.textAlign = "center", e.textBaseline = "middle", e.font = `600 ${a}px ${i.font.family}`;
|
|
11094
11101
|
let s = !!r, c = s ? t.cy - o * .6 : t.cy - a * .1;
|
|
11095
11102
|
e.fillText(n, t.cx, c), s && (e.fillStyle = i.textSecondary, e.font = `${o}px ${i.font.family}`, e.fillText(r, t.cx, t.cy + a * .55));
|
|
11096
11103
|
}
|
|
11097
|
-
function
|
|
11104
|
+
function ts(e, t, n, r) {
|
|
11098
11105
|
e.fillStyle = r.textSecondary, e.font = `${r.font.sizeSmall}px ${r.font.family}`;
|
|
11099
11106
|
let i = t.radius + 10, a = Math.cos(t.startAngle), o = Math.sin(t.startAngle), s = Math.cos(t.endAngle), c = Math.sin(t.endAngle), l = t.cx + a * i, u = t.cy + o * i, d = t.cx + s * i, f = t.cy + c * i;
|
|
11100
11107
|
e.textBaseline = "middle", e.textAlign = a < -.2 ? "right" : a > .2 ? "left" : "center", e.fillText(n(t.min), l, u), e.textAlign = s < -.2 ? "right" : s > .2 ? "left" : "center", e.fillText(n(t.max), d, f);
|
|
11101
11108
|
}
|
|
11102
|
-
function
|
|
11109
|
+
function ns(e, t, n, r) {
|
|
11103
11110
|
e.fillStyle = r.textSecondary, e.font = `${r.font.sizeSmall}px ${r.font.family}`, e.textAlign = "center", e.textBaseline = "middle";
|
|
11104
11111
|
let i = (t.radius + t.innerRadius) / 2;
|
|
11105
11112
|
for (let r = 0; r < n.length; r++) {
|
|
@@ -11109,15 +11116,15 @@ function ts(e, t, n, r) {
|
|
|
11109
11116
|
e.fillText(a.label, s, c);
|
|
11110
11117
|
}
|
|
11111
11118
|
}
|
|
11112
|
-
function
|
|
11119
|
+
function rs(e, t, n, r, i, a) {
|
|
11113
11120
|
if (t <= 0 || n <= 0) return;
|
|
11114
|
-
let o =
|
|
11115
|
-
|
|
11121
|
+
let o = Jo(t, n, r), s = r.trackColor ?? i.grid, c = r.needleColor ?? i.text, l = r.showValue !== !1, u = r.showZoneLabels === !0, d = r.valueFormat ?? qo, f = Q(a, o.min, o.max);
|
|
11122
|
+
Yo(e, t, n, i.background), Xo(e, o, s);
|
|
11116
11123
|
let p = r.zones;
|
|
11117
|
-
if (p && p.length > 0) for (let t = 0; t < p.length; t++)
|
|
11118
|
-
|
|
11124
|
+
if (p && p.length > 0) for (let t = 0; t < p.length; t++) Zo(e, o, p[t]);
|
|
11125
|
+
Qo(e, o, f, c, .12), $o(e, o, f, c), l && es(e, o, d(f), r.label, i), ts(e, o, d, i), u && p && p.length > 0 && ns(e, o, p, i);
|
|
11119
11126
|
}
|
|
11120
11127
|
//#endregion
|
|
11121
|
-
export { Et as ADXIndicator, Tt as ATRIndicator, gn as AcceleratorOscillatorIndicator, wn as AccumulationDistributionIndicator, Ln as AlertDragHandler,
|
|
11128
|
+
export { Et as ADXIndicator, Tt as ATRIndicator, gn as AcceleratorOscillatorIndicator, wn as AccumulationDistributionIndicator, Ln as AlertDragHandler, ta as AlertManager, vt as AlligatorIndicator, lt as AnchoredVWAPIndicator, Or as AnchoredVWAPTool, Ea as Animator, ce as AreaRenderer, jt as AroonIndicator, Cr as ArrowTool, bt as AwesomeOscillatorIndicator, In as AxisDragHandler, Qt as BalanceOfPowerIndicator, Hi as BarCountdown, le as BarRenderer, Oa as BaseFinanceChart, de as BaselineRenderer, mi as BinanceAdapter, et as BollingerBandsIndicator, Kr as BracketTool, Ei as BybitAdapter, kt as CCIIndicator, Pt as CMFIndicator, re as CandlestickRenderer, T as CanvasLayer, xt as ChaikinOscillatorIndicator, ln as ChaikinVolatilityIndicator, en as ChandeMomentumIndicator, _t as ChandelierExitIndicator, zi as ChartLegend, ua as ChartStateManager, Lt as ChoppinessIndexIndicator, bi as CoinbaseAdapter, He as CompareRenderer, Vt as ConnorsRSIIndicator, Ut as CoppockIndicator, Bn as CrosshairHandler, Wn as CrosshairTooltip, si as CurrentPriceLine, Ri as DEFAULT_LEGEND_CONFIG, Qi as DEFAULT_SESSION_HOURS, O as DPRManager, fa as DataExporter, yr as DateRangeTool, ze as DepthHeatmapBuffer, Be as DepthHeatmapRenderer, Br as DepthOverlay, Zt as DetrendedPriceOscillatorIndicator, yn as DisparityIndexIndicator, ot as DonchianChannelIndicator, H as DrawingBase, $n as DrawingManager, er as DrawingRenderer, $e as EMAIndicator, rn as EaseOfMovementIndicator, Ta as Easing, Kt as ElderRayIndicator, _r as ElliottWaveTool, pr as EllipseTool, G as Emitter, ge as EquivolumeRenderer, Zn as EventBus, or as ExtendedLineTool, dr as FibExtensionTool, lr as FibRetracementTool, jr as FibTimeZonesTool, ka as FinanceCrosshair, Xt as FisherTransformIndicator, Bt as ForceIndexIndicator, Dr as GannBoxTool, Tr as GannFanTool, kn as GridRenderer, ve as HLCAreaRenderer, ue as HollowCandleRenderer, rr as HorizontalLineTool, ft as HullMAIndicator, nt as IchimokuIndicator, L as IndicatorBase, Ze as IndicatorEngine, On as IndicatorWorkerHost, Nn as InteractionManager, Wt as KSTIndicator, pe as KagiRenderer, at as KeltnerChannelIndicator, Un as KeyboardHandler, Yt as KlingerIndicator, Ni as KrakenAdapter, E as LayerManager, se as LineRenderer, be as LineWithMarkersRenderer, dt as LinearRegressionChannelIndicator, Ct as MACDIndicator, At as MFIIndicator, ht as MTFMovingAverageIndicator, Oe as MarketProfileRenderer, $t as MassIndexIndicator, _a as MeasureOverlay, br as MeasureTool, hi as MockAdapter, Dt as OBVIndicator, Qr as OrderDraftTool, Nr as OrderRenderer, Pn as PanHandler, Rn as PaneResizeHandler, ri as PaperExecutionAdapter, rt as ParabolicSARIndicator, sr as ParallelChannelTool, mn as PercentagePriceOscillatorIndicator, Ne as PeriodLevelsRenderer, qn as PinnedTooltip, hr as PitchforkTool, Le as PivotMarkersRenderer, ct as PivotPointsIndicator, me as PointAndFigureRenderer, _i as PollingAdapter, zr as PositionRenderer, xn as PrettyGoodOscillatorIndicator, An as PriceAxis, vr as PriceRangeTool, cn as PriceVolumeTrendIndicator, bn as QstickIndicator, Mt as ROCIndicator, St as RSIIndicator, ar as RayTool, oi as ReconnectManager, fr as RectangleTool, cr as RegressionChannelTool, vn as RelativeMomentumIndexIndicator, un as RelativeVigorIndicator, ee as RenderEngine, D as RenderLoop, fe as RenkoRenderer, li as ReplayController, na as ReplayManager, Qe as SMAIndicator, qt as SchaffTrendCycleIndicator, Bi as Screenshot, Ui as SessionBreaks, $i as SessionShading, gt as SessionVWAPIndicator, ma as SignalMarkerManager, Sn as StdDevIndicator, ye as StepLineRenderer, wt as StochasticIndicator, dn as StochasticRSIIndicator, ci as StreamManager, it as SupertrendIndicator, tn as TRIXIndicator, Nt as TSIIndicator, Sr as TextAnnotationTool, ai as TickAggregator, Mn as TimeAxis, ga as TradeZoneManager, Hr as TradingContextMenu, Vr as TradingDragHandler, ti as TradingManager, ni as TradingRenderer, nr as TrendLineTool, mr as TriangleTool, Rt as UltimateOscillatorIndicator, da as UndoRedoManager, Tn as VROCIndicator, tt as VWAPIndicator, ir as VerticalLineTool, te as Viewport, he as VolumeCandleRenderer, Ft as VolumeDeltaIndicator, Cn as VolumeProfileIndicator, kr as VolumeProfileRangeTool, Se as VolumeProfileRenderer, xe as VolumeRenderer, It as VortexIndicator, Vi as Watermark, gi as WebSocketAdapter, on as WilliamsADIndicator, Ot as WilliamsRIndicator, ut as ZigZagIndicator, Fn as ZoomHandler, Ee as assignSessionLetters, k as barIndexToX, Wr as bracketRiskReward, Fe as classifyPivots, Ur as computeBracketDefaults, we as computeMarketProfile, Me as computePeriodLevels, De as computeSessionProfiles, tr as findDominantSwing, Ie as findPivots, z as getIntParam, R as getNumberParam, ne as getVisibleData, Xr as inferOrderType, Xi as isInWindow, Zi as isRegularSession, Dn as isWorkerResponse, ho as layoutSquarifiedTreemap, uo as layoutUniformGrid, ie as lttbDownsample, oe as lttbVisibleIndices, Yi as minuteOfDay, A as priceToY, Mr as registerBuiltInDrawingTools, En as registerBuiltInIndicators, Ga as renderDepthChart, lo as renderEquityCurve, rs as renderGauge, So as renderHeatmap, Aa as renderSparkline, Ho as renderWaterfall, P as resolveBarIndex, F as timeToX, N as timestampToBarIndex, Ue as toHeikinAshi, qe as toKagi, Ke as toLineBreak, Je as toPointAndFigure, Ye as toRangeBars, We as toRenko, Te as tpoLetter, j as xToBarIndex, I as xToTime, M as yToPrice };
|
|
11122
11129
|
|
|
11123
11130
|
//# sourceMappingURL=index.js.map
|