@hybridcore/ui 1.6.10 → 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 (52) hide show
  1. package/dist/{AnimatedTheme-ktdO3Bel.js → AnimatedTheme-D3VZKKNV.js} +6 -6
  2. package/dist/{AxisRenderer-BCQoUJw6.js → AxisRenderer-Doyw-FTI.js} +6 -6
  3. package/dist/{AxisRendererY-AXWvGU6r.js → AxisRendererY-BylCU67e.js} +3 -3
  4. package/dist/{Bullet-Djj7Vs9T.js → Bullet-C6357hTv.js} +1 -1
  5. package/dist/{Button-BLY4PVJC.js → Button-DGOT8RcT.js} +3 -3
  6. package/dist/{CategoryAxis-B6NqW8qd.js → CategoryAxis-B5uTZjhL.js} +3 -3
  7. package/dist/{Circle-BnfBNKBD.js → Circle-DhzVdFBd.js} +1 -1
  8. package/dist/{ColorSet-cyPmWGwh.js → ColorSet-DGLMpbL3.js} +1 -1
  9. package/dist/{ColumnSeries-CtRTsn-E.js → ColumnSeries-CqJ-563p.js} +28 -28
  10. package/dist/DataProcessor-WXzhvIg6.js +83 -0
  11. package/dist/{DateAxis-DEXKps1S.js → DateAxis-lJZjbAS-.js} +4 -4
  12. package/dist/{Entity-BJCuhdq_.js → Entity-4Lr2piVN.js} +14 -14
  13. package/dist/GaplessDateAxis-DowssQ6y.js +296 -0
  14. package/dist/{Hierarchy-CEOK8Gzh.js → Hierarchy-DPEcTr0v.js} +4 -4
  15. package/dist/{Legend-CFvQiIfn.js → Legend-CTb6rZz_.js} +4 -4
  16. package/dist/{LineSeries-D_IL2qGF.js → LineSeries-Dg1aytHA.js} +4 -4
  17. package/dist/{LinearGradient-CxQyCSEB.js → LinearGradient-D1hzMjaW.js} +2 -2
  18. package/dist/{PieSeries-CMH0Z7pz.js → PieSeries-C9YUWMnA.js} +8 -8
  19. package/dist/{RoundedRectangle-BKLX1LKM.js → RoundedRectangle-B23Oh_r6.js} +2 -2
  20. package/dist/{Scrollbar-CTI7_8Qw.js → Scrollbar-CSoXoZSe.js} +4 -4
  21. package/dist/{Slice-BUncQh1B.js → Slice-CIP7Vmzu.js} +11 -11
  22. package/dist/{Tick--VhF0xlz.js → Tick-CRu6rQQy.js} +2 -2
  23. package/dist/{Tooltip-vyZRZWih.js → Tooltip-RhAldW7s.js} +1 -1
  24. package/dist/{XYCursor-CVUSpqb9.js → XYCursor-Z-Ral42q.js} +3 -3
  25. package/dist/{ZoomableContainer-Ca_pDVYQ.js → ZoomableContainer-D1laxHnA.js} +2 -2
  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 +35 -34
  29. package/dist/components/charts/chart-wrapper/index.js +36 -34
  30. package/dist/components/charts/column-line-mix/logic.js +41 -40
  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 +20 -19
  40. package/dist/components/charts/logaritmic-scale/logic.js +31 -30
  41. package/dist/components/charts/multiple-value-axes/logic.js +19 -18
  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 +29 -28
  48. package/dist/components/metric-card/MetricChart.js +9 -9
  49. package/dist/main.d.ts +69 -1
  50. package/dist/main.js +167 -165
  51. package/package.json +1 -1
  52. package/dist/GaplessDateAxis-B2g2jgSG.js +0 -376
@@ -1,24 +1,25 @@
1
- import { R as M, A as O } from "../../../AnimatedTheme-ktdO3Bel.js";
1
+ import { R as M, A as O } from "../../../AnimatedTheme-D3VZKKNV.js";
2
2
  import { useThemeProps as E, useTheme as P } from "@mui/material";
3
3
  import C from "lodash";
4
4
  import { useId as V, useRef as z, useEffect as G } from "react";
5
5
  import { humanizeLabel as b } from "../_common/format.js";
6
6
  import { attachCombinedAxisTooltip as N } from "../_common/tooltip.js";
7
7
  import { colorSetFromPalette as W, applyValueFormat as q } from "../_common/utils.js";
8
- import { c as l, p as H, a as X } from "../../../Entity-BJCuhdq_.js";
9
- import { X as U, V as _ } from "../../../AxisRenderer-BCQoUJw6.js";
10
- import { S as $ } from "../../../Scrollbar-CTI7_8Qw.js";
11
- import { A as D, a as j } from "../../../AxisRendererY-AXWvGU6r.js";
12
- import { C as J } from "../../../CategoryAxis-B6NqW8qd.js";
13
- import { C as K } from "../../../ColumnSeries-CtRTsn-E.js";
14
- import { D as L, G as Q } from "../../../GaplessDateAxis-B2g2jgSG.js";
15
- import { L as Z } from "../../../LineSeries-D_IL2qGF.js";
16
- import { B as ee } from "../../../Bullet-Djj7Vs9T.js";
17
- import { C as te } from "../../../Circle-BnfBNKBD.js";
18
- import { X as re } from "../../../XYCursor-CVUSpqb9.js";
19
- import { L as ae } from "../../../Legend-CFvQiIfn.js";
20
- import { D as oe } from "../../../DateAxis-DEXKps1S.js";
21
- const Le = (Y) => {
8
+ import { c as l, p as H, a as X } from "../../../Entity-4Lr2piVN.js";
9
+ import { X as U, V as _ } from "../../../AxisRenderer-Doyw-FTI.js";
10
+ import { S as $ } from "../../../Scrollbar-CSoXoZSe.js";
11
+ import { A as D, a as j } from "../../../AxisRendererY-BylCU67e.js";
12
+ import { C as J } from "../../../CategoryAxis-B5uTZjhL.js";
13
+ import { C as K } from "../../../ColumnSeries-CqJ-563p.js";
14
+ import { D as L } from "../../../DataProcessor-WXzhvIg6.js";
15
+ import { L as Q } from "../../../LineSeries-Dg1aytHA.js";
16
+ import { B as Z } from "../../../Bullet-C6357hTv.js";
17
+ import { C as ee } from "../../../Circle-DhzVdFBd.js";
18
+ import { X as te } from "../../../XYCursor-Z-Ral42q.js";
19
+ import { L as re } from "../../../Legend-CTb6rZz_.js";
20
+ import { G as oe } from "../../../GaplessDateAxis-DowssQ6y.js";
21
+ import { D as ae } from "../../../DateAxis-lJZjbAS-.js";
22
+ const Ye = (Y) => {
22
23
  const f = E({ props: Y, name: "HCColumnLineMix" }), {
23
24
  dimensions: t,
24
25
  values: n,
@@ -56,34 +57,34 @@ const Le = (Y) => {
56
57
  "scrollbarX",
57
58
  $.new(e, { orientation: "horizontal" })
58
59
  );
59
- let o, m = p;
60
+ let a, m = p;
60
61
  if (t[0].type === "date") {
61
62
  m = C.orderBy(p, [t[0].value]);
62
- const i = A ? Q : oe;
63
- o = r.xAxes.push(
63
+ const i = A ? oe : ae;
64
+ a = r.xAxes.push(
64
65
  i.new(e, {
65
66
  maxDeviation: 0.1,
66
67
  groupData: !1,
67
68
  baseInterval: h || { timeUnit: "day", count: 1 },
68
69
  renderer: D.new(e, {})
69
70
  })
70
- ), (w = o.get("renderer")) == null || w.grid.template.setAll({
71
+ ), (w = a.get("renderer")) == null || w.grid.template.setAll({
71
72
  stroke: l(s.palette.divider),
72
73
  strokeOpacity: 1
73
74
  });
74
75
  } else
75
- o = r.xAxes.push(
76
+ a = r.xAxes.push(
76
77
  J.new(e, {
77
78
  categoryField: t[0].value,
78
79
  renderer: D.new(e, {})
79
80
  })
80
- ), (v = o.get("renderer")) == null || v.grid.template.setAll({
81
+ ), (v = a.get("renderer")) == null || v.grid.template.setAll({
81
82
  stroke: l(s.palette.divider),
82
83
  strokeOpacity: 1
83
84
  }), e.numberFormatter.setAll({
84
85
  numberFormat: "#",
85
86
  numericFields: ["valueX"]
86
- }), m = C.orderBy(p, [t[0].value]), o.data.setAll(m);
87
+ }), m = C.orderBy(p, [t[0].value]), a.data.setAll(m);
87
88
  const u = r.yAxes.push(
88
89
  _.new(e, {
89
90
  min: 0,
@@ -96,43 +97,43 @@ const Le = (Y) => {
96
97
  strokeOpacity: 1
97
98
  }), n.forEach((i, I) => {
98
99
  if (I === 0) {
99
- const a = r.series.push(
100
+ const o = r.series.push(
100
101
  K.new(e, {
101
102
  name: i.label ?? b(i.name),
102
- xAxis: o,
103
+ xAxis: a,
103
104
  yAxis: u,
104
105
  valueYField: i.dataFieldName,
105
106
  ...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
106
107
  })
107
108
  );
108
- a.columns.template.setAll({
109
+ o.columns.template.setAll({
109
110
  tooltipY: H(10),
110
111
  templateField: "columnSettings"
111
- }), t[0].type === "date" && (a.data.processor = L.new(e, {
112
+ }), t[0].type === "date" && (o.data.processor = L.new(e, {
112
113
  dateFormat: "i",
113
114
  dateFields: [t[0].value]
114
- })), a.data.setAll(m), a.appear();
115
+ })), o.data.setAll(m), o.appear();
115
116
  } else {
116
- const a = r.series.push(
117
- Z.new(e, {
117
+ const o = r.series.push(
118
+ Q.new(e, {
118
119
  name: i.label ?? b(i.name),
119
- xAxis: o,
120
+ xAxis: a,
120
121
  yAxis: u,
121
122
  valueYField: i.dataFieldName,
122
123
  ...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
123
124
  })
124
125
  );
125
- a.strokes.template.setAll({
126
+ o.strokes.template.setAll({
126
127
  strokeWidth: 3,
127
128
  templateField: "strokeSettings"
128
- }), t[0].type === "date" && (a.data.processor = L.new(e, {
129
+ }), t[0].type === "date" && (o.data.processor = L.new(e, {
129
130
  dateFormat: "i",
130
131
  dateFields: [t[0].value]
131
- })), a.data.setAll(m), a.bullets.push(function() {
132
- return ee.new(e, {
133
- sprite: te.new(e, {
132
+ })), o.data.setAll(m), o.bullets.push(function() {
133
+ return Z.new(e, {
134
+ sprite: ee.new(e, {
134
135
  strokeWidth: 3,
135
- stroke: a.get("stroke"),
136
+ stroke: o.get("stroke"),
136
137
  radius: 5,
137
138
  fill: e.interfaceColors.get("background")
138
139
  })
@@ -141,17 +142,17 @@ const Le = (Y) => {
141
142
  }
142
143
  }), r.set(
143
144
  "cursor",
144
- re.new(e, { xAxis: o, behavior: "none" })
145
+ te.new(e, { xAxis: a, behavior: "none" })
145
146
  ).lineY.set("visible", !1), N({
146
147
  root: e,
147
148
  chart: r,
148
- xAxis: o,
149
+ xAxis: a,
149
150
  theme: s,
150
151
  isDateAxis: t[0].type === "date",
151
152
  baseInterval: h,
152
153
  follow: !0
153
154
  }), r.children.push(
154
- ae.new(e, {
155
+ re.new(e, {
155
156
  centerX: X,
156
157
  x: X
157
158
  })
@@ -165,5 +166,5 @@ const Le = (Y) => {
165
166
  return { chartId: g, ownerState: B, sx: T, error: y, other: R };
166
167
  };
167
168
  export {
168
- Le as useColumnLineMixLogic
169
+ Ye as useColumnLineMixLogic
169
170
  };
@@ -1,11 +1,11 @@
1
- import { R as P, A } from "../../../AnimatedTheme-ktdO3Bel.js";
1
+ import { R as P, A } from "../../../AnimatedTheme-D3VZKKNV.js";
2
2
  import { useThemeProps as C, useTheme as D } from "@mui/material";
3
3
  import F from "dayjs";
4
4
  import { useId as R, useRef as L, useEffect as I } from "react";
5
5
  import { applyValueFormat as S, colorSetFromPalette as b } from "../_common/utils.js";
6
- import { P as E, a as N } from "../../../PieSeries-CMH0Z7pz.js";
7
- import { p as m, c as u } from "../../../Entity-BJCuhdq_.js";
8
- import { L as j } from "../../../Legend-CFvQiIfn.js";
6
+ import { P as E, a as N } from "../../../PieSeries-C9YUWMnA.js";
7
+ import { p as m, c as u } from "../../../Entity-4Lr2piVN.js";
8
+ import { L as j } from "../../../Legend-CTb6rZz_.js";
9
9
  const K = (y) => {
10
10
  const p = C({ props: y, name: "HCDonutChart" }), {
11
11
  dimensions: t,
@@ -1,13 +1,13 @@
1
- import { R as W, T as E, A as Z } from "../../../AnimatedTheme-ktdO3Bel.js";
1
+ import { R as W, T as E, A as Z } from "../../../AnimatedTheme-D3VZKKNV.js";
2
2
  import { useThemeProps as $, useTheme as G } from "@mui/material";
3
3
  import J from "dayjs";
4
4
  import K from "lodash";
5
5
  import { useId as Q, useRef as U, useEffect as ee } from "react";
6
6
  import { applyValueFormat as te, colorSetFromPalette as ie } from "../_common/utils.js";
7
- import { C as x, a as F, b as I, L as ae } from "../../../Tooltip-vyZRZWih.js";
8
- import { m as M, f as O, e as j, p as C } from "../../../Entity-BJCuhdq_.js";
9
- import { a as ne, H as X } from "../../../Hierarchy-CEOK8Gzh.js";
10
- import { R as z } from "../../../RoundedRectangle-BKLX1LKM.js";
7
+ import { C as x, a as F, b as I, L as ae } from "../../../Tooltip-RhAldW7s.js";
8
+ import { m as M, f as O, e as j, p as C } from "../../../Entity-4Lr2piVN.js";
9
+ import { a as ne, H as X } from "../../../Hierarchy-DPEcTr0v.js";
10
+ import { R as z } from "../../../RoundedRectangle-B23Oh_r6.js";
11
11
  import { r as se, c as R, a as L } from "../../../constant-BiOGvlZc.js";
12
12
  class Y extends x {
13
13
  constructor() {
@@ -1,13 +1,13 @@
1
- import { R as ve, T as de, A as xe } from "../../../AnimatedTheme-ktdO3Bel.js";
1
+ import { R as ve, T as de, A as xe } from "../../../AnimatedTheme-D3VZKKNV.js";
2
2
  import { useThemeProps as we, useTheme as me } from "@mui/material";
3
3
  import ye from "dayjs";
4
4
  import be from "lodash";
5
5
  import { useId as Ce, useRef as Ae, useEffect as Pe } from "react";
6
6
  import { applyValueFormat as _e, colorSetFromPalette as ze } from "../_common/utils.js";
7
- import { e as Zt, B as ht, m as De, a as lt, c as Ht, b as Vt } from "../../../Entity-BJCuhdq_.js";
8
- import { Z as Ee } from "../../../ZoomableContainer-Ca_pDVYQ.js";
9
- import { H as Kt } from "../../../Hierarchy-CEOK8Gzh.js";
10
- import { G as Jt, a as Te, b as Ne } from "../../../Tooltip-vyZRZWih.js";
7
+ import { e as Zt, B as ht, m as De, a as lt, c as Ht, b as Vt } from "../../../Entity-4Lr2piVN.js";
8
+ import { Z as Ee } from "../../../ZoomableContainer-D1laxHnA.js";
9
+ import { H as Kt } from "../../../Hierarchy-DPEcTr0v.js";
10
+ import { G as Jt, a as Te, b as Ne } from "../../../Tooltip-RhAldW7s.js";
11
11
  import { c as K, g as ke, a as Ie } from "../../../_commonjsHelpers-BVfed4GL.js";
12
12
  class pt extends Jt {
13
13
  constructor() {
@@ -0,0 +1,52 @@
1
+ import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
+ import { useForecastConeChartLogic as h } from "./logic.js";
3
+ import { ForecastConeChartRoot as f } from "./styled.js";
4
+ const x = (o) => {
5
+ const { chartDivRef: r, data: n, chartId: i, loading: t, emptyMessage: s, sx: a, other: c, ownerState: l } = h(o);
6
+ return /* @__PURE__ */ d(f, { ownerState: l, sx: a, ...c, children: [
7
+ /* @__PURE__ */ e(
8
+ "div",
9
+ {
10
+ ref: r,
11
+ id: i,
12
+ style: { width: "100%", height: "100%" }
13
+ }
14
+ ),
15
+ t && /* @__PURE__ */ e(
16
+ "div",
17
+ {
18
+ style: {
19
+ position: "absolute",
20
+ inset: 0,
21
+ background: "rgba(255,255,255,0.8)",
22
+ display: "flex",
23
+ alignItems: "center",
24
+ justifyContent: "center",
25
+ fontSize: "1.2rem",
26
+ color: "#555",
27
+ zIndex: 10
28
+ },
29
+ children: "Loading..."
30
+ }
31
+ ),
32
+ !t && n.length === 0 && /* @__PURE__ */ e(
33
+ "div",
34
+ {
35
+ style: {
36
+ position: "absolute",
37
+ inset: 0,
38
+ display: "flex",
39
+ alignItems: "center",
40
+ justifyContent: "center",
41
+ color: "#999",
42
+ fontSize: "1.1rem",
43
+ zIndex: 10
44
+ },
45
+ children: s
46
+ }
47
+ )
48
+ ] });
49
+ };
50
+ export {
51
+ x as ForecastConeChart
52
+ };
@@ -0,0 +1,331 @@
1
+ import { R as ye, A as ge } from "../../../AnimatedTheme-D3VZKKNV.js";
2
+ import { useTheme as we, useThemeProps as xe } from "@mui/material";
3
+ import Fe from "lodash";
4
+ import { useRef as j, useLayoutEffect as Ae } from "react";
5
+ import { getTooltipDateFormat as Ne, attachCursorTooltip as ke } from "../_common/tooltip.js";
6
+ import { applyValueFormat as De } from "../_common/utils.js";
7
+ import { c as d, a as se } from "../../../Entity-4Lr2piVN.js";
8
+ import { X as Te, V as Oe } from "../../../AxisRenderer-Doyw-FTI.js";
9
+ import { X as Xe } from "../../../XYCursor-Z-Ral42q.js";
10
+ import { D as Ie } from "../../../DateAxis-lJZjbAS-.js";
11
+ import { A as Pe, a as Ce } from "../../../AxisRendererY-BylCU67e.js";
12
+ import { L as Ye } from "../../../Legend-CTb6rZz_.js";
13
+ import { L } from "../../../LineSeries-Dg1aytHA.js";
14
+ import { D as je } from "../../../DataProcessor-WXzhvIg6.js";
15
+ class Se {
16
+ constructor(e, s) {
17
+ Object.defineProperty(this, "_line", {
18
+ enumerable: !0,
19
+ configurable: !0,
20
+ writable: !0,
21
+ value: 0
22
+ }), Object.defineProperty(this, "_point", {
23
+ enumerable: !0,
24
+ configurable: !0,
25
+ writable: !0,
26
+ value: 0
27
+ }), Object.defineProperty(this, "_context", {
28
+ enumerable: !0,
29
+ configurable: !0,
30
+ writable: !0,
31
+ value: void 0
32
+ }), Object.defineProperty(this, "_x0", {
33
+ enumerable: !0,
34
+ configurable: !0,
35
+ writable: !0,
36
+ value: 0
37
+ }), Object.defineProperty(this, "_x1", {
38
+ enumerable: !0,
39
+ configurable: !0,
40
+ writable: !0,
41
+ value: 0
42
+ }), Object.defineProperty(this, "_y0", {
43
+ enumerable: !0,
44
+ configurable: !0,
45
+ writable: !0,
46
+ value: 0
47
+ }), Object.defineProperty(this, "_y1", {
48
+ enumerable: !0,
49
+ configurable: !0,
50
+ writable: !0,
51
+ value: 0
52
+ }), Object.defineProperty(this, "_t0", {
53
+ enumerable: !0,
54
+ configurable: !0,
55
+ writable: !0,
56
+ value: 0
57
+ }), Object.defineProperty(this, "_tension", {
58
+ enumerable: !0,
59
+ configurable: !0,
60
+ writable: !0,
61
+ value: 0
62
+ }), this._context = e, this._tension = s;
63
+ }
64
+ areaStart() {
65
+ this._line = 0;
66
+ }
67
+ areaEnd() {
68
+ this._line = NaN;
69
+ }
70
+ lineStart() {
71
+ this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN, this._point = 0;
72
+ }
73
+ lineEnd() {
74
+ switch (this._point) {
75
+ case 2:
76
+ this._context.lineTo(this._x1, this._y1);
77
+ break;
78
+ case 3:
79
+ S(this, this._t0, ne(this, this._t0));
80
+ break;
81
+ }
82
+ (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
83
+ }
84
+ point(e, s) {
85
+ let o = NaN;
86
+ if (e = +e, s = +s, !(e === this._x1 && s === this._y1)) {
87
+ switch (this._point) {
88
+ case 0:
89
+ this._point = 1, this._line ? this._context.lineTo(e, s) : this._context.moveTo(e, s);
90
+ break;
91
+ case 1:
92
+ this._point = 2;
93
+ break;
94
+ case 2:
95
+ this._point = 3, S(this, ne(this, o = ae(this, e, s)), o);
96
+ break;
97
+ default:
98
+ S(this, this._t0, o = ae(this, e, s));
99
+ break;
100
+ }
101
+ this._x0 = this._x1, this._x1 = e, this._y0 = this._y1, this._y1 = s, this._t0 = o;
102
+ }
103
+ }
104
+ }
105
+ function oe(r) {
106
+ function e(s) {
107
+ return new Se(s, r);
108
+ }
109
+ return e;
110
+ }
111
+ function ie(r) {
112
+ return r < 0 ? -1 : 1;
113
+ }
114
+ function ae(r, e, s) {
115
+ let o = r._x1 - r._x0, l = e - r._x1, a = (r._y1 - r._y0) / (o || l < 0 && -0), n = (s - r._y1) / (l || o < 0 && -0), p = (a * l + n * o) / (o + l);
116
+ return (ie(a) + ie(n)) * Math.min(Math.abs(a), Math.abs(n), 0.5 * Math.abs(p)) || 0;
117
+ }
118
+ function ne(r, e) {
119
+ let s = r._x1 - r._x0;
120
+ return s ? (3 * (r._y1 - r._y0) / s - e) / 2 : e;
121
+ }
122
+ function S(r, e, s) {
123
+ let o = r._x0, l = r._y0, a = r._x1, n = r._y1, p = (a - o) / 1.5 * (1 - r._tension);
124
+ r._context.bezierCurveTo(o + p, l + p * e, a - p, n - p * s, a, n);
125
+ }
126
+ class w extends L {
127
+ _afterNew() {
128
+ this._setDefault("curveFactory", oe(this.get("tension", 0.5))), super._afterNew();
129
+ }
130
+ _updateChildren() {
131
+ this.isDirty("tension") && (this.set("curveFactory", oe(this.get("tension", 0.5))), this._valuesDirty = !0), super._updateChildren();
132
+ }
133
+ }
134
+ Object.defineProperty(w, "className", {
135
+ enumerable: !0,
136
+ configurable: !0,
137
+ writable: !0,
138
+ value: "SmoothedXLineSeries"
139
+ });
140
+ Object.defineProperty(w, "classNames", {
141
+ enumerable: !0,
142
+ configurable: !0,
143
+ writable: !0,
144
+ value: L.classNames.concat([w.className])
145
+ });
146
+ const Le = [
147
+ { lowerField: "low95", upperField: "high95", label: "95% expected move" },
148
+ { lowerField: "low68", upperField: "high68", label: "68% expected move" }
149
+ ], Re = [0.15, 0.3, 0.45], $e = {
150
+ millisecond: 1,
151
+ second: 1e3,
152
+ minute: 6e4,
153
+ hour: 36e5,
154
+ day: 864e5,
155
+ week: 6048e5,
156
+ month: 2592e6,
157
+ year: 31536e6
158
+ }, tt = (r) => {
159
+ const e = we(), s = xe({ props: r, name: "HCForecastCone" }), {
160
+ data: o = [],
161
+ dateField: l = "date",
162
+ historyField: a = "close",
163
+ centreField: n = "center",
164
+ bands: p = Le,
165
+ nowValue: k,
166
+ color: R = e.palette.warning.main,
167
+ baseInterval: $,
168
+ chartId: V = "forecast-cone-chart",
169
+ height: le = "100%",
170
+ width: ue = "100%",
171
+ loading: M = !1,
172
+ emptyMessage: E = "No data available",
173
+ sx: ce,
174
+ ...pe
175
+ } = s, u = Fe.orderBy(o, [l]).map((t) => ({ ...t })), y = u.findIndex(
176
+ (t) => t[n] !== null && t[n] !== void 0
177
+ );
178
+ y > 0 && (u[y][a] === null || u[y][a] === void 0) && (u[y][a] = u[y][n]);
179
+ const he = {
180
+ ...s,
181
+ height: le,
182
+ width: ue,
183
+ chartId: V,
184
+ loading: M,
185
+ emptyMessage: E,
186
+ baseInterval: $
187
+ }, B = j(null), H = j(null), D = j(null);
188
+ return Ae(() => {
189
+ var q, G, J;
190
+ if (!D.current) return;
191
+ const t = ye.new(D.current);
192
+ H.current = t, t.setThemes([ge.new(t)]), t.interfaceColors.setAll({
193
+ text: d(e.palette.text.primary),
194
+ grid: d(e.palette.divider),
195
+ stroke: d(e.palette.divider)
196
+ }), De(t);
197
+ const c = t.container.children.push(
198
+ Te.new(t, {
199
+ panX: !0,
200
+ panY: !1,
201
+ wheelX: "none",
202
+ wheelY: "none",
203
+ maxTooltipDistance: -1,
204
+ pinchZoomX: !0,
205
+ layout: t.verticalLayout
206
+ })
207
+ );
208
+ B.current = c, c.set(
209
+ "cursor",
210
+ Xe.new(t, { behavior: "none" })
211
+ ).lineY.set("visible", !1);
212
+ const x = $ ?? { timeUnit: "hour", count: 1 }, _ = c.xAxes.push(
213
+ Ie.new(t, {
214
+ maxDeviation: 0.1,
215
+ groupData: !1,
216
+ baseInterval: x,
217
+ renderer: Pe.new(t, {})
218
+ })
219
+ );
220
+ (q = _.get("renderer")) == null || q.grid.template.setAll({
221
+ stroke: d(e.palette.divider),
222
+ strokeOpacity: 1
223
+ });
224
+ const F = c.yAxes.push(
225
+ Oe.new(t, {
226
+ renderer: Ce.new(t, {})
227
+ })
228
+ );
229
+ (G = F.get("renderer")) == null || G.grid.template.setAll({
230
+ stroke: d(e.palette.divider),
231
+ strokeOpacity: 1
232
+ });
233
+ const A = d(R), de = c.children.push(
234
+ Ye.new(t, { centerX: se, x: se })
235
+ ), T = () => je.new(t, { dateFormat: "i", dateFields: [l] }), O = [];
236
+ p.forEach((i, f) => {
237
+ const h = c.series.push(
238
+ w.new(t, {
239
+ name: i.label ?? `Band ${f + 1}`,
240
+ xAxis: _,
241
+ yAxis: F,
242
+ valueYField: i.upperField,
243
+ openValueYField: i.lowerField,
244
+ valueXField: l,
245
+ fill: A,
246
+ stroke: A
247
+ })
248
+ );
249
+ h.strokes.template.set("strokeOpacity", 0), h.fills.template.setAll({
250
+ visible: !0,
251
+ fill: A,
252
+ fillOpacity: i.fillOpacity ?? Re[f] ?? 0.2
253
+ }), h.data.processor = T(), h.data.setAll(u), O.push(h);
254
+ });
255
+ let m;
256
+ n && (m = c.series.push(
257
+ w.new(t, {
258
+ name: "Forecast centre",
259
+ xAxis: _,
260
+ yAxis: F,
261
+ valueYField: n,
262
+ valueXField: l,
263
+ stroke: d(e.palette.error.main)
264
+ })
265
+ ), m.strokes.template.setAll({
266
+ strokeWidth: 1.5,
267
+ strokeDasharray: [4, 4]
268
+ }), m.fills.template.set("visible", !1), m.data.processor = T(), m.data.setAll(u));
269
+ const N = c.series.push(
270
+ L.new(t, {
271
+ name: "History",
272
+ xAxis: _,
273
+ yAxis: F,
274
+ valueYField: a,
275
+ valueXField: l,
276
+ stroke: d(e.palette.primary.main)
277
+ })
278
+ );
279
+ N.strokes.template.setAll({ strokeWidth: 2 }), N.data.processor = T(), N.data.setAll(u), de.data.setAll(c.series.values);
280
+ const U = u.findIndex(
281
+ (i) => i[n] !== null && i[n] !== void 0
282
+ ), me = [...u].reverse().find(
283
+ (i) => i[a] !== null && i[a] !== void 0
284
+ ), W = U >= 0 ? u[U] : me, z = k !== void 0 ? new Date(k).getTime() : W ? new Date(W[l]).getTime() : NaN, fe = ($e[x.timeUnit] ?? 0) * x.count / 2, Z = Number.isNaN(z) ? NaN : z + fe;
285
+ Number.isNaN(Z) || (J = _.createAxisRange(
286
+ _.makeDataItem({ value: Z })
287
+ ).get("grid")) == null || J.setAll({
288
+ visible: !0,
289
+ stroke: d(e.palette.text.secondary),
290
+ strokeOpacity: 0.7,
291
+ strokeDasharray: [2, 3]
292
+ });
293
+ const _e = Ne(x);
294
+ return ke({
295
+ root: t,
296
+ chart: c,
297
+ theme: e,
298
+ getText: () => {
299
+ var ee;
300
+ const i = (g) => g == null ? "—" : t.numberFormatter.format(g), f = N.get("tooltipDataItem"), h = m == null ? void 0 : m.get("tooltipDataItem"), X = h ?? f ?? ((ee = O[0]) == null ? void 0 : ee.get("tooltipDataItem")), K = X == null ? void 0 : X.get("valueX"), Q = typeof K == "number" ? t.dateFormatter.format(new Date(K), _e) : "", b = [], I = f == null ? void 0 : f.get("valueY");
301
+ I != null && b.push(`History: ${i(I)}`);
302
+ const P = h == null ? void 0 : h.get("valueY");
303
+ return P != null && b.push(`Centre: ${i(P)}`), p.forEach((g, te) => {
304
+ var re;
305
+ const v = (re = O[te]) == null ? void 0 : re.get("tooltipDataItem"), C = v == null ? void 0 : v.get("valueY"), Y = v == null ? void 0 : v.get("openValueY");
306
+ if (C != null && Y !== void 0 && Y !== null) {
307
+ const be = (C - Y) / 2, ve = g.label ?? `Band ${te + 1}`;
308
+ b.push(`[${A.toCSSHex()}]●[/] ${ve}: ±${i(be)}`);
309
+ }
310
+ }), b.length === 0 ? "" : Q ? `[bold]${Q}[/]
311
+ ${b.join(`
312
+ `)}` : b.join(`
313
+ `);
314
+ }
315
+ }), c.appear(1e3, 100), () => {
316
+ t.dispose(), H.current = null, B.current = null;
317
+ };
318
+ }, [e.palette.mode, o, p, R, k]), {
319
+ chartDivRef: D,
320
+ data: u,
321
+ chartId: V,
322
+ loading: M,
323
+ emptyMessage: E,
324
+ sx: ce,
325
+ other: pe,
326
+ ownerState: he
327
+ };
328
+ };
329
+ export {
330
+ tt as useForecastConeChartLogic
331
+ };
@@ -0,0 +1,12 @@
1
+ import { styled as t } from "@mui/material";
2
+ const i = t("div", {
3
+ name: "HCForecastCone",
4
+ slot: "Root"
5
+ })(({ ownerState: o }) => ({
6
+ position: "relative",
7
+ width: o.width,
8
+ height: o.height
9
+ }));
10
+ export {
11
+ i as ForecastConeChartRoot
12
+ };
@@ -1,17 +1,17 @@
1
- import { R as J, A as K } from "../../../AnimatedTheme-ktdO3Bel.js";
1
+ import { R as J, A as K } from "../../../AnimatedTheme-D3VZKKNV.js";
2
2
  import { useThemeProps as Q, useTheme as Z } from "@mui/material";
3
3
  import ee from "dayjs";
4
4
  import T from "lodash";
5
5
  import { useId as te, useRef as re, useEffect as ae } from "react";
6
6
  import { applyValueFormat as ie, colorSetFromPalette as se } from "../_common/utils.js";
7
- import { m as E, f as oe, C as S, b as u, p as P, c as Y } from "../../../Entity-BJCuhdq_.js";
8
- import { X as ne } from "../../../AxisRenderer-BCQoUJw6.js";
9
- import { A as le, a as he } from "../../../AxisRendererY-AXWvGU6r.js";
10
- import { C as R } from "../../../CategoryAxis-B6NqW8qd.js";
11
- import { C as L, L as U, a as ce, b as ue, T as W } from "../../../Tooltip-vyZRZWih.js";
12
- import { R as de } from "../../../RoundedRectangle-BKLX1LKM.js";
13
- import { L as me } from "../../../LinearGradient-CxQyCSEB.js";
14
- import { C as pe } from "../../../ColumnSeries-CtRTsn-E.js";
7
+ import { m as E, f as oe, C as S, b as u, p as P, c as Y } from "../../../Entity-4Lr2piVN.js";
8
+ import { X as ne } from "../../../AxisRenderer-Doyw-FTI.js";
9
+ import { A as le, a as he } from "../../../AxisRendererY-BylCU67e.js";
10
+ import { C as R } from "../../../CategoryAxis-B5uTZjhL.js";
11
+ import { C as L, L as U, a as ce, b as ue, T as W } from "../../../Tooltip-RhAldW7s.js";
12
+ import { R as de } from "../../../RoundedRectangle-B23Oh_r6.js";
13
+ import { L as me } from "../../../LinearGradient-D1hzMjaW.js";
14
+ import { C as pe } from "../../../ColumnSeries-CqJ-563p.js";
15
15
  class _ extends L {
16
16
  constructor() {
17
17
  super(...arguments), Object.defineProperty(this, "labelContainer", {