@hybridcore/ui 1.6.30 → 1.6.31
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/components/charts/_common/utils.js +53 -31
- package/dist/components/charts/candlestick/logic.js +83 -86
- package/dist/components/charts/column-line-mix/logic.js +66 -70
- package/dist/components/charts/donut-chart/logic.js +65 -64
- package/dist/components/charts/drill-down-treemap/logic.js +69 -69
- package/dist/components/charts/drill-down-voronoi-treemap/logic.js +75 -75
- package/dist/components/charts/forecast-cone/logic.js +110 -114
- package/dist/components/charts/heatmap/logic.js +117 -119
- package/dist/components/charts/highlighting-line-data/logic.js +65 -64
- package/dist/components/charts/histogram/logic.js +66 -70
- package/dist/components/charts/line/logic.js +95 -99
- package/dist/components/charts/logaritmic-scale/logic.js +79 -83
- package/dist/components/charts/multiple-value-axes/logic.js +65 -69
- package/dist/components/charts/nested-pie/logic.js +49 -53
- package/dist/components/charts/packed-circles/logic.js +139 -139
- package/dist/components/charts/pie-chart/logic.js +59 -59
- package/dist/components/charts/stacked-area-radar/logic.js +95 -97
- package/dist/components/charts/stacked-column-chart/logic.js +69 -69
- package/dist/components/charts/xy-chart/logic.js +82 -86
- package/dist/components/metric-card/MetricChart.js +6 -4
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { buildAmNumberFormat as c, formatDateValue as
|
|
2
|
-
import { C as
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
1
|
+
import { buildAmNumberFormat as c, formatDateValue as s, formatPercent as p } from "./format.js";
|
|
2
|
+
import { C as m } from "../../../ColorSet-cyPmWGwh.js";
|
|
3
|
+
import { c as o } from "../../../Entity-BJCuhdq_.js";
|
|
4
|
+
const i = [
|
|
5
5
|
"#294D94",
|
|
6
6
|
"#375F97",
|
|
7
7
|
"#44729C",
|
|
@@ -12,49 +12,71 @@ const b = [
|
|
|
12
12
|
"#9FCFBF",
|
|
13
13
|
"#B9E1C9",
|
|
14
14
|
"#D6F1D5"
|
|
15
|
-
],
|
|
16
|
-
colors: e.map((r) =>
|
|
15
|
+
], B = (t, e = i) => m.new(t, {
|
|
16
|
+
colors: e.map((r) => o(r)),
|
|
17
17
|
reuse: !0
|
|
18
|
-
}),
|
|
18
|
+
}), d = [
|
|
19
19
|
{ number: 1e3, suffix: "K" },
|
|
20
20
|
{ number: 1e6, suffix: "M" },
|
|
21
21
|
{ number: 1e9, suffix: "B" },
|
|
22
22
|
{ number: 1e12, suffix: "T" }
|
|
23
|
-
],
|
|
23
|
+
], f = (t, e) => {
|
|
24
24
|
const r = c(e) ?? "#,###.##";
|
|
25
|
-
t.numberFormatter.set("numericFields", void 0), t.numberFormatter.set("numberFormat", r), (e == null ? void 0 : e.notation) === "compact" && t.numberFormatter.set("bigNumberPrefixes",
|
|
26
|
-
},
|
|
25
|
+
t.numberFormatter.set("numericFields", void 0), t.numberFormatter.set("numberFormat", r), (e == null ? void 0 : e.notation) === "compact" && t.numberFormatter.set("bigNumberPrefixes", d);
|
|
26
|
+
}, v = (t, e) => {
|
|
27
27
|
e.type !== "date" || !e.dateFormat || t.get("renderer").labels.template.adapters.add(
|
|
28
28
|
"text",
|
|
29
29
|
(r, a) => {
|
|
30
|
-
var
|
|
31
|
-
const
|
|
32
|
-
return typeof
|
|
30
|
+
var l;
|
|
31
|
+
const n = (l = a == null ? void 0 : a.dataItem) == null ? void 0 : l.get("value");
|
|
32
|
+
return typeof n == "number" ? s(n, e.dateFormat, e.value) : r;
|
|
33
33
|
}
|
|
34
34
|
);
|
|
35
|
-
},
|
|
35
|
+
}, u = (t) => {
|
|
36
36
|
const { percentDecimals: e, percent: r } = t, a = e <= 0 ? "0" : `0.${"0".repeat(e)}`;
|
|
37
|
-
return r === void 0 ? `{valuePercentTotal.formatNumber('${a}')}%` : `${
|
|
38
|
-
},
|
|
39
|
-
const { percentDecimals: e, showValueText: r, percent: a } = t,
|
|
40
|
-
return r ? `{category}: ${
|
|
41
|
-
},
|
|
37
|
+
return r === void 0 ? `{valuePercentTotal.formatNumber('${a}')}%` : `${p(r, e)}%`;
|
|
38
|
+
}, D = (t) => {
|
|
39
|
+
const { percentDecimals: e, showValueText: r, percent: a } = t, n = u({ percentDecimals: e, percent: a });
|
|
40
|
+
return r ? `{category}: ${n} ({value})` : `{category}: ${n}`;
|
|
41
|
+
}, b = (t) => {
|
|
42
42
|
var r;
|
|
43
43
|
const e = (r = t == null ? void 0 : t.dataItem) == null ? void 0 : r.get("valuePercentTotal");
|
|
44
44
|
return typeof e == "number" ? e : void 0;
|
|
45
|
-
},
|
|
46
|
-
t.valueLabels.template.set(
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
}, T = (t, e) => {
|
|
46
|
+
t.valueLabels.template.set(
|
|
47
|
+
"text",
|
|
48
|
+
u({ percentDecimals: e })
|
|
49
|
+
), t.valueLabels.template.adapters.add("text", (r, a) => {
|
|
50
|
+
const n = b(a);
|
|
51
|
+
return n === void 0 ? r : u({ percentDecimals: e, percent: n });
|
|
52
|
+
});
|
|
53
|
+
}, A = (t, e, r) => {
|
|
54
|
+
const { primary: a } = e.palette;
|
|
55
|
+
t.interfaceColors.setAll({
|
|
56
|
+
text: o(e.palette.text.primary),
|
|
57
|
+
grid: o(e.palette.divider),
|
|
58
|
+
stroke: o(e.palette.divider),
|
|
59
|
+
primaryButton: o(a.main),
|
|
60
|
+
primaryButtonHover: o(a.dark),
|
|
61
|
+
primaryButtonDown: o(a.dark),
|
|
62
|
+
primaryButtonActive: o(a.dark),
|
|
63
|
+
// The default theme strokes button backgrounds with this; matching the fill
|
|
64
|
+
// keeps the amCharts white ring off a brand-colored button.
|
|
65
|
+
primaryButtonStroke: o(a.main),
|
|
66
|
+
primaryButtonText: o(a.contrastText),
|
|
67
|
+
primaryButtonDisabled: o(e.palette.action.disabledBackground),
|
|
68
|
+
primaryButtonTextDisabled: o(e.palette.action.disabled),
|
|
69
|
+
...r
|
|
49
70
|
});
|
|
50
71
|
};
|
|
51
72
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
A as
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
73
|
+
i as DEFAULT_VIRIDIS_COOL,
|
|
74
|
+
v as applyDateAxisLabelFormat,
|
|
75
|
+
A as applyInterfaceColors,
|
|
76
|
+
T as applyLegendPercentFormat,
|
|
77
|
+
f as applyValueFormat,
|
|
78
|
+
u as buildPercentText,
|
|
79
|
+
D as buildSliceText,
|
|
80
|
+
B as colorSetFromPalette,
|
|
81
|
+
b as readSharePercent
|
|
60
82
|
};
|
|
@@ -3,15 +3,16 @@ import { useTheme as he, useThemeProps as ce } from "@mui/material";
|
|
|
3
3
|
import ue from "lodash";
|
|
4
4
|
import { useRef as N, useLayoutEffect as ge, useEffect as B } from "react";
|
|
5
5
|
import { getTooltipDateFormat as pe, attachCursorTooltip as me } from "../_common/tooltip.js";
|
|
6
|
-
import {
|
|
7
|
-
import { X as
|
|
8
|
-
import { X as
|
|
9
|
-
import { A as xe, a as
|
|
6
|
+
import { applyInterfaceColors as de } from "../_common/utils.js";
|
|
7
|
+
import { X as fe, V as U } from "../../../AxisRenderer-BCQoUJw6.js";
|
|
8
|
+
import { X as we } from "../../../XYCursor-CVUSpqb9.js";
|
|
9
|
+
import { A as xe, a as Z } from "../../../AxisRendererY-AXWvGU6r.js";
|
|
10
|
+
import { m as q, e as J, c as f, p as Ye } from "../../../Entity-BJCuhdq_.js";
|
|
10
11
|
import { C as G } from "../../../ColumnSeries-CtRTsn-E.js";
|
|
11
12
|
import { R as te } from "../../../RoundedRectangle-BKLX1LKM.js";
|
|
12
13
|
import { a as K, b as Q } from "../../../Tooltip-vyZRZWih.js";
|
|
13
|
-
import { D as ee, G as
|
|
14
|
-
import { D as
|
|
14
|
+
import { D as ee, G as ye } from "../../../GaplessDateAxis-B2g2jgSG.js";
|
|
15
|
+
import { D as Xe } from "../../../DateAxis-DEXKps1S.js";
|
|
15
16
|
class T extends te {
|
|
16
17
|
_beforeChanged() {
|
|
17
18
|
super._beforeChanged(), (this.isDirty("lowX0") || this.isDirty("lowY0") || this.isDirty("lowX1") || this.isDirty("lowY1") || this.isDirty("highX0") || this.isDirty("highX1") || this.isDirty("highY0") || this.isDirty("highY1")) && (this._clear = !0);
|
|
@@ -43,7 +44,7 @@ class V extends G {
|
|
|
43
44
|
value: this.addDisposer(new K(Q.new({
|
|
44
45
|
themeTags: ["autocolor"]
|
|
45
46
|
}), () => T._new(this._root, {
|
|
46
|
-
themeTags:
|
|
47
|
+
themeTags: q(this.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
|
|
47
48
|
}, [this.columns.template])))
|
|
48
49
|
});
|
|
49
50
|
}
|
|
@@ -51,55 +52,55 @@ class V extends G {
|
|
|
51
52
|
* @ignore
|
|
52
53
|
*/
|
|
53
54
|
makeColumn(e, s) {
|
|
54
|
-
const
|
|
55
|
-
return this.get("turboMode") ?
|
|
55
|
+
const p = s.make();
|
|
56
|
+
return this.get("turboMode") ? p.virtualParent = this.chart : this.mainContainer.children.push(p), p._setDataItem(e), s.push(p), p;
|
|
56
57
|
}
|
|
57
|
-
_updateGraphics(e, s,
|
|
58
|
-
super._updateGraphics(e, s,
|
|
59
|
-
const
|
|
60
|
-
let Y = this.get("vcy", 1), y = this.get("vcx", 1), h, c, r, i,
|
|
61
|
-
if (
|
|
58
|
+
_updateGraphics(e, s, p) {
|
|
59
|
+
super._updateGraphics(e, s, p);
|
|
60
|
+
const w = this.getRaw("xAxis"), x = this.getRaw("yAxis");
|
|
61
|
+
let Y = this.get("vcy", 1), y = this.get("vcx", 1), h, c, r, i, m, u, g, d, o = this.get("locationX", e.get("locationX", 0.5)), l = this.get("locationY", e.get("locationY", 0.5)), D = this.get("openLocationX", e.get("openLocationX", o)), a = this.get("openLocationY", e.get("openLocationY", l)), _;
|
|
62
|
+
if (p == 0) {
|
|
62
63
|
let v = x.getDataItemPositionY(e, this._yOpenField, 1, Y), t = x.getDataItemPositionY(e, this._yField, 1, Y);
|
|
63
|
-
i = x.getDataItemPositionY(e, this._yLowField, 1, Y),
|
|
64
|
-
let n = this._aLocationX0 + D - 0.5,
|
|
65
|
-
h =
|
|
64
|
+
i = x.getDataItemPositionY(e, this._yLowField, 1, Y), d = x.getDataItemPositionY(e, this._yHighField, 1, Y), g = Math.max(v, t), r = Math.min(v, t);
|
|
65
|
+
let n = this._aLocationX0 + D - 0.5, A = this._aLocationX1 + o - 0.5;
|
|
66
|
+
h = w.getDataItemPositionX(e, this._xField, n + (A - n) / 2, y), c = h, m = h, u = h, _ = "vertical";
|
|
66
67
|
} else {
|
|
67
|
-
let v =
|
|
68
|
-
c =
|
|
69
|
-
let n = this._aLocationY0 + a - 0.5,
|
|
70
|
-
r = x.getDataItemPositionY(e, this._yField, n + (
|
|
68
|
+
let v = w.getDataItemPositionX(e, this._xOpenField, 1, y), t = w.getDataItemPositionX(e, this._xField, 1, y);
|
|
69
|
+
c = w.getDataItemPositionX(e, this._xLowField, 1, y), u = w.getDataItemPositionX(e, this._xHighField, 1, y), m = Math.max(v, t), h = Math.min(v, t);
|
|
70
|
+
let n = this._aLocationY0 + a - 0.5, A = this._aLocationY1 + l - 0.5;
|
|
71
|
+
r = x.getDataItemPositionY(e, this._yField, n + (A - n) / 2, Y), i = r, g = r, d = r, _ = "horizontal";
|
|
71
72
|
}
|
|
72
|
-
this._updateCandleGraphics(e, h, c, r, i,
|
|
73
|
+
this._updateCandleGraphics(e, h, c, r, i, m, u, g, d, _);
|
|
73
74
|
}
|
|
74
|
-
_updateCandleGraphics(e, s,
|
|
75
|
+
_updateCandleGraphics(e, s, p, w, x, Y, y, h, c, r) {
|
|
75
76
|
let i = e.get("graphics");
|
|
76
77
|
if (i) {
|
|
77
|
-
let
|
|
78
|
+
let m = this.getPoint(s, w), u = this.getPoint(p, x), g = this.getPoint(Y, h), d = this.getPoint(y, c);
|
|
78
79
|
if (this.get("turboMode")) {
|
|
79
80
|
const o = this.allColumnsData[this.allColumnsData.length - 1];
|
|
80
|
-
o.lowX0 =
|
|
81
|
+
o.lowX0 = m.x, o.lowY0 = m.y, o.lowX1 = u.x, o.lowY1 = u.y, o.highX0 = g.x, o.highY0 = g.y, o.highX1 = d.x, o.highY1 = d.y;
|
|
81
82
|
} else {
|
|
82
83
|
let o = i.x(), l = i.y();
|
|
83
|
-
i.set("lowX0",
|
|
84
|
+
i.set("lowX0", m.x - o), i.set("lowY0", m.y - l), i.set("lowX1", u.x - o), i.set("lowY1", u.y - l), i.set("highX0", g.x - o), i.set("highY0", g.y - l), i.set("highX1", d.x - o), i.set("highY1", d.y - l), i.set("orientation", r);
|
|
84
85
|
let D = e.get("rangeGraphics");
|
|
85
|
-
D &&
|
|
86
|
-
a.set("lowX0",
|
|
86
|
+
D && J(D, (a) => {
|
|
87
|
+
a.set("lowX0", m.x - o), a.set("lowY0", m.y - l), a.set("lowX1", u.x - o), a.set("lowY1", u.y - l), a.set("highX0", g.x - o), a.set("highY0", g.y - l), a.set("highX1", d.x - o), a.set("highY1", d.y - l), a.set("orientation", r);
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
_afterColumnsDraw() {
|
|
92
93
|
this.get("turboMode") && this.allColumns.set("draw", (e) => {
|
|
93
|
-
e.clear(),
|
|
94
|
+
e.clear(), J(this.allColumnsData, (s) => {
|
|
94
95
|
e.beginPath();
|
|
95
|
-
const
|
|
96
|
-
e.beginFill(h, i), e.beginPath(), e.lineStyle(c, y, r), e.drawRect(x, Y,
|
|
96
|
+
const p = s.width, w = s.height, x = s.x, Y = s.y, y = s.stroke, h = s.fill, c = s.strokeWidth, r = s.strokeOpacity, i = s.fillOpacity, m = s.lowX0, u = s.lowY0, g = s.lowX1, d = s.lowY1, o = s.highX0, l = s.highY0, D = s.highX1, a = s.highY1;
|
|
97
|
+
e.beginFill(h, i), e.beginPath(), e.lineStyle(c, y, r), e.drawRect(x, Y, p, w), e.moveTo(m, u), e.lineTo(g, d), e.moveTo(o, l), e.lineTo(D, a), e.endStroke(), e.endFill();
|
|
97
98
|
});
|
|
98
99
|
});
|
|
99
100
|
}
|
|
100
101
|
_processAxisRange(e) {
|
|
101
102
|
super._processAxisRange(e), e.columns = new K(Q.new({}), () => T._new(this._root, {
|
|
102
|
-
themeTags:
|
|
103
|
+
themeTags: q(e.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
|
|
103
104
|
}, [this.columns.template, e.columns.template]));
|
|
104
105
|
}
|
|
105
106
|
}
|
|
@@ -115,13 +116,13 @@ Object.defineProperty(V, "classNames", {
|
|
|
115
116
|
writable: !0,
|
|
116
117
|
value: G.classNames.concat([V.className])
|
|
117
118
|
});
|
|
118
|
-
const
|
|
119
|
+
const Ne = ($) => {
|
|
119
120
|
const e = he(), s = ce({
|
|
120
121
|
props: $,
|
|
121
122
|
name: "HCCandlestickChart"
|
|
122
123
|
}), {
|
|
123
|
-
data:
|
|
124
|
-
seriesName:
|
|
124
|
+
data: p,
|
|
125
|
+
seriesName: w,
|
|
125
126
|
height: x = "100%",
|
|
126
127
|
width: Y = "100%",
|
|
127
128
|
chartId: y = "candlestick-chart",
|
|
@@ -129,12 +130,12 @@ const Ve = ($) => {
|
|
|
129
130
|
risingColor: c = e.palette.success.main,
|
|
130
131
|
fallingColor: r = e.palette.error.main,
|
|
131
132
|
loading: i = !1,
|
|
132
|
-
emptyMessage:
|
|
133
|
+
emptyMessage: m = "No data available",
|
|
133
134
|
baseInterval: u,
|
|
134
135
|
skipEmptyDates: g = !1,
|
|
135
|
-
sx:
|
|
136
|
+
sx: d,
|
|
136
137
|
...o
|
|
137
|
-
} = s, l = ue.orderBy(
|
|
138
|
+
} = s, l = ue.orderBy(p, ["date"]), D = {
|
|
138
139
|
...s,
|
|
139
140
|
height: x,
|
|
140
141
|
width: Y,
|
|
@@ -143,7 +144,7 @@ const Ve = ($) => {
|
|
|
143
144
|
risingColor: c,
|
|
144
145
|
fallingColor: r,
|
|
145
146
|
loading: i,
|
|
146
|
-
emptyMessage:
|
|
147
|
+
emptyMessage: m,
|
|
147
148
|
baseInterval: u,
|
|
148
149
|
skipEmptyDates: g
|
|
149
150
|
}, a = N(null), _ = N(null), v = N(null);
|
|
@@ -151,13 +152,9 @@ const Ve = ($) => {
|
|
|
151
152
|
var j, H, E;
|
|
152
153
|
if (!v.current) return;
|
|
153
154
|
const t = le.new(v.current);
|
|
154
|
-
_.current = t, t.setThemes([ne.new(t)]), t
|
|
155
|
-
text: p(e.palette.text.primary),
|
|
156
|
-
grid: p(e.palette.divider),
|
|
157
|
-
stroke: p(e.palette.divider)
|
|
158
|
-
});
|
|
155
|
+
_.current = t, t.setThemes([ne.new(t)]), de(t, e);
|
|
159
156
|
const n = t.container.children.push(
|
|
160
|
-
|
|
157
|
+
fe.new(t, {
|
|
161
158
|
panX: !0,
|
|
162
159
|
panY: !0,
|
|
163
160
|
wheelX: "none",
|
|
@@ -169,12 +166,12 @@ const Ve = ($) => {
|
|
|
169
166
|
);
|
|
170
167
|
a.current = n, n.set(
|
|
171
168
|
"cursor",
|
|
172
|
-
|
|
169
|
+
we.new(t, {
|
|
173
170
|
behavior: "zoomX"
|
|
174
171
|
})
|
|
175
172
|
).lineY.set("visible", !1);
|
|
176
|
-
const
|
|
177
|
-
|
|
173
|
+
const A = g ? ye : Xe, L = n.xAxes.push(
|
|
174
|
+
A.new(t, {
|
|
178
175
|
maxDeviation: 0.3,
|
|
179
176
|
groupData: !0,
|
|
180
177
|
baseInterval: u || { timeUnit: "day", count: 1 },
|
|
@@ -183,22 +180,22 @@ const Ve = ($) => {
|
|
|
183
180
|
})
|
|
184
181
|
})
|
|
185
182
|
), S = n.yAxes.push(
|
|
186
|
-
|
|
187
|
-
renderer:
|
|
183
|
+
U.new(t, {
|
|
184
|
+
renderer: Z.new(t, {})
|
|
188
185
|
})
|
|
189
186
|
);
|
|
190
187
|
(j = L.get("renderer")) == null || j.grid.template.setAll({
|
|
191
|
-
stroke:
|
|
188
|
+
stroke: f(e.palette.divider),
|
|
192
189
|
strokeOpacity: 1
|
|
193
190
|
}), (H = L.get("renderer")) == null || H.labels.template.setAll({
|
|
194
191
|
paddingTop: 12
|
|
195
192
|
}), (E = S.get("renderer")) == null || E.grid.template.setAll({
|
|
196
|
-
stroke:
|
|
193
|
+
stroke: f(e.palette.divider),
|
|
197
194
|
strokeOpacity: 1
|
|
198
195
|
});
|
|
199
|
-
const
|
|
196
|
+
const C = n.series.push(
|
|
200
197
|
V.new(t, {
|
|
201
|
-
name:
|
|
198
|
+
name: w || "Price",
|
|
202
199
|
xAxis: L,
|
|
203
200
|
yAxis: S,
|
|
204
201
|
valueXField: "date",
|
|
@@ -208,20 +205,20 @@ const Ve = ($) => {
|
|
|
208
205
|
valueYField: "close"
|
|
209
206
|
})
|
|
210
207
|
);
|
|
211
|
-
|
|
212
|
-
fill:
|
|
213
|
-
stroke:
|
|
214
|
-
}),
|
|
215
|
-
fill:
|
|
216
|
-
stroke:
|
|
217
|
-
}),
|
|
208
|
+
C.columns.template.states.create("riseFromPrevious", {
|
|
209
|
+
fill: f(c),
|
|
210
|
+
stroke: f(c)
|
|
211
|
+
}), C.columns.template.states.create("dropFromPrevious", {
|
|
212
|
+
fill: f(r),
|
|
213
|
+
stroke: f(r)
|
|
214
|
+
}), C.data.processor = ee.new(t, {
|
|
218
215
|
dateFormat: "i",
|
|
219
216
|
dateFields: ["date"]
|
|
220
217
|
});
|
|
221
218
|
let F = null, M = null;
|
|
222
219
|
h && (M = n.yAxes.push(
|
|
223
|
-
|
|
224
|
-
renderer:
|
|
220
|
+
U.new(t, {
|
|
221
|
+
renderer: Z.new(t, {
|
|
225
222
|
opposite: !0
|
|
226
223
|
}),
|
|
227
224
|
numberFormat: "#a"
|
|
@@ -233,16 +230,16 @@ const Ve = ($) => {
|
|
|
233
230
|
yAxis: M,
|
|
234
231
|
valueYField: "volume",
|
|
235
232
|
valueXField: "date",
|
|
236
|
-
fill:
|
|
237
|
-
stroke:
|
|
233
|
+
fill: f("#2962ff"),
|
|
234
|
+
stroke: f("#2962ff"),
|
|
238
235
|
opacity: 0.6
|
|
239
236
|
})
|
|
240
237
|
), F.columns.template.setAll({
|
|
241
|
-
width:
|
|
238
|
+
width: Ye(80)
|
|
242
239
|
}), F.data.processor = ee.new(t, {
|
|
243
240
|
dateFormat: "i",
|
|
244
241
|
dateFields: ["date"]
|
|
245
|
-
})),
|
|
242
|
+
})), C.data.setAll(l), h && F && F.data.setAll(l);
|
|
246
243
|
const se = pe(u);
|
|
247
244
|
return me({
|
|
248
245
|
root: t,
|
|
@@ -250,31 +247,31 @@ const Ve = ($) => {
|
|
|
250
247
|
theme: e,
|
|
251
248
|
getText: () => {
|
|
252
249
|
var W;
|
|
253
|
-
const b =
|
|
250
|
+
const b = C.get("tooltipDataItem"), O = b == null ? void 0 : b.get("valueY");
|
|
254
251
|
if (b === void 0 || O === void 0 || O === null)
|
|
255
252
|
return "";
|
|
256
|
-
const
|
|
257
|
-
`Open: ${P
|
|
258
|
-
`High: ${
|
|
259
|
-
`Low: ${
|
|
260
|
-
`Close: ${
|
|
253
|
+
const P = b.get("openValueY"), oe = b.get("highValueY"), ie = b.get("lowValueY"), I = b.get("valueX"), z = typeof I == "number" ? t.dateFormatter.format(new Date(I), se) : "", k = (X) => X == null ? "—" : t.numberFormatter.format(X), R = [
|
|
254
|
+
`Open: ${k(P)}`,
|
|
255
|
+
`High: ${k(oe)}`,
|
|
256
|
+
`Low: ${k(ie)}`,
|
|
257
|
+
`Close: ${k(O)}`
|
|
261
258
|
];
|
|
262
|
-
if (typeof
|
|
263
|
-
const X = (O -
|
|
259
|
+
if (typeof P == "number" && P !== 0) {
|
|
260
|
+
const X = (O - P) / P * 100, re = f(X >= 0 ? c : r), ae = X > 0 ? "+" : "";
|
|
264
261
|
R.push(
|
|
265
262
|
`Change: [${re.toCSSHex()}]${ae}${X.toFixed(2)}%[/]`
|
|
266
263
|
);
|
|
267
264
|
}
|
|
268
265
|
if (h && F) {
|
|
269
266
|
const X = (W = F.get("tooltipDataItem")) == null ? void 0 : W.get("valueY");
|
|
270
|
-
X != null && R.push(`Volume: ${
|
|
267
|
+
X != null && R.push(`Volume: ${k(X)}`);
|
|
271
268
|
}
|
|
272
269
|
return z ? `[bold]${z}[/]
|
|
273
270
|
${R.join(`
|
|
274
271
|
`)}` : R.join(`
|
|
275
272
|
`);
|
|
276
273
|
}
|
|
277
|
-
}), n.appear(1e3),
|
|
274
|
+
}), n.appear(1e3), C.appear(1e3), () => {
|
|
278
275
|
t.dispose();
|
|
279
276
|
};
|
|
280
277
|
}, [e.palette.mode, g]), B(() => {
|
|
@@ -288,16 +285,16 @@ ${R.join(`
|
|
|
288
285
|
if (!a.current) return;
|
|
289
286
|
const t = a.current.series.getIndex(0);
|
|
290
287
|
t && (t.columns.template.states.create("riseFromPrevious", {
|
|
291
|
-
fill:
|
|
292
|
-
stroke:
|
|
288
|
+
fill: f(c),
|
|
289
|
+
stroke: f(c)
|
|
293
290
|
}), t.columns.template.states.create("dropFromPrevious", {
|
|
294
|
-
fill:
|
|
295
|
-
stroke:
|
|
291
|
+
fill: f(r),
|
|
292
|
+
stroke: f(r)
|
|
296
293
|
}));
|
|
297
294
|
}, [c, r]), {
|
|
298
295
|
chartDivRef: v,
|
|
299
|
-
data:
|
|
300
|
-
seriesName:
|
|
296
|
+
data: p,
|
|
297
|
+
seriesName: w,
|
|
301
298
|
height: x,
|
|
302
299
|
width: Y,
|
|
303
300
|
chartId: y,
|
|
@@ -305,12 +302,12 @@ ${R.join(`
|
|
|
305
302
|
risingColor: c,
|
|
306
303
|
fallingColor: r,
|
|
307
304
|
loading: i,
|
|
308
|
-
emptyMessage:
|
|
309
|
-
sx:
|
|
305
|
+
emptyMessage: m,
|
|
306
|
+
sx: d,
|
|
310
307
|
other: o,
|
|
311
308
|
ownerState: D
|
|
312
309
|
};
|
|
313
310
|
};
|
|
314
311
|
export {
|
|
315
|
-
|
|
312
|
+
Ne as useCandlestickChartLogic
|
|
316
313
|
};
|