@hybridcore/ui 1.6.9 → 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 (46) hide show
  1. package/dist/{AnimatedTheme-BOKdw2Oy.js → AnimatedTheme-ktdO3Bel.js} +2 -2
  2. package/dist/{AxisRenderer-lUbezuh7.js → AxisRenderer-BCQoUJw6.js} +6 -6
  3. package/dist/{AxisRendererY-DbSiyb45.js → AxisRendererY-AXWvGU6r.js} +3 -3
  4. package/dist/{Bullet-PgoNb3Jv.js → Bullet-Djj7Vs9T.js} +1 -1
  5. package/dist/{Button-XBf4Mwz-.js → Button-BLY4PVJC.js} +3 -3
  6. package/dist/{CategoryAxis-B8KQp1pE.js → CategoryAxis-B6NqW8qd.js} +3 -3
  7. package/dist/{Circle-BWRdiMpG.js → Circle-BnfBNKBD.js} +1 -1
  8. package/dist/{ColorSet-DDmFoKtZ.js → ColorSet-cyPmWGwh.js} +1 -1
  9. package/dist/{ColumnSeries-rgnGm-Bg.js → ColumnSeries-CtRTsn-E.js} +4 -4
  10. package/dist/{DateAxis-zNtbSVjW.js → DateAxis-DEXKps1S.js} +4 -4
  11. package/dist/{Entity-CCUIdRAr.js → Entity-BJCuhdq_.js} +62 -62
  12. package/dist/GaplessDateAxis-B2g2jgSG.js +376 -0
  13. package/dist/{Hierarchy-CCvGsF1A.js → Hierarchy-CEOK8Gzh.js} +8 -8
  14. package/dist/{Legend-kbCFjJAW.js → Legend-CFvQiIfn.js} +4 -4
  15. package/dist/{LineSeries-BLFvwrLT.js → LineSeries-D_IL2qGF.js} +4 -4
  16. package/dist/{LinearGradient-C7rnipF7.js → LinearGradient-CxQyCSEB.js} +2 -2
  17. package/dist/{PieSeries-3iLRbqFv.js → PieSeries-CMH0Z7pz.js} +6 -6
  18. package/dist/{RoundedRectangle-CqMMmPM0.js → RoundedRectangle-BKLX1LKM.js} +2 -2
  19. package/dist/{Scrollbar-BzSBcIUt.js → Scrollbar-CTI7_8Qw.js} +4 -4
  20. package/dist/{Slice-CS23iLiS.js → Slice-BUncQh1B.js} +2 -2
  21. package/dist/{Tick-BADQ8QeT.js → Tick--VhF0xlz.js} +2 -2
  22. package/dist/{Tooltip-A_HlttXp.js → Tooltip-vyZRZWih.js} +13 -13
  23. package/dist/{XYCursor-gHAo40xC.js → XYCursor-CVUSpqb9.js} +3 -3
  24. package/dist/{ZoomableContainer-Brs1wHM1.js → ZoomableContainer-Ca_pDVYQ.js} +4 -4
  25. package/dist/components/charts/_common/tooltip.js +2 -2
  26. package/dist/components/charts/_common/utils.js +2 -2
  27. package/dist/components/charts/candlestick/logic.js +175 -173
  28. package/dist/components/charts/column-line-mix/logic.js +89 -83
  29. package/dist/components/charts/donut-chart/logic.js +4 -4
  30. package/dist/components/charts/drill-down-treemap/logic.js +5 -5
  31. package/dist/components/charts/drill-down-voronoi-treemap/logic.js +5 -5
  32. package/dist/components/charts/heatmap/logic.js +9 -9
  33. package/dist/components/charts/highlighting-line-data/logic.js +10 -10
  34. package/dist/components/charts/line/logic.js +99 -86
  35. package/dist/components/charts/logaritmic-scale/logic.js +78 -72
  36. package/dist/components/charts/multiple-value-axes/logic.js +100 -95
  37. package/dist/components/charts/nested-pie/logic.js +3 -3
  38. package/dist/components/charts/packed-circles/logic.js +7 -7
  39. package/dist/components/charts/pie-chart/logic.js +4 -4
  40. package/dist/components/charts/stacked-area-radar/logic.js +9 -9
  41. package/dist/components/charts/stacked-column-chart/logic.js +10 -10
  42. package/dist/components/charts/xy-chart/logic.js +66 -64
  43. package/dist/components/metric-card/MetricChart.js +9 -9
  44. package/dist/main.d.ts +13 -0
  45. package/package.json +1 -1
  46. package/dist/DataProcessor-CvIe9BVn.js +0 -83
@@ -1,18 +1,18 @@
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 {
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 {
16
16
  _beforeChanged() {
17
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);
18
18
  }
@@ -32,130 +32,132 @@ Object.defineProperty(T, "classNames", {
32
32
  enumerable: !0,
33
33
  configurable: !0,
34
34
  writable: !0,
35
- value: Q.classNames.concat([T.className])
35
+ value: te.classNames.concat([T.className])
36
36
  });
37
- class R extends N {
37
+ class V extends G {
38
38
  constructor() {
39
39
  super(...arguments), Object.defineProperty(this, "columns", {
40
40
  enumerable: !0,
41
41
  configurable: !0,
42
42
  writable: !0,
43
- value: this.addDisposer(new q(J.new({
43
+ value: this.addDisposer(new K(Q.new({
44
44
  themeTags: ["autocolor"]
45
45
  }), () => T._new(this._root, {
46
- themeTags: W(this.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
46
+ themeTags: U(this.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
47
47
  }, [this.columns.template])))
48
48
  });
49
49
  }
50
50
  /**
51
51
  * @ignore
52
52
  */
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;
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;
56
56
  }
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";
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";
66
66
  } else {
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";
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";
71
71
  }
72
- this._updateCandleGraphics(e, l, n, r, i, p, h, d, w, F);
72
+ this._updateCandleGraphics(e, h, c, r, i, d, u, g, w, _);
73
73
  }
74
- _updateCandleGraphics(e, o, g, x, Y, y, X, l, n, r) {
74
+ _updateCandleGraphics(e, s, m, f, x, Y, y, h, c, r) {
75
75
  let i = e.get("graphics");
76
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);
77
+ let d = this.getPoint(s, f), u = this.getPoint(m, x), g = this.getPoint(Y, h), w = this.getPoint(y, c);
78
78
  if (this.get("turboMode")) {
79
- const s = this.allColumnsData[this.allColumnsData.length - 1];
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
+ 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;
81
81
  } else {
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);
84
- let f = e.get("rangeGraphics");
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);
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);
87
87
  });
88
88
  }
89
89
  }
90
90
  }
91
91
  _afterColumnsDraw() {
92
92
  this.get("turboMode") && this.allColumns.set("draw", (e) => {
93
- e.clear(), B(this.allColumnsData, (o) => {
93
+ e.clear(), Z(this.allColumnsData, (s) => {
94
94
  e.beginPath();
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
+ 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();
97
97
  });
98
98
  });
99
99
  }
100
100
  _processAxisRange(e) {
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
+ super._processAxisRange(e), e.columns = new K(Q.new({}), () => T._new(this._root, {
102
+ themeTags: U(e.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
103
103
  }, [this.columns.template, e.columns.template]));
104
104
  }
105
105
  }
106
- Object.defineProperty(R, "className", {
106
+ Object.defineProperty(V, "className", {
107
107
  enumerable: !0,
108
108
  configurable: !0,
109
109
  writable: !0,
110
110
  value: "CandlestickSeries"
111
111
  });
112
- Object.defineProperty(R, "classNames", {
112
+ Object.defineProperty(V, "classNames", {
113
113
  enumerable: !0,
114
114
  configurable: !0,
115
115
  writable: !0,
116
- value: N.classNames.concat([R.className])
116
+ value: G.classNames.concat([V.className])
117
117
  });
118
- const Le = (V) => {
119
- const e = le(), o = ne({
120
- props: V,
118
+ const Ve = ($) => {
119
+ const e = he(), s = ce({
120
+ props: $,
121
121
  name: "HCCandlestickChart"
122
122
  }), {
123
- data: g,
124
- seriesName: x,
125
- height: Y = "100%",
126
- width: y = "100%",
127
- chartId: X = "candlestick-chart",
128
- showVolume: l = !1,
129
- risingColor: n = e.palette.success.main,
123
+ data: m,
124
+ seriesName: f,
125
+ height: x = "100%",
126
+ width: Y = "100%",
127
+ chartId: y = "candlestick-chart",
128
+ showVolume: h = !1,
129
+ risingColor: c = e.palette.success.main,
130
130
  fallingColor: r = e.palette.error.main,
131
131
  loading: i = !1,
132
- emptyMessage: p = "No data available",
133
- baseInterval: h,
134
- sx: d,
135
- ...w
136
- } = o, s = he.orderBy(g, ["date"]), m = {
137
- ...o,
138
- height: Y,
139
- width: y,
140
- chartId: X,
141
- showVolume: l,
142
- risingColor: n,
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,
139
+ height: x,
140
+ width: Y,
141
+ chartId: y,
142
+ showVolume: h,
143
+ risingColor: c,
143
144
  fallingColor: r,
144
145
  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)
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)
156
158
  });
157
- const a = t.container.children.push(
158
- me.new(t, {
159
+ const n = t.container.children.push(
160
+ we.new(t, {
159
161
  panX: !0,
160
162
  panY: !0,
161
163
  wheelX: "none",
@@ -165,40 +167,40 @@ const Le = (V) => {
165
167
  layout: t.verticalLayout
166
168
  })
167
169
  );
168
- f.current = a, a.set(
170
+ a.current = n, n.set(
169
171
  "cursor",
170
- de.new(t, {
172
+ fe.new(t, {
171
173
  behavior: "zoomX"
172
174
  })
173
175
  ).lineY.set("visible", !1);
174
- const b = a.xAxes.push(
175
- we.new(t, {
176
+ const C = g ? Ye : ye, L = n.xAxes.push(
177
+ C.new(t, {
176
178
  maxDeviation: 0.3,
177
179
  groupData: !0,
178
- baseInterval: h || { timeUnit: "day", count: 1 },
179
- renderer: fe.new(t, {
180
+ baseInterval: u || { timeUnit: "day", count: 1 },
181
+ renderer: xe.new(t, {
180
182
  minorGridEnabled: !0
181
183
  })
182
184
  })
183
- ), C = a.yAxes.push(
184
- U.new(t, {
185
- renderer: Z.new(t, {})
185
+ ), S = n.yAxes.push(
186
+ q.new(t, {
187
+ renderer: J.new(t, {})
186
188
  })
187
189
  );
188
- (M = b.get("renderer")) == null || M.grid.template.setAll({
189
- stroke: u(e.palette.divider),
190
+ (j = L.get("renderer")) == null || j.grid.template.setAll({
191
+ stroke: p(e.palette.divider),
190
192
  strokeOpacity: 1
191
- }), (j = b.get("renderer")) == null || j.labels.template.setAll({
193
+ }), (H = L.get("renderer")) == null || H.labels.template.setAll({
192
194
  paddingTop: 12
193
- }), (G = C.get("renderer")) == null || G.grid.template.setAll({
194
- stroke: u(e.palette.divider),
195
+ }), (E = S.get("renderer")) == null || E.grid.template.setAll({
196
+ stroke: p(e.palette.divider),
195
197
  strokeOpacity: 1
196
198
  });
197
- const A = a.series.push(
198
- R.new(t, {
199
- name: x || "Price",
200
- xAxis: b,
201
- yAxis: C,
199
+ const A = n.series.push(
200
+ V.new(t, {
201
+ name: f || "Price",
202
+ xAxis: L,
203
+ yAxis: S,
202
204
  valueXField: "date",
203
205
  openValueYField: "open",
204
206
  highValueYField: "high",
@@ -207,108 +209,108 @@ const Le = (V) => {
207
209
  })
208
210
  );
209
211
  A.columns.template.states.create("riseFromPrevious", {
210
- fill: u(n),
211
- stroke: u(n)
212
+ fill: p(c),
213
+ stroke: p(c)
212
214
  }), A.columns.template.states.create("dropFromPrevious", {
213
- fill: u(r),
214
- stroke: u(r)
215
- }), A.data.processor = K.new(t, {
215
+ fill: p(r),
216
+ stroke: p(r)
217
+ }), A.data.processor = ee.new(t, {
216
218
  dateFormat: "i",
217
219
  dateFields: ["date"]
218
220
  });
219
- let _ = null, S = null;
220
- l && (S = a.yAxes.push(
221
- U.new(t, {
222
- 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, {
223
225
  opposite: !0
224
226
  }),
225
227
  numberFormat: "#a"
226
228
  })
227
- ), _ = a.series.push(
228
- N.new(t, {
229
+ ), F = n.series.push(
230
+ G.new(t, {
229
231
  name: "Volume",
230
- xAxis: b,
231
- yAxis: S,
232
+ xAxis: L,
233
+ yAxis: M,
232
234
  valueYField: "volume",
233
235
  valueXField: "date",
234
- fill: u("#2962ff"),
235
- stroke: u("#2962ff"),
236
+ fill: p("#2962ff"),
237
+ stroke: p("#2962ff"),
236
238
  opacity: 0.6
237
239
  })
238
- ), _.columns.template.setAll({
239
- width: pe(80)
240
- }), _.data.processor = K.new(t, {
240
+ ), F.columns.template.setAll({
241
+ width: de(80)
242
+ }), F.data.processor = ee.new(t, {
241
243
  dateFormat: "i",
242
244
  dateFields: ["date"]
243
- })), A.data.setAll(s), l && _ && _.data.setAll(s);
244
- const ee = ue(h);
245
- return ge({
245
+ })), A.data.setAll(l), h && F && F.data.setAll(l);
246
+ const se = pe(u);
247
+ return me({
246
248
  root: t,
247
- chart: a,
249
+ chart: n,
248
250
  theme: e,
249
251
  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)
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)
253
255
  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)}`
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)}`
259
261
  ];
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)}%[/]`
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)}%[/]`
264
266
  );
265
267
  }
266
- if (l && _) {
267
- const v = (I = _.get("tooltipDataItem")) == null ? void 0 : I.get("valueY");
268
- v != null && O.push(`Volume: ${k(v)}`);
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)}`);
269
271
  }
270
- return E ? `[bold]${E}[/]
271
- ${O.join(`
272
- `)}` : O.join(`
272
+ return z ? `[bold]${z}[/]
273
+ ${R.join(`
274
+ `)}` : R.join(`
273
275
  `);
274
276
  }
275
- }), a.appear(1e3), A.appear(1e3), () => {
277
+ }), n.appear(1e3), A.appear(1e3), () => {
276
278
  t.dispose();
277
279
  };
278
- }, [e.palette.mode]), z(() => {
279
- if (f.current && c.current) {
280
- const t = f.current.series.getIndex(
280
+ }, [e.palette.mode, g]), B(() => {
281
+ if (a.current && _.current) {
282
+ const t = a.current.series.getIndex(
281
283
  0
282
- ), a = l ? f.current.series.getIndex(1) : null;
283
- t == null || t.data.setAll(s), a == null || a.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);
284
286
  }
285
- }, [s, l]), z(() => {
286
- if (!f.current) return;
287
- const t = f.current.series.getIndex(0);
287
+ }, [l, h]), B(() => {
288
+ if (!a.current) return;
289
+ const t = a.current.series.getIndex(0);
288
290
  t && (t.columns.template.states.create("riseFromPrevious", {
289
- fill: u(n),
290
- stroke: u(n)
291
+ fill: p(c),
292
+ stroke: p(c)
291
293
  }), t.columns.template.states.create("dropFromPrevious", {
292
- fill: u(r),
293
- stroke: u(r)
294
+ fill: p(r),
295
+ stroke: p(r)
294
296
  }));
295
- }, [n, r]), {
296
- chartDivRef: F,
297
- data: g,
298
- seriesName: x,
299
- height: Y,
300
- width: y,
301
- chartId: X,
302
- showVolume: l,
303
- risingColor: n,
297
+ }, [c, r]), {
298
+ chartDivRef: v,
299
+ data: m,
300
+ seriesName: f,
301
+ height: x,
302
+ width: Y,
303
+ chartId: y,
304
+ showVolume: h,
305
+ risingColor: c,
304
306
  fallingColor: r,
305
307
  loading: i,
306
- emptyMessage: p,
307
- sx: d,
308
- other: w,
309
- ownerState: m
308
+ emptyMessage: d,
309
+ sx: w,
310
+ other: o,
311
+ ownerState: D
310
312
  };
311
313
  };
312
314
  export {
313
- Le as useCandlestickChartLogic
315
+ Ve as useCandlestickChartLogic
314
316
  };