candleview 2.3.2 → 2.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/index.mjs +219 -227
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2,10 +2,10 @@ import rt, { useState as st, useRef as Ct, useEffect as ut } from "react";
|
|
|
2
2
|
import { LineSeries as dt, AreaSeries as xe, CandlestickSeries as Kt, BarSeries as yi, BaselineSeries as De, HistogramSeries as Qt, createChart as ar } from "lightweight-charts";
|
|
3
3
|
import me from "react-dom";
|
|
4
4
|
var Jt = { exports: {} }, Vt = {};
|
|
5
|
-
var
|
|
5
|
+
var Ee;
|
|
6
6
|
function nr() {
|
|
7
|
-
if (
|
|
8
|
-
|
|
7
|
+
if (Ee) return Vt;
|
|
8
|
+
Ee = 1;
|
|
9
9
|
var f = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
10
10
|
function e(i, r, a) {
|
|
11
11
|
var s = null;
|
|
@@ -28,12 +28,12 @@ var qt = {};
|
|
|
28
28
|
var ye;
|
|
29
29
|
function or() {
|
|
30
30
|
return ye || (ye = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
31
|
-
function f(
|
|
32
|
-
if (
|
|
33
|
-
if (typeof
|
|
34
|
-
return
|
|
35
|
-
if (typeof
|
|
36
|
-
switch (
|
|
31
|
+
function f(E) {
|
|
32
|
+
if (E == null) return null;
|
|
33
|
+
if (typeof E == "function")
|
|
34
|
+
return E.$$typeof === W ? null : E.displayName || E.name || null;
|
|
35
|
+
if (typeof E == "string") return E;
|
|
36
|
+
switch (E) {
|
|
37
37
|
case M:
|
|
38
38
|
return "Fragment";
|
|
39
39
|
case P:
|
|
@@ -47,127 +47,127 @@ function or() {
|
|
|
47
47
|
case I:
|
|
48
48
|
return "Activity";
|
|
49
49
|
}
|
|
50
|
-
if (typeof
|
|
51
|
-
switch (typeof
|
|
50
|
+
if (typeof E == "object")
|
|
51
|
+
switch (typeof E.tag == "number" && console.error(
|
|
52
52
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
53
|
-
),
|
|
53
|
+
), E.$$typeof) {
|
|
54
54
|
case p:
|
|
55
55
|
return "Portal";
|
|
56
56
|
case _:
|
|
57
|
-
return
|
|
57
|
+
return E.displayName || "Context";
|
|
58
58
|
case S:
|
|
59
|
-
return (
|
|
59
|
+
return (E._context.displayName || "Context") + ".Consumer";
|
|
60
60
|
case C:
|
|
61
|
-
var N =
|
|
62
|
-
return
|
|
63
|
-
case
|
|
64
|
-
return N =
|
|
61
|
+
var N = E.render;
|
|
62
|
+
return E = E.displayName, E || (E = N.displayName || N.name || "", E = E !== "" ? "ForwardRef(" + E + ")" : "ForwardRef"), E;
|
|
63
|
+
case R:
|
|
64
|
+
return N = E.displayName || null, N !== null ? N : f(E.type) || "Memo";
|
|
65
65
|
case B:
|
|
66
|
-
N =
|
|
66
|
+
N = E._payload, E = E._init;
|
|
67
67
|
try {
|
|
68
|
-
return f(
|
|
68
|
+
return f(E(N));
|
|
69
69
|
} catch {
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
74
|
-
function t(
|
|
75
|
-
return "" +
|
|
74
|
+
function t(E) {
|
|
75
|
+
return "" + E;
|
|
76
76
|
}
|
|
77
|
-
function e(
|
|
77
|
+
function e(E) {
|
|
78
78
|
try {
|
|
79
|
-
t(
|
|
79
|
+
t(E);
|
|
80
80
|
var N = !1;
|
|
81
81
|
} catch {
|
|
82
82
|
N = !0;
|
|
83
83
|
}
|
|
84
84
|
if (N) {
|
|
85
85
|
N = console;
|
|
86
|
-
var nt = N.error, ct = typeof Symbol == "function" && Symbol.toStringTag &&
|
|
86
|
+
var nt = N.error, ct = typeof Symbol == "function" && Symbol.toStringTag && E[Symbol.toStringTag] || E.constructor.name || "Object";
|
|
87
87
|
return nt.call(
|
|
88
88
|
N,
|
|
89
89
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
90
90
|
ct
|
|
91
|
-
), t(
|
|
91
|
+
), t(E);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
function i(
|
|
95
|
-
if (
|
|
96
|
-
if (typeof
|
|
94
|
+
function i(E) {
|
|
95
|
+
if (E === M) return "<>";
|
|
96
|
+
if (typeof E == "object" && E !== null && E.$$typeof === B)
|
|
97
97
|
return "<...>";
|
|
98
98
|
try {
|
|
99
|
-
var N = f(
|
|
99
|
+
var N = f(E);
|
|
100
100
|
return N ? "<" + N + ">" : "<...>";
|
|
101
101
|
} catch {
|
|
102
102
|
return "<...>";
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
function r() {
|
|
106
|
-
var
|
|
107
|
-
return
|
|
106
|
+
var E = L.A;
|
|
107
|
+
return E === null ? null : E.getOwner();
|
|
108
108
|
}
|
|
109
109
|
function a() {
|
|
110
110
|
return Error("react-stack-top-frame");
|
|
111
111
|
}
|
|
112
|
-
function s(
|
|
113
|
-
if ($.call(
|
|
114
|
-
var N = Object.getOwnPropertyDescriptor(
|
|
112
|
+
function s(E) {
|
|
113
|
+
if ($.call(E, "key")) {
|
|
114
|
+
var N = Object.getOwnPropertyDescriptor(E, "key").get;
|
|
115
115
|
if (N && N.isReactWarning) return !1;
|
|
116
116
|
}
|
|
117
|
-
return
|
|
117
|
+
return E.key !== void 0;
|
|
118
118
|
}
|
|
119
|
-
function n(
|
|
119
|
+
function n(E, N) {
|
|
120
120
|
function nt() {
|
|
121
121
|
Z || (Z = !0, console.error(
|
|
122
122
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
123
123
|
N
|
|
124
124
|
));
|
|
125
125
|
}
|
|
126
|
-
nt.isReactWarning = !0, Object.defineProperty(
|
|
126
|
+
nt.isReactWarning = !0, Object.defineProperty(E, "key", {
|
|
127
127
|
get: nt,
|
|
128
128
|
configurable: !0
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
function o() {
|
|
132
|
-
var
|
|
133
|
-
return O[
|
|
132
|
+
var E = f(this.type);
|
|
133
|
+
return O[E] || (O[E] = !0, console.error(
|
|
134
134
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
135
|
-
)),
|
|
135
|
+
)), E = this.props.ref, E !== void 0 ? E : null;
|
|
136
136
|
}
|
|
137
|
-
function h(
|
|
137
|
+
function h(E, N, nt, ct, tt, y) {
|
|
138
138
|
var Q = nt.ref;
|
|
139
|
-
return
|
|
139
|
+
return E = {
|
|
140
140
|
$$typeof: u,
|
|
141
|
-
type:
|
|
141
|
+
type: E,
|
|
142
142
|
key: N,
|
|
143
143
|
props: nt,
|
|
144
144
|
_owner: ct
|
|
145
|
-
}, (Q !== void 0 ? Q : null) !== null ? Object.defineProperty(
|
|
145
|
+
}, (Q !== void 0 ? Q : null) !== null ? Object.defineProperty(E, "ref", {
|
|
146
146
|
enumerable: !1,
|
|
147
147
|
get: o
|
|
148
|
-
}) : Object.defineProperty(
|
|
148
|
+
}) : Object.defineProperty(E, "ref", { enumerable: !1, value: null }), E._store = {}, Object.defineProperty(E._store, "validated", {
|
|
149
149
|
configurable: !1,
|
|
150
150
|
enumerable: !1,
|
|
151
151
|
writable: !0,
|
|
152
152
|
value: 0
|
|
153
|
-
}), Object.defineProperty(
|
|
153
|
+
}), Object.defineProperty(E, "_debugInfo", {
|
|
154
154
|
configurable: !1,
|
|
155
155
|
enumerable: !1,
|
|
156
156
|
writable: !0,
|
|
157
157
|
value: null
|
|
158
|
-
}), Object.defineProperty(
|
|
158
|
+
}), Object.defineProperty(E, "_debugStack", {
|
|
159
159
|
configurable: !1,
|
|
160
160
|
enumerable: !1,
|
|
161
161
|
writable: !0,
|
|
162
162
|
value: tt
|
|
163
|
-
}), Object.defineProperty(
|
|
163
|
+
}), Object.defineProperty(E, "_debugTask", {
|
|
164
164
|
configurable: !1,
|
|
165
165
|
enumerable: !1,
|
|
166
166
|
writable: !0,
|
|
167
167
|
value: y
|
|
168
|
-
}), Object.freeze && (Object.freeze(
|
|
168
|
+
}), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
|
|
169
169
|
}
|
|
170
|
-
function l(
|
|
170
|
+
function l(E, N, nt, ct, tt, y) {
|
|
171
171
|
var Q = N.children;
|
|
172
172
|
if (Q !== void 0)
|
|
173
173
|
if (ct)
|
|
@@ -181,7 +181,7 @@ function or() {
|
|
|
181
181
|
);
|
|
182
182
|
else g(Q);
|
|
183
183
|
if ($.call(N, "key")) {
|
|
184
|
-
Q = f(
|
|
184
|
+
Q = f(E);
|
|
185
185
|
var et = Object.keys(N).filter(function(gt) {
|
|
186
186
|
return gt !== "key";
|
|
187
187
|
});
|
|
@@ -205,9 +205,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
205
205
|
} else nt = N;
|
|
206
206
|
return Q && n(
|
|
207
207
|
nt,
|
|
208
|
-
typeof
|
|
208
|
+
typeof E == "function" ? E.displayName || E.name || "Unknown" : E
|
|
209
209
|
), h(
|
|
210
|
-
|
|
210
|
+
E,
|
|
211
211
|
Q,
|
|
212
212
|
nt,
|
|
213
213
|
r(),
|
|
@@ -215,43 +215,43 @@ React keys must be passed directly to JSX without using spread:
|
|
|
215
215
|
y
|
|
216
216
|
);
|
|
217
217
|
}
|
|
218
|
-
function g(
|
|
219
|
-
c(
|
|
218
|
+
function g(E) {
|
|
219
|
+
c(E) ? E._store && (E._store.validated = 1) : typeof E == "object" && E !== null && E.$$typeof === B && (E._payload.status === "fulfilled" ? c(E._payload.value) && E._payload.value._store && (E._payload.value._store.validated = 1) : E._store && (E._store.validated = 1));
|
|
220
220
|
}
|
|
221
|
-
function c(
|
|
222
|
-
return typeof
|
|
221
|
+
function c(E) {
|
|
222
|
+
return typeof E == "object" && E !== null && E.$$typeof === u;
|
|
223
223
|
}
|
|
224
|
-
var d = rt, u = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), M = Symbol.for("react.fragment"), k = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), S = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"),
|
|
224
|
+
var d = rt, u = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), M = Symbol.for("react.fragment"), k = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), S = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), B = Symbol.for("react.lazy"), I = Symbol.for("react.activity"), W = Symbol.for("react.client.reference"), L = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, $ = Object.prototype.hasOwnProperty, at = Array.isArray, J = console.createTask ? console.createTask : function() {
|
|
225
225
|
return null;
|
|
226
226
|
};
|
|
227
227
|
d = {
|
|
228
|
-
react_stack_bottom_frame: function(
|
|
229
|
-
return
|
|
228
|
+
react_stack_bottom_frame: function(E) {
|
|
229
|
+
return E();
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
232
|
var Z, O = {}, it = d.react_stack_bottom_frame.bind(
|
|
233
233
|
d,
|
|
234
234
|
a
|
|
235
235
|
)(), ht = J(i(a)), pt = {};
|
|
236
|
-
qt.Fragment = M, qt.jsx = function(
|
|
236
|
+
qt.Fragment = M, qt.jsx = function(E, N, nt) {
|
|
237
237
|
var ct = 1e4 > L.recentlyCreatedOwnerStacks++;
|
|
238
238
|
return l(
|
|
239
|
-
|
|
239
|
+
E,
|
|
240
240
|
N,
|
|
241
241
|
nt,
|
|
242
242
|
!1,
|
|
243
243
|
ct ? Error("react-stack-top-frame") : it,
|
|
244
|
-
ct ? J(i(
|
|
244
|
+
ct ? J(i(E)) : ht
|
|
245
245
|
);
|
|
246
|
-
}, qt.jsxs = function(
|
|
246
|
+
}, qt.jsxs = function(E, N, nt) {
|
|
247
247
|
var ct = 1e4 > L.recentlyCreatedOwnerStacks++;
|
|
248
248
|
return l(
|
|
249
|
-
|
|
249
|
+
E,
|
|
250
250
|
N,
|
|
251
251
|
nt,
|
|
252
252
|
!0,
|
|
253
253
|
ct ? Error("react-stack-top-frame") : it,
|
|
254
|
-
ct ? J(i(
|
|
254
|
+
ct ? J(i(E)) : ht
|
|
255
255
|
);
|
|
256
256
|
};
|
|
257
257
|
})()), qt;
|
|
@@ -721,7 +721,7 @@ const vr = (f, t) => ({ series: f.addSeries(Kt, {
|
|
|
721
721
|
precision: 2,
|
|
722
722
|
minMove: 0.01
|
|
723
723
|
}
|
|
724
|
-
}), type: "candle" }),
|
|
724
|
+
}), type: "candle" }), Rr = (f, t) => ({ series: f.addSeries(Kt, {
|
|
725
725
|
upColor: "transparent",
|
|
726
726
|
downColor: t.chart.candleDownColor || "#ef5350",
|
|
727
727
|
borderUpColor: t.chart.candleUpColor || "#26a69a",
|
|
@@ -735,7 +735,7 @@ const vr = (f, t) => ({ series: f.addSeries(Kt, {
|
|
|
735
735
|
precision: 2,
|
|
736
736
|
minMove: 0.01
|
|
737
737
|
}
|
|
738
|
-
}), type: "hollow-candle" }),
|
|
738
|
+
}), type: "hollow-candle" }), Er = (f, t) => ({ series: f.addSeries(yi, {
|
|
739
739
|
upColor: t.chart.candleUpColor || "#26a69a",
|
|
740
740
|
downColor: t.chart.candleDownColor || "#ef5350",
|
|
741
741
|
thinBars: !0,
|
|
@@ -808,14 +808,14 @@ const vr = (f, t) => ({ series: f.addSeries(Kt, {
|
|
|
808
808
|
id: "hollow-candle",
|
|
809
809
|
label: "Hollow Candlestick",
|
|
810
810
|
description: "Hollow Candlestick",
|
|
811
|
-
createSeries:
|
|
811
|
+
createSeries: Rr,
|
|
812
812
|
type: q.HollowCandle
|
|
813
813
|
},
|
|
814
814
|
{
|
|
815
815
|
id: "bar",
|
|
816
816
|
label: "Bar Chart",
|
|
817
817
|
description: "Bar Chart",
|
|
818
|
-
createSeries:
|
|
818
|
+
createSeries: Er,
|
|
819
819
|
type: q.Bar
|
|
820
820
|
},
|
|
821
821
|
{
|
|
@@ -2579,13 +2579,13 @@ const Lr = ({
|
|
|
2579
2579
|
onCancel: h,
|
|
2580
2580
|
i18n: l
|
|
2581
2581
|
}) => {
|
|
2582
|
-
const [g, c] = st(i), [d, u] = st(r), [p, M] = st(a), [k, P] = st(s), [S, _] = st(n), [C, A] = st(t), [x,
|
|
2582
|
+
const [g, c] = st(i), [d, u] = st(r), [p, M] = st(a), [k, P] = st(s), [S, _] = st(n), [C, A] = st(t), [x, R] = st(!1), [B, I] = st({ x: 0, y: 0 }), W = Ct(null), L = Ct(null);
|
|
2583
2583
|
ut(() => {
|
|
2584
2584
|
c(i), u(r), M(a), P(s), _(n), A(t);
|
|
2585
2585
|
}, [i, r, a, s, n, t]);
|
|
2586
2586
|
const $ = (O) => {
|
|
2587
2587
|
if (O.target === L.current || L.current?.contains(O.target)) {
|
|
2588
|
-
|
|
2588
|
+
R(!0);
|
|
2589
2589
|
const it = W.current.getBoundingClientRect();
|
|
2590
2590
|
I({
|
|
2591
2591
|
x: O.clientX - it.left,
|
|
@@ -2596,14 +2596,14 @@ const Lr = ({
|
|
|
2596
2596
|
ut(() => {
|
|
2597
2597
|
const O = (ht) => {
|
|
2598
2598
|
if (x) {
|
|
2599
|
-
const pt = ht.clientX - B.x,
|
|
2599
|
+
const pt = ht.clientX - B.x, E = ht.clientY - B.y, N = window.innerWidth - 320, nt = window.innerHeight - 300;
|
|
2600
2600
|
A({
|
|
2601
2601
|
x: Math.max(10, Math.min(pt, N)),
|
|
2602
|
-
y: Math.max(10, Math.min(
|
|
2602
|
+
y: Math.max(10, Math.min(E, nt))
|
|
2603
2603
|
});
|
|
2604
2604
|
}
|
|
2605
2605
|
}, it = () => {
|
|
2606
|
-
|
|
2606
|
+
R(!1);
|
|
2607
2607
|
};
|
|
2608
2608
|
if (x)
|
|
2609
2609
|
return document.addEventListener("mousemove", O), document.addEventListener("mouseup", it), () => {
|
|
@@ -2936,7 +2936,7 @@ const Lr = ({
|
|
|
2936
2936
|
boxShadow: "0 8px 24px rgba(0,0,0,0.3)",
|
|
2937
2937
|
cursor: h ? "grabbing" : "default",
|
|
2938
2938
|
userSelect: h ? "none" : "auto"
|
|
2939
|
-
},
|
|
2939
|
+
}, R = {
|
|
2940
2940
|
padding: "12px 16px",
|
|
2941
2941
|
borderBottom: `1px solid ${i.toolbar.border}`,
|
|
2942
2942
|
cursor: "grab",
|
|
@@ -3003,7 +3003,7 @@ const Lr = ({
|
|
|
3003
3003
|
fontSize: "12px",
|
|
3004
3004
|
cursor: "pointer",
|
|
3005
3005
|
minWidth: "60px"
|
|
3006
|
-
},
|
|
3006
|
+
}, E = {
|
|
3007
3007
|
background: i.toolbar.button.active,
|
|
3008
3008
|
color: i.toolbar.button.activeTextColor,
|
|
3009
3009
|
border: "none",
|
|
@@ -3056,7 +3056,7 @@ const Lr = ({
|
|
|
3056
3056
|
"div",
|
|
3057
3057
|
{
|
|
3058
3058
|
ref: p,
|
|
3059
|
-
style:
|
|
3059
|
+
style: R,
|
|
3060
3060
|
onMouseDown: (tt) => {
|
|
3061
3061
|
tt.target === p.current && tt.preventDefault();
|
|
3062
3062
|
},
|
|
@@ -3118,7 +3118,7 @@ const Lr = ({
|
|
|
3118
3118
|
{
|
|
3119
3119
|
onClick: P,
|
|
3120
3120
|
disabled: !a,
|
|
3121
|
-
style: a ?
|
|
3121
|
+
style: a ? E : N,
|
|
3122
3122
|
type: "button",
|
|
3123
3123
|
children: r.systemSettings?.confirm || "确定"
|
|
3124
3124
|
}
|
|
@@ -5346,8 +5346,8 @@ class Wr {
|
|
|
5346
5346
|
else if (this.state.dragPoint === "mid") {
|
|
5347
5347
|
const u = g.timeToCoordinate(this.state.dragTarget.getStartTime()), p = i.series.priceToCoordinate(this.state.dragTarget.getStartPrice()), M = g.timeToCoordinate(this.state.dragTarget.getEndTime()), k = i.series.priceToCoordinate(this.state.dragTarget.getEndPrice());
|
|
5348
5348
|
if (u === null || p === null || M === null || k === null) return;
|
|
5349
|
-
const P = (u + M) / 2, S = (p + k) / 2, _ = this.state.dragTarget.getMidPixelOffsetX() + P, C = this.state.dragTarget.getMidPixelOffsetY() + S, A = this.quadraticBezierPoint(u, _, M, 0.5), x = this.quadraticBezierPoint(p, C, k, 0.5),
|
|
5350
|
-
this.state.dragTarget.updateMidPoint(I +
|
|
5349
|
+
const P = (u + M) / 2, S = (p + k) / 2, _ = this.state.dragTarget.getMidPixelOffsetX() + P, C = this.state.dragTarget.getMidPixelOffsetY() + S, A = this.quadraticBezierPoint(u, _, M, 0.5), x = this.quadraticBezierPoint(p, C, k, 0.5), R = h - A, B = l - x, I = this.state.dragTarget.getMidPixelOffsetX(), W = this.state.dragTarget.getMidPixelOffsetY();
|
|
5350
|
+
this.state.dragTarget.updateMidPoint(I + R, W + B), this.dragStartData = { time: c, price: d };
|
|
5351
5351
|
}
|
|
5352
5352
|
return;
|
|
5353
5353
|
}
|
|
@@ -5546,8 +5546,8 @@ class Oe {
|
|
|
5546
5546
|
const l = Math.abs(this._series.priceToCoordinate(this._startPrice - this._channelHeight) - this._series.priceToCoordinate(this._startPrice)), g = s - r, c = n - a, d = Math.sqrt(g * g + c * c), u = this._angle * Math.PI / 180, p = Math.tan(u) * d * 0.5, M = (r + s) / 2, k = (a + n) / 2, P = M, S = k - l;
|
|
5547
5547
|
if (Math.sqrt(Math.pow(t - P, 2) + Math.pow(e - S, 2)) <= i)
|
|
5548
5548
|
return "channel";
|
|
5549
|
-
const C = n - l - p, A = n + l + p, x = s,
|
|
5550
|
-
return Math.sqrt(Math.pow(t - x, 2) + Math.pow(e -
|
|
5549
|
+
const C = n - l - p, A = n + l + p, x = s, R = (C + A) / 2;
|
|
5550
|
+
return Math.sqrt(Math.pow(t - x, 2) + Math.pow(e - R, 2)) <= i ? "angle" : null;
|
|
5551
5551
|
}
|
|
5552
5552
|
updateAngleByPixels(t) {
|
|
5553
5553
|
if (!this._chart || !this._series) return;
|
|
@@ -5609,8 +5609,8 @@ class Oe {
|
|
|
5609
5609
|
e.fillRect(L - O / 2 - 5, $ - 25, O + 10, 18), e.fillStyle = "#333333", e.fillText(Z, L, $ - 10), e.restore();
|
|
5610
5610
|
};
|
|
5611
5611
|
C(i, r, "start", this._dragPoint === "start" || this._hoverPoint === "start"), C(a, s, "end", this._dragPoint === "end" || this._hoverPoint === "end");
|
|
5612
|
-
const A = (i + a) / 2, x = (r + s) / 2,
|
|
5613
|
-
C(
|
|
5612
|
+
const A = (i + a) / 2, x = (r + s) / 2, R = A, B = x - l;
|
|
5613
|
+
C(R, B, "channel", this._dragPoint === "channel" || this._hoverPoint === "channel");
|
|
5614
5614
|
const I = a, W = (M + _) / 2;
|
|
5615
5615
|
C(I, W, "angle", this._dragPoint === "angle" || this._hoverPoint === "angle");
|
|
5616
5616
|
}
|
|
@@ -5954,11 +5954,11 @@ class Xr {
|
|
|
5954
5954
|
if (p === 0) return !1;
|
|
5955
5955
|
const M = -u / p, k = d / p;
|
|
5956
5956
|
for (let P = -1; P <= 1; P += 2) {
|
|
5957
|
-
const S = M * 30 * P, _ = k * 30 * P, C = a + S, A = s + _, x = n + S,
|
|
5957
|
+
const S = M * 30 * P, _ = k * 30 * P, C = a + S, A = s + _, x = n + S, R = o + _, B = t - C, I = e - A, W = x - C, L = R - A, $ = B * W + I * L, at = W * W + L * L;
|
|
5958
5958
|
let J = -1;
|
|
5959
5959
|
at !== 0 && (J = $ / at);
|
|
5960
5960
|
let Z, O;
|
|
5961
|
-
J < 0 ? (Z = C, O = A) : J > 1 ? (Z = x, O =
|
|
5961
|
+
J < 0 ? (Z = C, O = A) : J > 1 ? (Z = x, O = R) : (Z = C + J * W, O = A + J * L);
|
|
5962
5962
|
const it = t - Z, ht = e - O;
|
|
5963
5963
|
if (Math.sqrt(it * it + ht * ht) <= r)
|
|
5964
5964
|
return !0;
|
|
@@ -6316,10 +6316,10 @@ class Yr {
|
|
|
6316
6316
|
else if (this.state.dragPoint === "mid1" || this.state.dragPoint === "mid2") {
|
|
6317
6317
|
const u = g.timeToCoordinate(this.state.dragTarget.getStartTime()), p = i.series.priceToCoordinate(this.state.dragTarget.getStartPrice()), M = g.timeToCoordinate(this.state.dragTarget.getEndTime()), k = i.series.priceToCoordinate(this.state.dragTarget.getEndPrice());
|
|
6318
6318
|
if (u === null || p === null || M === null || k === null) return;
|
|
6319
|
-
const P = u + (M - u) * 1 / 3, S = p + (k - p) * 1 / 3, _ = u + (M - u) * 2 / 3, C = p + (k - p) * 2 / 3, A = this.state.dragTarget.getMid1PixelOffsetX(), x = this.state.dragTarget.getMid1PixelOffsetY(),
|
|
6319
|
+
const P = u + (M - u) * 1 / 3, S = p + (k - p) * 1 / 3, _ = u + (M - u) * 2 / 3, C = p + (k - p) * 2 / 3, A = this.state.dragTarget.getMid1PixelOffsetX(), x = this.state.dragTarget.getMid1PixelOffsetY(), R = this.state.dragTarget.getMid2PixelOffsetX(), B = this.state.dragTarget.getMid2PixelOffsetY(), I = P + A, W = S + x, L = _ + R, $ = C + B;
|
|
6320
6320
|
let at, J;
|
|
6321
6321
|
this.state.dragPoint === "mid1" ? (at = this.cubicBezierPoint(u, I, L, M, 1 / 3), J = this.cubicBezierPoint(p, W, $, k, 1 / 3)) : (at = this.cubicBezierPoint(u, I, L, M, 2 / 3), J = this.cubicBezierPoint(p, W, $, k, 2 / 3));
|
|
6322
|
-
const Z = h - at, O = l - J, it = this.state.dragPoint === "mid1" ? A :
|
|
6322
|
+
const Z = h - at, O = l - J, it = this.state.dragPoint === "mid1" ? A : R, ht = this.state.dragPoint === "mid1" ? x : B;
|
|
6323
6323
|
this.state.dragPoint === "mid1" ? this.state.dragTarget.updateMid1Point(it + Z, ht + O) : this.state.dragTarget.updateMid2Point(it + Z, ht + O), this.dragStartData = { time: c, price: d };
|
|
6324
6324
|
}
|
|
6325
6325
|
return;
|
|
@@ -9368,8 +9368,8 @@ class We {
|
|
|
9368
9368
|
if (e.strokeStyle = "#FF6B35", e.setLineDash([]), e.beginPath(), e.moveTo(h, l), e.lineTo(i, r), e.stroke(), !g) {
|
|
9369
9369
|
const u = i - h, p = r - l, M = 3, k = -u * M, P = -p * M, S = [];
|
|
9370
9370
|
for (let A = 0; A < this._numberOfForks; A++) {
|
|
9371
|
-
const x = A / (this._numberOfForks - 1),
|
|
9372
|
-
S.push({ x:
|
|
9371
|
+
const x = A / (this._numberOfForks - 1), R = a + (n - a) * x, B = s + (o - s) * x;
|
|
9372
|
+
S.push({ x: R, y: B });
|
|
9373
9373
|
}
|
|
9374
9374
|
const _ = [
|
|
9375
9375
|
"#FF4444",
|
|
@@ -9384,17 +9384,17 @@ class We {
|
|
|
9384
9384
|
const C = e.createLinearGradient(a, s, n, o);
|
|
9385
9385
|
if (C.addColorStop(0, "#FF4444"), C.addColorStop(0.5, "#4CAF50"), C.addColorStop(1, "#9C27B0"), e.strokeStyle = C, e.setLineDash([]), e.beginPath(), e.moveTo(a, s), e.lineTo(n, o), e.stroke(), !this._isPreview)
|
|
9386
9386
|
for (let A = 0; A < S.length - 1; A++) {
|
|
9387
|
-
const x = S[A],
|
|
9387
|
+
const x = S[A], R = S[A + 1], B = e.createLinearGradient(
|
|
9388
9388
|
x.x,
|
|
9389
9389
|
x.y,
|
|
9390
|
-
|
|
9391
|
-
|
|
9390
|
+
R.x + k,
|
|
9391
|
+
R.y + P
|
|
9392
9392
|
);
|
|
9393
|
-
A === 0 ? (B.addColorStop(0, "rgba(255, 68, 68, 0.2)"), B.addColorStop(1, "rgba(255, 170, 0, 0.3)")) : A === 1 ? (B.addColorStop(0, "rgba(255, 170, 0, 0.3)"), B.addColorStop(1, "rgba(76, 175, 80, 0.4)")) : A === 2 ? (B.addColorStop(0, "rgba(76, 175, 80, 0.4)"), B.addColorStop(1, "rgba(33, 150, 243, 0.3)")) : A === 3 && (B.addColorStop(0, "rgba(33, 150, 243, 0.3)"), B.addColorStop(1, "rgba(156, 39, 176, 0.2)")), e.fillStyle = B, e.beginPath(), e.moveTo(x.x, x.y), e.lineTo(x.x + k, x.y + P), e.lineTo(
|
|
9393
|
+
A === 0 ? (B.addColorStop(0, "rgba(255, 68, 68, 0.2)"), B.addColorStop(1, "rgba(255, 170, 0, 0.3)")) : A === 1 ? (B.addColorStop(0, "rgba(255, 170, 0, 0.3)"), B.addColorStop(1, "rgba(76, 175, 80, 0.4)")) : A === 2 ? (B.addColorStop(0, "rgba(76, 175, 80, 0.4)"), B.addColorStop(1, "rgba(33, 150, 243, 0.3)")) : A === 3 && (B.addColorStop(0, "rgba(33, 150, 243, 0.3)"), B.addColorStop(1, "rgba(156, 39, 176, 0.2)")), e.fillStyle = B, e.beginPath(), e.moveTo(x.x, x.y), e.lineTo(x.x + k, x.y + P), e.lineTo(R.x + k, R.y + P), e.lineTo(R.x, R.y), e.closePath(), e.fill(), e.strokeStyle = _[A], e.lineWidth = 0.5, e.setLineDash([2, 2]), e.stroke(), e.setLineDash([]);
|
|
9394
9394
|
}
|
|
9395
9395
|
this._isPreview || S.forEach((A, x) => {
|
|
9396
|
-
const
|
|
9397
|
-
e.fillStyle = _[x], e.beginPath(), e.arc(
|
|
9396
|
+
const R = A.x + k, B = A.y + P;
|
|
9397
|
+
e.fillStyle = _[x], e.beginPath(), e.arc(R, B, 3, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(R, B, 1, 0, Math.PI * 2), e.fill();
|
|
9398
9398
|
});
|
|
9399
9399
|
}
|
|
9400
9400
|
const c = (this._showHandles || this._isDragging || this._hoverPoint) && !this._isPreview, d = this._isPreview;
|
|
@@ -9752,7 +9752,7 @@ class $r {
|
|
|
9752
9752
|
return !1;
|
|
9753
9753
|
const p = (n + h) / 2, M = (o + l) / 2, k = a - p, P = s - M, S = [];
|
|
9754
9754
|
for (let x = 0; x < 5; x++) {
|
|
9755
|
-
const
|
|
9755
|
+
const R = x / 4, B = n + (h - n) * R, I = o + (l - o) * R;
|
|
9756
9756
|
S.push({ x: B, y: I });
|
|
9757
9757
|
}
|
|
9758
9758
|
const _ = S.map((x) => ({
|
|
@@ -9918,10 +9918,10 @@ class Xe {
|
|
|
9918
9918
|
if ((this._showHandles || this._isDragging || this._hoverPoint) && !this._isPreview) {
|
|
9919
9919
|
const p = (_, C, A, x = !1) => {
|
|
9920
9920
|
e.save(), e.fillStyle = this._color, e.beginPath(), e.arc(_, C, 6, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(_, C, 4, 0, Math.PI * 2), e.fill(), x && (e.strokeStyle = this._color, e.lineWidth = 2, e.setLineDash([]), e.beginPath(), e.arc(_, C, 8, 0, Math.PI * 2), e.stroke()), e.fillStyle = this._color, e.font = "12px Arial", e.textAlign = "center", e.textBaseline = "bottom";
|
|
9921
|
-
let
|
|
9922
|
-
A === "start" ?
|
|
9923
|
-
const B = e.measureText(
|
|
9924
|
-
e.fillRect(_ - B / 2 - 5, C - 25, B + 10, 18), e.fillStyle = "#333333", e.fillText(
|
|
9921
|
+
let R = "";
|
|
9922
|
+
A === "start" ? R = `${this._startPrice.toFixed(2)}` : A === "end" ? R = `${this._endPrice.toFixed(2)}` : A === "channel" && (R = `${(this._channelHeight / this._startPrice * 100).toFixed(2)}%`), e.fillStyle = "rgba(255, 255, 255, 0.9)";
|
|
9923
|
+
const B = e.measureText(R).width;
|
|
9924
|
+
e.fillRect(_ - B / 2 - 5, C - 25, B + 10, 18), e.fillStyle = "#333333", e.fillText(R, _, C - 10), e.restore();
|
|
9925
9925
|
};
|
|
9926
9926
|
p(i, r, "start", this._dragPoint === "start" || this._hoverPoint === "start"), p(a, s, "end", this._dragPoint === "end" || this._hoverPoint === "end");
|
|
9927
9927
|
const M = (i + a) / 2, k = (r + s) / 2, P = M + c * u, S = k + d * u;
|
|
@@ -10258,11 +10258,11 @@ class Zr {
|
|
|
10258
10258
|
if (p === 0) return !1;
|
|
10259
10259
|
const M = -u / p, k = d / p;
|
|
10260
10260
|
for (let P = -1; P <= 1; P += 2) {
|
|
10261
|
-
const S = M * 30 * P, _ = k * 30 * P, C = a + S, A = s + _, x = n + S,
|
|
10261
|
+
const S = M * 30 * P, _ = k * 30 * P, C = a + S, A = s + _, x = n + S, R = o + _, B = t - C, I = e - A, W = x - C, L = R - A, $ = B * W + I * L, at = W * W + L * L;
|
|
10262
10262
|
let J = -1;
|
|
10263
10263
|
at !== 0 && (J = $ / at);
|
|
10264
10264
|
let Z, O;
|
|
10265
|
-
J < 0 ? (Z = C, O = A) : J > 1 ? (Z = x, O =
|
|
10265
|
+
J < 0 ? (Z = C, O = A) : J > 1 ? (Z = x, O = R) : (Z = C + J * W, O = A + J * L);
|
|
10266
10266
|
const it = t - Z, ht = e - O;
|
|
10267
10267
|
if (Math.sqrt(it * it + ht * ht) <= r)
|
|
10268
10268
|
return !0;
|
|
@@ -11004,8 +11004,8 @@ class Ve {
|
|
|
11004
11004
|
M === "start" ? C = `${this._startPrice.toFixed(2)}` : M === "end" ? C = `${this._endPrice.toFixed(2)}` : M === "channel" && (C = `${(this._channelHeight / Math.min(this._startPrice, this._endPrice) * 100).toFixed(2)}%`);
|
|
11005
11005
|
const A = S, x = Math.max(25, _ - 15);
|
|
11006
11006
|
t.fillStyle = "rgba(255, 255, 255, 0.9)";
|
|
11007
|
-
const
|
|
11008
|
-
t.fillRect(A -
|
|
11007
|
+
const R = t.measureText(C).width;
|
|
11008
|
+
t.fillRect(A - R / 2 - 5, x - 8, R + 4, 16), t.fillStyle = "#333333", t.fillText(C, A, x), t.restore();
|
|
11009
11009
|
};
|
|
11010
11010
|
s(e, i, "start", this._dragPoint === "start" || this._hoverPoint === "start"), s(r, a, "end", this._dragPoint === "end" || this._hoverPoint === "end");
|
|
11011
11011
|
const n = (e + r) / 2, o = (i + a) / 2, h = r - e, l = a - i, g = Math.sqrt(h * h + l * l);
|
|
@@ -11237,7 +11237,7 @@ class es {
|
|
|
11237
11237
|
if (P === null) return;
|
|
11238
11238
|
const _ = l - P, C = Math.abs(M - p), A = i.series.priceToCoordinate(p), x = i.series.priceToCoordinate(M);
|
|
11239
11239
|
if (A === null || x === null) return;
|
|
11240
|
-
const
|
|
11240
|
+
const R = Math.abs(A - x), B = R > 0 ? C / R : 0.01, I = _ * B, W = Math.max(1e-3, Math.abs(this.state.adjustStartData.channelHeight + I));
|
|
11241
11241
|
this.state.dragTarget.updateChannelHeight(W);
|
|
11242
11242
|
}
|
|
11243
11243
|
}
|
|
@@ -11356,11 +11356,11 @@ class es {
|
|
|
11356
11356
|
if (p === 0) return !1;
|
|
11357
11357
|
const M = -u / p, k = d / p;
|
|
11358
11358
|
for (let P = 0; P <= 10; P++) {
|
|
11359
|
-
const S = P / 10, _ = M * 30 * S, C = k * 30 * S, A = a + _, x = s + C,
|
|
11359
|
+
const S = P / 10, _ = M * 30 * S, C = k * 30 * S, A = a + _, x = s + C, R = n + _, B = o + C, I = t - A, W = e - x, L = R - A, $ = B - x, at = I * L + W * $, J = L * L + $ * $;
|
|
11360
11360
|
let Z = -1;
|
|
11361
11361
|
J !== 0 && (Z = at / J);
|
|
11362
11362
|
let O, it;
|
|
11363
|
-
Z < 0 ? (O = A, it = x) : Z > 1 ? (O =
|
|
11363
|
+
Z < 0 ? (O = A, it = x) : Z > 1 ? (O = R, it = B) : (O = A + Z * L, it = x + Z * $);
|
|
11364
11364
|
const ht = t - O, pt = e - it;
|
|
11365
11365
|
if (Math.sqrt(ht * ht + pt * pt) <= r)
|
|
11366
11366
|
return !0;
|
|
@@ -14499,8 +14499,8 @@ class os {
|
|
|
14499
14499
|
if (this.state.fibonacciSpiralCenterPoint && this.previewFibonacciSpiralMark) {
|
|
14500
14500
|
const u = this.previewFibonacciSpiralMark.getCenterPrice(), p = this.previewFibonacciSpiralMark.getCenterTime(), M = i.series.priceToCoordinate(u), P = r.timeScale().timeToCoordinate(p);
|
|
14501
14501
|
if (M !== null && P !== null) {
|
|
14502
|
-
const S = h - P, _ = l - M, C = Math.sqrt(S * S + _ * _), A = M + C, x = i.series.coordinateToPrice(A),
|
|
14503
|
-
this.previewFibonacciSpiralMark.updateRadius && this.previewFibonacciSpiralMark.updateRadius(
|
|
14502
|
+
const S = h - P, _ = l - M, C = Math.sqrt(S * S + _ * _), A = M + C, x = i.series.coordinateToPrice(A), R = Math.abs(x - u);
|
|
14503
|
+
this.previewFibonacciSpiralMark.updateRadius && this.previewFibonacciSpiralMark.updateRadius(R);
|
|
14504
14504
|
const B = Math.atan2(_, S), I = P + C * Math.cos(B), W = M + C * Math.sin(B);
|
|
14505
14505
|
this.previewFibonacciSpiralMark.setRadiusPoint({ x: I, y: W });
|
|
14506
14506
|
}
|
|
@@ -16971,8 +16971,8 @@ class ri {
|
|
|
16971
16971
|
let _, C;
|
|
16972
16972
|
const A = n + (r - s) * Math.tan(P), x = s + (a - n) / Math.tan(P);
|
|
16973
16973
|
if (A >= a && A <= i ? (_ = r, C = A) : x >= e && x <= r ? (_ = x, C = a) : (_ = r, C = a), t.lineTo(_, C), t.stroke(), this._showLabels && !this._isPreview) {
|
|
16974
|
-
const
|
|
16975
|
-
t.save(), t.fillStyle = this._labelColor, t.font = "10px Arial", t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${
|
|
16974
|
+
const R = Math.round(P * 180 / Math.PI), B = Math.sqrt(Math.pow(_ - s, 2) + Math.pow(C - n, 2)) * 0.5, I = s + B * Math.cos(P), W = n + B * Math.sin(P);
|
|
16975
|
+
t.save(), t.fillStyle = this._labelColor, t.font = "10px Arial", t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${R}°`, I, W), t.restore();
|
|
16976
16976
|
}
|
|
16977
16977
|
}
|
|
16978
16978
|
t.restore();
|
|
@@ -18440,10 +18440,10 @@ class ai {
|
|
|
18440
18440
|
if ((this._showHandles || this._isDragging || this._hoverPoint) && !this._isPreview) {
|
|
18441
18441
|
const p = (_, C, A, x = !1) => {
|
|
18442
18442
|
e.save(), e.fillStyle = this._color, e.beginPath(), e.arc(_, C, 6, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(_, C, 4, 0, Math.PI * 2), e.fill(), x && (e.strokeStyle = this._color, e.lineWidth = 2, e.setLineDash([]), e.beginPath(), e.arc(_, C, 8, 0, Math.PI * 2), e.stroke()), e.fillStyle = this._color, e.font = "12px Arial", e.textAlign = "center", e.textBaseline = "bottom";
|
|
18443
|
-
let
|
|
18444
|
-
A === "start" ?
|
|
18445
|
-
const B = e.measureText(
|
|
18446
|
-
e.fillRect(_ - B / 2 - 5, C - 25, B + 10, 18), e.fillStyle = "#333333", e.fillText(
|
|
18443
|
+
let R = "";
|
|
18444
|
+
A === "start" ? R = `${this._startPrice.toFixed(2)}` : A === "end" ? R = `${this._endPrice.toFixed(2)}` : A === "channel" && (R = `${(this._channelHeight / this._startPrice * 100).toFixed(2)}%`), e.fillStyle = "rgba(255, 255, 255, 0.9)";
|
|
18445
|
+
const B = e.measureText(R).width;
|
|
18446
|
+
e.fillRect(_ - B / 2 - 5, C - 25, B + 10, 18), e.fillStyle = "#333333", e.fillText(R, _, C - 10), e.restore();
|
|
18447
18447
|
};
|
|
18448
18448
|
p(i, r, "start", this._dragPoint === "start" || this._hoverPoint === "start"), p(a, s, "end", this._dragPoint === "end" || this._hoverPoint === "end");
|
|
18449
18449
|
const M = (i + a) / 2, k = (r + s) / 2, P = M + c * u, S = k + d * u;
|
|
@@ -18780,11 +18780,11 @@ class fs {
|
|
|
18780
18780
|
if (p === 0) return !1;
|
|
18781
18781
|
const M = -u / p, k = d / p;
|
|
18782
18782
|
for (let P = -1; P <= 1; P++) {
|
|
18783
|
-
const S = M * 30 * P, _ = k * 30 * P, C = a + S, A = s + _, x = n + S,
|
|
18783
|
+
const S = M * 30 * P, _ = k * 30 * P, C = a + S, A = s + _, x = n + S, R = o + _, B = t - C, I = e - A, W = x - C, L = R - A, $ = B * W + I * L, at = W * W + L * L;
|
|
18784
18784
|
let J = -1;
|
|
18785
18785
|
at !== 0 && (J = $ / at);
|
|
18786
18786
|
let Z, O;
|
|
18787
|
-
J < 0 ? (Z = C, O = A) : J > 1 ? (Z = x, O =
|
|
18787
|
+
J < 0 ? (Z = C, O = A) : J > 1 ? (Z = x, O = R) : (Z = C + J * W, O = A + J * L);
|
|
18788
18788
|
const it = t - Z, ht = e - O;
|
|
18789
18789
|
if (Math.sqrt(it * it + ht * ht) <= r)
|
|
18790
18790
|
return !0;
|
|
@@ -23205,7 +23205,7 @@ class ui {
|
|
|
23205
23205
|
return i ? t >= i.minX && t <= i.maxX && e >= i.minY && e <= i.maxY : !1;
|
|
23206
23206
|
}
|
|
23207
23207
|
}
|
|
23208
|
-
class
|
|
23208
|
+
class Rs {
|
|
23209
23209
|
constructor(t) {
|
|
23210
23210
|
this.previewTimeRangeMark = null, this.timeRangeMarks = [], this.dragStartData = null, this.isOperating = !1, this.firstPointPrice = 0, this.firstPointTime = 0, this.secondPointPrice = 0, this.secondPointTime = 0, this.setTimeRangeMarkMode = () => (this.state = {
|
|
23211
23211
|
...this.state,
|
|
@@ -23673,7 +23673,7 @@ class ae {
|
|
|
23673
23673
|
}
|
|
23674
23674
|
}
|
|
23675
23675
|
}
|
|
23676
|
-
class
|
|
23676
|
+
class Es {
|
|
23677
23677
|
constructor(t) {
|
|
23678
23678
|
this.previewMark = null, this.TriangleABCDMarks = [], this.mouseDownPoint = null, this.dragStartData = null, this.isOperating = !1, this.defaultColor = "#396DFE", this.lastMousePoint = null, this.setGlassTriangleABCDMode = () => (this.state = {
|
|
23679
23679
|
...this.state,
|
|
@@ -31677,8 +31677,8 @@ class _i {
|
|
|
31677
31677
|
if (isNaN(t) || isNaN(e) || !this._chart || !this._series) return;
|
|
31678
31678
|
const i = this._chart.timeScale(), r = i.timeToCoordinate(this._handleTime), a = this._series.priceToCoordinate(this._handlePrice), s = i.timeToCoordinate(this._baseStartTime), n = this._series.priceToCoordinate(this._baseStartPrice), o = i.timeToCoordinate(this._baseEndTime), h = this._series.priceToCoordinate(this._baseEndPrice), l = i.timeToCoordinate(this._extensionTime), g = this._series.priceToCoordinate(this._extensionPrice);
|
|
31679
31679
|
if (r === null || a === null || s === null || n === null || o === null || h === null || l === null || g === null) return;
|
|
31680
|
-
const c = r + t, d = a + e, u = s + t, p = n + e, M = o + t, k = h + e, P = l + t, S = g + e, _ = i.coordinateToTime(c), C = this._series.coordinateToPrice(d), A = i.coordinateToTime(u), x = this._series.coordinateToPrice(p),
|
|
31681
|
-
_ !== null && !isNaN(C) && A !== null && !isNaN(x) &&
|
|
31680
|
+
const c = r + t, d = a + e, u = s + t, p = n + e, M = o + t, k = h + e, P = l + t, S = g + e, _ = i.coordinateToTime(c), C = this._series.coordinateToPrice(d), A = i.coordinateToTime(u), x = this._series.coordinateToPrice(p), R = i.coordinateToTime(M), B = this._series.coordinateToPrice(k), I = i.coordinateToTime(P), W = this._series.coordinateToPrice(S);
|
|
31681
|
+
_ !== null && !isNaN(C) && A !== null && !isNaN(x) && R !== null && !isNaN(B) && I !== null && !isNaN(W) && (this._handleTime = _, this._handlePrice = C, this._baseStartTime = A, this._baseStartPrice = x, this._baseEndTime = R, this._baseEndPrice = B, this._extensionTime = I, this._extensionPrice = W, this.requestUpdate());
|
|
31682
31682
|
}
|
|
31683
31683
|
isPointNearHandle(t, e, i = 15) {
|
|
31684
31684
|
if (!this._chart || !this._series) return null;
|
|
@@ -31725,8 +31725,8 @@ class _i {
|
|
|
31725
31725
|
const g = (a + n) / 2, c = (s + o) / 2, d = a === n && s === o, u = h - g, p = l - c;
|
|
31726
31726
|
if (e.strokeStyle = "#2962FF", e.setLineDash([]), e.beginPath(), e.moveTo(g, c), e.lineTo(i, r), e.stroke(), !d) {
|
|
31727
31727
|
const S = -u * 3, _ = -p * 3, C = [];
|
|
31728
|
-
for (let
|
|
31729
|
-
const B =
|
|
31728
|
+
for (let R = 0; R < this._numberOfForks; R++) {
|
|
31729
|
+
const B = R / (this._numberOfForks - 1), I = a + (n - a) * B, W = s + (o - s) * B;
|
|
31730
31730
|
C.push({ x: I, y: W });
|
|
31731
31731
|
}
|
|
31732
31732
|
const A = [
|
|
@@ -31736,22 +31736,22 @@ class _i {
|
|
|
31736
31736
|
"#2196F3",
|
|
31737
31737
|
"#9C27B0"
|
|
31738
31738
|
];
|
|
31739
|
-
e.setLineDash(this._isPreview ? [5, 3] : []), C.forEach((
|
|
31740
|
-
e.strokeStyle = A[B], e.lineWidth = B === 2 ? this._lineWidth + 1 : this._lineWidth, e.beginPath(), e.moveTo(
|
|
31739
|
+
e.setLineDash(this._isPreview ? [5, 3] : []), C.forEach((R, B) => {
|
|
31740
|
+
e.strokeStyle = A[B], e.lineWidth = B === 2 ? this._lineWidth + 1 : this._lineWidth, e.beginPath(), e.moveTo(R.x, R.y), e.lineTo(R.x + S, R.y + _), e.stroke();
|
|
31741
31741
|
}), e.lineWidth = this._lineWidth;
|
|
31742
31742
|
const x = e.createLinearGradient(a, s, n, o);
|
|
31743
31743
|
if (x.addColorStop(0, "#FF4444"), x.addColorStop(0.5, "#4CAF50"), x.addColorStop(1, "#9C27B0"), e.strokeStyle = x, e.setLineDash([]), e.beginPath(), e.moveTo(a, s), e.lineTo(n, o), e.stroke(), !this._isPreview)
|
|
31744
|
-
for (let
|
|
31745
|
-
const B = C[
|
|
31744
|
+
for (let R = 0; R < C.length - 1; R++) {
|
|
31745
|
+
const B = C[R], I = C[R + 1], W = e.createLinearGradient(
|
|
31746
31746
|
B.x,
|
|
31747
31747
|
B.y,
|
|
31748
31748
|
I.x + S,
|
|
31749
31749
|
I.y + _
|
|
31750
31750
|
);
|
|
31751
|
-
|
|
31751
|
+
R === 0 ? (W.addColorStop(0, "rgba(255, 68, 68, 0.2)"), W.addColorStop(1, "rgba(255, 170, 0, 0.3)")) : R === 1 ? (W.addColorStop(0, "rgba(255, 170, 0, 0.3)"), W.addColorStop(1, "rgba(76, 175, 80, 0.4)")) : R === 2 ? (W.addColorStop(0, "rgba(76, 175, 80, 0.4)"), W.addColorStop(1, "rgba(33, 150, 243, 0.3)")) : R === 3 && (W.addColorStop(0, "rgba(33, 150, 243, 0.3)"), W.addColorStop(1, "rgba(156, 39, 176, 0.2)")), e.fillStyle = W, e.beginPath(), e.moveTo(B.x, B.y), e.lineTo(B.x + S, B.y + _), e.lineTo(I.x + S, I.y + _), e.lineTo(I.x, I.y), e.closePath(), e.fill(), e.strokeStyle = A[R], e.lineWidth = 0.5, e.setLineDash([2, 2]), e.stroke(), e.setLineDash([]);
|
|
31752
31752
|
}
|
|
31753
|
-
this._isPreview || C.forEach((
|
|
31754
|
-
const I =
|
|
31753
|
+
this._isPreview || C.forEach((R, B) => {
|
|
31754
|
+
const I = R.x + S, W = R.y + _;
|
|
31755
31755
|
e.fillStyle = A[B], e.beginPath(), e.arc(I, W, 3, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(I, W, 1, 0, Math.PI * 2), e.fill();
|
|
31756
31756
|
});
|
|
31757
31757
|
}
|
|
@@ -31823,8 +31823,8 @@ class _i {
|
|
|
31823
31823
|
if (t == null || e == null || i == null || r == null || a == null || s == null || n == null || o == null) return null;
|
|
31824
31824
|
const h = (i + a) / 2, l = (r + s) / 2, g = t - h, c = e - l, d = 3, u = -g * d, p = -c * d, M = [];
|
|
31825
31825
|
for (let C = 0; C < this._numberOfForks; C++) {
|
|
31826
|
-
const A = C / (this._numberOfForks - 1), x = i + (a - i) * A,
|
|
31827
|
-
M.push({ x, y:
|
|
31826
|
+
const A = C / (this._numberOfForks - 1), x = i + (a - i) * A, R = r + (s - r) * A;
|
|
31827
|
+
M.push({ x, y: R });
|
|
31828
31828
|
}
|
|
31829
31829
|
const k = M.map((C) => ({
|
|
31830
31830
|
x: C.x + u,
|
|
@@ -32317,7 +32317,7 @@ class ea {
|
|
|
32317
32317
|
chart: t.props.chart,
|
|
32318
32318
|
containerRef: t.containerRef,
|
|
32319
32319
|
onCloseDrawing: t.props.onCloseDrawing
|
|
32320
|
-
}), this.timeRangeMarkManager = new
|
|
32320
|
+
}), this.timeRangeMarkManager = new Rs({
|
|
32321
32321
|
chartSeries: t.props.chartSeries,
|
|
32322
32322
|
chart: t.props.chart,
|
|
32323
32323
|
containerRef: t.containerRef,
|
|
@@ -32347,7 +32347,7 @@ class ea {
|
|
|
32347
32347
|
chart: t.props.chart,
|
|
32348
32348
|
containerRef: t.containerRef,
|
|
32349
32349
|
onCloseDrawing: t.props.onCloseDrawing
|
|
32350
|
-
}), this.triangleABCDMarkManager = new
|
|
32350
|
+
}), this.triangleABCDMarkManager = new Es({
|
|
32351
32351
|
chartSeries: t.props.chartSeries,
|
|
32352
32352
|
chart: t.props.chart,
|
|
32353
32353
|
containerRef: t.containerRef,
|
|
@@ -34319,7 +34319,7 @@ const b = 1.5, T = "round", z = "round", Oi = ({ size: f = 29, color: t = "curre
|
|
|
34319
34319
|
/* @__PURE__ */ m.jsx("circle", { cx: "2", cy: "20", r: "1.2", stroke: t, strokeWidth: b, fill: "none" }),
|
|
34320
34320
|
/* @__PURE__ */ m.jsx("circle", { cx: "12", cy: "2", r: "1.2", stroke: t, strokeWidth: b, fill: "none" }),
|
|
34321
34321
|
/* @__PURE__ */ m.jsx("circle", { cx: "22", cy: "20", r: "1.2", stroke: t, strokeWidth: b, fill: "none" })
|
|
34322
|
-
] }),
|
|
34322
|
+
] }), Ra = ({ size: f = 29, color: t = "currentColor", className: e }) => /* @__PURE__ */ m.jsxs("svg", { width: f, height: f, viewBox: "0 0 24 24", fill: "none", className: e, children: [
|
|
34323
34323
|
/* @__PURE__ */ m.jsx("path", { d: "M2 20L12 2L22 20L2 20Z", stroke: t, strokeWidth: b * 0.8, strokeLinecap: T, strokeLinejoin: z, fill: "none" }),
|
|
34324
34324
|
/* @__PURE__ */ m.jsx("path", { d: "M6 16L18 16", stroke: t, strokeWidth: b * 0.8, strokeLinecap: T, strokeDasharray: "2 2" }),
|
|
34325
34325
|
/* @__PURE__ */ m.jsx("circle", { cx: "2", cy: "20", r: "1", stroke: t, strokeWidth: b, fill: "none" }),
|
|
@@ -34327,7 +34327,7 @@ const b = 1.5, T = "round", z = "round", Oi = ({ size: f = 29, color: t = "curre
|
|
|
34327
34327
|
/* @__PURE__ */ m.jsx("circle", { cx: "22", cy: "20", r: "1", stroke: t, strokeWidth: b, fill: "none" }),
|
|
34328
34328
|
/* @__PURE__ */ m.jsx("circle", { cx: "6", cy: "16", r: "1", stroke: t, strokeWidth: b, fill: "none" }),
|
|
34329
34329
|
/* @__PURE__ */ m.jsx("circle", { cx: "18", cy: "16", r: "1", stroke: t, strokeWidth: b, fill: "none" })
|
|
34330
|
-
] }),
|
|
34330
|
+
] }), Ea = ({ size: f = 29, color: t = "currentColor", className: e }) => /* @__PURE__ */ m.jsxs("svg", { width: f, height: f, viewBox: "0 0 24 24", fill: "none", className: e, children: [
|
|
34331
34331
|
/* @__PURE__ */ m.jsx("path", { d: "M2 18L6 6L10 14L14 6L18 10L22 18", stroke: t, strokeWidth: b, strokeLinecap: T, strokeLinejoin: z }),
|
|
34332
34332
|
/* @__PURE__ */ m.jsx("circle", { cx: "6", cy: "6", r: "0.8", fill: t }),
|
|
34333
34333
|
/* @__PURE__ */ m.jsx("circle", { cx: "10", cy: "14", r: "0.8", fill: t }),
|
|
@@ -34622,7 +34622,7 @@ const b = 1.5, T = "round", z = "round", Oi = ({ size: f = 29, color: t = "curre
|
|
|
34622
34622
|
/* @__PURE__ */ m.jsx("path", { d: "M15 6V18", stroke: t, strokeWidth: b, strokeLinecap: T }),
|
|
34623
34623
|
/* @__PURE__ */ m.jsx("path", { d: "M18 8V16", stroke: t, strokeWidth: b, strokeLinecap: T }),
|
|
34624
34624
|
/* @__PURE__ */ m.jsx("path", { d: "M20 10L23 12L20 14", stroke: t, strokeWidth: b, strokeLinecap: T, strokeLinejoin: z })
|
|
34625
|
-
] }),
|
|
34625
|
+
] }), Rn = ({ size: f = 29, color: t = "currentColor", className: e }) => /* @__PURE__ */ m.jsxs("svg", { width: f, height: f, viewBox: "0 0 24 24", fill: "none", className: e, children: [
|
|
34626
34626
|
/* @__PURE__ */ m.jsx("path", { d: "M12 2V22", stroke: t, strokeWidth: b, strokeLinecap: T }),
|
|
34627
34627
|
/* @__PURE__ */ m.jsx("path", { d: "M8 6H16", stroke: t, strokeWidth: b, strokeLinecap: T }),
|
|
34628
34628
|
/* @__PURE__ */ m.jsx("path", { d: "M6 9H18", stroke: t, strokeWidth: b, strokeLinecap: T }),
|
|
@@ -34630,7 +34630,7 @@ const b = 1.5, T = "round", z = "round", Oi = ({ size: f = 29, color: t = "curre
|
|
|
34630
34630
|
/* @__PURE__ */ m.jsx("path", { d: "M6 15H18", stroke: t, strokeWidth: b, strokeLinecap: T }),
|
|
34631
34631
|
/* @__PURE__ */ m.jsx("path", { d: "M8 18H16", stroke: t, strokeWidth: b, strokeLinecap: T }),
|
|
34632
34632
|
/* @__PURE__ */ m.jsx("path", { d: "M10 20L12 23L14 20", stroke: t, strokeWidth: b, strokeLinecap: T, strokeLinejoin: z })
|
|
34633
|
-
] }),
|
|
34633
|
+
] }), En = ({ size: f = 29, color: t = "currentColor", className: e }) => /* @__PURE__ */ m.jsx("svg", { width: f, height: f, viewBox: "0 0 24 24", fill: "none", className: e, children: /* @__PURE__ */ m.jsx("path", { d: "M4 20A16 16 0 0 1 20 4L20 20L4 20Z", stroke: t, strokeWidth: b, fill: "none" }) }), yn = ({ size: f = 25, color: t = "currentColor", className: e }) => /* @__PURE__ */ m.jsxs("svg", { width: f, height: f, viewBox: "0 0 24 24", fill: "none", className: e, children: [
|
|
34634
34634
|
/* @__PURE__ */ m.jsx(
|
|
34635
34635
|
"rect",
|
|
34636
34636
|
{
|
|
@@ -38943,7 +38943,7 @@ const Vn = ({
|
|
|
38943
38943
|
...o,
|
|
38944
38944
|
params: V
|
|
38945
38945
|
});
|
|
38946
|
-
},
|
|
38946
|
+
}, R = (Y, U) => {
|
|
38947
38947
|
if (!o || !o.params) return;
|
|
38948
38948
|
const V = [...o.params];
|
|
38949
38949
|
V[Y] = { ...V[Y], lineWidth: U }, h({
|
|
@@ -39014,10 +39014,10 @@ const Vn = ({
|
|
|
39014
39014
|
ut(() => {
|
|
39015
39015
|
const Y = (V) => {
|
|
39016
39016
|
if (c) {
|
|
39017
|
-
const G = V.clientX - u.x, wt = V.clientY - u.y, Tt = window.innerWidth - 400,
|
|
39017
|
+
const G = V.clientX - u.x, wt = V.clientY - u.y, Tt = window.innerWidth - 400, Rt = window.innerHeight - 400;
|
|
39018
39018
|
g({
|
|
39019
39019
|
x: Math.max(10, Math.min(G, Tt)),
|
|
39020
|
-
y: Math.max(10, Math.min(wt,
|
|
39020
|
+
y: Math.max(10, Math.min(wt, Rt))
|
|
39021
39021
|
});
|
|
39022
39022
|
}
|
|
39023
39023
|
}, U = () => {
|
|
@@ -39074,7 +39074,7 @@ const Vn = ({
|
|
|
39074
39074
|
cursor: "grab",
|
|
39075
39075
|
userSelect: "none",
|
|
39076
39076
|
flexShrink: 0
|
|
39077
|
-
},
|
|
39077
|
+
}, E = {
|
|
39078
39078
|
fontSize: "14px",
|
|
39079
39079
|
fontWeight: "bold",
|
|
39080
39080
|
color: r?.layout?.textColor || "#000000",
|
|
@@ -39236,7 +39236,7 @@ const Vn = ({
|
|
|
39236
39236
|
onMouseDown: (Y) => {
|
|
39237
39237
|
Y.target === k.current && Y.preventDefault();
|
|
39238
39238
|
},
|
|
39239
|
-
children: /* @__PURE__ */ m.jsx("div", { style:
|
|
39239
|
+
children: /* @__PURE__ */ m.jsx("div", { style: E, children: L() })
|
|
39240
39240
|
}
|
|
39241
39241
|
),
|
|
39242
39242
|
/* @__PURE__ */ m.jsxs("div", { style: N, children: [
|
|
@@ -39262,7 +39262,7 @@ const Vn = ({
|
|
|
39262
39262
|
{
|
|
39263
39263
|
style: Q,
|
|
39264
39264
|
value: Y.lineWidth,
|
|
39265
|
-
onChange: (V) =>
|
|
39265
|
+
onChange: (V) => R(U, Number(V.target.value)),
|
|
39266
39266
|
onClick: (V) => V.stopPropagation(),
|
|
39267
39267
|
children: [
|
|
39268
39268
|
/* @__PURE__ */ m.jsx("option", { value: 1, children: "1px" }),
|
|
@@ -39690,10 +39690,10 @@ class Gn {
|
|
|
39690
39690
|
MinusDI: []
|
|
39691
39691
|
}, r = t.map((S) => S.time), a = [0], s = [0], n = [0];
|
|
39692
39692
|
for (let S = 1; S < t.length; S++) {
|
|
39693
|
-
const _ = t[S].high, C = t[S].low, A = t[S - 1].high, x = t[S - 1].low,
|
|
39693
|
+
const _ = t[S].high, C = t[S].low, A = t[S - 1].high, x = t[S - 1].low, R = t[S - 1].close, B = Math.max(
|
|
39694
39694
|
_ - C,
|
|
39695
|
-
Math.abs(_ -
|
|
39696
|
-
Math.abs(C -
|
|
39695
|
+
Math.abs(_ - R),
|
|
39696
|
+
Math.abs(C - R)
|
|
39697
39697
|
);
|
|
39698
39698
|
a.push(B);
|
|
39699
39699
|
const I = _ - A, W = x - C;
|
|
@@ -41590,10 +41590,10 @@ const So = ({
|
|
|
41590
41590
|
}, [f, i]), ut(() => {
|
|
41591
41591
|
f && g((() => {
|
|
41592
41592
|
if (a?.current) {
|
|
41593
|
-
const V = a.current.getBoundingClientRect(), G = 450, wt = 500, Tt = V.left + (V.width - G) / 2,
|
|
41593
|
+
const V = a.current.getBoundingClientRect(), G = 450, wt = 500, Tt = V.left + (V.width - G) / 2, Rt = V.top + (V.height - wt) / 2;
|
|
41594
41594
|
return {
|
|
41595
41595
|
x: Math.max(10, Tt),
|
|
41596
|
-
y: Math.max(10,
|
|
41596
|
+
y: Math.max(10, Rt)
|
|
41597
41597
|
};
|
|
41598
41598
|
} else {
|
|
41599
41599
|
const V = Math.max(10, (window.innerWidth - 450) / 2), G = Math.max(10, (window.innerHeight - 500) / 2);
|
|
@@ -41606,14 +41606,14 @@ const So = ({
|
|
|
41606
41606
|
if (o.length >= U.maxParams || !U.allowAdd) return;
|
|
41607
41607
|
const V = o.map((Lt) => Lt.paramValue), G = [6, 12, 14, 24, 26, 9, 20].filter((Lt) => !V.includes(Lt));
|
|
41608
41608
|
if (G.length === 0) return;
|
|
41609
|
-
const wt = B(), Tt = G[0],
|
|
41609
|
+
const wt = B(), Tt = G[0], Rt = {
|
|
41610
41610
|
paramName: `${n.modal?.parameterName || "Param"}${Tt}`,
|
|
41611
41611
|
paramValue: Tt,
|
|
41612
41612
|
lineColor: wt,
|
|
41613
41613
|
lineWidth: 1,
|
|
41614
41614
|
data: []
|
|
41615
41615
|
};
|
|
41616
|
-
h([...o,
|
|
41616
|
+
h([...o, Rt]);
|
|
41617
41617
|
}, _ = (U) => {
|
|
41618
41618
|
const V = $(s);
|
|
41619
41619
|
if (o.length <= V.minParams || !V.allowDelete) return;
|
|
@@ -41637,7 +41637,7 @@ const So = ({
|
|
|
41637
41637
|
...G[U],
|
|
41638
41638
|
lineColor: V
|
|
41639
41639
|
}, h(G);
|
|
41640
|
-
},
|
|
41640
|
+
}, R = (U, V) => {
|
|
41641
41641
|
const G = [...o];
|
|
41642
41642
|
G[U] = {
|
|
41643
41643
|
...G[U],
|
|
@@ -41788,9 +41788,9 @@ const So = ({
|
|
|
41788
41788
|
ut(() => {
|
|
41789
41789
|
const U = (G) => {
|
|
41790
41790
|
if (c) {
|
|
41791
|
-
const wt = G.clientX - u.x, Tt = G.clientY - u.y,
|
|
41791
|
+
const wt = G.clientX - u.x, Tt = G.clientY - u.y, Rt = window.innerWidth - 450, Lt = window.innerHeight - 500;
|
|
41792
41792
|
g({
|
|
41793
|
-
x: Math.max(10, Math.min(wt,
|
|
41793
|
+
x: Math.max(10, Math.min(wt, Rt)),
|
|
41794
41794
|
y: Math.max(10, Math.min(Tt, Lt))
|
|
41795
41795
|
});
|
|
41796
41796
|
}
|
|
@@ -41853,7 +41853,7 @@ const So = ({
|
|
|
41853
41853
|
fontWeight: "bold",
|
|
41854
41854
|
color: r?.layout?.textColor || "#000000",
|
|
41855
41855
|
margin: 0
|
|
41856
|
-
},
|
|
41856
|
+
}, E = {
|
|
41857
41857
|
padding: "16px",
|
|
41858
41858
|
flex: 1,
|
|
41859
41859
|
display: "flex",
|
|
@@ -42018,7 +42018,7 @@ const So = ({
|
|
|
42018
42018
|
] })
|
|
42019
42019
|
}
|
|
42020
42020
|
),
|
|
42021
|
-
/* @__PURE__ */ m.jsxs("div", { style:
|
|
42021
|
+
/* @__PURE__ */ m.jsxs("div", { style: E, children: [
|
|
42022
42022
|
/* @__PURE__ */ m.jsx(
|
|
42023
42023
|
"div",
|
|
42024
42024
|
{
|
|
@@ -42055,7 +42055,7 @@ const So = ({
|
|
|
42055
42055
|
{
|
|
42056
42056
|
style: y,
|
|
42057
42057
|
value: U.lineWidth,
|
|
42058
|
-
onChange: (G) =>
|
|
42058
|
+
onChange: (G) => R(V, Number(G.target.value)),
|
|
42059
42059
|
onClick: (G) => G.stopPropagation(),
|
|
42060
42060
|
children: [
|
|
42061
42061
|
/* @__PURE__ */ m.jsx("option", { value: 1, children: "1px" }),
|
|
@@ -42945,7 +42945,7 @@ class Fo {
|
|
|
42945
42945
|
return this.series;
|
|
42946
42946
|
}
|
|
42947
42947
|
}
|
|
42948
|
-
class
|
|
42948
|
+
class Ro {
|
|
42949
42949
|
constructor(t, e) {
|
|
42950
42950
|
this.series = null, this.refreshData = (r) => {
|
|
42951
42951
|
if (!this.series) return;
|
|
@@ -43049,7 +43049,7 @@ class Eo {
|
|
|
43049
43049
|
return this.series;
|
|
43050
43050
|
}
|
|
43051
43051
|
}
|
|
43052
|
-
class
|
|
43052
|
+
class Eo {
|
|
43053
43053
|
constructor(t, e) {
|
|
43054
43054
|
this.series = null, this._chart = null, this._renderer = null, this._chartData = [], this._width = 0, this._height = 0, this._isAttached = !1, this.channelWidthPercent = 0.3, this._timeScale = null, this._lineWidth = 2, this.refreshData = (r) => {
|
|
43055
43055
|
if (!this.series) return;
|
|
@@ -43329,10 +43329,10 @@ class Bo {
|
|
|
43329
43329
|
this.currentChart = new yo(this.chartLayer, this.theme);
|
|
43330
43330
|
break;
|
|
43331
43331
|
case q.HighLow:
|
|
43332
|
-
this.currentChart = new
|
|
43332
|
+
this.currentChart = new Ro(this.chartLayer, this.theme);
|
|
43333
43333
|
break;
|
|
43334
43334
|
case q.HLCArea:
|
|
43335
|
-
this.currentChart = new
|
|
43335
|
+
this.currentChart = new Eo(this.chartLayer, this.theme);
|
|
43336
43336
|
break;
|
|
43337
43337
|
default:
|
|
43338
43338
|
console.warn(`Unknown chart type: ${t}`), this.currentChart = new xi(this.chartLayer, this.theme);
|
|
@@ -43472,7 +43472,7 @@ class Uo {
|
|
|
43472
43472
|
const L = (_ - 0.5) * 2;
|
|
43473
43473
|
C = Math.floor(255 * L), A = Math.floor(255 * (1 - L)), x = Math.floor(255 * (1 - L));
|
|
43474
43474
|
}
|
|
43475
|
-
const
|
|
43475
|
+
const R = 0.4 + _ * 0.6, B = `rgba(${C}, ${A}, ${x}, ${R})`, I = o + (n - S), W = this._height - (u + 1) * d;
|
|
43476
43476
|
t.fillStyle = B, t.fillRect(I, W, S, d);
|
|
43477
43477
|
}
|
|
43478
43478
|
t.restore();
|
|
@@ -46271,7 +46271,7 @@ function Ce(f, t, e, i) {
|
|
|
46271
46271
|
};
|
|
46272
46272
|
}
|
|
46273
46273
|
class be {
|
|
46274
|
-
// The raw data undergoes time zone conversion, time frame data aggregation, and virtual data expansion processing.
|
|
46274
|
+
// The raw data undergoes time zone conversion, time frame data aggregation, and virtual data expansion processing.
|
|
46275
46275
|
// This data is generally used for charts other than the main chart.
|
|
46276
46276
|
static handleData(t, e, i) {
|
|
46277
46277
|
if (!t || t.length === 0)
|
|
@@ -46382,7 +46382,7 @@ class be {
|
|
|
46382
46382
|
value: Number(r.close),
|
|
46383
46383
|
...a && { color: "transparent" }
|
|
46384
46384
|
};
|
|
46385
|
-
}),
|
|
46385
|
+
}), i;
|
|
46386
46386
|
} catch {
|
|
46387
46387
|
return [];
|
|
46388
46388
|
}
|
|
@@ -47638,7 +47638,7 @@ const ll = {
|
|
|
47638
47638
|
deepseek: "https://www.deepseek.com/favicon.ico",
|
|
47639
47639
|
claude: "https://cdn.simpleicons.org/anthropic/FF6B35",
|
|
47640
47640
|
gemini: "https://cdn.simpleicons.org/google/4285F4"
|
|
47641
|
-
},
|
|
47641
|
+
}, Ri = {
|
|
47642
47642
|
aliyun: "Aliyun",
|
|
47643
47643
|
openai: "OpenAI",
|
|
47644
47644
|
deepseek: "DeepSeek",
|
|
@@ -47717,7 +47717,7 @@ const ul = ({
|
|
|
47717
47717
|
onModelChange: h,
|
|
47718
47718
|
data: l
|
|
47719
47719
|
}) => {
|
|
47720
|
-
const [g, c] = st(""), [d, u] = st([]), [p, M] = st(!1), [k, P] = st(""), [S, _] = st([]), [C, A] = st(!1), x = Ct(null),
|
|
47720
|
+
const [g, c] = st(""), [d, u] = st([]), [p, M] = st(!1), [k, P] = st(""), [S, _] = st([]), [C, A] = st(!1), x = Ct(null), R = Ct(null), B = Ct(null), [I, W] = st(10), L = 10, $ = Ct(!1), at = Ct(0), J = Ct(0);
|
|
47721
47721
|
ut(() => {
|
|
47722
47722
|
const y = (Q) => {
|
|
47723
47723
|
C && B.current && !B.current.contains(Q.target) && A(!1);
|
|
@@ -47791,7 +47791,7 @@ const ul = ({
|
|
|
47791
47791
|
};
|
|
47792
47792
|
return y.addEventListener("scroll", Q), () => y.removeEventListener("scroll", Q);
|
|
47793
47793
|
}, []), ut(() => {
|
|
47794
|
-
const y =
|
|
47794
|
+
const y = R.current;
|
|
47795
47795
|
y && setTimeout(() => {
|
|
47796
47796
|
y.style.height = "auto";
|
|
47797
47797
|
const et = Math.max(y.scrollHeight, 60);
|
|
@@ -47807,7 +47807,7 @@ const ul = ({
|
|
|
47807
47807
|
}
|
|
47808
47808
|
]);
|
|
47809
47809
|
}, [e, t]), ut(() => {
|
|
47810
|
-
const y =
|
|
47810
|
+
const y = R.current;
|
|
47811
47811
|
if (!y) return;
|
|
47812
47812
|
const Q = 60;
|
|
47813
47813
|
y.style.height = "auto";
|
|
@@ -47832,7 +47832,7 @@ const ul = ({
|
|
|
47832
47832
|
}, [o, i, h]);
|
|
47833
47833
|
const pt = (y) => {
|
|
47834
47834
|
c(y.target.value);
|
|
47835
|
-
},
|
|
47835
|
+
}, E = (y) => {
|
|
47836
47836
|
P(y), A(!1), h && h(y);
|
|
47837
47837
|
}, N = () => !o || !k ? null : i.find(
|
|
47838
47838
|
(Q) => Q.brand === o && Q.model === k
|
|
@@ -47913,7 +47913,7 @@ const ul = ({
|
|
|
47913
47913
|
});
|
|
47914
47914
|
} finally {
|
|
47915
47915
|
M(!1), setTimeout(() => {
|
|
47916
|
-
|
|
47916
|
+
R.current?.focus();
|
|
47917
47917
|
}, 100);
|
|
47918
47918
|
}
|
|
47919
47919
|
}, ct = (y) => {
|
|
@@ -48055,7 +48055,7 @@ const ul = ({
|
|
|
48055
48055
|
textOverflow: "ellipsis",
|
|
48056
48056
|
whiteSpace: "nowrap"
|
|
48057
48057
|
},
|
|
48058
|
-
onClick: () =>
|
|
48058
|
+
onClick: () => E(y),
|
|
48059
48059
|
onMouseEnter: (et) => {
|
|
48060
48060
|
et.currentTarget.style.backgroundColor = y === k ? f.toolbar.button.dropdown.selected : f.toolbar.button.dropdown.hover;
|
|
48061
48061
|
},
|
|
@@ -48249,7 +48249,7 @@ const ul = ({
|
|
|
48249
48249
|
/* @__PURE__ */ m.jsx(
|
|
48250
48250
|
"textarea",
|
|
48251
48251
|
{
|
|
48252
|
-
ref:
|
|
48252
|
+
ref: R,
|
|
48253
48253
|
value: g,
|
|
48254
48254
|
onChange: pt,
|
|
48255
48255
|
onKeyDown: ct,
|
|
@@ -48326,7 +48326,7 @@ const ul = ({
|
|
|
48326
48326
|
marginTop: "8px",
|
|
48327
48327
|
textAlign: "center"
|
|
48328
48328
|
}, children: [
|
|
48329
|
-
o ? t === kt ? `Powered by ${
|
|
48329
|
+
o ? t === kt ? `Powered by ${Ri[o]}` : `由 ${Ri[o]} 提供支持` : null,
|
|
48330
48330
|
k && ` - ${k}`
|
|
48331
48331
|
] })
|
|
48332
48332
|
] }),
|
|
@@ -48417,7 +48417,7 @@ const pl = [
|
|
|
48417
48417
|
chartLayerRef: o,
|
|
48418
48418
|
candleView: h
|
|
48419
48419
|
}) => {
|
|
48420
|
-
const [l, g] = st(""), [c, d] = st([]), [u, p] = st(-1), [M, k] = st(!1), [P, S] = st(0), [_, C] = st(n), [A, x] = st([]), [
|
|
48420
|
+
const [l, g] = st(""), [c, d] = st([]), [u, p] = st(-1), [M, k] = st(!1), [P, S] = st(0), [_, C] = st(n), [A, x] = st([]), [R, B] = st(!1), I = Ct(null), W = Ct(null), L = t.terminal.isEn === "en", [$, at] = st([]), [J, Z] = st(-1), [O, it] = st(!1);
|
|
48421
48421
|
ut(() => {
|
|
48422
48422
|
x([L ? `🕯️ Welcome to CandleView Terminal v1.0 Type 'help' to see available commands
|
|
48423
48423
|
This software is licensed under AGPL 3.0
|
|
@@ -48481,7 +48481,7 @@ Npm: <a href="https://www.npmjs.com/package/candleview" target="_blank" rel="noo
|
|
|
48481
48481
|
localStorage.setItem("terminal_command_history", JSON.stringify(X));
|
|
48482
48482
|
} catch {
|
|
48483
48483
|
}
|
|
48484
|
-
},
|
|
48484
|
+
}, E = (D) => {
|
|
48485
48485
|
x((K) => [...K, `$ ${D}`]);
|
|
48486
48486
|
}, N = (D) => {
|
|
48487
48487
|
x((K) => [...K, D]);
|
|
@@ -48493,7 +48493,7 @@ Npm: <a href="https://www.npmjs.com/package/candleview" target="_blank" rel="noo
|
|
|
48493
48493
|
const nt = (D) => {
|
|
48494
48494
|
D.preventDefault();
|
|
48495
48495
|
const K = l.trim();
|
|
48496
|
-
K && (
|
|
48496
|
+
K && (E(K), e && e(K), Tt(K), pt(K), g(""), p(-1), at([]), it(!1), Z(-1), setTimeout(() => {
|
|
48497
48497
|
const X = document.querySelector(".terminal-scrollbar");
|
|
48498
48498
|
X && (X.scrollTop = X.scrollHeight);
|
|
48499
48499
|
}, 50), !r && _ && (I.current?.focus(), S(0)));
|
|
@@ -48663,15 +48663,15 @@ Npm: <a href="https://www.npmjs.com/package/candleview" target="_blank" rel="noo
|
|
|
48663
48663
|
}, Tt = (D) => {
|
|
48664
48664
|
const K = D.toLowerCase().trim();
|
|
48665
48665
|
if (K.startsWith("open ") || K.startsWith("close ")) {
|
|
48666
|
-
const [X, ...lt] = K.split(" "), mt = lt.join(" ").toUpperCase(), Ot = Object.values(F).includes(mt),
|
|
48667
|
-
if (!Ot && !
|
|
48668
|
-
const Gt = Object.values(F).map((Yt) => Yt.toLowerCase().replace(/_/g, " ")).join(", "),
|
|
48666
|
+
const [X, ...lt] = K.split(" "), mt = lt.join(" ").toUpperCase(), Ot = Object.values(F).includes(mt), Re = Object.values(j).includes(mt);
|
|
48667
|
+
if (!Ot && !Re) {
|
|
48668
|
+
const Gt = Object.values(F).map((Yt) => Yt.toLowerCase().replace(/_/g, " ")).join(", "), Et = Object.values(j).map((Yt) => Yt.toLowerCase().replace(/_/g, " ")).join(", ");
|
|
48669
48669
|
N(
|
|
48670
48670
|
L ? `[<span style="color: #c41a1aff">ERROR</span>] Invalid indicator: "${mt}".
|
|
48671
48671
|
Main chart indicators: ${Gt}
|
|
48672
|
-
Sub chart indicators: ${
|
|
48672
|
+
Sub chart indicators: ${Et}` : `[<span style="color: #c41a1aff">错误</span>] 无效的指标: "${mt}"。
|
|
48673
48673
|
主图指标: ${Gt}
|
|
48674
|
-
副图指标: ${
|
|
48674
|
+
副图指标: ${Et}`
|
|
48675
48675
|
);
|
|
48676
48676
|
return;
|
|
48677
48677
|
}
|
|
@@ -48706,13 +48706,13 @@ Sub chart indicators: ${Rt}` : `[<span style="color: #c41a1aff">错误</span>]
|
|
|
48706
48706
|
At(ft);
|
|
48707
48707
|
break;
|
|
48708
48708
|
default:
|
|
48709
|
-
const
|
|
48709
|
+
const Et = mt.toLowerCase().replace(/_/g, " ");
|
|
48710
48710
|
N(
|
|
48711
|
-
L ? `[<span style="color: #52c41a">INFO</span>] ${X === "open" ? "Opening" : "Closing"} main chart indicator: ${
|
|
48711
|
+
L ? `[<span style="color: #52c41a">INFO</span>] ${X === "open" ? "Opening" : "Closing"} main chart indicator: ${Et}` : `[<span style="color: #52c41a">信息</span>] ${X === "open" ? "开启" : "关闭"}主图指标: ${Et}`
|
|
48712
48712
|
);
|
|
48713
48713
|
break;
|
|
48714
48714
|
}
|
|
48715
|
-
else if (
|
|
48715
|
+
else if (Re)
|
|
48716
48716
|
switch (mt) {
|
|
48717
48717
|
case j.RSI:
|
|
48718
48718
|
Pt(ft);
|
|
@@ -48748,9 +48748,9 @@ Sub chart indicators: ${Rt}` : `[<span style="color: #c41a1aff">错误</span>]
|
|
|
48748
48748
|
wt(ft);
|
|
48749
48749
|
break;
|
|
48750
48750
|
default:
|
|
48751
|
-
const
|
|
48751
|
+
const Et = mt.toLowerCase().replace(/_/g, " ");
|
|
48752
48752
|
N(
|
|
48753
|
-
L ? `[<span style="color: #52c41a">INFO</span>] ${X === "open" ? "Opening" : "Closing"} sub chart indicator: ${
|
|
48753
|
+
L ? `[<span style="color: #52c41a">INFO</span>] ${X === "open" ? "Opening" : "Closing"} sub chart indicator: ${Et}` : `[<span style="color: #52c41a">信息</span>] ${X === "open" ? "开启" : "关闭"}副图指标: ${Et}`
|
|
48754
48754
|
);
|
|
48755
48755
|
break;
|
|
48756
48756
|
}
|
|
@@ -48804,7 +48804,7 @@ ${X}`
|
|
|
48804
48804
|
N(
|
|
48805
48805
|
L ? `Command executed: ${D}` : `命令已执行: ${D}`
|
|
48806
48806
|
);
|
|
48807
|
-
},
|
|
48807
|
+
}, Rt = (D) => {
|
|
48808
48808
|
if (!r)
|
|
48809
48809
|
switch (D.key) {
|
|
48810
48810
|
case "ArrowLeft":
|
|
@@ -48920,7 +48920,7 @@ ${X}`
|
|
|
48920
48920
|
style: {
|
|
48921
48921
|
fontSize: "20px",
|
|
48922
48922
|
color: f.toolbar.button.color,
|
|
48923
|
-
backgroundColor:
|
|
48923
|
+
backgroundColor: R ? f.toolbar.button.hover + "20" : "transparent",
|
|
48924
48924
|
border: "none",
|
|
48925
48925
|
borderRadius: "4px",
|
|
48926
48926
|
padding: "6px",
|
|
@@ -48931,7 +48931,7 @@ ${X}`
|
|
|
48931
48931
|
justifyContent: "center",
|
|
48932
48932
|
width: "30px",
|
|
48933
48933
|
height: "30px",
|
|
48934
|
-
opacity:
|
|
48934
|
+
opacity: R ? 1 : 0.7,
|
|
48935
48935
|
transition: "opacity 0.2s, background-color 0.2s"
|
|
48936
48936
|
},
|
|
48937
48937
|
title: L ? "Close Terminal" : "关闭终端",
|
|
@@ -49076,7 +49076,7 @@ ${X}`
|
|
|
49076
49076
|
onChange: (D) => {
|
|
49077
49077
|
g(D.target.value), p(-1), S(D.target.selectionStart || 0);
|
|
49078
49078
|
},
|
|
49079
|
-
onKeyDown:
|
|
49079
|
+
onKeyDown: Rt,
|
|
49080
49080
|
onFocus: () => k(!0),
|
|
49081
49081
|
onBlur: () => k(!1),
|
|
49082
49082
|
disabled: r,
|
|
@@ -49668,7 +49668,7 @@ ${X}`
|
|
|
49668
49668
|
{ id: "fibonacci-wedge", name: f.leftPanel.fibonacciWedge, description: f.leftPanel.fibonacciWedgeDesc, icon: Ca },
|
|
49669
49669
|
{ id: "fibonacci-fan", name: f.leftPanel.fibonacciFan, description: f.leftPanel.fibonacciFanDesc, icon: va },
|
|
49670
49670
|
{ id: "fibonacci-channel", name: f.leftPanel.fibonacciChannel, description: f.leftPanel.fibonacciChannelDesc, icon: Ta },
|
|
49671
|
-
{ id: "fibonacci-extension-base-price", name: f.leftPanel.fibonacciExtensionPrice, description: f.leftPanel.fibonacciExtensionPriceDesc, icon:
|
|
49671
|
+
{ id: "fibonacci-extension-base-price", name: f.leftPanel.fibonacciExtensionPrice, description: f.leftPanel.fibonacciExtensionPriceDesc, icon: Rn },
|
|
49672
49672
|
{ id: "fibonacci-extension-base-time", name: f.leftPanel.fibonacciExtensionTime, description: f.leftPanel.fibonacciExtensionTimeDesc, icon: Fn }
|
|
49673
49673
|
]
|
|
49674
49674
|
}
|
|
@@ -49680,13 +49680,13 @@ ${X}`
|
|
|
49680
49680
|
{ id: "xabcd", name: f.leftPanel.xabcdPattern, description: f.leftPanel.xabcdPatternDesc, icon: xa },
|
|
49681
49681
|
{ id: "head-and-shoulders", name: f.leftPanel.headAndShoulders, description: f.leftPanel.headAndShouldersDesc, icon: Da },
|
|
49682
49682
|
{ id: "abcd", name: f.leftPanel.abcdPattern, description: f.leftPanel.abcdPatternDesc, icon: Fa },
|
|
49683
|
-
{ id: "triangle-abcd", name: f.leftPanel.triangleAbcd, description: f.leftPanel.triangleAbcdDesc, icon:
|
|
49683
|
+
{ id: "triangle-abcd", name: f.leftPanel.triangleAbcd, description: f.leftPanel.triangleAbcdDesc, icon: Ra }
|
|
49684
49684
|
]
|
|
49685
49685
|
},
|
|
49686
49686
|
{
|
|
49687
49687
|
title: f.leftPanel.elliottWave,
|
|
49688
49688
|
tools: [
|
|
49689
|
-
{ id: "elliott-lmpulse", name: f.leftPanel.elliottImpulse, description: f.leftPanel.elliottImpulseDesc, icon:
|
|
49689
|
+
{ id: "elliott-lmpulse", name: f.leftPanel.elliottImpulse, description: f.leftPanel.elliottImpulseDesc, icon: Ea },
|
|
49690
49690
|
{ id: "elliott-corrective", name: f.leftPanel.elliottCorrective, description: f.leftPanel.elliottCorrectiveDesc, icon: ya },
|
|
49691
49691
|
{ id: "elliott-triangle", name: f.leftPanel.elliottTriangle, description: f.leftPanel.elliottTriangleDesc, icon: Ba },
|
|
49692
49692
|
{ id: "elliott-double-combo", name: f.leftPanel.elliottDoubleCombo, description: f.leftPanel.elliottDoubleComboDesc, icon: Ua },
|
|
@@ -49700,7 +49700,7 @@ ${X}`
|
|
|
49700
49700
|
{ id: "circle", name: f.leftPanel.circle, description: f.leftPanel.circleDesc, icon: aa },
|
|
49701
49701
|
{ id: "ellipse", name: f.leftPanel.ellipse, description: f.leftPanel.ellipseDesc, icon: ca },
|
|
49702
49702
|
{ id: "triangle", name: f.leftPanel.triangle, description: f.leftPanel.triangleDesc, icon: na },
|
|
49703
|
-
{ id: "sector", name: f.leftPanel.sector, description: f.leftPanel.sectorDesc, icon:
|
|
49703
|
+
{ id: "sector", name: f.leftPanel.sector, description: f.leftPanel.sectorDesc, icon: En },
|
|
49704
49704
|
{ id: "curve", name: f.leftPanel.curve, description: f.leftPanel.curveDesc, icon: La },
|
|
49705
49705
|
{ id: "double-curve", name: f.leftPanel.doubleCurve, description: f.leftPanel.doubleCurveDesc, icon: Ka }
|
|
49706
49706
|
]
|
|
@@ -49788,7 +49788,7 @@ ${X}`
|
|
|
49788
49788
|
}
|
|
49789
49789
|
]
|
|
49790
49790
|
});
|
|
49791
|
-
class
|
|
49791
|
+
class Ei {
|
|
49792
49792
|
constructor() {
|
|
49793
49793
|
this.handleDrawingToolSelect = (t, e) => {
|
|
49794
49794
|
t.setState({
|
|
@@ -49806,7 +49806,7 @@ class Ri {
|
|
|
49806
49806
|
}
|
|
49807
49807
|
class Sl extends rt.Component {
|
|
49808
49808
|
constructor(t) {
|
|
49809
|
-
super(t), this.drawingModalRef = rt.createRef(), this.emojiPickerRef = rt.createRef(), this.cursorModalRef = rt.createRef(), this.brushModalRef = rt.createRef(), this.rulerModalRef = rt.createRef(), this.fibonacciModalRef = rt.createRef(), this.gannModalRef = rt.createRef(), this.projectInfoModalRef = rt.createRef(), this.irregularShapeModalRef = rt.createRef(), this.aiModalRef = rt.createRef(), this.toolManager = new
|
|
49809
|
+
super(t), this.drawingModalRef = rt.createRef(), this.emojiPickerRef = rt.createRef(), this.cursorModalRef = rt.createRef(), this.brushModalRef = rt.createRef(), this.rulerModalRef = rt.createRef(), this.fibonacciModalRef = rt.createRef(), this.gannModalRef = rt.createRef(), this.projectInfoModalRef = rt.createRef(), this.irregularShapeModalRef = rt.createRef(), this.aiModalRef = rt.createRef(), this.toolManager = new Ei(), this.functionPopUpWidth = "200px", this.emojiSelectPopUpWidth = "315px", this.containerRef = rt.createRef(), this.updateContainerHeight = () => {
|
|
49810
49810
|
if (this.containerRef.current) {
|
|
49811
49811
|
const e = this.containerRef.current.clientHeight;
|
|
49812
49812
|
this.setState({ containerHeight: e });
|
|
@@ -50819,7 +50819,7 @@ class Sl extends rt.Component {
|
|
|
50819
50819
|
ai: this.props.ai || !1,
|
|
50820
50820
|
// ai config list
|
|
50821
50821
|
aiconfigs: this.props.aiconfigs || []
|
|
50822
|
-
}, this.toolManager = new
|
|
50822
|
+
}, this.toolManager = new Ei();
|
|
50823
50823
|
}
|
|
50824
50824
|
componentDidMount() {
|
|
50825
50825
|
document.addEventListener("mousedown", (t) => this.handleClickOutside(t), !0), this.updateContainerHeight(), window.addEventListener("resize", this.updateContainerHeight);
|
|
@@ -53423,7 +53423,7 @@ class yl extends rt.Component {
|
|
|
53423
53423
|
if (t.data !== this.props.data) {
|
|
53424
53424
|
this.isIncrementalDataUpdate(t.data, this.props.data) && this.chart && this.currentSeries && this.props.data ? (this.originalData = this.props.data, this.refreshInternalData(() => {
|
|
53425
53425
|
this.refreshChart();
|
|
53426
|
-
})) : (this.setState({
|
|
53426
|
+
})) : (this.clearStaticMarks(), this.setState({
|
|
53427
53427
|
isDataLoading: !0,
|
|
53428
53428
|
dataLoadProgress: 0
|
|
53429
53429
|
}), this.loadDataAsync(() => {
|
|
@@ -53453,39 +53453,31 @@ class yl extends rt.Component {
|
|
|
53453
53453
|
this.updateTimeout && clearTimeout(this.updateTimeout), this.resizeObserver && this.chartContainerRef.current && (this.resizeObserver.unobserve(this.chartContainerRef.current), this.resizeObserver.disconnect()), this.chart && this.chart.remove(), this.realTimeInterval && clearInterval(this.realTimeInterval), document.removeEventListener("mousedown", this.handleClickOutside, !0), document.removeEventListener("mousemove", this.handleMouseMove), document.removeEventListener("mouseup", this.handleMouseUp), document.removeEventListener("mousemove", this.handleTerminalMouseMove), document.removeEventListener("mouseup", this.handleTerminalMouseUp);
|
|
53454
53454
|
}
|
|
53455
53455
|
// ======================================== life cycle end ========================================
|
|
53456
|
+
// clear static marks
|
|
53457
|
+
clearStaticMarks() {
|
|
53458
|
+
this.chartLayerRef && this.chartLayerRef.current && this.chartLayerRef.current.staticMarkManager && this.chartLayerRef.current.staticMarkManager.clearAllMarks && this.chartLayerRef.current.staticMarkManager.clearAllMarks();
|
|
53459
|
+
}
|
|
53456
53460
|
// Incremental data checking function
|
|
53457
53461
|
isIncrementalDataUpdate(t, e) {
|
|
53458
53462
|
if (!t || !e || t.length === 0 || e.length === 0)
|
|
53459
53463
|
return !1;
|
|
53460
|
-
if (e.length > t.length
|
|
53461
|
-
const
|
|
53462
|
-
|
|
53463
|
-
|
|
53464
|
-
|
|
53465
|
-
|
|
53466
|
-
let s = -1;
|
|
53467
|
-
for (let n = 0; n < t.length; n++) {
|
|
53468
|
-
const o = typeof t[n].time == "string" ? new Date(t[n].time).getTime() : t[n].time, h = typeof e[n].time == "string" ? new Date(e[n].time).getTime() : e[n].time;
|
|
53469
|
-
if (o !== h) {
|
|
53470
|
-
s = n;
|
|
53471
|
-
break;
|
|
53472
|
-
}
|
|
53464
|
+
if (e.length > t.length) {
|
|
53465
|
+
const i = Math.min(t.length, 10);
|
|
53466
|
+
for (let r = 0; r < i; r++) {
|
|
53467
|
+
const a = typeof t[r].time == "string" ? new Date(t[r].time).getTime() : t[r].time, s = typeof e[r].time == "string" ? new Date(e[r].time).getTime() : e[r].time;
|
|
53468
|
+
if (a !== s)
|
|
53469
|
+
return !1;
|
|
53473
53470
|
}
|
|
53474
|
-
|
|
53475
|
-
|
|
53476
|
-
|
|
53477
|
-
|
|
53478
|
-
if (
|
|
53471
|
+
return !0;
|
|
53472
|
+
}
|
|
53473
|
+
if (t.length === e.length) {
|
|
53474
|
+
const i = t[t.length - 1], r = e[e.length - 1], a = typeof i.time == "string" ? new Date(i.time).getTime() : i.time, s = typeof r.time == "string" ? new Date(r.time).getTime() : r.time;
|
|
53475
|
+
if (a === s)
|
|
53479
53476
|
return !0;
|
|
53477
|
+
const n = t[0], o = e[0], h = typeof n.time == "string" ? new Date(n.time).getTime() : n.time, l = typeof o.time == "string" ? new Date(o.time).getTime() : o.time;
|
|
53478
|
+
return h === l;
|
|
53480
53479
|
}
|
|
53481
|
-
|
|
53482
|
-
return t.forEach((s) => {
|
|
53483
|
-
const n = typeof s.time == "string" ? new Date(s.time).getTime() : s.time;
|
|
53484
|
-
i.add(n);
|
|
53485
|
-
}), e.filter((s) => {
|
|
53486
|
-
const n = typeof s.time == "string" ? new Date(s.time).getTime() : s.time;
|
|
53487
|
-
return i.has(n);
|
|
53488
|
-
}).length / Math.max(t.length, e.length) >= 0.8;
|
|
53480
|
+
return !1;
|
|
53489
53481
|
}
|
|
53490
53482
|
// clear original data
|
|
53491
53483
|
clearOriginalData() {
|