@hybridcore/ui 1.6.9 → 1.6.11

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 (51) hide show
  1. package/dist/{AnimatedTheme-BOKdw2Oy.js → AnimatedTheme-D3VZKKNV.js} +6 -6
  2. package/dist/{AxisRenderer-lUbezuh7.js → AxisRenderer-Doyw-FTI.js} +6 -6
  3. package/dist/{AxisRendererY-DbSiyb45.js → AxisRendererY-BylCU67e.js} +3 -3
  4. package/dist/{Bullet-PgoNb3Jv.js → Bullet-C6357hTv.js} +1 -1
  5. package/dist/{Button-XBf4Mwz-.js → Button-DGOT8RcT.js} +3 -3
  6. package/dist/{CategoryAxis-B8KQp1pE.js → CategoryAxis-B5uTZjhL.js} +3 -3
  7. package/dist/{Circle-BWRdiMpG.js → Circle-DhzVdFBd.js} +1 -1
  8. package/dist/{ColorSet-DDmFoKtZ.js → ColorSet-DGLMpbL3.js} +1 -1
  9. package/dist/{ColumnSeries-rgnGm-Bg.js → ColumnSeries-CqJ-563p.js} +28 -28
  10. package/dist/{DataProcessor-CvIe9BVn.js → DataProcessor-WXzhvIg6.js} +1 -1
  11. package/dist/{DateAxis-zNtbSVjW.js → DateAxis-lJZjbAS-.js} +4 -4
  12. package/dist/{Entity-CCUIdRAr.js → Entity-4Lr2piVN.js} +66 -66
  13. package/dist/GaplessDateAxis-DowssQ6y.js +296 -0
  14. package/dist/{Hierarchy-CCvGsF1A.js → Hierarchy-DPEcTr0v.js} +8 -8
  15. package/dist/{Legend-kbCFjJAW.js → Legend-CTb6rZz_.js} +4 -4
  16. package/dist/{LineSeries-BLFvwrLT.js → LineSeries-Dg1aytHA.js} +4 -4
  17. package/dist/{LinearGradient-C7rnipF7.js → LinearGradient-D1hzMjaW.js} +2 -2
  18. package/dist/{PieSeries-3iLRbqFv.js → PieSeries-C9YUWMnA.js} +8 -8
  19. package/dist/{RoundedRectangle-CqMMmPM0.js → RoundedRectangle-B23Oh_r6.js} +2 -2
  20. package/dist/{Scrollbar-BzSBcIUt.js → Scrollbar-CSoXoZSe.js} +4 -4
  21. package/dist/{Slice-CS23iLiS.js → Slice-CIP7Vmzu.js} +11 -11
  22. package/dist/{Tick-BADQ8QeT.js → Tick-CRu6rQQy.js} +2 -2
  23. package/dist/{Tooltip-A_HlttXp.js → Tooltip-RhAldW7s.js} +13 -13
  24. package/dist/{XYCursor-gHAo40xC.js → XYCursor-Z-Ral42q.js} +3 -3
  25. package/dist/{ZoomableContainer-Brs1wHM1.js → ZoomableContainer-D1laxHnA.js} +4 -4
  26. package/dist/components/charts/_common/tooltip.js +2 -2
  27. package/dist/components/charts/_common/utils.js +2 -2
  28. package/dist/components/charts/candlestick/logic.js +176 -173
  29. package/dist/components/charts/chart-wrapper/index.js +36 -34
  30. package/dist/components/charts/column-line-mix/logic.js +72 -65
  31. package/dist/components/charts/donut-chart/logic.js +4 -4
  32. package/dist/components/charts/drill-down-treemap/logic.js +5 -5
  33. package/dist/components/charts/drill-down-voronoi-treemap/logic.js +5 -5
  34. package/dist/components/charts/forecast-cone/index.js +52 -0
  35. package/dist/components/charts/forecast-cone/logic.js +331 -0
  36. package/dist/components/charts/forecast-cone/styled.js +12 -0
  37. package/dist/components/charts/heatmap/logic.js +9 -9
  38. package/dist/components/charts/highlighting-line-data/logic.js +10 -10
  39. package/dist/components/charts/line/logic.js +96 -82
  40. package/dist/components/charts/logaritmic-scale/logic.js +71 -64
  41. package/dist/components/charts/multiple-value-axes/logic.js +101 -95
  42. package/dist/components/charts/nested-pie/logic.js +3 -3
  43. package/dist/components/charts/packed-circles/logic.js +7 -7
  44. package/dist/components/charts/pie-chart/logic.js +4 -4
  45. package/dist/components/charts/stacked-area-radar/logic.js +9 -9
  46. package/dist/components/charts/stacked-column-chart/logic.js +10 -10
  47. package/dist/components/charts/xy-chart/logic.js +74 -71
  48. package/dist/components/metric-card/MetricChart.js +9 -9
  49. package/dist/main.d.ts +82 -1
  50. package/dist/main.js +167 -165
  51. package/package.json +1 -1
@@ -1,18 +1,19 @@
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-D3VZKKNV.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-4Lr2piVN.js";
7
+ import { X as fe, V as q } from "../../../AxisRenderer-Doyw-FTI.js";
8
+ import { X as we } from "../../../XYCursor-Z-Ral42q.js";
9
+ import { A as xe, a as J } from "../../../AxisRendererY-BylCU67e.js";
10
+ import { C as G } from "../../../ColumnSeries-CqJ-563p.js";
11
+ import { R as te } from "../../../RoundedRectangle-B23Oh_r6.js";
12
+ import { a as K, b as Q } from "../../../Tooltip-RhAldW7s.js";
13
+ import { D as ee } from "../../../DataProcessor-WXzhvIg6.js";
14
+ import { G as Ye } from "../../../GaplessDateAxis-DowssQ6y.js";
15
+ import { D as ye } from "../../../DateAxis-lJZjbAS-.js";
16
+ class T extends te {
16
17
  _beforeChanged() {
17
18
  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
19
  }
@@ -32,130 +33,132 @@ Object.defineProperty(T, "classNames", {
32
33
  enumerable: !0,
33
34
  configurable: !0,
34
35
  writable: !0,
35
- value: Q.classNames.concat([T.className])
36
+ value: te.classNames.concat([T.className])
36
37
  });
37
- class R extends N {
38
+ class V extends G {
38
39
  constructor() {
39
40
  super(...arguments), Object.defineProperty(this, "columns", {
40
41
  enumerable: !0,
41
42
  configurable: !0,
42
43
  writable: !0,
43
- value: this.addDisposer(new q(J.new({
44
+ value: this.addDisposer(new K(Q.new({
44
45
  themeTags: ["autocolor"]
45
46
  }), () => T._new(this._root, {
46
- themeTags: W(this.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
47
+ themeTags: U(this.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
47
48
  }, [this.columns.template])))
48
49
  });
49
50
  }
50
51
  /**
51
52
  * @ignore
52
53
  */
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
+ makeColumn(e, s) {
55
+ const m = s.make();
56
+ return this.get("turboMode") ? m.virtualParent = this.chart : this.mainContainer.children.push(m), m._setDataItem(e), s.push(m), m;
56
57
  }
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";
58
+ _updateGraphics(e, s, m) {
59
+ super._updateGraphics(e, s, m);
60
+ const w = this.getRaw("xAxis"), x = this.getRaw("yAxis");
61
+ let Y = this.get("vcy", 1), y = this.get("vcx", 1), h, c, r, i, d, u, g, f, 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)), _;
62
+ if (m == 0) {
63
+ let v = x.getDataItemPositionY(e, this._yOpenField, 1, Y), t = x.getDataItemPositionY(e, this._yField, 1, Y);
64
+ i = x.getDataItemPositionY(e, this._yLowField, 1, Y), f = x.getDataItemPositionY(e, this._yHighField, 1, Y), g = Math.max(v, t), r = Math.min(v, t);
65
+ let n = this._aLocationX0 + D - 0.5, C = this._aLocationX1 + o - 0.5;
66
+ h = w.getDataItemPositionX(e, this._xField, n + (C - n) / 2, y), c = h, d = h, u = h, _ = "vertical";
66
67
  } 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";
68
+ let v = w.getDataItemPositionX(e, this._xOpenField, 1, y), t = w.getDataItemPositionX(e, this._xField, 1, y);
69
+ c = w.getDataItemPositionX(e, this._xLowField, 1, y), u = w.getDataItemPositionX(e, this._xHighField, 1, y), d = Math.max(v, t), h = Math.min(v, t);
70
+ let n = this._aLocationY0 + a - 0.5, C = this._aLocationY1 + l - 0.5;
71
+ r = x.getDataItemPositionY(e, this._yField, n + (C - n) / 2, Y), i = r, g = r, f = r, _ = "horizontal";
71
72
  }
72
- this._updateCandleGraphics(e, l, n, r, i, p, h, d, w, F);
73
+ this._updateCandleGraphics(e, h, c, r, i, d, u, g, f, _);
73
74
  }
74
- _updateCandleGraphics(e, o, g, x, Y, y, X, l, n, r) {
75
+ _updateCandleGraphics(e, s, m, w, x, Y, y, h, c, r) {
75
76
  let i = e.get("graphics");
76
77
  if (i) {
77
- let p = this.getPoint(o, x), h = this.getPoint(g, Y), d = this.getPoint(y, l), w = this.getPoint(X, n);
78
+ let d = this.getPoint(s, w), u = this.getPoint(m, x), g = this.getPoint(Y, h), f = this.getPoint(y, c);
78
79
  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;
80
+ const o = this.allColumnsData[this.allColumnsData.length - 1];
81
+ 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 = f.x, o.highY1 = f.y;
81
82
  } 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);
83
+ let o = i.x(), l = i.y();
84
+ 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", f.x - o), i.set("highY1", f.y - l), i.set("orientation", r);
85
+ let D = e.get("rangeGraphics");
86
+ D && Z(D, (a) => {
87
+ 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", f.x - o), a.set("highY1", f.y - l), a.set("orientation", r);
87
88
  });
88
89
  }
89
90
  }
90
91
  }
91
92
  _afterColumnsDraw() {
92
93
  this.get("turboMode") && this.allColumns.set("draw", (e) => {
93
- e.clear(), B(this.allColumnsData, (o) => {
94
+ e.clear(), Z(this.allColumnsData, (s) => {
94
95
  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();
96
+ const m = s.width, w = 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, f = s.lowY1, o = s.highX0, l = s.highY0, D = s.highX1, a = s.highY1;
97
+ e.beginFill(h, i), e.beginPath(), e.lineStyle(c, y, r), e.drawRect(x, Y, m, w), e.moveTo(d, u), e.lineTo(g, f), e.moveTo(o, l), e.lineTo(D, a), e.endStroke(), e.endFill();
97
98
  });
98
99
  });
99
100
  }
100
101
  _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"])
102
+ super._processAxisRange(e), e.columns = new K(Q.new({}), () => T._new(this._root, {
103
+ themeTags: U(e.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
103
104
  }, [this.columns.template, e.columns.template]));
104
105
  }
105
106
  }
106
- Object.defineProperty(R, "className", {
107
+ Object.defineProperty(V, "className", {
107
108
  enumerable: !0,
108
109
  configurable: !0,
109
110
  writable: !0,
110
111
  value: "CandlestickSeries"
111
112
  });
112
- Object.defineProperty(R, "classNames", {
113
+ Object.defineProperty(V, "classNames", {
113
114
  enumerable: !0,
114
115
  configurable: !0,
115
116
  writable: !0,
116
- value: N.classNames.concat([R.className])
117
+ value: G.classNames.concat([V.className])
117
118
  });
118
- const Le = (V) => {
119
- const e = le(), o = ne({
120
- props: V,
119
+ const $e = ($) => {
120
+ const e = he(), s = ce({
121
+ props: $,
121
122
  name: "HCCandlestickChart"
122
123
  }), {
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,
124
+ data: m,
125
+ seriesName: w,
126
+ height: x = "100%",
127
+ width: Y = "100%",
128
+ chartId: y = "candlestick-chart",
129
+ showVolume: h = !1,
130
+ risingColor: c = e.palette.success.main,
130
131
  fallingColor: r = e.palette.error.main,
131
132
  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,
133
+ emptyMessage: d = "No data available",
134
+ baseInterval: u,
135
+ skipEmptyDates: g = !1,
136
+ sx: f,
137
+ ...o
138
+ } = s, l = ue.orderBy(m, ["date"]), D = {
139
+ ...s,
140
+ height: x,
141
+ width: Y,
142
+ chartId: y,
143
+ showVolume: h,
144
+ risingColor: c,
143
145
  fallingColor: r,
144
146
  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)
147
+ emptyMessage: d,
148
+ baseInterval: u,
149
+ skipEmptyDates: g
150
+ }, a = N(null), _ = N(null), v = N(null);
151
+ return ge(() => {
152
+ var j, H, E;
153
+ if (!v.current) return;
154
+ const t = le.new(v.current);
155
+ _.current = t, t.setThemes([ne.new(t)]), t.interfaceColors.setAll({
156
+ text: p(e.palette.text.primary),
157
+ grid: p(e.palette.divider),
158
+ stroke: p(e.palette.divider)
156
159
  });
157
- const a = t.container.children.push(
158
- me.new(t, {
160
+ const n = t.container.children.push(
161
+ fe.new(t, {
159
162
  panX: !0,
160
163
  panY: !0,
161
164
  wheelX: "none",
@@ -165,40 +168,40 @@ const Le = (V) => {
165
168
  layout: t.verticalLayout
166
169
  })
167
170
  );
168
- f.current = a, a.set(
171
+ a.current = n, n.set(
169
172
  "cursor",
170
- de.new(t, {
173
+ we.new(t, {
171
174
  behavior: "zoomX"
172
175
  })
173
176
  ).lineY.set("visible", !1);
174
- const b = a.xAxes.push(
175
- we.new(t, {
177
+ const C = g ? Ye : ye, L = n.xAxes.push(
178
+ C.new(t, {
176
179
  maxDeviation: 0.3,
177
180
  groupData: !0,
178
- baseInterval: h || { timeUnit: "day", count: 1 },
179
- renderer: fe.new(t, {
181
+ baseInterval: u || { timeUnit: "day", count: 1 },
182
+ renderer: xe.new(t, {
180
183
  minorGridEnabled: !0
181
184
  })
182
185
  })
183
- ), C = a.yAxes.push(
184
- U.new(t, {
185
- renderer: Z.new(t, {})
186
+ ), S = n.yAxes.push(
187
+ q.new(t, {
188
+ renderer: J.new(t, {})
186
189
  })
187
190
  );
188
- (M = b.get("renderer")) == null || M.grid.template.setAll({
189
- stroke: u(e.palette.divider),
191
+ (j = L.get("renderer")) == null || j.grid.template.setAll({
192
+ stroke: p(e.palette.divider),
190
193
  strokeOpacity: 1
191
- }), (j = b.get("renderer")) == null || j.labels.template.setAll({
194
+ }), (H = L.get("renderer")) == null || H.labels.template.setAll({
192
195
  paddingTop: 12
193
- }), (G = C.get("renderer")) == null || G.grid.template.setAll({
194
- stroke: u(e.palette.divider),
196
+ }), (E = S.get("renderer")) == null || E.grid.template.setAll({
197
+ stroke: p(e.palette.divider),
195
198
  strokeOpacity: 1
196
199
  });
197
- const A = a.series.push(
198
- R.new(t, {
199
- name: x || "Price",
200
- xAxis: b,
201
- yAxis: C,
200
+ const A = n.series.push(
201
+ V.new(t, {
202
+ name: w || "Price",
203
+ xAxis: L,
204
+ yAxis: S,
202
205
  valueXField: "date",
203
206
  openValueYField: "open",
204
207
  highValueYField: "high",
@@ -207,108 +210,108 @@ const Le = (V) => {
207
210
  })
208
211
  );
209
212
  A.columns.template.states.create("riseFromPrevious", {
210
- fill: u(n),
211
- stroke: u(n)
213
+ fill: p(c),
214
+ stroke: p(c)
212
215
  }), A.columns.template.states.create("dropFromPrevious", {
213
- fill: u(r),
214
- stroke: u(r)
215
- }), A.data.processor = K.new(t, {
216
+ fill: p(r),
217
+ stroke: p(r)
218
+ }), A.data.processor = ee.new(t, {
216
219
  dateFormat: "i",
217
220
  dateFields: ["date"]
218
221
  });
219
- let _ = null, S = null;
220
- l && (S = a.yAxes.push(
221
- U.new(t, {
222
- renderer: Z.new(t, {
222
+ let F = null, M = null;
223
+ h && (M = n.yAxes.push(
224
+ q.new(t, {
225
+ renderer: J.new(t, {
223
226
  opposite: !0
224
227
  }),
225
228
  numberFormat: "#a"
226
229
  })
227
- ), _ = a.series.push(
228
- N.new(t, {
230
+ ), F = n.series.push(
231
+ G.new(t, {
229
232
  name: "Volume",
230
- xAxis: b,
231
- yAxis: S,
233
+ xAxis: L,
234
+ yAxis: M,
232
235
  valueYField: "volume",
233
236
  valueXField: "date",
234
- fill: u("#2962ff"),
235
- stroke: u("#2962ff"),
237
+ fill: p("#2962ff"),
238
+ stroke: p("#2962ff"),
236
239
  opacity: 0.6
237
240
  })
238
- ), _.columns.template.setAll({
239
- width: pe(80)
240
- }), _.data.processor = K.new(t, {
241
+ ), F.columns.template.setAll({
242
+ width: de(80)
243
+ }), F.data.processor = ee.new(t, {
241
244
  dateFormat: "i",
242
245
  dateFields: ["date"]
243
- })), A.data.setAll(s), l && _ && _.data.setAll(s);
244
- const ee = ue(h);
245
- return ge({
246
+ })), A.data.setAll(l), h && F && F.data.setAll(l);
247
+ const se = pe(u);
248
+ return me({
246
249
  root: t,
247
- chart: a,
250
+ chart: n,
248
251
  theme: e,
249
252
  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
+ var W;
254
+ const b = A.get("tooltipDataItem"), O = b == null ? void 0 : b.get("valueY");
255
+ if (b === void 0 || O === void 0 || O === null)
253
256
  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)}`
257
+ 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 = [
258
+ `Open: ${P(k)}`,
259
+ `High: ${P(oe)}`,
260
+ `Low: ${P(ie)}`,
261
+ `Close: ${P(O)}`
259
262
  ];
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)}%[/]`
263
+ if (typeof k == "number" && k !== 0) {
264
+ const X = (O - k) / k * 100, re = p(X >= 0 ? c : r), ae = X > 0 ? "+" : "";
265
+ R.push(
266
+ `Change: [${re.toCSSHex()}]${ae}${X.toFixed(2)}%[/]`
264
267
  );
265
268
  }
266
- if (l && _) {
267
- const v = (I = _.get("tooltipDataItem")) == null ? void 0 : I.get("valueY");
268
- v != null && O.push(`Volume: ${k(v)}`);
269
+ if (h && F) {
270
+ const X = (W = F.get("tooltipDataItem")) == null ? void 0 : W.get("valueY");
271
+ X != null && R.push(`Volume: ${P(X)}`);
269
272
  }
270
- return E ? `[bold]${E}[/]
271
- ${O.join(`
272
- `)}` : O.join(`
273
+ return z ? `[bold]${z}[/]
274
+ ${R.join(`
275
+ `)}` : R.join(`
273
276
  `);
274
277
  }
275
- }), a.appear(1e3), A.appear(1e3), () => {
278
+ }), n.appear(1e3), A.appear(1e3), () => {
276
279
  t.dispose();
277
280
  };
278
- }, [e.palette.mode]), z(() => {
279
- if (f.current && c.current) {
280
- const t = f.current.series.getIndex(
281
+ }, [e.palette.mode, g]), B(() => {
282
+ if (a.current && _.current) {
283
+ const t = a.current.series.getIndex(
281
284
  0
282
- ), a = l ? f.current.series.getIndex(1) : null;
283
- t == null || t.data.setAll(s), a == null || a.data.setAll(s);
285
+ ), n = h ? a.current.series.getIndex(1) : null;
286
+ t == null || t.data.setAll(l), n == null || n.data.setAll(l);
284
287
  }
285
- }, [s, l]), z(() => {
286
- if (!f.current) return;
287
- const t = f.current.series.getIndex(0);
288
+ }, [l, h]), B(() => {
289
+ if (!a.current) return;
290
+ const t = a.current.series.getIndex(0);
288
291
  t && (t.columns.template.states.create("riseFromPrevious", {
289
- fill: u(n),
290
- stroke: u(n)
292
+ fill: p(c),
293
+ stroke: p(c)
291
294
  }), t.columns.template.states.create("dropFromPrevious", {
292
- fill: u(r),
293
- stroke: u(r)
295
+ fill: p(r),
296
+ stroke: p(r)
294
297
  }));
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,
298
+ }, [c, r]), {
299
+ chartDivRef: v,
300
+ data: m,
301
+ seriesName: w,
302
+ height: x,
303
+ width: Y,
304
+ chartId: y,
305
+ showVolume: h,
306
+ risingColor: c,
304
307
  fallingColor: r,
305
308
  loading: i,
306
- emptyMessage: p,
307
- sx: d,
308
- other: w,
309
- ownerState: m
309
+ emptyMessage: d,
310
+ sx: f,
311
+ other: o,
312
+ ownerState: D
310
313
  };
311
314
  };
312
315
  export {
313
- Le as useCandlestickChartLogic
316
+ $e as useCandlestickChartLogic
314
317
  };
@@ -1,47 +1,49 @@
1
- import { jsxs as i, jsx as r, Fragment as l } from "react/jsx-runtime";
2
- import { Typography as h, Divider as C } from "@mui/material";
3
- import { Loading as d } from "../../loading/index.js";
4
- import { CandlestickChart as c } from "../candlestick/index.js";
1
+ import { jsxs as a, jsx as r, Fragment as l } from "react/jsx-runtime";
2
+ import { Typography as C, Divider as h } from "@mui/material";
3
+ import { Loading as c } from "../../loading/index.js";
4
+ import { CandlestickChart as d } from "../candlestick/index.js";
5
5
  import { ColumnLineMix as f } from "../column-line-mix/index.js";
6
6
  import { DonutChart as s } from "../donut-chart/index.js";
7
7
  import { DrillDownTreemap as u } from "../drill-down-treemap/index.js";
8
8
  import { DrillDownVoronoiTreemap as D } from "../drill-down-voronoi-treemap/index.js";
9
- import { Heatmap as L } from "../heatmap/index.js";
10
- import { LineChart as g } from "../line/index.js";
11
- import { LogaritmicScale as x } from "../logaritmic-scale/index.js";
12
- import { MultipleValueAxes as k } from "../multiple-value-axes/index.js";
13
- import { NestedPie as S } from "../nested-pie/index.js";
14
- import { PackedCircles as P } from "../packed-circles/index.js";
15
- import { PieChart as w } from "../pie-chart/index.js";
16
- import { StackedAreaRadar as A } from "../stacked-area-radar/index.js";
17
- import { StackedColumnChart as T } from "../stacked-column-chart/index.js";
18
- import { XYChart as W } from "../xy-chart/index.js";
19
- import { useChartWrapperLogic as M } from "./logic.js";
20
- import { ChartWrapperRoot as V, ChartWrapperHeader as v, ChartWrapperContent as y } from "./styled.js";
21
- const _ = (a) => {
22
- const { title: m, type: o, chartProps: e, loading: p, ownerState: t, sx: n } = M(a);
23
- return /* @__PURE__ */ i(V, { ownerState: t, sx: n, children: [
24
- /* @__PURE__ */ r(v, { ownerState: t, children: /* @__PURE__ */ r(h, { sx: { paddingLeft: "0.5rem" }, variant: "h3", children: m }) }),
25
- /* @__PURE__ */ r(C, {}),
26
- /* @__PURE__ */ r(y, { ownerState: t, children: p ? /* @__PURE__ */ r(d, { show: !0, position: "absolute" }) : /* @__PURE__ */ i(l, { children: [
27
- o === "MultipleValueAxes" && /* @__PURE__ */ r(k, { ...e }),
28
- o === "XYChart" && /* @__PURE__ */ r(W, { ...e }),
29
- o === "HeatLegend" && /* @__PURE__ */ r(L, { ...e }),
30
- o === "PieChart" && /* @__PURE__ */ r(w, { ...e }),
9
+ import { ForecastConeChart as L } from "../forecast-cone/index.js";
10
+ import { Heatmap as g } from "../heatmap/index.js";
11
+ import { LineChart as x } from "../line/index.js";
12
+ import { LogaritmicScale as k } from "../logaritmic-scale/index.js";
13
+ import { MultipleValueAxes as S } from "../multiple-value-axes/index.js";
14
+ import { NestedPie as P } from "../nested-pie/index.js";
15
+ import { PackedCircles as w } from "../packed-circles/index.js";
16
+ import { PieChart as A } from "../pie-chart/index.js";
17
+ import { StackedAreaRadar as T } from "../stacked-area-radar/index.js";
18
+ import { StackedColumnChart as W } from "../stacked-column-chart/index.js";
19
+ import { XYChart as M } from "../xy-chart/index.js";
20
+ import { useChartWrapperLogic as V } from "./logic.js";
21
+ import { ChartWrapperRoot as v, ChartWrapperHeader as y, ChartWrapperContent as F } from "./styled.js";
22
+ const rr = (i) => {
23
+ const { title: m, type: o, chartProps: e, loading: p, ownerState: t, sx: n } = V(i);
24
+ return /* @__PURE__ */ a(v, { ownerState: t, sx: n, children: [
25
+ /* @__PURE__ */ r(y, { ownerState: t, children: /* @__PURE__ */ r(C, { sx: { paddingLeft: "0.5rem" }, variant: "h3", children: m }) }),
26
+ /* @__PURE__ */ r(h, {}),
27
+ /* @__PURE__ */ r(F, { ownerState: t, children: p ? /* @__PURE__ */ r(c, { show: !0, position: "absolute" }) : /* @__PURE__ */ a(l, { children: [
28
+ o === "MultipleValueAxes" && /* @__PURE__ */ r(S, { ...e }),
29
+ o === "XYChart" && /* @__PURE__ */ r(M, { ...e }),
30
+ o === "HeatLegend" && /* @__PURE__ */ r(g, { ...e }),
31
+ o === "PieChart" && /* @__PURE__ */ r(A, { ...e }),
31
32
  o === "DonutChart" && /* @__PURE__ */ r(s, { ...e }),
32
- o === "StackedColumnChart" && /* @__PURE__ */ r(T, { ...e }),
33
- o === "StackedAreaRadar" && /* @__PURE__ */ r(A, { ...e }),
34
- o === "LineChart" && /* @__PURE__ */ r(g, { ...e }),
35
- o === "NestedPie" && /* @__PURE__ */ r(S, { ...e }),
36
- o === "SingleLevelPackedCircles" && /* @__PURE__ */ r(P, { ...e }),
37
- o === "LogarithmicScale" && /* @__PURE__ */ r(x, { ...e }),
33
+ o === "StackedColumnChart" && /* @__PURE__ */ r(W, { ...e }),
34
+ o === "StackedAreaRadar" && /* @__PURE__ */ r(T, { ...e }),
35
+ o === "LineChart" && /* @__PURE__ */ r(x, { ...e }),
36
+ o === "NestedPie" && /* @__PURE__ */ r(P, { ...e }),
37
+ o === "SingleLevelPackedCircles" && /* @__PURE__ */ r(w, { ...e }),
38
+ o === "LogarithmicScale" && /* @__PURE__ */ r(k, { ...e }),
38
39
  o === "ColumnAndLineMix" && /* @__PURE__ */ r(f, { ...e }),
39
40
  o === "DrillDownTreemap" && /* @__PURE__ */ r(u, { ...e }),
40
41
  o === "DrillDownVoronoiTreemap" && /* @__PURE__ */ r(D, { ...e }),
41
- o === "CandlestickChart" && /* @__PURE__ */ r(c, { ...e })
42
+ o === "CandlestickChart" && /* @__PURE__ */ r(d, { ...e }),
43
+ o === "ForecastCone" && /* @__PURE__ */ r(L, { ...e })
42
44
  ] }) })
43
45
  ] });
44
46
  };
45
47
  export {
46
- _ as ChartWrapper
48
+ rr as ChartWrapper
47
49
  };