@363045841yyt/klinechart 0.2.9 → 0.2.11
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/README.md +3 -5
- package/dist/core/chart.d.ts +0 -2
- package/dist/core/controller/interaction.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +308 -392
- package/dist/klinechart.css +1 -1
- package/package.json +1 -1
- package/dist/core/renderers/globalBorders.d.ts +0 -13
package/dist/index.js
CHANGED
|
@@ -57,8 +57,8 @@ function ne(e, t) {
|
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/utils.js
|
|
60
|
-
var { toString:
|
|
61
|
-
let n =
|
|
60
|
+
var { toString: re } = Object.prototype, { getPrototypeOf: ie } = Object, { iterator: ae, toStringTag: I } = Symbol, oe = ((e) => (t) => {
|
|
61
|
+
let n = re.call(t);
|
|
62
62
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
63
63
|
})(Object.create(null)), L = (e) => (e = e.toLowerCase(), (t) => oe(t) === e), se = (e) => (t) => typeof t === e, { isArray: ce } = Array, le = se("undefined");
|
|
64
64
|
function ue(e) {
|
|
@@ -71,8 +71,8 @@ function de(e) {
|
|
|
71
71
|
}
|
|
72
72
|
var z = se("string"), B = se("function"), fe = se("number"), pe = (e) => typeof e == "object" && !!e, me = (e) => e === !0 || e === !1, he = (e) => {
|
|
73
73
|
if (oe(e) !== "object") return !1;
|
|
74
|
-
let t =
|
|
75
|
-
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(
|
|
74
|
+
let t = ie(e);
|
|
75
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(I in e) && !(ae in e);
|
|
76
76
|
}, ge = (e) => {
|
|
77
77
|
if (!pe(e) || ue(e)) return !1;
|
|
78
78
|
try {
|
|
@@ -144,7 +144,7 @@ var ze = (e, t, n, { allOwnKeys: r } = {}) => (Pe(t, (t, r) => {
|
|
|
144
144
|
if (t ||= {}, e == null) return t;
|
|
145
145
|
do {
|
|
146
146
|
for (i = Object.getOwnPropertyNames(e), a = i.length; a-- > 0;) o = i[a], (!r || r(o, e, t)) && !s[o] && (t[o] = e[o], s[o] = !0);
|
|
147
|
-
e = n !== !1 &&
|
|
147
|
+
e = n !== !1 && ie(e);
|
|
148
148
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
149
149
|
return t;
|
|
150
150
|
}, Ue = (e, t, n) => {
|
|
@@ -159,8 +159,8 @@ var ze = (e, t, n, { allOwnKeys: r } = {}) => (Pe(t, (t, r) => {
|
|
|
159
159
|
let n = Array(t);
|
|
160
160
|
for (; t-- > 0;) n[t] = e[t];
|
|
161
161
|
return n;
|
|
162
|
-
}, Ge = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" &&
|
|
163
|
-
let n = (e && e[
|
|
162
|
+
}, Ge = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ie(Uint8Array)), Ke = (e, t) => {
|
|
163
|
+
let n = (e && e[ae]).call(e), r;
|
|
164
164
|
for (; (r = n.next()) && !r.done;) {
|
|
165
165
|
let n = r.value;
|
|
166
166
|
t.call(e, n[0], n[1]);
|
|
@@ -204,7 +204,7 @@ var ze = (e, t, n, { allOwnKeys: r } = {}) => (Pe(t, (t, r) => {
|
|
|
204
204
|
return ce(e) ? r(e) : r(String(e).split(t)), n;
|
|
205
205
|
}, tt = () => {}, nt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
206
206
|
function rt(e) {
|
|
207
|
-
return !!(e && B(e.append) && e[
|
|
207
|
+
return !!(e && B(e.append) && e[I] === "FormData" && e[ae]);
|
|
208
208
|
}
|
|
209
209
|
var it = (e) => {
|
|
210
210
|
let t = Array(10), n = (e, r) => {
|
|
@@ -286,7 +286,7 @@ var it = (e) => {
|
|
|
286
286
|
isThenable: ot,
|
|
287
287
|
setImmediate: st,
|
|
288
288
|
asap: typeof queueMicrotask < "u" ? queueMicrotask.bind(Ie) : typeof process < "u" && process.nextTick || st,
|
|
289
|
-
isIterable: (e) => e != null && B(e[
|
|
289
|
+
isIterable: (e) => e != null && B(e[ae])
|
|
290
290
|
}, H = class e extends Error {
|
|
291
291
|
static from(t, n, r, i, a, o) {
|
|
292
292
|
let s = new e(t.message, n || t.code, r, i, a);
|
|
@@ -3540,12 +3540,12 @@ var lr = /* @__PURE__ */ M(((e) => {
|
|
|
3540
3540
|
return;
|
|
3541
3541
|
}
|
|
3542
3542
|
t.forEach((t) => {
|
|
3543
|
-
|
|
3544
|
-
}),
|
|
3543
|
+
ie(e.dataTypes, t) || I(e, `type "${t}" not allowed by context "${e.dataTypes.join(",")}"`);
|
|
3544
|
+
}), ae(e, t);
|
|
3545
3545
|
}
|
|
3546
3546
|
}
|
|
3547
3547
|
function F(e, t) {
|
|
3548
|
-
t.length > 1 && !(t.length === 2 && t.includes("null")) &&
|
|
3548
|
+
t.length > 1 && !(t.length === 2 && t.includes("null")) && I(e, "use allowUnionTypes to allow union type keyword");
|
|
3549
3549
|
}
|
|
3550
3550
|
function ne(e, t) {
|
|
3551
3551
|
let n = e.self.RULES.all;
|
|
@@ -3553,22 +3553,22 @@ var lr = /* @__PURE__ */ M(((e) => {
|
|
|
3553
3553
|
let a = n[i];
|
|
3554
3554
|
if (typeof a == "object" && (0, r.shouldUseRule)(e.schema, a)) {
|
|
3555
3555
|
let { type: n } = a.definition;
|
|
3556
|
-
n.length && !n.some((e) =>
|
|
3556
|
+
n.length && !n.some((e) => re(t, e)) && I(e, `missing type "${n.join(",")}" for keyword "${i}"`);
|
|
3557
3557
|
}
|
|
3558
3558
|
}
|
|
3559
3559
|
}
|
|
3560
|
-
function
|
|
3560
|
+
function re(e, t) {
|
|
3561
3561
|
return e.includes(t) || t === "number" && e.includes("integer");
|
|
3562
3562
|
}
|
|
3563
|
-
function
|
|
3563
|
+
function ie(e, t) {
|
|
3564
3564
|
return e.includes(t) || t === "integer" && e.includes("number");
|
|
3565
3565
|
}
|
|
3566
|
-
function
|
|
3566
|
+
function ae(e, t) {
|
|
3567
3567
|
let n = [];
|
|
3568
|
-
for (let r of e.dataTypes)
|
|
3568
|
+
for (let r of e.dataTypes) ie(t, r) ? n.push(r) : t.includes("integer") && r === "number" && n.push("integer");
|
|
3569
3569
|
e.dataTypes = n;
|
|
3570
3570
|
}
|
|
3571
|
-
function
|
|
3571
|
+
function I(e, t) {
|
|
3572
3572
|
let n = e.schemaEnv.baseId + e.errSchemaPath;
|
|
3573
3573
|
t += ` at "${n}" (strictTypes)`, (0, d.checkStrictMode)(e, t, e.opts.strictTypes);
|
|
3574
3574
|
}
|
|
@@ -7713,19 +7713,22 @@ var Qa = { class: "kline-tooltip__title" }, $a = { key: 0 }, eo = { class: "klin
|
|
|
7713
7713
|
}, Wo = {
|
|
7714
7714
|
key: 0,
|
|
7715
7715
|
class: "hover-overlay"
|
|
7716
|
-
}, Go = ["onClick"], Ko =
|
|
7716
|
+
}, Go = ["onClick"], Ko = {
|
|
7717
|
+
key: 1,
|
|
7718
|
+
class: "divider"
|
|
7719
|
+
}, qo = ["onClick"], Jo = { class: "indicator-item" }, Yo = { class: "menu-section" }, Xo = { class: "menu-items" }, Zo = ["disabled", "onClick"], Qo = {
|
|
7717
7720
|
key: 0,
|
|
7718
7721
|
class: "param-hint"
|
|
7719
|
-
},
|
|
7722
|
+
}, $o = {
|
|
7720
7723
|
key: 1,
|
|
7721
7724
|
class: "active-tag"
|
|
7722
|
-
},
|
|
7725
|
+
}, es = { class: "menu-section" }, ts = { class: "menu-items" }, ns = ["disabled", "onClick"], rs = {
|
|
7723
7726
|
key: 0,
|
|
7724
7727
|
class: "param-hint"
|
|
7725
|
-
},
|
|
7728
|
+
}, is = {
|
|
7726
7729
|
key: 1,
|
|
7727
7730
|
class: "active-tag"
|
|
7728
|
-
},
|
|
7731
|
+
}, as = /* @__PURE__ */ po(/* @__PURE__ */ u({
|
|
7729
7732
|
__name: "IndicatorSelector",
|
|
7730
7733
|
props: {
|
|
7731
7734
|
activeIndicators: {},
|
|
@@ -8009,13 +8012,13 @@ var Qa = { class: "kline-tooltip__title" }, $a = { key: 0 }, eo = { class: "klin
|
|
|
8009
8012
|
let t = y.find((t) => t.id === e);
|
|
8010
8013
|
t && (t.pane === "main" && y.filter((t) => t.pane === "main" && t.id !== e && F(t.id)).forEach((e) => D("toggle", e.id, !1)), D("toggle", e, !0), N.value = !1);
|
|
8011
8014
|
}
|
|
8012
|
-
function
|
|
8015
|
+
function re(e) {
|
|
8013
8016
|
D("toggle", e, !1);
|
|
8014
8017
|
}
|
|
8015
|
-
function
|
|
8018
|
+
function ie(e) {
|
|
8016
8019
|
j.value = e, A.value = !0;
|
|
8017
8020
|
}
|
|
8018
|
-
function
|
|
8021
|
+
function ae(e) {
|
|
8019
8022
|
let t = y.find((t) => t.id === e);
|
|
8020
8023
|
if (!t?.params) return {};
|
|
8021
8024
|
let n = {};
|
|
@@ -8025,8 +8028,8 @@ var Qa = { class: "kline-tooltip__title" }, $a = { key: 0 }, eo = { class: "klin
|
|
|
8025
8028
|
...E.indicatorParams?.[e] || {}
|
|
8026
8029
|
};
|
|
8027
8030
|
}
|
|
8028
|
-
function
|
|
8029
|
-
let t =
|
|
8031
|
+
function I(e) {
|
|
8032
|
+
let t = ae(e.id);
|
|
8030
8033
|
return e.params ? e.params.map((e) => t[e.key] ?? "").join(",") : "";
|
|
8031
8034
|
}
|
|
8032
8035
|
function oe(e) {
|
|
@@ -8064,38 +8067,39 @@ var Qa = { class: "kline-tooltip__title" }, $a = { key: 0 }, eo = { class: "klin
|
|
|
8064
8067
|
}, [s("button", { class: f(["indicator-btn", {
|
|
8065
8068
|
active: !0,
|
|
8066
8069
|
hovering: M.value === e.id
|
|
8067
|
-
}]) }, [s("span", Ho, [c(b(e.label) + " ", 1), e.params ? (g(), o("span", Uo, " (" + b(
|
|
8070
|
+
}]) }, [s("span", Ho, [c(b(e.label) + " ", 1), e.params ? (g(), o("span", Uo, " (" + b(I(e)) + ") ", 1)) : a("", !0)]), l(n, { name: "fade" }, {
|
|
8068
8071
|
default: C(() => [M.value === e.id ? (g(), o("div", Wo, [
|
|
8069
|
-
|
|
8072
|
+
e.params ? (g(), o("button", {
|
|
8073
|
+
key: 0,
|
|
8070
8074
|
class: "action-btn settings-btn",
|
|
8071
|
-
onClick: w((t) =>
|
|
8075
|
+
onClick: w((t) => ie(e.id), ["stop"]),
|
|
8072
8076
|
title: "编辑参数"
|
|
8073
8077
|
}, [...u[2] ||= [s("svg", {
|
|
8074
8078
|
viewBox: "0 0 24 24",
|
|
8075
8079
|
width: "14",
|
|
8076
8080
|
height: "14",
|
|
8077
8081
|
fill: "currentColor"
|
|
8078
|
-
}, [s("path", { d: "M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z" })], -1)]], 8, Go),
|
|
8079
|
-
|
|
8082
|
+
}, [s("path", { d: "M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z" })], -1)]], 8, Go)) : a("", !0),
|
|
8083
|
+
e.params ? (g(), o("span", Ko)) : a("", !0),
|
|
8080
8084
|
s("button", {
|
|
8081
8085
|
class: "action-btn remove-btn",
|
|
8082
|
-
onClick: w((t) =>
|
|
8086
|
+
onClick: w((t) => re(e.id), ["stop"]),
|
|
8083
8087
|
title: "移除指标"
|
|
8084
8088
|
}, [...u[3] ||= [s("svg", {
|
|
8085
8089
|
viewBox: "0 0 24 24",
|
|
8086
8090
|
width: "14",
|
|
8087
8091
|
height: "14",
|
|
8088
8092
|
fill: "currentColor"
|
|
8089
|
-
}, [s("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" })], -1)]], 8,
|
|
8093
|
+
}, [s("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" })], -1)]], 8, qo)
|
|
8090
8094
|
])) : a("", !0)]),
|
|
8091
8095
|
_: 2
|
|
8092
|
-
}, 1024)], 2)], 40, Vo)]))), 128)), s("div",
|
|
8096
|
+
}, 1024)], 2)], 40, Vo)]))), 128)), s("div", Jo, [s("button", {
|
|
8093
8097
|
ref_key: "addBtnRef",
|
|
8094
8098
|
ref: O,
|
|
8095
8099
|
class: "add-btn",
|
|
8096
8100
|
onClick: L,
|
|
8097
8101
|
title: "添加指标"
|
|
8098
|
-
}, [...u[
|
|
8102
|
+
}, [...u[4] ||= [s("svg", {
|
|
8099
8103
|
viewBox: "0 0 24 24",
|
|
8100
8104
|
width: "16",
|
|
8101
8105
|
height: "16",
|
|
@@ -8108,35 +8112,35 @@ var Qa = { class: "kline-tooltip__title" }, $a = { key: 0 }, eo = { class: "klin
|
|
|
8108
8112
|
ref_key: "addMenuRef",
|
|
8109
8113
|
ref: k,
|
|
8110
8114
|
style: p(ee.value)
|
|
8111
|
-
}, [s("div",
|
|
8115
|
+
}, [s("div", Yo, [u[6] ||= s("div", { class: "menu-title" }, "主图指标", -1), s("div", Xo, [(g(!0), o(e, null, v(x(S), (e) => (g(), o("button", {
|
|
8112
8116
|
key: e.id,
|
|
8113
8117
|
class: f(["menu-item", { disabled: F(e.id) }]),
|
|
8114
8118
|
disabled: F(e.id),
|
|
8115
8119
|
onClick: (t) => ne(e.id)
|
|
8116
8120
|
}, [
|
|
8117
8121
|
c(b(e.label) + " ", 1),
|
|
8118
|
-
e.params ? (g(), o("span",
|
|
8119
|
-
F(e.id) ? (g(), o("span",
|
|
8122
|
+
e.params ? (g(), o("span", Qo, " (" + b(e.name) + ") ", 1)) : a("", !0),
|
|
8123
|
+
F(e.id) ? (g(), o("span", $o, [...u[5] ||= [s("svg", {
|
|
8120
8124
|
viewBox: "0 0 24 24",
|
|
8121
8125
|
width: "14",
|
|
8122
8126
|
height: "14",
|
|
8123
8127
|
fill: "currentColor"
|
|
8124
8128
|
}, [s("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" })], -1)]])) : a("", !0)
|
|
8125
|
-
], 10,
|
|
8129
|
+
], 10, Zo))), 128))])]), s("div", es, [u[8] ||= s("div", { class: "menu-title" }, "副图指标", -1), s("div", ts, [(g(!0), o(e, null, v(x(T), (e) => (g(), o("button", {
|
|
8126
8130
|
key: e.id,
|
|
8127
8131
|
class: f(["menu-item", { disabled: F(e.id) }]),
|
|
8128
8132
|
disabled: F(e.id),
|
|
8129
8133
|
onClick: (t) => ne(e.id)
|
|
8130
8134
|
}, [
|
|
8131
8135
|
c(b(e.label) + " ", 1),
|
|
8132
|
-
e.params ? (g(), o("span",
|
|
8133
|
-
F(e.id) ? (g(), o("span",
|
|
8136
|
+
e.params ? (g(), o("span", rs, " (" + b(e.name) + ") ", 1)) : a("", !0),
|
|
8137
|
+
F(e.id) ? (g(), o("span", is, [...u[7] ||= [s("svg", {
|
|
8134
8138
|
viewBox: "0 0 24 24",
|
|
8135
8139
|
width: "14",
|
|
8136
8140
|
height: "14",
|
|
8137
8141
|
fill: "currentColor"
|
|
8138
8142
|
}, [s("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" })], -1)]])) : a("", !0)
|
|
8139
|
-
], 10,
|
|
8143
|
+
], 10, ns))), 128))])])], 4)) : a("", !0)]),
|
|
8140
8144
|
_: 1
|
|
8141
8145
|
})])),
|
|
8142
8146
|
P.value ? (g(), i(Lo, {
|
|
@@ -8146,7 +8150,7 @@ var Qa = { class: "kline-tooltip__title" }, $a = { key: 0 }, eo = { class: "klin
|
|
|
8146
8150
|
"indicator-name": P.value.name,
|
|
8147
8151
|
"indicator-description": P.value.description,
|
|
8148
8152
|
params: P.value.params || [],
|
|
8149
|
-
values:
|
|
8153
|
+
values: ae(P.value.id),
|
|
8150
8154
|
onClose: u[1] ||= (e) => A.value = !1,
|
|
8151
8155
|
onConfirm: oe
|
|
8152
8156
|
}, null, 8, [
|
|
@@ -8159,15 +8163,15 @@ var Qa = { class: "kline-tooltip__title" }, $a = { key: 0 }, eo = { class: "klin
|
|
|
8159
8163
|
])) : a("", !0)
|
|
8160
8164
|
]));
|
|
8161
8165
|
}
|
|
8162
|
-
}), [["__scopeId", "data-v-
|
|
8166
|
+
}), [["__scopeId", "data-v-ef3141f5"]]);
|
|
8163
8167
|
//#endregion
|
|
8164
8168
|
//#region src/core/utils/klineConfig.ts
|
|
8165
|
-
function
|
|
8169
|
+
function os(e, t) {
|
|
8166
8170
|
let n = Math.round(e * t);
|
|
8167
8171
|
return n % 2 == 0 && (n += 1), Math.max(1, n);
|
|
8168
8172
|
}
|
|
8169
|
-
function
|
|
8170
|
-
let r =
|
|
8173
|
+
function ss(e, t, n) {
|
|
8174
|
+
let r = os(e, n), i = Math.round(t * n), a = r + i, o = i;
|
|
8171
8175
|
return {
|
|
8172
8176
|
kWidthPx: r,
|
|
8173
8177
|
kGapPx: i,
|
|
@@ -8181,14 +8185,14 @@ function os(e, t, n) {
|
|
|
8181
8185
|
}
|
|
8182
8186
|
//#endregion
|
|
8183
8187
|
//#region src/core/viewport/viewport.ts
|
|
8184
|
-
function
|
|
8185
|
-
let { unitPx: o, startXPx: s } =
|
|
8188
|
+
function cs(e, t, n, r, i, a = 1) {
|
|
8189
|
+
let { unitPx: o, startXPx: s } = ss(n, r, a), c = e * a, l = t * a;
|
|
8186
8190
|
return {
|
|
8187
8191
|
start: Math.max(0, Math.floor((c - s) / o) - 1),
|
|
8188
8192
|
end: Math.min(i, Math.ceil((c + l - s) / o) + 1)
|
|
8189
8193
|
};
|
|
8190
8194
|
}
|
|
8191
|
-
function
|
|
8195
|
+
function ls(e, t, n) {
|
|
8192
8196
|
let r = -Infinity, i = Infinity;
|
|
8193
8197
|
for (let a = t; a < n && a < e.length; a++) {
|
|
8194
8198
|
let t = e[a];
|
|
@@ -8204,7 +8208,7 @@ function cs(e, t, n) {
|
|
|
8204
8208
|
}
|
|
8205
8209
|
//#endregion
|
|
8206
8210
|
//#region src/core/scale/priceScale.ts
|
|
8207
|
-
var
|
|
8211
|
+
var us = class {
|
|
8208
8212
|
range = {
|
|
8209
8213
|
maxPrice: 100,
|
|
8210
8214
|
minPrice: 0
|
|
@@ -8238,7 +8242,7 @@ var ls = class {
|
|
|
8238
8242
|
let { maxPrice: t, minPrice: n } = this.range, r = t - n || 1, i = Math.max(1, this.height - this.paddingTop - this.paddingBottom);
|
|
8239
8243
|
return n + (1 - (e - this.paddingTop) / i) * r;
|
|
8240
8244
|
}
|
|
8241
|
-
},
|
|
8245
|
+
}, ds = class {
|
|
8242
8246
|
id;
|
|
8243
8247
|
top = 0;
|
|
8244
8248
|
height = 0;
|
|
@@ -8246,7 +8250,7 @@ var ls = class {
|
|
|
8246
8250
|
maxPrice: 100,
|
|
8247
8251
|
minPrice: 0
|
|
8248
8252
|
};
|
|
8249
|
-
yAxis = new
|
|
8253
|
+
yAxis = new us();
|
|
8250
8254
|
renderers = [];
|
|
8251
8255
|
constructor(e) {
|
|
8252
8256
|
this.id = e;
|
|
@@ -8261,9 +8265,9 @@ var ls = class {
|
|
|
8261
8265
|
this.renderers.push(e);
|
|
8262
8266
|
}
|
|
8263
8267
|
updateRange(e, t) {
|
|
8264
|
-
this.priceRange =
|
|
8268
|
+
this.priceRange = ls(e, t.start, t.end), this.yAxis.setRange(this.priceRange);
|
|
8265
8269
|
}
|
|
8266
|
-
},
|
|
8270
|
+
}, fs = class {
|
|
8267
8271
|
chart;
|
|
8268
8272
|
isDragging = !1;
|
|
8269
8273
|
dragStartX = 0;
|
|
@@ -8348,7 +8352,8 @@ var ls = class {
|
|
|
8348
8352
|
this.kLinePositions = null, this.visibleRange = null, this.clearHover(), this.chart.scheduleDraw();
|
|
8349
8353
|
}
|
|
8350
8354
|
onPointerMove(e) {
|
|
8351
|
-
if (!
|
|
8355
|
+
if (!e.isPrimary) return;
|
|
8356
|
+
e.pointerType === "touch" && (this.isTouchSession = !0);
|
|
8352
8357
|
let t = this.chart.getDom().container;
|
|
8353
8358
|
if (this.isDragging) {
|
|
8354
8359
|
let n = this.dragStartX - e.clientX;
|
|
@@ -8434,7 +8439,7 @@ var ls = class {
|
|
|
8434
8439
|
return;
|
|
8435
8440
|
}
|
|
8436
8441
|
this.hoveredIndex = this.crosshairIndex;
|
|
8437
|
-
let
|
|
8442
|
+
let re = this.tooltipSize.width, ie = this.tooltipSize.height, ae = i + 14, I = i - 14 - re, oe = ae + re + 12 <= s ? ae : I, L = a + 14, se = Math.max(12, s - re - 12), ce = Math.max(12, c - ie - 12);
|
|
8438
8443
|
this.tooltipPos = {
|
|
8439
8444
|
x: Math.min(Math.max(oe, 12), se),
|
|
8440
8445
|
y: Math.min(Math.max(L, 12), ce)
|
|
@@ -8443,7 +8448,7 @@ var ls = class {
|
|
|
8443
8448
|
reset() {
|
|
8444
8449
|
this.isDragging = !1, this.dragStartX = 0, this.scrollStartX = 0, this.isTouchSession = !1, this.crosshairPos = null, this.crosshairIndex = null, this.hoveredIndex = null, this.activePaneId = null, this.hoveredMarkerId = null, this.clickedMarkerId = null, this.hoveredMarkerData = null, this.clickedMarkerData = null, this.kLinePositions = null, this.visibleRange = null, this.kWidthPx = null;
|
|
8445
8450
|
}
|
|
8446
|
-
},
|
|
8451
|
+
}, ps = class {
|
|
8447
8452
|
dom;
|
|
8448
8453
|
pane;
|
|
8449
8454
|
opt;
|
|
@@ -8469,7 +8474,7 @@ var ls = class {
|
|
|
8469
8474
|
};
|
|
8470
8475
|
//#endregion
|
|
8471
8476
|
//#region src/core/renderers/subVolume.ts
|
|
8472
|
-
function
|
|
8477
|
+
function ms(e = {}) {
|
|
8473
8478
|
let { paneId: t = "sub" } = e;
|
|
8474
8479
|
return {
|
|
8475
8480
|
name: `volume_${t}`,
|
|
@@ -8488,26 +8493,26 @@ function ps(e = {}) {
|
|
|
8488
8493
|
if (!r) continue;
|
|
8489
8494
|
let i = r.volume;
|
|
8490
8495
|
if (!i) continue;
|
|
8491
|
-
let a =
|
|
8492
|
-
d &&
|
|
8496
|
+
let a = gs(r), d = c[e - u];
|
|
8497
|
+
d && hs(t, d, a, i, f, o, s, n.height);
|
|
8493
8498
|
}
|
|
8494
8499
|
t.restore();
|
|
8495
8500
|
}
|
|
8496
8501
|
};
|
|
8497
8502
|
}
|
|
8498
|
-
function
|
|
8499
|
-
let c =
|
|
8503
|
+
function hs(e, t, n, r, i, a, o, s) {
|
|
8504
|
+
let c = _s(r, i, s), l = a;
|
|
8500
8505
|
e.fillStyle = n, e.fillRect(t, c, l, s - c);
|
|
8501
8506
|
}
|
|
8502
|
-
function
|
|
8507
|
+
function gs(e) {
|
|
8503
8508
|
return e.close > e.open ? X.UP : e.close < e.open ? X.DOWN : X.NEUTRAL;
|
|
8504
8509
|
}
|
|
8505
|
-
function
|
|
8510
|
+
function _s(e, t, n) {
|
|
8506
8511
|
return n - n / t * e;
|
|
8507
8512
|
}
|
|
8508
8513
|
//#endregion
|
|
8509
8514
|
//#region src/utils/priceToY.ts
|
|
8510
|
-
function
|
|
8515
|
+
function vs(e, t, n, r, i, a) {
|
|
8511
8516
|
let o = t - n || 1, s = (e - n) / o;
|
|
8512
8517
|
return i + Math.max(1, r - i - a) * (1 - s);
|
|
8513
8518
|
}
|
|
@@ -8519,7 +8524,7 @@ function Z(e, t) {
|
|
|
8519
8524
|
function Q(e, t) {
|
|
8520
8525
|
return (Math.floor(e * t) + .5) / t;
|
|
8521
8526
|
}
|
|
8522
|
-
function
|
|
8527
|
+
function ys(e, t, n, r) {
|
|
8523
8528
|
if (t === n) return null;
|
|
8524
8529
|
let i = Math.min(t, n), a = Math.max(t, n), o = Math.round(e * r), s = Math.round(i * r), c = Math.round(a * r);
|
|
8525
8530
|
return {
|
|
@@ -8529,7 +8534,7 @@ function vs(e, t, n, r) {
|
|
|
8529
8534
|
height: Math.max(1, c - s) / r
|
|
8530
8535
|
};
|
|
8531
8536
|
}
|
|
8532
|
-
function
|
|
8537
|
+
function bs(e, t, n, r) {
|
|
8533
8538
|
if (e === t) return null;
|
|
8534
8539
|
let i = Math.min(e, t), a = Math.max(e, t), o = Math.round(i * r), s = Math.round(a * r), c = Math.round(n * r);
|
|
8535
8540
|
return {
|
|
@@ -8539,7 +8544,7 @@ function ys(e, t, n, r) {
|
|
|
8539
8544
|
height: 1 / r
|
|
8540
8545
|
};
|
|
8541
8546
|
}
|
|
8542
|
-
function
|
|
8547
|
+
function xs(e, t, n, r, i) {
|
|
8543
8548
|
let a = e + n, o = n, s = Math.round(t * i), c = Math.round((t + r) * i), l = Math.max(1, c - s), u = e + (n - 1) / 2, d = u, f = o % 2 == 1;
|
|
8544
8549
|
return {
|
|
8545
8550
|
bodyRect: {
|
|
@@ -8562,7 +8567,7 @@ function bs(e, t, n, r, i) {
|
|
|
8562
8567
|
}
|
|
8563
8568
|
//#endregion
|
|
8564
8569
|
//#region src/core/renderers/Indicator/ma.ts
|
|
8565
|
-
function
|
|
8570
|
+
function Ss(e, t) {
|
|
8566
8571
|
let n = Array(e.length);
|
|
8567
8572
|
if (e.length < t) return n;
|
|
8568
8573
|
let r = 0;
|
|
@@ -8578,7 +8583,7 @@ function xs(e, t) {
|
|
|
8578
8583
|
}
|
|
8579
8584
|
return n;
|
|
8580
8585
|
}
|
|
8581
|
-
function
|
|
8586
|
+
function Cs(e = {}) {
|
|
8582
8587
|
let t = {
|
|
8583
8588
|
ma5: !0,
|
|
8584
8589
|
ma10: !0,
|
|
@@ -8590,7 +8595,7 @@ function Ss(e = {}) {
|
|
|
8590
8595
|
function i(e, t) {
|
|
8591
8596
|
let i = n.get(t);
|
|
8592
8597
|
if (i && r === e) return i.values;
|
|
8593
|
-
let a =
|
|
8598
|
+
let a = Ss(e, t);
|
|
8594
8599
|
return n.set(t, {
|
|
8595
8600
|
period: t,
|
|
8596
8601
|
values: a
|
|
@@ -8606,7 +8611,7 @@ function Ss(e = {}) {
|
|
|
8606
8611
|
for (let n = a.start; n < a.end && n < t.length; n++) {
|
|
8607
8612
|
let r = t[n];
|
|
8608
8613
|
if (r === void 0) continue;
|
|
8609
|
-
let i = l[n - a.start] + o / 2, s =
|
|
8614
|
+
let i = l[n - a.start] + o / 2, s = vs(r, h, g, u, p, m), d = Q(i, c), f = Q(s, c);
|
|
8610
8615
|
_ ? (e.moveTo(d, f), _ = !1) : e.lineTo(d, f);
|
|
8611
8616
|
}
|
|
8612
8617
|
e.stroke();
|
|
@@ -8635,7 +8640,7 @@ function Ss(e = {}) {
|
|
|
8635
8640
|
}
|
|
8636
8641
|
//#endregion
|
|
8637
8642
|
//#region src/utils/kline/ma.ts
|
|
8638
|
-
function
|
|
8643
|
+
function ws(e, t, n) {
|
|
8639
8644
|
if (t < n - 1) return;
|
|
8640
8645
|
let r = 0;
|
|
8641
8646
|
for (let i = 0; i < n; i++) {
|
|
@@ -8647,7 +8652,7 @@ function Cs(e, t, n) {
|
|
|
8647
8652
|
}
|
|
8648
8653
|
//#endregion
|
|
8649
8654
|
//#region src/core/renderers/Indicator/maLegend.ts
|
|
8650
|
-
function
|
|
8655
|
+
function Ts(e) {
|
|
8651
8656
|
let t = {
|
|
8652
8657
|
ma5: !0,
|
|
8653
8658
|
ma10: !0,
|
|
@@ -8672,23 +8677,23 @@ function ws(e) {
|
|
|
8672
8677
|
if (t.ma5 && l.push({
|
|
8673
8678
|
label: "MA5",
|
|
8674
8679
|
color: ja.MA5,
|
|
8675
|
-
value:
|
|
8680
|
+
value: ws(o, c, 5)
|
|
8676
8681
|
}), t.ma10 && l.push({
|
|
8677
8682
|
label: "MA10",
|
|
8678
8683
|
color: ja.MA10,
|
|
8679
|
-
value:
|
|
8684
|
+
value: ws(o, c, 10)
|
|
8680
8685
|
}), t.ma20 && l.push({
|
|
8681
8686
|
label: "MA20",
|
|
8682
8687
|
color: ja.MA20,
|
|
8683
|
-
value:
|
|
8688
|
+
value: ws(o, c, 20)
|
|
8684
8689
|
}), t.ma30 && l.push({
|
|
8685
8690
|
label: "MA30",
|
|
8686
8691
|
color: ja.MA30,
|
|
8687
|
-
value:
|
|
8692
|
+
value: ws(o, c, 30)
|
|
8688
8693
|
}), t.ma60 && l.push({
|
|
8689
8694
|
label: "MA60",
|
|
8690
8695
|
color: ja.MA60,
|
|
8691
|
-
value:
|
|
8696
|
+
value: ws(o, c, 60)
|
|
8692
8697
|
}), l.length > 0) {
|
|
8693
8698
|
let e = 12, t = s;
|
|
8694
8699
|
r.fillStyle = X.NEUTRAL, r.fillText("均线", e, t), e += r.measureText("均线").width + 10;
|
|
@@ -8709,7 +8714,7 @@ function ws(e) {
|
|
|
8709
8714
|
}
|
|
8710
8715
|
//#endregion
|
|
8711
8716
|
//#region src/core/renderers/Indicator/boll.ts
|
|
8712
|
-
function
|
|
8717
|
+
function Es(e, t, n) {
|
|
8713
8718
|
let r = Array(e.length);
|
|
8714
8719
|
if (e.length < t) return r;
|
|
8715
8720
|
let i = 0, a = [];
|
|
@@ -8742,7 +8747,7 @@ function Ts(e, t, n) {
|
|
|
8742
8747
|
}
|
|
8743
8748
|
return r;
|
|
8744
8749
|
}
|
|
8745
|
-
function
|
|
8750
|
+
function Ds(e = {}) {
|
|
8746
8751
|
let t = {
|
|
8747
8752
|
period: 20,
|
|
8748
8753
|
multiplier: 2,
|
|
@@ -8753,7 +8758,7 @@ function Es(e = {}) {
|
|
|
8753
8758
|
...e
|
|
8754
8759
|
}, n = null, r = 0, i = 0, a = [];
|
|
8755
8760
|
function o(e) {
|
|
8756
|
-
return (n !== e || r !== t.period || i !== t.multiplier) && (a =
|
|
8761
|
+
return (n !== e || r !== t.period || i !== t.multiplier) && (a = Es(e, t.period, t.multiplier), n = e, r = t.period, i = t.multiplier), a;
|
|
8757
8762
|
}
|
|
8758
8763
|
return {
|
|
8759
8764
|
name: "boll",
|
|
@@ -8783,13 +8788,13 @@ function Es(e = {}) {
|
|
|
8783
8788
|
for (let t = C; t < w; t++) {
|
|
8784
8789
|
let r = p[t];
|
|
8785
8790
|
if (!r) continue;
|
|
8786
|
-
let i = d[t - a.start] + m.kWidth / 2, o =
|
|
8791
|
+
let i = d[t - a.start] + m.kWidth / 2, o = vs(r.upper, x, S, g, y, b), s = Q(i, u), c = Q(o, u);
|
|
8787
8792
|
e ? (n.moveTo(s, c), e = !1) : n.lineTo(s, c);
|
|
8788
8793
|
}
|
|
8789
8794
|
for (let e = w - 1; e >= C; e--) {
|
|
8790
8795
|
let t = p[e];
|
|
8791
8796
|
if (!t) continue;
|
|
8792
|
-
let r = d[e - a.start] + m.kWidth / 2, i =
|
|
8797
|
+
let r = d[e - a.start] + m.kWidth / 2, i = vs(t.lower, x, S, g, y, b), o = Q(r, u), s = Q(i, u);
|
|
8793
8798
|
n.lineTo(o, s);
|
|
8794
8799
|
}
|
|
8795
8800
|
n.closePath(), n.fill();
|
|
@@ -8801,7 +8806,7 @@ function Es(e = {}) {
|
|
|
8801
8806
|
for (let t = C; t < w; t++) {
|
|
8802
8807
|
let i = p[t];
|
|
8803
8808
|
if (!i) continue;
|
|
8804
|
-
let o = d[t - a.start] + m.kWidth / 2, s =
|
|
8809
|
+
let o = d[t - a.start] + m.kWidth / 2, s = vs(i[e], x, S, g, y, b), c = Q(o, u), l = Q(s, u);
|
|
8805
8810
|
r ? (n.moveTo(c, l), r = !1) : n.lineTo(c, l);
|
|
8806
8811
|
}
|
|
8807
8812
|
n.stroke();
|
|
@@ -8819,7 +8824,7 @@ function Es(e = {}) {
|
|
|
8819
8824
|
}
|
|
8820
8825
|
};
|
|
8821
8826
|
}
|
|
8822
|
-
function
|
|
8827
|
+
function Os(e, t, n = 20, r = 2) {
|
|
8823
8828
|
if (t < n - 1 || t >= e.length) return null;
|
|
8824
8829
|
let i = 0;
|
|
8825
8830
|
for (let r = 0; r < n; r++) {
|
|
@@ -8842,7 +8847,7 @@ function Ds(e, t, n = 20, r = 2) {
|
|
|
8842
8847
|
}
|
|
8843
8848
|
//#endregion
|
|
8844
8849
|
//#region src/core/renderers/Indicator/bollLegend.ts
|
|
8845
|
-
function
|
|
8850
|
+
function ks(e) {
|
|
8846
8851
|
let t = {
|
|
8847
8852
|
period: 20,
|
|
8848
8853
|
multiplier: 2,
|
|
@@ -8862,7 +8867,7 @@ function Os(e) {
|
|
|
8862
8867
|
if (!o.length) return;
|
|
8863
8868
|
let s = (12 + e.yPaddingPx) / 2;
|
|
8864
8869
|
r.save(), r.font = "12px Arial", r.textAlign = "left";
|
|
8865
|
-
let c =
|
|
8870
|
+
let c = Os(o, Math.min(a.end - 1, o.length - 1), t.period, t.multiplier), l = 12;
|
|
8866
8871
|
r.fillStyle = X.NEUTRAL, r.fillText(`BOLL(${t.period},${t.multiplier})`, l, s), l += r.measureText(`BOLL(${t.period},${t.multiplier})`).width + 10, c && (r.fillStyle = Ma.UPPER, r.fillText(`上轨:${c.upper.toFixed(2)}`, l, s), l += r.measureText(`上轨:${c.upper.toFixed(2)}`).width + 10, r.fillStyle = Ma.MIDDLE, r.fillText(`中轨:${c.middle.toFixed(2)}`, l, s), l += r.measureText(`中轨:${c.middle.toFixed(2)}`).width + 10, r.fillStyle = Ma.LOWER, r.fillText(`下轨:${c.lower.toFixed(2)}`, l, s)), r.restore();
|
|
8867
8872
|
},
|
|
8868
8873
|
getConfig() {
|
|
@@ -8875,7 +8880,7 @@ function Os(e) {
|
|
|
8875
8880
|
}
|
|
8876
8881
|
//#endregion
|
|
8877
8882
|
//#region src/core/renderers/Indicator/macd.ts
|
|
8878
|
-
function
|
|
8883
|
+
function As(e, t) {
|
|
8879
8884
|
let n = Array(e.length), r = 2 / (t + 1);
|
|
8880
8885
|
if (e.length === 0) return n;
|
|
8881
8886
|
n[0] = e[0].close;
|
|
@@ -8885,7 +8890,7 @@ function ks(e, t) {
|
|
|
8885
8890
|
}
|
|
8886
8891
|
return n;
|
|
8887
8892
|
}
|
|
8888
|
-
function
|
|
8893
|
+
function js(e, t) {
|
|
8889
8894
|
let n = Array(e.length), r = 2 / (t + 1), i = e.findIndex((e) => e !== void 0);
|
|
8890
8895
|
if (i === -1) return n;
|
|
8891
8896
|
n[i] = e[i];
|
|
@@ -8895,15 +8900,15 @@ function As(e, t) {
|
|
|
8895
8900
|
}
|
|
8896
8901
|
return n;
|
|
8897
8902
|
}
|
|
8898
|
-
function
|
|
8903
|
+
function Ms(e, t, n, r) {
|
|
8899
8904
|
let i = Array(e.length);
|
|
8900
8905
|
if (e.length < n) return i;
|
|
8901
|
-
let a =
|
|
8906
|
+
let a = As(e, t), o = As(e, n), s = Array(e.length);
|
|
8902
8907
|
for (let t = 0; t < e.length; t++) {
|
|
8903
8908
|
let e = a[t], n = o[t];
|
|
8904
8909
|
e !== void 0 && n !== void 0 && (s[t] = e - n);
|
|
8905
8910
|
}
|
|
8906
|
-
let c =
|
|
8911
|
+
let c = js(s, r);
|
|
8907
8912
|
for (let t = 0; t < e.length; t++) {
|
|
8908
8913
|
let e = s[t], n = c[t];
|
|
8909
8914
|
e !== void 0 && n !== void 0 && (i[t] = {
|
|
@@ -8914,7 +8919,7 @@ function js(e, t, n, r) {
|
|
|
8914
8919
|
}
|
|
8915
8920
|
return i;
|
|
8916
8921
|
}
|
|
8917
|
-
function
|
|
8922
|
+
function Ns(e = {}) {
|
|
8918
8923
|
let { paneId: t = "sub", config: n = {} } = e, r = {
|
|
8919
8924
|
fastPeriod: 12,
|
|
8920
8925
|
slowPeriod: 26,
|
|
@@ -8925,7 +8930,7 @@ function Ms(e = {}) {
|
|
|
8925
8930
|
...n
|
|
8926
8931
|
}, i = null, a = 0, o = 0, s = 0, c = [];
|
|
8927
8932
|
function l(e) {
|
|
8928
|
-
return (i !== e || a !== r.fastPeriod || o !== r.slowPeriod || s !== r.signalPeriod) && (c =
|
|
8933
|
+
return (i !== e || a !== r.fastPeriod || o !== r.slowPeriod || s !== r.signalPeriod) && (c = Ms(e, r.fastPeriod, r.slowPeriod, r.signalPeriod), i = e, a = r.fastPeriod, o = r.slowPeriod, s = r.signalPeriod), c;
|
|
8929
8934
|
}
|
|
8930
8935
|
return {
|
|
8931
8936
|
name: `macd_${t}`,
|
|
@@ -8998,11 +9003,11 @@ function Ms(e = {}) {
|
|
|
8998
9003
|
}
|
|
8999
9004
|
};
|
|
9000
9005
|
}
|
|
9001
|
-
function Ns(e, t, n = 12, r = 26, i = 9) {
|
|
9002
|
-
return t < r || t >= e.length ? null : js(e, n, r, i)[t] ?? null;
|
|
9003
|
-
}
|
|
9004
9006
|
function Ps(e, t, n = 12, r = 26, i = 9) {
|
|
9005
|
-
|
|
9007
|
+
return t < r || t >= e.length ? null : Ms(e, n, r, i)[t] ?? null;
|
|
9008
|
+
}
|
|
9009
|
+
function Fs(e, t, n = 12, r = 26, i = 9) {
|
|
9010
|
+
let a = Ps(e, t, n, r, i);
|
|
9006
9011
|
return a ? {
|
|
9007
9012
|
name: "MACD",
|
|
9008
9013
|
params: [
|
|
@@ -9031,7 +9036,7 @@ function Ps(e, t, n = 12, r = 26, i = 9) {
|
|
|
9031
9036
|
}
|
|
9032
9037
|
//#endregion
|
|
9033
9038
|
//#region src/core/renderers/Indicator/rsi.ts
|
|
9034
|
-
function
|
|
9039
|
+
function Is(e, t) {
|
|
9035
9040
|
let n = Array(e.length);
|
|
9036
9041
|
if (e.length < t + 1) return n;
|
|
9037
9042
|
let r = [];
|
|
@@ -9053,7 +9058,7 @@ function Fs(e, t) {
|
|
|
9053
9058
|
}
|
|
9054
9059
|
return n;
|
|
9055
9060
|
}
|
|
9056
|
-
function
|
|
9061
|
+
function Ls(e = {}) {
|
|
9057
9062
|
let { paneId: t = "sub", config: n = {} } = e, r = {
|
|
9058
9063
|
period1: 6,
|
|
9059
9064
|
period2: 12,
|
|
@@ -9064,7 +9069,7 @@ function Is(e = {}) {
|
|
|
9064
9069
|
...n
|
|
9065
9070
|
}, i = null, a = 0, o = 0, s = 0, c = [], l = [], u = [];
|
|
9066
9071
|
function d(e) {
|
|
9067
|
-
return (i !== e || a !== r.period1 || o !== r.period2 || s !== r.period3) && (c =
|
|
9072
|
+
return (i !== e || a !== r.period1 || o !== r.period2 || s !== r.period3) && (c = Is(e, r.period1), l = Is(e, r.period2), u = Is(e, r.period3), i = e, a = r.period1, o = r.period2, s = r.period3), {
|
|
9068
9073
|
rsi1: c,
|
|
9069
9074
|
rsi2: l,
|
|
9070
9075
|
rsi3: u
|
|
@@ -9110,9 +9115,9 @@ function Is(e = {}) {
|
|
|
9110
9115
|
}
|
|
9111
9116
|
};
|
|
9112
9117
|
}
|
|
9113
|
-
function
|
|
9118
|
+
function Rs(e, t, n = 6, r = 12, i = 24) {
|
|
9114
9119
|
if (t < n + 1 || t >= e.length) return null;
|
|
9115
|
-
let a =
|
|
9120
|
+
let a = Is(e, n)[t], o = Is(e, r)[t], s = Is(e, i)[t], c = [];
|
|
9116
9121
|
return a !== void 0 && c.push({
|
|
9117
9122
|
label: `RSI${n}`,
|
|
9118
9123
|
value: a,
|
|
@@ -9137,7 +9142,7 @@ function Ls(e, t, n = 6, r = 12, i = 24) {
|
|
|
9137
9142
|
}
|
|
9138
9143
|
//#endregion
|
|
9139
9144
|
//#region src/core/renderers/Indicator/cci.ts
|
|
9140
|
-
function
|
|
9145
|
+
function zs(e, t) {
|
|
9141
9146
|
let n = Array(e.length);
|
|
9142
9147
|
if (e.length < t) return n;
|
|
9143
9148
|
let r = e.map((e) => (e.high + e.low + e.close) / 3);
|
|
@@ -9151,14 +9156,14 @@ function Rs(e, t) {
|
|
|
9151
9156
|
}
|
|
9152
9157
|
return n;
|
|
9153
9158
|
}
|
|
9154
|
-
function
|
|
9159
|
+
function Bs(e = {}) {
|
|
9155
9160
|
let { paneId: t = "sub", config: n = {} } = e, r = {
|
|
9156
9161
|
period: 14,
|
|
9157
9162
|
showCCI: !0,
|
|
9158
9163
|
...n
|
|
9159
9164
|
}, i = null, a = 0, o = [];
|
|
9160
9165
|
function s(e) {
|
|
9161
|
-
return (i !== e || a !== r.period) && (o =
|
|
9166
|
+
return (i !== e || a !== r.period) && (o = zs(e, r.period), i = e, a = r.period), o;
|
|
9162
9167
|
}
|
|
9163
9168
|
return {
|
|
9164
9169
|
name: `cci_${t}`,
|
|
@@ -9208,12 +9213,12 @@ function zs(e = {}) {
|
|
|
9208
9213
|
}
|
|
9209
9214
|
};
|
|
9210
9215
|
}
|
|
9211
|
-
function
|
|
9212
|
-
return
|
|
9216
|
+
function Vs(e, t, n) {
|
|
9217
|
+
return zs(e, n)[t];
|
|
9213
9218
|
}
|
|
9214
|
-
function
|
|
9219
|
+
function Hs(e, t, n = 14) {
|
|
9215
9220
|
if (t < n || t >= e.length) return null;
|
|
9216
|
-
let r =
|
|
9221
|
+
let r = Vs(e, t, n);
|
|
9217
9222
|
return r === void 0 ? null : {
|
|
9218
9223
|
name: "CCI",
|
|
9219
9224
|
params: [n],
|
|
@@ -9226,7 +9231,7 @@ function Vs(e, t, n = 14) {
|
|
|
9226
9231
|
}
|
|
9227
9232
|
//#endregion
|
|
9228
9233
|
//#region src/core/renderers/Indicator/stoch.ts
|
|
9229
|
-
function
|
|
9234
|
+
function Us(e, t, n) {
|
|
9230
9235
|
let r = Array(e.length);
|
|
9231
9236
|
if (e.length < t) return r;
|
|
9232
9237
|
let i = Array(e.length);
|
|
@@ -9254,7 +9259,7 @@ function Hs(e, t, n) {
|
|
|
9254
9259
|
}
|
|
9255
9260
|
return r;
|
|
9256
9261
|
}
|
|
9257
|
-
function
|
|
9262
|
+
function Ws(e = {}) {
|
|
9258
9263
|
let { paneId: t = "sub", config: n = {} } = e, r = {
|
|
9259
9264
|
n: 9,
|
|
9260
9265
|
m: 3,
|
|
@@ -9263,7 +9268,7 @@ function Us(e = {}) {
|
|
|
9263
9268
|
...n
|
|
9264
9269
|
}, i = null, a = 0, o = 0, s = [];
|
|
9265
9270
|
function c(e) {
|
|
9266
|
-
return (i !== e || a !== r.n || o !== r.m) && (s =
|
|
9271
|
+
return (i !== e || a !== r.n || o !== r.m) && (s = Us(e, r.n, r.m), i = e, a = r.n, o = r.m), s;
|
|
9267
9272
|
}
|
|
9268
9273
|
return {
|
|
9269
9274
|
name: `stoch_${t}`,
|
|
@@ -9319,12 +9324,12 @@ function Us(e = {}) {
|
|
|
9319
9324
|
}
|
|
9320
9325
|
};
|
|
9321
9326
|
}
|
|
9322
|
-
function
|
|
9323
|
-
return
|
|
9327
|
+
function Gs(e, t, n, r) {
|
|
9328
|
+
return Us(e, n, r)[t];
|
|
9324
9329
|
}
|
|
9325
|
-
function
|
|
9330
|
+
function Ks(e, t, n = 9, r = 3) {
|
|
9326
9331
|
if (t < n + r - 1 || t >= e.length) return null;
|
|
9327
|
-
let i =
|
|
9332
|
+
let i = Gs(e, t, n, r);
|
|
9328
9333
|
return i ? {
|
|
9329
9334
|
name: "STOCH",
|
|
9330
9335
|
params: [n, r],
|
|
@@ -9341,7 +9346,7 @@ function Gs(e, t, n = 9, r = 3) {
|
|
|
9341
9346
|
}
|
|
9342
9347
|
//#endregion
|
|
9343
9348
|
//#region src/core/renderers/Indicator/mom.ts
|
|
9344
|
-
function
|
|
9349
|
+
function qs(e, t) {
|
|
9345
9350
|
let n = Array(e.length);
|
|
9346
9351
|
if (e.length < t + 1) return n;
|
|
9347
9352
|
for (let r = t; r < e.length; r++) {
|
|
@@ -9350,14 +9355,14 @@ function Ks(e, t) {
|
|
|
9350
9355
|
}
|
|
9351
9356
|
return n;
|
|
9352
9357
|
}
|
|
9353
|
-
function
|
|
9358
|
+
function Js(e = {}) {
|
|
9354
9359
|
let { paneId: t = "sub", config: n = {} } = e, r = {
|
|
9355
9360
|
period: 10,
|
|
9356
9361
|
showMOM: !0,
|
|
9357
9362
|
...n
|
|
9358
9363
|
}, i = null, a = 0, o = [];
|
|
9359
9364
|
function s(e) {
|
|
9360
|
-
return (i !== e || a !== r.period) && (o =
|
|
9365
|
+
return (i !== e || a !== r.period) && (o = qs(e, r.period), i = e, a = r.period), o;
|
|
9361
9366
|
}
|
|
9362
9367
|
return {
|
|
9363
9368
|
name: `mom_${t}`,
|
|
@@ -9408,12 +9413,12 @@ function qs(e = {}) {
|
|
|
9408
9413
|
}
|
|
9409
9414
|
};
|
|
9410
9415
|
}
|
|
9411
|
-
function
|
|
9412
|
-
return
|
|
9416
|
+
function Ys(e, t, n) {
|
|
9417
|
+
return qs(e, n)[t];
|
|
9413
9418
|
}
|
|
9414
|
-
function
|
|
9419
|
+
function Xs(e, t, n = 10) {
|
|
9415
9420
|
if (t < n || t >= e.length) return null;
|
|
9416
|
-
let r =
|
|
9421
|
+
let r = Ys(e, t, n);
|
|
9417
9422
|
return r === void 0 ? null : {
|
|
9418
9423
|
name: "MOM",
|
|
9419
9424
|
params: [n],
|
|
@@ -9426,7 +9431,7 @@ function Ys(e, t, n = 10) {
|
|
|
9426
9431
|
}
|
|
9427
9432
|
//#endregion
|
|
9428
9433
|
//#region src/core/renderers/Indicator/wmsr.ts
|
|
9429
|
-
function
|
|
9434
|
+
function Zs(e, t) {
|
|
9430
9435
|
let n = Array(e.length);
|
|
9431
9436
|
if (e.length < t) return n;
|
|
9432
9437
|
for (let r = t - 1; r < e.length; r++) {
|
|
@@ -9440,14 +9445,14 @@ function Xs(e, t) {
|
|
|
9440
9445
|
}
|
|
9441
9446
|
return n;
|
|
9442
9447
|
}
|
|
9443
|
-
function
|
|
9448
|
+
function Qs(e = {}) {
|
|
9444
9449
|
let { paneId: t = "sub", config: n = {} } = e, r = {
|
|
9445
9450
|
period: 14,
|
|
9446
9451
|
showWMSR: !0,
|
|
9447
9452
|
...n
|
|
9448
9453
|
}, i = null, a = 0, o = [];
|
|
9449
9454
|
function s(e) {
|
|
9450
|
-
return (i !== e || a !== r.period) && (o =
|
|
9455
|
+
return (i !== e || a !== r.period) && (o = Zs(e, r.period), i = e, a = r.period), o;
|
|
9451
9456
|
}
|
|
9452
9457
|
return {
|
|
9453
9458
|
name: `wmsr_${t}`,
|
|
@@ -9490,12 +9495,12 @@ function Zs(e = {}) {
|
|
|
9490
9495
|
}
|
|
9491
9496
|
};
|
|
9492
9497
|
}
|
|
9493
|
-
function
|
|
9494
|
-
return
|
|
9498
|
+
function $s(e, t, n) {
|
|
9499
|
+
return Zs(e, n)[t];
|
|
9495
9500
|
}
|
|
9496
|
-
function
|
|
9501
|
+
function ec(e, t, n = 14) {
|
|
9497
9502
|
if (t < n || t >= e.length) return null;
|
|
9498
|
-
let r =
|
|
9503
|
+
let r = $s(e, t, n);
|
|
9499
9504
|
return r === void 0 ? null : {
|
|
9500
9505
|
name: "WMSR",
|
|
9501
9506
|
params: [n],
|
|
@@ -9508,7 +9513,7 @@ function $s(e, t, n = 14) {
|
|
|
9508
9513
|
}
|
|
9509
9514
|
//#endregion
|
|
9510
9515
|
//#region src/core/renderers/Indicator/kst.ts
|
|
9511
|
-
function
|
|
9516
|
+
function tc(e, t) {
|
|
9512
9517
|
let n = Array(e.length);
|
|
9513
9518
|
if (e.length < t + 1) return n;
|
|
9514
9519
|
for (let r = t; r < e.length; r++) {
|
|
@@ -9517,7 +9522,7 @@ function ec(e, t) {
|
|
|
9517
9522
|
}
|
|
9518
9523
|
return n;
|
|
9519
9524
|
}
|
|
9520
|
-
function
|
|
9525
|
+
function nc(e, t) {
|
|
9521
9526
|
let n = Array(e.length), r = 0, i = 0;
|
|
9522
9527
|
for (let a = 0; a < e.length; a++) {
|
|
9523
9528
|
let o = e[a];
|
|
@@ -9531,13 +9536,13 @@ function tc(e, t) {
|
|
|
9531
9536
|
}
|
|
9532
9537
|
return n;
|
|
9533
9538
|
}
|
|
9534
|
-
function
|
|
9535
|
-
let o = Array(e.length), s =
|
|
9539
|
+
function rc(e, t, n, r, i, a) {
|
|
9540
|
+
let o = Array(e.length), s = tc(e, t), c = tc(e, n), l = tc(e, r), u = tc(e, i), d = nc(s, 10), f = nc(c, 10), p = nc(l, 10), m = nc(u, 15), h = Array(e.length);
|
|
9536
9541
|
for (let t = 0; t < e.length; t++) {
|
|
9537
9542
|
let e = d[t], n = f[t], r = p[t], i = m[t];
|
|
9538
9543
|
e !== void 0 && n !== void 0 && r !== void 0 && i !== void 0 && (h[t] = e * 1 + n * 2 + r * 3 + i * 4);
|
|
9539
9544
|
}
|
|
9540
|
-
let g =
|
|
9545
|
+
let g = nc(h, a);
|
|
9541
9546
|
for (let t = 0; t < e.length; t++) {
|
|
9542
9547
|
let e = h[t], n = g[t];
|
|
9543
9548
|
e !== void 0 && n !== void 0 && (o[t] = {
|
|
@@ -9547,7 +9552,7 @@ function nc(e, t, n, r, i, a) {
|
|
|
9547
9552
|
}
|
|
9548
9553
|
return o;
|
|
9549
9554
|
}
|
|
9550
|
-
function
|
|
9555
|
+
function ic(e = {}) {
|
|
9551
9556
|
let { paneId: t = "sub", config: n = {} } = e, r = {
|
|
9552
9557
|
roc1: 10,
|
|
9553
9558
|
roc2: 15,
|
|
@@ -9560,7 +9565,7 @@ function rc(e = {}) {
|
|
|
9560
9565
|
}, i = null, a = "", o = [];
|
|
9561
9566
|
function s(e) {
|
|
9562
9567
|
let t = `${r.roc1}-${r.roc2}-${r.roc3}-${r.roc4}-${r.signalPeriod}`;
|
|
9563
|
-
return (i !== e || a !== t) && (o =
|
|
9568
|
+
return (i !== e || a !== t) && (o = rc(e, r.roc1, r.roc2, r.roc3, r.roc4, r.signalPeriod), i = e, a = t), o;
|
|
9564
9569
|
}
|
|
9565
9570
|
return {
|
|
9566
9571
|
name: `kst_${t}`,
|
|
@@ -9624,12 +9629,12 @@ function rc(e = {}) {
|
|
|
9624
9629
|
}
|
|
9625
9630
|
};
|
|
9626
9631
|
}
|
|
9627
|
-
function
|
|
9628
|
-
return
|
|
9632
|
+
function ac(e, t, n, r, i, a, o) {
|
|
9633
|
+
return rc(e, n, r, i, a, o)[t];
|
|
9629
9634
|
}
|
|
9630
|
-
function
|
|
9635
|
+
function oc(e, t, n = 10, r = 15, i = 20, a = 30, o = 9) {
|
|
9631
9636
|
if (t < a + 15 + o || t >= e.length) return null;
|
|
9632
|
-
let s =
|
|
9637
|
+
let s = ac(e, t, n, r, i, a, o);
|
|
9633
9638
|
return s ? {
|
|
9634
9639
|
name: "KST",
|
|
9635
9640
|
params: [
|
|
@@ -9652,7 +9657,7 @@ function ac(e, t, n = 10, r = 15, i = 20, a = 30, o = 9) {
|
|
|
9652
9657
|
}
|
|
9653
9658
|
//#endregion
|
|
9654
9659
|
//#region src/core/renderers/Indicator/fastk.ts
|
|
9655
|
-
function
|
|
9660
|
+
function sc(e, t) {
|
|
9656
9661
|
let n = Array(e.length);
|
|
9657
9662
|
if (e.length < t) return n;
|
|
9658
9663
|
for (let r = t - 1; r < e.length; r++) {
|
|
@@ -9666,14 +9671,14 @@ function oc(e, t) {
|
|
|
9666
9671
|
}
|
|
9667
9672
|
return n;
|
|
9668
9673
|
}
|
|
9669
|
-
function
|
|
9674
|
+
function cc(e = {}) {
|
|
9670
9675
|
let { paneId: t = "sub", config: n = {} } = e, r = {
|
|
9671
9676
|
period: 9,
|
|
9672
9677
|
showFASTK: !0,
|
|
9673
9678
|
...n
|
|
9674
9679
|
}, i = null, a = 0, o = [];
|
|
9675
9680
|
function s(e) {
|
|
9676
|
-
return (i !== e || a !== r.period) && (o =
|
|
9681
|
+
return (i !== e || a !== r.period) && (o = sc(e, r.period), i = e, a = r.period), o;
|
|
9677
9682
|
}
|
|
9678
9683
|
return {
|
|
9679
9684
|
name: `fastk_${t}`,
|
|
@@ -9716,12 +9721,12 @@ function sc(e = {}) {
|
|
|
9716
9721
|
}
|
|
9717
9722
|
};
|
|
9718
9723
|
}
|
|
9719
|
-
function
|
|
9720
|
-
return
|
|
9724
|
+
function lc(e, t, n) {
|
|
9725
|
+
return sc(e, n)[t];
|
|
9721
9726
|
}
|
|
9722
|
-
function
|
|
9727
|
+
function uc(e, t, n = 9) {
|
|
9723
9728
|
if (t < n || t >= e.length) return null;
|
|
9724
|
-
let r =
|
|
9729
|
+
let r = lc(e, t, n);
|
|
9725
9730
|
return r === void 0 ? null : {
|
|
9726
9731
|
name: "FASTK",
|
|
9727
9732
|
params: [n],
|
|
@@ -9734,24 +9739,24 @@ function lc(e, t, n = 9) {
|
|
|
9734
9739
|
}
|
|
9735
9740
|
//#endregion
|
|
9736
9741
|
//#region src/core/renderers/Indicator/index.ts
|
|
9737
|
-
function
|
|
9742
|
+
function dc(e) {
|
|
9738
9743
|
let { indicatorId: t, paneId: n } = e;
|
|
9739
9744
|
switch (t) {
|
|
9740
|
-
case "VOLUME": return
|
|
9741
|
-
case "MACD": return
|
|
9742
|
-
case "RSI": return
|
|
9743
|
-
case "CCI": return
|
|
9744
|
-
case "STOCH": return
|
|
9745
|
-
case "MOM": return
|
|
9746
|
-
case "WMSR": return
|
|
9747
|
-
case "KST": return
|
|
9748
|
-
case "FASTK": return
|
|
9745
|
+
case "VOLUME": return ms({ paneId: n });
|
|
9746
|
+
case "MACD": return Ns({ paneId: n });
|
|
9747
|
+
case "RSI": return Ls({ paneId: n });
|
|
9748
|
+
case "CCI": return Bs({ paneId: n });
|
|
9749
|
+
case "STOCH": return Ws({ paneId: n });
|
|
9750
|
+
case "MOM": return Js({ paneId: n });
|
|
9751
|
+
case "WMSR": return Qs({ paneId: n });
|
|
9752
|
+
case "KST": return ic({ paneId: n });
|
|
9753
|
+
case "FASTK": return cc({ paneId: n });
|
|
9749
9754
|
default: throw Error(`Unknown indicator: ${t}`);
|
|
9750
9755
|
}
|
|
9751
9756
|
}
|
|
9752
9757
|
//#endregion
|
|
9753
9758
|
//#region src/core/chart.ts
|
|
9754
|
-
var
|
|
9759
|
+
var fc = class e {
|
|
9755
9760
|
dom;
|
|
9756
9761
|
opt;
|
|
9757
9762
|
data = [];
|
|
@@ -9763,7 +9768,7 @@ var dc = class e {
|
|
|
9763
9768
|
pluginHost;
|
|
9764
9769
|
rendererPluginManager;
|
|
9765
9770
|
constructor(e, t) {
|
|
9766
|
-
this.dom = e, this.opt = t, this.interaction = new
|
|
9771
|
+
this.dom = e, this.opt = t, this.interaction = new fs(this), this.markerManager = new go(), this.pluginHost = da(), this.rendererPluginManager = new pa(), this.rendererPluginManager.setPluginHost(this.pluginHost), this.rendererPluginManager.setInvalidateCallback(() => this.scheduleDraw()), this.initPanes();
|
|
9767
9772
|
}
|
|
9768
9773
|
get plugin() {
|
|
9769
9774
|
return this.pluginHost;
|
|
@@ -9797,14 +9802,14 @@ var dc = class e {
|
|
|
9797
9802
|
console.log("[Chart] draw aborted: no data");
|
|
9798
9803
|
return;
|
|
9799
9804
|
}
|
|
9800
|
-
let { start: t, end: n } =
|
|
9805
|
+
let { start: t, end: n } = cs(e.scrollLeft, e.plotWidth, this.opt.kWidth, this.opt.kGap, this.data.length, e.dpr), r = {
|
|
9801
9806
|
start: t,
|
|
9802
9807
|
end: n
|
|
9803
|
-
}, i = this.calcKLinePositions(r), { kWidthPx: a } =
|
|
9808
|
+
}, i = this.calcKLinePositions(r), { kWidthPx: a } = ss(this.opt.kWidth, this.opt.kGap, e.dpr);
|
|
9804
9809
|
this.interaction.setKLinePositions(i, r, a);
|
|
9805
9810
|
for (let t of this.paneRenderers) {
|
|
9806
9811
|
let n = t.getPane(), a = t.getDom().plotCanvas.getContext("2d"), o = t.getDom().yAxisCanvas.getContext("2d");
|
|
9807
|
-
n.updateRange(this.data, r), a && (a.setTransform(1, 0, 0, 1, 0, 0), a.scale(e.dpr, e.dpr), a.clearRect(0, 0, e.plotWidth, n.height + 2 / e.dpr));
|
|
9812
|
+
n.updateRange(this.data, r), a && (a.setTransform(1, 0, 0, 1, 0, 0), a.scale(e.dpr, e.dpr), a.clearRect(0, 0, e.plotWidth + 1, n.height + 2 / e.dpr));
|
|
9808
9813
|
let s = this.opt.rightAxisWidth + (this.opt.priceLabelWidth || 60);
|
|
9809
9814
|
o && (o.setTransform(1, 0, 0, 1, 0, 0), o.scale(e.dpr, e.dpr), o.clearRect(0, 0, s, n.height + 2 / e.dpr));
|
|
9810
9815
|
let c = {
|
|
@@ -9864,44 +9869,6 @@ var dc = class e {
|
|
|
9864
9869
|
errors: n
|
|
9865
9870
|
});
|
|
9866
9871
|
}
|
|
9867
|
-
let s = this.dom.borderCanvas;
|
|
9868
|
-
if (s) {
|
|
9869
|
-
let t = s.getContext("2d");
|
|
9870
|
-
if (t) {
|
|
9871
|
-
t.setTransform(1, 0, 0, 1, 0, 0), t.scale(e.dpr, e.dpr), t.clearRect(0, 0, e.plotWidth, e.plotHeight);
|
|
9872
|
-
let n = {
|
|
9873
|
-
ctx: t,
|
|
9874
|
-
pane: {
|
|
9875
|
-
id: "globalBorders",
|
|
9876
|
-
top: 0,
|
|
9877
|
-
height: e.plotHeight,
|
|
9878
|
-
yAxis: {
|
|
9879
|
-
priceToY: () => 0,
|
|
9880
|
-
yToPrice: () => 0,
|
|
9881
|
-
getPaddingTop: () => 0,
|
|
9882
|
-
getPaddingBottom: () => 0
|
|
9883
|
-
},
|
|
9884
|
-
priceRange: {
|
|
9885
|
-
maxPrice: 0,
|
|
9886
|
-
minPrice: 0
|
|
9887
|
-
}
|
|
9888
|
-
},
|
|
9889
|
-
data: this.data,
|
|
9890
|
-
range: r,
|
|
9891
|
-
scrollLeft: e.scrollLeft,
|
|
9892
|
-
kWidth: this.opt.kWidth,
|
|
9893
|
-
kGap: this.opt.kGap,
|
|
9894
|
-
dpr: e.dpr,
|
|
9895
|
-
paneWidth: e.plotWidth,
|
|
9896
|
-
kLinePositions: i,
|
|
9897
|
-
borderCtx: t
|
|
9898
|
-
}, a = this.rendererPluginManager.renderPlugin("globalBorders", n);
|
|
9899
|
-
a.length > 0 && this.pluginHost.events.emit("renderer:error", {
|
|
9900
|
-
paneId: "globalBorders",
|
|
9901
|
-
errors: a
|
|
9902
|
-
});
|
|
9903
|
-
}
|
|
9904
|
-
}
|
|
9905
9872
|
}
|
|
9906
9873
|
zoomAt(e, t, n) {
|
|
9907
9874
|
let r = this.opt.kWidth + this.opt.kGap, i = (t + e) / r, a = this.viewport?.dpr || window.devicePixelRatio || 1, o = Math.round(this.opt.kWidth * a), s = n > 0 ? -2 : 2, c = o + s;
|
|
@@ -9953,7 +9920,7 @@ var dc = class e {
|
|
|
9953
9920
|
calcKLinePositions(e) {
|
|
9954
9921
|
let { start: t, end: n } = e, r = n - t;
|
|
9955
9922
|
if (r <= 0) return [];
|
|
9956
|
-
let i = this.viewport?.dpr || window.devicePixelRatio || 1, { unitPx: a, startXPx: o } =
|
|
9923
|
+
let i = this.viewport?.dpr || window.devicePixelRatio || 1, { unitPx: a, startXPx: o } = ss(this.opt.kWidth, this.opt.kGap, i), s = Array(r);
|
|
9957
9924
|
for (let e = 0; e < r; e++) s[e] = (o + (t + e) * a) / i;
|
|
9958
9925
|
return s;
|
|
9959
9926
|
}
|
|
@@ -9971,9 +9938,9 @@ var dc = class e {
|
|
|
9971
9938
|
console.warn(`Pane "${e}" already exists`);
|
|
9972
9939
|
return;
|
|
9973
9940
|
}
|
|
9974
|
-
let t = new
|
|
9975
|
-
n.id = `${e}-plot`, n.className = "plot-canvas", n.style.position = "absolute", n.style.left = "0", n.style.top = "0", r.id = `${e}-yAxis`, r.className = "
|
|
9976
|
-
let
|
|
9941
|
+
let t = new ds(e), n = document.createElement("canvas"), r = document.createElement("canvas"), i = e === "main";
|
|
9942
|
+
n.id = `${e}-plot`, n.className = i ? "plot-canvas main" : "plot-canvas sub", n.style.position = "absolute", n.style.left = "0", n.style.top = "0", r.id = `${e}-yAxis`, r.className = "right-axis", r.style.position = "absolute", r.style.right = "0";
|
|
9943
|
+
let a = new ps({
|
|
9977
9944
|
plotCanvas: n,
|
|
9978
9945
|
yAxisCanvas: r
|
|
9979
9946
|
}, t, {
|
|
@@ -9981,9 +9948,9 @@ var dc = class e {
|
|
|
9981
9948
|
yPaddingPx: 0,
|
|
9982
9949
|
priceLabelWidth: this.opt.priceLabelWidth
|
|
9983
9950
|
});
|
|
9984
|
-
this.paneRenderers.push(
|
|
9985
|
-
let
|
|
9986
|
-
|
|
9951
|
+
this.paneRenderers.push(a);
|
|
9952
|
+
let o = this.dom.canvasLayer;
|
|
9953
|
+
o && (o.appendChild(n), o.appendChild(r)), this.rendererPluginManager.addKnownPaneId(e);
|
|
9987
9954
|
}
|
|
9988
9955
|
removePane(e) {
|
|
9989
9956
|
let t = this.paneRenderers.findIndex((t) => t.getPane().id === e);
|
|
@@ -10004,7 +9971,7 @@ var dc = class e {
|
|
|
10004
9971
|
return n && this.updateRendererConfig(e, n), !0;
|
|
10005
9972
|
}
|
|
10006
9973
|
this.addPane(r);
|
|
10007
|
-
let i =
|
|
9974
|
+
let i = dc({
|
|
10008
9975
|
indicatorId: t,
|
|
10009
9976
|
paneId: r
|
|
10010
9977
|
});
|
|
@@ -10042,7 +10009,7 @@ var dc = class e {
|
|
|
10042
10009
|
return this.data;
|
|
10043
10010
|
}
|
|
10044
10011
|
getContentWidth() {
|
|
10045
|
-
let e = this.data?.length ?? 0, t = this.viewport?.dpr || window.devicePixelRatio || 1, { startXPx: n, unitPx: r } =
|
|
10012
|
+
let e = this.data?.length ?? 0, t = this.viewport?.dpr || window.devicePixelRatio || 1, { startXPx: n, unitPx: r } = ss(this.opt.kWidth, this.opt.kGap, t);
|
|
10046
10013
|
return (n + e * r) / t + (this.opt.rightAxisWidth + (this.opt.priceLabelWidth || 60));
|
|
10047
10014
|
}
|
|
10048
10015
|
resize() {
|
|
@@ -10059,8 +10026,8 @@ var dc = class e {
|
|
|
10059
10026
|
}
|
|
10060
10027
|
initPanes() {
|
|
10061
10028
|
this.paneRenderers = this.opt.panes.map((e) => {
|
|
10062
|
-
let t = new
|
|
10063
|
-
return n.id = `${e.id}-plot`, n.className = "plot-canvas", n.style.position = "absolute", n.style.left = "0", n.style.top = "0", r.id = `${e.id}-yAxis`, r.className = "
|
|
10029
|
+
let t = new ds(e.id), n = document.createElement("canvas"), r = document.createElement("canvas"), i = e.id === "main";
|
|
10030
|
+
return n.id = `${e.id}-plot`, n.className = i ? "plot-canvas main" : "plot-canvas sub", n.style.position = "absolute", n.style.left = "0", n.style.top = "0", r.id = `${e.id}-yAxis`, r.className = "right-axis", r.style.position = "absolute", r.style.right = "0", new ps({
|
|
10064
10031
|
plotCanvas: n,
|
|
10065
10032
|
yAxisCanvas: r
|
|
10066
10033
|
}, t, {
|
|
@@ -10070,14 +10037,10 @@ var dc = class e {
|
|
|
10070
10037
|
});
|
|
10071
10038
|
});
|
|
10072
10039
|
let e = this.dom.canvasLayer;
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
});
|
|
10078
|
-
let t = document.createElement("canvas");
|
|
10079
|
-
t.id = "border", t.style.position = "absolute", t.style.left = "0", t.style.top = "0", t.style.pointerEvents = "none", this.dom.borderCanvas = t, e.appendChild(t);
|
|
10080
|
-
}
|
|
10040
|
+
e && (e.querySelectorAll("canvas:not(.x-axis-canvas)").forEach((e) => e.remove()), this.paneRenderers.forEach((t) => {
|
|
10041
|
+
let n = t.getDom();
|
|
10042
|
+
e.appendChild(n.plotCanvas), e.appendChild(n.yAxisCanvas);
|
|
10043
|
+
}));
|
|
10081
10044
|
}
|
|
10082
10045
|
layoutPanes() {
|
|
10083
10046
|
let e = this.viewport;
|
|
@@ -10099,7 +10062,7 @@ var dc = class e {
|
|
|
10099
10062
|
let e = this.dom.container;
|
|
10100
10063
|
if (!e) return null;
|
|
10101
10064
|
let t = Math.max(1, Math.ceil(e.clientWidth)), n = Math.max(1, Math.ceil(e.clientHeight)), r = e.scrollLeft, i = this.opt.rightAxisWidth + (this.opt.priceLabelWidth || 60), a = Math.round(t - i), o = Math.round(n - this.opt.bottomAxisHeight), s = window.devicePixelRatio || 1, c = 16 * 1024 * 1024;
|
|
10102
|
-
t * s * (n * s) > c && (s = Math.sqrt(c / (t * n))), this.dom.canvasLayer.style.width = `${t}px`, this.dom.canvasLayer.style.height = `${n}px`, this.dom.xAxisCanvas.style.width = `${a}px`, this.dom.xAxisCanvas.style.height = `${this.opt.bottomAxisHeight}px`, this.dom.xAxisCanvas.width = Math.round(a * s), this.dom.xAxisCanvas.height = Math.round(this.opt.bottomAxisHeight * s)
|
|
10065
|
+
t * s * (n * s) > c && (s = Math.sqrt(c / (t * n))), this.dom.canvasLayer.style.width = `${t}px`, this.dom.canvasLayer.style.height = `${n}px`, this.dom.xAxisCanvas.style.width = `${a}px`, this.dom.xAxisCanvas.style.height = `${this.opt.bottomAxisHeight}px`, this.dom.xAxisCanvas.width = Math.round(a * s), this.dom.xAxisCanvas.height = Math.round(this.opt.bottomAxisHeight * s);
|
|
10103
10066
|
let l = {
|
|
10104
10067
|
viewWidth: t,
|
|
10105
10068
|
viewHeight: n,
|
|
@@ -10113,18 +10076,18 @@ var dc = class e {
|
|
|
10113
10076
|
};
|
|
10114
10077
|
//#endregion
|
|
10115
10078
|
//#region src/types/kLine.ts
|
|
10116
|
-
function
|
|
10079
|
+
function pc(e) {
|
|
10117
10080
|
return e.open > e.close ? "down" : e.open < e.close ? "up" : "flat";
|
|
10118
10081
|
}
|
|
10119
10082
|
//#endregion
|
|
10120
10083
|
//#region src/types/volumePrice.ts
|
|
10121
10084
|
var $ = /* @__PURE__ */ function(e) {
|
|
10122
10085
|
return e.RISE_WITH_VOLUME = "rise_with_volume", e.RISE_WITHOUT_VOLUME = "rise_without_volume", e.FALL_WITH_VOLUME = "fall_with_volume", e.FALL_WITHOUT_VOLUME = "fall_without_volume", e.OTHERS = "others", e;
|
|
10123
|
-
}({}),
|
|
10086
|
+
}({}), mc = {
|
|
10124
10087
|
volumeAmplifyThreshold: 1.5,
|
|
10125
10088
|
volumeShrinkThreshold: .8,
|
|
10126
10089
|
avgPeriod: 20
|
|
10127
|
-
},
|
|
10090
|
+
}, hc = class {
|
|
10128
10091
|
prefixSum = [];
|
|
10129
10092
|
dataLength = 0;
|
|
10130
10093
|
build(e) {
|
|
@@ -10149,8 +10112,8 @@ var $ = /* @__PURE__ */ function(e) {
|
|
|
10149
10112
|
return this.dataLength;
|
|
10150
10113
|
}
|
|
10151
10114
|
};
|
|
10152
|
-
function
|
|
10153
|
-
let i = new
|
|
10115
|
+
function gc(e, t, n, r = mc) {
|
|
10116
|
+
let i = new hc();
|
|
10154
10117
|
i.build(e);
|
|
10155
10118
|
let a = [], { volumeAmplifyThreshold: o, volumeShrinkThreshold: s, avgPeriod: c } = r;
|
|
10156
10119
|
for (let r = t; r < n && r < e.length; r++) {
|
|
@@ -10171,7 +10134,7 @@ function hc(e, t, n, r = pc) {
|
|
|
10171
10134
|
}
|
|
10172
10135
|
//#endregion
|
|
10173
10136
|
//#region src/core/renderers/candle.ts
|
|
10174
|
-
function
|
|
10137
|
+
function _c() {
|
|
10175
10138
|
return {
|
|
10176
10139
|
name: "candle",
|
|
10177
10140
|
version: "1.0.0",
|
|
@@ -10182,36 +10145,36 @@ function gc() {
|
|
|
10182
10145
|
draw(e) {
|
|
10183
10146
|
let { ctx: t, pane: n, data: r, range: i, scrollLeft: a, kWidth: o, kGap: s, dpr: c, kLinePositions: l, markerManager: u } = e, d = r;
|
|
10184
10147
|
if (!d.length) return;
|
|
10185
|
-
let { kWidthPx: f } =
|
|
10148
|
+
let { kWidthPx: f } = ss(o, s, c);
|
|
10186
10149
|
t.save(), t.translate(-a, 0);
|
|
10187
|
-
let p = l || [], m =
|
|
10150
|
+
let p = l || [], m = gc(d, i.start, i.end, mc);
|
|
10188
10151
|
for (let e = i.start; e < i.end && e < d.length; e++) {
|
|
10189
10152
|
let r = d[e];
|
|
10190
10153
|
if (!r) continue;
|
|
10191
10154
|
let a = n.yAxis.priceToY(r.open), s = n.yAxis.priceToY(r.close), l = n.yAxis.priceToY(r.high), h = n.yAxis.priceToY(r.low), g = Math.min(a, s), _ = Math.max(Math.abs(a - s), 1), v = p[e - i.start];
|
|
10192
10155
|
if (!v) continue;
|
|
10193
|
-
let y =
|
|
10194
|
-
t.fillStyle =
|
|
10156
|
+
let y = xs(Math.round(v * c), g, f, _, c);
|
|
10157
|
+
t.fillStyle = pc(r) === "up" ? X.UP : X.DOWN, t.fillRect(y.bodyRect.x, y.bodyRect.y, y.bodyRect.width, y.bodyRect.height);
|
|
10195
10158
|
let b = y.wickRect.width, x = y.wickRect.x, S = y.bodyRect.y, C = y.bodyRect.y + y.bodyRect.height, w = Math.max(r.open, r.close), T = Math.min(r.open, r.close);
|
|
10196
10159
|
if (r.high > w) {
|
|
10197
|
-
let e =
|
|
10160
|
+
let e = ys(x, l, S, c);
|
|
10198
10161
|
e && t.fillRect(e.x, e.y, b, e.height);
|
|
10199
10162
|
}
|
|
10200
10163
|
if (r.low < T) {
|
|
10201
|
-
let e =
|
|
10164
|
+
let e = ys(x, C, h, c);
|
|
10202
10165
|
e && t.fillRect(e.x, e.y, b, e.height);
|
|
10203
10166
|
}
|
|
10204
10167
|
let E = m[e - i.start];
|
|
10205
10168
|
if (E !== $.OTHERS && u) {
|
|
10206
10169
|
let n = E === $.RISE_WITH_VOLUME || E === $.RISE_WITHOUT_VOLUME ? l - 15 : h + 15;
|
|
10207
|
-
|
|
10170
|
+
vc(t, y.bodyRect.x + y.bodyRect.width / 2, n, E, e, o, 4, u);
|
|
10208
10171
|
}
|
|
10209
10172
|
}
|
|
10210
10173
|
t.restore();
|
|
10211
10174
|
}
|
|
10212
10175
|
};
|
|
10213
10176
|
}
|
|
10214
|
-
function
|
|
10177
|
+
function vc(e, t, n, r, i, a, o = 4, s) {
|
|
10215
10178
|
let c = Math.min(a, 20), l = c * Math.sqrt(3) / 2, u, d;
|
|
10216
10179
|
switch (r) {
|
|
10217
10180
|
case $.RISE_WITH_VOLUME:
|
|
@@ -10275,12 +10238,12 @@ function _c(e, t, n, r, i, a, o = 4, s) {
|
|
|
10275
10238
|
}
|
|
10276
10239
|
//#endregion
|
|
10277
10240
|
//#region src/core/utils/tickCount.ts
|
|
10278
|
-
function
|
|
10241
|
+
function yc(e, t) {
|
|
10279
10242
|
return t ? Math.max(4, Math.min(8, Math.round(e / 80))) : 2;
|
|
10280
10243
|
}
|
|
10281
10244
|
//#endregion
|
|
10282
10245
|
//#region src/core/renderers/gridLines.ts
|
|
10283
|
-
function
|
|
10246
|
+
function bc() {
|
|
10284
10247
|
return {
|
|
10285
10248
|
name: "gridLines",
|
|
10286
10249
|
version: "1.0.0",
|
|
@@ -10291,11 +10254,11 @@ function yc() {
|
|
|
10291
10254
|
draw(e) {
|
|
10292
10255
|
let { ctx: t, pane: n, data: r, range: i, scrollLeft: a, kWidth: o, dpr: s, kLinePositions: c } = e, l = r;
|
|
10293
10256
|
if (!l.length) return;
|
|
10294
|
-
let u =
|
|
10257
|
+
let u = yc(n.height, n.id === "main");
|
|
10295
10258
|
t.save(), t.fillStyle = Aa.HORIZONTAL, t.translate(-a, 0);
|
|
10296
10259
|
let d = t.canvas.width / s, f = a, p = a + d, m = n.yAxis.getPaddingTop(), h = n.yAxis.getPaddingBottom(), g = m, _ = Math.max(m, n.height - h), v = Math.max(0, _ - g);
|
|
10297
10260
|
for (let e = 0; e < u; e++) {
|
|
10298
|
-
let n = u <= 1 ? 0 : e / (u - 1), r =
|
|
10261
|
+
let n = u <= 1 ? 0 : e / (u - 1), r = bs(f, p, Math.round(g + n * v), s);
|
|
10299
10262
|
r && t.fillRect(r.x, r.y, r.width, r.height);
|
|
10300
10263
|
}
|
|
10301
10264
|
let y = Ea(l);
|
|
@@ -10303,7 +10266,7 @@ function yc() {
|
|
|
10303
10266
|
if (e < i.start || e >= i.end || e >= l.length) continue;
|
|
10304
10267
|
let r = e - i.start;
|
|
10305
10268
|
if (r < 0 || r >= c.length) continue;
|
|
10306
|
-
let a =
|
|
10269
|
+
let a = ys(c[r] + o / 2, 0, n.height, s);
|
|
10307
10270
|
a && t.fillRect(a.x, a.y, a.width, a.height);
|
|
10308
10271
|
}
|
|
10309
10272
|
t.restore();
|
|
@@ -10312,7 +10275,7 @@ function yc() {
|
|
|
10312
10275
|
}
|
|
10313
10276
|
//#endregion
|
|
10314
10277
|
//#region src/core/renderers/lastPrice.ts
|
|
10315
|
-
function
|
|
10278
|
+
function xc() {
|
|
10316
10279
|
return {
|
|
10317
10280
|
name: "lastPriceLine",
|
|
10318
10281
|
version: "1.0.0",
|
|
@@ -10333,7 +10296,7 @@ function bc() {
|
|
|
10333
10296
|
}
|
|
10334
10297
|
//#endregion
|
|
10335
10298
|
//#region src/core/renderers/extremaMarkers.ts
|
|
10336
|
-
function
|
|
10299
|
+
function Sc() {
|
|
10337
10300
|
return {
|
|
10338
10301
|
name: "extremaMarkers",
|
|
10339
10302
|
version: "1.0.0",
|
|
@@ -10356,28 +10319,28 @@ function xc() {
|
|
|
10356
10319
|
let t = e - i.start;
|
|
10357
10320
|
return t < 0 || t >= l.length ? 0 : l[t] + o / 2;
|
|
10358
10321
|
};
|
|
10359
|
-
t.save(), t.translate(-a, 0),
|
|
10322
|
+
t.save(), t.translate(-a, 0), Cc(t, _(h), n.yAxis.priceToY(p), p, s, c, a), Cc(t, _(g), n.yAxis.priceToY(m), m, s, c, a), t.restore();
|
|
10360
10323
|
}
|
|
10361
10324
|
};
|
|
10362
10325
|
}
|
|
10363
|
-
function
|
|
10326
|
+
function Cc(e, t, n, r, i, a, o) {
|
|
10364
10327
|
let s = r.toFixed(2);
|
|
10365
10328
|
e.font = "12px Arial";
|
|
10366
10329
|
let c = e.measureText(s).width, l = t - o + 30 + 4 + c > a, u = t, d = l ? t - 30 : t + 30;
|
|
10367
10330
|
u > d && ([u, d] = [d, u]);
|
|
10368
|
-
let f =
|
|
10331
|
+
let f = bs(u, d, n, i);
|
|
10369
10332
|
f && (e.fillStyle = Da.WEAK, e.fillRect(f.x, f.y, f.width, f.height));
|
|
10370
10333
|
let p = Z(d, i), m = Z(n, i);
|
|
10371
10334
|
e.fillStyle = Da.WEAK, e.beginPath(), e.arc(p, m, 2, 0, Math.PI * 2), e.fill(), e.font = "12px Arial", e.textBaseline = "middle", e.fillStyle = X.NEUTRAL, l ? (e.textAlign = "right", e.fillText(s, Z(t - 30 - 4, i), Z(n, i))) : (e.textAlign = "left", e.fillText(s, Z(t + 30 + 4, i), Z(n, i)));
|
|
10372
10335
|
}
|
|
10373
10336
|
//#endregion
|
|
10374
10337
|
//#region src/utils/kLineDraw/axis.ts
|
|
10375
|
-
function
|
|
10338
|
+
function wc(e, t) {
|
|
10376
10339
|
let { x: n, y: r, width: i, height: a, priceRange: o, yPaddingPx: s = 0, dpr: c, ticks: l = 10, bgColor: u = Oa.TRANSPARENT, textColor: d = Da.SECONDARY, lineColor: f = ka.DARK, fontSize: p = 16, paddingX: m = 12, drawLeftBorder: h = !0, drawTickLines: g = !0 } = t, _ = Math.max(0, Math.min(s, Math.floor(a / 2) - 1)), { maxPrice: v, minPrice: y } = o, b = v - y, x = b === 0 ? 0 : b / (Math.max(2, l) - 1);
|
|
10377
10340
|
e.fillStyle = u, e.fillRect(n, r, i, a), h && (e.strokeStyle = f, e.lineWidth = 1, e.beginPath(), e.moveTo(Q(n, c), r), e.lineTo(Q(n, c), r + a), e.stroke()), e.font = `${p}px -apple-system,BlinkMacSystemFont,Trebuchet MS,Roboto,Ubuntu,sans-serif`, e.textBaseline = "middle", e.textAlign = "left";
|
|
10378
10341
|
let S = n + m;
|
|
10379
10342
|
for (let t = 0; t < Math.max(2, l); t++) {
|
|
10380
|
-
let i = b === 0 ? v : v - x * t, o = Math.round(
|
|
10343
|
+
let i = b === 0 ? v : v - x * t, o = Math.round(vs(i, v, y, a, _, _) + r);
|
|
10381
10344
|
if (g) {
|
|
10382
10345
|
e.strokeStyle = f, e.beginPath();
|
|
10383
10346
|
let t = Q(o, c);
|
|
@@ -10386,33 +10349,29 @@ function Cc(e, t) {
|
|
|
10386
10349
|
e.fillStyle = d, e.fillText(i.toFixed(2), Z(S, c), Z(o, c));
|
|
10387
10350
|
}
|
|
10388
10351
|
}
|
|
10389
|
-
function
|
|
10352
|
+
function Tc(e, t) {
|
|
10390
10353
|
let { x: n, y: r, width: i, height: a, crosshairX: o, timestamp: s, dpr: c, bgColor: l = Oa.WHITE, textColor: u = Da.PRIMARY, fontSize: d = 16, paddingX: f = 8, paddingY: p = 4 } = t, m = Ta(s);
|
|
10391
10354
|
e.save(), e.font = `${d}px -apple-system,BlinkMacSystemFont,Trebuchet MS,Roboto,Ubuntu,sans-serif`, e.textBaseline = "middle", e.textAlign = "center";
|
|
10392
10355
|
let h = Math.round(e.measureText(m).width), g = Math.min(i, h + f * 2), _ = Math.min(a, d + p * 2), v = Math.min(Math.max(o, n + g / 2), n + i - g / 2), y = r + a / 2, b = v - g / 2;
|
|
10393
10356
|
y - _ / 2, e.fillStyle = l, e.fillRect(Z(b, c), 0, Z(g, c), Z(_, c)), e.fillStyle = u, e.fillText(m, Z(v, c), Z(y, c)), e.restore();
|
|
10394
10357
|
}
|
|
10395
|
-
function
|
|
10358
|
+
function Ec(e, t) {
|
|
10396
10359
|
let { x: n, y: r, width: i, height: a, data: o, scrollLeft: s, kWidth: c, kGap: l, startIndex: u, endIndex: d, dpr: f, bgColor: p = Oa.TRANSPARENT, textColor: m = Da.SECONDARY, lineColor: h = ka.DARK, fontSize: g = 16, paddingX: _ = 8, drawTopBorder: v = !0, drawBottomBorder: y = !0 } = t, b = Math.round(c * f), x = b % 2 == 0 ? b + 1 : b, S = Math.round(l * f), C = x + S, w = S, T = C / f, E = w / f, D = x / f;
|
|
10397
10360
|
e.fillStyle = p, e.fillRect(n, r, i, a), v && (e.strokeStyle = h, e.lineWidth = 1, e.beginPath(), e.moveTo(n, Q(r, f)), e.lineTo(n + i, Q(r, f)), e.stroke()), y && (e.strokeStyle = h, e.lineWidth = 1, e.beginPath(), e.moveTo(n, Q(r + a, f)), e.lineTo(n + i, Q(r + a, f)), e.stroke()), e.textAlign = "center", e.textBaseline = "middle";
|
|
10398
10361
|
let O = r + a / 2, k = Ea(o).filter((e) => e >= u && e < d);
|
|
10399
10362
|
for (let t of k) {
|
|
10400
10363
|
let n = o[t];
|
|
10401
10364
|
if (!n) continue;
|
|
10402
|
-
let
|
|
10403
|
-
if (
|
|
10404
|
-
let t = Math.min(Math.max(a, c),
|
|
10405
|
-
e.
|
|
10406
|
-
let i = Q(t, f);
|
|
10407
|
-
e.moveTo(i, r), e.lineTo(i, r + 4), e.stroke();
|
|
10408
|
-
let { text: o, isYear: s } = Sa(n.timestamp);
|
|
10409
|
-
e.fillStyle = m, e.font = `${s ? "bold " : ""}${g}px -apple-system,BlinkMacSystemFont,Trebuchet MS,Roboto,Ubuntu,sans-serif`, e.fillText(o, Z(t, f), Z(O, f));
|
|
10365
|
+
let r = E + t * T + D / 2 - s, a = _, c = Math.max(_, i - _);
|
|
10366
|
+
if (r >= a && r <= c) {
|
|
10367
|
+
let t = Math.min(Math.max(r, a), c), { text: i, isYear: o } = Sa(n.timestamp);
|
|
10368
|
+
e.fillStyle = m, e.font = `${o ? "bold " : ""}${g}px -apple-system,BlinkMacSystemFont,Trebuchet MS,Roboto,Ubuntu,sans-serif`, e.fillText(i, Z(t, f), Z(O, f));
|
|
10410
10369
|
}
|
|
10411
10370
|
}
|
|
10412
10371
|
}
|
|
10413
10372
|
//#endregion
|
|
10414
10373
|
//#region src/core/renderers/yAxis.ts
|
|
10415
|
-
function
|
|
10374
|
+
function Dc(e) {
|
|
10416
10375
|
return {
|
|
10417
10376
|
name: "yAxis",
|
|
10418
10377
|
version: "1.0.0",
|
|
@@ -10421,8 +10380,8 @@ function Ec(e) {
|
|
|
10421
10380
|
paneId: oa,
|
|
10422
10381
|
priority: Y.SYSTEM_YAXIS,
|
|
10423
10382
|
draw(t) {
|
|
10424
|
-
let { ctx: n, pane: r, dpr: i, yAxisCtx: a } = t, o = a || n, s =
|
|
10425
|
-
|
|
10383
|
+
let { ctx: n, pane: r, dpr: i, yAxisCtx: a } = t, o = a || n, s = yc(r.height, r.id === "main");
|
|
10384
|
+
wc(o, {
|
|
10426
10385
|
x: 0,
|
|
10427
10386
|
y: r.top,
|
|
10428
10387
|
width: e.axisWidth,
|
|
@@ -10439,19 +10398,19 @@ function Ec(e) {
|
|
|
10439
10398
|
}
|
|
10440
10399
|
//#endregion
|
|
10441
10400
|
//#region src/core/renderers/timeAxis.ts
|
|
10442
|
-
var
|
|
10443
|
-
function
|
|
10401
|
+
var Oc = Symbol("time-axis");
|
|
10402
|
+
function kc(e) {
|
|
10444
10403
|
return {
|
|
10445
10404
|
name: "timeAxis",
|
|
10446
10405
|
version: "1.0.0",
|
|
10447
10406
|
description: "时间轴渲染器",
|
|
10448
10407
|
debugName: "时间轴",
|
|
10449
|
-
paneId:
|
|
10408
|
+
paneId: Oc,
|
|
10450
10409
|
priority: Y.SYSTEM_XAXIS,
|
|
10451
10410
|
isSystem: !0,
|
|
10452
10411
|
draw(t) {
|
|
10453
10412
|
let { ctx: n, data: r, range: i, scrollLeft: a, kWidth: o, kGap: s, dpr: c, paneWidth: l } = t, u = r, d = n, f = l, p = e.height;
|
|
10454
|
-
d.setTransform(1, 0, 0, 1, 0, 0), d.scale(c, c), d.clearRect(0, 0, f, p),
|
|
10413
|
+
d.setTransform(1, 0, 0, 1, 0, 0), d.scale(c, c), d.clearRect(0, 0, f, p), Ec(d, {
|
|
10455
10414
|
x: 0,
|
|
10456
10415
|
y: 0,
|
|
10457
10416
|
width: f,
|
|
@@ -10469,7 +10428,7 @@ function Oc(e) {
|
|
|
10469
10428
|
let m = e.getCrosshair?.();
|
|
10470
10429
|
if (m && typeof m.index == "number") {
|
|
10471
10430
|
let e = u[m.index];
|
|
10472
|
-
e &&
|
|
10431
|
+
e && Tc(d, {
|
|
10473
10432
|
x: 0,
|
|
10474
10433
|
y: 0,
|
|
10475
10434
|
width: f,
|
|
@@ -10484,7 +10443,7 @@ function Oc(e) {
|
|
|
10484
10443
|
}
|
|
10485
10444
|
//#endregion
|
|
10486
10445
|
//#region src/core/renderers/crosshair.ts
|
|
10487
|
-
function
|
|
10446
|
+
function Ac(e) {
|
|
10488
10447
|
return {
|
|
10489
10448
|
name: "crosshair",
|
|
10490
10449
|
version: "1.0.0",
|
|
@@ -10497,9 +10456,9 @@ function kc(e) {
|
|
|
10497
10456
|
if (o.isDragging || !o.pos) return;
|
|
10498
10457
|
let { x: s, y: c } = o.pos, l = r.id === o.activePaneId, u = l ? c - r.top : -1;
|
|
10499
10458
|
n.save(), n.beginPath(), n.rect(0, 0, a, r.height), n.clip(), n.fillStyle = Ba.LINE;
|
|
10500
|
-
let d =
|
|
10459
|
+
let d = ys(s, 0, r.height, i);
|
|
10501
10460
|
if (d && n.fillRect(d.x, d.y, d.width, d.height), l && u >= 0) {
|
|
10502
|
-
let e =
|
|
10461
|
+
let e = bs(0, a, Math.min(u, r.height - 1 / i), i);
|
|
10503
10462
|
e && n.fillRect(e.x, e.y, e.width, e.height);
|
|
10504
10463
|
}
|
|
10505
10464
|
n.restore();
|
|
@@ -10507,42 +10466,8 @@ function kc(e) {
|
|
|
10507
10466
|
};
|
|
10508
10467
|
}
|
|
10509
10468
|
//#endregion
|
|
10510
|
-
//#region src/core/renderers/globalBorders.ts
|
|
10511
|
-
var Ac = Symbol("global-borders");
|
|
10512
|
-
function jc(e) {
|
|
10513
|
-
return {
|
|
10514
|
-
name: "globalBorders",
|
|
10515
|
-
version: "1.0.0",
|
|
10516
|
-
description: "全局边框渲染器",
|
|
10517
|
-
debugName: "边框",
|
|
10518
|
-
paneId: Ac,
|
|
10519
|
-
priority: Y.SYSTEM_BORDER,
|
|
10520
|
-
isSystem: !0,
|
|
10521
|
-
draw(t) {
|
|
10522
|
-
let { ctx: n, dpr: r, paneWidth: i, borderCtx: a } = t, o = e.getPaneInfos();
|
|
10523
|
-
if (o.length === 0) return;
|
|
10524
|
-
let s = a || n;
|
|
10525
|
-
s.save(), s.strokeStyle = ka.DARK, s.lineWidth = 3;
|
|
10526
|
-
let c = 1.5 / r, l = Q(c, r), u = Q(i - c, r), d = Infinity, f = -Infinity;
|
|
10527
|
-
for (let e of o) d = Math.min(d, e.top), f = Math.max(f, e.top + e.height);
|
|
10528
|
-
d = Number.isFinite(d) ? d : 0, f = Number.isFinite(f) ? f : 0, s.beginPath();
|
|
10529
|
-
let p = o[0], m = Q(p.top + c, r);
|
|
10530
|
-
s.moveTo(l, m), s.lineTo(u, m);
|
|
10531
|
-
let h = o[o.length - 1], g = Q(h.top + h.height - c, r);
|
|
10532
|
-
s.moveTo(l, g), s.lineTo(u, g);
|
|
10533
|
-
let _ = Q(d + c, r), v = Z(f - c, r);
|
|
10534
|
-
s.moveTo(l, _), s.lineTo(l, v), s.moveTo(u, _), s.lineTo(u, v);
|
|
10535
|
-
for (let e = 1; e < o.length; e++) {
|
|
10536
|
-
let t = o[e], n = Q(t.top, r);
|
|
10537
|
-
s.moveTo(l, n), s.lineTo(u, n);
|
|
10538
|
-
}
|
|
10539
|
-
s.stroke(), s.restore();
|
|
10540
|
-
}
|
|
10541
|
-
};
|
|
10542
|
-
}
|
|
10543
|
-
//#endregion
|
|
10544
10469
|
//#region src/core/renderers/paneTitle.ts
|
|
10545
|
-
function
|
|
10470
|
+
function jc(e) {
|
|
10546
10471
|
let t = { ...e };
|
|
10547
10472
|
return {
|
|
10548
10473
|
name: `paneTitle_${e.paneId}`,
|
|
@@ -10583,7 +10508,7 @@ function Mc(e) {
|
|
|
10583
10508
|
}
|
|
10584
10509
|
//#endregion
|
|
10585
10510
|
//#region src/components/KLineChart.vue?vue&type=script&setup=true&lang.ts
|
|
10586
|
-
var
|
|
10511
|
+
var Mc = { class: "chart-wrapper" }, Nc = 4, Pc = /* @__PURE__ */ po(/* @__PURE__ */ u({
|
|
10587
10512
|
__name: "KLineChart",
|
|
10588
10513
|
props: {
|
|
10589
10514
|
semanticConfig: {},
|
|
@@ -10592,7 +10517,7 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
10592
10517
|
yPaddingPx: { default: 0 },
|
|
10593
10518
|
minKWidth: { default: 2 },
|
|
10594
10519
|
maxKWidth: { default: 50 },
|
|
10595
|
-
rightAxisWidth: { default:
|
|
10520
|
+
rightAxisWidth: { default: 0 },
|
|
10596
10521
|
bottomAxisHeight: { default: 24 },
|
|
10597
10522
|
priceLabelWidth: { default: 60 }
|
|
10598
10523
|
},
|
|
@@ -10615,12 +10540,17 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
10615
10540
|
}), j = _(!1), M = _(null), N = _(null), ee = _({
|
|
10616
10541
|
x: 0,
|
|
10617
10542
|
y: 0
|
|
10618
|
-
}), te = r(() => {
|
|
10543
|
+
}), te = _(0), P = r(() => {
|
|
10619
10544
|
let e = M.value;
|
|
10620
10545
|
if (typeof e != "number") return null;
|
|
10546
|
+
te.value;
|
|
10621
10547
|
let t = C.value?.getData();
|
|
10622
10548
|
return t && e >= 0 && e < t.length ? t[e] : null;
|
|
10623
|
-
}),
|
|
10549
|
+
}), F = r(() => M.value), ne = r(() => ee.value), re = r(() => (te.value, C.value?.getData() ?? []));
|
|
10550
|
+
function ie() {
|
|
10551
|
+
te.value++;
|
|
10552
|
+
}
|
|
10553
|
+
let ae = null;
|
|
10624
10554
|
function I() {
|
|
10625
10555
|
let e = C.value?.interaction;
|
|
10626
10556
|
if (!e) {
|
|
@@ -10634,24 +10564,15 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
10634
10564
|
y: t.y
|
|
10635
10565
|
});
|
|
10636
10566
|
}
|
|
10637
|
-
function
|
|
10638
|
-
|
|
10567
|
+
function oe() {
|
|
10568
|
+
ae ||= requestAnimationFrame(() => {
|
|
10569
|
+
I(), ae = null;
|
|
10570
|
+
});
|
|
10639
10571
|
}
|
|
10640
|
-
function
|
|
10572
|
+
function L(e) {
|
|
10641
10573
|
j.value = !0, C.value?.interaction.onPointerDown(e), I();
|
|
10642
10574
|
}
|
|
10643
|
-
function
|
|
10644
|
-
let t = v.value;
|
|
10645
|
-
if (t) {
|
|
10646
|
-
let n = t.getBoundingClientRect();
|
|
10647
|
-
A.value = {
|
|
10648
|
-
x: e.clientX - n.left,
|
|
10649
|
-
y: e.clientY - n.top
|
|
10650
|
-
};
|
|
10651
|
-
}
|
|
10652
|
-
C.value?.interaction.onMouseMove(e), I();
|
|
10653
|
-
}
|
|
10654
|
-
function oe(e) {
|
|
10575
|
+
function se(e) {
|
|
10655
10576
|
let t = v.value;
|
|
10656
10577
|
if (t) {
|
|
10657
10578
|
let n = t.getBoundingClientRect();
|
|
@@ -10660,17 +10581,11 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
10660
10581
|
y: e.clientY - n.top
|
|
10661
10582
|
};
|
|
10662
10583
|
}
|
|
10663
|
-
C.value?.interaction.onPointerMove(e),
|
|
10664
|
-
}
|
|
10665
|
-
function L() {
|
|
10666
|
-
j.value = !1, C.value?.interaction.onMouseUp(), I();
|
|
10584
|
+
C.value?.interaction.onPointerMove(e), oe();
|
|
10667
10585
|
}
|
|
10668
|
-
function
|
|
10586
|
+
function ce(e) {
|
|
10669
10587
|
j.value = !1, C.value?.interaction.onPointerUp(e), I();
|
|
10670
10588
|
}
|
|
10671
|
-
function ce() {
|
|
10672
|
-
j.value = !1, C.value?.interaction.onMouseLeave(), M.value = null;
|
|
10673
|
-
}
|
|
10674
10589
|
function le(e) {
|
|
10675
10590
|
j.value = !1, C.value?.interaction.onPointerLeave(e), M.value = null;
|
|
10676
10591
|
}
|
|
@@ -10734,11 +10649,11 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
10734
10649
|
}
|
|
10735
10650
|
}
|
|
10736
10651
|
function pe(e = "VOLUME", t) {
|
|
10737
|
-
if (z.value.length >=
|
|
10652
|
+
if (z.value.length >= Nc) return !1;
|
|
10738
10653
|
let n = `sub_${e}`;
|
|
10739
10654
|
if (z.value.some((e) => e.id === n)) return !0;
|
|
10740
10655
|
if (!C.value?.createSubPane(e, t ?? fe(e))) return !1;
|
|
10741
|
-
let r =
|
|
10656
|
+
let r = jc({
|
|
10742
10657
|
paneId: n,
|
|
10743
10658
|
title: e,
|
|
10744
10659
|
getTitleInfo: () => ve(n)
|
|
@@ -10765,7 +10680,7 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
10765
10680
|
let e = C.value?.getSubPaneIndicators() ?? [];
|
|
10766
10681
|
z.value = [];
|
|
10767
10682
|
for (let t of e) {
|
|
10768
|
-
let e = `sub_${t}`, n =
|
|
10683
|
+
let e = `sub_${t}`, n = jc({
|
|
10769
10684
|
paneId: e,
|
|
10770
10685
|
title: t,
|
|
10771
10686
|
getTitleInfo: () => ve(e)
|
|
@@ -10784,7 +10699,7 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
10784
10699
|
if (!n) return;
|
|
10785
10700
|
let r = n.indicatorId;
|
|
10786
10701
|
C.value?.removeRenderer(n.paneTitleRendererName), C.value?.removeSubPane(r), C.value?.createSubPane(t, fe(t));
|
|
10787
|
-
let i = `sub_${t}`, a =
|
|
10702
|
+
let i = `sub_${t}`, a = jc({
|
|
10788
10703
|
paneId: i,
|
|
10789
10704
|
title: t,
|
|
10790
10705
|
getTitleInfo: () => ve(i)
|
|
@@ -10813,14 +10728,14 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
10813
10728
|
let i = N.value;
|
|
10814
10729
|
if (i === null) return null;
|
|
10815
10730
|
switch (t.indicatorId) {
|
|
10816
|
-
case "MACD": return
|
|
10817
|
-
case "RSI": return
|
|
10818
|
-
case "CCI": return
|
|
10819
|
-
case "STOCH": return
|
|
10820
|
-
case "MOM": return
|
|
10821
|
-
case "WMSR": return
|
|
10822
|
-
case "KST": return
|
|
10823
|
-
case "FASTK": return
|
|
10731
|
+
case "MACD": return Fs(n, i, r.fastPeriod ?? 12, r.slowPeriod ?? 26, r.signalPeriod ?? 9);
|
|
10732
|
+
case "RSI": return Rs(n, i, r.period1 ?? 6, r.period2 ?? 12, r.period3 ?? 24);
|
|
10733
|
+
case "CCI": return Hs(n, i, r.period ?? 14);
|
|
10734
|
+
case "STOCH": return Ks(n, i, r.n ?? 9, r.m ?? 3);
|
|
10735
|
+
case "MOM": return Xs(n, i, r.period ?? 10);
|
|
10736
|
+
case "WMSR": return ec(n, i, r.period ?? 14);
|
|
10737
|
+
case "KST": return oc(n, i, r.roc1 ?? 10, r.roc2 ?? 15, r.roc3 ?? 20, r.roc4 ?? 30, r.signalPeriod ?? 9);
|
|
10738
|
+
case "FASTK": return uc(n, i, r.period ?? 9);
|
|
10824
10739
|
default: return null;
|
|
10825
10740
|
}
|
|
10826
10741
|
}
|
|
@@ -10866,7 +10781,7 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
10866
10781
|
}), E();
|
|
10867
10782
|
}
|
|
10868
10783
|
let xe = r(() => {
|
|
10869
|
-
let e = T.value, t = window.devicePixelRatio || 1, { startXPx: r, unitPx: i } =
|
|
10784
|
+
let e = T.value, t = window.devicePixelRatio || 1, { startXPx: r, unitPx: i } = ss(b.value, x.value, t);
|
|
10870
10785
|
return (r + e * i) / t + (n.rightAxisWidth + n.priceLabelWidth);
|
|
10871
10786
|
});
|
|
10872
10787
|
function Se() {
|
|
@@ -10886,10 +10801,11 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
10886
10801
|
}), m(() => {
|
|
10887
10802
|
let e = v.value, t = u.value, r = c.value;
|
|
10888
10803
|
if (!e || !t || !r) return;
|
|
10889
|
-
|
|
10804
|
+
let i = (e) => {
|
|
10890
10805
|
C.value?.interaction.onWheel(e), I();
|
|
10891
|
-
}
|
|
10892
|
-
|
|
10806
|
+
};
|
|
10807
|
+
e.addEventListener("wheel", i, { passive: !1 });
|
|
10808
|
+
let a = new fc({
|
|
10893
10809
|
container: e,
|
|
10894
10810
|
canvasLayer: t,
|
|
10895
10811
|
xAxisCanvas: r
|
|
@@ -10908,22 +10824,22 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
10908
10824
|
}],
|
|
10909
10825
|
paneGap: 0
|
|
10910
10826
|
});
|
|
10911
|
-
|
|
10827
|
+
a.setOnZoomChange(async (e, t, n) => {
|
|
10912
10828
|
b.value = e, x.value = t, await d(), await new Promise((e) => requestAnimationFrame(() => e()));
|
|
10913
10829
|
let r = v.value;
|
|
10914
10830
|
if (!r) return;
|
|
10915
|
-
let
|
|
10916
|
-
r.scrollLeft = Math.min(Math.max(0, n),
|
|
10917
|
-
}),
|
|
10831
|
+
let i = Math.max(0, r.scrollWidth - r.clientWidth);
|
|
10832
|
+
r.scrollLeft = Math.min(Math.max(0, n), i), a.applyZoom(e, t);
|
|
10833
|
+
}), a.useRenderer(bc()), a.useRenderer(Sc()), a.useRenderer(Cs({
|
|
10918
10834
|
ma5: !0,
|
|
10919
10835
|
ma10: !0,
|
|
10920
10836
|
ma20: !0,
|
|
10921
10837
|
ma30: !0,
|
|
10922
10838
|
ma60: !0
|
|
10923
|
-
})),
|
|
10839
|
+
})), a.useRenderer(Ds()), a.setRendererEnabled("boll", !1), a.useRenderer(_c()), a.useRenderer(xc()), a.useRenderer(va()), a.useRenderer(Dc({
|
|
10924
10840
|
axisWidth: n.rightAxisWidth,
|
|
10925
10841
|
yPaddingPx: n.yPaddingPx
|
|
10926
|
-
})),
|
|
10842
|
+
})), a.useRenderer(Ts({
|
|
10927
10843
|
yPaddingPx: n.yPaddingPx,
|
|
10928
10844
|
showMA: {
|
|
10929
10845
|
ma5: !0,
|
|
@@ -10932,39 +10848,36 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
10932
10848
|
ma30: !0,
|
|
10933
10849
|
ma60: !0
|
|
10934
10850
|
}
|
|
10935
|
-
})),
|
|
10936
|
-
pos:
|
|
10937
|
-
activePaneId:
|
|
10938
|
-
isDragging:
|
|
10939
|
-
}) })),
|
|
10851
|
+
})), a.useRenderer(ks({ yPaddingPx: n.yPaddingPx })), a.setRendererEnabled("bollLegend", !1), a.useRenderer(Ac({ getCrosshairState: () => ({
|
|
10852
|
+
pos: a.interaction.crosshairPos,
|
|
10853
|
+
activePaneId: a.interaction.activePaneId,
|
|
10854
|
+
isDragging: a.interaction.isDraggingState()
|
|
10855
|
+
}) })), a.useRenderer(kc({
|
|
10940
10856
|
height: n.bottomAxisHeight,
|
|
10941
10857
|
getCrosshair: () => {
|
|
10942
|
-
let e =
|
|
10858
|
+
let e = a.interaction.crosshairPos, t = a.interaction.hoveredIndex;
|
|
10943
10859
|
return e && t !== null ? {
|
|
10944
10860
|
x: e.x,
|
|
10945
10861
|
index: t
|
|
10946
10862
|
} : null;
|
|
10947
10863
|
}
|
|
10948
|
-
})),
|
|
10949
|
-
top: e.getPane().top,
|
|
10950
|
-
height: e.getPane().height
|
|
10951
|
-
})) })), C.value = i, i.resize(), w.value = new Ui(i), w.value.on("config:error", (e) => {
|
|
10864
|
+
})), C.value = a, a.resize(), w.value = new Ui(a), w.value.on("config:error", (e) => {
|
|
10952
10865
|
console.error("Semantic config error:", e);
|
|
10953
10866
|
}), w.value.on("config:ready", () => {
|
|
10954
|
-
T.value =
|
|
10867
|
+
T.value = a.getData()?.length ?? 0, ie(), ge(), d(() => Se());
|
|
10955
10868
|
}), w.value.applyConfig(n.semanticConfig).then((e) => {
|
|
10956
10869
|
e && !e.success && console.error("Semantic config apply failed:", e.errors);
|
|
10957
|
-
}),
|
|
10870
|
+
}), a.interaction.setOnMarkerHover((e) => {
|
|
10958
10871
|
O.value = e, E();
|
|
10959
|
-
}),
|
|
10872
|
+
}), a.interaction.setOnCustomMarkerHover((e) => {
|
|
10960
10873
|
k.value = e, E();
|
|
10961
10874
|
});
|
|
10962
|
-
let
|
|
10963
|
-
|
|
10964
|
-
|
|
10875
|
+
let o = null, s = new ResizeObserver(() => {
|
|
10876
|
+
o && clearTimeout(o), o = setTimeout(() => {
|
|
10877
|
+
a.resize(), o = null;
|
|
10965
10878
|
}, 50);
|
|
10966
10879
|
});
|
|
10967
|
-
|
|
10880
|
+
s.observe(e), a.__resizeObserver = s, a.__resizeTimeout = o, a.__onWheel = i;
|
|
10968
10881
|
}), h(() => {
|
|
10969
10882
|
let e = C.value;
|
|
10970
10883
|
if (e) {
|
|
@@ -10986,18 +10899,14 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
10986
10899
|
let t = await w.value?.applyConfig(e);
|
|
10987
10900
|
t && !t.success && console.error("Semantic config apply failed:", t.errors);
|
|
10988
10901
|
}
|
|
10989
|
-
}, { deep: !0 }), (e, t) => (g(), o("div",
|
|
10902
|
+
}, { deep: !0 }), (e, t) => (g(), o("div", Mc, [s("div", {
|
|
10990
10903
|
class: f(["chart-container", { "is-dragging": j.value }]),
|
|
10991
10904
|
ref_key: "containerRef",
|
|
10992
10905
|
ref: v,
|
|
10993
10906
|
onScrollPassive: ue,
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
onMouseleave: ce,
|
|
10998
|
-
onPointerdown: ie,
|
|
10999
|
-
onPointermove: oe,
|
|
11000
|
-
onPointerup: se,
|
|
10907
|
+
onPointerdown: L,
|
|
10908
|
+
onPointermove: se,
|
|
10909
|
+
onPointerup: ce,
|
|
11001
10910
|
onPointerleave: le
|
|
11002
10911
|
}, [s("div", {
|
|
11003
10912
|
class: "scroll-content",
|
|
@@ -11008,16 +10917,23 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
11008
10917
|
ref: u
|
|
11009
10918
|
}, [
|
|
11010
10919
|
s("canvas", {
|
|
11011
|
-
class: "x-axis-canvas",
|
|
10920
|
+
class: "x-axis-canvas bottom-axis",
|
|
11012
10921
|
ref_key: "xAxisCanvasRef",
|
|
11013
10922
|
ref: c
|
|
11014
10923
|
}, null, 512),
|
|
11015
|
-
|
|
10924
|
+
s("div", {
|
|
10925
|
+
class: "x-axis-corner right-axis-corner",
|
|
10926
|
+
style: p({
|
|
10927
|
+
height: n.bottomAxisHeight + "px",
|
|
10928
|
+
width: n.rightAxisWidth + n.priceLabelWidth + "px"
|
|
10929
|
+
})
|
|
10930
|
+
}, null, 4),
|
|
10931
|
+
P.value ? (g(), i(mo, {
|
|
11016
10932
|
key: 0,
|
|
11017
|
-
k:
|
|
11018
|
-
index:
|
|
11019
|
-
data:
|
|
11020
|
-
pos:
|
|
10933
|
+
k: P.value,
|
|
10934
|
+
index: F.value,
|
|
10935
|
+
data: re.value,
|
|
10936
|
+
pos: ne.value,
|
|
11021
10937
|
"set-el": D
|
|
11022
10938
|
}, null, 8, [
|
|
11023
10939
|
"k",
|
|
@@ -11030,15 +10946,15 @@ var Nc = { class: "chart-wrapper" }, Pc = 4, Fc = /* @__PURE__ */ po(/* @__PURE_
|
|
|
11030
10946
|
marker: O.value || k.value,
|
|
11031
10947
|
pos: A.value
|
|
11032
10948
|
}, null, 8, ["marker", "pos"])) : a("", !0)
|
|
11033
|
-
], 512)], 4)], 34), l(
|
|
10949
|
+
], 512)], 4)], 34), l(as, {
|
|
11034
10950
|
"active-indicators": R.value,
|
|
11035
10951
|
"indicator-params": de.value,
|
|
11036
10952
|
onToggle: ye,
|
|
11037
10953
|
onUpdateParams: be
|
|
11038
10954
|
}, null, 8, ["active-indicators", "indicator-params"])]));
|
|
11039
10955
|
}
|
|
11040
|
-
}), [["__scopeId", "data-v-
|
|
11041
|
-
e.component("KLineChart",
|
|
10956
|
+
}), [["__scopeId", "data-v-cb99e513"]]), Fc = { install(e) {
|
|
10957
|
+
e.component("KLineChart", Pc);
|
|
11042
10958
|
} };
|
|
11043
10959
|
//#endregion
|
|
11044
|
-
export { la as ConfigManager, F as EventBus, oa as GLOBAL_PANE_ID, ca as HookSystem,
|
|
10960
|
+
export { la as ConfigManager, F as EventBus, oa as GLOBAL_PANE_ID, ca as HookSystem, Pc as KLineChart, Fc as KMapPlugin, ua as PluginHostImpl, sa as PluginRegistry, ia as PluginState, Y as RENDERER_PRIORITY, pa as RendererPluginManager, da as createPluginHost, aa as wrapPaneInfo };
|