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