@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.
Files changed (47) hide show
  1. package/dist/AnimatedTheme-ktdO3Bel.js +7708 -0
  2. package/dist/{AxisRenderer-DTyLLA6c.js → AxisRenderer-BCQoUJw6.js} +51 -49
  3. package/dist/{AxisRendererY-C_ItLPNV.js → AxisRendererY-AXWvGU6r.js} +3 -3
  4. package/dist/{Bullet-DVczI2TD.js → Bullet-Djj7Vs9T.js} +1 -1
  5. package/dist/{Button-CcsPEIDh.js → Button-BLY4PVJC.js} +3 -3
  6. package/dist/{CategoryAxis-CwnfaGc8.js → CategoryAxis-B6NqW8qd.js} +3 -3
  7. package/dist/{Circle-Cy5s-pVc.js → Circle-BnfBNKBD.js} +1 -1
  8. package/dist/ColorSet-cyPmWGwh.js +77 -0
  9. package/dist/{ColumnSeries-CjgdJ2QL.js → ColumnSeries-CtRTsn-E.js} +4 -4
  10. package/dist/{DateAxis-YX3QNIB-.js → DateAxis-DEXKps1S.js} +8 -7
  11. package/dist/{ColorSet-C7vpNXhM.js → Entity-BJCuhdq_.js} +638 -712
  12. package/dist/GaplessDateAxis-B2g2jgSG.js +376 -0
  13. package/dist/{Hierarchy-Bihj0S61.js → Hierarchy-CEOK8Gzh.js} +21 -19
  14. package/dist/{Legend-Dp_MKfS4.js → Legend-CFvQiIfn.js} +11 -10
  15. package/dist/{LineSeries-Uiv5o56b.js → LineSeries-D_IL2qGF.js} +13 -12
  16. package/dist/{LinearGradient-DiRq5YcI.js → LinearGradient-CxQyCSEB.js} +11 -11
  17. package/dist/{PieSeries-B2fW3z0s.js → PieSeries-CMH0Z7pz.js} +34 -32
  18. package/dist/{RoundedRectangle-CWLi2PXn.js → RoundedRectangle-BKLX1LKM.js} +4 -4
  19. package/dist/{Scrollbar-D86MJyr2.js → Scrollbar-CTI7_8Qw.js} +4 -4
  20. package/dist/{Slice-B19rbYDZ.js → Slice-BUncQh1B.js} +2 -2
  21. package/dist/{Tick-2bcLyHpF.js → Tick--VhF0xlz.js} +15 -15
  22. package/dist/Tooltip-vyZRZWih.js +3606 -0
  23. package/dist/{XYCursor-C8WktvKM.js → XYCursor-CVUSpqb9.js} +3 -3
  24. package/dist/{ZoomableContainer-DYyqwaMb.js → ZoomableContainer-Ca_pDVYQ.js} +7 -7
  25. package/dist/components/charts/_common/tooltip.js +73 -0
  26. package/dist/components/charts/_common/utils.js +10 -9
  27. package/dist/components/charts/candlestick/logic.js +191 -164
  28. package/dist/components/charts/column-line-mix/logic.js +116 -107
  29. package/dist/components/charts/donut-chart/logic.js +36 -34
  30. package/dist/components/charts/drill-down-treemap/logic.js +49 -48
  31. package/dist/components/charts/drill-down-voronoi-treemap/logic.js +102 -101
  32. package/dist/components/charts/heatmap/logic.js +33 -32
  33. package/dist/components/charts/highlighting-line-data/logic.js +26 -24
  34. package/dist/components/charts/line/logic.js +147 -185
  35. package/dist/components/charts/logaritmic-scale/logic.js +99 -84
  36. package/dist/components/charts/multiple-value-axes/logic.js +117 -107
  37. package/dist/components/charts/nested-pie/logic.js +3 -3
  38. package/dist/components/charts/packed-circles/logic.js +28 -27
  39. package/dist/components/charts/pie-chart/logic.js +43 -41
  40. package/dist/components/charts/stacked-area-radar/logic.js +124 -121
  41. package/dist/components/charts/stacked-column-chart/logic.js +107 -95
  42. package/dist/components/charts/xy-chart/logic.js +112 -98
  43. package/dist/components/metric-card/MetricChart.js +29 -28
  44. package/dist/main.d.ts +13 -0
  45. package/package.json +1 -1
  46. package/dist/AnimatedTheme-jnasw6rT.js +0 -11305
  47. package/dist/DataProcessor-CHDO51q4.js +0 -83
@@ -1,16 +1,18 @@
1
- import { k as N, l as M, R as B, A as U, T as G } from "../../../AnimatedTheme-jnasw6rT.js";
2
- import { useTheme as Z, useThemeProps as q } from "@mui/material";
3
- import J from "lodash";
4
- import { useRef as C, useLayoutEffect as K, useEffect as S } from "react";
5
- import { m as j, e as H, c as m, p as Q } from "../../../ColorSet-C7vpNXhM.js";
6
- import { X as $, V as E } from "../../../AxisRenderer-DTyLLA6c.js";
7
- import { X as ee } from "../../../XYCursor-C8WktvKM.js";
8
- import { D as te } from "../../../DateAxis-YX3QNIB-.js";
9
- import { A as se, a as z } from "../../../AxisRendererY-C_ItLPNV.js";
10
- import { C as T } from "../../../ColumnSeries-CjgdJ2QL.js";
11
- import { R as W } from "../../../RoundedRectangle-CWLi2PXn.js";
12
- import { D as I } from "../../../DataProcessor-CHDO51q4.js";
13
- class A extends W {
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(A, "className", {
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(A, "classNames", {
31
+ Object.defineProperty(T, "classNames", {
30
32
  enumerable: !0,
31
33
  configurable: !0,
32
34
  writable: !0,
33
- value: W.classNames.concat([A.className])
35
+ value: te.classNames.concat([T.className])
34
36
  });
35
- class F extends T {
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 N(M.new({
43
+ value: this.addDisposer(new K(Q.new({
42
44
  themeTags: ["autocolor"]
43
- }), () => A._new(this._root, {
44
- themeTags: j(this.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
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, i) {
52
- const h = i.make();
53
- return this.get("turboMode") ? h.virtualParent = this.chart : this.mainContainer.children.push(h), h._setDataItem(e), i.push(h), h;
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, i, h) {
56
- super._updateGraphics(e, i, h);
57
- const Y = this.getRaw("xAxis"), x = this.getRaw("yAxis");
58
- let y = this.get("vcy", 1), X = this.get("vcx", 1), a, c, r, o, u, g, d, w, s = this.get("locationX", e.get("locationX", 0.5)), p = this.get("locationY", e.get("locationY", 0.5)), f = this.get("openLocationX", e.get("openLocationX", s)), n = this.get("openLocationY", e.get("openLocationY", p)), b;
59
- if (h == 0) {
60
- let t = x.getDataItemPositionY(e, this._yOpenField, 1, y), l = x.getDataItemPositionY(e, this._yField, 1, y);
61
- o = x.getDataItemPositionY(e, this._yLowField, 1, y), w = x.getDataItemPositionY(e, this._yHighField, 1, y), d = Math.max(t, l), r = Math.min(t, l);
62
- let v = this._aLocationX0 + f - 0.5, D = this._aLocationX1 + s - 0.5;
63
- a = Y.getDataItemPositionX(e, this._xField, v + (D - v) / 2, X), c = a, u = a, g = a, b = "vertical";
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 t = Y.getDataItemPositionX(e, this._xOpenField, 1, X), l = Y.getDataItemPositionX(e, this._xField, 1, X);
66
- c = Y.getDataItemPositionX(e, this._xLowField, 1, X), g = Y.getDataItemPositionX(e, this._xHighField, 1, X), u = Math.max(t, l), a = Math.min(t, l);
67
- let v = this._aLocationY0 + n - 0.5, D = this._aLocationY1 + p - 0.5;
68
- r = x.getDataItemPositionY(e, this._yField, v + (D - v) / 2, y), o = r, d = r, w = r, b = "horizontal";
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, a, c, r, o, u, g, d, w, b);
72
+ this._updateCandleGraphics(e, h, c, r, i, d, u, g, w, _);
71
73
  }
72
- _updateCandleGraphics(e, i, h, Y, x, y, X, a, c, r) {
73
- let o = e.get("graphics");
74
- if (o) {
75
- let u = this.getPoint(i, Y), g = this.getPoint(h, x), d = this.getPoint(y, a), w = this.getPoint(X, c);
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 s = this.allColumnsData[this.allColumnsData.length - 1];
78
- s.lowX0 = u.x, s.lowY0 = u.y, s.lowX1 = g.x, s.lowY1 = g.y, s.highX0 = d.x, s.highY0 = d.y, s.highX1 = w.x, s.highY1 = w.y;
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 s = o.x(), p = o.y();
81
- o.set("lowX0", u.x - s), o.set("lowY0", u.y - p), o.set("lowX1", g.x - s), o.set("lowY1", g.y - p), o.set("highX0", d.x - s), o.set("highY0", d.y - p), o.set("highX1", w.x - s), o.set("highY1", w.y - p), o.set("orientation", r);
82
- let f = e.get("rangeGraphics");
83
- f && H(f, (n) => {
84
- n.set("lowX0", u.x - s), n.set("lowY0", u.y - p), n.set("lowX1", g.x - s), n.set("lowY1", g.y - p), n.set("highX0", d.x - s), n.set("highY0", d.y - p), n.set("highX1", w.x - s), n.set("highY1", w.y - p), n.set("orientation", r);
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(), H(this.allColumnsData, (i) => {
93
+ e.clear(), Z(this.allColumnsData, (s) => {
92
94
  e.beginPath();
93
- const h = i.width, Y = i.height, x = i.x, y = i.y, X = i.stroke, a = i.fill, c = i.strokeWidth, r = i.strokeOpacity, o = i.fillOpacity, u = i.lowX0, g = i.lowY0, d = i.lowX1, w = i.lowY1, s = i.highX0, p = i.highY0, f = i.highX1, n = i.highY1;
94
- e.beginFill(a, o), e.beginPath(), e.lineStyle(c, X, r), e.drawRect(x, y, h, Y), e.moveTo(u, g), e.lineTo(d, w), e.moveTo(s, p), e.lineTo(f, n), e.endStroke(), e.endFill();
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 N(M.new({}), () => A._new(this._root, {
100
- themeTags: j(e.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
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(F, "className", {
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(F, "classNames", {
112
+ Object.defineProperty(V, "classNames", {
111
113
  enumerable: !0,
112
114
  configurable: !0,
113
115
  writable: !0,
114
- value: T.classNames.concat([F.className])
116
+ value: G.classNames.concat([V.className])
115
117
  });
116
- const de = (P) => {
117
- const e = Z(), i = q({
118
- props: P,
118
+ const Ve = ($) => {
119
+ const e = he(), s = ce({
120
+ props: $,
119
121
  name: "HCCandlestickChart"
120
122
  }), {
121
- data: h,
122
- seriesName: Y,
123
+ data: m,
124
+ seriesName: f,
123
125
  height: x = "100%",
124
- width: y = "100%",
125
- chartId: X = "candlestick-chart",
126
- showVolume: a = !1,
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: o = !1,
130
- emptyMessage: u = "No data available",
131
- baseInterval: g,
132
- sx: d,
133
- ...w
134
- } = i, s = J.orderBy(h, ["date"]), p = {
135
- ...i,
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: y,
138
- chartId: X,
139
- showVolume: a,
140
+ width: Y,
141
+ chartId: y,
142
+ showVolume: h,
140
143
  risingColor: c,
141
144
  fallingColor: r,
142
- loading: o,
143
- emptyMessage: u,
144
- baseInterval: g
145
- }, f = C(null), n = C(null), b = C(null);
146
- return K(() => {
147
- var O, R, V;
148
- if (!b.current) return;
149
- const t = B.new(b.current);
150
- n.current = t, t.setThemes([U.new(t)]), t.interfaceColors.setAll({
151
- text: m(e.palette.text.primary),
152
- grid: m(e.palette.divider),
153
- stroke: m(e.palette.divider)
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 l = t.container.children.push(
156
- $.new(t, {
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
- f.current = l, l.set(
170
+ a.current = n, n.set(
166
171
  "cursor",
167
- ee.new(t, {
172
+ fe.new(t, {
168
173
  behavior: "zoomX"
169
174
  })
170
175
  ).lineY.set("visible", !1);
171
- const v = l.xAxes.push(
172
- te.new(t, {
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: g || { timeUnit: "day", count: 1 },
176
- renderer: se.new(t, {
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
- ), D = l.yAxes.push(
182
- E.new(t, {
183
- renderer: z.new(t, {})
185
+ ), S = n.yAxes.push(
186
+ q.new(t, {
187
+ renderer: J.new(t, {})
184
188
  })
185
189
  );
186
- (O = v.get("renderer")) == null || O.grid.template.setAll({
187
- stroke: m(e.palette.divider),
190
+ (j = L.get("renderer")) == null || j.grid.template.setAll({
191
+ stroke: p(e.palette.divider),
188
192
  strokeOpacity: 1
189
- }), (R = v.get("renderer")) == null || R.labels.template.setAll({
193
+ }), (H = L.get("renderer")) == null || H.labels.template.setAll({
190
194
  paddingTop: 12
191
- }), (V = D.get("renderer")) == null || V.grid.template.setAll({
192
- stroke: m(e.palette.divider),
195
+ }), (E = S.get("renderer")) == null || E.grid.template.setAll({
196
+ stroke: p(e.palette.divider),
193
197
  strokeOpacity: 1
194
198
  });
195
- const _ = l.series.push(
196
- F.new(t, {
197
- name: Y || "Price",
198
- xAxis: v,
199
- yAxis: D,
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
- _.columns.template.states.create("riseFromPrevious", {
217
- fill: m(c),
218
- stroke: m(c)
219
- }), _.columns.template.states.create("dropFromPrevious", {
220
- fill: m(r),
221
- stroke: m(r)
222
- }), _.data.processor = I.new(t, {
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 k = null, L = null;
227
- return a && (L = l.yAxes.push(
228
- E.new(t, {
229
- renderer: z.new(t, {
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
- ), k = l.series.push(
235
- T.new(t, {
229
+ ), F = n.series.push(
230
+ G.new(t, {
236
231
  name: "Volume",
237
- xAxis: v,
238
- yAxis: L,
232
+ xAxis: L,
233
+ yAxis: M,
239
234
  valueYField: "volume",
240
235
  valueXField: "date",
241
- fill: m("#2962ff"),
242
- stroke: m("#2962ff"),
236
+ fill: p("#2962ff"),
237
+ stroke: p("#2962ff"),
243
238
  opacity: 0.6
244
239
  })
245
- ), k.columns.template.setAll({
246
- width: Q(80)
247
- }), k.data.processor = I.new(t, {
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
- })), _.data.setAll(s), a && k && k.data.setAll(s), l.appear(1e3), _.appear(1e3), () => {
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]), S(() => {
254
- if (f.current && n.current) {
255
- const t = f.current.series.getIndex(
280
+ }, [e.palette.mode, g]), B(() => {
281
+ if (a.current && _.current) {
282
+ const t = a.current.series.getIndex(
256
283
  0
257
- ), l = a ? f.current.series.getIndex(1) : null;
258
- t == null || t.data.setAll(s), l == null || l.data.setAll(s);
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
- }, [s, a]), S(() => {
261
- if (!f.current) return;
262
- const t = f.current.series.getIndex(0);
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: m(c),
265
- stroke: m(c)
291
+ fill: p(c),
292
+ stroke: p(c)
266
293
  }), t.columns.template.states.create("dropFromPrevious", {
267
- fill: m(r),
268
- stroke: m(r)
294
+ fill: p(r),
295
+ stroke: p(r)
269
296
  }));
270
297
  }, [c, r]), {
271
- chartDivRef: b,
272
- data: h,
273
- seriesName: Y,
298
+ chartDivRef: v,
299
+ data: m,
300
+ seriesName: f,
274
301
  height: x,
275
- width: y,
276
- chartId: X,
277
- showVolume: a,
302
+ width: Y,
303
+ chartId: y,
304
+ showVolume: h,
278
305
  risingColor: c,
279
306
  fallingColor: r,
280
- loading: o,
281
- emptyMessage: u,
282
- sx: d,
283
- other: w,
284
- ownerState: p
307
+ loading: i,
308
+ emptyMessage: d,
309
+ sx: w,
310
+ other: o,
311
+ ownerState: D
285
312
  };
286
313
  };
287
314
  export {
288
- de as useCandlestickChartLogic
315
+ Ve as useCandlestickChartLogic
289
316
  };