charts-core 1.1.59 → 1.1.61
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 +613 -601
- package/dist/charts-core.js.map +1 -1
- package/dist/charts-core.umd.cjs +3 -3
- package/dist/charts-core.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/charts-core.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var f = (i, t, e) =>
|
|
1
|
+
var Hs = Object.defineProperty;
|
|
2
|
+
var Is = (i, t, e) => t in i ? Hs(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var f = (i, t, e) => Is(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import * as k from "d3";
|
|
5
|
-
const
|
|
5
|
+
const Bs = (i) => {
|
|
6
6
|
const { svg: t, config: e, y: s, width: n } = i, { margin: a, yAxis: r } = e, { customTicks: o, tickFormat: c, tickValues: h, ticks: d, isShow: g } = r;
|
|
7
7
|
if (!g) return null;
|
|
8
8
|
t.append("g").attr("transform", `translate(${n - a.right},0)`).call((_) => {
|
|
@@ -20,11 +20,11 @@ const Hs = (i) => {
|
|
|
20
20
|
const v = m.nodes().map((w) => w.getBBox().width), b = Math.max(...v);
|
|
21
21
|
_.selectAll(".tick").each(function(w, x) {
|
|
22
22
|
var I;
|
|
23
|
-
const y = k.select(this), C = y.select("text"),
|
|
24
|
-
C.attr("x",
|
|
23
|
+
const y = k.select(this), C = y.select("text"), A = v[x], M = b - A, D = y.append("g").attr("transform", "translate(10, 0)");
|
|
24
|
+
C.attr("x", M), C.remove(), (I = D.node()) == null || I.appendChild(C.node());
|
|
25
25
|
});
|
|
26
26
|
}).attr("font-family", "inherit");
|
|
27
|
-
},
|
|
27
|
+
}, Rs = (i) => {
|
|
28
28
|
const { svg: t, config: e, x: s, height: n } = i, { margin: a, xAxis: r } = e, { isShow: o, tickValues: c, tickFormat: h, customTicks: d, ticks: g } = r;
|
|
29
29
|
if (!o) return null;
|
|
30
30
|
t.append("g").attr("transform", `translate(0,${n - a.bottom})`).call((_) => {
|
|
@@ -34,7 +34,7 @@ const Hs = (i) => {
|
|
|
34
34
|
let m = [];
|
|
35
35
|
_.selectAll(".tick").each((v) => m.push(v)), i.xTicks = m;
|
|
36
36
|
}).call((_) => _.selectAll(".tick line").remove()).call((_) => _.selectAll(".tick text").classed("sc-charts__x-axis-tick", !0)).attr("font-family", "inherit");
|
|
37
|
-
},
|
|
37
|
+
}, $s = (i) => {
|
|
38
38
|
const { svg: t, config: e, y: s, width: n } = i, {
|
|
39
39
|
margin: a,
|
|
40
40
|
grid: { horizontalStyle: r }
|
|
@@ -49,11 +49,11 @@ const Hs = (i) => {
|
|
|
49
49
|
r === "every-line-dashed" && h.attr("stroke-dasharray", "4 4");
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
},
|
|
52
|
+
}, bi = (i) => {
|
|
53
53
|
const t = Array.from(i.childNodes);
|
|
54
54
|
for (let e = 0; e < t.length; e++)
|
|
55
55
|
i.removeChild(t[e]);
|
|
56
|
-
},
|
|
56
|
+
}, Os = (i) => {
|
|
57
57
|
const t = "http://www.w3.org/2000/svg", e = document.createElement("div");
|
|
58
58
|
e.className = "sc-charts__hovered-circles-tooltip-container", e.style.display = "none";
|
|
59
59
|
const s = document.createElement("div");
|
|
@@ -68,7 +68,7 @@ const Hs = (i) => {
|
|
|
68
68
|
tooltip: s,
|
|
69
69
|
tooltipArrow: n
|
|
70
70
|
};
|
|
71
|
-
},
|
|
71
|
+
}, Ps = (i, t, {
|
|
72
72
|
x: e,
|
|
73
73
|
y: s,
|
|
74
74
|
r: n = 3.5,
|
|
@@ -84,12 +84,12 @@ const Hs = (i) => {
|
|
|
84
84
|
return r.append("circle").attr("cx", e).attr("cy", s).attr("r", n).classed("sc-charts__hovered-circles", !0), r.append("circle").attr("cx", e).attr("cy", s).attr("r", n + a).classed("sc-charts__hovered-circles_add", !0), r;
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
function
|
|
87
|
+
function zs(i, t, e, s) {
|
|
88
88
|
if (!i) return null;
|
|
89
89
|
const n = i.width / 2, a = t - n, r = t + n;
|
|
90
90
|
return a < e ? e : r > s ? s - i.width : t - n;
|
|
91
91
|
}
|
|
92
|
-
const
|
|
92
|
+
const ti = (i, { x1: t, x2: e, y1: s, y2: n }) => i.append("line").attr("x1", t).attr("x2", e).attr("y1", s).attr("y2", n).attr("stroke", "var(--sc-color-axis-zero-line)").attr("stroke-width", 1), Vs = (i) => {
|
|
93
93
|
const { svg: t, config: e, x: s, y: n, height: a, data: r, wrapperNode: o } = i, {
|
|
94
94
|
margin: c,
|
|
95
95
|
grid: { verticalStyle: h, tooltipNode: d, hoverCirclesRadius: g, hoverCirclesAdditionalArea: _ }
|
|
@@ -99,27 +99,27 @@ const Qe = (i, { x1: t, x2: e, y1: s, y2: n }) => i.append("line").attr("x1", t)
|
|
|
99
99
|
h === "every-line-dashed" && b.attr("stroke-dasharray", "4 4");
|
|
100
100
|
}), h === "hovered-circles")) {
|
|
101
101
|
const m = n.range()[0], v = s(r[0].date), b = s(r[r.length - 1].date);
|
|
102
|
-
|
|
103
|
-
const { tooltipContainer: w, tooltip: x, tooltipArrow: y } =
|
|
102
|
+
ti(t, { x1: v, x2: b, y1: m, y2: m });
|
|
103
|
+
const { tooltipContainer: w, tooltip: x, tooltipArrow: y } = Os(o), C = (M) => {
|
|
104
104
|
if (!d) return;
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
s(
|
|
105
|
+
bi(x), w.style.display = "block", x.append(d({ date: M.date, value: M.value }));
|
|
106
|
+
const D = x.getBoundingClientRect(), I = zs(
|
|
107
|
+
D,
|
|
108
|
+
s(M.date),
|
|
109
109
|
i.config.margin.left - i.config.grid.tooltipArrowSize,
|
|
110
110
|
i.width - i.config.margin.right + i.config.grid.tooltipArrowSize
|
|
111
111
|
);
|
|
112
|
-
I !== null && (x.style.left = I + "px"), y.style.left = s(
|
|
113
|
-
},
|
|
112
|
+
I !== null && (x.style.left = I + "px"), y.style.left = s(M.date) + "px";
|
|
113
|
+
}, A = () => {
|
|
114
114
|
w.style.display = "none";
|
|
115
115
|
};
|
|
116
116
|
i.gridHoverTooltip = d ? {
|
|
117
|
-
show: (
|
|
118
|
-
hide:
|
|
119
|
-
} : null, r.forEach((
|
|
120
|
-
const I = s(
|
|
121
|
-
et ||
|
|
122
|
-
const K =
|
|
117
|
+
show: (M) => C(M),
|
|
118
|
+
hide: A
|
|
119
|
+
} : null, r.forEach((M, D) => {
|
|
120
|
+
const I = s(M.date), W = n(M.value), Z = r[D - 1], et = D > 0 && Z && M.value === Z.value;
|
|
121
|
+
et || ti(t, { x1: I, x2: I, y1: W, y2: m });
|
|
122
|
+
const K = Ps(t, et, {
|
|
123
123
|
x: I,
|
|
124
124
|
y: m,
|
|
125
125
|
r: g,
|
|
@@ -127,17 +127,17 @@ const Qe = (i, { x1: t, x2: e, y1: s, y2: n }) => i.append("line").attr("x1", t)
|
|
|
127
127
|
});
|
|
128
128
|
d && K.on("mouseover", function() {
|
|
129
129
|
var O, V;
|
|
130
|
-
(V = (O = i.onGridCircleHoverRef) == null ? void 0 : O.current) == null || V.call(O, { date:
|
|
130
|
+
(V = (O = i.onGridCircleHoverRef) == null ? void 0 : O.current) == null || V.call(O, { date: M.date, value: M.value }), C({ date: M.date, value: et ? null : M.value });
|
|
131
131
|
}).on("mouseout", function() {
|
|
132
|
-
|
|
132
|
+
A();
|
|
133
133
|
});
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
},
|
|
136
|
+
}, Ws = (i) => {
|
|
137
|
+
$s(i), Vs(i);
|
|
138
|
+
}, Ys = (i) => {
|
|
139
139
|
const { svg: t, config: e, width: s, height: n } = i, { margin: a, logo: r } = e;
|
|
140
|
-
|
|
140
|
+
Rs(i), Bs(i), r && t.append("image").attr("xlink:href", e.theme === "dark" ? r.picDarkTheme : r.picLightTheme).attr("width", r.width).attr("height", r.height).attr("x", r.x ?? (s - a.left - a.right) / 2 - r.width / 2 + a.left).attr("y", r.y ?? (n - a.top - a.bottom) / 2 - r.height / 2 + a.top), Ws(i);
|
|
141
141
|
}, kt = (i, t, e) => {
|
|
142
142
|
let s = i.select(`#${t}`);
|
|
143
143
|
return s.empty() && (s = i.append("linearGradient").attr("gradientUnits", "userSpaceOnUse").attr("id", t)), s.attr("x1", e.x1).attr("y1", e.x2).attr("x2", e.y1).attr("y2", e.y2), e.stops.forEach(({ offset: n, stopColor: a }) => {
|
|
@@ -146,13 +146,13 @@ const Qe = (i, { x1: t, x2: e, y1: s, y2: n }) => i.append("line").attr("x1", t)
|
|
|
146
146
|
}, vt = (i) => {
|
|
147
147
|
const t = k.select(i).select("defs");
|
|
148
148
|
return t.empty() ? k.select(i).append("defs") : t;
|
|
149
|
-
},
|
|
149
|
+
}, ke = (i) => {
|
|
150
150
|
const {
|
|
151
151
|
y: t,
|
|
152
152
|
config: { margin: e }
|
|
153
153
|
} = i, s = t.range()[0] - t(0), n = t.range()[0] - s >= 0 ? t.range()[0] - s : 0, a = s + e.bottom >= 0 ? s + e.bottom : 0;
|
|
154
154
|
return { x: 0, y: n, width: "100%", height: a };
|
|
155
|
-
},
|
|
155
|
+
}, ei = (i, t) => ({
|
|
156
156
|
...i,
|
|
157
157
|
...t,
|
|
158
158
|
margin: {
|
|
@@ -187,7 +187,7 @@ const Qe = (i, { x1: t, x2: e, y1: s, y2: n }) => i.append("line").attr("x1", t)
|
|
|
187
187
|
...i.selection,
|
|
188
188
|
...t == null ? void 0 : t.selection
|
|
189
189
|
}
|
|
190
|
-
}),
|
|
190
|
+
}), ii = (i, t = {}) => {
|
|
191
191
|
const e = i.node(), s = vt(e), n = (o, c) => kt(s, o, {
|
|
192
192
|
x1: "0%",
|
|
193
193
|
y1: "0%",
|
|
@@ -213,7 +213,7 @@ const Qe = (i, { x1: t, x2: e, y1: s, y2: n }) => i.append("line").attr("x1", t)
|
|
|
213
213
|
r.remove();
|
|
214
214
|
}
|
|
215
215
|
};
|
|
216
|
-
},
|
|
216
|
+
}, pe = (i, t = {}) => {
|
|
217
217
|
const e = i.append("circle").attr("r", t.radius || 4).style("display", t.hidden ? "none" : "block"), s = t.className || "";
|
|
218
218
|
return s && e.classed(s, !0), {
|
|
219
219
|
className(n, a) {
|
|
@@ -226,7 +226,7 @@ const Qe = (i, { x1: t, x2: e, y1: s, y2: n }) => i.append("line").attr("x1", t)
|
|
|
226
226
|
e.remove();
|
|
227
227
|
}
|
|
228
228
|
};
|
|
229
|
-
},
|
|
229
|
+
}, js = (i, t = {}) => {
|
|
230
230
|
const e = "sc-charts__hover-line", s = i.append("line").style("display", t.hidden ? "none" : "block").classed(e, !0), n = i.node(), a = vt(n);
|
|
231
231
|
return ((o, c) => kt(a, o, {
|
|
232
232
|
x1: "0%",
|
|
@@ -250,11 +250,11 @@ const Qe = (i, { x1: t, x2: e, y1: s, y2: n }) => i.append("line").attr("x1", t)
|
|
|
250
250
|
s.remove();
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
|
-
}, gt = "sc-charts__range-tooltip",
|
|
253
|
+
}, gt = "sc-charts__range-tooltip", si = k.timeFormat("%b %e, %I:%M %p"), Xs = (i) => {
|
|
254
254
|
const t = k.format(",.2f");
|
|
255
255
|
return `${i < 0 ? "-" : ""}$${t(Math.abs(i))}`;
|
|
256
256
|
};
|
|
257
|
-
function
|
|
257
|
+
function Us(i) {
|
|
258
258
|
const t = "http://www.w3.org/2000/svg", e = document.createElement("div");
|
|
259
259
|
e.className = gt, e.style.position = "absolute", e.style.top = "0", e.style.pointerEvents = "none", e.style.display = "none", i.append(e);
|
|
260
260
|
const s = document.createElement("div");
|
|
@@ -275,8 +275,8 @@ function js(i) {
|
|
|
275
275
|
const h = document.createElement("div");
|
|
276
276
|
return h.className = `${gt}-time`, s.append(h), { wrapper: e, sumNode: c, timeNode: h };
|
|
277
277
|
}
|
|
278
|
-
const
|
|
279
|
-
const { wrapper: t, sumNode: e, timeNode: s } =
|
|
278
|
+
const Gs = (i) => {
|
|
279
|
+
const { wrapper: t, sumNode: e, timeNode: s } = Us(i.wrapperNode);
|
|
280
280
|
return {
|
|
281
281
|
className(n, a) {
|
|
282
282
|
n === "remove" ? t.classList.remove(`${gt}${a}`) : t.classList.add(`${gt}${a}`);
|
|
@@ -289,13 +289,13 @@ const Xs = (i) => {
|
|
|
289
289
|
b = g({ left: n.value, right: a.value, direction: v });
|
|
290
290
|
else {
|
|
291
291
|
const x = (d / Math.abs(n.value) * 100).toFixed(2);
|
|
292
|
-
b = `${
|
|
292
|
+
b = `${Xs(d)} (${x}%)`;
|
|
293
293
|
}
|
|
294
|
-
_ ? w = _({ left: n.date, right: a.date, direction: v }) : w = `${
|
|
295
|
-
const x = t.getBoundingClientRect(), y = i.wrapperNode.getBoundingClientRect(), C = i.x(n.date),
|
|
296
|
-
let
|
|
294
|
+
_ ? w = _({ left: n.date, right: a.date, direction: v }) : w = `${si(n.date)} to ${si(a.date)}`, e.textContent = b, s.textContent = w, requestAnimationFrame(() => {
|
|
295
|
+
const x = t.getBoundingClientRect(), y = i.wrapperNode.getBoundingClientRect(), C = i.x(n.date), A = i.x(a.date);
|
|
296
|
+
let D = (C + A) / 2 - x.width / 2;
|
|
297
297
|
const I = 0, W = y.width - x.width;
|
|
298
|
-
|
|
298
|
+
D < I && (D = I), D > W && (D = W), t.style.left = `${D}px`, t.style.top = `${o}px`;
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
301
|
c !== void 0 && (t.style.display = c ? "none" : "block");
|
|
@@ -304,28 +304,28 @@ const Xs = (i) => {
|
|
|
304
304
|
t.remove();
|
|
305
305
|
}
|
|
306
306
|
};
|
|
307
|
-
},
|
|
307
|
+
}, Lt = "sc-charts__hover-tooltip", ve = 16, Zs = k.timeFormat("%a, %b %d, %-I:%M %p"), qs = (i) => {
|
|
308
308
|
const t = k.format(",.2f");
|
|
309
309
|
return `${i < 0 ? "-" : ""}$${t(Math.abs(i))}`;
|
|
310
310
|
};
|
|
311
|
-
function
|
|
311
|
+
function Js(i) {
|
|
312
312
|
const t = document.createElement("div");
|
|
313
|
-
t.className = `${
|
|
313
|
+
t.className = `${Lt}-container`, t.style.position = "absolute", t.style.top = "0", t.style.pointerEvents = "none", t.style.display = "none", i.appendChild(t);
|
|
314
314
|
const e = document.createElement("div");
|
|
315
|
-
e.className = `${
|
|
315
|
+
e.className = `${Lt}-sum`;
|
|
316
316
|
const s = document.createElement("div");
|
|
317
|
-
return s.className = `${
|
|
317
|
+
return s.className = `${Lt}-time`, { wrapper: t, sumNode: e, timeNode: s };
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
return i ? t +
|
|
319
|
+
function Qs(i, t, e) {
|
|
320
|
+
return i ? t + ve + i.width < e ? t + ve : t - ve - i.width : null;
|
|
321
321
|
}
|
|
322
|
-
const
|
|
323
|
-
const { wrapper: t, sumNode: e, timeNode: s } =
|
|
322
|
+
const Ks = (i) => {
|
|
323
|
+
const { wrapper: t, sumNode: e, timeNode: s } = Js(i.wrapperNode), n = () => {
|
|
324
324
|
e.parentNode || (t.appendChild(e), t.appendChild(s));
|
|
325
325
|
};
|
|
326
326
|
return {
|
|
327
327
|
className(a, r) {
|
|
328
|
-
a === "remove" ? t.classList.remove(`${
|
|
328
|
+
a === "remove" ? t.classList.remove(`${Lt}${r}`) : t.classList.add(`${Lt}${r}`);
|
|
329
329
|
},
|
|
330
330
|
update({ hidden: a, dataItem: r }) {
|
|
331
331
|
if (!i.config.hover.showDefaultTooltip) {
|
|
@@ -334,8 +334,8 @@ const Js = (i) => {
|
|
|
334
334
|
}
|
|
335
335
|
if (r) {
|
|
336
336
|
const { sumFormatter: o, timeFormatter: c, tooltipNode: h } = i.config.hover;
|
|
337
|
-
h ? (
|
|
338
|
-
const d = t.getBoundingClientRect(), g =
|
|
337
|
+
h ? (bi(t), t.appendChild(h({ date: r.date, value: r.value }))) : (n(), e.textContent = o ? o(r.value) : qs(r.value), s.textContent = c ? c(r.date) : Zs(r.date)), requestAnimationFrame(() => {
|
|
338
|
+
const d = t.getBoundingClientRect(), g = Qs(
|
|
339
339
|
d,
|
|
340
340
|
i.x(r.date),
|
|
341
341
|
i.width - i.config.margin.right
|
|
@@ -349,7 +349,7 @@ const Js = (i) => {
|
|
|
349
349
|
t.remove();
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
|
-
},
|
|
352
|
+
}, tn = {
|
|
353
353
|
margin: { top: 10, right: 30, bottom: 20, left: 10 },
|
|
354
354
|
theme: "light",
|
|
355
355
|
logo: {
|
|
@@ -403,7 +403,7 @@ const Js = (i) => {
|
|
|
403
403
|
},
|
|
404
404
|
enableBelowZeroLine: !1,
|
|
405
405
|
curveTension: 1
|
|
406
|
-
},
|
|
406
|
+
}, ee = () => k.curveMonotoneX, en = (i) => {
|
|
407
407
|
const { svg: t, data: e, x: s, y: n, config: a } = i, r = t.node(), o = vt(r);
|
|
408
408
|
kt(o, "main-line-area-gradient", {
|
|
409
409
|
x1: "0%",
|
|
@@ -415,7 +415,7 @@ const Js = (i) => {
|
|
|
415
415
|
{ offset: "100%", stopColor: "rgba(255, 255, 255, 0)" }
|
|
416
416
|
]
|
|
417
417
|
});
|
|
418
|
-
const h = k.area().x((_) => s(_.date)).y0(n.range()[0]).y1((_) => n(_.value)).curve(
|
|
418
|
+
const h = k.area().x((_) => s(_.date)).y0(n.range()[0]).y1((_) => n(_.value)).curve(ee()), d = "sc-charts__main-line-area", g = t.append("path").datum(e).attr("d", h).attr("class", d).classed(`${d}_hidden`, !a.hasMainLineArea);
|
|
419
419
|
return {
|
|
420
420
|
className(_, m) {
|
|
421
421
|
_ === "remove" ? g.classed(`${d}${m}`, !1) : g.classed(`${d}${m}`, !0);
|
|
@@ -430,7 +430,7 @@ const Js = (i) => {
|
|
|
430
430
|
g.remove();
|
|
431
431
|
}
|
|
432
432
|
};
|
|
433
|
-
},
|
|
433
|
+
}, sn = (i, t = {}) => {
|
|
434
434
|
const e = "sc-charts__range-line-area", { svg: s, x: n, y: a, config: r, data: o, chartId: c } = i, { clip: h } = t, d = s.node(), g = vt(d), _ = "range-line-area-gradient";
|
|
435
435
|
kt(g, _ + "_up", {
|
|
436
436
|
x1: "0%",
|
|
@@ -451,20 +451,20 @@ const Js = (i) => {
|
|
|
451
451
|
{ offset: "100%", stopColor: "rgba(255, 255, 255, 0)" }
|
|
452
452
|
]
|
|
453
453
|
});
|
|
454
|
-
const m = k.area().x((y) => n(y.date)).y0(a.range()[0]).y1((y) => a(y.value)).curve(
|
|
454
|
+
const m = k.area().x((y) => n(y.date)).y0(a.range()[0]).y1((y) => a(y.value)).curve(ee()), v = `${c}-clip-${e}`, 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%"), x = s.append("path").datum(o).attr("d", m).attr("class", e).classed(`${e}_hidden`, !r.hasMainLineArea).attr("clip-path", `url(#${v})`);
|
|
455
455
|
return {
|
|
456
456
|
className(y, C) {
|
|
457
457
|
y === "remove" ? x.classed(`${e}${C}`, !1) : x.classed(`${e}${C}`, !0);
|
|
458
458
|
},
|
|
459
|
-
update({ data: y, hidden: C, clip:
|
|
460
|
-
y !== void 0 && x.datum(y).attr("d", m), C !== void 0 && x.classed(`${e}_hidden`, C),
|
|
459
|
+
update({ data: y, hidden: C, clip: A }) {
|
|
460
|
+
y !== void 0 && x.datum(y).attr("d", m), C !== void 0 && x.classed(`${e}_hidden`, C), A !== void 0 && w.attr("x", A.x).attr("y", A.y).attr("width", A.width).attr("height", A.height);
|
|
461
461
|
},
|
|
462
462
|
destroy() {
|
|
463
463
|
x.remove();
|
|
464
464
|
}
|
|
465
465
|
};
|
|
466
|
-
},
|
|
467
|
-
const { svg: e, data: s, x: n, y: a, chartId: r } = i, { baseClassName: o, id: c, clip: h } = t, d = e.node(), g = vt(d), _ = k.line().x((x) => n(x.date)).y((x) => a(x.value)).curve(
|
|
466
|
+
}, be = (i, t) => {
|
|
467
|
+
const { svg: e, data: s, x: n, y: a, chartId: r } = i, { baseClassName: o, id: c, clip: h } = t, d = e.node(), g = vt(d), _ = k.line().x((x) => n(x.date)).y((x) => a(x.value)).curve(ee()), m = `${r}-clip-${o}`, b = g.append("clipPath").attr("id", m).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 = e.append("path").classed(o, !0).datum(s).attr("d", _).attr("id", c).attr("clip-path", `url(#${m})`);
|
|
468
468
|
return {
|
|
469
469
|
className(x, y) {
|
|
470
470
|
x === "remove" ? w.classed(`${o}${y}`, !1) : w.classed(`${o}${y}`, !0);
|
|
@@ -476,30 +476,30 @@ const Js = (i) => {
|
|
|
476
476
|
w.remove();
|
|
477
477
|
}
|
|
478
478
|
};
|
|
479
|
-
},
|
|
480
|
-
const { svg: e, data: s, x: n, y: a, chartId: r, config: o } = i, { baseClassName: c, id: h, clip: d } = t, g = e.node(), _ = vt(g), m = k.line().x((y) => n(y.date)).y((y) => a(y.value)).curve(
|
|
479
|
+
}, nn = (i, t) => {
|
|
480
|
+
const { svg: e, data: s, x: n, y: a, chartId: r, config: o } = i, { baseClassName: c, id: h, clip: d } = t, g = e.node(), _ = vt(g), m = k.line().x((y) => n(y.date)).y((y) => a(y.value)).curve(ee()), v = `${r}-clip-${c}`, w = _.append("clipPath").attr("id", v).append("rect").attr("x", (d == null ? void 0 : d.x) || 0).attr("y", (d == null ? void 0 : d.y) || 0).attr("width", (d == null ? void 0 : d.width) || "100%").attr("height", (d == null ? void 0 : d.height) || "100%"), x = e.append("path").classed(c, !0).datum(s).attr("d", m).attr("id", h).attr("clip-path", `url(#${v})`);
|
|
481
481
|
return {
|
|
482
482
|
className(y, C) {
|
|
483
483
|
y === "remove" ? x.classed(`${c}${C}`, !1) : x.classed(`${c}${C}`, !0);
|
|
484
484
|
},
|
|
485
|
-
update({ data: y, clip: C, hidden:
|
|
486
|
-
y !== void 0 && x.datum(y).attr("d", m),
|
|
485
|
+
update({ data: y, clip: C, hidden: A }) {
|
|
486
|
+
y !== void 0 && x.datum(y).attr("d", m), A !== void 0 && x.classed(`${c}_hidden`, A), C !== void 0 && (o.hover.transitionName === "default" ? w.transition().duration(o.hover.transitionDuration).attr("x", C.x).attr("y", C.y).attr("width", C.width).attr("height", C.height).ease(k.easeLinear) : w.attr("x", C.x).attr("y", C.y).attr("width", C.width).attr("height", C.height));
|
|
487
487
|
},
|
|
488
488
|
destroy() {
|
|
489
489
|
x.remove();
|
|
490
490
|
}
|
|
491
491
|
};
|
|
492
|
-
},
|
|
492
|
+
}, an = (i) => {
|
|
493
493
|
const t = Math.abs(i);
|
|
494
494
|
let e;
|
|
495
495
|
return t >= 1e9 ? e = (i / 1e9).toFixed(1) + "B" : t >= 1e6 ? e = (i / 1e6).toFixed(1) + "M" : t >= 1e3 ? e = (i / 1e3).toFixed(1) + "K" : e = i.toFixed(1), e;
|
|
496
|
-
},
|
|
496
|
+
}, rn = (i, t) => {
|
|
497
497
|
const { svg: e, data: s, x: n, y: a } = i, { baseClassName: r } = t, o = e.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);
|
|
498
498
|
return ((g) => {
|
|
499
499
|
if (!g || g.length === 0) return;
|
|
500
500
|
const _ = g[g.length - 1], m = n(_.date), v = a(_.value);
|
|
501
501
|
c.attr("cx", m).attr("cy", v);
|
|
502
|
-
const b = i.config.extremePointFormatter ||
|
|
502
|
+
const b = i.config.extremePointFormatter || an;
|
|
503
503
|
h.attr("x", m).attr("y", v).text(b(_.value));
|
|
504
504
|
})(s), {
|
|
505
505
|
className(g, _) {
|
|
@@ -512,40 +512,40 @@ const Js = (i) => {
|
|
|
512
512
|
o.remove();
|
|
513
513
|
}
|
|
514
514
|
};
|
|
515
|
-
},
|
|
516
|
-
const t =
|
|
515
|
+
}, on = (i) => {
|
|
516
|
+
const t = be(i, {
|
|
517
517
|
baseClassName: "sc-charts__main-line",
|
|
518
518
|
id: `${i.chartId}-sc-charts__main-line`
|
|
519
|
-
}), e =
|
|
519
|
+
}), e = en(i);
|
|
520
520
|
let s = null;
|
|
521
|
-
i.config.hasExtremePoint && (s =
|
|
521
|
+
i.config.hasExtremePoint && (s = rn(i, {
|
|
522
522
|
baseClassName: "sc-charts__extreme-point"
|
|
523
523
|
}));
|
|
524
|
-
const n =
|
|
524
|
+
const n = js(i.svg), a = nn(i, {
|
|
525
525
|
baseClassName: "sc-charts__highlight-line",
|
|
526
526
|
id: `${i.chartId}-sc-charts__highlight-line`,
|
|
527
527
|
clip: { x: 0, y: 0, width: "0", height: "0" }
|
|
528
528
|
});
|
|
529
529
|
let r = null;
|
|
530
|
-
i.config.enableBelowZeroLine && (r =
|
|
530
|
+
i.config.enableBelowZeroLine && (r = be(i, {
|
|
531
531
|
baseClassName: "sc-charts__below-zero-line",
|
|
532
532
|
id: `${i.chartId}-sc-charts__below-zero-line`,
|
|
533
|
-
clip:
|
|
533
|
+
clip: ke(i)
|
|
534
534
|
}));
|
|
535
|
-
const o =
|
|
535
|
+
const o = pe(i.svg, {
|
|
536
536
|
className: "sc-charts__hover-circle",
|
|
537
537
|
hidden: !0
|
|
538
|
-
}), c =
|
|
538
|
+
}), c = ii(i.svg), h = ii(i.svg), d = be(i, {
|
|
539
539
|
baseClassName: "sc-charts__range-line",
|
|
540
540
|
id: `${i.chartId}-sc-charts__range-line`,
|
|
541
541
|
clip: { x: 0, y: 0, width: "0", height: "0" }
|
|
542
|
-
}), g =
|
|
542
|
+
}), g = pe(i.svg, {
|
|
543
543
|
className: "sc-charts__range-circle-left",
|
|
544
544
|
hidden: !0
|
|
545
|
-
}), _ =
|
|
545
|
+
}), _ = pe(i.svg, {
|
|
546
546
|
className: "sc-charts__range-circle-right",
|
|
547
547
|
hidden: !0
|
|
548
|
-
}), m =
|
|
548
|
+
}), m = Gs(i), v = Ks(i), b = sn(i);
|
|
549
549
|
return {
|
|
550
550
|
hoverLine: n,
|
|
551
551
|
hoverCircle: o,
|
|
@@ -563,7 +563,7 @@ const Js = (i) => {
|
|
|
563
563
|
belowZeroLine: r,
|
|
564
564
|
extremePoint: s
|
|
565
565
|
};
|
|
566
|
-
},
|
|
566
|
+
}, ln = (i, t, e) => {
|
|
567
567
|
const s = i.match(/^(\d+)([dMhmw])$/);
|
|
568
568
|
if (!s)
|
|
569
569
|
return console.warn("Invalid hoverRange:", i), {
|
|
@@ -644,9 +644,9 @@ const Js = (i) => {
|
|
|
644
644
|
width: "100%",
|
|
645
645
|
height: "100%"
|
|
646
646
|
};
|
|
647
|
-
},
|
|
647
|
+
}, ye = (i, t) => {
|
|
648
648
|
var c, h, d;
|
|
649
|
-
|
|
649
|
+
Me(i);
|
|
650
650
|
const {
|
|
651
651
|
x: e,
|
|
652
652
|
y: s,
|
|
@@ -668,7 +668,7 @@ const Js = (i) => {
|
|
|
668
668
|
dataItem: t,
|
|
669
669
|
hidden: !1
|
|
670
670
|
}), r.highlightRange) {
|
|
671
|
-
const g =
|
|
671
|
+
const g = ln(r.range, t.date, e);
|
|
672
672
|
n.highlightLine.update({
|
|
673
673
|
clip: g,
|
|
674
674
|
hidden: !1
|
|
@@ -683,16 +683,16 @@ const Js = (i) => {
|
|
|
683
683
|
})), n.mainLine.className("add", "_muted");
|
|
684
684
|
} else
|
|
685
685
|
n.highlightLine.update({ hidden: !0 }), n.mainLine.className("remove", "_muted"), (h = n.belowZeroLine) == null || h.update({
|
|
686
|
-
clip:
|
|
686
|
+
clip: ke(i)
|
|
687
687
|
});
|
|
688
688
|
(d = i.gridHoverTooltip) == null || d.show({ date: t.date, value: t.value });
|
|
689
|
-
},
|
|
689
|
+
}, Me = (i) => {
|
|
690
690
|
var e, s;
|
|
691
691
|
const { elements: t } = i;
|
|
692
692
|
t.hoverLine.update({ hidden: !0 }), t.hoverCircle.update({ hidden: !0 }), t.highlightLine.update({ hidden: !0 }), t.mainLine.className("remove", "_muted"), t.hoverTooltip.update({ hidden: !0 }), (e = i.gridHoverTooltip) == null || e.hide(), i.action !== "selection" && ((s = t.belowZeroLine) == null || s.update({
|
|
693
|
-
clip:
|
|
693
|
+
clip: ke(i)
|
|
694
694
|
}));
|
|
695
|
-
},
|
|
695
|
+
}, cn = (i, t) => {
|
|
696
696
|
[
|
|
697
697
|
"rangeBorderLeft",
|
|
698
698
|
"rangeBorderRight",
|
|
@@ -704,7 +704,7 @@ const Js = (i) => {
|
|
|
704
704
|
].forEach((s) => {
|
|
705
705
|
t ? (i[s].className("remove", "_down"), i[s].className("add", "_up")) : (i[s].className("remove", "_up"), i[s].className("add", "_down"));
|
|
706
706
|
});
|
|
707
|
-
},
|
|
707
|
+
}, hn = (i, t, e) => {
|
|
708
708
|
var v;
|
|
709
709
|
const {
|
|
710
710
|
x: s,
|
|
@@ -758,25 +758,25 @@ const Js = (i) => {
|
|
|
758
758
|
hidden: !1
|
|
759
759
|
}), (v = o.belowZeroLine) == null || v.update({
|
|
760
760
|
hidden: !0
|
|
761
|
-
}), o.mainLineArea.update({ hidden: !0 }),
|
|
762
|
-
},
|
|
761
|
+
}), o.mainLineArea.update({ hidden: !0 }), cn(o, d), o.mainLine.className("add", "_selected-muted");
|
|
762
|
+
}, ni = (i) => {
|
|
763
763
|
var e;
|
|
764
764
|
const { elements: t } = i;
|
|
765
765
|
t.rangeLine.update({ hidden: !0 }), t.rangeLineArea.update({ hidden: !0 }), t.rangeBorderLeft.update({ hidden: !0 }), t.rangeBorderRight.update({ hidden: !0 }), t.rangeCircleLeft.update({ hidden: !0 }), t.rangeCircleRight.update({ hidden: !0 }), t.rangeTooltip.update({ hidden: !0 }), t.mainLine.className("remove", "_selected-muted"), t.mainLineArea.update({ hidden: !1 }), (e = t.belowZeroLine) == null || e.update({ hidden: !1 });
|
|
766
|
-
},
|
|
766
|
+
}, dn = (i) => {
|
|
767
767
|
const { svg: t, data: e, x: s, config: n, width: a, height: r } = i, { margin: o, hover: c, selection: h } = n;
|
|
768
768
|
let d = null, g = !1;
|
|
769
769
|
i.onGridCircleHoverRef && (i.onGridCircleHoverRef.current = (v) => {
|
|
770
|
-
c.enable && (i.action = "hover",
|
|
770
|
+
c.enable && (i.action = "hover", ye(i, v));
|
|
771
771
|
});
|
|
772
772
|
const _ = (v) => e.reduce(
|
|
773
773
|
(b, w) => Math.abs(s(b.date) - v) < Math.abs(s(w.date) - v) ? b : w
|
|
774
774
|
);
|
|
775
775
|
t.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) {
|
|
776
776
|
const [b] = k.pointer(v, this), w = _(b);
|
|
777
|
-
!g && c.enable ? (i.action = "hover",
|
|
777
|
+
!g && c.enable ? (i.action = "hover", ye(i, w)) : (i.action = g ? "selection" : "none", Me(i)), d && h.enable && (i.action = "selection", hn(i, d, w));
|
|
778
778
|
}).on("mouseleave", () => {
|
|
779
|
-
i.action = "none", g = !1, d = null,
|
|
779
|
+
i.action = "none", g = !1, d = null, Me(i), ni(i);
|
|
780
780
|
}).on("mousedown", function(v) {
|
|
781
781
|
if (h.enable) {
|
|
782
782
|
g = !0, i.action = "selection";
|
|
@@ -785,15 +785,15 @@ const Js = (i) => {
|
|
|
785
785
|
}
|
|
786
786
|
}).on("mouseup", function(v) {
|
|
787
787
|
const [b] = k.pointer(v, this), w = _(b);
|
|
788
|
-
g = !1, d = null, i.action = "hover", h.enable &&
|
|
788
|
+
g = !1, d = null, i.action = "hover", h.enable && ni(i), c.enable && ye(i, w);
|
|
789
789
|
});
|
|
790
|
-
},
|
|
790
|
+
}, un = (i, t, e) => {
|
|
791
791
|
const { margin: s } = t, n = k.scaleTime(), a = k.extent(i, (r) => new Date(r.date));
|
|
792
792
|
return a[0] == null || a[1] == null ? n : n.domain([a[0], a[1]]).range([s.left, e - s.right]);
|
|
793
|
-
},
|
|
793
|
+
}, fn = (i, t, e) => {
|
|
794
794
|
const { margin: s } = t, n = k.max(i, (r) => r.value) ?? 0, a = k.min(i, (r) => r.value) ?? 0;
|
|
795
795
|
return k.scaleLinear().domain([a, n]).range([e - s.bottom, s.top]);
|
|
796
|
-
},
|
|
796
|
+
}, br = (i, t) => {
|
|
797
797
|
const e = k.select(i);
|
|
798
798
|
if (e.empty())
|
|
799
799
|
return console.error(`Element with selector ${i} not found!`), null;
|
|
@@ -801,16 +801,20 @@ const Js = (i) => {
|
|
|
801
801
|
return console.error(`chartId is required and must be a valid id
|
|
802
802
|
(only letters, numbers or underscores. The first character must be a letter)`), null;
|
|
803
803
|
const s = e.append("div"), n = s.append("svg"), a = e.node();
|
|
804
|
-
let r = a.clientWidth, o = a.clientHeight, c =
|
|
804
|
+
let r = a.clientWidth, o = a.clientHeight, c = ei({ ...tn }, t.config), h = t.data;
|
|
805
805
|
const d = () => {
|
|
806
806
|
r = a.clientWidth, o = a.clientHeight, g({ data: h, config: c });
|
|
807
807
|
};
|
|
808
808
|
t.disabledResize || window.addEventListener("resize", d);
|
|
809
809
|
const g = (_, m = !1) => {
|
|
810
|
-
m && _.config && (c =
|
|
811
|
-
const v = h.map((
|
|
810
|
+
m && _.config && (c = ei(c, _.config)), m && _.data && (h = _.data);
|
|
811
|
+
const v = h.map((M) => ({ date: new Date(M.date), value: M.value })).sort((M, D) => M.date.getTime() - D.date.getTime()), b = un(v, c, r), w = fn(v, c, o);
|
|
812
812
|
s.attr("class", `sc-charts sc-charts__${c.theme}`), n.attr("preserveAspectRatio", "xMinYMin meet").attr("viewBox", `0 0 ${r} ${o}`).style("width", "100%").style("height", "100%").selectAll("*").remove();
|
|
813
|
-
const x =
|
|
813
|
+
const x = s.node(), y = n.node();
|
|
814
|
+
Array.from(x.children).forEach((M) => {
|
|
815
|
+
M !== y && M.remove();
|
|
816
|
+
});
|
|
817
|
+
const C = {
|
|
814
818
|
chartId: t.chartId,
|
|
815
819
|
svg: n,
|
|
816
820
|
wrapperNode: s.node(),
|
|
@@ -824,12 +828,12 @@ const Js = (i) => {
|
|
|
824
828
|
gridHoverTooltip: null,
|
|
825
829
|
onGridCircleHoverRef: { current: null }
|
|
826
830
|
};
|
|
827
|
-
|
|
828
|
-
const
|
|
829
|
-
...
|
|
830
|
-
elements:
|
|
831
|
+
Ys(C);
|
|
832
|
+
const A = {
|
|
833
|
+
...C,
|
|
834
|
+
elements: on(C)
|
|
831
835
|
};
|
|
832
|
-
|
|
836
|
+
dn(A);
|
|
833
837
|
};
|
|
834
838
|
return g(t), {
|
|
835
839
|
update: (_) => g(_, !0),
|
|
@@ -839,17 +843,17 @@ const Js = (i) => {
|
|
|
839
843
|
};
|
|
840
844
|
};
|
|
841
845
|
var Gt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
842
|
-
function
|
|
846
|
+
function gn(i) {
|
|
843
847
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
844
848
|
}
|
|
845
849
|
var Dt = { exports: {} };
|
|
846
850
|
Dt.exports;
|
|
847
|
-
var
|
|
848
|
-
function
|
|
849
|
-
return
|
|
850
|
-
var e = 200, s = "__lodash_hash_undefined__", n = 800, a = 16, r = 9007199254740991, o = "[object Arguments]", c = "[object Array]", h = "[object AsyncFunction]", d = "[object Boolean]", g = "[object Date]", _ = "[object Error]", m = "[object Function]", v = "[object GeneratorFunction]", b = "[object Map]", w = "[object Number]", x = "[object Null]", y = "[object Object]", C = "[object Proxy]",
|
|
851
|
-
F[K] = F[O] = F[V] = F[P] = F[ot] = F[
|
|
852
|
-
var Rt = typeof Gt == "object" && Gt && Gt.Object === Object && Gt,
|
|
851
|
+
var ai;
|
|
852
|
+
function mn() {
|
|
853
|
+
return ai || (ai = 1, function(i, t) {
|
|
854
|
+
var e = 200, s = "__lodash_hash_undefined__", n = 800, a = 16, r = 9007199254740991, o = "[object Arguments]", c = "[object Array]", h = "[object AsyncFunction]", d = "[object Boolean]", g = "[object Date]", _ = "[object Error]", m = "[object Function]", v = "[object GeneratorFunction]", b = "[object Map]", w = "[object Number]", x = "[object Null]", y = "[object Object]", C = "[object Proxy]", A = "[object RegExp]", M = "[object Set]", D = "[object String]", I = "[object Undefined]", W = "[object WeakMap]", Z = "[object ArrayBuffer]", et = "[object DataView]", K = "[object Float32Array]", O = "[object Float64Array]", V = "[object Int8Array]", P = "[object Int16Array]", ot = "[object Int32Array]", se = "[object Uint8Array]", lt = "[object Uint8ClampedArray]", bt = "[object Uint16Array]", yt = "[object Uint32Array]", Ht = /[\\^$.*+?()[\]{}|]/g, It = /^\[object .+?Constructor\]$/, Bt = /^(?:0|[1-9]\d*)$/, F = {};
|
|
855
|
+
F[K] = F[O] = F[V] = F[P] = F[ot] = F[se] = F[lt] = F[bt] = F[yt] = !0, F[o] = F[c] = F[Z] = F[d] = F[et] = F[g] = F[_] = F[m] = F[b] = F[w] = F[y] = F[A] = F[M] = F[D] = F[W] = !1;
|
|
856
|
+
var Rt = typeof Gt == "object" && Gt && Gt.Object === Object && Gt, ne = typeof self == "object" && self && self.Object === Object && self, z = Rt || ne || Function("return this")(), tt = t && !t.nodeType && t, Y = tt && !0 && i && !i.nodeType && i, j = Y && Y.exports === tt, mt = j && Rt.process, wt = function() {
|
|
853
857
|
try {
|
|
854
858
|
var l = Y && Y.require && Y.require("util").types;
|
|
855
859
|
return l || mt && mt.binding && mt.binding("util");
|
|
@@ -882,32 +886,32 @@ function fn() {
|
|
|
882
886
|
function ht(l, u) {
|
|
883
887
|
return l == null ? void 0 : l[u];
|
|
884
888
|
}
|
|
885
|
-
function
|
|
889
|
+
function ae(l, u) {
|
|
886
890
|
return function(p) {
|
|
887
891
|
return l(u(p));
|
|
888
892
|
};
|
|
889
893
|
}
|
|
890
|
-
var Ct = Array.prototype,
|
|
891
|
-
var l = /[^.]+$/.exec(
|
|
894
|
+
var Ct = Array.prototype, Ai = Function.prototype, Pt = Object.prototype, re = z["__core-js_shared__"], zt = Ai.toString, at = Pt.hasOwnProperty, Be = function() {
|
|
895
|
+
var l = /[^.]+$/.exec(re && re.keys && re.keys.IE_PROTO || "");
|
|
892
896
|
return l ? "Symbol(src)_1." + l : "";
|
|
893
|
-
}(),
|
|
897
|
+
}(), Re = Pt.toString, Di = zt.call(Object), Ei = RegExp(
|
|
894
898
|
"^" + zt.call(at).replace(Ht, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
895
|
-
), Vt = j ? z.Buffer : void 0,
|
|
899
|
+
), Vt = j ? z.Buffer : void 0, $e = z.Symbol, Oe = z.Uint8Array;
|
|
896
900
|
Vt && Vt.allocUnsafe;
|
|
897
|
-
var
|
|
901
|
+
var Pe = ae(Object.getPrototypeOf, Object), ze = Object.create, Li = Pt.propertyIsEnumerable, ki = Ct.splice, dt = $e ? $e.toStringTag : void 0, Wt = function() {
|
|
898
902
|
try {
|
|
899
|
-
var l =
|
|
903
|
+
var l = ce(Object, "defineProperty");
|
|
900
904
|
return l({}, "", {}), l;
|
|
901
905
|
} catch {
|
|
902
906
|
}
|
|
903
|
-
}(),
|
|
907
|
+
}(), Ni = Vt ? Vt.isBuffer : void 0, Ve = Math.max, Fi = Date.now, We = ce(z, "Map"), Tt = ce(Object, "create"), Hi = /* @__PURE__ */ function() {
|
|
904
908
|
function l() {
|
|
905
909
|
}
|
|
906
910
|
return function(u) {
|
|
907
911
|
if (!ft(u))
|
|
908
912
|
return {};
|
|
909
|
-
if (
|
|
910
|
-
return
|
|
913
|
+
if (ze)
|
|
914
|
+
return ze(u);
|
|
911
915
|
l.prototype = u;
|
|
912
916
|
var p = new l();
|
|
913
917
|
return l.prototype = void 0, p;
|
|
@@ -920,14 +924,14 @@ function fn() {
|
|
|
920
924
|
this.set(T[0], T[1]);
|
|
921
925
|
}
|
|
922
926
|
}
|
|
923
|
-
function
|
|
927
|
+
function Ii() {
|
|
924
928
|
this.__data__ = Tt ? Tt(null) : {}, this.size = 0;
|
|
925
929
|
}
|
|
926
|
-
function
|
|
930
|
+
function Bi(l) {
|
|
927
931
|
var u = this.has(l) && delete this.__data__[l];
|
|
928
932
|
return this.size -= u ? 1 : 0, u;
|
|
929
933
|
}
|
|
930
|
-
function
|
|
934
|
+
function Ri(l) {
|
|
931
935
|
var u = this.__data__;
|
|
932
936
|
if (Tt) {
|
|
933
937
|
var p = u[l];
|
|
@@ -935,15 +939,15 @@ function fn() {
|
|
|
935
939
|
}
|
|
936
940
|
return at.call(u, l) ? u[l] : void 0;
|
|
937
941
|
}
|
|
938
|
-
function
|
|
942
|
+
function $i(l) {
|
|
939
943
|
var u = this.__data__;
|
|
940
944
|
return Tt ? u[l] !== void 0 : at.call(u, l);
|
|
941
945
|
}
|
|
942
|
-
function
|
|
946
|
+
function Oi(l, u) {
|
|
943
947
|
var p = this.__data__;
|
|
944
948
|
return this.size += this.has(l) ? 0 : 1, p[l] = Tt && u === void 0 ? s : u, this;
|
|
945
949
|
}
|
|
946
|
-
ut.prototype.clear =
|
|
950
|
+
ut.prototype.clear = Ii, ut.prototype.delete = Bi, ut.prototype.get = Ri, ut.prototype.has = $i, ut.prototype.set = Oi;
|
|
947
951
|
function it(l) {
|
|
948
952
|
var u = -1, p = l == null ? 0 : l.length;
|
|
949
953
|
for (this.clear(); ++u < p; ) {
|
|
@@ -951,28 +955,28 @@ function fn() {
|
|
|
951
955
|
this.set(T[0], T[1]);
|
|
952
956
|
}
|
|
953
957
|
}
|
|
954
|
-
function
|
|
958
|
+
function Pi() {
|
|
955
959
|
this.__data__ = [], this.size = 0;
|
|
956
960
|
}
|
|
957
|
-
function
|
|
961
|
+
function zi(l) {
|
|
958
962
|
var u = this.__data__, p = Yt(u, l);
|
|
959
963
|
if (p < 0)
|
|
960
964
|
return !1;
|
|
961
965
|
var T = u.length - 1;
|
|
962
|
-
return p == T ? u.pop() :
|
|
966
|
+
return p == T ? u.pop() : ki.call(u, p, 1), --this.size, !0;
|
|
963
967
|
}
|
|
964
|
-
function
|
|
968
|
+
function Vi(l) {
|
|
965
969
|
var u = this.__data__, p = Yt(u, l);
|
|
966
970
|
return p < 0 ? void 0 : u[p][1];
|
|
967
971
|
}
|
|
968
|
-
function
|
|
972
|
+
function Wi(l) {
|
|
969
973
|
return Yt(this.__data__, l) > -1;
|
|
970
974
|
}
|
|
971
|
-
function
|
|
975
|
+
function Yi(l, u) {
|
|
972
976
|
var p = this.__data__, T = Yt(p, l);
|
|
973
977
|
return T < 0 ? (++this.size, p.push([l, u])) : p[T][1] = u, this;
|
|
974
978
|
}
|
|
975
|
-
it.prototype.clear =
|
|
979
|
+
it.prototype.clear = Pi, it.prototype.delete = zi, it.prototype.get = Vi, it.prototype.has = Wi, it.prototype.set = Yi;
|
|
976
980
|
function _t(l) {
|
|
977
981
|
var u = -1, p = l == null ? 0 : l.length;
|
|
978
982
|
for (this.clear(); ++u < p; ) {
|
|
@@ -980,72 +984,72 @@ function fn() {
|
|
|
980
984
|
this.set(T[0], T[1]);
|
|
981
985
|
}
|
|
982
986
|
}
|
|
983
|
-
function
|
|
987
|
+
function ji() {
|
|
984
988
|
this.size = 0, this.__data__ = {
|
|
985
989
|
hash: new ut(),
|
|
986
|
-
map: new (
|
|
990
|
+
map: new (We || it)(),
|
|
987
991
|
string: new ut()
|
|
988
992
|
};
|
|
989
993
|
}
|
|
990
|
-
function
|
|
994
|
+
function Xi(l) {
|
|
991
995
|
var u = Xt(this, l).delete(l);
|
|
992
996
|
return this.size -= u ? 1 : 0, u;
|
|
993
997
|
}
|
|
994
|
-
function
|
|
998
|
+
function Ui(l) {
|
|
995
999
|
return Xt(this, l).get(l);
|
|
996
1000
|
}
|
|
997
|
-
function
|
|
1001
|
+
function Gi(l) {
|
|
998
1002
|
return Xt(this, l).has(l);
|
|
999
1003
|
}
|
|
1000
|
-
function
|
|
1004
|
+
function Zi(l, u) {
|
|
1001
1005
|
var p = Xt(this, l), T = p.size;
|
|
1002
1006
|
return p.set(l, u), this.size += p.size == T ? 0 : 1, this;
|
|
1003
1007
|
}
|
|
1004
|
-
_t.prototype.clear =
|
|
1008
|
+
_t.prototype.clear = ji, _t.prototype.delete = Xi, _t.prototype.get = Ui, _t.prototype.has = Gi, _t.prototype.set = Zi;
|
|
1005
1009
|
function pt(l) {
|
|
1006
1010
|
var u = this.__data__ = new it(l);
|
|
1007
1011
|
this.size = u.size;
|
|
1008
1012
|
}
|
|
1009
|
-
function
|
|
1013
|
+
function qi() {
|
|
1010
1014
|
this.__data__ = new it(), this.size = 0;
|
|
1011
1015
|
}
|
|
1012
|
-
function
|
|
1016
|
+
function Ji(l) {
|
|
1013
1017
|
var u = this.__data__, p = u.delete(l);
|
|
1014
1018
|
return this.size = u.size, p;
|
|
1015
1019
|
}
|
|
1016
|
-
function
|
|
1020
|
+
function Qi(l) {
|
|
1017
1021
|
return this.__data__.get(l);
|
|
1018
1022
|
}
|
|
1019
|
-
function
|
|
1023
|
+
function Ki(l) {
|
|
1020
1024
|
return this.__data__.has(l);
|
|
1021
1025
|
}
|
|
1022
|
-
function
|
|
1026
|
+
function ts(l, u) {
|
|
1023
1027
|
var p = this.__data__;
|
|
1024
1028
|
if (p instanceof it) {
|
|
1025
1029
|
var T = p.__data__;
|
|
1026
|
-
if (!
|
|
1030
|
+
if (!We || T.length < e - 1)
|
|
1027
1031
|
return T.push([l, u]), this.size = ++p.size, this;
|
|
1028
1032
|
p = this.__data__ = new _t(T);
|
|
1029
1033
|
}
|
|
1030
1034
|
return p.set(l, u), this.size = p.size, this;
|
|
1031
1035
|
}
|
|
1032
|
-
pt.prototype.clear =
|
|
1033
|
-
function
|
|
1034
|
-
var p =
|
|
1036
|
+
pt.prototype.clear = qi, pt.prototype.delete = Ji, pt.prototype.get = Qi, pt.prototype.has = Ki, pt.prototype.set = ts;
|
|
1037
|
+
function es(l, u) {
|
|
1038
|
+
var p = ue(l), T = !p && de(l), E = !p && !T && Ge(l), H = !p && !T && !E && qe(l), B = p || T || E || H, N = B ? Ot(l.length, String) : [], R = N.length;
|
|
1035
1039
|
for (var q in l)
|
|
1036
1040
|
B && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1037
1041
|
(q == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1038
|
-
|
|
1042
|
+
E && (q == "offset" || q == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1039
1043
|
H && (q == "buffer" || q == "byteLength" || q == "byteOffset") || // Skip index properties.
|
|
1040
|
-
|
|
1044
|
+
Xe(q, R)) || N.push(q);
|
|
1041
1045
|
return N;
|
|
1042
1046
|
}
|
|
1043
|
-
function
|
|
1044
|
-
(p !== void 0 && !Ut(l[u], p) || p === void 0 && !(u in l)) &&
|
|
1047
|
+
function oe(l, u, p) {
|
|
1048
|
+
(p !== void 0 && !Ut(l[u], p) || p === void 0 && !(u in l)) && le(l, u, p);
|
|
1045
1049
|
}
|
|
1046
|
-
function
|
|
1050
|
+
function is(l, u, p) {
|
|
1047
1051
|
var T = l[u];
|
|
1048
|
-
(!(at.call(l, u) && Ut(T, p)) || p === void 0 && !(u in l)) &&
|
|
1052
|
+
(!(at.call(l, u) && Ut(T, p)) || p === void 0 && !(u in l)) && le(l, u, p);
|
|
1049
1053
|
}
|
|
1050
1054
|
function Yt(l, u) {
|
|
1051
1055
|
for (var p = l.length; p--; )
|
|
@@ -1053,7 +1057,7 @@ function fn() {
|
|
|
1053
1057
|
return p;
|
|
1054
1058
|
return -1;
|
|
1055
1059
|
}
|
|
1056
|
-
function
|
|
1060
|
+
function le(l, u, p) {
|
|
1057
1061
|
u == "__proto__" && Wt ? Wt(l, u, {
|
|
1058
1062
|
configurable: !0,
|
|
1059
1063
|
enumerable: !0,
|
|
@@ -1061,104 +1065,104 @@ function fn() {
|
|
|
1061
1065
|
writable: !0
|
|
1062
1066
|
}) : l[u] = p;
|
|
1063
1067
|
}
|
|
1064
|
-
var
|
|
1068
|
+
var ss = _s();
|
|
1065
1069
|
function jt(l) {
|
|
1066
|
-
return l == null ? l === void 0 ? I : x : dt && dt in Object(l) ?
|
|
1070
|
+
return l == null ? l === void 0 ? I : x : dt && dt in Object(l) ? ps(l) : Cs(l);
|
|
1067
1071
|
}
|
|
1068
|
-
function
|
|
1072
|
+
function Ye(l) {
|
|
1069
1073
|
return St(l) && jt(l) == o;
|
|
1070
1074
|
}
|
|
1071
|
-
function
|
|
1072
|
-
if (!ft(l) ||
|
|
1075
|
+
function ns(l) {
|
|
1076
|
+
if (!ft(l) || ws(l))
|
|
1073
1077
|
return !1;
|
|
1074
|
-
var u =
|
|
1075
|
-
return u.test(
|
|
1078
|
+
var u = ge(l) ? Ei : It;
|
|
1079
|
+
return u.test(As(l));
|
|
1076
1080
|
}
|
|
1077
|
-
function
|
|
1078
|
-
return St(l) &&
|
|
1081
|
+
function as(l) {
|
|
1082
|
+
return St(l) && Ze(l.length) && !!F[jt(l)];
|
|
1079
1083
|
}
|
|
1080
|
-
function
|
|
1084
|
+
function rs(l) {
|
|
1081
1085
|
if (!ft(l))
|
|
1082
|
-
return
|
|
1083
|
-
var u =
|
|
1086
|
+
return xs(l);
|
|
1087
|
+
var u = Ue(l), p = [];
|
|
1084
1088
|
for (var T in l)
|
|
1085
1089
|
T == "constructor" && (u || !at.call(l, T)) || p.push(T);
|
|
1086
1090
|
return p;
|
|
1087
1091
|
}
|
|
1088
|
-
function
|
|
1089
|
-
l !== u &&
|
|
1090
|
-
if (
|
|
1091
|
-
|
|
1092
|
+
function je(l, u, p, T, E) {
|
|
1093
|
+
l !== u && ss(u, function(H, B) {
|
|
1094
|
+
if (E || (E = new pt()), ft(H))
|
|
1095
|
+
os(l, u, B, p, je, T, E);
|
|
1092
1096
|
else {
|
|
1093
|
-
var N = T ? T(
|
|
1094
|
-
N === void 0 && (N = H),
|
|
1097
|
+
var N = T ? T(he(l, B), H, B + "", l, u, E) : void 0;
|
|
1098
|
+
N === void 0 && (N = H), oe(l, B, N);
|
|
1095
1099
|
}
|
|
1096
|
-
},
|
|
1100
|
+
}, Je);
|
|
1097
1101
|
}
|
|
1098
|
-
function
|
|
1099
|
-
var N =
|
|
1102
|
+
function os(l, u, p, T, E, H, B) {
|
|
1103
|
+
var N = he(l, p), R = he(u, p), q = B.get(R);
|
|
1100
1104
|
if (q) {
|
|
1101
|
-
|
|
1105
|
+
oe(l, p, q);
|
|
1102
1106
|
return;
|
|
1103
1107
|
}
|
|
1104
1108
|
var X = H ? H(N, R, p + "", l, u, B) : void 0, Mt = X === void 0;
|
|
1105
1109
|
if (Mt) {
|
|
1106
|
-
var
|
|
1107
|
-
X = R,
|
|
1110
|
+
var me = ue(R), _e = !me && Ge(R), Ke = !me && !_e && qe(R);
|
|
1111
|
+
X = R, me || _e || Ke ? ue(N) ? X = N : Ds(N) ? X = fs(N) : _e ? (Mt = !1, X = hs(R)) : Ke ? (Mt = !1, X = us(R)) : X = [] : Es(R) || de(R) ? (X = N, de(N) ? X = Ls(N) : (!ft(N) || ge(N)) && (X = vs(R))) : Mt = !1;
|
|
1108
1112
|
}
|
|
1109
|
-
Mt && (B.set(R, X),
|
|
1113
|
+
Mt && (B.set(R, X), E(X, R, T, H, B), B.delete(R)), oe(l, p, X);
|
|
1110
1114
|
}
|
|
1111
|
-
function
|
|
1112
|
-
return
|
|
1115
|
+
function ls(l, u) {
|
|
1116
|
+
return Ss(Ts(l, u, Qe), l + "");
|
|
1113
1117
|
}
|
|
1114
|
-
var
|
|
1118
|
+
var cs = Wt ? function(l, u) {
|
|
1115
1119
|
return Wt(l, "toString", {
|
|
1116
1120
|
configurable: !0,
|
|
1117
1121
|
enumerable: !1,
|
|
1118
|
-
value:
|
|
1122
|
+
value: Ns(u),
|
|
1119
1123
|
writable: !0
|
|
1120
1124
|
});
|
|
1121
|
-
} :
|
|
1122
|
-
function
|
|
1125
|
+
} : Qe;
|
|
1126
|
+
function hs(l, u) {
|
|
1123
1127
|
return l.slice();
|
|
1124
1128
|
}
|
|
1125
|
-
function
|
|
1129
|
+
function ds(l) {
|
|
1126
1130
|
var u = new l.constructor(l.byteLength);
|
|
1127
|
-
return new
|
|
1131
|
+
return new Oe(u).set(new Oe(l)), u;
|
|
1128
1132
|
}
|
|
1129
|
-
function
|
|
1130
|
-
var p =
|
|
1133
|
+
function us(l, u) {
|
|
1134
|
+
var p = ds(l.buffer);
|
|
1131
1135
|
return new l.constructor(p, l.byteOffset, l.length);
|
|
1132
1136
|
}
|
|
1133
|
-
function
|
|
1137
|
+
function fs(l, u) {
|
|
1134
1138
|
var p = -1, T = l.length;
|
|
1135
1139
|
for (u || (u = Array(T)); ++p < T; )
|
|
1136
1140
|
u[p] = l[p];
|
|
1137
1141
|
return u;
|
|
1138
1142
|
}
|
|
1139
|
-
function
|
|
1140
|
-
var
|
|
1143
|
+
function gs(l, u, p, T) {
|
|
1144
|
+
var E = !p;
|
|
1141
1145
|
p || (p = {});
|
|
1142
1146
|
for (var H = -1, B = u.length; ++H < B; ) {
|
|
1143
1147
|
var N = u[H], R = void 0;
|
|
1144
|
-
R === void 0 && (R = l[N]),
|
|
1148
|
+
R === void 0 && (R = l[N]), E ? le(p, N, R) : is(p, N, R);
|
|
1145
1149
|
}
|
|
1146
1150
|
return p;
|
|
1147
1151
|
}
|
|
1148
|
-
function
|
|
1149
|
-
return
|
|
1150
|
-
var T = -1,
|
|
1151
|
-
for (H = l.length > 3 && typeof H == "function" ? (
|
|
1152
|
+
function ms(l) {
|
|
1153
|
+
return ls(function(u, p) {
|
|
1154
|
+
var T = -1, E = p.length, H = E > 1 ? p[E - 1] : void 0, B = E > 2 ? p[2] : void 0;
|
|
1155
|
+
for (H = l.length > 3 && typeof H == "function" ? (E--, H) : void 0, B && bs(p[0], p[1], B) && (H = E < 3 ? void 0 : H, E = 1), u = Object(u); ++T < E; ) {
|
|
1152
1156
|
var N = p[T];
|
|
1153
1157
|
N && l(u, N, T, H);
|
|
1154
1158
|
}
|
|
1155
1159
|
return u;
|
|
1156
1160
|
});
|
|
1157
1161
|
}
|
|
1158
|
-
function
|
|
1162
|
+
function _s(l) {
|
|
1159
1163
|
return function(u, p, T) {
|
|
1160
|
-
for (var
|
|
1161
|
-
var R = B[++
|
|
1164
|
+
for (var E = -1, H = Object(u), B = T(u), N = B.length; N--; ) {
|
|
1165
|
+
var R = B[++E];
|
|
1162
1166
|
if (p(H[R], R, H) === !1)
|
|
1163
1167
|
break;
|
|
1164
1168
|
}
|
|
@@ -1167,76 +1171,76 @@ function fn() {
|
|
|
1167
1171
|
}
|
|
1168
1172
|
function Xt(l, u) {
|
|
1169
1173
|
var p = l.__data__;
|
|
1170
|
-
return
|
|
1174
|
+
return ys(u) ? p[typeof u == "string" ? "string" : "hash"] : p.map;
|
|
1171
1175
|
}
|
|
1172
|
-
function
|
|
1176
|
+
function ce(l, u) {
|
|
1173
1177
|
var p = ht(l, u);
|
|
1174
|
-
return
|
|
1178
|
+
return ns(p) ? p : void 0;
|
|
1175
1179
|
}
|
|
1176
|
-
function
|
|
1180
|
+
function ps(l) {
|
|
1177
1181
|
var u = at.call(l, dt), p = l[dt];
|
|
1178
1182
|
try {
|
|
1179
1183
|
l[dt] = void 0;
|
|
1180
1184
|
var T = !0;
|
|
1181
1185
|
} catch {
|
|
1182
1186
|
}
|
|
1183
|
-
var
|
|
1184
|
-
return T && (u ? l[dt] = p : delete l[dt]),
|
|
1187
|
+
var E = Re.call(l);
|
|
1188
|
+
return T && (u ? l[dt] = p : delete l[dt]), E;
|
|
1185
1189
|
}
|
|
1186
|
-
function
|
|
1187
|
-
return typeof l.constructor == "function" && !
|
|
1190
|
+
function vs(l) {
|
|
1191
|
+
return typeof l.constructor == "function" && !Ue(l) ? Hi(Pe(l)) : {};
|
|
1188
1192
|
}
|
|
1189
|
-
function
|
|
1193
|
+
function Xe(l, u) {
|
|
1190
1194
|
var p = typeof l;
|
|
1191
1195
|
return u = u ?? r, !!u && (p == "number" || p != "symbol" && Bt.test(l)) && l > -1 && l % 1 == 0 && l < u;
|
|
1192
1196
|
}
|
|
1193
|
-
function
|
|
1197
|
+
function bs(l, u, p) {
|
|
1194
1198
|
if (!ft(p))
|
|
1195
1199
|
return !1;
|
|
1196
1200
|
var T = typeof u;
|
|
1197
|
-
return (T == "number" ?
|
|
1201
|
+
return (T == "number" ? fe(p) && Xe(u, p.length) : T == "string" && u in p) ? Ut(p[u], l) : !1;
|
|
1198
1202
|
}
|
|
1199
|
-
function
|
|
1203
|
+
function ys(l) {
|
|
1200
1204
|
var u = typeof l;
|
|
1201
1205
|
return u == "string" || u == "number" || u == "symbol" || u == "boolean" ? l !== "__proto__" : l === null;
|
|
1202
1206
|
}
|
|
1203
|
-
function
|
|
1204
|
-
return !!
|
|
1207
|
+
function ws(l) {
|
|
1208
|
+
return !!Be && Be in l;
|
|
1205
1209
|
}
|
|
1206
|
-
function
|
|
1210
|
+
function Ue(l) {
|
|
1207
1211
|
var u = l && l.constructor, p = typeof u == "function" && u.prototype || Pt;
|
|
1208
1212
|
return l === p;
|
|
1209
1213
|
}
|
|
1210
|
-
function
|
|
1214
|
+
function xs(l) {
|
|
1211
1215
|
var u = [];
|
|
1212
1216
|
if (l != null)
|
|
1213
1217
|
for (var p in Object(l))
|
|
1214
1218
|
u.push(p);
|
|
1215
1219
|
return u;
|
|
1216
1220
|
}
|
|
1217
|
-
function
|
|
1218
|
-
return
|
|
1219
|
-
}
|
|
1220
|
-
function
|
|
1221
|
-
return u =
|
|
1222
|
-
for (var T = arguments,
|
|
1223
|
-
B[
|
|
1224
|
-
|
|
1225
|
-
for (var N = Array(u + 1); ++
|
|
1226
|
-
N[
|
|
1221
|
+
function Cs(l) {
|
|
1222
|
+
return Re.call(l);
|
|
1223
|
+
}
|
|
1224
|
+
function Ts(l, u, p) {
|
|
1225
|
+
return u = Ve(u === void 0 ? l.length - 1 : u, 0), function() {
|
|
1226
|
+
for (var T = arguments, E = -1, H = Ve(T.length - u, 0), B = Array(H); ++E < H; )
|
|
1227
|
+
B[E] = T[u + E];
|
|
1228
|
+
E = -1;
|
|
1229
|
+
for (var N = Array(u + 1); ++E < u; )
|
|
1230
|
+
N[E] = T[E];
|
|
1227
1231
|
return N[u] = p(B), $t(l, this, N);
|
|
1228
1232
|
};
|
|
1229
1233
|
}
|
|
1230
|
-
function
|
|
1234
|
+
function he(l, u) {
|
|
1231
1235
|
if (!(u === "constructor" && typeof l[u] == "function") && u != "__proto__")
|
|
1232
1236
|
return l[u];
|
|
1233
1237
|
}
|
|
1234
|
-
var
|
|
1235
|
-
function
|
|
1238
|
+
var Ss = Ms(cs);
|
|
1239
|
+
function Ms(l) {
|
|
1236
1240
|
var u = 0, p = 0;
|
|
1237
1241
|
return function() {
|
|
1238
|
-
var T =
|
|
1239
|
-
if (p = T,
|
|
1242
|
+
var T = Fi(), E = a - (T - p);
|
|
1243
|
+
if (p = T, E > 0) {
|
|
1240
1244
|
if (++u >= n)
|
|
1241
1245
|
return arguments[0];
|
|
1242
1246
|
} else
|
|
@@ -1244,7 +1248,7 @@ function fn() {
|
|
|
1244
1248
|
return l.apply(void 0, arguments);
|
|
1245
1249
|
};
|
|
1246
1250
|
}
|
|
1247
|
-
function
|
|
1251
|
+
function As(l) {
|
|
1248
1252
|
if (l != null) {
|
|
1249
1253
|
try {
|
|
1250
1254
|
return zt.call(l);
|
|
@@ -1260,25 +1264,25 @@ function fn() {
|
|
|
1260
1264
|
function Ut(l, u) {
|
|
1261
1265
|
return l === u || l !== l && u !== u;
|
|
1262
1266
|
}
|
|
1263
|
-
var
|
|
1267
|
+
var de = Ye(/* @__PURE__ */ function() {
|
|
1264
1268
|
return arguments;
|
|
1265
|
-
}()) ?
|
|
1266
|
-
return St(l) && at.call(l, "callee") && !
|
|
1267
|
-
},
|
|
1268
|
-
function
|
|
1269
|
-
return l != null &&
|
|
1269
|
+
}()) ? Ye : function(l) {
|
|
1270
|
+
return St(l) && at.call(l, "callee") && !Li.call(l, "callee");
|
|
1271
|
+
}, ue = Array.isArray;
|
|
1272
|
+
function fe(l) {
|
|
1273
|
+
return l != null && Ze(l.length) && !ge(l);
|
|
1270
1274
|
}
|
|
1271
|
-
function
|
|
1272
|
-
return St(l) &&
|
|
1275
|
+
function Ds(l) {
|
|
1276
|
+
return St(l) && fe(l);
|
|
1273
1277
|
}
|
|
1274
|
-
var
|
|
1275
|
-
function
|
|
1278
|
+
var Ge = Ni || Fs;
|
|
1279
|
+
function ge(l) {
|
|
1276
1280
|
if (!ft(l))
|
|
1277
1281
|
return !1;
|
|
1278
1282
|
var u = jt(l);
|
|
1279
1283
|
return u == m || u == v || u == h || u == C;
|
|
1280
1284
|
}
|
|
1281
|
-
function
|
|
1285
|
+
function Ze(l) {
|
|
1282
1286
|
return typeof l == "number" && l > -1 && l % 1 == 0 && l <= r;
|
|
1283
1287
|
}
|
|
1284
1288
|
function ft(l) {
|
|
@@ -1288,47 +1292,47 @@ function fn() {
|
|
|
1288
1292
|
function St(l) {
|
|
1289
1293
|
return l != null && typeof l == "object";
|
|
1290
1294
|
}
|
|
1291
|
-
function
|
|
1295
|
+
function Es(l) {
|
|
1292
1296
|
if (!St(l) || jt(l) != y)
|
|
1293
1297
|
return !1;
|
|
1294
|
-
var u =
|
|
1298
|
+
var u = Pe(l);
|
|
1295
1299
|
if (u === null)
|
|
1296
1300
|
return !0;
|
|
1297
1301
|
var p = at.call(u, "constructor") && u.constructor;
|
|
1298
|
-
return typeof p == "function" && p instanceof p && zt.call(p) ==
|
|
1302
|
+
return typeof p == "function" && p instanceof p && zt.call(p) == Di;
|
|
1299
1303
|
}
|
|
1300
|
-
var
|
|
1301
|
-
function
|
|
1302
|
-
return
|
|
1304
|
+
var qe = xt ? ct(xt) : as;
|
|
1305
|
+
function Ls(l) {
|
|
1306
|
+
return gs(l, Je(l));
|
|
1303
1307
|
}
|
|
1304
|
-
function
|
|
1305
|
-
return
|
|
1308
|
+
function Je(l) {
|
|
1309
|
+
return fe(l) ? es(l) : rs(l);
|
|
1306
1310
|
}
|
|
1307
|
-
var
|
|
1308
|
-
|
|
1311
|
+
var ks = ms(function(l, u, p) {
|
|
1312
|
+
je(l, u, p);
|
|
1309
1313
|
});
|
|
1310
|
-
function
|
|
1314
|
+
function Ns(l) {
|
|
1311
1315
|
return function() {
|
|
1312
1316
|
return l;
|
|
1313
1317
|
};
|
|
1314
1318
|
}
|
|
1315
|
-
function
|
|
1319
|
+
function Qe(l) {
|
|
1316
1320
|
return l;
|
|
1317
1321
|
}
|
|
1318
|
-
function
|
|
1322
|
+
function Fs() {
|
|
1319
1323
|
return !1;
|
|
1320
1324
|
}
|
|
1321
|
-
i.exports =
|
|
1325
|
+
i.exports = ks;
|
|
1322
1326
|
}(Dt, Dt.exports)), Dt.exports;
|
|
1323
1327
|
}
|
|
1324
|
-
var
|
|
1325
|
-
const Jt = /* @__PURE__ */
|
|
1328
|
+
var _n = mn();
|
|
1329
|
+
const Jt = /* @__PURE__ */ gn(_n), ri = 12, pn = {
|
|
1326
1330
|
candles: {
|
|
1327
1331
|
direction: "right",
|
|
1328
|
-
offset: `${Math.round(
|
|
1332
|
+
offset: `${Math.round(ri / 2)}px`,
|
|
1329
1333
|
style: "filled",
|
|
1330
1334
|
strokeWidth: 1,
|
|
1331
|
-
baseWidth:
|
|
1335
|
+
baseWidth: ri,
|
|
1332
1336
|
bodyRatio: 0.7,
|
|
1333
1337
|
zoomOnWheel: "both",
|
|
1334
1338
|
scaleSensitivity: 2e-3,
|
|
@@ -1369,7 +1373,7 @@ const Jt = /* @__PURE__ */ un(gn), ni = 12, mn = {
|
|
|
1369
1373
|
showLabelButtons: !0
|
|
1370
1374
|
}
|
|
1371
1375
|
};
|
|
1372
|
-
class
|
|
1376
|
+
class vn {
|
|
1373
1377
|
constructor(t) {
|
|
1374
1378
|
f(this, "_candles");
|
|
1375
1379
|
f(this, "_xAxis");
|
|
@@ -1377,7 +1381,7 @@ class _n {
|
|
|
1377
1381
|
f(this, "_guides");
|
|
1378
1382
|
f(this, "_trade");
|
|
1379
1383
|
f(this, "_logo");
|
|
1380
|
-
const e = Jt({},
|
|
1384
|
+
const e = Jt({}, pn, t);
|
|
1381
1385
|
this._candles = e.candles, this._xAxis = e.xAxis, this._yAxis = e.yAxis, this._guides = e.guides, this._trade = e.trade, this._logo = e.logo;
|
|
1382
1386
|
}
|
|
1383
1387
|
update(t) {
|
|
@@ -1464,7 +1468,7 @@ class G {
|
|
|
1464
1468
|
return this.y + this.height;
|
|
1465
1469
|
}
|
|
1466
1470
|
}
|
|
1467
|
-
class
|
|
1471
|
+
class bn {
|
|
1468
1472
|
constructor(t, e) {
|
|
1469
1473
|
f(this, "_chart", new G());
|
|
1470
1474
|
f(this, "_area", new G());
|
|
@@ -1522,8 +1526,8 @@ class pn {
|
|
|
1522
1526
|
return this._chart;
|
|
1523
1527
|
}
|
|
1524
1528
|
}
|
|
1525
|
-
const
|
|
1526
|
-
function
|
|
1529
|
+
const yn = (i) => i ? new Date(i.close_time).getTime() - new Date(i.open_time).getTime() : 0;
|
|
1530
|
+
function wn(i, t) {
|
|
1527
1531
|
if (i.length < 2) return [];
|
|
1528
1532
|
const e = [];
|
|
1529
1533
|
for (let s = 0; s < i.length - 1; s++) {
|
|
@@ -1537,8 +1541,8 @@ function bn(i, t) {
|
|
|
1537
1541
|
}
|
|
1538
1542
|
return e;
|
|
1539
1543
|
}
|
|
1540
|
-
function
|
|
1541
|
-
const e =
|
|
1544
|
+
function oi(i, t) {
|
|
1545
|
+
const e = yn(i[0]), s = wn(i, e), n = [];
|
|
1542
1546
|
return s.forEach((a) => {
|
|
1543
1547
|
if (a.length === 0) return;
|
|
1544
1548
|
const r = i.find((g) => g.close_time.getTime() === a[0]), o = i.find(
|
|
@@ -1554,11 +1558,11 @@ function ai(i, t) {
|
|
|
1554
1558
|
const w = Math.abs(v - b);
|
|
1555
1559
|
let x = Math.max(v, b) + w / 2, y = Math.min(v, b) - w / 2;
|
|
1556
1560
|
if (t.trade) {
|
|
1557
|
-
const
|
|
1558
|
-
const
|
|
1559
|
-
return
|
|
1561
|
+
const A = [...t.trade.entries, ...t.trade.exits].find((M) => {
|
|
1562
|
+
const D = M.time.getTime();
|
|
1563
|
+
return D >= g && D < g + e;
|
|
1560
1564
|
});
|
|
1561
|
-
|
|
1565
|
+
A && (A.type === "buy" ? (y = A.price, b = Math.max(y, b), v = b + w, x = Math.max(v, b) + w / 2, d = v) : A.type === "sell" && (x = A.price, b = Math.min(x, b), v = b - w, y = Math.min(v, b) - w / 2, d = v));
|
|
1562
1566
|
}
|
|
1563
1567
|
const C = {
|
|
1564
1568
|
open_time: new Date(g),
|
|
@@ -1572,7 +1576,7 @@ function ai(i, t) {
|
|
|
1572
1576
|
});
|
|
1573
1577
|
}), n;
|
|
1574
1578
|
}
|
|
1575
|
-
class
|
|
1579
|
+
class Ne {
|
|
1576
1580
|
constructor(t, e) {
|
|
1577
1581
|
f(this, "_initialData", []);
|
|
1578
1582
|
f(this, "_preparedData", []);
|
|
@@ -1586,10 +1590,10 @@ class Ee {
|
|
|
1586
1590
|
return t.map((e) => ({ ...e, open_time: new Date(e.open_time), close_time: new Date(e.close_time) })).sort((e, s) => e.open_time.getTime() - s.open_time.getTime());
|
|
1587
1591
|
}
|
|
1588
1592
|
update(t) {
|
|
1589
|
-
this._initialData = t, this._preparedData = this._prepare(t), this._missingData =
|
|
1593
|
+
this._initialData = t, this._preparedData = this._prepare(t), this._missingData = oi(this._preparedData, this._model), this._count = this._preparedData.length + this._missingData.length, this._interval = new Date(t[0].close_time).getTime() - new Date(t[0].open_time).getTime();
|
|
1590
1594
|
}
|
|
1591
1595
|
updateMissingCandles() {
|
|
1592
|
-
this._missingData =
|
|
1596
|
+
this._missingData = oi(this._preparedData, this._model);
|
|
1593
1597
|
}
|
|
1594
1598
|
get initialData() {
|
|
1595
1599
|
return this._initialData;
|
|
@@ -1613,7 +1617,7 @@ class Ee {
|
|
|
1613
1617
|
return e.find((s) => s.open_time <= t && s.close_time > t);
|
|
1614
1618
|
}
|
|
1615
1619
|
}
|
|
1616
|
-
class
|
|
1620
|
+
class xn {
|
|
1617
1621
|
constructor() {
|
|
1618
1622
|
f(this, "listeners", {});
|
|
1619
1623
|
}
|
|
@@ -1632,7 +1636,7 @@ class yn {
|
|
|
1632
1636
|
});
|
|
1633
1637
|
}
|
|
1634
1638
|
}
|
|
1635
|
-
class
|
|
1639
|
+
class yi {
|
|
1636
1640
|
constructor() {
|
|
1637
1641
|
f(this, "_scale");
|
|
1638
1642
|
}
|
|
@@ -1668,27 +1672,27 @@ class vi {
|
|
|
1668
1672
|
return this._scale(t);
|
|
1669
1673
|
}
|
|
1670
1674
|
}
|
|
1671
|
-
class
|
|
1675
|
+
class wi extends yi {
|
|
1672
1676
|
constructor() {
|
|
1673
1677
|
super(), this._scale = k.scaleTime();
|
|
1674
1678
|
}
|
|
1675
1679
|
}
|
|
1676
|
-
class
|
|
1680
|
+
class Cn extends yi {
|
|
1677
1681
|
constructor() {
|
|
1678
1682
|
super(), this._scale = k.scaleLinear();
|
|
1679
1683
|
}
|
|
1680
1684
|
}
|
|
1681
|
-
const
|
|
1685
|
+
const li = { x: 0.2, y: 0.2 }, ci = 1e-3, Tn = {
|
|
1682
1686
|
s: 1e3,
|
|
1683
1687
|
M: 1e3 * 60,
|
|
1684
1688
|
h: 1e3 * 60 * 60,
|
|
1685
1689
|
d: 1e3 * 60 * 60 * 24,
|
|
1686
1690
|
w: 1e3 * 60 * 60 * 24 * 7
|
|
1687
|
-
},
|
|
1691
|
+
}, Sn = (i) => {
|
|
1688
1692
|
const t = i.match(/^(\d+)([a-zA-Z]+)$/);
|
|
1689
1693
|
if (!t) throw new Error(`Invalid offset format: "${i}"`);
|
|
1690
1694
|
return [parseInt(t[1]), t[2]];
|
|
1691
|
-
},
|
|
1695
|
+
}, Mn = (i, t) => {
|
|
1692
1696
|
const [e, s] = t.domain().map((o) => o.getTime()), n = i.filter((o) => {
|
|
1693
1697
|
const c = o.open_time.getTime();
|
|
1694
1698
|
return c >= e && c <= s;
|
|
@@ -1696,7 +1700,7 @@ const ri = { x: 0.2, y: 0.2 }, oi = 1e-3, xn = {
|
|
|
1696
1700
|
if (a == null || r == null) throw new Error("Invalid Y data");
|
|
1697
1701
|
return [a, r];
|
|
1698
1702
|
};
|
|
1699
|
-
class
|
|
1703
|
+
class An {
|
|
1700
1704
|
constructor(t) {
|
|
1701
1705
|
this.model = t;
|
|
1702
1706
|
}
|
|
@@ -1706,14 +1710,14 @@ class Sn {
|
|
|
1706
1710
|
t.setDomain(s), this.setRange(t, this.model.layout.xAxis), this.setDefaultXDomain(t), this.applyOffset(t);
|
|
1707
1711
|
}
|
|
1708
1712
|
initY(t, e) {
|
|
1709
|
-
const s =
|
|
1713
|
+
const s = Mn(this.model.candles.preparedData, e);
|
|
1710
1714
|
t.setDomain(s), this.setRange(t, this.model.layout.yAxis);
|
|
1711
1715
|
}
|
|
1712
1716
|
init(t) {
|
|
1713
1717
|
this.initX(t.x), this.initY(t.y, t.x);
|
|
1714
1718
|
}
|
|
1715
1719
|
setRange(t, { x: e, y: s, width: n, height: a }) {
|
|
1716
|
-
t instanceof
|
|
1720
|
+
t instanceof wi ? t.setRange([e, e + n]) : t.setRange([s + a, s]);
|
|
1717
1721
|
}
|
|
1718
1722
|
setDefaultXDomain(t) {
|
|
1719
1723
|
const {
|
|
@@ -1731,11 +1735,11 @@ class Sn {
|
|
|
1731
1735
|
candles: { offset: e, direction: s }
|
|
1732
1736
|
},
|
|
1733
1737
|
layout: { xAxis: n }
|
|
1734
|
-
} = this.model, [a, r] =
|
|
1738
|
+
} = this.model, [a, r] = Sn(e), o = r === "px" ? t.invert(n.x + a).getTime() - t.invert(n.x).getTime() : Tn[r] * a, c = s === "left" ? -o : o, [h, d] = t.domain();
|
|
1735
1739
|
t.setDomain([new Date(h.getTime() + c), new Date(d.getTime() + c)]);
|
|
1736
1740
|
}
|
|
1737
1741
|
}
|
|
1738
|
-
class
|
|
1742
|
+
class Dn {
|
|
1739
1743
|
constructor(t) {
|
|
1740
1744
|
f(this, "_model");
|
|
1741
1745
|
f(this, "_scaleX");
|
|
@@ -1747,7 +1751,7 @@ class Mn {
|
|
|
1747
1751
|
});
|
|
1748
1752
|
f(this, "scaleFactor", { x: 1, y: 1 });
|
|
1749
1753
|
f(this, "panOffset", { x: 0, y: 0 });
|
|
1750
|
-
this._model = t, this._scaleX = new
|
|
1754
|
+
this._model = t, this._scaleX = new wi(), this._scaleY = new Cn(), this._initializer = new An(t), this._initializer.init({ x: this._scaleX, y: this._scaleY }), this._baseDomain = {
|
|
1751
1755
|
x: this._scaleX.domain(),
|
|
1752
1756
|
y: this._scaleY.domain()
|
|
1753
1757
|
};
|
|
@@ -1804,12 +1808,12 @@ class Mn {
|
|
|
1804
1808
|
}
|
|
1805
1809
|
scale(t, e, s = "delta") {
|
|
1806
1810
|
if (s === "absolute") {
|
|
1807
|
-
const n = Math.max(
|
|
1808
|
-
if (Math.abs(n - this.scaleFactor[t]) <
|
|
1811
|
+
const n = Math.max(li[t], e);
|
|
1812
|
+
if (Math.abs(n - this.scaleFactor[t]) < ci) return;
|
|
1809
1813
|
this.scaleFactor[t] = n;
|
|
1810
1814
|
} else {
|
|
1811
1815
|
const n = this.scaleFactor[t], a = n + e * this._model.config.candles.scaleSensitivity;
|
|
1812
|
-
if (a <
|
|
1816
|
+
if (a < li[t] || Math.abs(a - n) < ci) return;
|
|
1813
1817
|
this.scaleFactor[t] = a;
|
|
1814
1818
|
}
|
|
1815
1819
|
this._updateDomain(t);
|
|
@@ -1835,7 +1839,7 @@ class Mn {
|
|
|
1835
1839
|
this._model.eventBus.emit("scale_event");
|
|
1836
1840
|
}
|
|
1837
1841
|
}
|
|
1838
|
-
class
|
|
1842
|
+
class En {
|
|
1839
1843
|
constructor(t, { entry: e = [], exit: s = [] }) {
|
|
1840
1844
|
f(this, "_model");
|
|
1841
1845
|
f(this, "_rawEntry");
|
|
@@ -1923,7 +1927,7 @@ class An {
|
|
|
1923
1927
|
return Math.abs(this.entryMinTime - this.exitMaxTime);
|
|
1924
1928
|
}
|
|
1925
1929
|
}
|
|
1926
|
-
class
|
|
1930
|
+
class Ln {
|
|
1927
1931
|
constructor(t, e) {
|
|
1928
1932
|
f(this, "_rawMarkers");
|
|
1929
1933
|
f(this, "_markers", []);
|
|
@@ -1971,7 +1975,7 @@ class Dn {
|
|
|
1971
1975
|
return this._markers;
|
|
1972
1976
|
}
|
|
1973
1977
|
}
|
|
1974
|
-
const
|
|
1978
|
+
const kn = {
|
|
1975
1979
|
bg: "#FFFFFF",
|
|
1976
1980
|
axisIntersection: "#FFFFFF",
|
|
1977
1981
|
xAxis: {
|
|
@@ -2035,10 +2039,10 @@ const Ln = {
|
|
|
2035
2039
|
}
|
|
2036
2040
|
}
|
|
2037
2041
|
};
|
|
2038
|
-
class
|
|
2042
|
+
class Nn {
|
|
2039
2043
|
constructor(t) {
|
|
2040
2044
|
f(this, "_scheme");
|
|
2041
|
-
this._scheme = Jt({},
|
|
2045
|
+
this._scheme = Jt({}, kn, t), Object.keys(this._scheme).forEach((e) => {
|
|
2042
2046
|
Object.defineProperty(this, e, {
|
|
2043
2047
|
get: () => this._scheme[e],
|
|
2044
2048
|
enumerable: !0
|
|
@@ -2049,7 +2053,7 @@ class En {
|
|
|
2049
2053
|
this._scheme = Jt({}, this._scheme, t);
|
|
2050
2054
|
}
|
|
2051
2055
|
}
|
|
2052
|
-
class
|
|
2056
|
+
class Fn {
|
|
2053
2057
|
constructor(t, e) {
|
|
2054
2058
|
f(this, "_data");
|
|
2055
2059
|
f(this, "_callbacks", {
|
|
@@ -2067,7 +2071,7 @@ class kn {
|
|
|
2067
2071
|
_updateGroups() {
|
|
2068
2072
|
this._grouped = {};
|
|
2069
2073
|
for (const t of this._data) {
|
|
2070
|
-
const e =
|
|
2074
|
+
const e = Ne.findByDate(new Date(t.date), this._model.candles.allData);
|
|
2071
2075
|
if (!e) continue;
|
|
2072
2076
|
const s = e.open_time.getTime();
|
|
2073
2077
|
this._grouped[s] || (this._grouped[s] = []), this._grouped[s].push({ ...t, candle: e });
|
|
@@ -2092,7 +2096,7 @@ class kn {
|
|
|
2092
2096
|
this._updateGroups(), this._callbacks.onUpdate(t, e);
|
|
2093
2097
|
}
|
|
2094
2098
|
}
|
|
2095
|
-
class
|
|
2099
|
+
class Hn {
|
|
2096
2100
|
constructor({
|
|
2097
2101
|
chartId: t,
|
|
2098
2102
|
container: e,
|
|
@@ -2105,7 +2109,7 @@ class Nn {
|
|
|
2105
2109
|
}) {
|
|
2106
2110
|
f(this, "chartId");
|
|
2107
2111
|
f(this, "container");
|
|
2108
|
-
f(this, "eventBus", new
|
|
2112
|
+
f(this, "eventBus", new xn());
|
|
2109
2113
|
f(this, "candles");
|
|
2110
2114
|
f(this, "config");
|
|
2111
2115
|
f(this, "colorScheme");
|
|
@@ -2114,7 +2118,7 @@ class Nn {
|
|
|
2114
2118
|
f(this, "trade");
|
|
2115
2119
|
f(this, "userMarkers");
|
|
2116
2120
|
f(this, "comments");
|
|
2117
|
-
this.chartId = t, this.container = e, this.candles = new
|
|
2121
|
+
this.chartId = t, this.container = e, this.candles = new Ne(s, this), this.config = new vn(n), this.colorScheme = new Nn(o), this.layout = new bn(e, this.config), this.scales = new Dn(this), this.trade = new En(this, a), this.candles.updateMissingCandles(), this.trade.recalculate(), this.userMarkers = new Ln(this, r), this.comments = new Fn(c, this);
|
|
2118
2122
|
}
|
|
2119
2123
|
init() {
|
|
2120
2124
|
this.eventBus.emit("init_model");
|
|
@@ -2154,7 +2158,7 @@ class Nn {
|
|
|
2154
2158
|
}
|
|
2155
2159
|
}
|
|
2156
2160
|
const Zt = window.devicePixelRatio || 2;
|
|
2157
|
-
class
|
|
2161
|
+
class L {
|
|
2158
2162
|
constructor({ tag: t, className: e, id: s, textContent: n }) {
|
|
2159
2163
|
f(this, "_tag");
|
|
2160
2164
|
f(this, "_className");
|
|
@@ -2192,7 +2196,7 @@ class E {
|
|
|
2192
2196
|
this.node.style.opacity = t ? "1" : "0", this.node.style.visibility = t ? "visible" : "hidden";
|
|
2193
2197
|
}
|
|
2194
2198
|
}
|
|
2195
|
-
class Nt extends
|
|
2199
|
+
class Nt extends L {
|
|
2196
2200
|
constructor({ className: e, id: s, width: n, height: a, isMain: r }) {
|
|
2197
2201
|
super({
|
|
2198
2202
|
tag: "canvas",
|
|
@@ -2224,24 +2228,24 @@ class Nt extends E {
|
|
|
2224
2228
|
return this._height;
|
|
2225
2229
|
}
|
|
2226
2230
|
}
|
|
2227
|
-
const
|
|
2228
|
-
function
|
|
2231
|
+
const In = 50, Bn = 8;
|
|
2232
|
+
function Rn(i, t) {
|
|
2229
2233
|
const {
|
|
2230
2234
|
layout: { xAxis: e },
|
|
2231
2235
|
colorScheme: { xAxis: s },
|
|
2232
2236
|
config: { xAxis: n },
|
|
2233
2237
|
scales: a
|
|
2234
|
-
} = t, r = a.x.ticks(
|
|
2238
|
+
} = t, r = a.x.ticks(In), o = (_) => _.getHours() === 0 && _.getMinutes() === 0, c = k.timeFormat("%d %b"), h = k.timeFormat("%H:%M");
|
|
2235
2239
|
i.save(), i.fillStyle = s.bg, i.fillRect(e.x, e.y, e.width, e.height), i.restore(), i.fillStyle = s.text, i.font = `${n.text.fontSize} ${n.text.font}`, i.textAlign = "center", i.textBaseline = "middle";
|
|
2236
2240
|
const d = r.map((_) => {
|
|
2237
2241
|
const m = a.x.convert(_), v = o(_) ? c(_) : h(_), b = i.measureText(v).width;
|
|
2238
2242
|
return { tick: _, x: m, label: v, width: b };
|
|
2239
2243
|
});
|
|
2240
|
-
|
|
2244
|
+
$n(d, Bn).forEach(({ x: _, label: m }) => {
|
|
2241
2245
|
i.fillText(m, _, e.y + e.height / 2);
|
|
2242
2246
|
});
|
|
2243
2247
|
}
|
|
2244
|
-
function
|
|
2248
|
+
function $n(i, t) {
|
|
2245
2249
|
if (i.length === 0) return [];
|
|
2246
2250
|
const e = [];
|
|
2247
2251
|
let s = -1 / 0, n = 0;
|
|
@@ -2256,7 +2260,7 @@ function Bn(i, t) {
|
|
|
2256
2260
|
}
|
|
2257
2261
|
return e;
|
|
2258
2262
|
}
|
|
2259
|
-
function
|
|
2263
|
+
function On(i, t) {
|
|
2260
2264
|
const {
|
|
2261
2265
|
layout: { yAxis: e },
|
|
2262
2266
|
colorScheme: { yAxis: s },
|
|
@@ -2268,7 +2272,7 @@ function Rn(i, t) {
|
|
|
2268
2272
|
i.fillText(d, e.x + e.width / 2, h);
|
|
2269
2273
|
});
|
|
2270
2274
|
}
|
|
2271
|
-
const
|
|
2275
|
+
const Pn = (i, t) => {
|
|
2272
2276
|
const {
|
|
2273
2277
|
layout: { axisIntersection: e },
|
|
2274
2278
|
colorScheme: s
|
|
@@ -2280,18 +2284,18 @@ const $n = (i, t) => {
|
|
|
2280
2284
|
e.height
|
|
2281
2285
|
), i.restore();
|
|
2282
2286
|
};
|
|
2283
|
-
class
|
|
2287
|
+
class we {
|
|
2284
2288
|
static xAxis(t, e) {
|
|
2285
|
-
|
|
2289
|
+
Rn(t, e);
|
|
2286
2290
|
}
|
|
2287
2291
|
static yAxis(t, e) {
|
|
2288
|
-
|
|
2292
|
+
On(t, e);
|
|
2289
2293
|
}
|
|
2290
2294
|
static intersection(t, e) {
|
|
2291
|
-
|
|
2295
|
+
Pn(t, e);
|
|
2292
2296
|
}
|
|
2293
2297
|
}
|
|
2294
|
-
class
|
|
2298
|
+
class zn {
|
|
2295
2299
|
constructor(t) {
|
|
2296
2300
|
f(this, "_target");
|
|
2297
2301
|
this._target = t;
|
|
@@ -2333,12 +2337,12 @@ class On {
|
|
|
2333
2337
|
function Qt(i) {
|
|
2334
2338
|
return i * 0.1875;
|
|
2335
2339
|
}
|
|
2336
|
-
const
|
|
2340
|
+
const Vn = (i, { mainColor: t, textColor: e, symbol: s, x: n, y: a, size: r, fontSize: o }) => {
|
|
2337
2341
|
const g = r / 16, _ = 16 * g, m = n - _ / 2, v = a;
|
|
2338
2342
|
i.save(), i.translate(m, 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 = t, 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 = t, 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";
|
|
2339
2343
|
const b = a + g * 3 + 0.5, w = g * 16, x = b + w / 2;
|
|
2340
2344
|
i.fillStyle = e, i.fillText(s, n, x), i.restore();
|
|
2341
|
-
},
|
|
2345
|
+
}, Wn = (i, { mainColor: t, textColor: e, symbol: s, x: n, y: a, size: r, fontSize: o }) => {
|
|
2342
2346
|
const g = r / 16, _ = 16 * g, m = n - _ / 2, v = a;
|
|
2343
2347
|
i.save(), i.translate(m, 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 = t, 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 = t, i.fill(), i.restore(), i.save(), i.font = `bold ${o}px sans-serif`, i.textAlign = "center", i.textBaseline = "middle";
|
|
2344
2348
|
const b = g * 16, w = a - g * 19 + b / 2;
|
|
@@ -2352,13 +2356,13 @@ function Kt(i) {
|
|
|
2352
2356
|
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2353
2357
|
}, Kt(i);
|
|
2354
2358
|
}
|
|
2355
|
-
var
|
|
2359
|
+
var Yn = /^\s+/, jn = /\s+$/;
|
|
2356
2360
|
function S(i, t) {
|
|
2357
2361
|
if (i = i || "", t = t || {}, i instanceof S)
|
|
2358
2362
|
return i;
|
|
2359
2363
|
if (!(this instanceof S))
|
|
2360
2364
|
return new S(i, t);
|
|
2361
|
-
var e =
|
|
2365
|
+
var e = Xn(i);
|
|
2362
2366
|
this._originalInput = i, this._r = e.r, this._g = e.g, this._b = e.b, this._a = e.a, this._roundA = Math.round(100 * this._a) / 100, this._format = t.format || e.format, this._gradientType = t.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 = e.ok;
|
|
2363
2367
|
}
|
|
2364
2368
|
S.prototype = {
|
|
@@ -2389,10 +2393,10 @@ S.prototype = {
|
|
|
2389
2393
|
return e = t.r / 255, s = t.g / 255, n = t.b / 255, e <= 0.03928 ? a = e / 12.92 : a = Math.pow((e + 0.055) / 1.055, 2.4), s <= 0.03928 ? r = s / 12.92 : r = Math.pow((s + 0.055) / 1.055, 2.4), n <= 0.03928 ? o = n / 12.92 : o = Math.pow((n + 0.055) / 1.055, 2.4), 0.2126 * a + 0.7152 * r + 0.0722 * o;
|
|
2390
2394
|
},
|
|
2391
2395
|
setAlpha: function(t) {
|
|
2392
|
-
return this._a =
|
|
2396
|
+
return this._a = xi(t), this._roundA = Math.round(100 * this._a) / 100, this;
|
|
2393
2397
|
},
|
|
2394
2398
|
toHsv: function() {
|
|
2395
|
-
var t =
|
|
2399
|
+
var t = di(this._r, this._g, this._b);
|
|
2396
2400
|
return {
|
|
2397
2401
|
h: t.h * 360,
|
|
2398
2402
|
s: t.s,
|
|
@@ -2401,11 +2405,11 @@ S.prototype = {
|
|
|
2401
2405
|
};
|
|
2402
2406
|
},
|
|
2403
2407
|
toHsvString: function() {
|
|
2404
|
-
var t =
|
|
2408
|
+
var t = di(this._r, this._g, this._b), e = Math.round(t.h * 360), s = Math.round(t.s * 100), n = Math.round(t.v * 100);
|
|
2405
2409
|
return this._a == 1 ? "hsv(" + e + ", " + s + "%, " + n + "%)" : "hsva(" + e + ", " + s + "%, " + n + "%, " + this._roundA + ")";
|
|
2406
2410
|
},
|
|
2407
2411
|
toHsl: function() {
|
|
2408
|
-
var t =
|
|
2412
|
+
var t = hi(this._r, this._g, this._b);
|
|
2409
2413
|
return {
|
|
2410
2414
|
h: t.h * 360,
|
|
2411
2415
|
s: t.s,
|
|
@@ -2414,17 +2418,17 @@ S.prototype = {
|
|
|
2414
2418
|
};
|
|
2415
2419
|
},
|
|
2416
2420
|
toHslString: function() {
|
|
2417
|
-
var t =
|
|
2421
|
+
var t = hi(this._r, this._g, this._b), e = Math.round(t.h * 360), s = Math.round(t.s * 100), n = Math.round(t.l * 100);
|
|
2418
2422
|
return this._a == 1 ? "hsl(" + e + ", " + s + "%, " + n + "%)" : "hsla(" + e + ", " + s + "%, " + n + "%, " + this._roundA + ")";
|
|
2419
2423
|
},
|
|
2420
2424
|
toHex: function(t) {
|
|
2421
|
-
return
|
|
2425
|
+
return ui(this._r, this._g, this._b, t);
|
|
2422
2426
|
},
|
|
2423
2427
|
toHexString: function(t) {
|
|
2424
2428
|
return "#" + this.toHex(t);
|
|
2425
2429
|
},
|
|
2426
2430
|
toHex8: function(t) {
|
|
2427
|
-
return
|
|
2431
|
+
return qn(this._r, this._g, this._b, this._a, t);
|
|
2428
2432
|
},
|
|
2429
2433
|
toHex8String: function(t) {
|
|
2430
2434
|
return "#" + this.toHex8(t);
|
|
@@ -2452,13 +2456,13 @@ S.prototype = {
|
|
|
2452
2456
|
return this._a == 1 ? "rgb(" + Math.round($(this._r, 255) * 100) + "%, " + Math.round($(this._g, 255) * 100) + "%, " + Math.round($(this._b, 255) * 100) + "%)" : "rgba(" + Math.round($(this._r, 255) * 100) + "%, " + Math.round($(this._g, 255) * 100) + "%, " + Math.round($(this._b, 255) * 100) + "%, " + this._roundA + ")";
|
|
2453
2457
|
},
|
|
2454
2458
|
toName: function() {
|
|
2455
|
-
return this._a === 0 ? "transparent" : this._a < 1 ? !1 :
|
|
2459
|
+
return this._a === 0 ? "transparent" : this._a < 1 ? !1 : la[ui(this._r, this._g, this._b, !0)] || !1;
|
|
2456
2460
|
},
|
|
2457
2461
|
toFilter: function(t) {
|
|
2458
|
-
var e = "#" +
|
|
2462
|
+
var e = "#" + fi(this._r, this._g, this._b, this._a), s = e, n = this._gradientType ? "GradientType = 1, " : "";
|
|
2459
2463
|
if (t) {
|
|
2460
2464
|
var a = S(t);
|
|
2461
|
-
s = "#" +
|
|
2465
|
+
s = "#" + fi(a._r, a._g, a._b, a._a);
|
|
2462
2466
|
}
|
|
2463
2467
|
return "progid:DXImageTransform.Microsoft.gradient(" + n + "startColorstr=" + e + ",endColorstr=" + s + ")";
|
|
2464
2468
|
},
|
|
@@ -2476,68 +2480,68 @@ S.prototype = {
|
|
|
2476
2480
|
return this._r = s._r, this._g = s._g, this._b = s._b, this.setAlpha(s._a), this;
|
|
2477
2481
|
},
|
|
2478
2482
|
lighten: function() {
|
|
2479
|
-
return this._applyModification(
|
|
2483
|
+
return this._applyModification(ta, arguments);
|
|
2480
2484
|
},
|
|
2481
2485
|
brighten: function() {
|
|
2482
|
-
return this._applyModification(
|
|
2486
|
+
return this._applyModification(ea, arguments);
|
|
2483
2487
|
},
|
|
2484
2488
|
darken: function() {
|
|
2485
|
-
return this._applyModification(
|
|
2489
|
+
return this._applyModification(ia, arguments);
|
|
2486
2490
|
},
|
|
2487
2491
|
desaturate: function() {
|
|
2488
|
-
return this._applyModification(
|
|
2492
|
+
return this._applyModification(Jn, arguments);
|
|
2489
2493
|
},
|
|
2490
2494
|
saturate: function() {
|
|
2491
|
-
return this._applyModification(
|
|
2495
|
+
return this._applyModification(Qn, arguments);
|
|
2492
2496
|
},
|
|
2493
2497
|
greyscale: function() {
|
|
2494
|
-
return this._applyModification(
|
|
2498
|
+
return this._applyModification(Kn, arguments);
|
|
2495
2499
|
},
|
|
2496
2500
|
spin: function() {
|
|
2497
|
-
return this._applyModification(
|
|
2501
|
+
return this._applyModification(sa, arguments);
|
|
2498
2502
|
},
|
|
2499
2503
|
_applyCombination: function(t, e) {
|
|
2500
2504
|
return t.apply(null, [this].concat([].slice.call(e)));
|
|
2501
2505
|
},
|
|
2502
2506
|
analogous: function() {
|
|
2503
|
-
return this._applyCombination(
|
|
2507
|
+
return this._applyCombination(ra, arguments);
|
|
2504
2508
|
},
|
|
2505
2509
|
complement: function() {
|
|
2506
|
-
return this._applyCombination(
|
|
2510
|
+
return this._applyCombination(na, arguments);
|
|
2507
2511
|
},
|
|
2508
2512
|
monochromatic: function() {
|
|
2509
|
-
return this._applyCombination(
|
|
2513
|
+
return this._applyCombination(oa, arguments);
|
|
2510
2514
|
},
|
|
2511
2515
|
splitcomplement: function() {
|
|
2512
|
-
return this._applyCombination(
|
|
2516
|
+
return this._applyCombination(aa, arguments);
|
|
2513
2517
|
},
|
|
2514
2518
|
// Disabled until https://github.com/bgrins/TinyColor/issues/254
|
|
2515
2519
|
// polyad: function (number) {
|
|
2516
2520
|
// return this._applyCombination(polyad, [number]);
|
|
2517
2521
|
// },
|
|
2518
2522
|
triad: function() {
|
|
2519
|
-
return this._applyCombination(
|
|
2523
|
+
return this._applyCombination(gi, [3]);
|
|
2520
2524
|
},
|
|
2521
2525
|
tetrad: function() {
|
|
2522
|
-
return this._applyCombination(
|
|
2526
|
+
return this._applyCombination(gi, [4]);
|
|
2523
2527
|
}
|
|
2524
2528
|
};
|
|
2525
2529
|
S.fromRatio = function(i, t) {
|
|
2526
2530
|
if (Kt(i) == "object") {
|
|
2527
2531
|
var e = {};
|
|
2528
2532
|
for (var s in i)
|
|
2529
|
-
i.hasOwnProperty(s) && (s === "a" ? e[s] = i[s] : e[s] =
|
|
2533
|
+
i.hasOwnProperty(s) && (s === "a" ? e[s] = i[s] : e[s] = Et(i[s]));
|
|
2530
2534
|
i = e;
|
|
2531
2535
|
}
|
|
2532
2536
|
return S(i, t);
|
|
2533
2537
|
};
|
|
2534
|
-
function
|
|
2538
|
+
function Xn(i) {
|
|
2535
2539
|
var t = {
|
|
2536
2540
|
r: 0,
|
|
2537
2541
|
g: 0,
|
|
2538
2542
|
b: 0
|
|
2539
2543
|
}, e = 1, s = null, n = null, a = null, r = !1, o = !1;
|
|
2540
|
-
return typeof i == "string" && (i =
|
|
2544
|
+
return typeof i == "string" && (i = ua(i)), Kt(i) == "object" && (st(i.r) && st(i.g) && st(i.b) ? (t = Un(i.r, i.g, i.b), r = !0, o = String(i.r).substr(-1) === "%" ? "prgb" : "rgb") : st(i.h) && st(i.s) && st(i.v) ? (s = Et(i.s), n = Et(i.v), t = Zn(i.h, s, n), r = !0, o = "hsv") : st(i.h) && st(i.s) && st(i.l) && (s = Et(i.s), a = Et(i.l), t = Gn(i.h, s, a), r = !0, o = "hsl"), i.hasOwnProperty("a") && (e = i.a)), e = xi(e), {
|
|
2541
2545
|
ok: r,
|
|
2542
2546
|
format: i.format || o,
|
|
2543
2547
|
r: Math.min(255, Math.max(t.r, 0)),
|
|
@@ -2546,14 +2550,14 @@ function Yn(i) {
|
|
|
2546
2550
|
a: e
|
|
2547
2551
|
};
|
|
2548
2552
|
}
|
|
2549
|
-
function
|
|
2553
|
+
function Un(i, t, e) {
|
|
2550
2554
|
return {
|
|
2551
2555
|
r: $(i, 255) * 255,
|
|
2552
2556
|
g: $(t, 255) * 255,
|
|
2553
2557
|
b: $(e, 255) * 255
|
|
2554
2558
|
};
|
|
2555
2559
|
}
|
|
2556
|
-
function
|
|
2560
|
+
function hi(i, t, e) {
|
|
2557
2561
|
i = $(i, 255), t = $(t, 255), e = $(e, 255);
|
|
2558
2562
|
var s = Math.max(i, t, e), n = Math.min(i, t, e), a, r, o = (s + n) / 2;
|
|
2559
2563
|
if (s == n)
|
|
@@ -2579,7 +2583,7 @@ function li(i, t, e) {
|
|
|
2579
2583
|
l: o
|
|
2580
2584
|
};
|
|
2581
2585
|
}
|
|
2582
|
-
function
|
|
2586
|
+
function Gn(i, t, e) {
|
|
2583
2587
|
var s, n, a;
|
|
2584
2588
|
i = $(i, 360), t = $(t, 100), e = $(e, 100);
|
|
2585
2589
|
function r(h, d, g) {
|
|
@@ -2597,7 +2601,7 @@ function Xn(i, t, e) {
|
|
|
2597
2601
|
b: a * 255
|
|
2598
2602
|
};
|
|
2599
2603
|
}
|
|
2600
|
-
function
|
|
2604
|
+
function di(i, t, e) {
|
|
2601
2605
|
i = $(i, 255), t = $(t, 255), e = $(e, 255);
|
|
2602
2606
|
var s = Math.max(i, t, e), n = Math.min(i, t, e), a, r, o = s, c = s - n;
|
|
2603
2607
|
if (r = s === 0 ? 0 : c / s, s == n)
|
|
@@ -2622,7 +2626,7 @@ function ci(i, t, e) {
|
|
|
2622
2626
|
v: o
|
|
2623
2627
|
};
|
|
2624
2628
|
}
|
|
2625
|
-
function
|
|
2629
|
+
function Zn(i, t, e) {
|
|
2626
2630
|
i = $(i, 360) * 6, t = $(t, 100), e = $(e, 100);
|
|
2627
2631
|
var s = Math.floor(i), n = i - s, a = e * (1 - t), r = e * (1 - n * t), o = e * (1 - (1 - n) * t), c = s % 6, h = [e, r, a, a, o, e][c], d = [o, e, e, r, a, a][c], g = [a, a, o, e, e, r][c];
|
|
2628
2632
|
return {
|
|
@@ -2631,16 +2635,16 @@ function Un(i, t, e) {
|
|
|
2631
2635
|
b: g * 255
|
|
2632
2636
|
};
|
|
2633
2637
|
}
|
|
2634
|
-
function
|
|
2638
|
+
function ui(i, t, e, s) {
|
|
2635
2639
|
var n = [Q(Math.round(i).toString(16)), Q(Math.round(t).toString(16)), Q(Math.round(e).toString(16))];
|
|
2636
2640
|
return s && n[0].charAt(0) == n[0].charAt(1) && n[1].charAt(0) == n[1].charAt(1) && n[2].charAt(0) == n[2].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join("");
|
|
2637
2641
|
}
|
|
2638
|
-
function
|
|
2639
|
-
var a = [Q(Math.round(i).toString(16)), Q(Math.round(t).toString(16)), Q(Math.round(e).toString(16)), Q(
|
|
2642
|
+
function qn(i, t, e, s, n) {
|
|
2643
|
+
var a = [Q(Math.round(i).toString(16)), Q(Math.round(t).toString(16)), Q(Math.round(e).toString(16)), Q(Ci(s))];
|
|
2640
2644
|
return n && a[0].charAt(0) == a[0].charAt(1) && a[1].charAt(0) == a[1].charAt(1) && a[2].charAt(0) == a[2].charAt(1) && a[3].charAt(0) == a[3].charAt(1) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
|
|
2641
2645
|
}
|
|
2642
|
-
function
|
|
2643
|
-
var n = [Q(
|
|
2646
|
+
function fi(i, t, e, s) {
|
|
2647
|
+
var n = [Q(Ci(s)), Q(Math.round(i).toString(16)), Q(Math.round(t).toString(16)), Q(Math.round(e).toString(16))];
|
|
2644
2648
|
return n.join("");
|
|
2645
2649
|
}
|
|
2646
2650
|
S.equals = function(i, t) {
|
|
@@ -2653,43 +2657,43 @@ S.random = function() {
|
|
|
2653
2657
|
b: Math.random()
|
|
2654
2658
|
});
|
|
2655
2659
|
};
|
|
2656
|
-
function
|
|
2660
|
+
function Jn(i, t) {
|
|
2657
2661
|
t = t === 0 ? 0 : t || 10;
|
|
2658
2662
|
var e = S(i).toHsl();
|
|
2659
|
-
return e.s -= t / 100, e.s =
|
|
2663
|
+
return e.s -= t / 100, e.s = ie(e.s), S(e);
|
|
2660
2664
|
}
|
|
2661
|
-
function
|
|
2665
|
+
function Qn(i, t) {
|
|
2662
2666
|
t = t === 0 ? 0 : t || 10;
|
|
2663
2667
|
var e = S(i).toHsl();
|
|
2664
|
-
return e.s += t / 100, e.s =
|
|
2668
|
+
return e.s += t / 100, e.s = ie(e.s), S(e);
|
|
2665
2669
|
}
|
|
2666
|
-
function
|
|
2670
|
+
function Kn(i) {
|
|
2667
2671
|
return S(i).desaturate(100);
|
|
2668
2672
|
}
|
|
2669
|
-
function
|
|
2673
|
+
function ta(i, t) {
|
|
2670
2674
|
t = t === 0 ? 0 : t || 10;
|
|
2671
2675
|
var e = S(i).toHsl();
|
|
2672
|
-
return e.l += t / 100, e.l =
|
|
2676
|
+
return e.l += t / 100, e.l = ie(e.l), S(e);
|
|
2673
2677
|
}
|
|
2674
|
-
function
|
|
2678
|
+
function ea(i, t) {
|
|
2675
2679
|
t = t === 0 ? 0 : t || 10;
|
|
2676
2680
|
var e = S(i).toRgb();
|
|
2677
2681
|
return e.r = Math.max(0, Math.min(255, e.r - Math.round(255 * -(t / 100)))), e.g = Math.max(0, Math.min(255, e.g - Math.round(255 * -(t / 100)))), e.b = Math.max(0, Math.min(255, e.b - Math.round(255 * -(t / 100)))), S(e);
|
|
2678
2682
|
}
|
|
2679
|
-
function
|
|
2683
|
+
function ia(i, t) {
|
|
2680
2684
|
t = t === 0 ? 0 : t || 10;
|
|
2681
2685
|
var e = S(i).toHsl();
|
|
2682
|
-
return e.l -= t / 100, e.l =
|
|
2686
|
+
return e.l -= t / 100, e.l = ie(e.l), S(e);
|
|
2683
2687
|
}
|
|
2684
|
-
function
|
|
2688
|
+
function sa(i, t) {
|
|
2685
2689
|
var e = S(i).toHsl(), s = (e.h + t) % 360;
|
|
2686
2690
|
return e.h = s < 0 ? 360 + s : s, S(e);
|
|
2687
2691
|
}
|
|
2688
|
-
function
|
|
2692
|
+
function na(i) {
|
|
2689
2693
|
var t = S(i).toHsl();
|
|
2690
2694
|
return t.h = (t.h + 180) % 360, S(t);
|
|
2691
2695
|
}
|
|
2692
|
-
function
|
|
2696
|
+
function gi(i, t) {
|
|
2693
2697
|
if (isNaN(t) || t <= 0)
|
|
2694
2698
|
throw new Error("Argument to polyad must be a positive number");
|
|
2695
2699
|
for (var e = S(i).toHsl(), s = [S(i)], n = 360 / t, a = 1; a < t; a++)
|
|
@@ -2700,7 +2704,7 @@ function ui(i, t) {
|
|
|
2700
2704
|
}));
|
|
2701
2705
|
return s;
|
|
2702
2706
|
}
|
|
2703
|
-
function
|
|
2707
|
+
function aa(i) {
|
|
2704
2708
|
var t = S(i).toHsl(), e = t.h;
|
|
2705
2709
|
return [S(i), S({
|
|
2706
2710
|
h: (e + 72) % 360,
|
|
@@ -2712,14 +2716,14 @@ function sa(i) {
|
|
|
2712
2716
|
l: t.l
|
|
2713
2717
|
})];
|
|
2714
2718
|
}
|
|
2715
|
-
function
|
|
2719
|
+
function ra(i, t, e) {
|
|
2716
2720
|
t = t || 6, e = e || 30;
|
|
2717
2721
|
var s = S(i).toHsl(), n = 360 / e, a = [S(i)];
|
|
2718
2722
|
for (s.h = (s.h - (n * t >> 1) + 720) % 360; --t; )
|
|
2719
2723
|
s.h = (s.h + n) % 360, a.push(S(s));
|
|
2720
2724
|
return a;
|
|
2721
2725
|
}
|
|
2722
|
-
function
|
|
2726
|
+
function oa(i, t) {
|
|
2723
2727
|
t = t || 6;
|
|
2724
2728
|
for (var e = S(i).toHsv(), s = e.h, n = e.s, a = e.v, r = [], o = 1 / t; t--; )
|
|
2725
2729
|
r.push(S({
|
|
@@ -2745,7 +2749,7 @@ S.readability = function(i, t) {
|
|
|
2745
2749
|
};
|
|
2746
2750
|
S.isReadable = function(i, t, e) {
|
|
2747
2751
|
var s = S.readability(i, t), n, a;
|
|
2748
|
-
switch (a = !1, n =
|
|
2752
|
+
switch (a = !1, n = fa(e), n.level + n.size) {
|
|
2749
2753
|
case "AAsmall":
|
|
2750
2754
|
case "AAAlarge":
|
|
2751
2755
|
a = s >= 4.5;
|
|
@@ -2769,7 +2773,7 @@ S.mostReadable = function(i, t, e) {
|
|
|
2769
2773
|
size: c
|
|
2770
2774
|
}) || !r ? s : (e.includeFallbackColors = !1, S.mostReadable(i, ["#fff", "#000"], e));
|
|
2771
2775
|
};
|
|
2772
|
-
var
|
|
2776
|
+
var Ae = S.names = {
|
|
2773
2777
|
aliceblue: "f0f8ff",
|
|
2774
2778
|
antiquewhite: "faebd7",
|
|
2775
2779
|
aqua: "0ff",
|
|
@@ -2919,43 +2923,43 @@ var Me = S.names = {
|
|
|
2919
2923
|
whitesmoke: "f5f5f5",
|
|
2920
2924
|
yellow: "ff0",
|
|
2921
2925
|
yellowgreen: "9acd32"
|
|
2922
|
-
},
|
|
2923
|
-
function
|
|
2926
|
+
}, la = S.hexNames = ca(Ae);
|
|
2927
|
+
function ca(i) {
|
|
2924
2928
|
var t = {};
|
|
2925
2929
|
for (var e in i)
|
|
2926
2930
|
i.hasOwnProperty(e) && (t[i[e]] = e);
|
|
2927
2931
|
return t;
|
|
2928
2932
|
}
|
|
2929
|
-
function
|
|
2933
|
+
function xi(i) {
|
|
2930
2934
|
return i = parseFloat(i), (isNaN(i) || i < 0 || i > 1) && (i = 1), i;
|
|
2931
2935
|
}
|
|
2932
2936
|
function $(i, t) {
|
|
2933
|
-
|
|
2934
|
-
var e =
|
|
2937
|
+
ha(i) && (i = "100%");
|
|
2938
|
+
var e = da(i);
|
|
2935
2939
|
return i = Math.min(t, Math.max(0, parseFloat(i))), e && (i = parseInt(i * t, 10) / 100), Math.abs(i - t) < 1e-6 ? 1 : i % t / parseFloat(t);
|
|
2936
2940
|
}
|
|
2937
|
-
function
|
|
2941
|
+
function ie(i) {
|
|
2938
2942
|
return Math.min(1, Math.max(0, i));
|
|
2939
2943
|
}
|
|
2940
2944
|
function U(i) {
|
|
2941
2945
|
return parseInt(i, 16);
|
|
2942
2946
|
}
|
|
2943
|
-
function
|
|
2947
|
+
function ha(i) {
|
|
2944
2948
|
return typeof i == "string" && i.indexOf(".") != -1 && parseFloat(i) === 1;
|
|
2945
2949
|
}
|
|
2946
|
-
function
|
|
2950
|
+
function da(i) {
|
|
2947
2951
|
return typeof i == "string" && i.indexOf("%") != -1;
|
|
2948
2952
|
}
|
|
2949
2953
|
function Q(i) {
|
|
2950
2954
|
return i.length == 1 ? "0" + i : "" + i;
|
|
2951
2955
|
}
|
|
2952
|
-
function
|
|
2956
|
+
function Et(i) {
|
|
2953
2957
|
return i <= 1 && (i = i * 100 + "%"), i;
|
|
2954
2958
|
}
|
|
2955
|
-
function
|
|
2959
|
+
function Ci(i) {
|
|
2956
2960
|
return Math.round(parseFloat(i) * 255).toString(16);
|
|
2957
2961
|
}
|
|
2958
|
-
function
|
|
2962
|
+
function mi(i) {
|
|
2959
2963
|
return U(i) / 255;
|
|
2960
2964
|
}
|
|
2961
2965
|
var J = function() {
|
|
@@ -2977,11 +2981,11 @@ var J = function() {
|
|
|
2977
2981
|
function st(i) {
|
|
2978
2982
|
return !!J.CSS_UNIT.exec(i);
|
|
2979
2983
|
}
|
|
2980
|
-
function
|
|
2981
|
-
i = i.replace(
|
|
2984
|
+
function ua(i) {
|
|
2985
|
+
i = i.replace(Yn, "").replace(jn, "").toLowerCase();
|
|
2982
2986
|
var t = !1;
|
|
2983
|
-
if (
|
|
2984
|
-
i =
|
|
2987
|
+
if (Ae[i])
|
|
2988
|
+
i = Ae[i], t = !0;
|
|
2985
2989
|
else if (i == "transparent")
|
|
2986
2990
|
return {
|
|
2987
2991
|
r: 0,
|
|
@@ -3022,7 +3026,7 @@ function ha(i) {
|
|
|
3022
3026
|
r: U(e[1]),
|
|
3023
3027
|
g: U(e[2]),
|
|
3024
3028
|
b: U(e[3]),
|
|
3025
|
-
a:
|
|
3029
|
+
a: mi(e[4]),
|
|
3026
3030
|
format: t ? "name" : "hex8"
|
|
3027
3031
|
} : (e = J.hex6.exec(i)) ? {
|
|
3028
3032
|
r: U(e[1]),
|
|
@@ -3033,7 +3037,7 @@ function ha(i) {
|
|
|
3033
3037
|
r: U(e[1] + "" + e[1]),
|
|
3034
3038
|
g: U(e[2] + "" + e[2]),
|
|
3035
3039
|
b: U(e[3] + "" + e[3]),
|
|
3036
|
-
a:
|
|
3040
|
+
a: mi(e[4] + "" + e[4]),
|
|
3037
3041
|
format: t ? "name" : "hex8"
|
|
3038
3042
|
} : (e = J.hex3.exec(i)) ? {
|
|
3039
3043
|
r: U(e[1] + "" + e[1]),
|
|
@@ -3042,7 +3046,7 @@ function ha(i) {
|
|
|
3042
3046
|
format: t ? "name" : "hex"
|
|
3043
3047
|
} : !1;
|
|
3044
3048
|
}
|
|
3045
|
-
function
|
|
3049
|
+
function fa(i) {
|
|
3046
3050
|
var t, e;
|
|
3047
3051
|
return i = i || {
|
|
3048
3052
|
level: "AA",
|
|
@@ -3052,7 +3056,7 @@ function da(i) {
|
|
|
3052
3056
|
size: e
|
|
3053
3057
|
};
|
|
3054
3058
|
}
|
|
3055
|
-
function
|
|
3059
|
+
function ga(i, t) {
|
|
3056
3060
|
const {
|
|
3057
3061
|
trade: { tradedCandles: e },
|
|
3058
3062
|
scales: { x: s, y: n },
|
|
@@ -3066,13 +3070,13 @@ function ua(i, t) {
|
|
|
3066
3070
|
e.forEach(({ isHovered: h, isActive: d, candle: g, trades: _ }) => {
|
|
3067
3071
|
const m = s.convert(g.open_time);
|
|
3068
3072
|
_.forEach((v) => {
|
|
3069
|
-
const b = v.type === "buy", w = b ? o.buyLabel.text : o.sellLabel.text, x = b ? "B" : "S", y = b ? n.convert(g.low) + c : n.convert(g.high) - c, C = b ?
|
|
3070
|
-
let
|
|
3071
|
-
h && h[1] && h[0] === v.type && (
|
|
3073
|
+
const b = v.type === "buy", w = b ? o.buyLabel.text : o.sellLabel.text, x = b ? "B" : "S", y = b ? n.convert(g.low) + c : n.convert(g.high) - c, C = b ? Vn : Wn;
|
|
3074
|
+
let A = b ? o.buyLabel.main : o.sellLabel.main;
|
|
3075
|
+
h && h[1] && h[0] === v.type && (A = S.mix(A, a.bg, 20).toString()), d && d[1] && d[0] === v.type && (A = o.activeLabel), C(i, {
|
|
3072
3076
|
x: m,
|
|
3073
3077
|
y,
|
|
3074
3078
|
symbol: x,
|
|
3075
|
-
mainColor:
|
|
3079
|
+
mainColor: A,
|
|
3076
3080
|
textColor: w,
|
|
3077
3081
|
size: 16,
|
|
3078
3082
|
fontSize: 12
|
|
@@ -3080,7 +3084,7 @@ function ua(i, t) {
|
|
|
3080
3084
|
});
|
|
3081
3085
|
});
|
|
3082
3086
|
}
|
|
3083
|
-
function
|
|
3087
|
+
function ma(i, t) {
|
|
3084
3088
|
const {
|
|
3085
3089
|
scales: { x: e, factorX: s },
|
|
3086
3090
|
layout: { area: n },
|
|
@@ -3100,7 +3104,7 @@ function fa(i, t) {
|
|
|
3100
3104
|
}
|
|
3101
3105
|
i.restore();
|
|
3102
3106
|
}
|
|
3103
|
-
const
|
|
3107
|
+
const _a = (i, t) => {
|
|
3104
3108
|
const {
|
|
3105
3109
|
scales: { x: e, y: s },
|
|
3106
3110
|
trade: { tradedCandles: n, entries: a, exits: r },
|
|
@@ -3133,7 +3137,7 @@ const ga = (i, t) => {
|
|
|
3133
3137
|
d(g, _);
|
|
3134
3138
|
}
|
|
3135
3139
|
i.restore();
|
|
3136
|
-
},
|
|
3140
|
+
}, Ti = (i, t) => {
|
|
3137
3141
|
const {
|
|
3138
3142
|
radius: e,
|
|
3139
3143
|
coords: { x: s, y: n },
|
|
@@ -3142,7 +3146,7 @@ const ga = (i, t) => {
|
|
|
3142
3146
|
height: o
|
|
3143
3147
|
} = t;
|
|
3144
3148
|
i.beginPath(), i.fillStyle = a, i.lineWidth = 1, i.moveTo(s + e, n), i.lineTo(s + r - e, n), i.quadraticCurveTo(s + r, n, s + r, n + e), i.lineTo(s + r, n + o - e), i.quadraticCurveTo(s + r, n + o, s + r - e, n + o), i.lineTo(s + e, n + o), i.quadraticCurveTo(s, n + o, s, n + o - e), i.lineTo(s, n + e), i.quadraticCurveTo(s, n, s + e, n), i.closePath(), i.fill();
|
|
3145
|
-
},
|
|
3149
|
+
}, pa = (i) => {
|
|
3146
3150
|
const t = Math.floor((Date.now() - +i) / 1e3), e = [
|
|
3147
3151
|
[60, 1, "s"],
|
|
3148
3152
|
[3600, 60, "m"],
|
|
@@ -3154,7 +3158,7 @@ const ga = (i, t) => {
|
|
|
3154
3158
|
], [, s, n] = e.find(([r]) => t < r);
|
|
3155
3159
|
return `${Math.floor(t / s)}${n} ago`;
|
|
3156
3160
|
};
|
|
3157
|
-
function
|
|
3161
|
+
function va(i) {
|
|
3158
3162
|
const t = Math.floor(i / 1e3), e = [
|
|
3159
3163
|
{ label: "d", value: 86400 },
|
|
3160
3164
|
{ label: "h", value: 3600 },
|
|
@@ -3169,7 +3173,7 @@ function _a(i) {
|
|
|
3169
3173
|
}
|
|
3170
3174
|
return s.length ? s.join(" ") : "0s";
|
|
3171
3175
|
}
|
|
3172
|
-
const
|
|
3176
|
+
const ba = 10, ya = 6, wa = 4, xa = 12, Ca = (i, t) => {
|
|
3173
3177
|
var V;
|
|
3174
3178
|
const {
|
|
3175
3179
|
scales: { x: e, y: s },
|
|
@@ -3186,23 +3190,23 @@ const pa = 10, va = 6, ba = 4, ya = 12, wa = (i, t) => {
|
|
|
3186
3190
|
if (!_ || !m) return;
|
|
3187
3191
|
const v = (P) => P ? P instanceof Date ? P : new Date(P) : null, b = v(d == null ? void 0 : d[0]) || _.candle.open_time, w = v(d == null ? void 0 : d[1]) || m.candle.close_time, x = e.convert(v(d == null ? void 0 : d[0]) || _.candle.open_time), y = e.convert(v(d == null ? void 0 : d[1]) || m.candle.open_time), C = t.candles.allData.filter(
|
|
3188
3192
|
(P) => P.open_time <= w && P.close_time >= b
|
|
3189
|
-
),
|
|
3190
|
-
i.beginPath(), i.setLineDash([4, 4]), i.strokeStyle = o.main, i.moveTo(x,
|
|
3191
|
-
const
|
|
3193
|
+
), A = C.length > 0 ? C.reduce((P, ot) => ot.low < P ? ot.low : P, C[0].low) : ((V = n.at(0)) == null ? void 0 : V.price) ?? 0, M = s.convert(g || A);
|
|
3194
|
+
i.beginPath(), i.setLineDash([4, 4]), i.strokeStyle = o.main, i.moveTo(x, M), i.lineTo(y, M), i.stroke(), i.setLineDash([]);
|
|
3195
|
+
const D = (x + y) / 2, I = h || `Hold: ${va(r)}`, Z = getComputedStyle(
|
|
3192
3196
|
document.querySelector(".sc-charts-cs") || document.body
|
|
3193
3197
|
).font.replace(/^\s*\S+/, "").trim();
|
|
3194
|
-
i.font = `600 ${
|
|
3195
|
-
const K = i.measureText(I).width +
|
|
3196
|
-
|
|
3198
|
+
i.font = `600 ${ba}px ${Z}`;
|
|
3199
|
+
const K = i.measureText(I).width + ya * 2, O = xa + wa * 2;
|
|
3200
|
+
Ti(i, {
|
|
3197
3201
|
radius: 4,
|
|
3198
3202
|
coords: {
|
|
3199
|
-
x:
|
|
3200
|
-
y:
|
|
3203
|
+
x: D - K / 2,
|
|
3204
|
+
y: M - O / 2
|
|
3201
3205
|
},
|
|
3202
3206
|
width: K,
|
|
3203
3207
|
height: O,
|
|
3204
3208
|
fillColor: o.main
|
|
3205
|
-
}), i.fillStyle = o.text, i.textBaseline = "middle", i.textAlign = "center", i.fillText(I,
|
|
3209
|
+
}), i.fillStyle = o.text, i.textBaseline = "middle", i.textAlign = "center", i.fillText(I, D, M), i.restore();
|
|
3206
3210
|
};
|
|
3207
3211
|
class Ft {
|
|
3208
3212
|
constructor(t, e, {
|
|
@@ -3214,7 +3218,7 @@ class Ft {
|
|
|
3214
3218
|
f(this, "dom", null);
|
|
3215
3219
|
f(this, "prefix");
|
|
3216
3220
|
const { width: r, height: o, canvasesContainer: c, domElements: h } = e;
|
|
3217
|
-
n || (this.canvas = new s({ className: `sc-charts-cs__canvas-${t}`, width: r, height: o }), c.append(this.canvas.node)), a || (this.dom = new
|
|
3221
|
+
n || (this.canvas = new s({ className: `sc-charts-cs__canvas-${t}`, width: r, height: o }), c.append(this.canvas.node)), a || (this.dom = new L({ className: `sc-charts-cs__dom-${t}` }), h.append(this.dom.node)), this.prefix = `sc-charts-cs__${t}`;
|
|
3218
3222
|
}
|
|
3219
3223
|
cx(...t) {
|
|
3220
3224
|
return t.map((e) => `${this.prefix}-${e}`).join(" ");
|
|
@@ -3223,12 +3227,12 @@ class Ft {
|
|
|
3223
3227
|
return (e) => t.map((s) => `${this.prefix}-${s}-${e}`).join(" ");
|
|
3224
3228
|
}
|
|
3225
3229
|
}
|
|
3226
|
-
const
|
|
3230
|
+
const Ta = {
|
|
3227
3231
|
"right-bottom": { dx: 1, dy: 1 },
|
|
3228
3232
|
"left-top": { dx: -1, dy: -1 },
|
|
3229
3233
|
"right-top": { dx: 1, dy: -1 },
|
|
3230
3234
|
"left-bottom": { dx: -1, dy: 1 }
|
|
3231
|
-
},
|
|
3235
|
+
}, Fe = ({
|
|
3232
3236
|
size: i,
|
|
3233
3237
|
parent: t,
|
|
3234
3238
|
coords: e,
|
|
@@ -3236,18 +3240,18 @@ const xa = {
|
|
|
3236
3240
|
offset: n = 8
|
|
3237
3241
|
}) => {
|
|
3238
3242
|
const { width: a, height: r } = i, o = t.right - t.left, c = t.bottom - t.top, h = (y) => {
|
|
3239
|
-
const { dx: C, dy:
|
|
3240
|
-
return { x:
|
|
3243
|
+
const { dx: C, dy: A } = Ta[y], M = e.x + (C === 1 ? n : -a - n), D = e.y + (A === 1 ? n : -r - n);
|
|
3244
|
+
return { x: M, y: D, side: y };
|
|
3241
3245
|
}, d = ({ x: y, y: C }) => y >= 0 && C >= 0 && y + a <= o && C + r <= c, g = () => {
|
|
3242
|
-
const y = e.y < 0, C = e.y + r > c,
|
|
3243
|
-
return
|
|
3246
|
+
const y = e.y < 0, C = e.y + r > c, A = e.x < 0, M = e.x + a > o;
|
|
3247
|
+
return A && y ? "right-bottom" : A && C ? "right-top" : M && y ? "left-bottom" : M && C ? "left-top" : A ? "right-bottom" : M ? "left-bottom" : y ? "right-bottom" : C ? "right-top" : s;
|
|
3244
3248
|
}, m = [
|
|
3245
3249
|
s,
|
|
3246
3250
|
"right-bottom",
|
|
3247
3251
|
"right-top",
|
|
3248
3252
|
"left-bottom",
|
|
3249
3253
|
"left-top"
|
|
3250
|
-
].filter((y, C,
|
|
3254
|
+
].filter((y, C, A) => A.indexOf(y) === C), v = g();
|
|
3251
3255
|
let b = null;
|
|
3252
3256
|
for (const y of [v, ...m]) {
|
|
3253
3257
|
const C = h(y);
|
|
@@ -3264,7 +3268,7 @@ const xa = {
|
|
|
3264
3268
|
side: b.side
|
|
3265
3269
|
};
|
|
3266
3270
|
};
|
|
3267
|
-
class nt extends
|
|
3271
|
+
class nt extends L {
|
|
3268
3272
|
constructor(e) {
|
|
3269
3273
|
super(e);
|
|
3270
3274
|
f(this, "_state", {});
|
|
@@ -3299,7 +3303,7 @@ class nt extends E {
|
|
|
3299
3303
|
this._scheduleUpdate();
|
|
3300
3304
|
}
|
|
3301
3305
|
}
|
|
3302
|
-
class
|
|
3306
|
+
class Sa extends nt {
|
|
3303
3307
|
constructor(e) {
|
|
3304
3308
|
const s = "label-tooltip";
|
|
3305
3309
|
super({ className: e.cx(s) });
|
|
@@ -3307,13 +3311,13 @@ class Ca extends nt {
|
|
|
3307
3311
|
f(this, "manyBox");
|
|
3308
3312
|
f(this, "oneBox");
|
|
3309
3313
|
f(this, "clsx");
|
|
3310
|
-
this.clsx = e.cxFabric(s), this.title = new
|
|
3314
|
+
this.clsx = e.cxFabric(s), this.title = new L({
|
|
3311
3315
|
tag: "div",
|
|
3312
3316
|
className: this.clsx("title")
|
|
3313
|
-
}), this.manyBox = new
|
|
3317
|
+
}), this.manyBox = new L({
|
|
3314
3318
|
tag: "div",
|
|
3315
3319
|
className: this.clsx("box_many")
|
|
3316
|
-
}), this.oneBox = new
|
|
3320
|
+
}), this.oneBox = new L({
|
|
3317
3321
|
tag: "div",
|
|
3318
3322
|
className: this.clsx("box_one")
|
|
3319
3323
|
}), e.dom.append(this.title.node, this.oneBox.node, this.manyBox.node), this.state = { isShow: !1, x: 0, y: 0, parent: G.empty() };
|
|
@@ -3322,13 +3326,13 @@ class Ca extends nt {
|
|
|
3322
3326
|
const n = [];
|
|
3323
3327
|
for (const a of Object.keys(s))
|
|
3324
3328
|
if (a in e) {
|
|
3325
|
-
const r = new
|
|
3329
|
+
const r = new L({
|
|
3326
3330
|
tag: "div",
|
|
3327
3331
|
className: this.clsx("line")
|
|
3328
3332
|
});
|
|
3329
3333
|
let o = e[a].toString();
|
|
3330
3334
|
a === "kind" && (o = this._formatDate(e.time));
|
|
3331
|
-
const c = new
|
|
3335
|
+
const c = new L({ tag: "strong", textContent: s[a] }), h = new L({ tag: "span", textContent: o });
|
|
3332
3336
|
r.append(c.node, h.node), n.push(r.node);
|
|
3333
3337
|
}
|
|
3334
3338
|
return n;
|
|
@@ -3341,8 +3345,11 @@ class Ca extends nt {
|
|
|
3341
3345
|
month: "short",
|
|
3342
3346
|
year: "numeric",
|
|
3343
3347
|
hour12: !1
|
|
3344
|
-
}).
|
|
3345
|
-
|
|
3348
|
+
}).formatToParts(e), n = (_) => {
|
|
3349
|
+
var m;
|
|
3350
|
+
return ((m = s.find((v) => v.type === _)) == null ? void 0 : m.value) ?? "";
|
|
3351
|
+
}, a = n("hour"), r = n("minute"), o = n("day"), c = n("month"), h = n("year"), d = [a, r].filter(Boolean).join(":"), g = [c, o, h].filter(Boolean).join(" ");
|
|
3352
|
+
return [d, g].filter(Boolean).join(", ");
|
|
3346
3353
|
}
|
|
3347
3354
|
updateContent(e) {
|
|
3348
3355
|
if (e.length) {
|
|
@@ -3358,7 +3365,7 @@ class Ca extends nt {
|
|
|
3358
3365
|
} else if (e.length > 1) {
|
|
3359
3366
|
this.manyBox.node.style.display = "flex";
|
|
3360
3367
|
const s = e.map((n) => {
|
|
3361
|
-
const a = new
|
|
3368
|
+
const a = new L({ tag: "div" }), r = this._createLineNodes(n, {
|
|
3362
3369
|
kind: n.kind === "entry" ? "Entry:" : "Exit:",
|
|
3363
3370
|
price: "Price:"
|
|
3364
3371
|
});
|
|
@@ -3371,7 +3378,7 @@ class Ca extends nt {
|
|
|
3371
3378
|
render() {
|
|
3372
3379
|
const { isShow: e, x: s, y: n, parent: a } = this.state;
|
|
3373
3380
|
this.setVisible(e), e && this.updateAbsolutePosition();
|
|
3374
|
-
const r =
|
|
3381
|
+
const r = Fe({
|
|
3375
3382
|
size: this.absolutePosition,
|
|
3376
3383
|
parent: a,
|
|
3377
3384
|
coords: { x: s, y: n }
|
|
@@ -3379,22 +3386,22 @@ class Ca extends nt {
|
|
|
3379
3386
|
this.position(r.x, r.y);
|
|
3380
3387
|
}
|
|
3381
3388
|
}
|
|
3382
|
-
class
|
|
3389
|
+
class Ma extends Ft {
|
|
3383
3390
|
constructor(e) {
|
|
3384
3391
|
super("trade", e);
|
|
3385
3392
|
f(this, "labelTooltip");
|
|
3386
3393
|
if (!this.dom) throw new Error("[CS_V_Trade] this.dom must be defined");
|
|
3387
3394
|
if (!this.canvas) throw new Error("[CS_V_Trade] this.canvas must be defined");
|
|
3388
|
-
this.labelTooltip = new
|
|
3395
|
+
this.labelTooltip = new Sa(this), this.dom.append(this.labelTooltip.node);
|
|
3389
3396
|
}
|
|
3390
3397
|
renderAll(e) {
|
|
3391
|
-
this.canvas.clear(),
|
|
3398
|
+
this.canvas.clear(), ma(this.canvas.ctx, e), ga(this.canvas.ctx, e), _a(this.canvas.ctx, e), Ca(this.canvas.ctx, e);
|
|
3392
3399
|
}
|
|
3393
3400
|
}
|
|
3394
|
-
function
|
|
3401
|
+
function Aa(i, { color: t = "#000000", lineWidth: e = 1, dashed: s, coords: n }) {
|
|
3395
3402
|
i.strokeStyle = t, i.lineWidth = e, s && i.setLineDash(s), i.beginPath(), i.moveTo(n.x1, n.y1), i.lineTo(n.x2, n.y2), i.stroke();
|
|
3396
3403
|
}
|
|
3397
|
-
const
|
|
3404
|
+
const Da = { text: "#FFFFFF", bg: "#000000" }, Ea = (i, t) => {
|
|
3398
3405
|
const {
|
|
3399
3406
|
coords: e,
|
|
3400
3407
|
text: s,
|
|
@@ -3405,28 +3412,28 @@ const Ma = { text: "#FFFFFF", bg: "#000000" }, Aa = (i, t) => {
|
|
|
3405
3412
|
borderRadius: c = 0,
|
|
3406
3413
|
colors: h,
|
|
3407
3414
|
align: d = { x: "left", y: "top" }
|
|
3408
|
-
} = t, g = { ...
|
|
3415
|
+
} = t, g = { ...Da, ...h }, m = getComputedStyle(
|
|
3409
3416
|
document.querySelector(".sc-charts-cs") || document.body
|
|
3410
3417
|
).font.replace(/^\s*\S+/, "").trim();
|
|
3411
3418
|
i.font = `${a} ${n}px ${m}`;
|
|
3412
3419
|
const b = i.measureText(s).width + o.x * 2, w = r + o.y * 2;
|
|
3413
3420
|
let x = e.x, y = e.y;
|
|
3414
|
-
d.x === "middle" ? x -= b / 2 : d.x === "right" && (x -= b), d.y === "middle" ? y -= w / 2 : d.y === "bottom" && (y -= w),
|
|
3421
|
+
d.x === "middle" ? x -= b / 2 : d.x === "right" && (x -= b), d.y === "middle" ? y -= w / 2 : d.y === "bottom" && (y -= w), Ti(i, {
|
|
3415
3422
|
radius: c,
|
|
3416
3423
|
coords: { x, y },
|
|
3417
3424
|
width: b,
|
|
3418
3425
|
height: w,
|
|
3419
3426
|
fillColor: g.bg
|
|
3420
3427
|
}), i.fillStyle = g.text, i.textBaseline = "middle", i.textAlign = "center", i.fillText(s, x + b / 2, y + w / 2);
|
|
3421
|
-
},
|
|
3428
|
+
}, _i = {
|
|
3422
3429
|
line: "#000000",
|
|
3423
3430
|
text: "#ffffff",
|
|
3424
3431
|
main: "#000000"
|
|
3425
|
-
},
|
|
3432
|
+
}, Si = (i, { text: t, startLineCoords: e, side: s, colors: n = _i, dir: a = "h", endMarkerCoords: r }) => {
|
|
3426
3433
|
if (a === "h" && (s === "bottom" || s === "top"))
|
|
3427
3434
|
throw new Error("[drawMarker util]: Incorrect side or dir for this marker");
|
|
3428
|
-
const o = { ...
|
|
3429
|
-
i.save(),
|
|
3435
|
+
const o = { ..._i, ...n };
|
|
3436
|
+
i.save(), Aa(i, {
|
|
3430
3437
|
color: o.line,
|
|
3431
3438
|
lineWidth: 1,
|
|
3432
3439
|
dashed: [4, 4],
|
|
@@ -3436,7 +3443,7 @@ const Ma = { text: "#FFFFFF", bg: "#000000" }, Aa = (i, t) => {
|
|
|
3436
3443
|
x2: r.x,
|
|
3437
3444
|
y2: r.y
|
|
3438
3445
|
}
|
|
3439
|
-
}),
|
|
3446
|
+
}), Ea(i, {
|
|
3440
3447
|
text: t,
|
|
3441
3448
|
coords: r,
|
|
3442
3449
|
padding: { x: 6, y: 4 },
|
|
@@ -3453,17 +3460,17 @@ const Ma = { text: "#FFFFFF", bg: "#000000" }, Aa = (i, t) => {
|
|
|
3453
3460
|
}
|
|
3454
3461
|
}), i.restore();
|
|
3455
3462
|
};
|
|
3456
|
-
class
|
|
3463
|
+
class La extends Nt {
|
|
3457
3464
|
constructor(t) {
|
|
3458
3465
|
super(t);
|
|
3459
3466
|
}
|
|
3460
3467
|
drawMarker(t) {
|
|
3461
|
-
|
|
3468
|
+
Si(this.ctx, t);
|
|
3462
3469
|
}
|
|
3463
3470
|
}
|
|
3464
|
-
class
|
|
3471
|
+
class ka extends Ft {
|
|
3465
3472
|
constructor(t) {
|
|
3466
|
-
if (super("user-markers", t, { CanvasClass:
|
|
3473
|
+
if (super("user-markers", t, { CanvasClass: La, noDOM: !0 }), !this.canvas) throw new Error("[CS_V_UserMarkers] this.canvas must be defined");
|
|
3467
3474
|
}
|
|
3468
3475
|
render(t) {
|
|
3469
3476
|
this.canvas.clear();
|
|
@@ -3491,23 +3498,23 @@ class La extends Ft {
|
|
|
3491
3498
|
this.canvas.clear();
|
|
3492
3499
|
}
|
|
3493
3500
|
}
|
|
3494
|
-
const
|
|
3501
|
+
const Na = "sc-charts-cs";
|
|
3495
3502
|
class rt {
|
|
3496
3503
|
constructor(t) {
|
|
3497
3504
|
f(this, "block");
|
|
3498
3505
|
this.block = t;
|
|
3499
3506
|
}
|
|
3500
3507
|
gen(t) {
|
|
3501
|
-
return `${
|
|
3508
|
+
return `${Na}__${this.block}${t ? "-" + t : ""}`;
|
|
3502
3509
|
}
|
|
3503
3510
|
}
|
|
3504
|
-
const
|
|
3505
|
-
class
|
|
3511
|
+
const xe = new rt("comment-actions");
|
|
3512
|
+
class Fa extends L {
|
|
3506
3513
|
constructor({ onDelete: t, onUpdate: e }) {
|
|
3507
|
-
super({ className:
|
|
3508
|
-
const s = new
|
|
3514
|
+
super({ className: xe.gen() });
|
|
3515
|
+
const s = new L({ tag: "button", className: xe.gen("edit"), textContent: "Edit" }), n = new L({
|
|
3509
3516
|
tag: "button",
|
|
3510
|
-
className:
|
|
3517
|
+
className: xe.gen("delete"),
|
|
3511
3518
|
textContent: "Delete"
|
|
3512
3519
|
});
|
|
3513
3520
|
n.node.addEventListener("click", (a) => {
|
|
@@ -3517,7 +3524,7 @@ class ka extends E {
|
|
|
3517
3524
|
}), this.append(s.node, n.node);
|
|
3518
3525
|
}
|
|
3519
3526
|
}
|
|
3520
|
-
function
|
|
3527
|
+
function He(i, t) {
|
|
3521
3528
|
var n;
|
|
3522
3529
|
const e = (a) => {
|
|
3523
3530
|
if (!document.contains(i.node)) return;
|
|
@@ -3534,7 +3541,7 @@ function Ne(i, t) {
|
|
|
3534
3541
|
document.removeEventListener("mousedown", e), s == null || s();
|
|
3535
3542
|
}, i;
|
|
3536
3543
|
}
|
|
3537
|
-
class
|
|
3544
|
+
class Ha {
|
|
3538
3545
|
constructor() {
|
|
3539
3546
|
f(this, "node");
|
|
3540
3547
|
const t = "http://www.w3.org/2000/svg", e = document.createElementNS(t, "svg");
|
|
@@ -3573,33 +3580,33 @@ class Na {
|
|
|
3573
3580
|
}
|
|
3574
3581
|
}
|
|
3575
3582
|
const At = new rt("comment-list");
|
|
3576
|
-
class
|
|
3583
|
+
class Ia extends L {
|
|
3577
3584
|
constructor({ onDelete: e, onOpenEditor: s, comment: n, layout: a }) {
|
|
3578
3585
|
super({ className: At.gen("item") });
|
|
3579
3586
|
f(this, "actionTooltip");
|
|
3580
3587
|
f(this, "actionsTrigger");
|
|
3581
|
-
const r = new
|
|
3588
|
+
const r = new L({ className: At.gen("text"), textContent: n.text }), o = new L({
|
|
3582
3589
|
className: At.gen("created-at"),
|
|
3583
|
-
textContent:
|
|
3590
|
+
textContent: pa(new Date(n.createdAt))
|
|
3584
3591
|
});
|
|
3585
|
-
this.actionsTrigger = new
|
|
3592
|
+
this.actionsTrigger = new L({
|
|
3586
3593
|
tag: "button",
|
|
3587
3594
|
className: At.gen("action-trigger")
|
|
3588
3595
|
});
|
|
3589
|
-
const c = new
|
|
3596
|
+
const c = new Fa({
|
|
3590
3597
|
onDelete: e,
|
|
3591
3598
|
onUpdate: s
|
|
3592
3599
|
});
|
|
3593
|
-
this.actionTooltip =
|
|
3600
|
+
this.actionTooltip = He(c, () => {
|
|
3594
3601
|
this.actionTooltip.setVisible(!1);
|
|
3595
3602
|
}), this.actionsTrigger.node.addEventListener("click", () => {
|
|
3596
3603
|
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);
|
|
3597
3604
|
});
|
|
3598
|
-
const h = new
|
|
3599
|
-
this.actionTooltip.node.setAttribute("id", `ac-${n.id}`), h.append(r.node, this.actionsTrigger.node), this.actionsTrigger.append(new
|
|
3605
|
+
const h = new L({ className: At.gen("text-wrap") });
|
|
3606
|
+
this.actionTooltip.node.setAttribute("id", `ac-${n.id}`), h.append(r.node, this.actionsTrigger.node), this.actionsTrigger.append(new Ha().node), this.append(h.node, o.node);
|
|
3600
3607
|
}
|
|
3601
3608
|
}
|
|
3602
|
-
class
|
|
3609
|
+
class Ba {
|
|
3603
3610
|
constructor() {
|
|
3604
3611
|
f(this, "node");
|
|
3605
3612
|
const t = "http://www.w3.org/2000/svg", e = document.createElementNS(t, "svg");
|
|
@@ -3611,7 +3618,7 @@ class Ha {
|
|
|
3611
3618
|
), s.setAttribute("fill", "currentColor"), e.appendChild(s), this.node = e;
|
|
3612
3619
|
}
|
|
3613
3620
|
}
|
|
3614
|
-
class
|
|
3621
|
+
class Ra {
|
|
3615
3622
|
constructor() {
|
|
3616
3623
|
f(this, "node");
|
|
3617
3624
|
const t = "http://www.w3.org/2000/svg", e = document.createElementNS(t, "svg");
|
|
@@ -3623,7 +3630,7 @@ class Ia {
|
|
|
3623
3630
|
), s.setAttribute("fill", "currentColor"), e.appendChild(s), this.node = e;
|
|
3624
3631
|
}
|
|
3625
3632
|
}
|
|
3626
|
-
class
|
|
3633
|
+
class $a extends nt {
|
|
3627
3634
|
constructor(e) {
|
|
3628
3635
|
super({ className: "sc-charts-cs__comments-edit" });
|
|
3629
3636
|
f(this, "input");
|
|
@@ -3631,14 +3638,14 @@ class Ba extends nt {
|
|
|
3631
3638
|
f(this, "cancelBtn");
|
|
3632
3639
|
f(this, "_onSave");
|
|
3633
3640
|
f(this, "_onCancel");
|
|
3634
|
-
this._onSave = e.onSave, this._onCancel = e.onCancel, this.input = new
|
|
3641
|
+
this._onSave = e.onSave, this._onCancel = e.onCancel, this.input = new L({ tag: "textarea", className: "sc-charts-cs__comments-edit-input" }), this.saveBtn = new L({
|
|
3635
3642
|
tag: "button",
|
|
3636
3643
|
className: "sc-charts-cs__comments-edit-save-btn"
|
|
3637
|
-
}), this.saveBtn.append(new
|
|
3644
|
+
}), this.saveBtn.append(new Ba().node), this.cancelBtn = new L({
|
|
3638
3645
|
tag: "button",
|
|
3639
3646
|
className: "sc-charts-cs__comments-edit-cancel-btn"
|
|
3640
|
-
}), this.cancelBtn.append(new
|
|
3641
|
-
const s = new
|
|
3647
|
+
}), this.cancelBtn.append(new Ra().node);
|
|
3648
|
+
const s = new L({ className: "sc-charts-cs__comments-edit-btn-container" });
|
|
3642
3649
|
s.append(this.cancelBtn.node, this.saveBtn.node), this.append(this.input.node, s.node), this.state = { inputValue: e.initialValue || "", hasInitFocused: !1 }, this._setupListeners(), this.render();
|
|
3643
3650
|
}
|
|
3644
3651
|
_setupListeners() {
|
|
@@ -3653,10 +3660,10 @@ class Ba extends nt {
|
|
|
3653
3660
|
this.input.node.value = this.state.inputValue, this.saveBtn.node.disabled = !this.state.inputValue.trim(), this.state.hasInitFocused || (requestAnimationFrame(() => this.input.node.focus()), this.setState({ hasInitFocused: !0 }));
|
|
3654
3661
|
}
|
|
3655
3662
|
}
|
|
3656
|
-
const
|
|
3657
|
-
class
|
|
3663
|
+
const Oa = new rt("comment-list");
|
|
3664
|
+
class Pa extends nt {
|
|
3658
3665
|
constructor(e, s, n, a = {}) {
|
|
3659
|
-
super({ tag: "ul", className:
|
|
3666
|
+
super({ tag: "ul", className: Oa.gen(), ...a });
|
|
3660
3667
|
f(this, "_elements", {});
|
|
3661
3668
|
f(this, "_model");
|
|
3662
3669
|
f(this, "_view");
|
|
@@ -3672,7 +3679,7 @@ class $a extends nt {
|
|
|
3672
3679
|
}
|
|
3673
3680
|
_createItem(e) {
|
|
3674
3681
|
if (this.state.editId === e.id)
|
|
3675
|
-
return new
|
|
3682
|
+
return new $a({
|
|
3676
3683
|
onSave: (a) => {
|
|
3677
3684
|
this._model.comments.update(e.id, a), this.setState({ editId: null });
|
|
3678
3685
|
},
|
|
@@ -3681,7 +3688,7 @@ class $a extends nt {
|
|
|
3681
3688
|
},
|
|
3682
3689
|
initialValue: e.text
|
|
3683
3690
|
});
|
|
3684
|
-
const s = new
|
|
3691
|
+
const s = new Ia({
|
|
3685
3692
|
onDelete: () => {
|
|
3686
3693
|
this._model.comments.remove(e.id), s.actionTooltip.setVisible(!1);
|
|
3687
3694
|
},
|
|
@@ -3697,7 +3704,7 @@ class $a extends nt {
|
|
|
3697
3704
|
return Object.values(this._elements).sort((e, s) => e.order - s.order).map((e) => e.element.node);
|
|
3698
3705
|
}
|
|
3699
3706
|
}
|
|
3700
|
-
class
|
|
3707
|
+
class za {
|
|
3701
3708
|
constructor() {
|
|
3702
3709
|
f(this, "node");
|
|
3703
3710
|
const t = "http://www.w3.org/2000/svg", e = document.createElementNS(t, "svg");
|
|
@@ -3709,21 +3716,21 @@ class Oa {
|
|
|
3709
3716
|
), s.setAttribute("stroke", "currentColor"), s.setAttribute("stroke-linecap", "round"), s.setAttribute("stroke-linejoin", "round"), e.appendChild(s), this.node = e;
|
|
3710
3717
|
}
|
|
3711
3718
|
}
|
|
3712
|
-
const qt = new rt(""),
|
|
3713
|
-
class
|
|
3719
|
+
const qt = new rt(""), Ce = new rt("add-field");
|
|
3720
|
+
class Mi extends nt {
|
|
3714
3721
|
constructor({ onAdd: e, blockName: s }) {
|
|
3715
3722
|
qt.block = s;
|
|
3716
|
-
super({ className: qt.gen() + " " +
|
|
3723
|
+
super({ className: qt.gen() + " " + Ce.gen() });
|
|
3717
3724
|
f(this, "btn");
|
|
3718
3725
|
f(this, "input");
|
|
3719
3726
|
f(this, "_onAdd");
|
|
3720
|
-
this._onAdd = e, this.state = { inputValue: "" }, this.input = new
|
|
3727
|
+
this._onAdd = e, this.state = { inputValue: "" }, this.input = new L({
|
|
3721
3728
|
tag: "input",
|
|
3722
|
-
className: qt.gen("input") + " " +
|
|
3723
|
-
}), this.input.node.setAttribute("placeholder", "Add comment..."), this.btn = new
|
|
3729
|
+
className: qt.gen("input") + " " + Ce.gen("input")
|
|
3730
|
+
}), this.input.node.setAttribute("placeholder", "Add comment..."), this.btn = new L({
|
|
3724
3731
|
tag: "button",
|
|
3725
|
-
className: qt.gen("btn") + " " +
|
|
3726
|
-
}), this.btn.append(new
|
|
3732
|
+
className: qt.gen("btn") + " " + Ce.gen("btn")
|
|
3733
|
+
}), this.btn.append(new za().node), this.append(this.input.node, this.btn.node), this._setupListeners(), this.render();
|
|
3727
3734
|
}
|
|
3728
3735
|
_addComment() {
|
|
3729
3736
|
this._onAdd(this.input.node.value), this.setState({ inputValue: "" }), this.input.node.value = "", this.input.node.blur();
|
|
@@ -3742,16 +3749,16 @@ class Ti extends nt {
|
|
|
3742
3749
|
this.btn.node.disabled = !this.state.inputValue.trim();
|
|
3743
3750
|
}
|
|
3744
3751
|
}
|
|
3745
|
-
const
|
|
3746
|
-
class
|
|
3752
|
+
const Va = new rt("list-tooltip"), Te = 8;
|
|
3753
|
+
class Wa extends nt {
|
|
3747
3754
|
constructor(e, s, n) {
|
|
3748
|
-
super({ className:
|
|
3755
|
+
super({ className: Va.gen() });
|
|
3749
3756
|
f(this, "_list");
|
|
3750
3757
|
f(this, "_addField");
|
|
3751
3758
|
f(this, "_size", null);
|
|
3752
3759
|
f(this, "_model");
|
|
3753
3760
|
f(this, "_prevIsShow", !1);
|
|
3754
|
-
this._model = s, this.state = { isShow: !1, comments: e }, this._list = new
|
|
3761
|
+
this._model = s, this.state = { isShow: !1, comments: e }, this._list = new Pa(e, s, n), this._addField = new Mi({
|
|
3755
3762
|
blockName: "list-tooltip-add",
|
|
3756
3763
|
onAdd: (a) => {
|
|
3757
3764
|
const r = e[0].date, o = e[0].price, c = {
|
|
@@ -3767,7 +3774,7 @@ class za extends nt {
|
|
|
3767
3774
|
}
|
|
3768
3775
|
render() {
|
|
3769
3776
|
const { isShow: e, comments: s } = this.state, { width: n, height: a } = this._model.layout.area;
|
|
3770
|
-
this._prevIsShow !== e && (this._list.forceUpdate(), this._prevIsShow = e), this.node.style.maxHeight = a / 2 -
|
|
3777
|
+
this._prevIsShow !== e && (this._list.forceUpdate(), this._prevIsShow = e), this.node.style.maxHeight = a / 2 - Te + "px", this.setVisible(e), e && !this._size && (this.updateAbsolutePosition(), this._size = this.absolutePosition, this.position(n / 2 - this._size.width - Te, a / 2 + Te)), this._list.setState({ items: s }), requestAnimationFrame(() => {
|
|
3771
3778
|
this._list.node.scrollTop = this._list.node.scrollHeight;
|
|
3772
3779
|
});
|
|
3773
3780
|
}
|
|
@@ -3775,7 +3782,7 @@ class za extends nt {
|
|
|
3775
3782
|
return this._list;
|
|
3776
3783
|
}
|
|
3777
3784
|
}
|
|
3778
|
-
class
|
|
3785
|
+
class Ya {
|
|
3779
3786
|
constructor() {
|
|
3780
3787
|
f(this, "node");
|
|
3781
3788
|
const t = "http://www.w3.org/2000/svg", e = document.createElementNS(t, "svg");
|
|
@@ -3787,7 +3794,7 @@ class Va {
|
|
|
3787
3794
|
), s.setAttribute("fill", "currentColor"), e.appendChild(s), this.node = e;
|
|
3788
3795
|
}
|
|
3789
3796
|
}
|
|
3790
|
-
class
|
|
3797
|
+
class ja extends nt {
|
|
3791
3798
|
constructor({ x: e, ...s }, n) {
|
|
3792
3799
|
super(s);
|
|
3793
3800
|
f(this, "_colors");
|
|
@@ -3795,7 +3802,7 @@ class Wa extends nt {
|
|
|
3795
3802
|
x: e,
|
|
3796
3803
|
y: n.layout.xAxis.top,
|
|
3797
3804
|
isActive: !1
|
|
3798
|
-
}, this.node.append(new
|
|
3805
|
+
}, this.node.append(new Ya().node), this.render();
|
|
3799
3806
|
}
|
|
3800
3807
|
render() {
|
|
3801
3808
|
const { x: e, y: s, isActive: n } = this.state;
|
|
@@ -3804,11 +3811,11 @@ class Wa extends nt {
|
|
|
3804
3811
|
this.node.style.backgroundColor = this._colors[`bg${a}`], this.node.style.color = this._colors[`icon${a}`];
|
|
3805
3812
|
}
|
|
3806
3813
|
}
|
|
3807
|
-
const
|
|
3808
|
-
class
|
|
3814
|
+
const pi = new rt("comment-box");
|
|
3815
|
+
class Xa extends nt {
|
|
3809
3816
|
constructor({ boxId: e, model: s, view: n, comments: a, coords: r, onBoxActivate: o, onBoxDeactivate: c }) {
|
|
3810
|
-
super({ className:
|
|
3811
|
-
f(this, "pointer", new
|
|
3817
|
+
super({ className: pi.gen() });
|
|
3818
|
+
f(this, "pointer", new L({ className: "sc-charts-cs__comments-pointer" }));
|
|
3812
3819
|
f(this, "tooltip");
|
|
3813
3820
|
f(this, "anchor");
|
|
3814
3821
|
f(this, "_onBoxActivate");
|
|
@@ -3818,10 +3825,10 @@ class Ya extends nt {
|
|
|
3818
3825
|
isActive: !1,
|
|
3819
3826
|
comments: a,
|
|
3820
3827
|
coords: r
|
|
3821
|
-
}, this.pointer.position(r), this.anchor = new
|
|
3828
|
+
}, this.pointer.position(r), this.anchor = new ja({ x: r.x, className: pi.gen("anchor") }, s), this.anchor.node.addEventListener("click", () => {
|
|
3822
3829
|
const h = !this.state.isActive;
|
|
3823
3830
|
h ? this._onBoxActivate(this._boxId) : this._onBoxDeactivate(this._boxId), this.setState({ isActive: h });
|
|
3824
|
-
}), this.tooltip =
|
|
3831
|
+
}), this.tooltip = He(new Wa(a, s, n), (h) => {
|
|
3825
3832
|
this.state.isActive && (this.anchor.node.contains(h.target) || (this._onBoxDeactivate(this._boxId), this.setState({ isActive: !1 })));
|
|
3826
3833
|
}), this.append(this.pointer.node, this.anchor.node, this.tooltip.node), this.render();
|
|
3827
3834
|
}
|
|
@@ -3830,7 +3837,7 @@ class Ya extends nt {
|
|
|
3830
3837
|
this.pointer.position(n), this.pointer.setVisible(e), this.anchor.setState({ x: n.x, isActive: e }), this.tooltip.setState({ comments: s, isShow: e });
|
|
3831
3838
|
}
|
|
3832
3839
|
}
|
|
3833
|
-
class
|
|
3840
|
+
class Ua {
|
|
3834
3841
|
static animateTo(t, e, s, n) {
|
|
3835
3842
|
const a = t.scales.panOffsetX + (t.layout.area.width / 2 - e), r = t.scales.panOffsetY + (t.layout.area.height / 2 - s), o = 300, c = performance.now(), h = t.scales.panOffsetX, d = t.scales.panOffsetY, g = (_) => {
|
|
3836
3843
|
const m = _ - c, v = Math.min(m / o, 1), b = v * v * (3 - 2 * v), w = h + (a - h) * b, x = d + (r - d) * b;
|
|
@@ -3843,19 +3850,19 @@ class ja {
|
|
|
3843
3850
|
this.animateTo(t, a, r, n);
|
|
3844
3851
|
}
|
|
3845
3852
|
}
|
|
3846
|
-
const
|
|
3847
|
-
class
|
|
3853
|
+
const Se = new rt("comments-context");
|
|
3854
|
+
class Ga extends nt {
|
|
3848
3855
|
constructor() {
|
|
3849
|
-
super({ className:
|
|
3856
|
+
super({ className: Se.gen() });
|
|
3850
3857
|
f(this, "pointer");
|
|
3851
3858
|
f(this, "addField");
|
|
3852
3859
|
f(this, "menu");
|
|
3853
3860
|
f(this, "_size", null);
|
|
3854
3861
|
f(this, "_model", null);
|
|
3855
3862
|
f(this, "_candle", null);
|
|
3856
|
-
this.state = { candle: null, isShow: !1, model: null }, this.pointer = new
|
|
3863
|
+
this.state = { candle: null, isShow: !1, model: null }, this.pointer = new L({ className: Se.gen("pointer") }), this.menu = new L({ className: Se.gen("menu") }), He(this.menu, () => {
|
|
3857
3864
|
this.setState({ isShow: !1 });
|
|
3858
|
-
}), this.addField = new
|
|
3865
|
+
}), this.addField = new Mi({
|
|
3859
3866
|
blockName: "context-add",
|
|
3860
3867
|
onAdd: (e) => {
|
|
3861
3868
|
!this._model || !this._candle || (this._model.comments.add({
|
|
@@ -3880,7 +3887,7 @@ class Xa extends nt {
|
|
|
3880
3887
|
y: n == null ? void 0 : n.scales.y.convert((e.open + e.close) / 2)
|
|
3881
3888
|
};
|
|
3882
3889
|
this.pointer.position(a), this._size || (this.menu.position(a), this.menu.updateAbsolutePosition());
|
|
3883
|
-
const r =
|
|
3890
|
+
const r = Fe({
|
|
3884
3891
|
size: this.menu.absolutePosition,
|
|
3885
3892
|
parent: n.layout.area,
|
|
3886
3893
|
offset: 9,
|
|
@@ -3889,14 +3896,14 @@ class Xa extends nt {
|
|
|
3889
3896
|
this._changeInputCorner(r.side), this.menu.position(r.x, r.y);
|
|
3890
3897
|
}
|
|
3891
3898
|
}
|
|
3892
|
-
class
|
|
3899
|
+
class Za extends Ft {
|
|
3893
3900
|
constructor(e) {
|
|
3894
3901
|
super("comments", e, { noCanvas: !0 });
|
|
3895
3902
|
f(this, "boxes", {});
|
|
3896
3903
|
f(this, "contextMenu");
|
|
3897
3904
|
f(this, "_view");
|
|
3898
3905
|
if (!this.dom) throw new Error("[CS_V_Comments] this.dom must be defined");
|
|
3899
|
-
this.contextMenu = new
|
|
3906
|
+
this.contextMenu = new Ga(), this._view = e, e.domElements.append(this.contextMenu.node);
|
|
3900
3907
|
}
|
|
3901
3908
|
_getCandleCoords(e, s) {
|
|
3902
3909
|
return {
|
|
@@ -3905,7 +3912,7 @@ class Ua extends Ft {
|
|
|
3905
3912
|
};
|
|
3906
3913
|
}
|
|
3907
3914
|
createBox({ boxId: e, coords: s, model: n, comments: a }) {
|
|
3908
|
-
const r = new
|
|
3915
|
+
const r = new Xa({
|
|
3909
3916
|
boxId: e,
|
|
3910
3917
|
model: n,
|
|
3911
3918
|
comments: a,
|
|
@@ -3913,7 +3920,7 @@ class Ua extends Ft {
|
|
|
3913
3920
|
view: this._view,
|
|
3914
3921
|
onBoxActivate: (o) => {
|
|
3915
3922
|
const c = a[0].candle;
|
|
3916
|
-
|
|
3923
|
+
Ua.animateToDataCoords(n, c.open_time, (c.open + c.close) / 2), this.boxes[o].setState({ isActive: !0 });
|
|
3917
3924
|
},
|
|
3918
3925
|
onBoxDeactivate: (o) => this.boxes[o].setState({ isActive: !1 })
|
|
3919
3926
|
});
|
|
@@ -3930,12 +3937,12 @@ class Ua extends Ft {
|
|
|
3930
3937
|
});
|
|
3931
3938
|
}
|
|
3932
3939
|
}
|
|
3933
|
-
class
|
|
3940
|
+
class qa extends Nt {
|
|
3934
3941
|
constructor(t) {
|
|
3935
3942
|
super(t);
|
|
3936
3943
|
}
|
|
3937
3944
|
drawMarker({ text: t, startLineCoords: e, endMarkerCoords: s, colors: n, type: a, side: r }) {
|
|
3938
|
-
|
|
3945
|
+
Si(this.ctx, {
|
|
3939
3946
|
text: t,
|
|
3940
3947
|
colors: n,
|
|
3941
3948
|
startLineCoords: e,
|
|
@@ -3945,9 +3952,9 @@ class Ga extends Nt {
|
|
|
3945
3952
|
});
|
|
3946
3953
|
}
|
|
3947
3954
|
}
|
|
3948
|
-
class
|
|
3955
|
+
class Ja extends Ft {
|
|
3949
3956
|
constructor(t) {
|
|
3950
|
-
if (super("guides", t, { CanvasClass:
|
|
3957
|
+
if (super("guides", t, { CanvasClass: qa, noDOM: !0 }), !this.canvas) throw new Error("[CS_V_Guides] Canvas must be defined");
|
|
3951
3958
|
}
|
|
3952
3959
|
render(t, { x: e, y: s }) {
|
|
3953
3960
|
if (this.canvas.clear(), t.config.guides.isShowY) {
|
|
@@ -3974,17 +3981,17 @@ class Za extends Ft {
|
|
|
3974
3981
|
}
|
|
3975
3982
|
}
|
|
3976
3983
|
}
|
|
3977
|
-
class
|
|
3984
|
+
class Qa extends nt {
|
|
3978
3985
|
constructor(e) {
|
|
3979
3986
|
super({ className: e });
|
|
3980
3987
|
f(this, "_isFirstShow", !1);
|
|
3981
|
-
const s = new
|
|
3988
|
+
const s = new L({ tag: "p" });
|
|
3982
3989
|
s.node.textContent = "No data from broker", this.append(s.node), this.state = { isShow: !1, x: 0, y: 0, parent: G.empty() }, this.render();
|
|
3983
3990
|
}
|
|
3984
3991
|
render() {
|
|
3985
3992
|
const { isShow: e, x: s, y: n, parent: a } = this.state;
|
|
3986
3993
|
e && !this._isFirstShow && (this.updateAbsolutePosition(), this._isFirstShow = !0), this.setVisible(e);
|
|
3987
|
-
const r =
|
|
3994
|
+
const r = Fe({
|
|
3988
3995
|
size: this.absolutePosition,
|
|
3989
3996
|
parent: a,
|
|
3990
3997
|
coords: { x: s, y: n }
|
|
@@ -3992,7 +3999,7 @@ class qa extends nt {
|
|
|
3992
3999
|
this.position(r.x, r.y);
|
|
3993
4000
|
}
|
|
3994
4001
|
}
|
|
3995
|
-
class
|
|
4002
|
+
class Ka extends Nt {
|
|
3996
4003
|
constructor(e) {
|
|
3997
4004
|
super(e);
|
|
3998
4005
|
f(this, "domain", null);
|
|
@@ -4048,14 +4055,14 @@ class Ja extends Nt {
|
|
|
4048
4055
|
};
|
|
4049
4056
|
}
|
|
4050
4057
|
}
|
|
4051
|
-
class
|
|
4058
|
+
class tr extends Ft {
|
|
4052
4059
|
constructor(e) {
|
|
4053
|
-
super("candles", e, { CanvasClass:
|
|
4060
|
+
super("candles", e, { CanvasClass: Ka });
|
|
4054
4061
|
f(this, "_noDataTooltip", null);
|
|
4055
4062
|
f(this, "limiter");
|
|
4056
4063
|
if (!this.dom) throw new Error("[CS_V_Candles] this.dom must be defined");
|
|
4057
4064
|
if (!this.canvas) throw new Error("[CS_V_Candles] this.canvas must be defined");
|
|
4058
|
-
this._noDataTooltip = new
|
|
4065
|
+
this._noDataTooltip = new Qa(this.cx("no-data")), this.limiter = new L({ className: this.cx("limiter") }), this.limiter.setVisible(!1), this.dom.append(this._noDataTooltip.node, this.limiter.node);
|
|
4059
4066
|
}
|
|
4060
4067
|
get noDataTooltip() {
|
|
4061
4068
|
return this._noDataTooltip;
|
|
@@ -4073,7 +4080,7 @@ class Qa extends Ft {
|
|
|
4073
4080
|
}
|
|
4074
4081
|
}
|
|
4075
4082
|
}
|
|
4076
|
-
class
|
|
4083
|
+
class er {
|
|
4077
4084
|
constructor(t) {
|
|
4078
4085
|
f(this, "container");
|
|
4079
4086
|
f(this, "width");
|
|
@@ -4090,14 +4097,14 @@ class Ka {
|
|
|
4090
4097
|
f(this, "candles");
|
|
4091
4098
|
f(this, "_logoImage");
|
|
4092
4099
|
f(this, "_logoSrc");
|
|
4093
|
-
this.container = t, this.wrapper = new
|
|
4100
|
+
this.container = t, this.wrapper = new L({ tag: "div", className: "sc-charts-cs" }), t.append(this.wrapper.node);
|
|
4094
4101
|
const { width: e, height: s } = t.getBoundingClientRect();
|
|
4095
4102
|
this.width = e, this.height = s, this.mainCanvas = new Nt({
|
|
4096
4103
|
className: "sc-charts-cs__canvas-main",
|
|
4097
4104
|
width: e,
|
|
4098
4105
|
height: s,
|
|
4099
4106
|
isMain: !0
|
|
4100
|
-
}), this.domElements = new
|
|
4107
|
+
}), this.domElements = new L({ tag: "div", className: "sc-charts-cs__dom-elements" }), this.canvasesContainer = new L({ 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 zn(this.mainCanvas.node), this.comments = new Za(this), this.candles = new tr(this), this.trade = new Ma(this), this.guideMarkers = new Ja(this), this.userMarkers = new ka(this);
|
|
4101
4108
|
}
|
|
4102
4109
|
_prepareLogo(t) {
|
|
4103
4110
|
const e = t.config.logo;
|
|
@@ -4132,10 +4139,10 @@ class Ka {
|
|
|
4132
4139
|
n.save(), n.globalAlpha = e.opacity ?? 0.2, n.drawImage(s, g, _, r, c), n.restore();
|
|
4133
4140
|
}
|
|
4134
4141
|
renderAll(t) {
|
|
4135
|
-
this._prepareLogo(t), this.mainCanvas.clear(), this.candles.render(t),
|
|
4142
|
+
this._prepareLogo(t), this.mainCanvas.clear(), this.candles.render(t), we.xAxis(this.mainCanvas.ctx, t), we.yAxis(this.mainCanvas.ctx, t), we.intersection(this.mainCanvas.ctx, t), this.trade.renderAll(t), this.userMarkers.render(t), this.comments.render(t), this._drawLogo(t);
|
|
4136
4143
|
}
|
|
4137
4144
|
}
|
|
4138
|
-
class
|
|
4145
|
+
class ir {
|
|
4139
4146
|
constructor(t) {
|
|
4140
4147
|
f(this, "logColors", {
|
|
4141
4148
|
init_model: "color: green",
|
|
@@ -4161,13 +4168,13 @@ class tr {
|
|
|
4161
4168
|
console.log(`%c[SUBSCRIBE] ${t}`, s, n);
|
|
4162
4169
|
}
|
|
4163
4170
|
}
|
|
4164
|
-
class
|
|
4171
|
+
class sr {
|
|
4165
4172
|
constructor(t, e) {
|
|
4166
4173
|
f(this, "_model");
|
|
4167
4174
|
f(this, "_view");
|
|
4168
4175
|
f(this, "_enableLogging");
|
|
4169
4176
|
f(this, "_logger");
|
|
4170
|
-
this._model = t, this._view = e, this._enableLogging = !1, this._logger = new
|
|
4177
|
+
this._model = t, this._view = e, this._enableLogging = !1, this._logger = new ir(["scale_event"]);
|
|
4171
4178
|
}
|
|
4172
4179
|
subscribeWithLogging(t, e) {
|
|
4173
4180
|
const s = (n) => {
|
|
@@ -4220,7 +4227,7 @@ class er {
|
|
|
4220
4227
|
});
|
|
4221
4228
|
}
|
|
4222
4229
|
}
|
|
4223
|
-
class
|
|
4230
|
+
class vi {
|
|
4224
4231
|
constructor() {
|
|
4225
4232
|
f(this, "_map", /* @__PURE__ */ new Map());
|
|
4226
4233
|
}
|
|
@@ -4251,10 +4258,10 @@ class _i {
|
|
|
4251
4258
|
return a;
|
|
4252
4259
|
}
|
|
4253
4260
|
}
|
|
4254
|
-
class
|
|
4261
|
+
class nr {
|
|
4255
4262
|
constructor() {
|
|
4256
4263
|
f(this, "_elements", []);
|
|
4257
|
-
f(this, "_listeners", new
|
|
4264
|
+
f(this, "_listeners", new vi());
|
|
4258
4265
|
f(this, "_lastHovered", /* @__PURE__ */ new Set());
|
|
4259
4266
|
f(this, "_dragContext", null);
|
|
4260
4267
|
}
|
|
@@ -4268,7 +4275,7 @@ class ir {
|
|
|
4268
4275
|
this._elements = this._elements.filter((e) => e !== t), this._listeners.removeAll(t), this._lastHovered.delete(t);
|
|
4269
4276
|
}
|
|
4270
4277
|
clear() {
|
|
4271
|
-
this._elements = [], this._listeners = new
|
|
4278
|
+
this._elements = [], this._listeners = new vi(), this._lastHovered.clear();
|
|
4272
4279
|
}
|
|
4273
4280
|
on(t, e, s) {
|
|
4274
4281
|
this._listeners.add(t, e, s);
|
|
@@ -4397,7 +4404,7 @@ class ir {
|
|
|
4397
4404
|
return this._listeners.emit(t, n), s;
|
|
4398
4405
|
}
|
|
4399
4406
|
}
|
|
4400
|
-
class
|
|
4407
|
+
class ar {
|
|
4401
4408
|
constructor(t) {
|
|
4402
4409
|
this.model = t;
|
|
4403
4410
|
}
|
|
@@ -4423,12 +4430,12 @@ class sr {
|
|
|
4423
4430
|
return null;
|
|
4424
4431
|
}
|
|
4425
4432
|
}
|
|
4426
|
-
class
|
|
4433
|
+
class rr {
|
|
4427
4434
|
constructor(t, e) {
|
|
4428
4435
|
f(this, "_model");
|
|
4429
4436
|
f(this, "_hitManager");
|
|
4430
4437
|
f(this, "_hit");
|
|
4431
|
-
this._model = t, this._hitManager = e, this._hit = new
|
|
4438
|
+
this._model = t, this._hitManager = e, this._hit = new ar(t), this._hitManager.register(this._hit);
|
|
4432
4439
|
}
|
|
4433
4440
|
register() {
|
|
4434
4441
|
this._hitManager.on(this._hit, "mouseover", (t) => {
|
|
@@ -4441,7 +4448,7 @@ class nr {
|
|
|
4441
4448
|
});
|
|
4442
4449
|
}
|
|
4443
4450
|
}
|
|
4444
|
-
class
|
|
4451
|
+
class or {
|
|
4445
4452
|
constructor(t) {
|
|
4446
4453
|
this.model = t;
|
|
4447
4454
|
}
|
|
@@ -4468,12 +4475,12 @@ class ar {
|
|
|
4468
4475
|
return null;
|
|
4469
4476
|
}
|
|
4470
4477
|
}
|
|
4471
|
-
class
|
|
4478
|
+
class lr {
|
|
4472
4479
|
constructor(t, e) {
|
|
4473
4480
|
f(this, "_model");
|
|
4474
4481
|
f(this, "_hitManager");
|
|
4475
4482
|
f(this, "_tradeLabelHit");
|
|
4476
|
-
this._model = t, this._hitManager = e, this._tradeLabelHit = new
|
|
4483
|
+
this._model = t, this._hitManager = e, this._tradeLabelHit = new or(t), this._hitManager.register(this._tradeLabelHit);
|
|
4477
4484
|
}
|
|
4478
4485
|
register() {
|
|
4479
4486
|
this._hitManager.on(this._tradeLabelHit, "click", (t) => {
|
|
@@ -4499,7 +4506,7 @@ class rr {
|
|
|
4499
4506
|
});
|
|
4500
4507
|
}
|
|
4501
4508
|
}
|
|
4502
|
-
class
|
|
4509
|
+
class cr {
|
|
4503
4510
|
constructor(t) {
|
|
4504
4511
|
this.model = t;
|
|
4505
4512
|
}
|
|
@@ -4513,7 +4520,7 @@ class or {
|
|
|
4513
4520
|
} : null;
|
|
4514
4521
|
}
|
|
4515
4522
|
}
|
|
4516
|
-
class
|
|
4523
|
+
class hr {
|
|
4517
4524
|
constructor(t) {
|
|
4518
4525
|
this.model = t;
|
|
4519
4526
|
}
|
|
@@ -4527,7 +4534,7 @@ class lr {
|
|
|
4527
4534
|
} : null;
|
|
4528
4535
|
}
|
|
4529
4536
|
}
|
|
4530
|
-
class
|
|
4537
|
+
class dr {
|
|
4531
4538
|
constructor(t) {
|
|
4532
4539
|
this.model = t;
|
|
4533
4540
|
}
|
|
@@ -4541,7 +4548,7 @@ class cr {
|
|
|
4541
4548
|
} : null;
|
|
4542
4549
|
}
|
|
4543
4550
|
}
|
|
4544
|
-
function
|
|
4551
|
+
function ur(i, t) {
|
|
4545
4552
|
let e = { x: 0, y: 0 }, s = null;
|
|
4546
4553
|
return (n) => {
|
|
4547
4554
|
Math.abs(n.x - e.x) < i && Math.abs(n.y - e.y) < i || (e = { x: n.x, y: n.y }, s && cancelAnimationFrame(s), s = requestAnimationFrame(() => {
|
|
@@ -4549,7 +4556,7 @@ function hr(i, t) {
|
|
|
4549
4556
|
}));
|
|
4550
4557
|
};
|
|
4551
4558
|
}
|
|
4552
|
-
function
|
|
4559
|
+
function fr(i, t) {
|
|
4553
4560
|
let e = null;
|
|
4554
4561
|
return (s) => {
|
|
4555
4562
|
const n = s.x - (s.prevX ?? s.x), a = s.y - (s.prevY ?? s.y);
|
|
@@ -4558,14 +4565,14 @@ function dr(i, t) {
|
|
|
4558
4565
|
}));
|
|
4559
4566
|
};
|
|
4560
4567
|
}
|
|
4561
|
-
function
|
|
4568
|
+
function De(i, t) {
|
|
4562
4569
|
const { width: e } = t.candles.limiter.absolutePosition, s = i.config.candles.baseWidth, n = i.config.candles.limiterOffset.left + i.config.candles.limiterOffset.right, r = i.scales.x.convert(i.candles.allData[0].open_time) - e - s / 2 - n;
|
|
4563
4570
|
r > 0 && i.scales.pan("x", -r);
|
|
4564
4571
|
}
|
|
4565
|
-
function
|
|
4572
|
+
function Ee(i) {
|
|
4566
4573
|
return i.candles.limiter.absolutePosition.width > 0;
|
|
4567
4574
|
}
|
|
4568
|
-
class
|
|
4575
|
+
class Ie {
|
|
4569
4576
|
constructor(t, e, s) {
|
|
4570
4577
|
f(this, "_model");
|
|
4571
4578
|
f(this, "_hitManager");
|
|
@@ -4573,24 +4580,24 @@ class Fe {
|
|
|
4573
4580
|
this._model = t, this._hitManager = e, this._hit = s, e.register(s);
|
|
4574
4581
|
}
|
|
4575
4582
|
}
|
|
4576
|
-
class
|
|
4583
|
+
class gr extends Ie {
|
|
4577
4584
|
constructor(e, s, n) {
|
|
4578
|
-
super(e, s, new
|
|
4585
|
+
super(e, s, new cr(e));
|
|
4579
4586
|
f(this, "_view");
|
|
4580
4587
|
this._view = n;
|
|
4581
4588
|
}
|
|
4582
4589
|
register() {
|
|
4583
4590
|
this._hitManager.on(this._hit, "drag", (e) => {
|
|
4584
4591
|
const s = e.x - (e.prevX ?? e.x);
|
|
4585
|
-
this._model.scales.scale("x", -s), this._view &&
|
|
4592
|
+
this._model.scales.scale("x", -s), this._view && Ee(this._view) && De(this._model, this._view);
|
|
4586
4593
|
}), this._hitManager.on(this._hit, "dblclick", () => {
|
|
4587
4594
|
this._model.scales.scale("x", 1, "absolute"), this._model.scales.pan("x", 0, "absolute");
|
|
4588
4595
|
});
|
|
4589
4596
|
}
|
|
4590
4597
|
}
|
|
4591
|
-
class
|
|
4598
|
+
class mr extends Ie {
|
|
4592
4599
|
constructor(t, e) {
|
|
4593
|
-
super(t, e, new
|
|
4600
|
+
super(t, e, new dr(t));
|
|
4594
4601
|
}
|
|
4595
4602
|
register() {
|
|
4596
4603
|
this._hitManager.on(this._hit, "drag", (t) => {
|
|
@@ -4601,9 +4608,9 @@ class fr extends Fe {
|
|
|
4601
4608
|
});
|
|
4602
4609
|
}
|
|
4603
4610
|
}
|
|
4604
|
-
class
|
|
4611
|
+
class _r extends Ie {
|
|
4605
4612
|
constructor(e, s, n) {
|
|
4606
|
-
super(e, n, new
|
|
4613
|
+
super(e, n, new hr(e));
|
|
4607
4614
|
f(this, "_view");
|
|
4608
4615
|
this._view = s;
|
|
4609
4616
|
}
|
|
@@ -4611,7 +4618,7 @@ class gr extends Fe {
|
|
|
4611
4618
|
this._hitManager.on(
|
|
4612
4619
|
this._hit,
|
|
4613
4620
|
"mousemove",
|
|
4614
|
-
|
|
4621
|
+
ur(1, (e) => {
|
|
4615
4622
|
this._view.guideMarkers.render(this._model, { x: e.x, y: e.y });
|
|
4616
4623
|
})
|
|
4617
4624
|
), this._hitManager.on(this._hit, "mouseleave", () => {
|
|
@@ -4619,21 +4626,21 @@ class gr extends Fe {
|
|
|
4619
4626
|
}), this._hitManager.on(
|
|
4620
4627
|
this._hit,
|
|
4621
4628
|
"drag",
|
|
4622
|
-
|
|
4623
|
-
this._model.scales.pan("x", e.x - (e.prevX ?? e.x)),
|
|
4629
|
+
fr(1, (e) => {
|
|
4630
|
+
this._model.scales.pan("x", e.x - (e.prevX ?? e.x)), Ee(this._view) && De(this._model, this._view), this._model.scales.pan("y", e.y - (e.prevY ?? e.y)), this._view.guideMarkers.render(this._model, { x: e.x, y: e.y });
|
|
4624
4631
|
})
|
|
4625
4632
|
), this._hitManager.on(this._hit, "contextmenu", ({ x: e }) => {
|
|
4626
|
-
const s = this._model.scales.x.invert(e), n =
|
|
4633
|
+
const s = this._model.scales.x.invert(e), n = Ne.findByDate(s, this._model.candles.allData);
|
|
4627
4634
|
n && (this._view.comments.contextMenu.setState({ isShow: !0, candle: n }), this._view.comments.render(this._model));
|
|
4628
4635
|
}), this._hitManager.on(this._hit, "wheel", (e) => {
|
|
4629
4636
|
var a, r;
|
|
4630
4637
|
if (!e.deltaY) return;
|
|
4631
4638
|
const s = -e.deltaY, n = (r = (a = this._model.config) == null ? void 0 : a.candles) == null ? void 0 : r.zoomOnWheel;
|
|
4632
|
-
["x", "both"].includes(n) && (this._model.scales.scale("x", s),
|
|
4639
|
+
["x", "both"].includes(n) && (this._model.scales.scale("x", s), Ee(this._view) && De(this._model, this._view)), ["y", "both"].includes(n) && this._model.scales.scale("y", s);
|
|
4633
4640
|
});
|
|
4634
4641
|
}
|
|
4635
4642
|
}
|
|
4636
|
-
class
|
|
4643
|
+
class pr {
|
|
4637
4644
|
constructor(t, e, s) {
|
|
4638
4645
|
f(this, "_hitManager");
|
|
4639
4646
|
f(this, "_candlesHandler");
|
|
@@ -4641,29 +4648,30 @@ class mr {
|
|
|
4641
4648
|
f(this, "_xAxisHandler");
|
|
4642
4649
|
f(this, "_yAxisHandler");
|
|
4643
4650
|
f(this, "_areaHandler");
|
|
4644
|
-
this._hitManager = s, this._candlesHandler = new
|
|
4651
|
+
this._hitManager = s, this._candlesHandler = new rr(t, this._hitManager), this._tradeLabelsHandler = new lr(t, this._hitManager), this._xAxisHandler = new gr(t, this._hitManager, e), this._yAxisHandler = new mr(t, this._hitManager), this._areaHandler = new _r(t, e, this._hitManager);
|
|
4645
4652
|
}
|
|
4646
4653
|
register() {
|
|
4647
4654
|
this._candlesHandler.register(), this._tradeLabelsHandler.register(), this._xAxisHandler.register(), this._yAxisHandler.register(), this._areaHandler.register();
|
|
4648
4655
|
}
|
|
4649
4656
|
}
|
|
4650
|
-
class
|
|
4657
|
+
const te = class te {
|
|
4651
4658
|
constructor(t, e) {
|
|
4652
4659
|
f(this, "_model");
|
|
4653
4660
|
f(this, "_view");
|
|
4654
4661
|
f(this, "_subscriptionsManager");
|
|
4655
|
-
f(this, "_hitManager", new
|
|
4662
|
+
f(this, "_hitManager", new nr());
|
|
4656
4663
|
f(this, "_touchId", null);
|
|
4657
4664
|
f(this, "_pinchDistance", null);
|
|
4665
|
+
f(this, "_touchStartCoords", null);
|
|
4658
4666
|
f(this, "_boundTouchMove", this.onDocumentTouchMove.bind(this));
|
|
4659
4667
|
f(this, "_boundTouchEnd", this.onDocumentTouchEnd.bind(this));
|
|
4660
4668
|
f(this, "_boundTouchCancel", this.onDocumentTouchCancel.bind(this));
|
|
4661
4669
|
f(this, "_boundMouseMove", this.onDocumentMouseMove.bind(this));
|
|
4662
4670
|
f(this, "_boundMouseUp", this.onDocumentMouseUp.bind(this));
|
|
4663
|
-
this._model = t, this._view = e, this._subscriptionsManager = new
|
|
4671
|
+
this._model = t, this._view = e, this._subscriptionsManager = new sr(t, e);
|
|
4664
4672
|
}
|
|
4665
4673
|
init() {
|
|
4666
|
-
this._subscriptionsManager.init(), this._model.init(), this._view.binding.mousemove(this.onMouseMove.bind(this)), this._view.binding.mousedown(this.onMouseDown.bind(this)), this._view.binding.mouseup(this.onMouseUp.bind(this)), this._view.binding.wheel(this.onWheel.bind(this)), this._view.binding.mouseleave(this.onMouseLeave.bind(this)), this._view.binding.dblclick(this.onDoubleClick.bind(this)), this._view.binding.contextmenu(this.onContextMenu.bind(this)), this._view.binding.touchstart(this.onTouchStart.bind(this)), window.addEventListener("scroll", this.onWindowScroll.bind(this), { passive: !0 }), document.addEventListener("click", this.onDocumentClick.bind(this)), new
|
|
4674
|
+
this._subscriptionsManager.init(), this._model.init(), this._view.binding.mousemove(this.onMouseMove.bind(this)), this._view.binding.mousedown(this.onMouseDown.bind(this)), this._view.binding.mouseup(this.onMouseUp.bind(this)), this._view.binding.wheel(this.onWheel.bind(this)), this._view.binding.mouseleave(this.onMouseLeave.bind(this)), this._view.binding.dblclick(this.onDoubleClick.bind(this)), this._view.binding.contextmenu(this.onContextMenu.bind(this)), this._view.binding.touchstart(this.onTouchStart.bind(this)), window.addEventListener("scroll", this.onWindowScroll.bind(this), { passive: !0 }), document.addEventListener("click", this.onDocumentClick.bind(this)), new pr(this._model, this._view, this._hitManager).register();
|
|
4667
4675
|
}
|
|
4668
4676
|
onContextMenu(t) {
|
|
4669
4677
|
t.preventDefault();
|
|
@@ -4708,7 +4716,7 @@ class _r {
|
|
|
4708
4716
|
const e = t.touches[0];
|
|
4709
4717
|
this._touchId = e.identifier;
|
|
4710
4718
|
const { x: s, y: n } = this.getTouchCoords(e);
|
|
4711
|
-
this._hitManager.dispatchMouseDown(s, n), document.addEventListener("touchmove", this._boundTouchMove, { passive: !1 }), document.addEventListener("touchend", this._boundTouchEnd, { passive: !1 }), document.addEventListener("touchcancel", this._boundTouchCancel, { passive: !1 });
|
|
4719
|
+
this._touchStartCoords = { x: s, y: n }, this._hitManager.dispatchMouseDown(s, n), document.addEventListener("touchmove", this._boundTouchMove, { passive: !1 }), document.addEventListener("touchend", this._boundTouchEnd, { passive: !1 }), document.addEventListener("touchcancel", this._boundTouchCancel, { passive: !1 });
|
|
4712
4720
|
}
|
|
4713
4721
|
onDocumentTouchMove(t) {
|
|
4714
4722
|
if (this._touchId === null) return;
|
|
@@ -4739,7 +4747,9 @@ class _r {
|
|
|
4739
4747
|
if (!e) return;
|
|
4740
4748
|
t.preventDefault();
|
|
4741
4749
|
const { x: s, y: n } = this.getTouchCoords(e);
|
|
4742
|
-
this._hitManager.dispatchMouseUp(s, n), this._hitManager.dispatchClick(s, n)
|
|
4750
|
+
this._hitManager.dispatchMouseUp(s, n), this._hitManager.dispatchClick(s, n);
|
|
4751
|
+
const a = this._view.mainCanvas.absolutePosition, r = s >= 0 && s <= a.width && n >= 0 && n <= a.height, c = this._hitManager.hitTestAll(s, n).some((d) => d.type === "trade-label");
|
|
4752
|
+
this._model.trade.hasActiveTrade && (!r || !c) && this._model.eventBus.emit("close_trade_label_tooltip"), this._touchStartCoords && Math.hypot(s - this._touchStartCoords.x, n - this._touchStartCoords.y) <= te._TAP_MOVE_THRESHOLD_PX && r && this._hitManager.dispatchMouseMove(s, n), this._clearTouch();
|
|
4743
4753
|
}
|
|
4744
4754
|
onDocumentTouchCancel(t) {
|
|
4745
4755
|
const e = this.findTouchById(t, this._touchId ?? -1, !0);
|
|
@@ -4748,7 +4758,7 @@ class _r {
|
|
|
4748
4758
|
this._hitManager.dispatchMouseUp(s, n), this._clearTouch();
|
|
4749
4759
|
}
|
|
4750
4760
|
_clearTouch() {
|
|
4751
|
-
this._touchId = null, this._pinchDistance = null, document.removeEventListener("touchmove", this._boundTouchMove), document.removeEventListener("touchend", this._boundTouchEnd), document.removeEventListener("touchcancel", this._boundTouchCancel);
|
|
4761
|
+
this._touchId = null, this._pinchDistance = null, this._touchStartCoords = null, document.removeEventListener("touchmove", this._boundTouchMove), document.removeEventListener("touchend", this._boundTouchEnd), document.removeEventListener("touchcancel", this._boundTouchCancel);
|
|
4752
4762
|
}
|
|
4753
4763
|
onDocumentMouseMove(t) {
|
|
4754
4764
|
const { x: e, y: s } = this.getMouseRelative(t);
|
|
@@ -4778,8 +4788,10 @@ class _r {
|
|
|
4778
4788
|
onWheel(t) {
|
|
4779
4789
|
t.preventDefault(), this._hitManager.dispatchWheel(t.offsetX, t.offsetY, t.deltaX, t.deltaY, t.deltaZ);
|
|
4780
4790
|
}
|
|
4781
|
-
}
|
|
4782
|
-
|
|
4791
|
+
};
|
|
4792
|
+
f(te, "_TAP_MOVE_THRESHOLD_PX", 10);
|
|
4793
|
+
let Le = te;
|
|
4794
|
+
class yr {
|
|
4783
4795
|
constructor(t, { chartId: e, candles: s, config: n, trade: a, userMarkers: r, colorScheme: o, comments: c, renderLimiter: h }) {
|
|
4784
4796
|
f(this, "_model");
|
|
4785
4797
|
f(this, "_view");
|
|
@@ -4791,7 +4803,7 @@ class br {
|
|
|
4791
4803
|
throw new Error(
|
|
4792
4804
|
"chartId is required and must be a valid id (only letters, numbers or underscores. The first character must be a letter)"
|
|
4793
4805
|
);
|
|
4794
|
-
if (this._model = new
|
|
4806
|
+
if (this._model = new Hn({
|
|
4795
4807
|
chartId: e,
|
|
4796
4808
|
candles: s,
|
|
4797
4809
|
config: n,
|
|
@@ -4800,7 +4812,7 @@ class br {
|
|
|
4800
4812
|
userMarkers: r,
|
|
4801
4813
|
colorScheme: o,
|
|
4802
4814
|
comments: c
|
|
4803
|
-
}), this._view = new
|
|
4815
|
+
}), this._view = new er(d), this._controller = new Le(this._model, this._view), h) {
|
|
4804
4816
|
const g = h(this._view.candles.limiter.node);
|
|
4805
4817
|
this._view.candles.limiter.updateAbsolutePosition(), typeof g == "function" && (this._candlesLimiterClean = g);
|
|
4806
4818
|
}
|
|
@@ -4876,16 +4888,16 @@ class br {
|
|
|
4876
4888
|
const v = _ + c / 2;
|
|
4877
4889
|
if (m.length === 0) return;
|
|
4878
4890
|
t.font = `500 ${d}px Geist, Arial, sans-serif`;
|
|
4879
|
-
const b = o ? "#878788" : "#8E8E93", w = o ? "#FAFAFA" : "#1C2026", x = m.reduce((
|
|
4880
|
-
const I = t.measureText(
|
|
4881
|
-
return
|
|
4891
|
+
const b = o ? "#878788" : "#8E8E93", w = o ? "#FAFAFA" : "#1C2026", x = m.reduce((M, D) => {
|
|
4892
|
+
const I = t.measureText(D.label).width, W = t.measureText(D.value).width;
|
|
4893
|
+
return M + I + g + W;
|
|
4882
4894
|
}, 0), y = s - h * 2, C = m.length > 1 ? (y - x) / (m.length - 1) : 0;
|
|
4883
|
-
let
|
|
4884
|
-
m.forEach((
|
|
4885
|
-
const
|
|
4886
|
-
t.fillStyle = b, t.fillText(
|
|
4887
|
-
const W =
|
|
4888
|
-
t.fillStyle =
|
|
4895
|
+
let A = h;
|
|
4896
|
+
m.forEach((M) => {
|
|
4897
|
+
const D = t.measureText(M.label).width, I = t.measureText(M.value).width;
|
|
4898
|
+
t.fillStyle = b, t.fillText(M.label, A, v);
|
|
4899
|
+
const W = A + D + g;
|
|
4900
|
+
t.fillStyle = M.valueColor || w, t.fillText(M.value, W, v), A += D + g + I + C;
|
|
4889
4901
|
});
|
|
4890
4902
|
}
|
|
4891
4903
|
getChartState() {
|
|
@@ -4913,9 +4925,9 @@ class br {
|
|
|
4913
4925
|
console.warn("No canvas elements found for screenshot");
|
|
4914
4926
|
return;
|
|
4915
4927
|
}
|
|
4916
|
-
const b = 1440, w = 900, x = 48, y = 20, C = c ? 32 : 0,
|
|
4928
|
+
const b = 1440, w = 900, x = 48, y = 20, C = c ? 32 : 0, A = w - x - y - C, M = b, D = _ / m, I = M / A;
|
|
4917
4929
|
let W, Z, et = 0, K = 0;
|
|
4918
|
-
|
|
4930
|
+
D > I ? (Z = A, W = Z * D, et = 0, K = 0) : (W = M, Z = W / D, K = (A - Z) / 2);
|
|
4919
4931
|
const O = window.devicePixelRatio || 1, V = document.createElement("canvas");
|
|
4920
4932
|
V.width = b * O, V.height = w * O;
|
|
4921
4933
|
const P = V.getContext("2d");
|
|
@@ -4924,7 +4936,7 @@ class br {
|
|
|
4924
4936
|
return;
|
|
4925
4937
|
}
|
|
4926
4938
|
P.fillStyle = h ? "#101011" : "#ffffff", P.fillRect(0, 0, V.width, V.height);
|
|
4927
|
-
const ot = x * O,
|
|
4939
|
+
const ot = x * O, se = y * O, lt = A * O, bt = M * O, yt = ot + se;
|
|
4928
4940
|
await this._drawHeader(P, V.width, O, h), this._drawHeaderSecondLine(
|
|
4929
4941
|
P,
|
|
4930
4942
|
r,
|
|
@@ -4939,7 +4951,7 @@ class br {
|
|
|
4939
4951
|
const It = W * O, Bt = Z * O, F = et * O, Rt = K * O;
|
|
4940
4952
|
v.forEach((z) => {
|
|
4941
4953
|
let tt = 0, Y = 0, j = z.width, mt = z.height, wt = It, xt = Bt, $t = F, Ot = Rt;
|
|
4942
|
-
if (
|
|
4954
|
+
if (D > I) {
|
|
4943
4955
|
const ct = Bt / z.height, ht = z.width * ct;
|
|
4944
4956
|
ht > bt && (tt = (ht - bt) / ct, j = z.width - tt, wt = bt, $t = 0);
|
|
4945
4957
|
} else {
|
|
@@ -4969,7 +4981,7 @@ class br {
|
|
|
4969
4981
|
O,
|
|
4970
4982
|
h
|
|
4971
4983
|
);
|
|
4972
|
-
const
|
|
4984
|
+
const ne = (z, tt) => {
|
|
4973
4985
|
const Y = URL.createObjectURL(z), j = document.createElement("a");
|
|
4974
4986
|
j.href = Y, j.download = tt, document.body.appendChild(j), j.click(), document.body.removeChild(j), URL.revokeObjectURL(Y);
|
|
4975
4987
|
};
|
|
@@ -4981,7 +4993,7 @@ class br {
|
|
|
4981
4993
|
return;
|
|
4982
4994
|
}
|
|
4983
4995
|
if (d)
|
|
4984
|
-
|
|
4996
|
+
ne(Y, e);
|
|
4985
4997
|
else
|
|
4986
4998
|
try {
|
|
4987
4999
|
await navigator.clipboard.write([new ClipboardItem({ "image/png": Y })]);
|
|
@@ -4997,7 +5009,7 @@ class br {
|
|
|
4997
5009
|
}
|
|
4998
5010
|
}
|
|
4999
5011
|
export {
|
|
5000
|
-
|
|
5001
|
-
|
|
5012
|
+
yr as CandlestickChart,
|
|
5013
|
+
br as createLineChart
|
|
5002
5014
|
};
|
|
5003
5015
|
//# sourceMappingURL=charts-core.js.map
|