charts-core 1.1.21 → 1.1.22
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/charts-core.js +440 -439
- package/dist/charts-core.js.map +1 -1
- package/dist/charts-core.umd.cjs +12 -12
- package/dist/charts-core.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/charts-core.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Ns = (i, e, t) => e in i ?
|
|
1
|
+
var Ls = Object.defineProperty;
|
|
2
|
+
var Ns = (i, e, t) => e in i ? Ls(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var f = (i, e, t) => Ns(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import * as
|
|
4
|
+
import * as E from "d3";
|
|
5
5
|
const Fs = (i) => {
|
|
6
6
|
const { svg: e, config: t, y: s, width: n } = i, { margin: a, yAxis: r } = t, { customTicks: o, tickFormat: c, tickValues: h, ticks: u, isShow: g } = r;
|
|
7
7
|
if (!g) return null;
|
|
8
|
-
e.append("g").attr("transform", `translate(${n - a.right},0)`).call((
|
|
9
|
-
let
|
|
10
|
-
o && c ?
|
|
8
|
+
e.append("g").attr("transform", `translate(${n - a.right},0)`).call((p) => {
|
|
9
|
+
let _ = E.axisRight(s);
|
|
10
|
+
o && c ? _ = _.tickFormat(c) : _ = _.tickFormat((v) => {
|
|
11
11
|
const b = Number(v), w = (C) => C.toString().replace(/\.0+$/, "");
|
|
12
12
|
return Math.abs(b) >= 1e12 ? w(b / 1e12) + "T" : Math.abs(b) >= 1e9 ? w(b / 1e9) + "B" : Math.abs(b) >= 1e6 ? w(b / 1e6) + "M" : Math.abs(b) >= 1e3 ? w(b / 1e3) + "K" : w(b);
|
|
13
|
-
}), o && u && (
|
|
14
|
-
}).call((
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
}).call((
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const v =
|
|
21
|
-
|
|
13
|
+
}), o && u && (_ = Array.isArray(u) ? _.ticks(...u) : _.ticks(u)), o && h && (_ = _.tickValues(h)), p.call(_);
|
|
14
|
+
}).call((p) => {
|
|
15
|
+
let _ = [];
|
|
16
|
+
p.selectAll(".tick").each((v) => _.push(v)), i.yTicks = _;
|
|
17
|
+
}).call((p) => p.select(".domain").remove()).call((p) => p.selectAll(".tick line").remove()).call((p) => {
|
|
18
|
+
const _ = p.selectAll(".tick text");
|
|
19
|
+
_.classed("sc-charts__y-axis-tick", !0).attr("text-anchor", "start");
|
|
20
|
+
const v = _.nodes().map((w) => w.getBBox().width), b = Math.max(...v);
|
|
21
|
+
p.selectAll(".tick").each(function(w, C) {
|
|
22
22
|
var $;
|
|
23
|
-
const y =
|
|
24
|
-
x.attr("x",
|
|
23
|
+
const y = E.select(this), x = y.select("text"), T = v[C], k = b - T, R = y.append("g").attr("transform", "translate(10, 0)");
|
|
24
|
+
x.attr("x", k), x.remove(), ($ = R.node()) == null || $.appendChild(x.node());
|
|
25
25
|
});
|
|
26
26
|
}).attr("font-family", "inherit");
|
|
27
27
|
}, Hs = (i) => {
|
|
28
28
|
const { svg: e, config: t, x: s, height: n } = i, { margin: a, xAxis: r } = t, { isShow: o, tickValues: c, tickFormat: h, customTicks: u, ticks: g } = r;
|
|
29
29
|
if (!o) return null;
|
|
30
|
-
e.append("g").attr("transform", `translate(0,${n - a.bottom})`).call((
|
|
31
|
-
let
|
|
32
|
-
u ? (h && (
|
|
33
|
-
}).call((
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
}).call((
|
|
30
|
+
e.append("g").attr("transform", `translate(0,${n - a.bottom})`).call((p) => {
|
|
31
|
+
let _ = E.axisBottom(s);
|
|
32
|
+
u ? (h && (_ = _.tickFormat(h)), g && (_ = Array.isArray(g) ? _.ticks(...g) : _.ticks(g)), c && (_ = _.tickValues(c))) : _.ticks(5), p.call(_);
|
|
33
|
+
}).call((p) => p.select(".domain").remove()).call((p) => {
|
|
34
|
+
let _ = [];
|
|
35
|
+
p.selectAll(".tick").each((v) => _.push(v)), i.xTicks = _;
|
|
36
|
+
}).call((p) => p.selectAll(".tick line").remove()).call((p) => p.selectAll(".tick text").classed("sc-charts__x-axis-tick", !0)).attr("font-family", "inherit");
|
|
37
37
|
}, Bs = (i) => {
|
|
38
38
|
const { svg: e, config: t, y: s, width: n } = i, {
|
|
39
39
|
margin: a,
|
|
@@ -89,31 +89,31 @@ function Ps(i, e, t, s) {
|
|
|
89
89
|
const n = i.width / 2, a = e - n, r = e + n;
|
|
90
90
|
return a < t ? t : r > s ? s - i.width : e - n;
|
|
91
91
|
}
|
|
92
|
-
const
|
|
92
|
+
const Lt = (i, { x1: e, x2: t, y1: s, y2: n }) => i.append("line").attr("x1", e).attr("x2", t).attr("y1", s).attr("y2", n).attr("stroke", "var(--sc-color-axis-zero-line)").attr("stroke-width", 1), Os = (i) => {
|
|
93
93
|
const { svg: e, config: t, x: s, y: n, height: a, data: r, wrapperNode: o } = i, {
|
|
94
94
|
margin: c,
|
|
95
|
-
grid: { verticalStyle: h, tooltipNode: u, hoverCirclesRadius: g, hoverCirclesAdditionalArea:
|
|
95
|
+
grid: { verticalStyle: h, tooltipNode: u, hoverCirclesRadius: g, hoverCirclesAdditionalArea: p }
|
|
96
96
|
} = t;
|
|
97
97
|
if (h !== "none" && (h.startsWith("every-line") && (i.xTicks || s.ticks()).forEach((v) => {
|
|
98
98
|
const b = e.append("line").attr("x1", s(v)).attr("x2", s(v)).attr("y1", c.top).attr("y2", a - c.bottom).attr("stroke", "var(--sc-color-axis-zero-line)").attr("stroke-width", 1);
|
|
99
99
|
h === "every-line-dashed" && b.attr("stroke-dasharray", "4 4");
|
|
100
100
|
}), h === "hovered-circles")) {
|
|
101
|
-
const
|
|
102
|
-
|
|
101
|
+
const _ = n.range()[0], v = s(r[0].date), b = s(r[r.length - 1].date);
|
|
102
|
+
Lt(e, { x1: v, x2: b, y1: _, y2: _ });
|
|
103
103
|
const { tooltipContainer: w, tooltip: C, tooltipArrow: y } = Rs(o);
|
|
104
104
|
r.forEach((x, T) => {
|
|
105
|
-
const
|
|
106
|
-
P ||
|
|
107
|
-
const
|
|
108
|
-
x:
|
|
109
|
-
y:
|
|
105
|
+
const k = s(x.date), R = n(x.value), $ = r[T - 1], P = T > 0 && $ && x.value === $.value;
|
|
106
|
+
P || Lt(e, { x1: k, x2: k, y1: R, y2: _ });
|
|
107
|
+
const U = $s(e, P, {
|
|
108
|
+
x: k,
|
|
109
|
+
y: _,
|
|
110
110
|
r: g,
|
|
111
|
-
hr:
|
|
111
|
+
hr: p
|
|
112
112
|
});
|
|
113
|
-
u &&
|
|
113
|
+
u && U.on("mouseover", function() {
|
|
114
114
|
Is(C), w.style.display = "block", C.append(u({ date: x.date, value: P ? null : x.value }));
|
|
115
|
-
const
|
|
116
|
-
|
|
115
|
+
const O = C.getBoundingClientRect(), He = Ps(
|
|
116
|
+
O,
|
|
117
117
|
s(x.date),
|
|
118
118
|
i.config.margin.left - i.config.grid.tooltipArrowSize,
|
|
119
119
|
i.width - i.config.margin.right + i.config.grid.tooltipArrowSize
|
|
@@ -135,8 +135,8 @@ const Et = (i, { x1: e, x2: t, y1: s, y2: n }) => i.append("line").attr("x1", e)
|
|
|
135
135
|
s.append("stop").attr("offset", n).attr("stop-color", a);
|
|
136
136
|
}), s;
|
|
137
137
|
}, ae = (i) => {
|
|
138
|
-
const e =
|
|
139
|
-
return e.empty() ?
|
|
138
|
+
const e = E.select(i).select("defs");
|
|
139
|
+
return e.empty() ? E.select(i).append("defs") : e;
|
|
140
140
|
}, Qt = (i) => {
|
|
141
141
|
const {
|
|
142
142
|
y: e,
|
|
@@ -241,8 +241,8 @@ const Et = (i, { x1: e, x2: t, y1: s, y2: n }) => i.append("line").attr("x1", e)
|
|
|
241
241
|
s.remove();
|
|
242
242
|
}
|
|
243
243
|
};
|
|
244
|
-
}, ie = "sc-charts__range-tooltip", Ht =
|
|
245
|
-
const e =
|
|
244
|
+
}, ie = "sc-charts__range-tooltip", Ht = E.timeFormat("%b %e, %I:%M %p"), Ys = (i) => {
|
|
245
|
+
const e = E.format(",.2f");
|
|
246
246
|
return `${i < 0 ? "-" : ""}$${e(Math.abs(i))}`;
|
|
247
247
|
};
|
|
248
248
|
function Ws(i) {
|
|
@@ -274,7 +274,7 @@ const Xs = (i) => {
|
|
|
274
274
|
},
|
|
275
275
|
update({ leftPoint: n, rightPoint: a, x: r, y: o, hidden: c, closest: h }) {
|
|
276
276
|
if (n && a && h && r !== void 0) {
|
|
277
|
-
const u = a.value - n.value, { sumFormatter: g, timeFormatter:
|
|
277
|
+
const u = a.value - n.value, { sumFormatter: g, timeFormatter: p } = i.config.selection, _ = (i.x(a.date) + i.x(n.date)) / 2, v = i.x(h.date) < _ ? "left" : "right";
|
|
278
278
|
let b = "", w = "";
|
|
279
279
|
if (g)
|
|
280
280
|
b = g({ left: n.value, right: a.value, direction: v });
|
|
@@ -282,7 +282,7 @@ const Xs = (i) => {
|
|
|
282
282
|
const C = (u / Math.abs(n.value) * 100).toFixed(2);
|
|
283
283
|
b = `${Ys(u)} (${C}%)`;
|
|
284
284
|
}
|
|
285
|
-
|
|
285
|
+
p ? w = p({ left: n.date, right: a.date, direction: v }) : w = `${Ht(n.date)} to ${Ht(a.date)}`, t.textContent = b, s.textContent = w, requestAnimationFrame(() => {
|
|
286
286
|
const C = e.getBoundingClientRect(), y = i.wrapperNode.getBoundingClientRect(), x = i.x(n.date), T = i.x(a.date);
|
|
287
287
|
let R = (x + T) / 2 - C.width / 2;
|
|
288
288
|
const $ = 0, P = y.width - C.width;
|
|
@@ -295,8 +295,8 @@ const Xs = (i) => {
|
|
|
295
295
|
e.remove();
|
|
296
296
|
}
|
|
297
297
|
};
|
|
298
|
-
}, ge = "sc-charts__hover-tooltip", Ge = 16, Us =
|
|
299
|
-
const e =
|
|
298
|
+
}, ge = "sc-charts__hover-tooltip", Ge = 16, Us = E.timeFormat("%a, %b %d, %-I:%M %p"), Gs = (i) => {
|
|
299
|
+
const e = E.format(",.2f");
|
|
300
300
|
return `${i < 0 ? "-" : ""}$${e(Math.abs(i))}`;
|
|
301
301
|
};
|
|
302
302
|
function Zs(i) {
|
|
@@ -385,7 +385,7 @@ const Js = (i) => {
|
|
|
385
385
|
},
|
|
386
386
|
enableBelowZeroLine: !1,
|
|
387
387
|
curveTension: 1
|
|
388
|
-
}, Ne = (i) =>
|
|
388
|
+
}, Ne = (i) => E.curveCardinal.tension(i.config.curveTension), Ks = (i) => {
|
|
389
389
|
const { svg: e, data: t, x: s, y: n, config: a } = i, r = e.node(), o = ae(r);
|
|
390
390
|
me(o, "main-line-area-gradient", {
|
|
391
391
|
x1: "0%",
|
|
@@ -397,15 +397,15 @@ const Js = (i) => {
|
|
|
397
397
|
{ offset: "100%", stopColor: "rgba(255, 255, 255, 0)" }
|
|
398
398
|
]
|
|
399
399
|
});
|
|
400
|
-
const h =
|
|
400
|
+
const h = E.area().x((p) => s(p.date)).y0(n.range()[0]).y1((p) => n(p.value)).curve(Ne(i)), u = "sc-charts__main-line-area", g = e.append("path").datum(t).attr("d", h).attr("class", u).classed(`${u}_hidden`, !a.hasMainLineArea);
|
|
401
401
|
return {
|
|
402
|
-
className(
|
|
403
|
-
|
|
402
|
+
className(p, _) {
|
|
403
|
+
p === "remove" ? g.classed(`${u}${_}`, !1) : g.classed(`${u}${_}`, !0);
|
|
404
404
|
},
|
|
405
|
-
update({ data:
|
|
406
|
-
if (
|
|
405
|
+
update({ data: p, hidden: _ }) {
|
|
406
|
+
if (p !== void 0 && g.datum(p).attr("d", h), _ !== void 0) {
|
|
407
407
|
if (!a.hasMainLineArea) return null;
|
|
408
|
-
g.classed(`${u}_hidden`,
|
|
408
|
+
g.classed(`${u}_hidden`, _);
|
|
409
409
|
}
|
|
410
410
|
},
|
|
411
411
|
destroy() {
|
|
@@ -413,8 +413,8 @@ const Js = (i) => {
|
|
|
413
413
|
}
|
|
414
414
|
};
|
|
415
415
|
}, en = (i, e = {}) => {
|
|
416
|
-
const t = "sc-charts__range-line-area", { svg: s, x: n, y: a, config: r, data: o, chartId: c } = i, { clip: h } = e, u = s.node(), g = ae(u),
|
|
417
|
-
me(g,
|
|
416
|
+
const t = "sc-charts__range-line-area", { svg: s, x: n, y: a, config: r, data: o, chartId: c } = i, { clip: h } = e, u = s.node(), g = ae(u), p = "range-line-area-gradient";
|
|
417
|
+
me(g, p + "_up", {
|
|
418
418
|
x1: "0%",
|
|
419
419
|
y1: "0%",
|
|
420
420
|
x2: "0%",
|
|
@@ -423,7 +423,7 @@ const Js = (i) => {
|
|
|
423
423
|
{ offset: "0%", stopColor: "var(--sc-color-selection-up)" },
|
|
424
424
|
{ offset: "100%", stopColor: "rgba(255, 255, 255, 0)" }
|
|
425
425
|
]
|
|
426
|
-
}), me(g,
|
|
426
|
+
}), me(g, p + "_down", {
|
|
427
427
|
x1: "0%",
|
|
428
428
|
y1: "0%",
|
|
429
429
|
x2: "0%",
|
|
@@ -433,39 +433,39 @@ const Js = (i) => {
|
|
|
433
433
|
{ offset: "100%", stopColor: "rgba(255, 255, 255, 0)" }
|
|
434
434
|
]
|
|
435
435
|
});
|
|
436
|
-
const
|
|
436
|
+
const _ = E.area().x((y) => n(y.date)).y0(a.range()[0]).y1((y) => a(y.value)).curve(Ne(i)), v = `${c}-clip-${t}`, w = g.append("clipPath").attr("id", v).append("rect").attr("x", (h == null ? void 0 : h.x) || 0).attr("y", (h == null ? void 0 : h.y) || 0).attr("width", (h == null ? void 0 : h.width) || "100%").attr("height", (h == null ? void 0 : h.height) || "100%"), C = s.append("path").datum(o).attr("d", _).attr("class", t).classed(`${t}_hidden`, !r.hasMainLineArea).attr("clip-path", `url(#${v})`);
|
|
437
437
|
return {
|
|
438
438
|
className(y, x) {
|
|
439
439
|
y === "remove" ? C.classed(`${t}${x}`, !1) : C.classed(`${t}${x}`, !0);
|
|
440
440
|
},
|
|
441
441
|
update({ data: y, hidden: x, clip: T }) {
|
|
442
|
-
y !== void 0 && C.datum(y).attr("d",
|
|
442
|
+
y !== void 0 && C.datum(y).attr("d", _), x !== void 0 && C.classed(`${t}_hidden`, x), T !== void 0 && w.attr("x", T.x).attr("y", T.y).attr("width", T.width).attr("height", T.height);
|
|
443
443
|
},
|
|
444
444
|
destroy() {
|
|
445
445
|
C.remove();
|
|
446
446
|
}
|
|
447
447
|
};
|
|
448
448
|
}, Ze = (i, e) => {
|
|
449
|
-
const { svg: t, data: s, x: n, y: a, chartId: r } = i, { baseClassName: o, id: c, clip: h } = e, u = t.node(), g = ae(u),
|
|
449
|
+
const { svg: t, data: s, x: n, y: a, chartId: r } = i, { baseClassName: o, id: c, clip: h } = e, u = t.node(), g = ae(u), p = E.line().x((C) => n(C.date)).y((C) => a(C.value)).curve(Ne(i)), _ = `${r}-clip-${o}`, b = g.append("clipPath").attr("id", _).append("rect").attr("x", (h == null ? void 0 : h.x) || 0).attr("y", (h == null ? void 0 : h.y) || 0).attr("width", (h == null ? void 0 : h.width) || "100%").attr("height", (h == null ? void 0 : h.height) || "100%"), w = t.append("path").classed(o, !0).datum(s).attr("d", p).attr("id", c).attr("clip-path", `url(#${_})`);
|
|
450
450
|
return {
|
|
451
451
|
className(C, y) {
|
|
452
452
|
C === "remove" ? w.classed(`${o}${y}`, !1) : w.classed(`${o}${y}`, !0);
|
|
453
453
|
},
|
|
454
454
|
update({ data: C, clip: y, hidden: x }) {
|
|
455
|
-
C !== void 0 && w.datum(C).attr("d",
|
|
455
|
+
C !== void 0 && w.datum(C).attr("d", p), x !== void 0 && w.classed(`${o}_hidden`, x), y !== void 0 && b.attr("x", y.x).attr("y", y.y).attr("width", y.width).attr("height", y.height);
|
|
456
456
|
},
|
|
457
457
|
destroy() {
|
|
458
458
|
w.remove();
|
|
459
459
|
}
|
|
460
460
|
};
|
|
461
461
|
}, tn = (i, e) => {
|
|
462
|
-
const { svg: t, data: s, x: n, y: a, chartId: r, config: o } = i, { baseClassName: c, id: h, clip: u } = e, g = t.node(),
|
|
462
|
+
const { svg: t, data: s, x: n, y: a, chartId: r, config: o } = i, { baseClassName: c, id: h, clip: u } = e, g = t.node(), p = ae(g), _ = E.line().x((y) => n(y.date)).y((y) => a(y.value)).curve(Ne(i)), v = `${r}-clip-${c}`, w = p.append("clipPath").attr("id", v).append("rect").attr("x", (u == null ? void 0 : u.x) || 0).attr("y", (u == null ? void 0 : u.y) || 0).attr("width", (u == null ? void 0 : u.width) || "100%").attr("height", (u == null ? void 0 : u.height) || "100%"), C = t.append("path").classed(c, !0).datum(s).attr("d", _).attr("id", h).attr("clip-path", `url(#${v})`);
|
|
463
463
|
return {
|
|
464
464
|
className(y, x) {
|
|
465
465
|
y === "remove" ? C.classed(`${c}${x}`, !1) : C.classed(`${c}${x}`, !0);
|
|
466
466
|
},
|
|
467
467
|
update({ data: y, clip: x, hidden: T }) {
|
|
468
|
-
y !== void 0 && C.datum(y).attr("d",
|
|
468
|
+
y !== void 0 && C.datum(y).attr("d", _), T !== void 0 && C.classed(`${c}_hidden`, T), x !== void 0 && (o.hover.transitionName === "default" ? w.transition().duration(o.hover.transitionDuration).attr("x", x.x).attr("y", x.y).attr("width", x.width).attr("height", x.height).ease(E.easeLinear) : w.attr("x", x.x).attr("y", x.y).attr("width", x.width).attr("height", x.height));
|
|
469
469
|
},
|
|
470
470
|
destroy() {
|
|
471
471
|
C.remove();
|
|
@@ -479,13 +479,13 @@ const Js = (i) => {
|
|
|
479
479
|
const { svg: t, data: s, x: n, y: a } = i, { baseClassName: r } = e, o = t.append("g").classed(r, !0), c = o.append("circle").attr("r", 5).classed(`${r}-circle`, !0), h = o.append("text").attr("text-anchor", "middle").attr("dy", "-9px").classed(`${r}-label`, !0);
|
|
480
480
|
return ((g) => {
|
|
481
481
|
if (!g || g.length === 0) return;
|
|
482
|
-
const
|
|
483
|
-
c.attr("cx",
|
|
482
|
+
const p = g[g.length - 1], _ = n(p.date), v = a(p.value);
|
|
483
|
+
c.attr("cx", _).attr("cy", v);
|
|
484
484
|
const b = i.config.extremePointFormatter || sn;
|
|
485
|
-
h.attr("x",
|
|
485
|
+
h.attr("x", _).attr("y", v).text(b(p.value));
|
|
486
486
|
})(s), {
|
|
487
|
-
className(g,
|
|
488
|
-
g === "remove" ? o.classed(`${r}${
|
|
487
|
+
className(g, p) {
|
|
488
|
+
g === "remove" ? o.classed(`${r}${p}`, !1) : o.classed(`${r}${p}`, !0);
|
|
489
489
|
},
|
|
490
490
|
update({ hidden: g }) {
|
|
491
491
|
g !== void 0 && o.classed(`${r}_hidden`, g);
|
|
@@ -524,10 +524,10 @@ const Js = (i) => {
|
|
|
524
524
|
}), g = Ue(i.svg, {
|
|
525
525
|
className: "sc-charts__range-circle-left",
|
|
526
526
|
hidden: !0
|
|
527
|
-
}),
|
|
527
|
+
}), p = Ue(i.svg, {
|
|
528
528
|
className: "sc-charts__range-circle-right",
|
|
529
529
|
hidden: !0
|
|
530
|
-
}),
|
|
530
|
+
}), _ = Xs(i), v = Js(i), b = en(i);
|
|
531
531
|
return {
|
|
532
532
|
hoverLine: n,
|
|
533
533
|
hoverCircle: o,
|
|
@@ -536,9 +536,9 @@ const Js = (i) => {
|
|
|
536
536
|
rangeLine: u,
|
|
537
537
|
rangeLineArea: b,
|
|
538
538
|
rangeCircleLeft: g,
|
|
539
|
-
rangeCircleRight:
|
|
539
|
+
rangeCircleRight: p,
|
|
540
540
|
mainLine: e,
|
|
541
|
-
rangeTooltip:
|
|
541
|
+
rangeTooltip: _,
|
|
542
542
|
highlightLine: a,
|
|
543
543
|
hoverTooltip: v,
|
|
544
544
|
mainLineArea: t,
|
|
@@ -583,11 +583,11 @@ const Js = (i) => {
|
|
|
583
583
|
};
|
|
584
584
|
}
|
|
585
585
|
if (e >= h && e < u) {
|
|
586
|
-
const g = t(h),
|
|
586
|
+
const g = t(h), p = t(u);
|
|
587
587
|
return {
|
|
588
588
|
x: g,
|
|
589
589
|
y: 0,
|
|
590
|
-
width:
|
|
590
|
+
width: p - g,
|
|
591
591
|
height: "100%"
|
|
592
592
|
};
|
|
593
593
|
}
|
|
@@ -612,11 +612,11 @@ const Js = (i) => {
|
|
|
612
612
|
u = new Date(c.getFullYear(), c.getMonth() - r, 1);
|
|
613
613
|
break;
|
|
614
614
|
}
|
|
615
|
-
const g = t(u),
|
|
615
|
+
const g = t(u), p = t(c);
|
|
616
616
|
return {
|
|
617
617
|
x: g,
|
|
618
618
|
y: 0,
|
|
619
|
-
width:
|
|
619
|
+
width: p - g,
|
|
620
620
|
height: "100%"
|
|
621
621
|
};
|
|
622
622
|
}
|
|
@@ -688,7 +688,7 @@ const Js = (i) => {
|
|
|
688
688
|
config: { margin: a },
|
|
689
689
|
height: r,
|
|
690
690
|
elements: o
|
|
691
|
-
} = i, c = s(e.date) < s(t.date) ? e : t, h = s(e.date) >= s(t.date) ? e : t, u = h.value - c.value >= 0, g = s(c.date),
|
|
691
|
+
} = i, c = s(e.date) < s(t.date) ? e : t, h = s(e.date) >= s(t.date) ? e : t, u = h.value - c.value >= 0, g = s(c.date), p = s(h.date), _ = p - g;
|
|
692
692
|
o.rangeBorderLeft.update({
|
|
693
693
|
x1: g,
|
|
694
694
|
x2: g,
|
|
@@ -696,8 +696,8 @@ const Js = (i) => {
|
|
|
696
696
|
y2: r - a.bottom,
|
|
697
697
|
hidden: !1
|
|
698
698
|
}), o.rangeBorderRight.update({
|
|
699
|
-
x1:
|
|
700
|
-
x2:
|
|
699
|
+
x1: p,
|
|
700
|
+
x2: p,
|
|
701
701
|
y1: a.top,
|
|
702
702
|
y2: r - a.bottom,
|
|
703
703
|
hidden: !1
|
|
@@ -706,14 +706,14 @@ const Js = (i) => {
|
|
|
706
706
|
cy: n(c.value),
|
|
707
707
|
hidden: !1
|
|
708
708
|
}), o.rangeCircleRight.update({
|
|
709
|
-
cx:
|
|
709
|
+
cx: p,
|
|
710
710
|
cy: n(h.value),
|
|
711
711
|
hidden: !1
|
|
712
712
|
}), o.rangeLine.update({
|
|
713
713
|
clip: {
|
|
714
714
|
x: g,
|
|
715
715
|
y: 0,
|
|
716
|
-
width:
|
|
716
|
+
width: _,
|
|
717
717
|
height: n.range()[0]
|
|
718
718
|
},
|
|
719
719
|
hidden: !1
|
|
@@ -721,7 +721,7 @@ const Js = (i) => {
|
|
|
721
721
|
clip: {
|
|
722
722
|
x: g,
|
|
723
723
|
y: 0,
|
|
724
|
-
width:
|
|
724
|
+
width: _,
|
|
725
725
|
height: n.range()[0]
|
|
726
726
|
},
|
|
727
727
|
hidden: !1
|
|
@@ -729,7 +729,7 @@ const Js = (i) => {
|
|
|
729
729
|
rightPoint: h,
|
|
730
730
|
leftPoint: c,
|
|
731
731
|
closest: t,
|
|
732
|
-
x: g +
|
|
732
|
+
x: g + _ / 2,
|
|
733
733
|
y: 0,
|
|
734
734
|
hidden: !1
|
|
735
735
|
}), (v = o.belowZeroLine) == null || v.update({
|
|
@@ -742,32 +742,32 @@ const Js = (i) => {
|
|
|
742
742
|
}, cn = (i) => {
|
|
743
743
|
const { svg: e, data: t, x: s, config: n, width: a, height: r } = i, { margin: o, hover: c, selection: h } = n;
|
|
744
744
|
let u = null, g = !1;
|
|
745
|
-
const
|
|
745
|
+
const p = (v) => t.reduce(
|
|
746
746
|
(b, w) => Math.abs(s(b.date) - v) < Math.abs(s(w.date) - v) ? b : w
|
|
747
747
|
);
|
|
748
748
|
e.append("rect").attr("width", a - o.left - o.right).attr("height", r - o.top - o.bottom).attr("x", o.left).attr("y", o.top).attr("fill", "transparent").on("mousemove", function(v) {
|
|
749
|
-
const [b] =
|
|
749
|
+
const [b] = E.pointer(v, this), w = p(b);
|
|
750
750
|
!g && c.enable ? (i.action = "hover", Bt(i, w)) : (i.action = g ? "selection" : "none", It(i)), u && h.enable && (i.action = "selection", ln(i, u, w));
|
|
751
751
|
}).on("mouseleave", () => {
|
|
752
752
|
i.action = "none", g = !1, u = null, It(i), Rt(i);
|
|
753
753
|
}).on("mousedown", function(v) {
|
|
754
754
|
if (h.enable) {
|
|
755
755
|
g = !0, i.action = "selection";
|
|
756
|
-
const [b] =
|
|
757
|
-
u =
|
|
756
|
+
const [b] = E.pointer(v, this);
|
|
757
|
+
u = p(b);
|
|
758
758
|
}
|
|
759
759
|
}).on("mouseup", function(v) {
|
|
760
|
-
const [b] =
|
|
760
|
+
const [b] = E.pointer(v, this), w = p(b);
|
|
761
761
|
g = !1, u = null, i.action = "hover", h.enable && Rt(i), c.enable && Bt(i, w);
|
|
762
762
|
});
|
|
763
763
|
}, hn = (i, e, t) => {
|
|
764
|
-
const { margin: s } = e, n =
|
|
764
|
+
const { margin: s } = e, n = E.scaleTime(), a = E.extent(i, (r) => new Date(r.date));
|
|
765
765
|
return a[0] == null || a[1] == null ? n : n.domain([a[0], a[1]]).range([s.left, t - s.right]);
|
|
766
766
|
}, dn = (i, e, t) => {
|
|
767
|
-
const { margin: s } = e, n =
|
|
768
|
-
return
|
|
767
|
+
const { margin: s } = e, n = E.max(i, (r) => r.value) ?? 0, a = E.min(i, (r) => r.value) ?? 0;
|
|
768
|
+
return E.scaleLinear().domain([a, n]).range([t - s.bottom, s.top]);
|
|
769
769
|
}, _r = (i, e) => {
|
|
770
|
-
const t =
|
|
770
|
+
const t = E.select(i);
|
|
771
771
|
if (t.empty())
|
|
772
772
|
return console.error(`Element with selector ${i} not found!`), null;
|
|
773
773
|
if (!e.chartId || !/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e.chartId))
|
|
@@ -776,12 +776,12 @@ const Js = (i) => {
|
|
|
776
776
|
const s = t.append("div"), n = s.append("svg"), a = t.node();
|
|
777
777
|
let r = a.getBoundingClientRect(), o = r.width, c = r.height, h = Nt({ ...Qs }, e.config), u = e.data;
|
|
778
778
|
const g = () => {
|
|
779
|
-
r = a.getBoundingClientRect(), o = r.width, c = r.height,
|
|
779
|
+
r = a.getBoundingClientRect(), o = r.width, c = r.height, p({ data: u, config: h });
|
|
780
780
|
};
|
|
781
781
|
window.addEventListener("resize", g);
|
|
782
|
-
const
|
|
783
|
-
v &&
|
|
784
|
-
const b = u.map((T) => ({ date: new Date(T.date), value: T.value })).sort((T,
|
|
782
|
+
const p = (_, v = !1) => {
|
|
783
|
+
v && _.config && (h = Nt(h, _.config)), v && _.data && (u = _.data);
|
|
784
|
+
const b = u.map((T) => ({ date: new Date(T.date), value: T.value })).sort((T, k) => T.date.getTime() - k.date.getTime()), w = hn(b, h, o), C = dn(b, h, c);
|
|
785
785
|
s.attr("class", `sc-charts sc-charts__${h.theme}`), n.attr("preserveAspectRatio", "xMinYMin meet").attr("viewBox", `0 0 ${o} ${c}`).style("width", "100%").style("height", "100%").selectAll("*").remove();
|
|
786
786
|
const y = {
|
|
787
787
|
chartId: e.chartId,
|
|
@@ -802,8 +802,8 @@ const Js = (i) => {
|
|
|
802
802
|
};
|
|
803
803
|
cn(x);
|
|
804
804
|
};
|
|
805
|
-
return
|
|
806
|
-
update: (
|
|
805
|
+
return p(e), {
|
|
806
|
+
update: (_) => p(_, !0),
|
|
807
807
|
destroy: () => {
|
|
808
808
|
window.removeEventListener("resize", g), n.remove();
|
|
809
809
|
}
|
|
@@ -818,8 +818,8 @@ ue.exports;
|
|
|
818
818
|
var $t;
|
|
819
819
|
function fn() {
|
|
820
820
|
return $t || ($t = 1, function(i, e) {
|
|
821
|
-
var t = 200, s = "__lodash_hash_undefined__", n = 800, a = 16, r = 9007199254740991, o = "[object Arguments]", c = "[object Array]", h = "[object AsyncFunction]", u = "[object Boolean]", g = "[object Date]",
|
|
822
|
-
|
|
821
|
+
var t = 200, s = "__lodash_hash_undefined__", n = 800, a = 16, r = 9007199254740991, o = "[object Arguments]", c = "[object Array]", h = "[object AsyncFunction]", u = "[object Boolean]", g = "[object Date]", p = "[object Error]", _ = "[object Function]", v = "[object GeneratorFunction]", b = "[object Map]", w = "[object Number]", C = "[object Null]", y = "[object Object]", x = "[object Proxy]", T = "[object RegExp]", k = "[object Set]", R = "[object String]", $ = "[object Undefined]", P = "[object WeakMap]", U = "[object ArrayBuffer]", O = "[object DataView]", He = "[object Float32Array]", ri = "[object Float64Array]", oi = "[object Int8Array]", li = "[object Int16Array]", ci = "[object Int32Array]", hi = "[object Uint8Array]", di = "[object Uint8ClampedArray]", ui = "[object Uint16Array]", fi = "[object Uint32Array]", gi = /[\\^$.*+?()[\]{}|]/g, mi = /^\[object .+?Constructor\]$/, _i = /^(?:0|[1-9]\d*)$/, F = {};
|
|
822
|
+
F[He] = F[ri] = F[oi] = F[li] = F[ci] = F[hi] = F[di] = F[ui] = F[fi] = !0, F[o] = F[c] = F[U] = F[u] = F[O] = F[g] = F[p] = F[_] = F[b] = F[w] = F[y] = F[T] = F[k] = F[R] = F[P] = !1;
|
|
823
823
|
var lt = typeof Te == "object" && Te && Te.Object === Object && Te, pi = typeof self == "object" && self && self.Object === Object && self, re = lt || pi || Function("return this")(), ct = e && !e.nodeType && e, oe = ct && !0 && i && !i.nodeType && i, ht = oe && oe.exports === ct, Be = ht && lt.process, dt = function() {
|
|
824
824
|
try {
|
|
825
825
|
var l = oe && oe.require && oe.require("util").types;
|
|
@@ -841,9 +841,9 @@ function fn() {
|
|
|
841
841
|
return l.apply(d, m);
|
|
842
842
|
}
|
|
843
843
|
function bi(l, d) {
|
|
844
|
-
for (var m = -1,
|
|
845
|
-
|
|
846
|
-
return
|
|
844
|
+
for (var m = -1, A = Array(l); ++m < l; )
|
|
845
|
+
A[m] = d(m);
|
|
846
|
+
return A;
|
|
847
847
|
}
|
|
848
848
|
function yi(l) {
|
|
849
849
|
return function(d) {
|
|
@@ -858,10 +858,10 @@ function fn() {
|
|
|
858
858
|
return l(d(m));
|
|
859
859
|
};
|
|
860
860
|
}
|
|
861
|
-
var Ci = Array.prototype,
|
|
861
|
+
var Ci = Array.prototype, Ai = Function.prototype, ve = Object.prototype, Ie = re["__core-js_shared__"], be = Ai.toString, J = ve.hasOwnProperty, ft = function() {
|
|
862
862
|
var l = /[^.]+$/.exec(Ie && Ie.keys && Ie.keys.IE_PROTO || "");
|
|
863
863
|
return l ? "Symbol(src)_1." + l : "";
|
|
864
|
-
}(), gt = ve.toString,
|
|
864
|
+
}(), gt = ve.toString, Mi = be.call(Object), Ti = RegExp(
|
|
865
865
|
"^" + be.call(J).replace(gi, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
866
866
|
), ye = ht ? re.Buffer : void 0, mt = re.Symbol, _t = re.Uint8Array;
|
|
867
867
|
ye && ye.allocUnsafe;
|
|
@@ -871,7 +871,7 @@ function fn() {
|
|
|
871
871
|
return l({}, "", {}), l;
|
|
872
872
|
} catch {
|
|
873
873
|
}
|
|
874
|
-
}(), Di = ye ? ye.isBuffer : void 0, bt = Math.max,
|
|
874
|
+
}(), Di = ye ? ye.isBuffer : void 0, bt = Math.max, Ei = Date.now, yt = Pe(re, "Map"), le = Pe(Object, "create"), Li = /* @__PURE__ */ function() {
|
|
875
875
|
function l() {
|
|
876
876
|
}
|
|
877
877
|
return function(d) {
|
|
@@ -887,8 +887,8 @@ function fn() {
|
|
|
887
887
|
function ee(l) {
|
|
888
888
|
var d = -1, m = l == null ? 0 : l.length;
|
|
889
889
|
for (this.clear(); ++d < m; ) {
|
|
890
|
-
var
|
|
891
|
-
this.set(
|
|
890
|
+
var A = l[d];
|
|
891
|
+
this.set(A[0], A[1]);
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
894
|
function Ni() {
|
|
@@ -915,11 +915,11 @@ function fn() {
|
|
|
915
915
|
return this.size += this.has(l) ? 0 : 1, m[l] = le && d === void 0 ? s : d, this;
|
|
916
916
|
}
|
|
917
917
|
ee.prototype.clear = Ni, ee.prototype.delete = Fi, ee.prototype.get = Hi, ee.prototype.has = Bi, ee.prototype.set = Ii;
|
|
918
|
-
function
|
|
918
|
+
function G(l) {
|
|
919
919
|
var d = -1, m = l == null ? 0 : l.length;
|
|
920
920
|
for (this.clear(); ++d < m; ) {
|
|
921
|
-
var
|
|
922
|
-
this.set(
|
|
921
|
+
var A = l[d];
|
|
922
|
+
this.set(A[0], A[1]);
|
|
923
923
|
}
|
|
924
924
|
}
|
|
925
925
|
function Ri() {
|
|
@@ -929,8 +929,8 @@ function fn() {
|
|
|
929
929
|
var d = this.__data__, m = xe(d, l);
|
|
930
930
|
if (m < 0)
|
|
931
931
|
return !1;
|
|
932
|
-
var
|
|
933
|
-
return m ==
|
|
932
|
+
var A = d.length - 1;
|
|
933
|
+
return m == A ? d.pop() : ki.call(d, m, 1), --this.size, !0;
|
|
934
934
|
}
|
|
935
935
|
function Pi(l) {
|
|
936
936
|
var d = this.__data__, m = xe(d, l);
|
|
@@ -940,45 +940,45 @@ function fn() {
|
|
|
940
940
|
return xe(this.__data__, l) > -1;
|
|
941
941
|
}
|
|
942
942
|
function zi(l, d) {
|
|
943
|
-
var m = this.__data__,
|
|
944
|
-
return
|
|
943
|
+
var m = this.__data__, A = xe(m, l);
|
|
944
|
+
return A < 0 ? (++this.size, m.push([l, d])) : m[A][1] = d, this;
|
|
945
945
|
}
|
|
946
|
-
|
|
946
|
+
G.prototype.clear = Ri, G.prototype.delete = $i, G.prototype.get = Pi, G.prototype.has = Oi, G.prototype.set = zi;
|
|
947
947
|
function se(l) {
|
|
948
948
|
var d = -1, m = l == null ? 0 : l.length;
|
|
949
949
|
for (this.clear(); ++d < m; ) {
|
|
950
|
-
var
|
|
951
|
-
this.set(
|
|
950
|
+
var A = l[d];
|
|
951
|
+
this.set(A[0], A[1]);
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
954
|
function Vi() {
|
|
955
955
|
this.size = 0, this.__data__ = {
|
|
956
956
|
hash: new ee(),
|
|
957
|
-
map: new (yt ||
|
|
957
|
+
map: new (yt || G)(),
|
|
958
958
|
string: new ee()
|
|
959
959
|
};
|
|
960
960
|
}
|
|
961
961
|
function ji(l) {
|
|
962
|
-
var d =
|
|
962
|
+
var d = Ae(this, l).delete(l);
|
|
963
963
|
return this.size -= d ? 1 : 0, d;
|
|
964
964
|
}
|
|
965
965
|
function Yi(l) {
|
|
966
|
-
return
|
|
966
|
+
return Ae(this, l).get(l);
|
|
967
967
|
}
|
|
968
968
|
function Wi(l) {
|
|
969
|
-
return
|
|
969
|
+
return Ae(this, l).has(l);
|
|
970
970
|
}
|
|
971
971
|
function Xi(l, d) {
|
|
972
|
-
var m =
|
|
973
|
-
return m.set(l, d), this.size += m.size ==
|
|
972
|
+
var m = Ae(this, l), A = m.size;
|
|
973
|
+
return m.set(l, d), this.size += m.size == A ? 0 : 1, this;
|
|
974
974
|
}
|
|
975
975
|
se.prototype.clear = Vi, se.prototype.delete = ji, se.prototype.get = Yi, se.prototype.has = Wi, se.prototype.set = Xi;
|
|
976
976
|
function ne(l) {
|
|
977
|
-
var d = this.__data__ = new
|
|
977
|
+
var d = this.__data__ = new G(l);
|
|
978
978
|
this.size = d.size;
|
|
979
979
|
}
|
|
980
980
|
function Ui() {
|
|
981
|
-
this.__data__ = new
|
|
981
|
+
this.__data__ = new G(), this.size = 0;
|
|
982
982
|
}
|
|
983
983
|
function Gi(l) {
|
|
984
984
|
var d = this.__data__, m = d.delete(l);
|
|
@@ -992,35 +992,35 @@ function fn() {
|
|
|
992
992
|
}
|
|
993
993
|
function Ji(l, d) {
|
|
994
994
|
var m = this.__data__;
|
|
995
|
-
if (m instanceof
|
|
996
|
-
var
|
|
997
|
-
if (!yt ||
|
|
998
|
-
return
|
|
999
|
-
m = this.__data__ = new se(
|
|
995
|
+
if (m instanceof G) {
|
|
996
|
+
var A = m.__data__;
|
|
997
|
+
if (!yt || A.length < t - 1)
|
|
998
|
+
return A.push([l, d]), this.size = ++m.size, this;
|
|
999
|
+
m = this.__data__ = new se(A);
|
|
1000
1000
|
}
|
|
1001
1001
|
return m.set(l, d), this.size = m.size, this;
|
|
1002
1002
|
}
|
|
1003
1003
|
ne.prototype.clear = Ui, ne.prototype.delete = Gi, ne.prototype.get = Zi, ne.prototype.has = qi, ne.prototype.set = Ji;
|
|
1004
1004
|
function Qi(l, d) {
|
|
1005
|
-
var m = Ve(l),
|
|
1005
|
+
var m = Ve(l), A = !m && ze(l), S = !m && !A && Mt(l), N = !m && !A && !S && St(l), H = m || A || S || N, L = H ? bi(l.length, String) : [], B = L.length;
|
|
1006
1006
|
for (var Y in l)
|
|
1007
1007
|
H && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1008
1008
|
(Y == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1009
1009
|
S && (Y == "offset" || Y == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1010
|
-
|
|
1010
|
+
N && (Y == "buffer" || Y == "byteLength" || Y == "byteOffset") || // Skip index properties.
|
|
1011
1011
|
Ct(Y, B)) || L.push(Y);
|
|
1012
1012
|
return L;
|
|
1013
1013
|
}
|
|
1014
1014
|
function Re(l, d, m) {
|
|
1015
|
-
(m !== void 0 && !
|
|
1015
|
+
(m !== void 0 && !Me(l[d], m) || m === void 0 && !(d in l)) && $e(l, d, m);
|
|
1016
1016
|
}
|
|
1017
1017
|
function Ki(l, d, m) {
|
|
1018
|
-
var
|
|
1019
|
-
(!(J.call(l, d) &&
|
|
1018
|
+
var A = l[d];
|
|
1019
|
+
(!(J.call(l, d) && Me(A, m)) || m === void 0 && !(d in l)) && $e(l, d, m);
|
|
1020
1020
|
}
|
|
1021
1021
|
function xe(l, d) {
|
|
1022
1022
|
for (var m = l.length; m--; )
|
|
1023
|
-
if (
|
|
1023
|
+
if (Me(l[m][0], d))
|
|
1024
1024
|
return m;
|
|
1025
1025
|
return -1;
|
|
1026
1026
|
}
|
|
@@ -1043,41 +1043,41 @@ function fn() {
|
|
|
1043
1043
|
if (!te(l) || vs(l))
|
|
1044
1044
|
return !1;
|
|
1045
1045
|
var d = Ye(l) ? Ti : mi;
|
|
1046
|
-
return d.test(
|
|
1046
|
+
return d.test(As(l));
|
|
1047
1047
|
}
|
|
1048
1048
|
function is(l) {
|
|
1049
|
-
return ce(l) && Tt(l.length) && !!
|
|
1049
|
+
return ce(l) && Tt(l.length) && !!F[Ce(l)];
|
|
1050
1050
|
}
|
|
1051
1051
|
function ss(l) {
|
|
1052
1052
|
if (!te(l))
|
|
1053
1053
|
return bs(l);
|
|
1054
|
-
var d =
|
|
1055
|
-
for (var
|
|
1056
|
-
|
|
1054
|
+
var d = At(l), m = [];
|
|
1055
|
+
for (var A in l)
|
|
1056
|
+
A == "constructor" && (d || !J.call(l, A)) || m.push(A);
|
|
1057
1057
|
return m;
|
|
1058
1058
|
}
|
|
1059
|
-
function xt(l, d, m,
|
|
1060
|
-
l !== d && es(d, function(
|
|
1061
|
-
if (S || (S = new ne()), te(
|
|
1062
|
-
ns(l, d, H, m, xt,
|
|
1059
|
+
function xt(l, d, m, A, S) {
|
|
1060
|
+
l !== d && es(d, function(N, H) {
|
|
1061
|
+
if (S || (S = new ne()), te(N))
|
|
1062
|
+
ns(l, d, H, m, xt, A, S);
|
|
1063
1063
|
else {
|
|
1064
|
-
var L =
|
|
1065
|
-
L === void 0 && (L =
|
|
1064
|
+
var L = A ? A(Oe(l, H), N, H + "", l, d, S) : void 0;
|
|
1065
|
+
L === void 0 && (L = N), Re(l, H, L);
|
|
1066
1066
|
}
|
|
1067
1067
|
}, kt);
|
|
1068
1068
|
}
|
|
1069
|
-
function ns(l, d, m,
|
|
1069
|
+
function ns(l, d, m, A, S, N, H) {
|
|
1070
1070
|
var L = Oe(l, m), B = Oe(d, m), Y = H.get(B);
|
|
1071
1071
|
if (Y) {
|
|
1072
1072
|
Re(l, m, Y);
|
|
1073
1073
|
return;
|
|
1074
1074
|
}
|
|
1075
|
-
var
|
|
1075
|
+
var z = N ? N(L, B, m + "", l, d, H) : void 0, he = z === void 0;
|
|
1076
1076
|
if (he) {
|
|
1077
|
-
var We = Ve(B), Xe = !We &&
|
|
1078
|
-
|
|
1077
|
+
var We = Ve(B), Xe = !We && Mt(B), Et = !We && !Xe && St(B);
|
|
1078
|
+
z = B, We || Xe || Et ? Ve(L) ? z = L : Ms(L) ? z = hs(L) : Xe ? (he = !1, z = os(B)) : Et ? (he = !1, z = cs(B)) : z = [] : Ts(B) || ze(B) ? (z = L, ze(L) ? z = Ss(L) : (!te(L) || Ye(L)) && (z = ms(B))) : he = !1;
|
|
1079
1079
|
}
|
|
1080
|
-
he && (H.set(B,
|
|
1080
|
+
he && (H.set(B, z), S(z, B, A, N, H), H.delete(B)), Re(l, m, z);
|
|
1081
1081
|
}
|
|
1082
1082
|
function as(l, d) {
|
|
1083
1083
|
return xs(ws(l, d, Dt), l + "");
|
|
@@ -1102,41 +1102,41 @@ function fn() {
|
|
|
1102
1102
|
return new l.constructor(m, l.byteOffset, l.length);
|
|
1103
1103
|
}
|
|
1104
1104
|
function hs(l, d) {
|
|
1105
|
-
var m = -1,
|
|
1106
|
-
for (d || (d = Array(
|
|
1105
|
+
var m = -1, A = l.length;
|
|
1106
|
+
for (d || (d = Array(A)); ++m < A; )
|
|
1107
1107
|
d[m] = l[m];
|
|
1108
1108
|
return d;
|
|
1109
1109
|
}
|
|
1110
|
-
function ds(l, d, m,
|
|
1110
|
+
function ds(l, d, m, A) {
|
|
1111
1111
|
var S = !m;
|
|
1112
1112
|
m || (m = {});
|
|
1113
|
-
for (var
|
|
1114
|
-
var L = d[
|
|
1113
|
+
for (var N = -1, H = d.length; ++N < H; ) {
|
|
1114
|
+
var L = d[N], B = void 0;
|
|
1115
1115
|
B === void 0 && (B = l[L]), S ? $e(m, L, B) : Ki(m, L, B);
|
|
1116
1116
|
}
|
|
1117
1117
|
return m;
|
|
1118
1118
|
}
|
|
1119
1119
|
function us(l) {
|
|
1120
1120
|
return as(function(d, m) {
|
|
1121
|
-
var
|
|
1122
|
-
for (
|
|
1123
|
-
var L = m[
|
|
1124
|
-
L && l(d, L,
|
|
1121
|
+
var A = -1, S = m.length, N = S > 1 ? m[S - 1] : void 0, H = S > 2 ? m[2] : void 0;
|
|
1122
|
+
for (N = l.length > 3 && typeof N == "function" ? (S--, N) : void 0, H && _s(m[0], m[1], H) && (N = S < 3 ? void 0 : N, S = 1), d = Object(d); ++A < S; ) {
|
|
1123
|
+
var L = m[A];
|
|
1124
|
+
L && l(d, L, A, N);
|
|
1125
1125
|
}
|
|
1126
1126
|
return d;
|
|
1127
1127
|
});
|
|
1128
1128
|
}
|
|
1129
1129
|
function fs(l) {
|
|
1130
|
-
return function(d, m,
|
|
1131
|
-
for (var S = -1,
|
|
1130
|
+
return function(d, m, A) {
|
|
1131
|
+
for (var S = -1, N = Object(d), H = A(d), L = H.length; L--; ) {
|
|
1132
1132
|
var B = H[++S];
|
|
1133
|
-
if (m(
|
|
1133
|
+
if (m(N[B], B, N) === !1)
|
|
1134
1134
|
break;
|
|
1135
1135
|
}
|
|
1136
1136
|
return d;
|
|
1137
1137
|
};
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1139
|
+
function Ae(l, d) {
|
|
1140
1140
|
var m = l.__data__;
|
|
1141
1141
|
return ps(d) ? m[typeof d == "string" ? "string" : "hash"] : m.map;
|
|
1142
1142
|
}
|
|
@@ -1148,14 +1148,14 @@ function fn() {
|
|
|
1148
1148
|
var d = J.call(l, K), m = l[K];
|
|
1149
1149
|
try {
|
|
1150
1150
|
l[K] = void 0;
|
|
1151
|
-
var
|
|
1151
|
+
var A = !0;
|
|
1152
1152
|
} catch {
|
|
1153
1153
|
}
|
|
1154
1154
|
var S = gt.call(l);
|
|
1155
|
-
return
|
|
1155
|
+
return A && (d ? l[K] = m : delete l[K]), S;
|
|
1156
1156
|
}
|
|
1157
1157
|
function ms(l) {
|
|
1158
|
-
return typeof l.constructor == "function" && !
|
|
1158
|
+
return typeof l.constructor == "function" && !At(l) ? Li(pt(l)) : {};
|
|
1159
1159
|
}
|
|
1160
1160
|
function Ct(l, d) {
|
|
1161
1161
|
var m = typeof l;
|
|
@@ -1164,8 +1164,8 @@ function fn() {
|
|
|
1164
1164
|
function _s(l, d, m) {
|
|
1165
1165
|
if (!te(m))
|
|
1166
1166
|
return !1;
|
|
1167
|
-
var
|
|
1168
|
-
return (
|
|
1167
|
+
var A = typeof d;
|
|
1168
|
+
return (A == "number" ? je(m) && Ct(d, m.length) : A == "string" && d in m) ? Me(m[d], l) : !1;
|
|
1169
1169
|
}
|
|
1170
1170
|
function ps(l) {
|
|
1171
1171
|
var d = typeof l;
|
|
@@ -1174,7 +1174,7 @@ function fn() {
|
|
|
1174
1174
|
function vs(l) {
|
|
1175
1175
|
return !!ft && ft in l;
|
|
1176
1176
|
}
|
|
1177
|
-
function
|
|
1177
|
+
function At(l) {
|
|
1178
1178
|
var d = l && l.constructor, m = typeof d == "function" && d.prototype || ve;
|
|
1179
1179
|
return l === m;
|
|
1180
1180
|
}
|
|
@@ -1190,11 +1190,11 @@ function fn() {
|
|
|
1190
1190
|
}
|
|
1191
1191
|
function ws(l, d, m) {
|
|
1192
1192
|
return d = bt(d === void 0 ? l.length - 1 : d, 0), function() {
|
|
1193
|
-
for (var
|
|
1194
|
-
H[S] =
|
|
1193
|
+
for (var A = arguments, S = -1, N = bt(A.length - d, 0), H = Array(N); ++S < N; )
|
|
1194
|
+
H[S] = A[d + S];
|
|
1195
1195
|
S = -1;
|
|
1196
1196
|
for (var L = Array(d + 1); ++S < d; )
|
|
1197
|
-
L[S] =
|
|
1197
|
+
L[S] = A[S];
|
|
1198
1198
|
return L[d] = m(H), vi(l, this, L);
|
|
1199
1199
|
};
|
|
1200
1200
|
}
|
|
@@ -1206,8 +1206,8 @@ function fn() {
|
|
|
1206
1206
|
function Cs(l) {
|
|
1207
1207
|
var d = 0, m = 0;
|
|
1208
1208
|
return function() {
|
|
1209
|
-
var
|
|
1210
|
-
if (m =
|
|
1209
|
+
var A = Ei(), S = a - (A - m);
|
|
1210
|
+
if (m = A, S > 0) {
|
|
1211
1211
|
if (++d >= n)
|
|
1212
1212
|
return arguments[0];
|
|
1213
1213
|
} else
|
|
@@ -1215,7 +1215,7 @@ function fn() {
|
|
|
1215
1215
|
return l.apply(void 0, arguments);
|
|
1216
1216
|
};
|
|
1217
1217
|
}
|
|
1218
|
-
function
|
|
1218
|
+
function As(l) {
|
|
1219
1219
|
if (l != null) {
|
|
1220
1220
|
try {
|
|
1221
1221
|
return be.call(l);
|
|
@@ -1228,7 +1228,7 @@ function fn() {
|
|
|
1228
1228
|
}
|
|
1229
1229
|
return "";
|
|
1230
1230
|
}
|
|
1231
|
-
function
|
|
1231
|
+
function Me(l, d) {
|
|
1232
1232
|
return l === d || l !== l && d !== d;
|
|
1233
1233
|
}
|
|
1234
1234
|
var ze = wt(/* @__PURE__ */ function() {
|
|
@@ -1239,15 +1239,15 @@ function fn() {
|
|
|
1239
1239
|
function je(l) {
|
|
1240
1240
|
return l != null && Tt(l.length) && !Ye(l);
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1242
|
+
function Ms(l) {
|
|
1243
1243
|
return ce(l) && je(l);
|
|
1244
1244
|
}
|
|
1245
|
-
var
|
|
1245
|
+
var Mt = Di || Es;
|
|
1246
1246
|
function Ye(l) {
|
|
1247
1247
|
if (!te(l))
|
|
1248
1248
|
return !1;
|
|
1249
1249
|
var d = Ce(l);
|
|
1250
|
-
return d ==
|
|
1250
|
+
return d == _ || d == v || d == h || d == x;
|
|
1251
1251
|
}
|
|
1252
1252
|
function Tt(l) {
|
|
1253
1253
|
return typeof l == "number" && l > -1 && l % 1 == 0 && l <= r;
|
|
@@ -1266,7 +1266,7 @@ function fn() {
|
|
|
1266
1266
|
if (d === null)
|
|
1267
1267
|
return !0;
|
|
1268
1268
|
var m = J.call(d, "constructor") && d.constructor;
|
|
1269
|
-
return typeof m == "function" && m instanceof m && be.call(m) ==
|
|
1269
|
+
return typeof m == "function" && m instanceof m && be.call(m) == Mi;
|
|
1270
1270
|
}
|
|
1271
1271
|
var St = ut ? yi(ut) : is;
|
|
1272
1272
|
function Ss(l) {
|
|
@@ -1286,7 +1286,7 @@ function fn() {
|
|
|
1286
1286
|
function Dt(l) {
|
|
1287
1287
|
return l;
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1289
|
+
function Es() {
|
|
1290
1290
|
return !1;
|
|
1291
1291
|
}
|
|
1292
1292
|
i.exports = ks;
|
|
@@ -1380,7 +1380,7 @@ class _n {
|
|
|
1380
1380
|
return this._trade;
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
1383
|
-
class
|
|
1383
|
+
class j {
|
|
1384
1384
|
constructor(e) {
|
|
1385
1385
|
f(this, "x");
|
|
1386
1386
|
f(this, "y");
|
|
@@ -1423,32 +1423,32 @@ class V {
|
|
|
1423
1423
|
}
|
|
1424
1424
|
class pn {
|
|
1425
1425
|
constructor(e, t) {
|
|
1426
|
-
f(this, "_chart", new
|
|
1427
|
-
f(this, "_area", new
|
|
1428
|
-
f(this, "_xAxis", new
|
|
1429
|
-
f(this, "_yAxis", new
|
|
1430
|
-
f(this, "_axisIntersection", new
|
|
1426
|
+
f(this, "_chart", new j());
|
|
1427
|
+
f(this, "_area", new j());
|
|
1428
|
+
f(this, "_xAxis", new j());
|
|
1429
|
+
f(this, "_yAxis", new j());
|
|
1430
|
+
f(this, "_axisIntersection", new j());
|
|
1431
1431
|
const { xAxis: s, yAxis: n } = t;
|
|
1432
|
-
this._chart = new
|
|
1432
|
+
this._chart = new j(e), this._calc(s, n);
|
|
1433
1433
|
}
|
|
1434
1434
|
_calc(e, t) {
|
|
1435
1435
|
const s = e.isShow ? e.height : 0, n = t.isShow ? t.width : 0, a = this._chart.height - s, r = this._chart.width - n;
|
|
1436
|
-
this._area = new
|
|
1436
|
+
this._area = new j({
|
|
1437
1437
|
x: t.position === "left" ? n : 0,
|
|
1438
1438
|
y: e.position === "top" ? s : 0,
|
|
1439
1439
|
width: r,
|
|
1440
1440
|
height: a
|
|
1441
|
-
}), this._xAxis = new
|
|
1441
|
+
}), this._xAxis = new j({
|
|
1442
1442
|
y: e.position === "top" ? 0 : a,
|
|
1443
1443
|
x: t.position === "left" ? n : 0,
|
|
1444
1444
|
height: s,
|
|
1445
1445
|
width: r
|
|
1446
|
-
}), this._yAxis = new
|
|
1446
|
+
}), this._yAxis = new j({
|
|
1447
1447
|
y: e.position === "top" ? s : 0,
|
|
1448
1448
|
x: t.position === "left" ? 0 : r,
|
|
1449
1449
|
width: n,
|
|
1450
1450
|
height: a
|
|
1451
|
-
}), this._axisIntersection = new
|
|
1451
|
+
}), this._axisIntersection = new j({
|
|
1452
1452
|
y: e.position === "top" ? 0 : a,
|
|
1453
1453
|
x: t.position === "left" ? 0 : r,
|
|
1454
1454
|
width: n,
|
|
@@ -1461,7 +1461,7 @@ class pn {
|
|
|
1461
1461
|
}
|
|
1462
1462
|
update(e) {
|
|
1463
1463
|
const { xAxis: t, yAxis: s } = e.config;
|
|
1464
|
-
this._chart = new
|
|
1464
|
+
this._chart = new j(e.container), this._calc(t, s);
|
|
1465
1465
|
}
|
|
1466
1466
|
get area() {
|
|
1467
1467
|
return this._area;
|
|
@@ -1505,14 +1505,14 @@ function Ot(i, e) {
|
|
|
1505
1505
|
throw new Error("[CS_Data] error while creating missing data");
|
|
1506
1506
|
const c = r.close, h = o.open;
|
|
1507
1507
|
let u = c;
|
|
1508
|
-
a.forEach((g,
|
|
1509
|
-
const
|
|
1510
|
-
let v = u +
|
|
1508
|
+
a.forEach((g, p) => {
|
|
1509
|
+
const _ = (h - u) / a.length;
|
|
1510
|
+
let v = u + _ * p, b = v + _;
|
|
1511
1511
|
const w = Math.abs(v - b);
|
|
1512
1512
|
let C = Math.max(v, b) + w / 2, y = Math.min(v, b) - w / 2;
|
|
1513
1513
|
if (e.trade) {
|
|
1514
|
-
const T = [...e.trade.entries, ...e.trade.exits].find((
|
|
1515
|
-
const R =
|
|
1514
|
+
const T = [...e.trade.entries, ...e.trade.exits].find((k) => {
|
|
1515
|
+
const R = k.time.getTime();
|
|
1516
1516
|
return R >= g && R < g + t;
|
|
1517
1517
|
});
|
|
1518
1518
|
T && (T.type === "buy" ? (y = T.price, b = Math.max(y, b), v = b + w, C = Math.max(v, b) + w / 2, u = v) : T.type === "sell" && (C = T.price, b = Math.min(C, b), v = b - w, y = Math.min(v, b) - w / 2, u = v));
|
|
@@ -1627,12 +1627,12 @@ class Kt {
|
|
|
1627
1627
|
}
|
|
1628
1628
|
class ei extends Kt {
|
|
1629
1629
|
constructor() {
|
|
1630
|
-
super(), this._scale =
|
|
1630
|
+
super(), this._scale = E.scaleTime();
|
|
1631
1631
|
}
|
|
1632
1632
|
}
|
|
1633
1633
|
class wn extends Kt {
|
|
1634
1634
|
constructor() {
|
|
1635
|
-
super(), this._scale =
|
|
1635
|
+
super(), this._scale = E.scaleLinear();
|
|
1636
1636
|
}
|
|
1637
1637
|
}
|
|
1638
1638
|
const zt = { x: 0.2, y: 0.2 }, Vt = 1e-3, xn = {
|
|
@@ -1645,25 +1645,25 @@ const zt = { x: 0.2, y: 0.2 }, Vt = 1e-3, xn = {
|
|
|
1645
1645
|
const e = i.match(/^(\d+)([a-zA-Z]+)$/);
|
|
1646
1646
|
if (!e) throw new Error(`Invalid offset format: "${i}"`);
|
|
1647
1647
|
return [parseInt(e[1]), e[2]];
|
|
1648
|
-
},
|
|
1648
|
+
}, An = (i, e) => {
|
|
1649
1649
|
const [t, s] = e.domain().map((o) => o.getTime()), n = i.filter((o) => {
|
|
1650
1650
|
const c = o.open_time.getTime();
|
|
1651
1651
|
return c >= t && c <= s;
|
|
1652
|
-
}), a =
|
|
1652
|
+
}), a = E.min(n, (o) => o.low), r = E.max(n, (o) => o.high);
|
|
1653
1653
|
if (a == null || r == null) throw new Error("Invalid Y data");
|
|
1654
1654
|
return [a, r];
|
|
1655
1655
|
};
|
|
1656
|
-
class
|
|
1656
|
+
class Mn {
|
|
1657
1657
|
constructor(e) {
|
|
1658
1658
|
this.model = e;
|
|
1659
1659
|
}
|
|
1660
1660
|
initX(e) {
|
|
1661
|
-
const t = this.model.candles.preparedData, s =
|
|
1661
|
+
const t = this.model.candles.preparedData, s = E.extent(t, (n) => new Date(n.open_time));
|
|
1662
1662
|
if (!s[0] || !s[1]) throw new Error("Invalid x data");
|
|
1663
1663
|
e.setDomain(s), this.setRange(e, this.model.layout.xAxis), this.setDefaultXDomain(e), this.applyOffset(e);
|
|
1664
1664
|
}
|
|
1665
1665
|
initY(e, t) {
|
|
1666
|
-
const s =
|
|
1666
|
+
const s = An(this.model.candles.preparedData, t);
|
|
1667
1667
|
e.setDomain(s), this.setRange(e, this.model.layout.yAxis);
|
|
1668
1668
|
}
|
|
1669
1669
|
init(e) {
|
|
@@ -1679,8 +1679,8 @@ class An {
|
|
|
1679
1679
|
config: {
|
|
1680
1680
|
candles: { baseWidth: n, bodyRatio: a, direction: r }
|
|
1681
1681
|
}
|
|
1682
|
-
} = this.model, [o, c] = e.domain().map((
|
|
1683
|
-
e.setDomain(
|
|
1682
|
+
} = this.model, [o, c] = e.domain().map((_) => _.getTime()), h = c - o, u = n / a * t, g = h * (s.width / u), p = r === "left" ? [new Date(o), new Date(o + g)] : [new Date(c - g), new Date(c)];
|
|
1683
|
+
e.setDomain(p);
|
|
1684
1684
|
}
|
|
1685
1685
|
applyOffset(e) {
|
|
1686
1686
|
const {
|
|
@@ -1704,7 +1704,7 @@ class Tn {
|
|
|
1704
1704
|
});
|
|
1705
1705
|
f(this, "scaleFactor", { x: 1, y: 1 });
|
|
1706
1706
|
f(this, "panOffset", { x: 0, y: 0 });
|
|
1707
|
-
this._model = e, this._scaleX = new ei(), this._scaleY = new wn(), this._initializer = new
|
|
1707
|
+
this._model = e, this._scaleX = new ei(), this._scaleY = new wn(), this._initializer = new Mn(e), this._initializer.init({ x: this._scaleX, y: this._scaleY }), this._baseDomain = {
|
|
1708
1708
|
x: this._scaleX.domain(),
|
|
1709
1709
|
y: this._scaleY.domain()
|
|
1710
1710
|
};
|
|
@@ -1976,7 +1976,7 @@ const Dn = {
|
|
|
1976
1976
|
}
|
|
1977
1977
|
}
|
|
1978
1978
|
};
|
|
1979
|
-
class
|
|
1979
|
+
class En {
|
|
1980
1980
|
constructor(e) {
|
|
1981
1981
|
f(this, "_scheme");
|
|
1982
1982
|
this._scheme = De({}, Dn, e), Object.keys(this._scheme).forEach((t) => {
|
|
@@ -1990,7 +1990,7 @@ class Ln {
|
|
|
1990
1990
|
this._scheme = De({}, this._scheme, e);
|
|
1991
1991
|
}
|
|
1992
1992
|
}
|
|
1993
|
-
class
|
|
1993
|
+
class Ln {
|
|
1994
1994
|
constructor(e, t) {
|
|
1995
1995
|
f(this, "_data");
|
|
1996
1996
|
f(this, "_callbacks", {
|
|
@@ -2055,7 +2055,7 @@ class Nn {
|
|
|
2055
2055
|
f(this, "trade");
|
|
2056
2056
|
f(this, "userMarkers");
|
|
2057
2057
|
f(this, "comments");
|
|
2058
|
-
this.chartId = e, this.container = t, this.candles = new nt(s, this), this.config = new _n(n), this.colorScheme = new
|
|
2058
|
+
this.chartId = e, this.container = t, this.candles = new nt(s, this), this.config = new _n(n), this.colorScheme = new En(o), this.layout = new pn(t, this.config), this.scales = new Tn(this), this.trade = new Sn(this, a), this.candles.updateMissingCandles(), this.trade.recalculate(), this.userMarkers = new kn(this, r), this.comments = new Ln(c, this);
|
|
2059
2059
|
}
|
|
2060
2060
|
init() {
|
|
2061
2061
|
this.eventBus.emit("init_model");
|
|
@@ -2086,7 +2086,7 @@ class Nn {
|
|
|
2086
2086
|
}
|
|
2087
2087
|
}
|
|
2088
2088
|
const Se = window.devicePixelRatio || 2;
|
|
2089
|
-
class
|
|
2089
|
+
class D {
|
|
2090
2090
|
constructor({ tag: e, className: t, id: s, textContent: n }) {
|
|
2091
2091
|
f(this, "_tag");
|
|
2092
2092
|
f(this, "_className");
|
|
@@ -2124,7 +2124,7 @@ class k {
|
|
|
2124
2124
|
this.node.style.opacity = e ? "1" : "0", this.node.style.visibility = e ? "visible" : "hidden";
|
|
2125
2125
|
}
|
|
2126
2126
|
}
|
|
2127
|
-
class _e extends
|
|
2127
|
+
class _e extends D {
|
|
2128
2128
|
constructor({ className: t, id: s, width: n, height: a, isMain: r }) {
|
|
2129
2129
|
super({
|
|
2130
2130
|
tag: "canvas",
|
|
@@ -2163,10 +2163,10 @@ function Hn(i, e) {
|
|
|
2163
2163
|
colorScheme: { xAxis: s },
|
|
2164
2164
|
config: { xAxis: n },
|
|
2165
2165
|
scales: a
|
|
2166
|
-
} = e, r = a.x.ticks(Fn), o = (u) => u.getHours() === 0 && u.getMinutes() === 0, c =
|
|
2166
|
+
} = e, r = a.x.ticks(Fn), o = (u) => u.getHours() === 0 && u.getMinutes() === 0, c = E.timeFormat("%d %b"), h = E.timeFormat("%H:%M");
|
|
2167
2167
|
i.save(), i.fillStyle = s.bg, i.fillRect(t.x, t.y, t.width, t.height), i.restore(), i.fillStyle = s.text, i.font = `${n.text.fontSize} ${n.text.font}`, i.textAlign = "center", i.textBaseline = "middle", r.forEach((u) => {
|
|
2168
|
-
const g = a.x.convert(u),
|
|
2169
|
-
i.fillText(
|
|
2168
|
+
const g = a.x.convert(u), p = o(u) ? c(u) : h(u);
|
|
2169
|
+
i.fillText(p, g, t.y + t.height / 2);
|
|
2170
2170
|
});
|
|
2171
2171
|
}
|
|
2172
2172
|
function Bn(i, e) {
|
|
@@ -2231,38 +2231,38 @@ class Rn {
|
|
|
2231
2231
|
this._target.addEventListener("contextmenu", e);
|
|
2232
2232
|
}
|
|
2233
2233
|
}
|
|
2234
|
-
function
|
|
2234
|
+
function Ee(i) {
|
|
2235
2235
|
return i * 0.1875;
|
|
2236
2236
|
}
|
|
2237
2237
|
const $n = (i, { mainColor: e, textColor: t, symbol: s, x: n, y: a, size: r, fontSize: o }) => {
|
|
2238
|
-
const g = r / 16,
|
|
2239
|
-
i.save(), i.translate(
|
|
2238
|
+
const g = r / 16, p = 16 * g, _ = n - p / 2, v = a;
|
|
2239
|
+
i.save(), i.translate(_, v), i.scale(g, g), i.beginPath(), i.moveTo(7.85696, 0.288512), i.lineTo(4.53377, 3.11938), i.bezierCurveTo(4.17982, 3.42089, 4.39305, 4, 4.85801, 4), i.lineTo(11.2275, 4), i.bezierCurveTo(11.6818, 4, 11.9006, 3.44302, 11.5678, 3.13374), i.lineTo(8.52156, 0.302869), i.bezierCurveTo(8.33575, 0.130189, 8.05007, 0.124018, 7.85696, 0.288512), i.closePath(), i.fillStyle = e, i.fill(), i.beginPath(), i.moveTo(0, 7), i.bezierCurveTo(0, 4.79086, 1.79086, 3, 4, 3), i.lineTo(12, 3), i.bezierCurveTo(14.2091, 3, 16, 4.79086, 16, 7), i.lineTo(16, 15), i.bezierCurveTo(16, 17.2091, 14.2091, 19, 12, 19), i.lineTo(4, 19), i.bezierCurveTo(1.79086, 19, 0, 17.2091, 0, 15), i.lineTo(0, 7), i.closePath(), i.fillStyle = e, i.fill(), i.restore(), i.save(), i.font = `bold ${o}px sans-serif`, i.textAlign = "center", i.textBaseline = "top", i.textAlign = "center", i.textBaseline = "middle";
|
|
2240
2240
|
const b = a + g * 3 + 0.5, w = g * 16, C = b + w / 2;
|
|
2241
2241
|
i.fillStyle = t, i.fillText(s, n, C), i.restore();
|
|
2242
2242
|
}, Pn = (i, { mainColor: e, textColor: t, symbol: s, x: n, y: a, size: r, fontSize: o }) => {
|
|
2243
|
-
const g = r / 16,
|
|
2244
|
-
i.save(), i.translate(
|
|
2243
|
+
const g = r / 16, p = 16 * g, _ = n - p / 2, v = a;
|
|
2244
|
+
i.save(), i.translate(_, v), i.scale(g, -g), i.beginPath(), i.moveTo(7.85696, 0.288512), i.lineTo(4.53377, 3.11938), i.bezierCurveTo(4.17982, 3.42089, 4.39305, 4, 4.85801, 4), i.lineTo(11.2275, 4), i.bezierCurveTo(11.6818, 4, 11.9006, 3.44302, 11.5678, 3.13374), i.lineTo(8.52156, 0.302869), i.bezierCurveTo(8.33575, 0.130189, 8.05007, 0.124018, 7.85696, 0.288512), i.closePath(), i.fillStyle = e, i.fill(), i.beginPath(), i.moveTo(0, 7), i.bezierCurveTo(0, 4.79086, 1.79086, 3, 4, 3), i.lineTo(12, 3), i.bezierCurveTo(14.2091, 3, 16, 4.79086, 16, 7), i.lineTo(16, 15), i.bezierCurveTo(16, 17.2091, 14.2091, 19, 12, 19), i.lineTo(4, 19), i.bezierCurveTo(1.79086, 19, 0, 17.2091, 0, 15), i.lineTo(0, 7), i.closePath(), i.fillStyle = e, i.fill(), i.restore(), i.save(), i.font = `bold ${o}px sans-serif`, i.textAlign = "center", i.textBaseline = "middle";
|
|
2245
2245
|
const b = g * 16, w = a - g * 19 + b / 2;
|
|
2246
2246
|
i.fillStyle = t, i.fillText(s, n, w), i.restore();
|
|
2247
2247
|
};
|
|
2248
|
-
function
|
|
2248
|
+
function Le(i) {
|
|
2249
2249
|
"@babel/helpers - typeof";
|
|
2250
|
-
return
|
|
2250
|
+
return Le = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2251
2251
|
return typeof e;
|
|
2252
2252
|
} : function(e) {
|
|
2253
2253
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2254
|
-
},
|
|
2254
|
+
}, Le(i);
|
|
2255
2255
|
}
|
|
2256
2256
|
var On = /^\s+/, zn = /\s+$/;
|
|
2257
|
-
function
|
|
2258
|
-
if (i = i || "", e = e || {}, i instanceof
|
|
2257
|
+
function M(i, e) {
|
|
2258
|
+
if (i = i || "", e = e || {}, i instanceof M)
|
|
2259
2259
|
return i;
|
|
2260
|
-
if (!(this instanceof
|
|
2261
|
-
return new
|
|
2260
|
+
if (!(this instanceof M))
|
|
2261
|
+
return new M(i, e);
|
|
2262
2262
|
var t = Vn(i);
|
|
2263
2263
|
this._originalInput = i, this._r = t.r, this._g = t.g, this._b = t.b, this._a = t.a, this._roundA = Math.round(100 * this._a) / 100, this._format = e.format || t.format, this._gradientType = e.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = t.ok;
|
|
2264
2264
|
}
|
|
2265
|
-
|
|
2265
|
+
M.prototype = {
|
|
2266
2266
|
isDark: function() {
|
|
2267
2267
|
return this.getBrightness() < 128;
|
|
2268
2268
|
},
|
|
@@ -2358,7 +2358,7 @@ A.prototype = {
|
|
|
2358
2358
|
toFilter: function(e) {
|
|
2359
2359
|
var t = "#" + Xt(this._r, this._g, this._b, this._a), s = t, n = this._gradientType ? "GradientType = 1, " : "";
|
|
2360
2360
|
if (e) {
|
|
2361
|
-
var a =
|
|
2361
|
+
var a = M(e);
|
|
2362
2362
|
s = "#" + Xt(a._r, a._g, a._b, a._a);
|
|
2363
2363
|
}
|
|
2364
2364
|
return "progid:DXImageTransform.Microsoft.gradient(" + n + "startColorstr=" + t + ",endColorstr=" + s + ")";
|
|
@@ -2370,7 +2370,7 @@ A.prototype = {
|
|
|
2370
2370
|
return a ? e === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (s = this.toRgbString()), e === "prgb" && (s = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (s = this.toHexString()), e === "hex3" && (s = this.toHexString(!0)), e === "hex4" && (s = this.toHex8String(!0)), e === "hex8" && (s = this.toHex8String()), e === "name" && (s = this.toName()), e === "hsl" && (s = this.toHslString()), e === "hsv" && (s = this.toHsvString()), s || this.toHexString());
|
|
2371
2371
|
},
|
|
2372
2372
|
clone: function() {
|
|
2373
|
-
return
|
|
2373
|
+
return M(this.toString());
|
|
2374
2374
|
},
|
|
2375
2375
|
_applyModification: function(e, t) {
|
|
2376
2376
|
var s = e.apply(null, [this].concat([].slice.call(t)));
|
|
@@ -2423,14 +2423,14 @@ A.prototype = {
|
|
|
2423
2423
|
return this._applyCombination(Ut, [4]);
|
|
2424
2424
|
}
|
|
2425
2425
|
};
|
|
2426
|
-
|
|
2427
|
-
if (
|
|
2426
|
+
M.fromRatio = function(i, e) {
|
|
2427
|
+
if (Le(i) == "object") {
|
|
2428
2428
|
var t = {};
|
|
2429
2429
|
for (var s in i)
|
|
2430
2430
|
i.hasOwnProperty(s) && (s === "a" ? t[s] = i[s] : t[s] = fe(i[s]));
|
|
2431
2431
|
i = t;
|
|
2432
2432
|
}
|
|
2433
|
-
return
|
|
2433
|
+
return M(i, e);
|
|
2434
2434
|
};
|
|
2435
2435
|
function Vn(i) {
|
|
2436
2436
|
var e = {
|
|
@@ -2438,7 +2438,7 @@ function Vn(i) {
|
|
|
2438
2438
|
g: 0,
|
|
2439
2439
|
b: 0
|
|
2440
2440
|
}, t = 1, s = null, n = null, a = null, r = !1, o = !1;
|
|
2441
|
-
return typeof i == "string" && (i = la(i)),
|
|
2441
|
+
return typeof i == "string" && (i = la(i)), Le(i) == "object" && (Z(i.r) && Z(i.g) && Z(i.b) ? (e = jn(i.r, i.g, i.b), r = !0, o = String(i.r).substr(-1) === "%" ? "prgb" : "rgb") : Z(i.h) && Z(i.s) && Z(i.v) ? (s = fe(i.s), n = fe(i.v), e = Wn(i.h, s, n), r = !0, o = "hsv") : Z(i.h) && Z(i.s) && Z(i.l) && (s = fe(i.s), a = fe(i.l), e = Yn(i.h, s, a), r = !0, o = "hsl"), i.hasOwnProperty("a") && (t = i.a)), t = ti(t), {
|
|
2442
2442
|
ok: r,
|
|
2443
2443
|
format: i.format || o,
|
|
2444
2444
|
r: Math.min(255, Math.max(e.r, 0)),
|
|
@@ -2544,11 +2544,11 @@ function Xt(i, e, t, s) {
|
|
|
2544
2544
|
var n = [X(ii(s)), X(Math.round(i).toString(16)), X(Math.round(e).toString(16)), X(Math.round(t).toString(16))];
|
|
2545
2545
|
return n.join("");
|
|
2546
2546
|
}
|
|
2547
|
-
|
|
2548
|
-
return !i || !e ? !1 :
|
|
2547
|
+
M.equals = function(i, e) {
|
|
2548
|
+
return !i || !e ? !1 : M(i).toRgbString() == M(e).toRgbString();
|
|
2549
2549
|
};
|
|
2550
|
-
|
|
2551
|
-
return
|
|
2550
|
+
M.random = function() {
|
|
2551
|
+
return M.fromRatio({
|
|
2552
2552
|
r: Math.random(),
|
|
2553
2553
|
g: Math.random(),
|
|
2554
2554
|
b: Math.random()
|
|
@@ -2556,45 +2556,45 @@ A.random = function() {
|
|
|
2556
2556
|
};
|
|
2557
2557
|
function Un(i, e) {
|
|
2558
2558
|
e = e === 0 ? 0 : e || 10;
|
|
2559
|
-
var t =
|
|
2560
|
-
return t.s -= e / 100, t.s = Fe(t.s),
|
|
2559
|
+
var t = M(i).toHsl();
|
|
2560
|
+
return t.s -= e / 100, t.s = Fe(t.s), M(t);
|
|
2561
2561
|
}
|
|
2562
2562
|
function Gn(i, e) {
|
|
2563
2563
|
e = e === 0 ? 0 : e || 10;
|
|
2564
|
-
var t =
|
|
2565
|
-
return t.s += e / 100, t.s = Fe(t.s),
|
|
2564
|
+
var t = M(i).toHsl();
|
|
2565
|
+
return t.s += e / 100, t.s = Fe(t.s), M(t);
|
|
2566
2566
|
}
|
|
2567
2567
|
function Zn(i) {
|
|
2568
|
-
return
|
|
2568
|
+
return M(i).desaturate(100);
|
|
2569
2569
|
}
|
|
2570
2570
|
function qn(i, e) {
|
|
2571
2571
|
e = e === 0 ? 0 : e || 10;
|
|
2572
|
-
var t =
|
|
2573
|
-
return t.l += e / 100, t.l = Fe(t.l),
|
|
2572
|
+
var t = M(i).toHsl();
|
|
2573
|
+
return t.l += e / 100, t.l = Fe(t.l), M(t);
|
|
2574
2574
|
}
|
|
2575
2575
|
function Jn(i, e) {
|
|
2576
2576
|
e = e === 0 ? 0 : e || 10;
|
|
2577
|
-
var t =
|
|
2578
|
-
return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(e / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(e / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(e / 100)))),
|
|
2577
|
+
var t = M(i).toRgb();
|
|
2578
|
+
return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(e / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(e / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(e / 100)))), M(t);
|
|
2579
2579
|
}
|
|
2580
2580
|
function Qn(i, e) {
|
|
2581
2581
|
e = e === 0 ? 0 : e || 10;
|
|
2582
|
-
var t =
|
|
2583
|
-
return t.l -= e / 100, t.l = Fe(t.l),
|
|
2582
|
+
var t = M(i).toHsl();
|
|
2583
|
+
return t.l -= e / 100, t.l = Fe(t.l), M(t);
|
|
2584
2584
|
}
|
|
2585
2585
|
function Kn(i, e) {
|
|
2586
|
-
var t =
|
|
2587
|
-
return t.h = s < 0 ? 360 + s : s,
|
|
2586
|
+
var t = M(i).toHsl(), s = (t.h + e) % 360;
|
|
2587
|
+
return t.h = s < 0 ? 360 + s : s, M(t);
|
|
2588
2588
|
}
|
|
2589
2589
|
function ea(i) {
|
|
2590
|
-
var e =
|
|
2591
|
-
return e.h = (e.h + 180) % 360,
|
|
2590
|
+
var e = M(i).toHsl();
|
|
2591
|
+
return e.h = (e.h + 180) % 360, M(e);
|
|
2592
2592
|
}
|
|
2593
2593
|
function Ut(i, e) {
|
|
2594
2594
|
if (isNaN(e) || e <= 0)
|
|
2595
2595
|
throw new Error("Argument to polyad must be a positive number");
|
|
2596
|
-
for (var t =
|
|
2597
|
-
s.push(
|
|
2596
|
+
for (var t = M(i).toHsl(), s = [M(i)], n = 360 / e, a = 1; a < e; a++)
|
|
2597
|
+
s.push(M({
|
|
2598
2598
|
h: (t.h + a * n) % 360,
|
|
2599
2599
|
s: t.s,
|
|
2600
2600
|
l: t.l
|
|
@@ -2602,12 +2602,12 @@ function Ut(i, e) {
|
|
|
2602
2602
|
return s;
|
|
2603
2603
|
}
|
|
2604
2604
|
function ta(i) {
|
|
2605
|
-
var e =
|
|
2606
|
-
return [
|
|
2605
|
+
var e = M(i).toHsl(), t = e.h;
|
|
2606
|
+
return [M(i), M({
|
|
2607
2607
|
h: (t + 72) % 360,
|
|
2608
2608
|
s: e.s,
|
|
2609
2609
|
l: e.l
|
|
2610
|
-
}),
|
|
2610
|
+
}), M({
|
|
2611
2611
|
h: (t + 216) % 360,
|
|
2612
2612
|
s: e.s,
|
|
2613
2613
|
l: e.l
|
|
@@ -2615,37 +2615,37 @@ function ta(i) {
|
|
|
2615
2615
|
}
|
|
2616
2616
|
function ia(i, e, t) {
|
|
2617
2617
|
e = e || 6, t = t || 30;
|
|
2618
|
-
var s =
|
|
2618
|
+
var s = M(i).toHsl(), n = 360 / t, a = [M(i)];
|
|
2619
2619
|
for (s.h = (s.h - (n * e >> 1) + 720) % 360; --e; )
|
|
2620
|
-
s.h = (s.h + n) % 360, a.push(
|
|
2620
|
+
s.h = (s.h + n) % 360, a.push(M(s));
|
|
2621
2621
|
return a;
|
|
2622
2622
|
}
|
|
2623
2623
|
function sa(i, e) {
|
|
2624
2624
|
e = e || 6;
|
|
2625
|
-
for (var t =
|
|
2626
|
-
r.push(
|
|
2625
|
+
for (var t = M(i).toHsv(), s = t.h, n = t.s, a = t.v, r = [], o = 1 / e; e--; )
|
|
2626
|
+
r.push(M({
|
|
2627
2627
|
h: s,
|
|
2628
2628
|
s: n,
|
|
2629
2629
|
v: a
|
|
2630
2630
|
})), a = (a + o) % 1;
|
|
2631
2631
|
return r;
|
|
2632
2632
|
}
|
|
2633
|
-
|
|
2633
|
+
M.mix = function(i, e, t) {
|
|
2634
2634
|
t = t === 0 ? 0 : t || 50;
|
|
2635
|
-
var s =
|
|
2635
|
+
var s = M(i).toRgb(), n = M(e).toRgb(), a = t / 100, r = {
|
|
2636
2636
|
r: (n.r - s.r) * a + s.r,
|
|
2637
2637
|
g: (n.g - s.g) * a + s.g,
|
|
2638
2638
|
b: (n.b - s.b) * a + s.b,
|
|
2639
2639
|
a: (n.a - s.a) * a + s.a
|
|
2640
2640
|
};
|
|
2641
|
-
return
|
|
2641
|
+
return M(r);
|
|
2642
2642
|
};
|
|
2643
|
-
|
|
2644
|
-
var t =
|
|
2643
|
+
M.readability = function(i, e) {
|
|
2644
|
+
var t = M(i), s = M(e);
|
|
2645
2645
|
return (Math.max(t.getLuminance(), s.getLuminance()) + 0.05) / (Math.min(t.getLuminance(), s.getLuminance()) + 0.05);
|
|
2646
2646
|
};
|
|
2647
|
-
|
|
2648
|
-
var s =
|
|
2647
|
+
M.isReadable = function(i, e, t) {
|
|
2648
|
+
var s = M.readability(i, e), n, a;
|
|
2649
2649
|
switch (a = !1, n = ca(t), n.level + n.size) {
|
|
2650
2650
|
case "AAsmall":
|
|
2651
2651
|
case "AAAlarge":
|
|
@@ -2660,17 +2660,17 @@ A.isReadable = function(i, e, t) {
|
|
|
2660
2660
|
}
|
|
2661
2661
|
return a;
|
|
2662
2662
|
};
|
|
2663
|
-
|
|
2663
|
+
M.mostReadable = function(i, e, t) {
|
|
2664
2664
|
var s = null, n = 0, a, r, o, c;
|
|
2665
2665
|
t = t || {}, r = t.includeFallbackColors, o = t.level, c = t.size;
|
|
2666
2666
|
for (var h = 0; h < e.length; h++)
|
|
2667
|
-
a =
|
|
2668
|
-
return
|
|
2667
|
+
a = M.readability(i, e[h]), a > n && (n = a, s = M(e[h]));
|
|
2668
|
+
return M.isReadable(i, s, {
|
|
2669
2669
|
level: o,
|
|
2670
2670
|
size: c
|
|
2671
|
-
}) || !r ? s : (t.includeFallbackColors = !1,
|
|
2671
|
+
}) || !r ? s : (t.includeFallbackColors = !1, M.mostReadable(i, ["#fff", "#000"], t));
|
|
2672
2672
|
};
|
|
2673
|
-
var tt =
|
|
2673
|
+
var tt = M.names = {
|
|
2674
2674
|
aliceblue: "f0f8ff",
|
|
2675
2675
|
antiquewhite: "faebd7",
|
|
2676
2676
|
aqua: "0ff",
|
|
@@ -2820,7 +2820,7 @@ var tt = A.names = {
|
|
|
2820
2820
|
whitesmoke: "f5f5f5",
|
|
2821
2821
|
yellow: "ff0",
|
|
2822
2822
|
yellowgreen: "9acd32"
|
|
2823
|
-
}, na =
|
|
2823
|
+
}, na = M.hexNames = aa(tt);
|
|
2824
2824
|
function aa(i) {
|
|
2825
2825
|
var e = {};
|
|
2826
2826
|
for (var t in i)
|
|
@@ -2838,7 +2838,7 @@ function I(i, e) {
|
|
|
2838
2838
|
function Fe(i) {
|
|
2839
2839
|
return Math.min(1, Math.max(0, i));
|
|
2840
2840
|
}
|
|
2841
|
-
function
|
|
2841
|
+
function V(i) {
|
|
2842
2842
|
return parseInt(i, 16);
|
|
2843
2843
|
}
|
|
2844
2844
|
function ra(i) {
|
|
@@ -2857,7 +2857,7 @@ function ii(i) {
|
|
|
2857
2857
|
return Math.round(parseFloat(i) * 255).toString(16);
|
|
2858
2858
|
}
|
|
2859
2859
|
function Gt(i) {
|
|
2860
|
-
return
|
|
2860
|
+
return V(i) / 255;
|
|
2861
2861
|
}
|
|
2862
2862
|
var W = function() {
|
|
2863
2863
|
var i = "[-\\+]?\\d+%?", e = "[-\\+]?\\d*\\.\\d+%?", t = "(?:" + e + ")|(?:" + i + ")", s = "[\\s|\\(]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")\\s*\\)?", n = "[\\s|\\(]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")\\s*\\)?";
|
|
@@ -2875,7 +2875,7 @@ var W = function() {
|
|
|
2875
2875
|
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
2876
2876
|
};
|
|
2877
2877
|
}();
|
|
2878
|
-
function
|
|
2878
|
+
function Z(i) {
|
|
2879
2879
|
return !!W.CSS_UNIT.exec(i);
|
|
2880
2880
|
}
|
|
2881
2881
|
function la(i) {
|
|
@@ -2920,26 +2920,26 @@ function la(i) {
|
|
|
2920
2920
|
v: t[3],
|
|
2921
2921
|
a: t[4]
|
|
2922
2922
|
} : (t = W.hex8.exec(i)) ? {
|
|
2923
|
-
r:
|
|
2924
|
-
g:
|
|
2925
|
-
b:
|
|
2923
|
+
r: V(t[1]),
|
|
2924
|
+
g: V(t[2]),
|
|
2925
|
+
b: V(t[3]),
|
|
2926
2926
|
a: Gt(t[4]),
|
|
2927
2927
|
format: e ? "name" : "hex8"
|
|
2928
2928
|
} : (t = W.hex6.exec(i)) ? {
|
|
2929
|
-
r:
|
|
2930
|
-
g:
|
|
2931
|
-
b:
|
|
2929
|
+
r: V(t[1]),
|
|
2930
|
+
g: V(t[2]),
|
|
2931
|
+
b: V(t[3]),
|
|
2932
2932
|
format: e ? "name" : "hex"
|
|
2933
2933
|
} : (t = W.hex4.exec(i)) ? {
|
|
2934
|
-
r:
|
|
2935
|
-
g:
|
|
2936
|
-
b:
|
|
2934
|
+
r: V(t[1] + "" + t[1]),
|
|
2935
|
+
g: V(t[2] + "" + t[2]),
|
|
2936
|
+
b: V(t[3] + "" + t[3]),
|
|
2937
2937
|
a: Gt(t[4] + "" + t[4]),
|
|
2938
2938
|
format: e ? "name" : "hex8"
|
|
2939
2939
|
} : (t = W.hex3.exec(i)) ? {
|
|
2940
|
-
r:
|
|
2941
|
-
g:
|
|
2942
|
-
b:
|
|
2940
|
+
r: V(t[1] + "" + t[1]),
|
|
2941
|
+
g: V(t[2] + "" + t[2]),
|
|
2942
|
+
b: V(t[3] + "" + t[3]),
|
|
2943
2943
|
format: e ? "name" : "hex"
|
|
2944
2944
|
} : !1;
|
|
2945
2945
|
}
|
|
@@ -2964,13 +2964,13 @@ function ha(i, e) {
|
|
|
2964
2964
|
} = e;
|
|
2965
2965
|
if (!r) return;
|
|
2966
2966
|
const { trade: o } = a, c = 4;
|
|
2967
|
-
t.forEach(({ isHovered: h, isActive: u, candle: g, trades:
|
|
2968
|
-
const
|
|
2969
|
-
|
|
2967
|
+
t.forEach(({ isHovered: h, isActive: u, candle: g, trades: p }) => {
|
|
2968
|
+
const _ = s.convert(g.open_time);
|
|
2969
|
+
p.forEach((v) => {
|
|
2970
2970
|
const b = v.type === "buy", w = b ? o.buyLabel.text : o.sellLabel.text, C = b ? "B" : "S", y = b ? n.convert(g.low) + c : n.convert(g.high) - c, x = b ? $n : Pn;
|
|
2971
2971
|
let T = b ? o.buyLabel.main : o.sellLabel.main;
|
|
2972
|
-
h && h[1] && h[0] === v.type && (T =
|
|
2973
|
-
x:
|
|
2972
|
+
h && h[1] && h[0] === v.type && (T = M.mix(T, a.bg, 20).toString()), u && u[1] && u[0] === v.type && (T = o.activeLabel), x(i, {
|
|
2973
|
+
x: _,
|
|
2974
2974
|
y,
|
|
2975
2975
|
symbol: C,
|
|
2976
2976
|
mainColor: T,
|
|
@@ -2990,14 +2990,14 @@ function da(i, e) {
|
|
|
2990
2990
|
colorScheme: { trade: h }
|
|
2991
2991
|
} = e;
|
|
2992
2992
|
if (a.length === 0) return;
|
|
2993
|
-
const u = a.map((
|
|
2993
|
+
const u = a.map((p) => p.candle).sort((p, _) => p.open_time.getTime() - _.open_time.getTime()), g = c.baseWidth / 2 * s + c.strokeWidth / 2;
|
|
2994
2994
|
if (i.save(), i.lineWidth = 1, i.strokeStyle = h.tradeBorders, o.length) {
|
|
2995
|
-
const
|
|
2996
|
-
i.beginPath(), i.moveTo(
|
|
2995
|
+
const p = t.convert(u[0].open_time) - g;
|
|
2996
|
+
i.beginPath(), i.moveTo(p, n.y), i.lineTo(p, n.y + n.height), i.stroke();
|
|
2997
2997
|
}
|
|
2998
2998
|
if (r.length) {
|
|
2999
|
-
const
|
|
3000
|
-
i.beginPath(), i.moveTo(
|
|
2999
|
+
const p = t.convert(u[u.length - 1].open_time) + g;
|
|
3000
|
+
i.beginPath(), i.moveTo(p, n.y), i.lineTo(p, n.y + n.height), i.stroke();
|
|
3001
3001
|
}
|
|
3002
3002
|
i.restore();
|
|
3003
3003
|
}
|
|
@@ -3012,16 +3012,16 @@ const ua = (i, e) => {
|
|
|
3012
3012
|
} = e;
|
|
3013
3013
|
if (i.save(), !c) return;
|
|
3014
3014
|
const h = (g) => {
|
|
3015
|
-
var
|
|
3016
|
-
return (
|
|
3017
|
-
(
|
|
3018
|
-
)) == null ? void 0 :
|
|
3019
|
-
}, u = (g,
|
|
3020
|
-
const
|
|
3021
|
-
if (!
|
|
3022
|
-
const b = t.convert(
|
|
3015
|
+
var p;
|
|
3016
|
+
return (p = n.find(
|
|
3017
|
+
(_) => g.getTime() >= _.candle.open_time.getTime() && g.getTime() < _.candle.close_time.getTime()
|
|
3018
|
+
)) == null ? void 0 : p.candle;
|
|
3019
|
+
}, u = (g, p) => {
|
|
3020
|
+
const _ = h(g.time), v = h(p.time);
|
|
3021
|
+
if (!_ || !v) return;
|
|
3022
|
+
const b = t.convert(_.open_time), w = t.convert(v.open_time);
|
|
3023
3023
|
let C, y;
|
|
3024
|
-
g.type === "buy" ? (C = s.convert(
|
|
3024
|
+
g.type === "buy" ? (C = s.convert(_.low), y = s.convert(v.high)) : (C = s.convert(_.high), y = s.convert(v.low)), i.beginPath(), i.setLineDash([4, 4]), i.strokeStyle = o.connectionLine, i.moveTo(b, C), i.lineTo(w, y), i.stroke(), i.setLineDash([]);
|
|
3025
3025
|
};
|
|
3026
3026
|
if (a.length === 1 && r.length > 1)
|
|
3027
3027
|
r.forEach((g) => u(a[0], g));
|
|
@@ -3030,8 +3030,8 @@ const ua = (i, e) => {
|
|
|
3030
3030
|
else if (a.length === 1 && r.length === 1)
|
|
3031
3031
|
u(a[0], r[0]);
|
|
3032
3032
|
else if (a.length > 0 && r.length > 0) {
|
|
3033
|
-
const g = a.reduce((
|
|
3034
|
-
u(g,
|
|
3033
|
+
const g = a.reduce((_, v) => _.time < v.time ? _ : v), p = r.reduce((_, v) => _.time > v.time ? _ : v);
|
|
3034
|
+
u(g, p);
|
|
3035
3035
|
}
|
|
3036
3036
|
i.restore();
|
|
3037
3037
|
}, si = (i, e) => {
|
|
@@ -3071,7 +3071,7 @@ function ga(i) {
|
|
|
3071
3071
|
return s.length ? s.join(" ") : "0s";
|
|
3072
3072
|
}
|
|
3073
3073
|
const ma = 10, _a = 6, pa = 4, va = 12, ba = (i, e) => {
|
|
3074
|
-
var
|
|
3074
|
+
var U;
|
|
3075
3075
|
const {
|
|
3076
3076
|
scales: { x: t, y: s },
|
|
3077
3077
|
trade: { entries: n, exits: a, holdTime: r },
|
|
@@ -3083,14 +3083,14 @@ const ma = 10, _a = 6, pa = 4, va = 12, ba = (i, e) => {
|
|
|
3083
3083
|
}
|
|
3084
3084
|
} = e;
|
|
3085
3085
|
if (!c) return;
|
|
3086
|
-
const
|
|
3087
|
-
if (!
|
|
3088
|
-
const v = (
|
|
3086
|
+
const p = n.at(0), _ = a.at(-1);
|
|
3087
|
+
if (!p || !_) return;
|
|
3088
|
+
const v = (O) => O ? O instanceof Date ? O : new Date(O) : null, b = t.convert(v(u == null ? void 0 : u[0]) || p.candle.open_time), w = t.convert(v(u == null ? void 0 : u[1]) || _.candle.open_time), C = s.convert(g || (((U = n.at(0)) == null ? void 0 : U.price) ?? 0));
|
|
3089
3089
|
i.beginPath(), i.setLineDash([4, 4]), i.strokeStyle = o.main, i.moveTo(b, C), i.lineTo(w, C), i.stroke(), i.setLineDash([]);
|
|
3090
|
-
const y = (b + w) / 2, x = h || `Hold: ${ga(r)}`,
|
|
3090
|
+
const y = (b + w) / 2, x = h || `Hold: ${ga(r)}`, k = getComputedStyle(
|
|
3091
3091
|
document.querySelector(".sc-charts-cs") || document.body
|
|
3092
3092
|
).font.replace(/^\s*\S+/, "").trim();
|
|
3093
|
-
i.font = `600 ${ma}px ${
|
|
3093
|
+
i.font = `600 ${ma}px ${k}`;
|
|
3094
3094
|
const $ = i.measureText(x).width + _a * 2, P = va + pa * 2;
|
|
3095
3095
|
si(i, {
|
|
3096
3096
|
radius: 4,
|
|
@@ -3113,7 +3113,7 @@ class pe {
|
|
|
3113
3113
|
f(this, "dom", null);
|
|
3114
3114
|
f(this, "prefix");
|
|
3115
3115
|
const { width: r, height: o, canvasesContainer: c, domElements: h } = t;
|
|
3116
|
-
n || (this.canvas = new s({ className: `sc-charts-cs__canvas-${e}`, width: r, height: o }), c.append(this.canvas.node)), a || (this.dom = new
|
|
3116
|
+
n || (this.canvas = new s({ className: `sc-charts-cs__canvas-${e}`, width: r, height: o }), c.append(this.canvas.node)), a || (this.dom = new D({ className: `sc-charts-cs__dom-${e}` }), h.append(this.dom.node)), this.prefix = `sc-charts-cs__${e}`;
|
|
3117
3117
|
}
|
|
3118
3118
|
cx(...e) {
|
|
3119
3119
|
return e.map((t) => `${this.prefix}-${t}`).join(" ");
|
|
@@ -3135,12 +3135,12 @@ const ya = {
|
|
|
3135
3135
|
offset: n = 8
|
|
3136
3136
|
}) => {
|
|
3137
3137
|
const { width: a, height: r } = i, o = e.right - e.left, c = e.bottom - e.top, h = (y) => {
|
|
3138
|
-
const { dx: x, dy: T } = ya[y],
|
|
3139
|
-
return { x:
|
|
3138
|
+
const { dx: x, dy: T } = ya[y], k = t.x + (x === 1 ? n : -a - n), R = t.y + (T === 1 ? n : -r - n);
|
|
3139
|
+
return { x: k, y: R, side: y };
|
|
3140
3140
|
}, u = ({ x: y, y: x }) => y >= 0 && x >= 0 && y + a <= o && x + r <= c, g = () => {
|
|
3141
|
-
const y = t.y < 0, x = t.y + r > c, T = t.x < 0,
|
|
3142
|
-
return T && y ? "right-bottom" : T && x ? "right-top" :
|
|
3143
|
-
},
|
|
3141
|
+
const y = t.y < 0, x = t.y + r > c, T = t.x < 0, k = t.x + a > o;
|
|
3142
|
+
return T && y ? "right-bottom" : T && x ? "right-top" : k && y ? "left-bottom" : k && x ? "left-top" : T ? "right-bottom" : k ? "left-bottom" : y ? "right-bottom" : x ? "right-top" : s;
|
|
3143
|
+
}, _ = [
|
|
3144
3144
|
s,
|
|
3145
3145
|
"right-bottom",
|
|
3146
3146
|
"right-top",
|
|
@@ -3148,7 +3148,7 @@ const ya = {
|
|
|
3148
3148
|
"left-top"
|
|
3149
3149
|
].filter((y, x, T) => T.indexOf(y) === x), v = g();
|
|
3150
3150
|
let b = null;
|
|
3151
|
-
for (const y of [v, ...
|
|
3151
|
+
for (const y of [v, ..._]) {
|
|
3152
3152
|
const x = h(y);
|
|
3153
3153
|
if (u(x)) {
|
|
3154
3154
|
b = x;
|
|
@@ -3163,7 +3163,7 @@ const ya = {
|
|
|
3163
3163
|
side: b.side
|
|
3164
3164
|
};
|
|
3165
3165
|
};
|
|
3166
|
-
class
|
|
3166
|
+
class q extends D {
|
|
3167
3167
|
constructor(t) {
|
|
3168
3168
|
super(t);
|
|
3169
3169
|
f(this, "_state", {});
|
|
@@ -3198,7 +3198,7 @@ class Z extends k {
|
|
|
3198
3198
|
this._scheduleUpdate();
|
|
3199
3199
|
}
|
|
3200
3200
|
}
|
|
3201
|
-
class wa extends
|
|
3201
|
+
class wa extends q {
|
|
3202
3202
|
constructor(t) {
|
|
3203
3203
|
const s = "label-tooltip";
|
|
3204
3204
|
super({ className: t.cx(s) });
|
|
@@ -3206,28 +3206,28 @@ class wa extends Z {
|
|
|
3206
3206
|
f(this, "manyBox");
|
|
3207
3207
|
f(this, "oneBox");
|
|
3208
3208
|
f(this, "clsx");
|
|
3209
|
-
this.clsx = t.cxFabric(s), this.title = new
|
|
3209
|
+
this.clsx = t.cxFabric(s), this.title = new D({
|
|
3210
3210
|
tag: "div",
|
|
3211
3211
|
className: this.clsx("title")
|
|
3212
|
-
}), this.manyBox = new
|
|
3212
|
+
}), this.manyBox = new D({
|
|
3213
3213
|
tag: "div",
|
|
3214
3214
|
className: this.clsx("box_many")
|
|
3215
|
-
}), this.oneBox = new
|
|
3215
|
+
}), this.oneBox = new D({
|
|
3216
3216
|
tag: "div",
|
|
3217
3217
|
className: this.clsx("box_one")
|
|
3218
|
-
}), t.dom.append(this.title.node, this.oneBox.node, this.manyBox.node), this.state = { isShow: !1, x: 0, y: 0, parent:
|
|
3218
|
+
}), t.dom.append(this.title.node, this.oneBox.node, this.manyBox.node), this.state = { isShow: !1, x: 0, y: 0, parent: j.empty() };
|
|
3219
3219
|
}
|
|
3220
3220
|
_createLineNodes(t, s) {
|
|
3221
3221
|
const n = [];
|
|
3222
3222
|
for (const a of Object.keys(s))
|
|
3223
3223
|
if (a in t) {
|
|
3224
|
-
const r = new
|
|
3224
|
+
const r = new D({
|
|
3225
3225
|
tag: "div",
|
|
3226
3226
|
className: this.clsx("line")
|
|
3227
3227
|
});
|
|
3228
3228
|
let o = t[a].toString();
|
|
3229
3229
|
a === "kind" && (o = this._formatDate(t.time));
|
|
3230
|
-
const c = new
|
|
3230
|
+
const c = new D({ tag: "strong", textContent: s[a] }), h = new D({ tag: "span", textContent: o });
|
|
3231
3231
|
r.append(c.node, h.node), n.push(r.node);
|
|
3232
3232
|
}
|
|
3233
3233
|
return n;
|
|
@@ -3257,7 +3257,7 @@ class wa extends Z {
|
|
|
3257
3257
|
} else if (t.length > 1) {
|
|
3258
3258
|
this.manyBox.node.style.display = "flex";
|
|
3259
3259
|
const s = t.map((n) => {
|
|
3260
|
-
const a = new
|
|
3260
|
+
const a = new D({ tag: "div" }), r = this._createLineNodes(n, {
|
|
3261
3261
|
kind: n.kind === "entry" ? "Entry:" : "Exit:",
|
|
3262
3262
|
price: "Price:"
|
|
3263
3263
|
});
|
|
@@ -3293,7 +3293,7 @@ class xa extends pe {
|
|
|
3293
3293
|
function Ca(i, { color: e = "#000000", lineWidth: t = 1, dashed: s, coords: n }) {
|
|
3294
3294
|
i.strokeStyle = e, i.lineWidth = t, s && i.setLineDash(s), i.beginPath(), i.moveTo(n.x1, n.y1), i.lineTo(n.x2, n.y2), i.stroke();
|
|
3295
3295
|
}
|
|
3296
|
-
const
|
|
3296
|
+
const Aa = { text: "#FFFFFF", bg: "#000000" }, Ma = (i, e) => {
|
|
3297
3297
|
const {
|
|
3298
3298
|
coords: t,
|
|
3299
3299
|
text: s,
|
|
@@ -3304,10 +3304,10 @@ const Ma = { text: "#FFFFFF", bg: "#000000" }, Aa = (i, e) => {
|
|
|
3304
3304
|
borderRadius: c = 0,
|
|
3305
3305
|
colors: h,
|
|
3306
3306
|
align: u = { x: "left", y: "top" }
|
|
3307
|
-
} = e, g = { ...
|
|
3307
|
+
} = e, g = { ...Aa, ...h }, _ = getComputedStyle(
|
|
3308
3308
|
document.querySelector(".sc-charts-cs") || document.body
|
|
3309
3309
|
).font.replace(/^\s*\S+/, "").trim();
|
|
3310
|
-
i.font = `${a} ${n}px ${
|
|
3310
|
+
i.font = `${a} ${n}px ${_}`;
|
|
3311
3311
|
const b = i.measureText(s).width + o.x * 2, w = r + o.y * 2;
|
|
3312
3312
|
let C = t.x, y = t.y;
|
|
3313
3313
|
u.x === "middle" ? C -= b / 2 : u.x === "right" && (C -= b), u.y === "middle" ? y -= w / 2 : u.y === "bottom" && (y -= w), si(i, {
|
|
@@ -3335,7 +3335,7 @@ const Ma = { text: "#FFFFFF", bg: "#000000" }, Aa = (i, e) => {
|
|
|
3335
3335
|
x2: r.x,
|
|
3336
3336
|
y2: r.y
|
|
3337
3337
|
}
|
|
3338
|
-
}),
|
|
3338
|
+
}), Ma(i, {
|
|
3339
3339
|
text: e,
|
|
3340
3340
|
coords: r,
|
|
3341
3341
|
padding: { x: 6, y: 4 },
|
|
@@ -3401,10 +3401,10 @@ class Q {
|
|
|
3401
3401
|
}
|
|
3402
3402
|
}
|
|
3403
3403
|
const Je = new Q("comment-actions");
|
|
3404
|
-
class Da extends
|
|
3404
|
+
class Da extends D {
|
|
3405
3405
|
constructor({ onDelete: e, onUpdate: t }) {
|
|
3406
3406
|
super({ className: Je.gen() });
|
|
3407
|
-
const s = new
|
|
3407
|
+
const s = new D({ tag: "button", className: Je.gen("edit"), textContent: "Edit" }), n = new D({
|
|
3408
3408
|
tag: "button",
|
|
3409
3409
|
className: Je.gen("delete"),
|
|
3410
3410
|
textContent: "Delete"
|
|
@@ -3433,7 +3433,7 @@ function rt(i, e) {
|
|
|
3433
3433
|
document.removeEventListener("mousedown", t), s == null || s();
|
|
3434
3434
|
}, i;
|
|
3435
3435
|
}
|
|
3436
|
-
class
|
|
3436
|
+
class Ea {
|
|
3437
3437
|
constructor() {
|
|
3438
3438
|
f(this, "node");
|
|
3439
3439
|
const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
|
|
@@ -3472,16 +3472,16 @@ class La {
|
|
|
3472
3472
|
}
|
|
3473
3473
|
}
|
|
3474
3474
|
const de = new Q("comment-list");
|
|
3475
|
-
class
|
|
3475
|
+
class La extends D {
|
|
3476
3476
|
constructor({ onDelete: t, onOpenEditor: s, comment: n, layout: a }) {
|
|
3477
3477
|
super({ className: de.gen("item") });
|
|
3478
3478
|
f(this, "actionTooltip");
|
|
3479
3479
|
f(this, "actionsTrigger");
|
|
3480
|
-
const r = new
|
|
3480
|
+
const r = new D({ className: de.gen("text"), textContent: n.text }), o = new D({
|
|
3481
3481
|
className: de.gen("created-at"),
|
|
3482
3482
|
textContent: fa(new Date(n.createdAt))
|
|
3483
3483
|
});
|
|
3484
|
-
this.actionsTrigger = new
|
|
3484
|
+
this.actionsTrigger = new D({
|
|
3485
3485
|
tag: "button",
|
|
3486
3486
|
className: de.gen("action-trigger")
|
|
3487
3487
|
});
|
|
@@ -3494,8 +3494,8 @@ class Ea extends k {
|
|
|
3494
3494
|
}), this.actionsTrigger.node.addEventListener("click", () => {
|
|
3495
3495
|
this.actionsTrigger.updateAbsolutePosition(), this.actionTooltip.updateAbsolutePosition(), this.actionTooltip.node.style.top = this.actionsTrigger.absolutePosition.top - a.chart.top + 20 + "px", this.actionTooltip.node.style.left = this.actionsTrigger.absolutePosition.left - a.chart.left - this.actionTooltip.absolutePosition.width + 10 + "px", this.actionTooltip.setVisible(!0);
|
|
3496
3496
|
});
|
|
3497
|
-
const h = new
|
|
3498
|
-
this.actionTooltip.node.setAttribute("id", `ac-${n.id}`), h.append(r.node, this.actionsTrigger.node), this.actionsTrigger.append(new
|
|
3497
|
+
const h = new D({ className: de.gen("text-wrap") });
|
|
3498
|
+
this.actionTooltip.node.setAttribute("id", `ac-${n.id}`), h.append(r.node, this.actionsTrigger.node), this.actionsTrigger.append(new Ea().node), this.append(h.node, o.node);
|
|
3499
3499
|
}
|
|
3500
3500
|
}
|
|
3501
3501
|
class Na {
|
|
@@ -3522,7 +3522,7 @@ class Fa {
|
|
|
3522
3522
|
), s.setAttribute("fill", "currentColor"), t.appendChild(s), this.node = t;
|
|
3523
3523
|
}
|
|
3524
3524
|
}
|
|
3525
|
-
class Ha extends
|
|
3525
|
+
class Ha extends q {
|
|
3526
3526
|
constructor(t) {
|
|
3527
3527
|
super({ className: "sc-charts-cs__comments-edit" });
|
|
3528
3528
|
f(this, "input");
|
|
@@ -3530,14 +3530,14 @@ class Ha extends Z {
|
|
|
3530
3530
|
f(this, "cancelBtn");
|
|
3531
3531
|
f(this, "_onSave");
|
|
3532
3532
|
f(this, "_onCancel");
|
|
3533
|
-
this._onSave = t.onSave, this._onCancel = t.onCancel, this.input = new
|
|
3533
|
+
this._onSave = t.onSave, this._onCancel = t.onCancel, this.input = new D({ tag: "textarea", className: "sc-charts-cs__comments-edit-input" }), this.saveBtn = new D({
|
|
3534
3534
|
tag: "button",
|
|
3535
3535
|
className: "sc-charts-cs__comments-edit-save-btn"
|
|
3536
|
-
}), this.saveBtn.append(new Na().node), this.cancelBtn = new
|
|
3536
|
+
}), this.saveBtn.append(new Na().node), this.cancelBtn = new D({
|
|
3537
3537
|
tag: "button",
|
|
3538
3538
|
className: "sc-charts-cs__comments-edit-cancel-btn"
|
|
3539
3539
|
}), this.cancelBtn.append(new Fa().node);
|
|
3540
|
-
const s = new
|
|
3540
|
+
const s = new D({ className: "sc-charts-cs__comments-edit-btn-container" });
|
|
3541
3541
|
s.append(this.cancelBtn.node, this.saveBtn.node), this.append(this.input.node, s.node), this.state = { inputValue: t.initialValue || "", hasInitFocused: !1 }, this._setupListeners(), this.render();
|
|
3542
3542
|
}
|
|
3543
3543
|
_setupListeners() {
|
|
@@ -3553,7 +3553,7 @@ class Ha extends Z {
|
|
|
3553
3553
|
}
|
|
3554
3554
|
}
|
|
3555
3555
|
const Ba = new Q("comment-list");
|
|
3556
|
-
class Ia extends
|
|
3556
|
+
class Ia extends q {
|
|
3557
3557
|
constructor(t, s, n, a = {}) {
|
|
3558
3558
|
super({ tag: "ul", className: Ba.gen(), ...a });
|
|
3559
3559
|
f(this, "_elements", {});
|
|
@@ -3580,7 +3580,7 @@ class Ia extends Z {
|
|
|
3580
3580
|
},
|
|
3581
3581
|
initialValue: t.text
|
|
3582
3582
|
});
|
|
3583
|
-
const s = new
|
|
3583
|
+
const s = new La({
|
|
3584
3584
|
onDelete: () => {
|
|
3585
3585
|
this._model.comments.remove(t.id), s.actionTooltip.setVisible(!1);
|
|
3586
3586
|
},
|
|
@@ -3609,17 +3609,17 @@ class Ra {
|
|
|
3609
3609
|
}
|
|
3610
3610
|
}
|
|
3611
3611
|
const ke = new Q(""), Qe = new Q("add-field");
|
|
3612
|
-
class ai extends
|
|
3612
|
+
class ai extends q {
|
|
3613
3613
|
constructor({ onAdd: t, blockName: s }) {
|
|
3614
3614
|
ke.block = s;
|
|
3615
3615
|
super({ className: ke.gen() + " " + Qe.gen() });
|
|
3616
3616
|
f(this, "btn");
|
|
3617
3617
|
f(this, "input");
|
|
3618
3618
|
f(this, "_onAdd");
|
|
3619
|
-
this._onAdd = t, this.state = { inputValue: "" }, this.input = new
|
|
3619
|
+
this._onAdd = t, this.state = { inputValue: "" }, this.input = new D({
|
|
3620
3620
|
tag: "input",
|
|
3621
3621
|
className: ke.gen("input") + " " + Qe.gen("input")
|
|
3622
|
-
}), this.input.node.setAttribute("placeholder", "Add comment..."), this.btn = new
|
|
3622
|
+
}), this.input.node.setAttribute("placeholder", "Add comment..."), this.btn = new D({
|
|
3623
3623
|
tag: "button",
|
|
3624
3624
|
className: ke.gen("btn") + " " + Qe.gen("btn")
|
|
3625
3625
|
}), this.btn.append(new Ra().node), this.append(this.input.node, this.btn.node), this._setupListeners(), this.render();
|
|
@@ -3642,7 +3642,7 @@ class ai extends Z {
|
|
|
3642
3642
|
}
|
|
3643
3643
|
}
|
|
3644
3644
|
const $a = new Q("list-tooltip"), Ke = 8;
|
|
3645
|
-
class Pa extends
|
|
3645
|
+
class Pa extends q {
|
|
3646
3646
|
constructor(t, s, n) {
|
|
3647
3647
|
super({ className: $a.gen() });
|
|
3648
3648
|
f(this, "_list");
|
|
@@ -3686,7 +3686,7 @@ class Oa {
|
|
|
3686
3686
|
), s.setAttribute("fill", "currentColor"), t.appendChild(s), this.node = t;
|
|
3687
3687
|
}
|
|
3688
3688
|
}
|
|
3689
|
-
class za extends
|
|
3689
|
+
class za extends q {
|
|
3690
3690
|
constructor({ x: t, ...s }, n) {
|
|
3691
3691
|
super(s);
|
|
3692
3692
|
f(this, "_colors");
|
|
@@ -3704,10 +3704,10 @@ class za extends Z {
|
|
|
3704
3704
|
}
|
|
3705
3705
|
}
|
|
3706
3706
|
const qt = new Q("comment-box");
|
|
3707
|
-
class Va extends
|
|
3707
|
+
class Va extends q {
|
|
3708
3708
|
constructor({ boxId: t, model: s, view: n, comments: a, coords: r, onBoxActivate: o, onBoxDeactivate: c }) {
|
|
3709
3709
|
super({ className: qt.gen() });
|
|
3710
|
-
f(this, "pointer", new
|
|
3710
|
+
f(this, "pointer", new D({ className: "sc-charts-cs__comments-pointer" }));
|
|
3711
3711
|
f(this, "tooltip");
|
|
3712
3712
|
f(this, "anchor");
|
|
3713
3713
|
f(this, "_onBoxActivate");
|
|
@@ -3731,8 +3731,8 @@ class Va extends Z {
|
|
|
3731
3731
|
}
|
|
3732
3732
|
class ja {
|
|
3733
3733
|
static animateTo(e, t, s, n) {
|
|
3734
|
-
const a = e.scales.panOffsetX + (e.layout.area.width / 2 - t), r = e.scales.panOffsetY + (e.layout.area.height / 2 - s), o = 300, c = performance.now(), h = e.scales.panOffsetX, u = e.scales.panOffsetY, g = (
|
|
3735
|
-
const
|
|
3734
|
+
const a = e.scales.panOffsetX + (e.layout.area.width / 2 - t), r = e.scales.panOffsetY + (e.layout.area.height / 2 - s), o = 300, c = performance.now(), h = e.scales.panOffsetX, u = e.scales.panOffsetY, g = (p) => {
|
|
3735
|
+
const _ = p - c, v = Math.min(_ / o, 1), b = v * v * (3 - 2 * v), w = h + (a - h) * b, C = u + (r - u) * b;
|
|
3736
3736
|
e.scales.pan("x", w, "absolute"), e.scales.pan("y", C, "absolute"), v < 1 ? requestAnimationFrame(g) : n == null || n();
|
|
3737
3737
|
};
|
|
3738
3738
|
requestAnimationFrame(g);
|
|
@@ -3743,7 +3743,7 @@ class ja {
|
|
|
3743
3743
|
}
|
|
3744
3744
|
}
|
|
3745
3745
|
const et = new Q("comments-context");
|
|
3746
|
-
class Ya extends
|
|
3746
|
+
class Ya extends q {
|
|
3747
3747
|
constructor() {
|
|
3748
3748
|
super({ className: et.gen() });
|
|
3749
3749
|
f(this, "pointer");
|
|
@@ -3752,7 +3752,7 @@ class Ya extends Z {
|
|
|
3752
3752
|
f(this, "_size", null);
|
|
3753
3753
|
f(this, "_model", null);
|
|
3754
3754
|
f(this, "_candle", null);
|
|
3755
|
-
this.state = { candle: null, isShow: !1, model: null }, this.pointer = new
|
|
3755
|
+
this.state = { candle: null, isShow: !1, model: null }, this.pointer = new D({ className: et.gen("pointer") }), this.menu = new D({ className: et.gen("menu") }), rt(this.menu, () => {
|
|
3756
3756
|
this.setState({ isShow: !1 });
|
|
3757
3757
|
}), this.addField = new ai({
|
|
3758
3758
|
blockName: "context-add",
|
|
@@ -3863,7 +3863,7 @@ class Ua extends pe {
|
|
|
3863
3863
|
if (e.config.guides.isShowX) {
|
|
3864
3864
|
const n = e.config.xAxis.position;
|
|
3865
3865
|
this.canvas.drawMarker({
|
|
3866
|
-
text:
|
|
3866
|
+
text: E.timeFormat("%a %d, %b %y %H:%M")(e.scales.x.invert(t)),
|
|
3867
3867
|
startLineCoords: { x: t, y: 0 },
|
|
3868
3868
|
endMarkerCoords: { x: t, y: e.layout.xAxis[n] },
|
|
3869
3869
|
side: n,
|
|
@@ -3873,12 +3873,12 @@ class Ua extends pe {
|
|
|
3873
3873
|
}
|
|
3874
3874
|
}
|
|
3875
3875
|
}
|
|
3876
|
-
class Ga extends
|
|
3876
|
+
class Ga extends q {
|
|
3877
3877
|
constructor(t) {
|
|
3878
3878
|
super({ className: t });
|
|
3879
3879
|
f(this, "_isFirstShow", !1);
|
|
3880
|
-
const s = new
|
|
3881
|
-
s.node.textContent = "No data from broker", this.append(s.node), this.state = { isShow: !1, x: 0, y: 0, parent:
|
|
3880
|
+
const s = new D({ tag: "p" });
|
|
3881
|
+
s.node.textContent = "No data from broker", this.append(s.node), this.state = { isShow: !1, x: 0, y: 0, parent: j.empty() }, this.render();
|
|
3882
3882
|
}
|
|
3883
3883
|
render() {
|
|
3884
3884
|
const { isShow: t, x: s, y: n, parent: a } = this.state;
|
|
@@ -3916,22 +3916,22 @@ class Za extends _e {
|
|
|
3916
3916
|
}
|
|
3917
3917
|
} = t, h = t.config.candles.style === "filled";
|
|
3918
3918
|
this.domain = t.scales.x.domain(), c || this._getVisible(r).forEach((u, g) => {
|
|
3919
|
-
const
|
|
3919
|
+
const p = s.noDataFill[g % s.noDataFill.length], _ = h ? p : s.noDataStroke;
|
|
3920
3920
|
this.drawSingleCandle({
|
|
3921
3921
|
...this._getBasicCandleProps(t, u),
|
|
3922
|
-
colors: { fill:
|
|
3922
|
+
colors: { fill: p, stroke: _, bg: n }
|
|
3923
3923
|
});
|
|
3924
3924
|
}), this._getVisible(o).forEach((u) => {
|
|
3925
|
-
const g = u.close >= u.open ? "rising" : "falling",
|
|
3925
|
+
const g = u.close >= u.open ? "rising" : "falling", p = s[`${g}Fill`], _ = s[`${g}${h ? "Fill" : "Stroke"}`];
|
|
3926
3926
|
this.drawSingleCandle({
|
|
3927
3927
|
...this._getBasicCandleProps(t, u),
|
|
3928
|
-
colors: { fill:
|
|
3928
|
+
colors: { fill: p, stroke: _, bg: n },
|
|
3929
3929
|
isDim: !!(a.length && !a.includes(u.open_time.getTime()))
|
|
3930
3930
|
});
|
|
3931
3931
|
});
|
|
3932
3932
|
}
|
|
3933
3933
|
_mix(t, s, n) {
|
|
3934
|
-
return n ?
|
|
3934
|
+
return n ? M.mix(t, s).toString() : t;
|
|
3935
3935
|
}
|
|
3936
3936
|
_getBasicCandleProps(t, s) {
|
|
3937
3937
|
return {
|
|
@@ -3954,7 +3954,7 @@ class qa extends pe {
|
|
|
3954
3954
|
f(this, "limiter");
|
|
3955
3955
|
if (!this.dom) throw new Error("[CS_V_Candles] this.dom must be defined");
|
|
3956
3956
|
if (!this.canvas) throw new Error("[CS_V_Candles] this.canvas must be defined");
|
|
3957
|
-
this._noDataTooltip = new Ga(this.cx("no-data")), this.limiter = new
|
|
3957
|
+
this._noDataTooltip = new Ga(this.cx("no-data")), this.limiter = new D({ className: this.cx("limiter") }), this.limiter.setVisible(!1), this.dom.append(this._noDataTooltip.node, this.limiter.node);
|
|
3958
3958
|
}
|
|
3959
3959
|
get noDataTooltip() {
|
|
3960
3960
|
return this._noDataTooltip;
|
|
@@ -3987,14 +3987,14 @@ class Ja {
|
|
|
3987
3987
|
f(this, "trade");
|
|
3988
3988
|
f(this, "comments");
|
|
3989
3989
|
f(this, "candles");
|
|
3990
|
-
this.container = e, this.wrapper = new
|
|
3990
|
+
this.container = e, this.wrapper = new D({ tag: "div", className: "sc-charts-cs" }), e.append(this.wrapper.node);
|
|
3991
3991
|
const { width: t, height: s } = e.getBoundingClientRect();
|
|
3992
3992
|
this.width = t, this.height = s, this.mainCanvas = new _e({
|
|
3993
3993
|
className: "sc-charts-cs__canvas-main",
|
|
3994
3994
|
width: t,
|
|
3995
3995
|
height: s,
|
|
3996
3996
|
isMain: !0
|
|
3997
|
-
}), this.domElements = new
|
|
3997
|
+
}), this.domElements = new D({ tag: "div", className: "sc-charts-cs__dom-elements" }), this.canvasesContainer = new D({ tag: "div", className: "sc-charts-cs__canvases" }), this.canvasesContainer.append(this.mainCanvas.node), this.wrapper.append(this.canvasesContainer.node, this.domElements.node), this.mainCanvas.updateAbsolutePosition(), this.binding = new Rn(this.mainCanvas.node), this.comments = new Wa(this), this.candles = new qa(this), this.trade = new xa(this), this.guideMarkers = new Ua(this), this.userMarkers = new Sa(this);
|
|
3998
3998
|
}
|
|
3999
3999
|
renderAll(e) {
|
|
4000
4000
|
this.mainCanvas.clear(), this.candles.render(e), qe.xAxis(this.mainCanvas.ctx, e), qe.yAxis(this.mainCanvas.ctx, e), qe.intersection(this.mainCanvas.ctx, e), this.trade.renderAll(e), this.userMarkers.render(e), this.comments.render(e);
|
|
@@ -4275,8 +4275,8 @@ class tr {
|
|
|
4275
4275
|
}
|
|
4276
4276
|
} = this.model;
|
|
4277
4277
|
for (const o of s) {
|
|
4278
|
-
const c = n.convert(o.open_time), h = a.convert(o.high), u = a.convert(o.low), g = c - r / 2,
|
|
4279
|
-
if (e >= g && e <=
|
|
4278
|
+
const c = n.convert(o.open_time), h = a.convert(o.high), u = a.convert(o.low), g = c - r / 2, p = c + r / 2, _ = Math.min(h, u), v = Math.max(h, u);
|
|
4279
|
+
if (e >= g && e <= p && t >= _ && t <= v)
|
|
4280
4280
|
return {
|
|
4281
4281
|
target: this,
|
|
4282
4282
|
x: e,
|
|
@@ -4313,11 +4313,11 @@ class sr {
|
|
|
4313
4313
|
hitTest(e, t) {
|
|
4314
4314
|
const { tradedCandles: s } = this.model.trade, { x: n, y: a } = this.model.scales, r = 16, o = 4;
|
|
4315
4315
|
for (const { candle: c, trades: h } of s) {
|
|
4316
|
-
const g = n.convert(c.open_time) + this.model.config.candles.baseWidth / 2,
|
|
4316
|
+
const g = n.convert(c.open_time) + this.model.config.candles.baseWidth / 2, p = r, _ = r;
|
|
4317
4317
|
for (const v of ["buy", "sell"]) {
|
|
4318
4318
|
const b = h.filter((x) => x.type === v);
|
|
4319
4319
|
if (!b.length) continue;
|
|
4320
|
-
const w = v === "buy" ? a.convert(c.low) + o +
|
|
4320
|
+
const w = v === "buy" ? a.convert(c.low) + o + Ee(r) : a.convert(c.high) - o - r - Ee(r), C = e >= g - p / 2 && e <= g + p / 2, y = t >= w && t <= w + _;
|
|
4321
4321
|
if (C && y)
|
|
4322
4322
|
return {
|
|
4323
4323
|
target: this,
|
|
@@ -4346,7 +4346,7 @@ class nr {
|
|
|
4346
4346
|
if (!t) return;
|
|
4347
4347
|
const s = this._model.scales.x.convert(t.candle.open_time), n = this._model.scales.y.convert(
|
|
4348
4348
|
t.trades[0].type === "buy" ? t.candle.low : t.candle.high
|
|
4349
|
-
), a = t.trades[0].type === "buy" ? n + 4 +
|
|
4349
|
+
), a = t.trades[0].type === "buy" ? n + 4 + Ee(16) + 8 : n - 4 - 16 - Ee(16) + 8;
|
|
4350
4350
|
this._model.eventBus.emit("open_trade_label_tooltip", {
|
|
4351
4351
|
trade: { candle: t.candle, trades: t.trades, tradeType: t.tradeType },
|
|
4352
4352
|
x: s,
|
|
@@ -4628,32 +4628,32 @@ class pr {
|
|
|
4628
4628
|
updateComments(e) {
|
|
4629
4629
|
this._model.updateComments(e);
|
|
4630
4630
|
}
|
|
4631
|
-
async _drawHeader(e, t, s) {
|
|
4632
|
-
const
|
|
4633
|
-
e.fillStyle = "#FFFFFF", e.fillRect(0, 0, t,
|
|
4634
|
-
const
|
|
4635
|
-
<path d="M92.6267 1.50666H93.0475C93.3792 1.50666 93.6025 1.31028 93.6025 1.02537C93.6025 0.740457 93.4034 0.561783 93.0426 0.561783C92.706 0.561783 92.4827 0.759773 92.4633 1.06239H91.795C91.8209 0.423351 92.3225 0.00805664 93.075 0.00805664C93.8274 0.00805664 94.2886 0.376671 94.2886 0.928788C94.2886 1.35213 93.9973 1.65797 93.5717 1.73523V1.74972C94.0895 1.79318 94.4229 2.10385 94.4229 2.58192C94.4229 3.20164 93.8581 3.61372 93.0572 3.61372C92.2562 3.61372 91.761 3.18555 91.7271 2.54973H92.4212C92.4423 2.84108 92.6834 3.03263 93.0652 3.03263C93.4471 3.03263 93.6834 2.82981 93.6834 2.53685C93.6834 2.22135 93.4455 2.0298 93.0539 2.0298H92.6251V1.50827L92.6267 1.50666Z" fill="
|
|
4636
|
-
<path d="M95.1182 2.97623C94.9256 2.68488 94.8269 2.29373 94.8269 1.83498C94.8269 0.692113 95.3852 0.00317383 96.2816 0.00317383C96.9434 0.00317383 97.4596 0.392714 97.5567 0.957708H96.8431C96.7735 0.727525 96.5502 0.574607 96.2784 0.574607C95.7945 0.574607 95.5017 1.03658 95.5178 1.81566H95.5324C95.6716 1.47763 96.013 1.25389 96.4564 1.25389C97.1149 1.25389 97.6036 1.73679 97.6036 2.39192C97.6036 3.10179 97.0486 3.61205 96.2719 3.61205C95.7735 3.61205 95.3625 3.3867 95.1198 2.97623H95.1182ZM96.8949 2.41446C96.8949 2.05872 96.6279 1.79796 96.2654 1.79796C95.903 1.79796 95.6311 2.05872 95.6311 2.40802C95.6311 2.75732 95.9078 3.0374 96.2638 3.0374C96.6198 3.0374 96.8965 2.76215 96.8965 2.41607L96.8949 2.41446Z" fill="
|
|
4637
|
-
<path d="M97.998 1.79961C97.998 0.68411 98.5336 0 99.4026 0C100.272 0 100.804 0.6825 100.804 1.79639C100.804 2.91028 100.275 3.60727 99.4026 3.60727C98.5304 3.60727 97.998 2.91672 97.998 1.798V1.79961ZM100.066 1.79961C100.066 1.01892 99.8136 0.579481 99.4026 0.579481C98.9916 0.579481 98.7359 1.02214 98.7359 1.79961C98.7359 2.57708 98.9883 3.0294 99.4026 3.0294C99.8168 3.0294 100.066 2.58674 100.066 1.79961Z" fill="
|
|
4638
|
-
<path d="M101.137 0.809958C101.137 0.381786 101.469 0.048584 101.901 0.048584C102.333 0.048584 102.666 0.381786 102.666 0.809958C102.666 1.23813 102.331 1.57294 101.901 1.57294C101.47 1.57294 101.137 1.23974 101.137 0.809958ZM102.249 0.809958C102.249 0.616798 102.097 0.46066 101.902 0.46066C101.708 0.46066 101.556 0.616798 101.556 0.809958C101.556 1.00312 101.715 1.16087 101.902 1.16087C102.1 1.16087 102.249 0.998289 102.249 0.809958Z" fill="
|
|
4639
|
-
<path d="M42.5486 0.0388184C37.204 0.0388184 33.5098 3.06983 33.5098 7.50447C33.5098 11.9391 37.204 15.02 42.5486 15.02C47.8933 15.02 51.5018 11.9375 51.5018 7.49803C51.5018 3.05856 47.8642 0.0388184 42.5486 0.0388184ZM42.5486 12.2836C39.0227 12.2836 36.5519 10.3327 36.5519 7.4771C36.5519 4.62155 39.0179 2.78331 42.5486 2.78331C46.0794 2.78331 48.4613 4.67789 48.4613 7.4771C48.4613 10.2763 45.9872 12.2787 42.5486 12.2787V12.2852V12.2836Z" fill="
|
|
4640
|
-
<path d="M10.4321 6.17332H5.62948C2.78642 6.17332 2.01943 2.78013 7.93208 2.78013C10.4337 2.78013 12.3949 3.85539 13.2476 4.41878L14.7833 2.10085C13.3318 0.827603 10.7751 0.0356445 7.90457 0.0356445C-1.589 0.0356445 -1.70389 8.85825 5.65861 8.85825H10.4903C13.6166 8.85825 14.1279 12.2804 7.93208 12.2804C4.83336 12.2804 2.38836 10.6402 1.53561 10.0172L0 12.3367C1.45146 13.6084 4.51944 15.0217 7.95797 15.0217C17.9062 15.0152 18.0211 6.17171 10.4321 6.17171V6.17332Z" fill="
|
|
4641
|
-
<path d="M26.0314 12.2771C22.3939 12.2771 20.0346 10.3262 20.0346 7.527C20.0346 4.72779 22.3648 2.7817 26.0023 2.7817C28.0784 2.7817 30.0104 3.85696 31.1755 4.93061L32.9166 2.52737C31.2677 1.22836 28.737 0.0388184 26.0088 0.0388184C20.5508 0.0388184 16.999 3.09397 16.999 7.53344C16.999 11.9729 20.6042 15.02 26.0654 15.02C28.8502 15.02 31.381 13.7757 33.0282 12.4751L31.2386 10.1266C30.0687 11.2067 28.135 12.2771 26.0314 12.2771Z" fill="
|
|
4642
|
-
<path d="M80.9771 0.0372542C75.8605 0.0372542 72.3071 3.09241 72.3071 7.53188C72.3071 11.9714 76.3719 15.0185 81.9156 15.0185C84.8428 15.0185 87.2829 14.0575 88.8218 12.7569L87.0289 10.4148C85.9771 11.5464 84.2732 12.3657 81.8849 12.3657C78.558 12.3657 76.1874 10.9814 75.5013 8.85986H89.592V7.5013C89.5872 3.06182 86.092 0.0356445 80.9755 0.0356445L80.9771 0.0372542ZM80.948 2.69482C83.8768 2.69482 85.88 4.06787 86.4075 6.25702H75.4447C75.9884 4.08718 77.9722 2.69482 80.948 2.69482Z" fill="
|
|
4643
|
-
<path d="M62.7358 0.0372542C60.1921 0.0372542 58.1743 0.925792 56.7875 2.29562C56.4283 1.16563 55.4364 0.462207 54.0917 0.462207H52.2471V3.14875H53.951V20.0004H56.9364V12.8792C58.3151 14.1782 60.273 15.0233 62.739 15.0233C67.485 15.0233 70.7536 11.9408 70.7536 7.5013C70.7536 3.06182 67.4802 0.0356445 62.7342 0.0356445L62.7358 0.0372542ZM62.3652 12.2756C59.1241 12.2756 56.9364 10.3247 56.9364 7.4691C56.9364 4.61355 59.1241 2.7753 62.3652 2.7753C65.6064 2.7753 67.7099 4.66989 67.7099 7.4691C67.7067 10.3311 65.464 12.2756 62.3652 12.2756Z" fill="
|
|
4631
|
+
async _drawHeader(e, t, s, n = !1) {
|
|
4632
|
+
const a = 48 * s, r = 12 * s, o = 20 * s, c = 103 * s;
|
|
4633
|
+
e.fillStyle = n ? "#101011" : "#FFFFFF", e.fillRect(0, 0, t, a), e.strokeStyle = n ? "#3E3E3E" : "#EDEDED", e.lineWidth = 1 * s, e.beginPath(), e.moveTo(0, a), e.lineTo(t, a), e.stroke();
|
|
4634
|
+
const h = n ? "#FFFFFF" : "#1C2026", u = `<svg width="103" height="20" viewBox="0 0 103 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4635
|
+
<path d="M92.6267 1.50666H93.0475C93.3792 1.50666 93.6025 1.31028 93.6025 1.02537C93.6025 0.740457 93.4034 0.561783 93.0426 0.561783C92.706 0.561783 92.4827 0.759773 92.4633 1.06239H91.795C91.8209 0.423351 92.3225 0.00805664 93.075 0.00805664C93.8274 0.00805664 94.2886 0.376671 94.2886 0.928788C94.2886 1.35213 93.9973 1.65797 93.5717 1.73523V1.74972C94.0895 1.79318 94.4229 2.10385 94.4229 2.58192C94.4229 3.20164 93.8581 3.61372 93.0572 3.61372C92.2562 3.61372 91.761 3.18555 91.7271 2.54973H92.4212C92.4423 2.84108 92.6834 3.03263 93.0652 3.03263C93.4471 3.03263 93.6834 2.82981 93.6834 2.53685C93.6834 2.22135 93.4455 2.0298 93.0539 2.0298H92.6251V1.50827L92.6267 1.50666Z" fill="${h}"/>
|
|
4636
|
+
<path d="M95.1182 2.97623C94.9256 2.68488 94.8269 2.29373 94.8269 1.83498C94.8269 0.692113 95.3852 0.00317383 96.2816 0.00317383C96.9434 0.00317383 97.4596 0.392714 97.5567 0.957708H96.8431C96.7735 0.727525 96.5502 0.574607 96.2784 0.574607C95.7945 0.574607 95.5017 1.03658 95.5178 1.81566H95.5324C95.6716 1.47763 96.013 1.25389 96.4564 1.25389C97.1149 1.25389 97.6036 1.73679 97.6036 2.39192C97.6036 3.10179 97.0486 3.61205 96.2719 3.61205C95.7735 3.61205 95.3625 3.3867 95.1198 2.97623H95.1182ZM96.8949 2.41446C96.8949 2.05872 96.6279 1.79796 96.2654 1.79796C95.903 1.79796 95.6311 2.05872 95.6311 2.40802C95.6311 2.75732 95.9078 3.0374 96.2638 3.0374C96.6198 3.0374 96.8965 2.76215 96.8965 2.41607L96.8949 2.41446Z" fill="${h}"/>
|
|
4637
|
+
<path d="M97.998 1.79961C97.998 0.68411 98.5336 0 99.4026 0C100.272 0 100.804 0.6825 100.804 1.79639C100.804 2.91028 100.275 3.60727 99.4026 3.60727C98.5304 3.60727 97.998 2.91672 97.998 1.798V1.79961ZM100.066 1.79961C100.066 1.01892 99.8136 0.579481 99.4026 0.579481C98.9916 0.579481 98.7359 1.02214 98.7359 1.79961C98.7359 2.57708 98.9883 3.0294 99.4026 3.0294C99.8168 3.0294 100.066 2.58674 100.066 1.79961Z" fill="${h}"/>
|
|
4638
|
+
<path d="M101.137 0.809958C101.137 0.381786 101.469 0.048584 101.901 0.048584C102.333 0.048584 102.666 0.381786 102.666 0.809958C102.666 1.23813 102.331 1.57294 101.901 1.57294C101.47 1.57294 101.137 1.23974 101.137 0.809958ZM102.249 0.809958C102.249 0.616798 102.097 0.46066 101.902 0.46066C101.708 0.46066 101.556 0.616798 101.556 0.809958C101.556 1.00312 101.715 1.16087 101.902 1.16087C102.1 1.16087 102.249 0.998289 102.249 0.809958Z" fill="${h}"/>
|
|
4639
|
+
<path d="M42.5486 0.0388184C37.204 0.0388184 33.5098 3.06983 33.5098 7.50447C33.5098 11.9391 37.204 15.02 42.5486 15.02C47.8933 15.02 51.5018 11.9375 51.5018 7.49803C51.5018 3.05856 47.8642 0.0388184 42.5486 0.0388184ZM42.5486 12.2836C39.0227 12.2836 36.5519 10.3327 36.5519 7.4771C36.5519 4.62155 39.0179 2.78331 42.5486 2.78331C46.0794 2.78331 48.4613 4.67789 48.4613 7.4771C48.4613 10.2763 45.9872 12.2787 42.5486 12.2787V12.2852V12.2836Z" fill="${h}"/>
|
|
4640
|
+
<path d="M10.4321 6.17332H5.62948C2.78642 6.17332 2.01943 2.78013 7.93208 2.78013C10.4337 2.78013 12.3949 3.85539 13.2476 4.41878L14.7833 2.10085C13.3318 0.827603 10.7751 0.0356445 7.90457 0.0356445C-1.589 0.0356445 -1.70389 8.85825 5.65861 8.85825H10.4903C13.6166 8.85825 14.1279 12.2804 7.93208 12.2804C4.83336 12.2804 2.38836 10.6402 1.53561 10.0172L0 12.3367C1.45146 13.6084 4.51944 15.0217 7.95797 15.0217C17.9062 15.0152 18.0211 6.17171 10.4321 6.17171V6.17332Z" fill="${h}"/>
|
|
4641
|
+
<path d="M26.0314 12.2771C22.3939 12.2771 20.0346 10.3262 20.0346 7.527C20.0346 4.72779 22.3648 2.7817 26.0023 2.7817C28.0784 2.7817 30.0104 3.85696 31.1755 4.93061L32.9166 2.52737C31.2677 1.22836 28.737 0.0388184 26.0088 0.0388184C20.5508 0.0388184 16.999 3.09397 16.999 7.53344C16.999 11.9729 20.6042 15.02 26.0654 15.02C28.8502 15.02 31.381 13.7757 33.0282 12.4751L31.2386 10.1266C30.0687 11.2067 28.135 12.2771 26.0314 12.2771Z" fill="${h}"/>
|
|
4642
|
+
<path d="M80.9771 0.0372542C75.8605 0.0372542 72.3071 3.09241 72.3071 7.53188C72.3071 11.9714 76.3719 15.0185 81.9156 15.0185C84.8428 15.0185 87.2829 14.0575 88.8218 12.7569L87.0289 10.4148C85.9771 11.5464 84.2732 12.3657 81.8849 12.3657C78.558 12.3657 76.1874 10.9814 75.5013 8.85986H89.592V7.5013C89.5872 3.06182 86.092 0.0356445 80.9755 0.0356445L80.9771 0.0372542ZM80.948 2.69482C83.8768 2.69482 85.88 4.06787 86.4075 6.25702H75.4447C75.9884 4.08718 77.9722 2.69482 80.948 2.69482Z" fill="${h}"/>
|
|
4643
|
+
<path d="M62.7358 0.0372542C60.1921 0.0372542 58.1743 0.925792 56.7875 2.29562C56.4283 1.16563 55.4364 0.462207 54.0917 0.462207H52.2471V3.14875H53.951V20.0004H56.9364V12.8792C58.3151 14.1782 60.273 15.0233 62.739 15.0233C67.485 15.0233 70.7536 11.9408 70.7536 7.5013C70.7536 3.06182 67.4802 0.0356445 62.7342 0.0356445L62.7358 0.0372542ZM62.3652 12.2756C59.1241 12.2756 56.9364 10.3247 56.9364 7.4691C56.9364 4.61355 59.1241 2.7753 62.3652 2.7753C65.6064 2.7753 67.7099 4.66989 67.7099 7.4691C67.7067 10.3311 65.464 12.2756 62.3652 12.2756Z" fill="${h}"/>
|
|
4644
4644
|
</svg>`;
|
|
4645
4645
|
try {
|
|
4646
|
-
const
|
|
4647
|
-
|
|
4648
|
-
} catch (
|
|
4649
|
-
console.warn("Failed to load logo SVG:",
|
|
4646
|
+
const g = await this._loadSvgAsImage(u);
|
|
4647
|
+
g && e.drawImage(g, r, (a - o) / 2, c, o);
|
|
4648
|
+
} catch (g) {
|
|
4649
|
+
console.warn("Failed to load logo SVG:", g);
|
|
4650
4650
|
}
|
|
4651
4651
|
}
|
|
4652
|
-
_drawHeaderSecondLine(e, t, s, n, a, r) {
|
|
4653
|
-
const
|
|
4654
|
-
e.fillStyle = "#FFFFFF", e.fillRect(0, a, n,
|
|
4655
|
-
const
|
|
4656
|
-
e.fillText(
|
|
4652
|
+
_drawHeaderSecondLine(e, t, s, n, a, r, o = !1) {
|
|
4653
|
+
const c = 20 * r, h = 12 * r, u = 8 * r;
|
|
4654
|
+
e.fillStyle = o ? "#292929" : "#FFFFFF", e.fillRect(0, a, n, c), e.strokeStyle = o ? "#3E3E3E" : "#EDEDED", e.lineWidth = 1 * r, e.beginPath(), e.moveTo(0, a + c), e.lineTo(n, a + c), e.stroke(), e.fillStyle = o ? "#C3C3C5" : "#1C2026", e.font = `500 ${u}px Geist, Arial, sans-serif`, e.textBaseline = "middle", e.textAlign = "left";
|
|
4655
|
+
const g = t ? `${t} created with Scope360, ${s}` : `Scope360, ${s}`;
|
|
4656
|
+
e.fillText(g, h, a + c / 2);
|
|
4657
4657
|
}
|
|
4658
4658
|
_loadSvgAsImage(e) {
|
|
4659
4659
|
return new Promise((t, s) => {
|
|
@@ -4665,24 +4665,25 @@ class pr {
|
|
|
4665
4665
|
}, n.src = r;
|
|
4666
4666
|
});
|
|
4667
4667
|
}
|
|
4668
|
-
_drawFooter(e, t, s, n, a, r) {
|
|
4669
|
-
const
|
|
4670
|
-
e.fillStyle = "#FFFFFF", e.fillRect(0,
|
|
4668
|
+
_drawFooter(e, t, s, n, a, r, o = !1) {
|
|
4669
|
+
const c = 32 * r, h = 12 * r, u = 12 * r, g = 4 * r, p = n + a;
|
|
4670
|
+
e.fillStyle = o ? "#292929" : "#FFFFFF", e.fillRect(0, p, s, c), e.strokeStyle = o ? "#3E3E3E" : "#EDEDED", e.lineWidth = 1 * r, e.beginPath(), e.moveTo(0, p), e.lineTo(s, p), e.stroke(), e.textBaseline = "middle", e.textAlign = "left";
|
|
4671
4671
|
const _ = [];
|
|
4672
4672
|
if (t.pair && _.push({ label: "", value: t.pair }), t.net_pnl !== void 0) {
|
|
4673
|
-
const
|
|
4674
|
-
_.push({ label: "Net P&L", value: t.net_pnl, valueColor:
|
|
4673
|
+
const x = t.net_pnl.startsWith("+");
|
|
4674
|
+
_.push({ label: "Net P&L", value: t.net_pnl, valueColor: x ? "#56B683" : "#F18169" });
|
|
4675
4675
|
}
|
|
4676
4676
|
t.type && _.push({ label: "Type", value: t.type }), t.entry_price && _.push({ label: "Entry", value: t.entry_price }), t.exit_price && _.push({ label: "Exit", value: t.exit_price }), t.open_date && _.push({ label: "Open date", value: t.open_date }), t.close_date && _.push({ label: "Close date", value: t.close_date }), t.holdtime && _.push({ label: "Holdtime", value: t.holdtime }), t.rr && _.push({ label: "RR", value: t.rr }), t.volume && _.push({ label: "Volume", value: t.volume });
|
|
4677
|
-
const
|
|
4677
|
+
const v = p + c / 2, b = 24 * r;
|
|
4678
4678
|
if (_.length === 0) return;
|
|
4679
|
-
e.font = `500 ${
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4679
|
+
e.font = `500 ${u}px Geist, Arial, sans-serif`;
|
|
4680
|
+
const w = o ? "#878788" : "#8E8E93", C = o ? "#FAFAFA" : "#1C2026";
|
|
4681
|
+
let y = h;
|
|
4682
|
+
_.forEach((x) => {
|
|
4683
|
+
const T = e.measureText(x.label).width, k = e.measureText(x.value).width, R = T + g + k;
|
|
4684
|
+
e.fillStyle = w, e.font = `500 ${u}px Geist, Arial, sans-serif`, e.fillText(x.label, y, v);
|
|
4685
|
+
const $ = y + T + g;
|
|
4686
|
+
e.fillStyle = x.valueColor || C, e.font = `500 ${u}px Geist, Arial, sans-serif`, e.fillText(x.value, $, v), y += R + b;
|
|
4686
4687
|
});
|
|
4687
4688
|
}
|
|
4688
4689
|
async captureScreenshot(e = {}) {
|
|
@@ -4693,44 +4694,44 @@ class pr {
|
|
|
4693
4694
|
hour: "2-digit",
|
|
4694
4695
|
minute: "2-digit",
|
|
4695
4696
|
timeZoneName: "short"
|
|
4696
|
-
}), a = typeof e == "object" ? e : {}, r = a.createdBy, o = a.createdAt || n, c = a.trade, { width:
|
|
4697
|
-
|
|
4697
|
+
}), a = typeof e == "object" ? e : {}, r = a.createdBy, o = a.createdAt || n, c = a.trade, h = a.isDark || !1, { width: u, height: g, canvasesContainer: p } = this._view, _ = Array.from(
|
|
4698
|
+
p.node.querySelectorAll("canvas")
|
|
4698
4699
|
);
|
|
4699
4700
|
if (_.length === 0) {
|
|
4700
4701
|
console.warn("No canvas elements found for screenshot");
|
|
4701
4702
|
return;
|
|
4702
4703
|
}
|
|
4703
|
-
const
|
|
4704
|
-
|
|
4705
|
-
const
|
|
4706
|
-
if (!
|
|
4704
|
+
const v = window.devicePixelRatio || 1, b = 48 * v, w = 20 * v, C = c ? 32 * v : 0, y = g * v, x = y + b + w + C, T = document.createElement("canvas");
|
|
4705
|
+
T.width = u * v, T.height = x;
|
|
4706
|
+
const k = T.getContext("2d");
|
|
4707
|
+
if (!k) {
|
|
4707
4708
|
console.error("Failed to get 2D context for merged canvas");
|
|
4708
4709
|
return;
|
|
4709
4710
|
}
|
|
4710
|
-
|
|
4711
|
-
let
|
|
4712
|
-
await this._drawHeader(
|
|
4713
|
-
const
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4711
|
+
k.fillStyle = h ? "#101011" : "#ffffff", k.fillRect(0, 0, T.width, T.height);
|
|
4712
|
+
let R = b + w;
|
|
4713
|
+
await this._drawHeader(k, T.width, v, h), this._drawHeaderSecondLine(k, r, o, T.width, b, v, h);
|
|
4714
|
+
const $ = this._view.mainCanvas;
|
|
4715
|
+
$.background && (k.fillStyle = $.background, k.fillRect(0, R, T.width, y)), _.forEach((P) => {
|
|
4716
|
+
k.drawImage(
|
|
4717
|
+
P,
|
|
4717
4718
|
0,
|
|
4718
4719
|
0,
|
|
4719
|
-
|
|
4720
|
-
|
|
4720
|
+
P.width,
|
|
4721
|
+
P.height,
|
|
4721
4722
|
0,
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4723
|
+
R,
|
|
4724
|
+
T.width,
|
|
4725
|
+
y
|
|
4725
4726
|
);
|
|
4726
|
-
}), c && this._drawFooter(
|
|
4727
|
-
(
|
|
4728
|
-
if (
|
|
4727
|
+
}), c && this._drawFooter(k, c, T.width, R, y, v, h), T.toBlob(
|
|
4728
|
+
(P) => {
|
|
4729
|
+
if (!P) {
|
|
4729
4730
|
console.error("Failed to create blob from canvas");
|
|
4730
4731
|
return;
|
|
4731
4732
|
}
|
|
4732
|
-
const
|
|
4733
|
-
|
|
4733
|
+
const U = URL.createObjectURL(P), O = document.createElement("a");
|
|
4734
|
+
O.href = U, O.download = t, document.body.appendChild(O), O.click(), document.body.removeChild(O), URL.revokeObjectURL(U);
|
|
4734
4735
|
},
|
|
4735
4736
|
"image/png",
|
|
4736
4737
|
1
|