@hybridcore/ui 1.6.8 → 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 (47) hide show
  1. package/dist/AnimatedTheme-ktdO3Bel.js +7708 -0
  2. package/dist/{AxisRenderer-DTyLLA6c.js → AxisRenderer-BCQoUJw6.js} +51 -49
  3. package/dist/{AxisRendererY-C_ItLPNV.js → AxisRendererY-AXWvGU6r.js} +3 -3
  4. package/dist/{Bullet-DVczI2TD.js → Bullet-Djj7Vs9T.js} +1 -1
  5. package/dist/{Button-CcsPEIDh.js → Button-BLY4PVJC.js} +3 -3
  6. package/dist/{CategoryAxis-CwnfaGc8.js → CategoryAxis-B6NqW8qd.js} +3 -3
  7. package/dist/{Circle-Cy5s-pVc.js → Circle-BnfBNKBD.js} +1 -1
  8. package/dist/ColorSet-cyPmWGwh.js +77 -0
  9. package/dist/{ColumnSeries-CjgdJ2QL.js → ColumnSeries-CtRTsn-E.js} +4 -4
  10. package/dist/{DateAxis-YX3QNIB-.js → DateAxis-DEXKps1S.js} +8 -7
  11. package/dist/{ColorSet-C7vpNXhM.js → Entity-BJCuhdq_.js} +638 -712
  12. package/dist/GaplessDateAxis-B2g2jgSG.js +376 -0
  13. package/dist/{Hierarchy-Bihj0S61.js → Hierarchy-CEOK8Gzh.js} +21 -19
  14. package/dist/{Legend-Dp_MKfS4.js → Legend-CFvQiIfn.js} +11 -10
  15. package/dist/{LineSeries-Uiv5o56b.js → LineSeries-D_IL2qGF.js} +13 -12
  16. package/dist/{LinearGradient-DiRq5YcI.js → LinearGradient-CxQyCSEB.js} +11 -11
  17. package/dist/{PieSeries-B2fW3z0s.js → PieSeries-CMH0Z7pz.js} +34 -32
  18. package/dist/{RoundedRectangle-CWLi2PXn.js → RoundedRectangle-BKLX1LKM.js} +4 -4
  19. package/dist/{Scrollbar-D86MJyr2.js → Scrollbar-CTI7_8Qw.js} +4 -4
  20. package/dist/{Slice-B19rbYDZ.js → Slice-BUncQh1B.js} +2 -2
  21. package/dist/{Tick-2bcLyHpF.js → Tick--VhF0xlz.js} +15 -15
  22. package/dist/Tooltip-vyZRZWih.js +3606 -0
  23. package/dist/{XYCursor-C8WktvKM.js → XYCursor-CVUSpqb9.js} +3 -3
  24. package/dist/{ZoomableContainer-DYyqwaMb.js → ZoomableContainer-Ca_pDVYQ.js} +7 -7
  25. package/dist/components/charts/_common/tooltip.js +73 -0
  26. package/dist/components/charts/_common/utils.js +10 -9
  27. package/dist/components/charts/candlestick/logic.js +191 -164
  28. package/dist/components/charts/column-line-mix/logic.js +116 -107
  29. package/dist/components/charts/donut-chart/logic.js +36 -34
  30. package/dist/components/charts/drill-down-treemap/logic.js +49 -48
  31. package/dist/components/charts/drill-down-voronoi-treemap/logic.js +102 -101
  32. package/dist/components/charts/heatmap/logic.js +33 -32
  33. package/dist/components/charts/highlighting-line-data/logic.js +26 -24
  34. package/dist/components/charts/line/logic.js +147 -185
  35. package/dist/components/charts/logaritmic-scale/logic.js +99 -84
  36. package/dist/components/charts/multiple-value-axes/logic.js +117 -107
  37. package/dist/components/charts/nested-pie/logic.js +3 -3
  38. package/dist/components/charts/packed-circles/logic.js +28 -27
  39. package/dist/components/charts/pie-chart/logic.js +43 -41
  40. package/dist/components/charts/stacked-area-radar/logic.js +124 -121
  41. package/dist/components/charts/stacked-column-chart/logic.js +107 -95
  42. package/dist/components/charts/xy-chart/logic.js +112 -98
  43. package/dist/components/metric-card/MetricChart.js +29 -28
  44. package/dist/main.d.ts +13 -0
  45. package/package.json +1 -1
  46. package/dist/AnimatedTheme-jnasw6rT.js +0 -11305
  47. package/dist/DataProcessor-CHDO51q4.js +0 -83
@@ -1,43 +1,45 @@
1
- import { R as B, A as I, T as d } from "../../../AnimatedTheme-jnasw6rT.js";
2
- import { useThemeProps as M, useTheme as P } from "@mui/material";
3
- import X from "lodash";
4
- import { useId as V, useRef as E, useEffect as N } from "react";
5
- import { humanizeLabel as k } from "../_common/format.js";
1
+ import { R as M, A as O } from "../../../AnimatedTheme-ktdO3Bel.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
+ import { attachCombinedAxisTooltip as N } from "../_common/tooltip.js";
6
7
  import { colorSetFromPalette as W, applyValueFormat as q } from "../_common/utils.js";
7
- import { c as l, p as H, a as C } from "../../../ColorSet-C7vpNXhM.js";
8
- import { X as U, V as _ } from "../../../AxisRenderer-DTyLLA6c.js";
9
- import { S as $ } from "../../../Scrollbar-D86MJyr2.js";
10
- import { D as j } from "../../../DateAxis-YX3QNIB-.js";
11
- import { A as b, a as G } from "../../../AxisRendererY-C_ItLPNV.js";
12
- import { C as J } from "../../../CategoryAxis-CwnfaGc8.js";
13
- import { C as K } from "../../../ColumnSeries-CjgdJ2QL.js";
14
- import { D as L } from "../../../DataProcessor-CHDO51q4.js";
15
- import { L as Q } from "../../../LineSeries-Uiv5o56b.js";
16
- import { B as Z } from "../../../Bullet-DVczI2TD.js";
17
- import { C as ee } from "../../../Circle-Cy5s-pVc.js";
18
- import { X as te } from "../../../XYCursor-C8WktvKM.js";
19
- import { L as re } from "../../../Legend-Dp_MKfS4.js";
20
- const ke = (T) => {
21
- const h = M({ props: T, name: "HCColumnLineMix" }), {
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) => {
22
+ const f = E({ props: Y, name: "HCColumnLineMix" }), {
22
23
  dimensions: t,
23
24
  values: n,
24
25
  data: p,
25
- initDelay: Y = 0,
26
- baseInterval: D,
27
- colors: g,
28
- sx: S,
29
- ...O
30
- } = h, a = P(), x = `hc-column-line-mix-${V().replace(/:/g, "")}`, c = E(null), w = t.length < 1 ? "ColumnLineMix requires at least 1 dimension" : null;
31
- N(() => {
32
- if (w) return;
33
- let u;
34
- return u = setTimeout(() => {
35
- var y, A, v, F;
36
- const e = B.new(x);
37
- c.current = e, e.setThemes([I.new(e)]), e.interfaceColors.setAll({
38
- text: l(a.palette.text.primary),
39
- grid: l(a.palette.divider),
40
- stroke: l(a.palette.divider)
26
+ initDelay: S = 0,
27
+ baseInterval: h,
28
+ colors: x,
29
+ skipEmptyDates: A = !1,
30
+ sx: T,
31
+ ...R
32
+ } = 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;
33
+ G(() => {
34
+ if (y) return;
35
+ let c;
36
+ return c = setTimeout(() => {
37
+ var w, v, F, k;
38
+ const e = M.new(g);
39
+ d.current = e, e.setThemes([O.new(e)]), e.interfaceColors.setAll({
40
+ text: l(s.palette.text.primary),
41
+ grid: l(s.palette.divider),
42
+ stroke: l(s.palette.divider)
41
43
  });
42
44
  const r = e.container.children.push(
43
45
  U.new(e, {
@@ -45,116 +47,123 @@ const ke = (T) => {
45
47
  panY: !1,
46
48
  wheelX: "none",
47
49
  wheelY: "none",
50
+ maxTooltipDistance: -1,
48
51
  paddingLeft: 0,
49
52
  layout: e.verticalLayout
50
53
  })
51
54
  );
52
- r.set("colors", W(e, g)), r.get("colors", {}).set("step", 3), r.set(
55
+ r.set("colors", W(e, x)), r.get("colors", {}).set("step", 3), r.set(
53
56
  "scrollbarX",
54
57
  $.new(e, { orientation: "horizontal" })
55
58
  );
56
- let s, m = p;
57
- t[0].type === "date" ? (m = X.orderBy(p, [t[0].value]), s = r.xAxes.push(
58
- j.new(e, {
59
- maxDeviation: 0.1,
60
- groupData: !1,
61
- baseInterval: D || { timeUnit: "day", count: 1 },
62
- renderer: b.new(e, {}),
63
- tooltip: d.new(e, {})
64
- })
65
- ), (y = s.get("renderer")) == null || y.grid.template.setAll({
66
- stroke: l(a.palette.divider),
67
- strokeOpacity: 1
68
- })) : (s = r.xAxes.push(
69
- J.new(e, {
70
- categoryField: t[0].value,
71
- renderer: b.new(e, {}),
72
- tooltip: d.new(e, {})
73
- })
74
- ), (A = s.get("renderer")) == null || A.grid.template.setAll({
75
- stroke: l(a.palette.divider),
76
- strokeOpacity: 1
77
- }), e.numberFormatter.setAll({
78
- numberFormat: "#",
79
- numericFields: ["valueX"]
80
- }), m = X.orderBy(p, [t[0].value]), s.data.setAll(m));
81
- const f = r.yAxes.push(
59
+ let o, m = p;
60
+ if (t[0].type === "date") {
61
+ m = C.orderBy(p, [t[0].value]);
62
+ const i = A ? Q : oe;
63
+ o = r.xAxes.push(
64
+ i.new(e, {
65
+ maxDeviation: 0.1,
66
+ groupData: !1,
67
+ baseInterval: h || { timeUnit: "day", count: 1 },
68
+ renderer: D.new(e, {})
69
+ })
70
+ ), (w = o.get("renderer")) == null || w.grid.template.setAll({
71
+ stroke: l(s.palette.divider),
72
+ strokeOpacity: 1
73
+ });
74
+ } else
75
+ o = r.xAxes.push(
76
+ J.new(e, {
77
+ categoryField: t[0].value,
78
+ renderer: D.new(e, {})
79
+ })
80
+ ), (v = o.get("renderer")) == null || v.grid.template.setAll({
81
+ stroke: l(s.palette.divider),
82
+ strokeOpacity: 1
83
+ }), e.numberFormatter.setAll({
84
+ numberFormat: "#",
85
+ numericFields: ["valueX"]
86
+ }), m = C.orderBy(p, [t[0].value]), o.data.setAll(m);
87
+ const u = r.yAxes.push(
82
88
  _.new(e, {
83
89
  min: 0,
84
90
  extraMax: 0.1,
85
- renderer: G.new(e, { strokeOpacity: 0.1 })
91
+ renderer: j.new(e, { strokeOpacity: 0.1 })
86
92
  })
87
93
  );
88
- (v = f.get("renderer")) == null || v.grid.template.setAll({
89
- stroke: l(a.palette.divider),
94
+ (F = u.get("renderer")) == null || F.grid.template.setAll({
95
+ stroke: l(s.palette.divider),
90
96
  strokeOpacity: 1
91
- }), n.forEach((i, z) => {
92
- if (z === 0) {
93
- const o = r.series.push(
97
+ }), n.forEach((i, I) => {
98
+ if (I === 0) {
99
+ const a = r.series.push(
94
100
  K.new(e, {
95
- name: i.label ?? k(i.name),
96
- xAxis: s,
97
- yAxis: f,
101
+ name: i.label ?? b(i.name),
102
+ xAxis: o,
103
+ yAxis: u,
98
104
  valueYField: i.dataFieldName,
99
- ...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value },
100
- tooltip: d.new(e, {
101
- pointerOrientation: "horizontal",
102
- labelText: "{name} in {categoryX}: {valueY} {info}"
103
- })
105
+ ...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
104
106
  })
105
107
  );
106
- o.columns.template.setAll({
108
+ a.columns.template.setAll({
107
109
  tooltipY: H(10),
108
110
  templateField: "columnSettings"
109
- }), t[0].type === "date" && (o.data.processor = L.new(e, {
111
+ }), t[0].type === "date" && (a.data.processor = L.new(e, {
110
112
  dateFormat: "i",
111
113
  dateFields: [t[0].value]
112
- })), o.data.setAll(m), o.appear();
114
+ })), a.data.setAll(m), a.appear();
113
115
  } else {
114
- const o = r.series.push(
115
- Q.new(e, {
116
- name: i.label ?? k(i.name),
117
- xAxis: s,
118
- yAxis: f,
116
+ const a = r.series.push(
117
+ Z.new(e, {
118
+ name: i.label ?? b(i.name),
119
+ xAxis: o,
120
+ yAxis: u,
119
121
  valueYField: i.dataFieldName,
120
- ...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value },
121
- tooltip: d.new(e, {
122
- pointerOrientation: "horizontal",
123
- labelText: "{name} in {categoryX}: {valueY} {info}"
124
- })
122
+ ...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
125
123
  })
126
124
  );
127
- o.strokes.template.setAll({
125
+ a.strokes.template.setAll({
128
126
  strokeWidth: 3,
129
127
  templateField: "strokeSettings"
130
- }), t[0].type === "date" && (o.data.processor = L.new(e, {
128
+ }), t[0].type === "date" && (a.data.processor = L.new(e, {
131
129
  dateFormat: "i",
132
130
  dateFields: [t[0].value]
133
- })), o.data.setAll(m), o.bullets.push(function() {
134
- return Z.new(e, {
135
- sprite: ee.new(e, {
131
+ })), a.data.setAll(m), a.bullets.push(function() {
132
+ return ee.new(e, {
133
+ sprite: te.new(e, {
136
134
  strokeWidth: 3,
137
- stroke: o.get("stroke"),
135
+ stroke: a.get("stroke"),
138
136
  radius: 5,
139
137
  fill: e.interfaceColors.get("background")
140
138
  })
141
139
  });
142
140
  });
143
141
  }
144
- }), r.set("cursor", te.new(e, {})), r.children.push(
145
- re.new(e, {
146
- centerX: C,
147
- x: C
142
+ }), r.set(
143
+ "cursor",
144
+ re.new(e, { xAxis: o, behavior: "none" })
145
+ ).lineY.set("visible", !1), N({
146
+ root: e,
147
+ chart: r,
148
+ xAxis: o,
149
+ theme: s,
150
+ isDateAxis: t[0].type === "date",
151
+ baseInterval: h,
152
+ follow: !0
153
+ }), r.children.push(
154
+ ae.new(e, {
155
+ centerX: X,
156
+ x: X
148
157
  })
149
- ).data.setAll(r.series.values), q(e, (F = n == null ? void 0 : n[0]) == null ? void 0 : F.format), r.appear(1e3, 100);
150
- }, Y), () => {
158
+ ).data.setAll(r.series.values), q(e, (k = n == null ? void 0 : n[0]) == null ? void 0 : k.format), r.appear(1e3, 100);
159
+ }, S), () => {
151
160
  var e;
152
- u && clearTimeout(u), (e = c.current) == null || e.dispose(), c.current = null;
161
+ c && clearTimeout(c), (e = d.current) == null || e.dispose(), d.current = null;
153
162
  };
154
- }, [p, t, n, a.palette.mode, g]);
155
- const R = { ...h };
156
- return { chartId: x, ownerState: R, sx: S, error: w, other: O };
163
+ }, [p, t, n, s.palette.mode, x, A]);
164
+ const B = { ...f };
165
+ return { chartId: g, ownerState: B, sx: T, error: y, other: R };
157
166
  };
158
167
  export {
159
- ke as useColumnLineMixLogic
168
+ Le as useColumnLineMixLogic
160
169
  };
@@ -1,29 +1,29 @@
1
- import { R as x, A } from "../../../AnimatedTheme-jnasw6rT.js";
1
+ import { R as P, A } from "../../../AnimatedTheme-ktdO3Bel.js";
2
2
  import { useThemeProps as C, useTheme as D } from "@mui/material";
3
3
  import F from "dayjs";
4
- import { useId as P, useRef as R, useEffect as L } from "react";
5
- import { applyValueFormat as I, colorSetFromPalette as S } from "../_common/utils.js";
6
- import { P as E, a as j } from "../../../PieSeries-B2fW3z0s.js";
7
- import { p as m, c as u } from "../../../ColorSet-C7vpNXhM.js";
8
- import { L as k } from "../../../Legend-Dp_MKfS4.js";
9
- const J = (v) => {
10
- const d = C({ props: v, name: "HCDonutChart" }), {
4
+ import { useId as R, useRef as L, useEffect as I } from "react";
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";
9
+ const K = (y) => {
10
+ const p = C({ props: y, name: "HCDonutChart" }), {
11
11
  dimensions: t,
12
12
  values: o,
13
- data: n,
14
- initDelay: y = 0,
15
- colors: p,
16
- sx: M,
17
- ...T
18
- } = d, r = D(), f = `hc-donut-chart-${P().replace(/:/g, "")}`, i = R(null);
13
+ data: i,
14
+ initDelay: T = 0,
15
+ colors: d,
16
+ sx: x,
17
+ ...M
18
+ } = p, a = D(), f = `hc-donut-chart-${R().replace(/:/g, "")}`, n = L(null);
19
19
  let s = null;
20
- t.length < 1 ? s = "Missing dimensions config!" : o.length < 1 && (s = "Missing values config!"), L(() => {
20
+ t.length < 1 ? s = "Missing dimensions config!" : o.length < 1 && (s = "Missing values config!"), I(() => {
21
21
  if (s) return;
22
22
  let l;
23
23
  return l = setTimeout(() => {
24
- var g;
25
- const e = x.new(f);
26
- i.current = e, I(e, (g = o == null ? void 0 : o[0]) == null ? void 0 : g.format), e.setThemes([A.new(e)]);
24
+ var Y;
25
+ const e = P.new(f);
26
+ n.current = e, S(e, (Y = o == null ? void 0 : o[0]) == null ? void 0 : Y.format), e.setThemes([A.new(e)]);
27
27
  const h = e.container.children.push(
28
28
  E.new(e, {
29
29
  layout: e.verticalLayout,
@@ -31,37 +31,39 @@ const J = (v) => {
31
31
  })
32
32
  );
33
33
  e.interfaceColors.setAll({
34
- text: u(r.palette.text.primary),
35
- grid: u(r.palette.divider),
36
- stroke: u(r.palette.divider)
34
+ text: u(a.palette.text.primary),
35
+ grid: u(a.palette.divider),
36
+ stroke: u(a.palette.divider)
37
37
  });
38
- const a = h.series.push(
39
- j.new(e, {
38
+ const r = h.series.push(
39
+ N.new(e, {
40
40
  valueField: o[0].dataFieldName,
41
41
  categoryField: t[0].value
42
42
  })
43
43
  );
44
- a.set("colors", S(e, p)), t[0].type === "date" && n.forEach((Y) => {
44
+ r.set("colors", b(e, d));
45
+ const g = "{category}: {valuePercentTotal.formatNumber('0.00')}% ({value})";
46
+ r.slices.template.set("tooltipText", g), r.labels.template.set("text", g), t[0].type === "date" && i.forEach((v) => {
45
47
  let c = "YYYY";
46
- t[0].value.includes("month") ? c = "MMM YYYY" : t[0].value.includes("day") && (c = "DD MMM YYYY"), Y[t[0].value] = F(Y[t[0].value]).format(
48
+ t[0].value.includes("month") ? c = "MMM YYYY" : t[0].value.includes("day") && (c = "DD MMM YYYY"), v[t[0].value] = F(v[t[0].value]).format(
47
49
  c
48
50
  );
49
- }), a.data.setAll(n), h.children.push(
50
- k.new(e, {
51
+ }), r.data.setAll(i), h.children.push(
52
+ j.new(e, {
51
53
  centerX: m(50),
52
54
  x: m(50),
53
55
  marginTop: 15,
54
56
  marginBottom: 15
55
57
  })
56
- ).data.setAll(a.dataItems), a.appear(1e3, 100);
57
- }, y), () => {
58
+ ).data.setAll(r.dataItems), r.appear(1e3, 100);
59
+ }, T), () => {
58
60
  var e;
59
- l && clearTimeout(l), (e = i.current) == null || e.dispose(), i.current = null;
61
+ l && clearTimeout(l), (e = n.current) == null || e.dispose(), n.current = null;
60
62
  };
61
- }, [n, t, o, r.palette.mode, p]);
62
- const w = { ...d };
63
- return { chartId: f, ownerState: w, sx: M, error: s, other: T };
63
+ }, [i, t, o, a.palette.mode, d]);
64
+ const w = { ...p };
65
+ return { chartId: f, ownerState: w, sx: x, error: s, other: M };
64
66
  };
65
67
  export {
66
- J as useDonutChartLogic
68
+ K as useDonutChartLogic
67
69
  };
@@ -1,12 +1,13 @@
1
- import { C as x, k as F, l as I, L as W, R as E, a as Z, A as $ } from "../../../AnimatedTheme-jnasw6rT.js";
2
- import { useThemeProps as G, useTheme as J } from "@mui/material";
3
- import K from "dayjs";
4
- import Q from "lodash";
5
- import { useId as U, useRef as ee, useEffect as te } from "react";
6
- import { applyValueFormat as ie, colorSetFromPalette as ae } from "../_common/utils.js";
7
- import { m as M, f as O, e as j, p as C } from "../../../ColorSet-C7vpNXhM.js";
8
- import { a as ne, H as X } from "../../../Hierarchy-Bihj0S61.js";
9
- import { R as z } from "../../../RoundedRectangle-CWLi2PXn.js";
1
+ import { R as W, T as E, A as Z } from "../../../AnimatedTheme-ktdO3Bel.js";
2
+ import { useThemeProps as $, useTheme as G } from "@mui/material";
3
+ import J from "dayjs";
4
+ import K from "lodash";
5
+ import { useId as Q, useRef as U, useEffect as ee } from "react";
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";
10
11
  import { r as se, c as R, a as L } from "../../../constant-BiOGvlZc.js";
11
12
  class Y extends x {
12
13
  constructor() {
@@ -14,7 +15,7 @@ class Y extends x {
14
15
  enumerable: !0,
15
16
  configurable: !0,
16
17
  writable: !0,
17
- value: this.addDisposer(new F(I.new({}), () => W._new(this._root, {
18
+ value: this.addDisposer(new F(I.new({}), () => ae._new(this._root, {
18
19
  themeTags: M(this.labels.template.get("themeTags", []), ["label"]),
19
20
  background: z.new(this._root, {
20
21
  themeTags: ["background"]
@@ -74,28 +75,28 @@ function re(u) {
74
75
  u.x0 = Math.round(u.x0), u.y0 = Math.round(u.y0), u.x1 = Math.round(u.x1), u.y1 = Math.round(u.y1);
75
76
  }
76
77
  function A(u, t, i, a, r) {
77
- for (var l = u.children, s, h = -1, y = l.length, c = u.value && (a - t) / u.value; ++h < y; )
78
+ for (var l = u.children, s, h = -1, b = l.length, c = u.value && (a - t) / u.value; ++h < b; )
78
79
  s = l[h], s.y0 = i, s.y1 = r, s.x0 = t, s.x1 = t += s.value * c;
79
80
  }
80
81
  function H(u, t, i, a, r) {
81
- for (var l = u.children, s, h = -1, y = l.length, c = u.value && (r - i) / u.value; ++h < y; )
82
+ for (var l = u.children, s, h = -1, b = l.length, c = u.value && (r - i) / u.value; ++h < b; )
82
83
  s = l[h], s.x0 = t, s.x1 = a, s.y0 = i, s.y1 = i += s.value * c;
83
84
  }
84
85
  var oe = (1 + Math.sqrt(5)) / 2;
85
86
  function le(u, t, i, a, r, l) {
86
- for (var s = [], h = t.children, y, c, o = 0, m = 0, e = h.length, d, g, p = t.value, n, f, w, v, P, b, _; o < e; ) {
87
+ for (var s = [], h = t.children, b, c, o = 0, m = 0, e = h.length, d, g, p = t.value, n, f, w, v, P, y, _; o < e; ) {
87
88
  d = r - i, g = l - a;
88
89
  do
89
90
  n = h[m++].value;
90
91
  while (!n && m < e);
91
- for (f = w = n, b = Math.max(g / d, d / g) / (p * u), _ = n * n * b, P = Math.max(w / _, _ / f); m < e; ++m) {
92
- if (n += c = h[m].value, c < f && (f = c), c > w && (w = c), _ = n * n * b, v = Math.max(w / _, _ / f), v > P) {
92
+ for (f = w = n, y = Math.max(g / d, d / g) / (p * u), _ = n * n * y, P = Math.max(w / _, _ / f); m < e; ++m) {
93
+ if (n += c = h[m].value, c < f && (f = c), c > w && (w = c), _ = n * n * y, v = Math.max(w / _, _ / f), v > P) {
93
94
  n -= c;
94
95
  break;
95
96
  }
96
97
  P = v;
97
98
  }
98
- s.push(y = { value: n, dice: d < g, children: h.slice(o, m) }), y.dice ? A(y, i, a, r, p ? a += g * n / p : l) : H(y, i, a, p ? i += d * n / p : r, l), p -= n, o = m;
99
+ s.push(b = { value: n, dice: d < g, children: h.slice(o, m) }), b.dice ? A(b, i, a, r, p ? a += g * n / p : l) : H(b, i, a, p ? i += d * n / p : r, l), p -= n, o = m;
99
100
  }
100
101
  return s;
101
102
  }
@@ -108,13 +109,13 @@ const V = function u(t) {
108
109
  }, i;
109
110
  }(oe);
110
111
  function q() {
111
- var u = V, t = !1, i = 1, a = 1, r = [0], l = R, s = R, h = R, y = R, c = R;
112
+ var u = V, t = !1, i = 1, a = 1, r = [0], l = R, s = R, h = R, b = R, c = R;
112
113
  function o(e) {
113
114
  return e.x0 = e.y0 = 0, e.x1 = i, e.y1 = a, e.eachBefore(m), r = [0], t && e.eachBefore(re), e;
114
115
  }
115
116
  function m(e) {
116
117
  var d = r[e.depth], g = e.x0 + d, p = e.y0 + d, n = e.x1 - d, f = e.y1 - d;
117
- n < g && (g = n = (g + n) / 2), f < p && (p = f = (p + f) / 2), e.x0 = g, e.y0 = p, e.x1 = n, e.y1 = f, e.children && (d = r[e.depth + 1] = l(e) / 2, g += c(e) - d, p += s(e) - d, n -= h(e) - d, f -= y(e) - d, n < g && (g = n = (g + n) / 2), f < p && (p = f = (p + f) / 2), u(e, g, p, n, f));
118
+ n < g && (g = n = (g + n) / 2), f < p && (p = f = (p + f) / 2), e.x0 = g, e.y0 = p, e.x1 = n, e.y1 = f, e.children && (d = r[e.depth + 1] = l(e) / 2, g += c(e) - d, p += s(e) - d, n -= h(e) - d, f -= b(e) - d, n < g && (g = n = (g + n) / 2), f < p && (p = f = (p + f) / 2), u(e, g, p, n, f));
118
119
  }
119
120
  return o.round = function(e) {
120
121
  return arguments.length ? (t = !!e, o) : t;
@@ -133,15 +134,15 @@ function q() {
133
134
  }, o.paddingRight = function(e) {
134
135
  return arguments.length ? (h = typeof e == "function" ? e : L(+e), o) : h;
135
136
  }, o.paddingBottom = function(e) {
136
- return arguments.length ? (y = typeof e == "function" ? e : L(+e), o) : y;
137
+ return arguments.length ? (b = typeof e == "function" ? e : L(+e), o) : b;
137
138
  }, o.paddingLeft = function(e) {
138
139
  return arguments.length ? (c = typeof e == "function" ? e : L(+e), o) : c;
139
140
  }, o;
140
141
  }
141
142
  function de(u, t, i, a, r) {
142
- var l = u.children, s, h = l.length, y, c = new Array(h + 1);
143
- for (c[0] = y = s = 0; s < h; ++s)
144
- c[s + 1] = y += l[s].value;
143
+ var l = u.children, s, h = l.length, b, c = new Array(h + 1);
144
+ for (c[0] = b = s = 0; s < h; ++s)
145
+ c[s + 1] = b += l[s].value;
145
146
  o(0, h, u.value, t, i, a, r);
146
147
  function o(m, e, d, g, p, n, f) {
147
148
  if (m >= e - 1) {
@@ -149,18 +150,18 @@ function de(u, t, i, a, r) {
149
150
  w.x0 = g, w.y0 = p, w.x1 = n, w.y1 = f;
150
151
  return;
151
152
  }
152
- for (var v = c[m], P = d / 2 + v, b = m + 1, _ = e - 1; b < _; ) {
153
- var k = b + _ >>> 1;
154
- c[k] < P ? b = k + 1 : _ = k;
153
+ for (var v = c[m], P = d / 2 + v, y = m + 1, _ = e - 1; y < _; ) {
154
+ var k = y + _ >>> 1;
155
+ c[k] < P ? y = k + 1 : _ = k;
155
156
  }
156
- P - c[b - 1] < c[b] - P && m + 1 < b && --b;
157
- var D = c[b] - v, T = d - D;
157
+ P - c[y - 1] < c[y] - P && m + 1 < y && --y;
158
+ var D = c[y] - v, T = d - D;
158
159
  if (n - g > f - p) {
159
160
  var N = d ? (g * T + n * D) / d : n;
160
- o(m, b, D, g, p, N, f), o(b, e, T, N, p, n, f);
161
+ o(m, y, D, g, p, N, f), o(y, e, T, N, p, n, f);
161
162
  } else {
162
163
  var S = d ? (p * T + f * D) / d : f;
163
- o(m, b, D, g, p, n, S), o(b, e, T, g, S, n, f);
164
+ o(m, y, D, g, p, n, S), o(y, e, T, g, S, n, f);
164
165
  }
165
166
  }
166
167
  }
@@ -234,7 +235,7 @@ class B extends X {
234
235
  }
235
236
  _updateNode(t) {
236
237
  super._updateNode(t);
237
- const i = t.get("node"), a = t.get("rectangle"), r = t.get("d3HierarchyNode"), l = this.getPrivate("scaleX", 1), s = this.getPrivate("scaleY", 1), h = r.x0 * l, y = r.x1 * l, c = r.y0 * s, o = r.y1 * s, m = y - h, e = o - c, d = this.get("animationDuration", 0), g = this.get("animationEasing");
238
+ const i = t.get("node"), a = t.get("rectangle"), r = t.get("d3HierarchyNode"), l = this.getPrivate("scaleX", 1), s = this.getPrivate("scaleY", 1), h = r.x0 * l, b = r.x1 * l, c = r.y0 * s, o = r.y1 * s, m = b - h, e = o - c, d = this.get("animationDuration", 0), g = this.get("animationEasing");
238
239
  if (i.animate({ key: "x", to: h, duration: d, easing: g }), i.animate({ key: "y", to: c, duration: d, easing: g }), i.animate({ key: "width", to: m, duration: d, easing: g }), i.animate({ key: "height", to: e, duration: d, easing: g }), a) {
239
240
  const p = t.get("fill"), n = t.get("fillPattern");
240
241
  a.animate({ key: "width", to: m, duration: d, easing: g }), a.animate({ key: "height", to: e, duration: d, easing: g }), a._setDefault("fill", p), a._setDefault("fillPattern", n), a._setDefault("stroke", p);
@@ -243,7 +244,7 @@ class B extends X {
243
244
  _updateNodesScale(t) {
244
245
  const i = t.data.dataItem;
245
246
  if (i) {
246
- const a = i.get("node"), r = i.get("rectangle"), l = this.getPrivate("scaleX", 1), s = this.getPrivate("scaleY", 1), h = t.x0 * l, y = t.x1 * l, c = t.y0 * s, o = t.y1 * s, m = y - h, e = o - c;
247
+ const a = i.get("node"), r = i.get("rectangle"), l = this.getPrivate("scaleX", 1), s = this.getPrivate("scaleY", 1), h = t.x0 * l, b = t.x1 * l, c = t.y0 * s, o = t.y1 * s, m = b - h, e = o - c;
247
248
  a.setAll({ x: h, y: c, width: m, height: e }), r.setAll({ width: m, height: e });
248
249
  const d = t.children;
249
250
  d && j(d, (g) => {
@@ -267,10 +268,10 @@ class B extends X {
267
268
  _zoom(t) {
268
269
  if (this.width() > 0 && this.height() > 0) {
269
270
  const i = t.get("d3HierarchyNode"), a = this.get("nodePaddingOuter", 0);
270
- let r = i.x0 + a, l = i.x1 - a, s = i.y0 + a, h = i.y1 - a, y = (this.innerWidth() - a * 2) / (l - r), c = (this.innerHeight() - a * 2) / (h - s);
271
+ let r = i.x0 + a, l = i.x1 - a, s = i.y0 + a, h = i.y1 - a, b = (this.innerWidth() - a * 2) / (l - r), c = (this.innerHeight() - a * 2) / (h - s);
271
272
  const o = this.get("animationEasing");
272
273
  let m = this.get("animationDuration", 0);
273
- this.inited || (m = 0), this.animatePrivate({ key: "scaleX", to: y, duration: m, easing: o }), this.animatePrivate({ key: "scaleY", to: c, duration: m, easing: o }), this.nodesContainer.animate({ key: "x", to: a - r * y, duration: m, easing: o }), this.nodesContainer.animate({ key: "y", to: a - s * c, duration: m, easing: o });
274
+ this.inited || (m = 0), this.animatePrivate({ key: "scaleX", to: b, duration: m, easing: o }), this.animatePrivate({ key: "scaleY", to: c, duration: m, easing: o }), this.nodesContainer.animate({ key: "x", to: a - r * b, duration: m, easing: o }), this.nodesContainer.animate({ key: "y", to: a - s * c, duration: m, easing: o });
274
275
  }
275
276
  }
276
277
  _selectDataItem(t, i, a) {
@@ -304,26 +305,26 @@ Object.defineProperty(B, "classNames", {
304
305
  writable: !0,
305
306
  value: X.classNames.concat([B.className])
306
307
  });
307
- const _e = (u) => {
308
- const t = G({ props: u, name: "HCDrillDownTreemap" }), {
308
+ const De = (u) => {
309
+ const t = $({ props: u, name: "HCDrillDownTreemap" }), {
309
310
  dimensions: i,
310
311
  values: a,
311
312
  data: r,
312
313
  initDelay: l = 0,
313
314
  colors: s,
314
315
  sx: h,
315
- ...y
316
- } = t, c = J(), m = `hc-drill-down-treemap-${U().replace(/:/g, "")}`, e = ee(null);
316
+ ...b
317
+ } = t, c = G(), m = `hc-drill-down-treemap-${Q().replace(/:/g, "")}`, e = U(null);
317
318
  let d = null;
318
- i.length < 2 ? d = "DrillDownTreemap requires at least 2 dimensions" : a.length < 1 && (d = "DrillDownTreemap requires at least 1 value"), te(() => {
319
+ i.length < 2 ? d = "DrillDownTreemap requires at least 2 dimensions" : a.length < 1 && (d = "DrillDownTreemap requires at least 1 value"), ee(() => {
319
320
  if (d) return;
320
321
  let p;
321
322
  return p = setTimeout(() => {
322
- var b, _;
323
- const n = E.new(m);
324
- e.current = n, ie(n, (b = a == null ? void 0 : a[0]) == null ? void 0 : b.format);
325
- const f = Z.new(n);
326
- f.rule("RoundedRectangle", ["hierarchy", "node", "shape", "depth1"]).setAll({ strokeWidth: 2 }), f.rule("RoundedRectangle", ["hierarchy", "node", "shape", "depth2"]).setAll({ strokeWidth: 1, strokeOpacity: 0.2 }), f.rule("Label", ["node", "depth1"]).setAll({ fontSize: 10 }), f.rule("Label", ["node", "depth2"]).setAll({ fontSize: 10 }), n.setThemes([$.new(n), f]);
323
+ var y, _;
324
+ const n = W.new(m);
325
+ e.current = n, te(n, (y = a == null ? void 0 : a[0]) == null ? void 0 : y.format);
326
+ const f = E.new(n);
327
+ f.rule("RoundedRectangle", ["hierarchy", "node", "shape", "depth1"]).setAll({ strokeWidth: 2 }), f.rule("RoundedRectangle", ["hierarchy", "node", "shape", "depth2"]).setAll({ strokeWidth: 1, strokeOpacity: 0.2 }), f.rule("Label", ["node", "depth1"]).setAll({ fontSize: 10 }), f.rule("Label", ["node", "depth2"]).setAll({ fontSize: 10 }), n.setThemes([Z.new(n), f]);
327
328
  const w = n.container.children.push(
328
329
  x.new(n, {
329
330
  width: C(100),
@@ -344,19 +345,19 @@ const _e = (u) => {
344
345
  nodePaddingInner: 0
345
346
  })
346
347
  );
347
- v.nodes.template.setPrivate("trustBounds", !0), v.set("colors", ae(n, s)), (_ = v.get("colors")) == null || _.set("step", 1), w.children.moveValue(
348
+ v.nodes.template.setPrivate("trustBounds", !0), v.set("colors", ie(n, s)), (_ = v.get("colors")) == null || _.set("step", 1), w.children.moveValue(
348
349
  Y.new(n, { series: v }),
349
350
  0
350
351
  );
351
352
  const P = (k, D, T) => {
352
353
  if (k === "date") {
353
354
  let N = "YYYY";
354
- return D.includes("month") ? N = "MMM YYYY" : D.includes("day") && (N = "DD MMM YYYY"), K(T).format(N);
355
+ return D.includes("month") ? N = "MMM YYYY" : D.includes("day") && (N = "DD MMM YYYY"), J(T).format(N);
355
356
  }
356
357
  return T;
357
358
  };
358
359
  if (i.length > 1) {
359
- const k = Q.groupBy(r, i[0].value), D = [];
360
+ const k = K.groupBy(r, i[0].value), D = [];
360
361
  Object.keys(k).forEach((T) => {
361
362
  D.push({
362
363
  name: P(i[0].type, i[0].value, T),
@@ -378,8 +379,8 @@ const _e = (u) => {
378
379
  };
379
380
  }, [r, i, a, c.palette.mode, s]);
380
381
  const g = { ...t };
381
- return { chartId: m, ownerState: g, sx: h, error: d, other: y };
382
+ return { chartId: m, ownerState: g, sx: h, error: d, other: b };
382
383
  };
383
384
  export {
384
- _e as useDrillDownTreemapLogic
385
+ De as useDrillDownTreemapLogic
385
386
  };