@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,41 +1,43 @@
1
- import { R as I, A as M } from "../../../AnimatedTheme-BOKdw2Oy.js";
2
- import { useThemeProps as O, useTheme as P } from "@mui/material";
3
- import k from "lodash";
4
- import { useId as V, useRef as z, useEffect as E } from "react";
5
- import { humanizeLabel as C } from "../_common/format.js";
1
+ import { R as M, A as O } from "../../../AnimatedTheme-D3VZKKNV.js";
2
+ import { useThemeProps as E, useTheme as P } from "@mui/material";
3
+ import C from "lodash";
4
+ import { useId as V, useRef as z, useEffect as G } from "react";
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 b } from "../../../Entity-CCUIdRAr.js";
9
- import { X as U, V as _ } from "../../../AxisRenderer-lUbezuh7.js";
10
- import { S as $ } from "../../../Scrollbar-BzSBcIUt.js";
11
- import { D as j } from "../../../DateAxis-zNtbSVjW.js";
12
- import { A as X, a as G } from "../../../AxisRendererY-DbSiyb45.js";
13
- import { C as J } from "../../../CategoryAxis-B8KQp1pE.js";
14
- import { C as K } from "../../../ColumnSeries-rgnGm-Bg.js";
15
- import { D as L } from "../../../DataProcessor-CvIe9BVn.js";
16
- import { L as Q } from "../../../LineSeries-BLFvwrLT.js";
17
- import { B as Z } from "../../../Bullet-PgoNb3Jv.js";
18
- import { C as ee } from "../../../Circle-BWRdiMpG.js";
19
- import { X as te } from "../../../XYCursor-gHAo40xC.js";
20
- import { L as re } from "../../../Legend-kbCFjJAW.js";
21
- const Xe = (D) => {
22
- const f = O({ props: D, name: "HCColumnLineMix" }), {
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) => {
23
+ const f = E({ props: Y, name: "HCColumnLineMix" }), {
23
24
  dimensions: t,
24
25
  values: n,
25
26
  data: p,
26
- initDelay: Y = 0,
27
+ initDelay: S = 0,
27
28
  baseInterval: h,
28
29
  colors: x,
29
- sx: S,
30
- ...T
31
- } = f, s = P(), A = `hc-column-line-mix-${V().replace(/:/g, "")}`, d = z(null), g = t.length < 1 ? "ColumnLineMix requires at least 1 dimension" : null;
32
- E(() => {
33
- if (g) return;
30
+ skipEmptyDates: A = !1,
31
+ sx: T,
32
+ ...R
33
+ } = f, s = P(), g = `hc-column-line-mix-${V().replace(/:/g, "")}`, d = z(null), y = t.length < 1 ? "ColumnLineMix requires at least 1 dimension" : null;
34
+ G(() => {
35
+ if (y) return;
34
36
  let c;
35
37
  return c = setTimeout(() => {
36
- var y, w, v, F;
37
- const e = I.new(A);
38
- d.current = e, e.setThemes([M.new(e)]), e.interfaceColors.setAll({
38
+ var w, v, F, k;
39
+ const e = M.new(g);
40
+ d.current = e, e.setThemes([O.new(e)]), e.interfaceColors.setAll({
39
41
  text: l(s.palette.text.primary),
40
42
  grid: l(s.palette.divider),
41
43
  stroke: l(s.palette.divider)
@@ -56,43 +58,48 @@ const Xe = (D) => {
56
58
  $.new(e, { orientation: "horizontal" })
57
59
  );
58
60
  let a, m = p;
59
- t[0].type === "date" ? (m = k.orderBy(p, [t[0].value]), a = r.xAxes.push(
60
- j.new(e, {
61
- maxDeviation: 0.1,
62
- groupData: !1,
63
- baseInterval: h || { timeUnit: "day", count: 1 },
64
- renderer: X.new(e, {})
65
- })
66
- ), (y = a.get("renderer")) == null || y.grid.template.setAll({
67
- stroke: l(s.palette.divider),
68
- strokeOpacity: 1
69
- })) : (a = r.xAxes.push(
70
- J.new(e, {
71
- categoryField: t[0].value,
72
- renderer: X.new(e, {})
73
- })
74
- ), (w = a.get("renderer")) == null || w.grid.template.setAll({
75
- stroke: l(s.palette.divider),
76
- strokeOpacity: 1
77
- }), e.numberFormatter.setAll({
78
- numberFormat: "#",
79
- numericFields: ["valueX"]
80
- }), m = k.orderBy(p, [t[0].value]), a.data.setAll(m));
61
+ if (t[0].type === "date") {
62
+ m = C.orderBy(p, [t[0].value]);
63
+ const i = A ? oe : ae;
64
+ a = r.xAxes.push(
65
+ i.new(e, {
66
+ maxDeviation: 0.1,
67
+ groupData: !1,
68
+ baseInterval: h || { timeUnit: "day", count: 1 },
69
+ renderer: D.new(e, {})
70
+ })
71
+ ), (w = a.get("renderer")) == null || w.grid.template.setAll({
72
+ stroke: l(s.palette.divider),
73
+ strokeOpacity: 1
74
+ });
75
+ } else
76
+ a = r.xAxes.push(
77
+ J.new(e, {
78
+ categoryField: t[0].value,
79
+ renderer: D.new(e, {})
80
+ })
81
+ ), (v = a.get("renderer")) == null || v.grid.template.setAll({
82
+ stroke: l(s.palette.divider),
83
+ strokeOpacity: 1
84
+ }), e.numberFormatter.setAll({
85
+ numberFormat: "#",
86
+ numericFields: ["valueX"]
87
+ }), m = C.orderBy(p, [t[0].value]), a.data.setAll(m);
81
88
  const u = r.yAxes.push(
82
89
  _.new(e, {
83
90
  min: 0,
84
91
  extraMax: 0.1,
85
- renderer: G.new(e, { strokeOpacity: 0.1 })
92
+ renderer: j.new(e, { strokeOpacity: 0.1 })
86
93
  })
87
94
  );
88
- (v = u.get("renderer")) == null || v.grid.template.setAll({
95
+ (F = u.get("renderer")) == null || F.grid.template.setAll({
89
96
  stroke: l(s.palette.divider),
90
97
  strokeOpacity: 1
91
- }), n.forEach((i, B) => {
92
- if (B === 0) {
98
+ }), n.forEach((i, I) => {
99
+ if (I === 0) {
93
100
  const o = r.series.push(
94
101
  K.new(e, {
95
- name: i.label ?? C(i.name),
102
+ name: i.label ?? b(i.name),
96
103
  xAxis: a,
97
104
  yAxis: u,
98
105
  valueYField: i.dataFieldName,
@@ -109,7 +116,7 @@ const Xe = (D) => {
109
116
  } else {
110
117
  const o = r.series.push(
111
118
  Q.new(e, {
112
- name: i.label ?? C(i.name),
119
+ name: i.label ?? b(i.name),
113
120
  xAxis: a,
114
121
  yAxis: u,
115
122
  valueYField: i.dataFieldName,
@@ -146,18 +153,18 @@ const Xe = (D) => {
146
153
  follow: !0
147
154
  }), r.children.push(
148
155
  re.new(e, {
149
- centerX: b,
150
- x: b
156
+ centerX: X,
157
+ x: X
151
158
  })
152
- ).data.setAll(r.series.values), q(e, (F = n == null ? void 0 : n[0]) == null ? void 0 : F.format), r.appear(1e3, 100);
153
- }, Y), () => {
159
+ ).data.setAll(r.series.values), q(e, (k = n == null ? void 0 : n[0]) == null ? void 0 : k.format), r.appear(1e3, 100);
160
+ }, S), () => {
154
161
  var e;
155
162
  c && clearTimeout(c), (e = d.current) == null || e.dispose(), d.current = null;
156
163
  };
157
- }, [p, t, n, s.palette.mode, x]);
158
- const R = { ...f };
159
- return { chartId: A, ownerState: R, sx: S, error: g, other: T };
164
+ }, [p, t, n, s.palette.mode, x, A]);
165
+ const B = { ...f };
166
+ return { chartId: g, ownerState: B, sx: T, error: y, other: R };
160
167
  };
161
168
  export {
162
- Xe as useColumnLineMixLogic
169
+ Ye as useColumnLineMixLogic
163
170
  };
@@ -1,11 +1,11 @@
1
- import { R as P, A } from "../../../AnimatedTheme-BOKdw2Oy.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-3iLRbqFv.js";
7
- import { p as m, c as u } from "../../../Entity-CCUIdRAr.js";
8
- import { L as j } from "../../../Legend-kbCFjJAW.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-BOKdw2Oy.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-A_HlttXp.js";
8
- import { m as M, f as O, e as j, p as C } from "../../../Entity-CCUIdRAr.js";
9
- import { a as ne, H as X } from "../../../Hierarchy-CCvGsF1A.js";
10
- import { R as z } from "../../../RoundedRectangle-CqMMmPM0.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-BOKdw2Oy.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, y as ht, m as De, a as lt, c as Ht, b as Vt } from "../../../Entity-CCUIdRAr.js";
8
- import { Z as Ee } from "../../../ZoomableContainer-Brs1wHM1.js";
9
- import { H as Kt } from "../../../Hierarchy-CCvGsF1A.js";
10
- import { G as Jt, a as Te, b as Ne } from "../../../Tooltip-A_HlttXp.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-BOKdw2Oy.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-CCUIdRAr.js";
8
- import { X as ne } from "../../../AxisRenderer-lUbezuh7.js";
9
- import { A as le, a as he } from "../../../AxisRendererY-DbSiyb45.js";
10
- import { C as R } from "../../../CategoryAxis-B8KQp1pE.js";
11
- import { C as L, L as U, a as ce, b as ue, T as W } from "../../../Tooltip-A_HlttXp.js";
12
- import { R as de } from "../../../RoundedRectangle-CqMMmPM0.js";
13
- import { L as me } from "../../../LinearGradient-C7rnipF7.js";
14
- import { C as pe } from "../../../ColumnSeries-rgnGm-Bg.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", {