@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.
Files changed (48) hide show
  1. package/dist/AnimatedTheme-BOKdw2Oy.js +7708 -0
  2. package/dist/{AxisRenderer-DTyLLA6c.js → AxisRenderer-lUbezuh7.js} +51 -49
  3. package/dist/{AxisRendererY-C_ItLPNV.js → AxisRendererY-DbSiyb45.js} +3 -3
  4. package/dist/{Bullet-DVczI2TD.js → Bullet-PgoNb3Jv.js} +1 -1
  5. package/dist/{Button-CcsPEIDh.js → Button-XBf4Mwz-.js} +3 -3
  6. package/dist/{CategoryAxis-CwnfaGc8.js → CategoryAxis-B8KQp1pE.js} +3 -3
  7. package/dist/{Circle-Cy5s-pVc.js → Circle-BWRdiMpG.js} +1 -1
  8. package/dist/ColorSet-DDmFoKtZ.js +77 -0
  9. package/dist/{ColumnSeries-CjgdJ2QL.js → ColumnSeries-rgnGm-Bg.js} +4 -4
  10. package/dist/{DataProcessor-CHDO51q4.js → DataProcessor-CvIe9BVn.js} +1 -1
  11. package/dist/{DateAxis-YX3QNIB-.js → DateAxis-zNtbSVjW.js} +8 -7
  12. package/dist/{ColorSet-C7vpNXhM.js → Entity-CCUIdRAr.js} +638 -712
  13. package/dist/{Hierarchy-Bihj0S61.js → Hierarchy-CCvGsF1A.js} +25 -23
  14. package/dist/{Legend-Dp_MKfS4.js → Legend-kbCFjJAW.js} +11 -10
  15. package/dist/{LineSeries-Uiv5o56b.js → LineSeries-BLFvwrLT.js} +13 -12
  16. package/dist/{LinearGradient-DiRq5YcI.js → LinearGradient-C7rnipF7.js} +11 -11
  17. package/dist/{PieSeries-B2fW3z0s.js → PieSeries-3iLRbqFv.js} +34 -32
  18. package/dist/{RoundedRectangle-CWLi2PXn.js → RoundedRectangle-CqMMmPM0.js} +4 -4
  19. package/dist/{Scrollbar-D86MJyr2.js → Scrollbar-BzSBcIUt.js} +4 -4
  20. package/dist/{Slice-B19rbYDZ.js → Slice-CS23iLiS.js} +2 -2
  21. package/dist/{Tick-2bcLyHpF.js → Tick-BADQ8QeT.js} +15 -15
  22. package/dist/Tooltip-A_HlttXp.js +3606 -0
  23. package/dist/{XYCursor-C8WktvKM.js → XYCursor-gHAo40xC.js} +3 -3
  24. package/dist/{ZoomableContainer-DYyqwaMb.js → ZoomableContainer-Brs1wHM1.js} +9 -9
  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 +181 -156
  28. package/dist/components/charts/column-line-mix/logic.js +80 -77
  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 +123 -174
  35. package/dist/components/charts/logaritmic-scale/logic.js +69 -60
  36. package/dist/components/charts/multiple-value-axes/logic.js +93 -88
  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 +103 -91
  43. package/dist/components/metric-card/MetricChart.js +29 -28
  44. package/dist/components/metric-card/index.js +1 -1
  45. package/dist/components/metric-card/logic.js +74 -67
  46. package/dist/components/metric-card/styled.js +55 -46
  47. package/package.json +1 -1
  48. package/dist/AnimatedTheme-jnasw6rT.js +0 -11305
@@ -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 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(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: Q.classNames.concat([T.className])
34
36
  });
35
- class F extends T {
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 N(M.new({
43
+ value: this.addDisposer(new q(J.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: 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, 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, 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, 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, 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 = 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 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, a, c, r, o, u, g, d, w, b);
72
+ this._updateCandleGraphics(e, l, n, r, i, p, h, d, w, F);
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, 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 = 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;
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 = 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 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 && 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);
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(), H(this.allColumnsData, (i) => {
93
+ e.clear(), B(this.allColumnsData, (o) => {
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 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 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 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(F, "className", {
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(F, "classNames", {
112
+ Object.defineProperty(R, "classNames", {
111
113
  enumerable: !0,
112
114
  configurable: !0,
113
115
  writable: !0,
114
- value: T.classNames.concat([F.className])
116
+ value: N.classNames.concat([R.className])
115
117
  });
116
- const de = (P) => {
117
- const e = Z(), i = q({
118
- props: P,
118
+ const Le = (V) => {
119
+ const e = le(), o = ne({
120
+ props: V,
119
121
  name: "HCCandlestickChart"
120
122
  }), {
121
- data: h,
122
- seriesName: Y,
123
- height: x = "100%",
123
+ data: g,
124
+ seriesName: x,
125
+ height: Y = "100%",
124
126
  width: y = "100%",
125
127
  chartId: X = "candlestick-chart",
126
- showVolume: a = !1,
127
- risingColor: c = e.palette.success.main,
128
+ showVolume: l = !1,
129
+ risingColor: n = 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,
131
+ loading: i = !1,
132
+ emptyMessage: p = "No data available",
133
+ baseInterval: h,
132
134
  sx: d,
133
135
  ...w
134
- } = i, s = J.orderBy(h, ["date"]), p = {
135
- ...i,
136
- height: x,
136
+ } = o, s = he.orderBy(g, ["date"]), m = {
137
+ ...o,
138
+ height: Y,
137
139
  width: y,
138
140
  chartId: X,
139
- showVolume: a,
140
- risingColor: c,
141
+ showVolume: l,
142
+ risingColor: n,
141
143
  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)
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 l = t.container.children.push(
156
- $.new(t, {
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 = l, l.set(
168
+ f.current = a, a.set(
166
169
  "cursor",
167
- ee.new(t, {
170
+ de.new(t, {
168
171
  behavior: "zoomX"
169
172
  })
170
173
  ).lineY.set("visible", !1);
171
- const v = l.xAxes.push(
172
- te.new(t, {
174
+ const b = a.xAxes.push(
175
+ we.new(t, {
173
176
  maxDeviation: 0.3,
174
177
  groupData: !0,
175
- baseInterval: g || { timeUnit: "day", count: 1 },
176
- renderer: se.new(t, {
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
- ), D = l.yAxes.push(
182
- E.new(t, {
183
- renderer: z.new(t, {})
183
+ ), C = a.yAxes.push(
184
+ U.new(t, {
185
+ renderer: Z.new(t, {})
184
186
  })
185
187
  );
186
- (O = v.get("renderer")) == null || O.grid.template.setAll({
187
- stroke: m(e.palette.divider),
188
+ (M = b.get("renderer")) == null || M.grid.template.setAll({
189
+ stroke: u(e.palette.divider),
188
190
  strokeOpacity: 1
189
- }), (R = v.get("renderer")) == null || R.labels.template.setAll({
191
+ }), (j = b.get("renderer")) == null || j.labels.template.setAll({
190
192
  paddingTop: 12
191
- }), (V = D.get("renderer")) == null || V.grid.template.setAll({
192
- stroke: m(e.palette.divider),
193
+ }), (G = C.get("renderer")) == null || G.grid.template.setAll({
194
+ stroke: u(e.palette.divider),
193
195
  strokeOpacity: 1
194
196
  });
195
- const _ = l.series.push(
196
- F.new(t, {
197
- name: Y || "Price",
198
- xAxis: v,
199
- yAxis: D,
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
- _.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, {
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 k = null, L = null;
227
- return a && (L = l.yAxes.push(
228
- E.new(t, {
229
- renderer: z.new(t, {
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
- ), k = l.series.push(
235
- T.new(t, {
227
+ ), _ = a.series.push(
228
+ N.new(t, {
236
229
  name: "Volume",
237
- xAxis: v,
238
- yAxis: L,
230
+ xAxis: b,
231
+ yAxis: S,
239
232
  valueYField: "volume",
240
233
  valueXField: "date",
241
- fill: m("#2962ff"),
242
- stroke: m("#2962ff"),
234
+ fill: u("#2962ff"),
235
+ stroke: u("#2962ff"),
243
236
  opacity: 0.6
244
237
  })
245
- ), k.columns.template.setAll({
246
- width: Q(80)
247
- }), k.data.processor = I.new(t, {
238
+ ), _.columns.template.setAll({
239
+ width: pe(80)
240
+ }), _.data.processor = K.new(t, {
248
241
  dateFormat: "i",
249
242
  dateFields: ["date"]
250
- })), _.data.setAll(s), a && k && k.data.setAll(s), l.appear(1e3), _.appear(1e3), () => {
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]), S(() => {
254
- if (f.current && n.current) {
278
+ }, [e.palette.mode]), z(() => {
279
+ if (f.current && c.current) {
255
280
  const t = f.current.series.getIndex(
256
281
  0
257
- ), l = a ? f.current.series.getIndex(1) : null;
258
- t == null || t.data.setAll(s), l == null || l.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, a]), 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: m(c),
265
- stroke: m(c)
289
+ fill: u(n),
290
+ stroke: u(n)
266
291
  }), t.columns.template.states.create("dropFromPrevious", {
267
- fill: m(r),
268
- stroke: m(r)
292
+ fill: u(r),
293
+ stroke: u(r)
269
294
  }));
270
- }, [c, r]), {
271
- chartDivRef: b,
272
- data: h,
273
- seriesName: Y,
274
- height: x,
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: a,
278
- risingColor: c,
302
+ showVolume: l,
303
+ risingColor: n,
279
304
  fallingColor: r,
280
- loading: o,
281
- emptyMessage: u,
305
+ loading: i,
306
+ emptyMessage: p,
282
307
  sx: d,
283
308
  other: w,
284
- ownerState: p
309
+ ownerState: m
285
310
  };
286
311
  };
287
312
  export {
288
- de as useCandlestickChartLogic
313
+ Le as useCandlestickChartLogic
289
314
  };