@hybridcore/ui 1.6.8 → 1.6.10
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/AnimatedTheme-ktdO3Bel.js +7708 -0
- package/dist/{AxisRenderer-DTyLLA6c.js → AxisRenderer-BCQoUJw6.js} +51 -49
- package/dist/{AxisRendererY-C_ItLPNV.js → AxisRendererY-AXWvGU6r.js} +3 -3
- package/dist/{Bullet-DVczI2TD.js → Bullet-Djj7Vs9T.js} +1 -1
- package/dist/{Button-CcsPEIDh.js → Button-BLY4PVJC.js} +3 -3
- package/dist/{CategoryAxis-CwnfaGc8.js → CategoryAxis-B6NqW8qd.js} +3 -3
- package/dist/{Circle-Cy5s-pVc.js → Circle-BnfBNKBD.js} +1 -1
- package/dist/ColorSet-cyPmWGwh.js +77 -0
- package/dist/{ColumnSeries-CjgdJ2QL.js → ColumnSeries-CtRTsn-E.js} +4 -4
- package/dist/{DateAxis-YX3QNIB-.js → DateAxis-DEXKps1S.js} +8 -7
- package/dist/{ColorSet-C7vpNXhM.js → Entity-BJCuhdq_.js} +638 -712
- package/dist/GaplessDateAxis-B2g2jgSG.js +376 -0
- package/dist/{Hierarchy-Bihj0S61.js → Hierarchy-CEOK8Gzh.js} +21 -19
- package/dist/{Legend-Dp_MKfS4.js → Legend-CFvQiIfn.js} +11 -10
- package/dist/{LineSeries-Uiv5o56b.js → LineSeries-D_IL2qGF.js} +13 -12
- package/dist/{LinearGradient-DiRq5YcI.js → LinearGradient-CxQyCSEB.js} +11 -11
- package/dist/{PieSeries-B2fW3z0s.js → PieSeries-CMH0Z7pz.js} +34 -32
- package/dist/{RoundedRectangle-CWLi2PXn.js → RoundedRectangle-BKLX1LKM.js} +4 -4
- package/dist/{Scrollbar-D86MJyr2.js → Scrollbar-CTI7_8Qw.js} +4 -4
- package/dist/{Slice-B19rbYDZ.js → Slice-BUncQh1B.js} +2 -2
- package/dist/{Tick-2bcLyHpF.js → Tick--VhF0xlz.js} +15 -15
- package/dist/Tooltip-vyZRZWih.js +3606 -0
- package/dist/{XYCursor-C8WktvKM.js → XYCursor-CVUSpqb9.js} +3 -3
- package/dist/{ZoomableContainer-DYyqwaMb.js → ZoomableContainer-Ca_pDVYQ.js} +7 -7
- package/dist/components/charts/_common/tooltip.js +73 -0
- package/dist/components/charts/_common/utils.js +10 -9
- package/dist/components/charts/candlestick/logic.js +191 -164
- package/dist/components/charts/column-line-mix/logic.js +116 -107
- package/dist/components/charts/donut-chart/logic.js +36 -34
- package/dist/components/charts/drill-down-treemap/logic.js +49 -48
- package/dist/components/charts/drill-down-voronoi-treemap/logic.js +102 -101
- package/dist/components/charts/heatmap/logic.js +33 -32
- package/dist/components/charts/highlighting-line-data/logic.js +26 -24
- package/dist/components/charts/line/logic.js +147 -185
- package/dist/components/charts/logaritmic-scale/logic.js +99 -84
- package/dist/components/charts/multiple-value-axes/logic.js +117 -107
- package/dist/components/charts/nested-pie/logic.js +3 -3
- package/dist/components/charts/packed-circles/logic.js +28 -27
- package/dist/components/charts/pie-chart/logic.js +43 -41
- package/dist/components/charts/stacked-area-radar/logic.js +124 -121
- package/dist/components/charts/stacked-column-chart/logic.js +107 -95
- package/dist/components/charts/xy-chart/logic.js +112 -98
- package/dist/components/metric-card/MetricChart.js +29 -28
- package/dist/main.d.ts +13 -0
- package/package.json +1 -1
- package/dist/AnimatedTheme-jnasw6rT.js +0 -11305
- package/dist/DataProcessor-CHDO51q4.js +0 -83
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import
|
|
4
|
-
import { useRef as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { X as
|
|
8
|
-
import {
|
|
9
|
-
import { A as
|
|
10
|
-
import { C as
|
|
11
|
-
import { R as
|
|
12
|
-
import {
|
|
13
|
-
|
|
1
|
+
import { R as le, A as ne } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
|
+
import { useTheme as he, useThemeProps as ce } from "@mui/material";
|
|
3
|
+
import ue from "lodash";
|
|
4
|
+
import { useRef as N, useLayoutEffect as ge, useEffect as B } from "react";
|
|
5
|
+
import { getTooltipDateFormat as pe, attachCursorTooltip as me } from "../_common/tooltip.js";
|
|
6
|
+
import { m as U, e as Z, c as p, p as de } from "../../../Entity-BJCuhdq_.js";
|
|
7
|
+
import { X as we, V as q } from "../../../AxisRenderer-BCQoUJw6.js";
|
|
8
|
+
import { X as fe } from "../../../XYCursor-CVUSpqb9.js";
|
|
9
|
+
import { A as xe, a as J } from "../../../AxisRendererY-AXWvGU6r.js";
|
|
10
|
+
import { C as G } from "../../../ColumnSeries-CtRTsn-E.js";
|
|
11
|
+
import { R as te } from "../../../RoundedRectangle-BKLX1LKM.js";
|
|
12
|
+
import { a as K, b as Q } from "../../../Tooltip-vyZRZWih.js";
|
|
13
|
+
import { D as ee, G as Ye } from "../../../GaplessDateAxis-B2g2jgSG.js";
|
|
14
|
+
import { D as ye } from "../../../DateAxis-DEXKps1S.js";
|
|
15
|
+
class T extends te {
|
|
14
16
|
_beforeChanged() {
|
|
15
17
|
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);
|
|
16
18
|
}
|
|
@@ -20,270 +22,295 @@ class A extends W {
|
|
|
20
22
|
e.moveTo(this.get("lowX0", 0), this.get("lowY0", 0)), e.lineTo(this.get("lowX1", 0), this.get("lowY1", 0)), e.moveTo(this.get("highX0", 0), this.get("highY0", 0)), e.lineTo(this.get("highX1", 0), this.get("highY1", 0));
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
|
-
Object.defineProperty(
|
|
25
|
+
Object.defineProperty(T, "className", {
|
|
24
26
|
enumerable: !0,
|
|
25
27
|
configurable: !0,
|
|
26
28
|
writable: !0,
|
|
27
29
|
value: "Candlestick"
|
|
28
30
|
});
|
|
29
|
-
Object.defineProperty(
|
|
31
|
+
Object.defineProperty(T, "classNames", {
|
|
30
32
|
enumerable: !0,
|
|
31
33
|
configurable: !0,
|
|
32
34
|
writable: !0,
|
|
33
|
-
value:
|
|
35
|
+
value: te.classNames.concat([T.className])
|
|
34
36
|
});
|
|
35
|
-
class
|
|
37
|
+
class V extends G {
|
|
36
38
|
constructor() {
|
|
37
39
|
super(...arguments), Object.defineProperty(this, "columns", {
|
|
38
40
|
enumerable: !0,
|
|
39
41
|
configurable: !0,
|
|
40
42
|
writable: !0,
|
|
41
|
-
value: this.addDisposer(new
|
|
43
|
+
value: this.addDisposer(new K(Q.new({
|
|
42
44
|
themeTags: ["autocolor"]
|
|
43
|
-
}), () =>
|
|
44
|
-
themeTags:
|
|
45
|
+
}), () => T._new(this._root, {
|
|
46
|
+
themeTags: U(this.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
|
|
45
47
|
}, [this.columns.template])))
|
|
46
48
|
});
|
|
47
49
|
}
|
|
48
50
|
/**
|
|
49
51
|
* @ignore
|
|
50
52
|
*/
|
|
51
|
-
makeColumn(e,
|
|
52
|
-
const
|
|
53
|
-
return this.get("turboMode") ?
|
|
53
|
+
makeColumn(e, s) {
|
|
54
|
+
const m = s.make();
|
|
55
|
+
return this.get("turboMode") ? m.virtualParent = this.chart : this.mainContainer.children.push(m), m._setDataItem(e), s.push(m), m;
|
|
54
56
|
}
|
|
55
|
-
_updateGraphics(e,
|
|
56
|
-
super._updateGraphics(e,
|
|
57
|
-
const
|
|
58
|
-
let
|
|
59
|
-
if (
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
-
let
|
|
63
|
-
|
|
57
|
+
_updateGraphics(e, s, m) {
|
|
58
|
+
super._updateGraphics(e, s, m);
|
|
59
|
+
const f = this.getRaw("xAxis"), x = this.getRaw("yAxis");
|
|
60
|
+
let Y = this.get("vcy", 1), y = this.get("vcx", 1), h, c, r, i, d, u, g, w, 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)), _;
|
|
61
|
+
if (m == 0) {
|
|
62
|
+
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), w = x.getDataItemPositionY(e, this._yHighField, 1, Y), g = Math.max(v, t), r = Math.min(v, t);
|
|
64
|
+
let n = this._aLocationX0 + D - 0.5, C = this._aLocationX1 + o - 0.5;
|
|
65
|
+
h = f.getDataItemPositionX(e, this._xField, n + (C - n) / 2, y), c = h, d = h, u = h, _ = "vertical";
|
|
64
66
|
} else {
|
|
65
|
-
let
|
|
66
|
-
c =
|
|
67
|
-
let
|
|
68
|
-
r = x.getDataItemPositionY(e, this._yField,
|
|
67
|
+
let v = f.getDataItemPositionX(e, this._xOpenField, 1, y), t = f.getDataItemPositionX(e, this._xField, 1, y);
|
|
68
|
+
c = f.getDataItemPositionX(e, this._xLowField, 1, y), u = f.getDataItemPositionX(e, this._xHighField, 1, y), d = Math.max(v, t), h = Math.min(v, t);
|
|
69
|
+
let n = this._aLocationY0 + a - 0.5, C = this._aLocationY1 + l - 0.5;
|
|
70
|
+
r = x.getDataItemPositionY(e, this._yField, n + (C - n) / 2, Y), i = r, g = r, w = r, _ = "horizontal";
|
|
69
71
|
}
|
|
70
|
-
this._updateCandleGraphics(e,
|
|
72
|
+
this._updateCandleGraphics(e, h, c, r, i, d, u, g, w, _);
|
|
71
73
|
}
|
|
72
|
-
_updateCandleGraphics(e,
|
|
73
|
-
let
|
|
74
|
-
if (
|
|
75
|
-
let
|
|
74
|
+
_updateCandleGraphics(e, s, m, f, x, Y, y, h, c, r) {
|
|
75
|
+
let i = e.get("graphics");
|
|
76
|
+
if (i) {
|
|
77
|
+
let d = this.getPoint(s, f), u = this.getPoint(m, x), g = this.getPoint(Y, h), w = this.getPoint(y, c);
|
|
76
78
|
if (this.get("turboMode")) {
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
+
const o = this.allColumnsData[this.allColumnsData.length - 1];
|
|
80
|
+
o.lowX0 = d.x, o.lowY0 = d.y, o.lowX1 = u.x, o.lowY1 = u.y, o.highX0 = g.x, o.highY0 = g.y, o.highX1 = w.x, o.highY1 = w.y;
|
|
79
81
|
} else {
|
|
80
|
-
let
|
|
81
|
-
|
|
82
|
-
let
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
let o = i.x(), l = i.y();
|
|
83
|
+
i.set("lowX0", d.x - o), i.set("lowY0", d.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", w.x - o), i.set("highY1", w.y - l), i.set("orientation", r);
|
|
84
|
+
let D = e.get("rangeGraphics");
|
|
85
|
+
D && Z(D, (a) => {
|
|
86
|
+
a.set("lowX0", d.x - o), a.set("lowY0", d.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", w.x - o), a.set("highY1", w.y - l), a.set("orientation", r);
|
|
85
87
|
});
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
_afterColumnsDraw() {
|
|
90
92
|
this.get("turboMode") && this.allColumns.set("draw", (e) => {
|
|
91
|
-
e.clear(),
|
|
93
|
+
e.clear(), Z(this.allColumnsData, (s) => {
|
|
92
94
|
e.beginPath();
|
|
93
|
-
const
|
|
94
|
-
e.beginFill(
|
|
95
|
+
const m = s.width, f = s.height, x = s.x, Y = s.y, y = s.stroke, h = s.fill, c = s.strokeWidth, r = s.strokeOpacity, i = s.fillOpacity, d = s.lowX0, u = s.lowY0, g = s.lowX1, w = s.lowY1, o = s.highX0, l = s.highY0, D = s.highX1, a = s.highY1;
|
|
96
|
+
e.beginFill(h, i), e.beginPath(), e.lineStyle(c, y, r), e.drawRect(x, Y, m, f), e.moveTo(d, u), e.lineTo(g, w), e.moveTo(o, l), e.lineTo(D, a), e.endStroke(), e.endFill();
|
|
95
97
|
});
|
|
96
98
|
});
|
|
97
99
|
}
|
|
98
100
|
_processAxisRange(e) {
|
|
99
|
-
super._processAxisRange(e), e.columns = new
|
|
100
|
-
themeTags:
|
|
101
|
+
super._processAxisRange(e), e.columns = new K(Q.new({}), () => T._new(this._root, {
|
|
102
|
+
themeTags: U(e.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
|
|
101
103
|
}, [this.columns.template, e.columns.template]));
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
|
-
Object.defineProperty(
|
|
106
|
+
Object.defineProperty(V, "className", {
|
|
105
107
|
enumerable: !0,
|
|
106
108
|
configurable: !0,
|
|
107
109
|
writable: !0,
|
|
108
110
|
value: "CandlestickSeries"
|
|
109
111
|
});
|
|
110
|
-
Object.defineProperty(
|
|
112
|
+
Object.defineProperty(V, "classNames", {
|
|
111
113
|
enumerable: !0,
|
|
112
114
|
configurable: !0,
|
|
113
115
|
writable: !0,
|
|
114
|
-
value:
|
|
116
|
+
value: G.classNames.concat([V.className])
|
|
115
117
|
});
|
|
116
|
-
const
|
|
117
|
-
const e =
|
|
118
|
-
props:
|
|
118
|
+
const Ve = ($) => {
|
|
119
|
+
const e = he(), s = ce({
|
|
120
|
+
props: $,
|
|
119
121
|
name: "HCCandlestickChart"
|
|
120
122
|
}), {
|
|
121
|
-
data:
|
|
122
|
-
seriesName:
|
|
123
|
+
data: m,
|
|
124
|
+
seriesName: f,
|
|
123
125
|
height: x = "100%",
|
|
124
|
-
width:
|
|
125
|
-
chartId:
|
|
126
|
-
showVolume:
|
|
126
|
+
width: Y = "100%",
|
|
127
|
+
chartId: y = "candlestick-chart",
|
|
128
|
+
showVolume: h = !1,
|
|
127
129
|
risingColor: c = e.palette.success.main,
|
|
128
130
|
fallingColor: r = e.palette.error.main,
|
|
129
|
-
loading:
|
|
130
|
-
emptyMessage:
|
|
131
|
-
baseInterval:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
131
|
+
loading: i = !1,
|
|
132
|
+
emptyMessage: d = "No data available",
|
|
133
|
+
baseInterval: u,
|
|
134
|
+
skipEmptyDates: g = !1,
|
|
135
|
+
sx: w,
|
|
136
|
+
...o
|
|
137
|
+
} = s, l = ue.orderBy(m, ["date"]), D = {
|
|
138
|
+
...s,
|
|
136
139
|
height: x,
|
|
137
|
-
width:
|
|
138
|
-
chartId:
|
|
139
|
-
showVolume:
|
|
140
|
+
width: Y,
|
|
141
|
+
chartId: y,
|
|
142
|
+
showVolume: h,
|
|
140
143
|
risingColor: c,
|
|
141
144
|
fallingColor: r,
|
|
142
|
-
loading:
|
|
143
|
-
emptyMessage:
|
|
144
|
-
baseInterval:
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
145
|
+
loading: i,
|
|
146
|
+
emptyMessage: d,
|
|
147
|
+
baseInterval: u,
|
|
148
|
+
skipEmptyDates: g
|
|
149
|
+
}, a = N(null), _ = N(null), v = N(null);
|
|
150
|
+
return ge(() => {
|
|
151
|
+
var j, H, E;
|
|
152
|
+
if (!v.current) return;
|
|
153
|
+
const t = le.new(v.current);
|
|
154
|
+
_.current = t, t.setThemes([ne.new(t)]), t.interfaceColors.setAll({
|
|
155
|
+
text: p(e.palette.text.primary),
|
|
156
|
+
grid: p(e.palette.divider),
|
|
157
|
+
stroke: p(e.palette.divider)
|
|
154
158
|
});
|
|
155
|
-
const
|
|
156
|
-
|
|
159
|
+
const n = t.container.children.push(
|
|
160
|
+
we.new(t, {
|
|
157
161
|
panX: !0,
|
|
158
162
|
panY: !0,
|
|
159
163
|
wheelX: "none",
|
|
160
164
|
wheelY: "none",
|
|
165
|
+
maxTooltipDistance: -1,
|
|
161
166
|
pinchZoomX: !0,
|
|
162
167
|
layout: t.verticalLayout
|
|
163
168
|
})
|
|
164
169
|
);
|
|
165
|
-
|
|
170
|
+
a.current = n, n.set(
|
|
166
171
|
"cursor",
|
|
167
|
-
|
|
172
|
+
fe.new(t, {
|
|
168
173
|
behavior: "zoomX"
|
|
169
174
|
})
|
|
170
175
|
).lineY.set("visible", !1);
|
|
171
|
-
const
|
|
172
|
-
|
|
176
|
+
const C = g ? Ye : ye, L = n.xAxes.push(
|
|
177
|
+
C.new(t, {
|
|
173
178
|
maxDeviation: 0.3,
|
|
174
179
|
groupData: !0,
|
|
175
|
-
baseInterval:
|
|
176
|
-
renderer:
|
|
180
|
+
baseInterval: u || { timeUnit: "day", count: 1 },
|
|
181
|
+
renderer: xe.new(t, {
|
|
177
182
|
minorGridEnabled: !0
|
|
178
|
-
})
|
|
179
|
-
tooltip: G.new(t, {})
|
|
183
|
+
})
|
|
180
184
|
})
|
|
181
|
-
),
|
|
182
|
-
|
|
183
|
-
renderer:
|
|
185
|
+
), S = n.yAxes.push(
|
|
186
|
+
q.new(t, {
|
|
187
|
+
renderer: J.new(t, {})
|
|
184
188
|
})
|
|
185
189
|
);
|
|
186
|
-
(
|
|
187
|
-
stroke:
|
|
190
|
+
(j = L.get("renderer")) == null || j.grid.template.setAll({
|
|
191
|
+
stroke: p(e.palette.divider),
|
|
188
192
|
strokeOpacity: 1
|
|
189
|
-
}), (
|
|
193
|
+
}), (H = L.get("renderer")) == null || H.labels.template.setAll({
|
|
190
194
|
paddingTop: 12
|
|
191
|
-
}), (
|
|
192
|
-
stroke:
|
|
195
|
+
}), (E = S.get("renderer")) == null || E.grid.template.setAll({
|
|
196
|
+
stroke: p(e.palette.divider),
|
|
193
197
|
strokeOpacity: 1
|
|
194
198
|
});
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
name:
|
|
198
|
-
xAxis:
|
|
199
|
-
yAxis:
|
|
199
|
+
const A = n.series.push(
|
|
200
|
+
V.new(t, {
|
|
201
|
+
name: f || "Price",
|
|
202
|
+
xAxis: L,
|
|
203
|
+
yAxis: S,
|
|
200
204
|
valueXField: "date",
|
|
201
205
|
openValueYField: "open",
|
|
202
206
|
highValueYField: "high",
|
|
203
207
|
lowValueYField: "low",
|
|
204
|
-
valueYField: "close"
|
|
205
|
-
tooltip: G.new(t, {
|
|
206
|
-
labelText: `
|
|
207
|
-
Open: {openValueY}
|
|
208
|
-
High: {highValueY}
|
|
209
|
-
Low: {lowValueY}
|
|
210
|
-
Close: {valueY}
|
|
211
|
-
Change: {valueY - openValueY > 0 ? "+" : ""}{((valueY - openValueY)/openValueY*100).toFixed(2)}%
|
|
212
|
-
`
|
|
213
|
-
})
|
|
208
|
+
valueYField: "close"
|
|
214
209
|
})
|
|
215
210
|
);
|
|
216
|
-
|
|
217
|
-
fill:
|
|
218
|
-
stroke:
|
|
219
|
-
}),
|
|
220
|
-
fill:
|
|
221
|
-
stroke:
|
|
222
|
-
}),
|
|
211
|
+
A.columns.template.states.create("riseFromPrevious", {
|
|
212
|
+
fill: p(c),
|
|
213
|
+
stroke: p(c)
|
|
214
|
+
}), A.columns.template.states.create("dropFromPrevious", {
|
|
215
|
+
fill: p(r),
|
|
216
|
+
stroke: p(r)
|
|
217
|
+
}), A.data.processor = ee.new(t, {
|
|
223
218
|
dateFormat: "i",
|
|
224
219
|
dateFields: ["date"]
|
|
225
220
|
});
|
|
226
|
-
let
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
renderer:
|
|
221
|
+
let F = null, M = null;
|
|
222
|
+
h && (M = n.yAxes.push(
|
|
223
|
+
q.new(t, {
|
|
224
|
+
renderer: J.new(t, {
|
|
230
225
|
opposite: !0
|
|
231
226
|
}),
|
|
232
227
|
numberFormat: "#a"
|
|
233
228
|
})
|
|
234
|
-
),
|
|
235
|
-
|
|
229
|
+
), F = n.series.push(
|
|
230
|
+
G.new(t, {
|
|
236
231
|
name: "Volume",
|
|
237
|
-
xAxis:
|
|
238
|
-
yAxis:
|
|
232
|
+
xAxis: L,
|
|
233
|
+
yAxis: M,
|
|
239
234
|
valueYField: "volume",
|
|
240
235
|
valueXField: "date",
|
|
241
|
-
fill:
|
|
242
|
-
stroke:
|
|
236
|
+
fill: p("#2962ff"),
|
|
237
|
+
stroke: p("#2962ff"),
|
|
243
238
|
opacity: 0.6
|
|
244
239
|
})
|
|
245
|
-
),
|
|
246
|
-
width:
|
|
247
|
-
}),
|
|
240
|
+
), F.columns.template.setAll({
|
|
241
|
+
width: de(80)
|
|
242
|
+
}), F.data.processor = ee.new(t, {
|
|
248
243
|
dateFormat: "i",
|
|
249
244
|
dateFields: ["date"]
|
|
250
|
-
})),
|
|
245
|
+
})), A.data.setAll(l), h && F && F.data.setAll(l);
|
|
246
|
+
const se = pe(u);
|
|
247
|
+
return me({
|
|
248
|
+
root: t,
|
|
249
|
+
chart: n,
|
|
250
|
+
theme: e,
|
|
251
|
+
getText: () => {
|
|
252
|
+
var W;
|
|
253
|
+
const b = A.get("tooltipDataItem"), O = b == null ? void 0 : b.get("valueY");
|
|
254
|
+
if (b === void 0 || O === void 0 || O === null)
|
|
255
|
+
return "";
|
|
256
|
+
const k = 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) : "", P = (X) => X == null ? "—" : t.numberFormatter.format(X), R = [
|
|
257
|
+
`Open: ${P(k)}`,
|
|
258
|
+
`High: ${P(oe)}`,
|
|
259
|
+
`Low: ${P(ie)}`,
|
|
260
|
+
`Close: ${P(O)}`
|
|
261
|
+
];
|
|
262
|
+
if (typeof k == "number" && k !== 0) {
|
|
263
|
+
const X = (O - k) / k * 100, re = p(X >= 0 ? c : r), ae = X > 0 ? "+" : "";
|
|
264
|
+
R.push(
|
|
265
|
+
`Change: [${re.toCSSHex()}]${ae}${X.toFixed(2)}%[/]`
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
if (h && F) {
|
|
269
|
+
const X = (W = F.get("tooltipDataItem")) == null ? void 0 : W.get("valueY");
|
|
270
|
+
X != null && R.push(`Volume: ${P(X)}`);
|
|
271
|
+
}
|
|
272
|
+
return z ? `[bold]${z}[/]
|
|
273
|
+
${R.join(`
|
|
274
|
+
`)}` : R.join(`
|
|
275
|
+
`);
|
|
276
|
+
}
|
|
277
|
+
}), n.appear(1e3), A.appear(1e3), () => {
|
|
251
278
|
t.dispose();
|
|
252
279
|
};
|
|
253
|
-
}, [e.palette.mode]),
|
|
254
|
-
if (
|
|
255
|
-
const t =
|
|
280
|
+
}, [e.palette.mode, g]), B(() => {
|
|
281
|
+
if (a.current && _.current) {
|
|
282
|
+
const t = a.current.series.getIndex(
|
|
256
283
|
0
|
|
257
|
-
),
|
|
258
|
-
t == null || t.data.setAll(
|
|
284
|
+
), n = h ? a.current.series.getIndex(1) : null;
|
|
285
|
+
t == null || t.data.setAll(l), n == null || n.data.setAll(l);
|
|
259
286
|
}
|
|
260
|
-
}, [
|
|
261
|
-
if (!
|
|
262
|
-
const t =
|
|
287
|
+
}, [l, h]), B(() => {
|
|
288
|
+
if (!a.current) return;
|
|
289
|
+
const t = a.current.series.getIndex(0);
|
|
263
290
|
t && (t.columns.template.states.create("riseFromPrevious", {
|
|
264
|
-
fill:
|
|
265
|
-
stroke:
|
|
291
|
+
fill: p(c),
|
|
292
|
+
stroke: p(c)
|
|
266
293
|
}), t.columns.template.states.create("dropFromPrevious", {
|
|
267
|
-
fill:
|
|
268
|
-
stroke:
|
|
294
|
+
fill: p(r),
|
|
295
|
+
stroke: p(r)
|
|
269
296
|
}));
|
|
270
297
|
}, [c, r]), {
|
|
271
|
-
chartDivRef:
|
|
272
|
-
data:
|
|
273
|
-
seriesName:
|
|
298
|
+
chartDivRef: v,
|
|
299
|
+
data: m,
|
|
300
|
+
seriesName: f,
|
|
274
301
|
height: x,
|
|
275
|
-
width:
|
|
276
|
-
chartId:
|
|
277
|
-
showVolume:
|
|
302
|
+
width: Y,
|
|
303
|
+
chartId: y,
|
|
304
|
+
showVolume: h,
|
|
278
305
|
risingColor: c,
|
|
279
306
|
fallingColor: r,
|
|
280
|
-
loading:
|
|
281
|
-
emptyMessage:
|
|
282
|
-
sx:
|
|
283
|
-
other:
|
|
284
|
-
ownerState:
|
|
307
|
+
loading: i,
|
|
308
|
+
emptyMessage: d,
|
|
309
|
+
sx: w,
|
|
310
|
+
other: o,
|
|
311
|
+
ownerState: D
|
|
285
312
|
};
|
|
286
313
|
};
|
|
287
314
|
export {
|
|
288
|
-
|
|
315
|
+
Ve as useCandlestickChartLogic
|
|
289
316
|
};
|