@hybridcore/ui 1.6.4 → 1.6.6
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.
- package/CATALOG.md +1 -0
- package/dist/IconX-C2wmVYSK.js +11 -0
- package/dist/components/charts/_common/format.js +49 -0
- package/dist/components/charts/_common/utils.js +12 -7
- package/dist/components/charts/chart-wrapper/index.js +36 -34
- package/dist/components/charts/column-line-mix/logic.js +78 -78
- package/dist/components/charts/donut-chart/index.js +11 -0
- package/dist/components/charts/donut-chart/logic.js +67 -0
- package/dist/components/charts/donut-chart/styled.js +12 -0
- package/dist/components/charts/drill-down-treemap/logic.js +123 -123
- package/dist/components/charts/drill-down-voronoi-treemap/logic.js +253 -252
- package/dist/components/charts/heatmap/logic.js +73 -73
- package/dist/components/charts/line/logic.js +66 -66
- package/dist/components/charts/logaritmic-scale/logic.js +65 -65
- package/dist/components/charts/multiple-value-axes/logic.js +75 -74
- package/dist/components/charts/nested-pie/logic.js +43 -42
- package/dist/components/charts/packed-circles/logic.js +111 -110
- package/dist/components/charts/pie-chart/logic.js +40 -39
- package/dist/components/charts/stacked-area-radar/logic.js +51 -51
- package/dist/components/charts/stacked-column-chart/logic.js +79 -79
- package/dist/components/charts/xy-chart/logic.js +71 -71
- package/dist/components/color-picker/index.js +1645 -1602
- package/dist/components/color-picker/logic.js +21 -12
- package/dist/components/color-picker/styled.js +4 -2
- package/dist/components/date-range-picker/index.js +359 -365
- package/dist/components/metric-card/helpers.js +12 -5
- package/dist/components/metric-card/logic.js +65 -57
- package/dist/components/metric-card/styled.js +55 -47
- package/dist/components/simple-pivot-table/index.js +129 -54
- package/dist/components/simple-pivot-table/logic.js +111 -45
- package/dist/components/simple-pivot-table/styled.js +31 -11
- package/dist/main.d.ts +128 -8
- package/dist/main.js +163 -157
- package/dist/{styled-Db1RdcPA.js → styled-SoqbyrkW.js} +116 -89
- package/package.json +1 -1
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
4
|
-
import { useId as
|
|
5
|
-
import { colorSetFromPalette as q } from "../_common/utils.js";
|
|
6
|
-
import { c as
|
|
7
|
-
import { X as
|
|
8
|
-
import { X as
|
|
9
|
-
import { D as
|
|
10
|
-
import { A as X, a as
|
|
11
|
-
import { C as
|
|
12
|
-
import { L as
|
|
13
|
-
import { D as
|
|
14
|
-
import { S as
|
|
15
|
-
const
|
|
16
|
-
const f =
|
|
1
|
+
import { R as C, A as R, T as u } from "../../../AnimatedTheme-jnasw6rT.js";
|
|
2
|
+
import { useThemeProps as I, useTheme as E } from "@mui/material";
|
|
3
|
+
import F from "lodash";
|
|
4
|
+
import { useId as O, useRef as P, useEffect as V } from "react";
|
|
5
|
+
import { colorSetFromPalette as q, applyValueFormat as B } from "../_common/utils.js";
|
|
6
|
+
import { c as i } from "../../../ColorSet-C7vpNXhM.js";
|
|
7
|
+
import { X as z, V as G } from "../../../AxisRenderer-DTyLLA6c.js";
|
|
8
|
+
import { X as H } from "../../../XYCursor-C8WktvKM.js";
|
|
9
|
+
import { D as N } from "../../../DateAxis-YX3QNIB-.js";
|
|
10
|
+
import { A as X, a as U } from "../../../AxisRendererY-C_ItLPNV.js";
|
|
11
|
+
import { C as W } from "../../../CategoryAxis-CwnfaGc8.js";
|
|
12
|
+
import { L as Z } from "../../../LineSeries-Uiv5o56b.js";
|
|
13
|
+
import { D as _ } from "../../../DataProcessor-CHDO51q4.js";
|
|
14
|
+
import { S as $ } from "../../../Scrollbar-D86MJyr2.js";
|
|
15
|
+
const ce = (b) => {
|
|
16
|
+
const f = I({ props: b, name: "HCLogaritmicScale" }), {
|
|
17
17
|
dimensions: t,
|
|
18
|
-
values:
|
|
19
|
-
data:
|
|
20
|
-
initDelay:
|
|
21
|
-
baseInterval:
|
|
18
|
+
values: a,
|
|
19
|
+
data: l,
|
|
20
|
+
initDelay: k = 0,
|
|
21
|
+
baseInterval: S,
|
|
22
22
|
colors: h,
|
|
23
|
-
sx:
|
|
24
|
-
...
|
|
25
|
-
} = f, o =
|
|
26
|
-
let
|
|
27
|
-
t.length < 1 ?
|
|
28
|
-
if (
|
|
23
|
+
sx: T,
|
|
24
|
+
...D
|
|
25
|
+
} = f, o = E(), g = `hc-logaritmic-scale-${O().replace(/:/g, "")}`, c = P(null);
|
|
26
|
+
let n = null;
|
|
27
|
+
t.length < 1 ? n = "LogaritmicScale requires at least 1 dimension" : a.length < 1 && (n = "LogaritmicScale requires at least 1 value"), V(() => {
|
|
28
|
+
if (n) return;
|
|
29
29
|
let d;
|
|
30
30
|
return d = setTimeout(() => {
|
|
31
|
-
var
|
|
32
|
-
const e =
|
|
33
|
-
|
|
34
|
-
text:
|
|
35
|
-
grid:
|
|
36
|
-
stroke:
|
|
31
|
+
var v, w, x, y;
|
|
32
|
+
const e = C.new(g);
|
|
33
|
+
c.current = e, e.setThemes([R.new(e)]), e.interfaceColors.setAll({
|
|
34
|
+
text: i(o.palette.text.primary),
|
|
35
|
+
grid: i(o.palette.divider),
|
|
36
|
+
stroke: i(o.palette.divider)
|
|
37
37
|
});
|
|
38
38
|
const r = e.container.children.push(
|
|
39
|
-
|
|
39
|
+
z.new(e, {
|
|
40
40
|
panX: !0,
|
|
41
41
|
panY: !0,
|
|
42
42
|
wheelX: "none",
|
|
@@ -46,22 +46,22 @@ const me = (F) => {
|
|
|
46
46
|
);
|
|
47
47
|
r.set("colors", q(e, h)), r.set(
|
|
48
48
|
"cursor",
|
|
49
|
-
|
|
49
|
+
H.new(e, { behavior: "none" })
|
|
50
50
|
).lineY.set("visible", !1);
|
|
51
|
-
let
|
|
52
|
-
t[0].type === "date" ? (
|
|
53
|
-
|
|
51
|
+
let s, m = l;
|
|
52
|
+
t[0].type === "date" ? (m = F.orderBy(l, [t[0].value]), s = r.xAxes.push(
|
|
53
|
+
N.new(e, {
|
|
54
54
|
maxDeviation: 0.1,
|
|
55
55
|
groupData: !1,
|
|
56
|
-
baseInterval:
|
|
56
|
+
baseInterval: S || { timeUnit: "day", count: 1 },
|
|
57
57
|
renderer: X.new(e, {}),
|
|
58
58
|
tooltip: u.new(e, {})
|
|
59
59
|
})
|
|
60
|
-
), (
|
|
61
|
-
stroke:
|
|
60
|
+
), (v = s.get("renderer")) == null || v.grid.template.setAll({
|
|
61
|
+
stroke: i(o.palette.divider),
|
|
62
62
|
strokeOpacity: 1
|
|
63
|
-
})) : (
|
|
64
|
-
|
|
63
|
+
})) : (s = r.xAxes.push(
|
|
64
|
+
W.new(e, {
|
|
65
65
|
categoryField: t[0].value,
|
|
66
66
|
renderer: X.new(e, {}),
|
|
67
67
|
tooltip: u.new(e, {})
|
|
@@ -69,45 +69,45 @@ const me = (F) => {
|
|
|
69
69
|
), e.numberFormatter.setAll({
|
|
70
70
|
numberFormat: "#",
|
|
71
71
|
numericFields: ["valueX"]
|
|
72
|
-
}),
|
|
73
|
-
stroke:
|
|
72
|
+
}), m = F.orderBy(l, [t[0].value]), s.data.setAll(m), (w = s.get("renderer")) == null || w.grid.template.setAll({
|
|
73
|
+
stroke: i(o.palette.divider),
|
|
74
74
|
strokeOpacity: 1
|
|
75
75
|
}));
|
|
76
|
-
const
|
|
77
|
-
|
|
76
|
+
const A = r.yAxes.push(
|
|
77
|
+
G.new(e, {
|
|
78
78
|
logarithmic: !0,
|
|
79
|
-
renderer:
|
|
79
|
+
renderer: U.new(e, { minorGridEnabled: !0 })
|
|
80
80
|
})
|
|
81
81
|
);
|
|
82
|
-
(x =
|
|
83
|
-
stroke:
|
|
82
|
+
(x = A.get("renderer")) == null || x.grid.template.setAll({
|
|
83
|
+
stroke: i(o.palette.divider),
|
|
84
84
|
strokeOpacity: 1
|
|
85
|
-
}),
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
xAxis:
|
|
89
|
-
yAxis:
|
|
90
|
-
valueYField:
|
|
85
|
+
}), a.forEach((L) => {
|
|
86
|
+
const p = r.series.push(
|
|
87
|
+
Z.new(e, {
|
|
88
|
+
xAxis: s,
|
|
89
|
+
yAxis: A,
|
|
90
|
+
valueYField: L.dataFieldName,
|
|
91
91
|
...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value },
|
|
92
92
|
tooltip: u.new(e, { labelText: "{valueY}" })
|
|
93
93
|
})
|
|
94
94
|
);
|
|
95
|
-
|
|
95
|
+
p.strokes.template.setAll({ strokeWidth: 3 }), t[0].type === "date" && (p.data.processor = _.new(e, {
|
|
96
96
|
dateFormat: "i",
|
|
97
97
|
dateFields: [t[0].value]
|
|
98
|
-
})),
|
|
98
|
+
})), p.data.setAll(m), p.appear(1e3);
|
|
99
99
|
}), r.set(
|
|
100
100
|
"scrollbarX",
|
|
101
|
-
|
|
102
|
-
), r.appear(1e3, 100);
|
|
103
|
-
},
|
|
101
|
+
$.new(e, { orientation: "horizontal" })
|
|
102
|
+
), B(e, (y = a == null ? void 0 : a[0]) == null ? void 0 : y.format), r.appear(1e3, 100);
|
|
103
|
+
}, k), () => {
|
|
104
104
|
var e;
|
|
105
|
-
d && clearTimeout(d), (e =
|
|
105
|
+
d && clearTimeout(d), (e = c.current) == null || e.dispose(), c.current = null;
|
|
106
106
|
};
|
|
107
|
-
}, [
|
|
108
|
-
const
|
|
109
|
-
return { chartId:
|
|
107
|
+
}, [l, t, a, o.palette.mode, h]);
|
|
108
|
+
const Y = { ...f };
|
|
109
|
+
return { chartId: g, ownerState: Y, sx: T, error: n, other: D };
|
|
110
110
|
};
|
|
111
111
|
export {
|
|
112
|
-
|
|
112
|
+
ce as useLogaritmicScaleLogic
|
|
113
113
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { G as P, R as
|
|
2
|
-
import { useThemeProps as
|
|
1
|
+
import { G as P, R as M, A as j, T, b as q } from "../../../AnimatedTheme-jnasw6rT.js";
|
|
2
|
+
import { useThemeProps as z, useTheme as U } from "@mui/material";
|
|
3
3
|
import C from "lodash";
|
|
4
|
-
import { useId as
|
|
5
|
-
import { colorSetFromPalette as
|
|
4
|
+
import { useId as $, useRef as H, useEffect as J } from "react";
|
|
5
|
+
import { colorSetFromPalette as K, applyValueFormat as Q } from "../_common/utils.js";
|
|
6
6
|
import { c as D, a as w } from "../../../ColorSet-C7vpNXhM.js";
|
|
7
|
-
import { X as
|
|
8
|
-
import { L as
|
|
9
|
-
import { D as
|
|
10
|
-
import { A as
|
|
11
|
-
import { C as
|
|
12
|
-
import { X as
|
|
13
|
-
import { L as
|
|
14
|
-
import { D as
|
|
15
|
-
import { C as
|
|
16
|
-
import { B as
|
|
7
|
+
import { X as Z, V as ee } from "../../../AxisRenderer-DTyLLA6c.js";
|
|
8
|
+
import { L as te } from "../../../Legend-Dp_MKfS4.js";
|
|
9
|
+
import { D as re } from "../../../DateAxis-YX3QNIB-.js";
|
|
10
|
+
import { A as F, a as se } from "../../../AxisRendererY-C_ItLPNV.js";
|
|
11
|
+
import { C as ae } from "../../../CategoryAxis-CwnfaGc8.js";
|
|
12
|
+
import { X as ie } from "../../../XYCursor-C8WktvKM.js";
|
|
13
|
+
import { L as oe } from "../../../LineSeries-Uiv5o56b.js";
|
|
14
|
+
import { D as le } from "../../../DataProcessor-CHDO51q4.js";
|
|
15
|
+
import { C as ne } from "../../../Circle-Cy5s-pVc.js";
|
|
16
|
+
import { B as ce } from "../../../Bullet-DVczI2TD.js";
|
|
17
17
|
class x extends P {
|
|
18
18
|
_beforeChanged() {
|
|
19
19
|
super._beforeChanged(), (this.isDirty("width") || this.isDirty("height") || this.isPrivateDirty("width") || this.isPrivateDirty("height")) && (this._clear = !0);
|
|
@@ -22,8 +22,8 @@ class x extends P {
|
|
|
22
22
|
super._changed(), this._clear && !this.get("draw") && this._draw();
|
|
23
23
|
}
|
|
24
24
|
_draw() {
|
|
25
|
-
const n = this.width(),
|
|
26
|
-
|
|
25
|
+
const n = this.width(), s = this.height(), t = this._display;
|
|
26
|
+
t.moveTo(-n / 2, s / 2), t.lineTo(0, -s / 2), t.lineTo(n / 2, s / 2), t.lineTo(-n / 2, s / 2), t.closePath();
|
|
27
27
|
}
|
|
28
28
|
_updateSize() {
|
|
29
29
|
this.markDirty(), this._clear = !0;
|
|
@@ -41,30 +41,31 @@ Object.defineProperty(x, "classNames", {
|
|
|
41
41
|
writable: !0,
|
|
42
42
|
value: P.classNames.concat([x.className])
|
|
43
43
|
});
|
|
44
|
-
const A = ["CIRCLE", "RECTANGLE", "TRIANGLE"],
|
|
45
|
-
const n =
|
|
46
|
-
dimensions:
|
|
47
|
-
values:
|
|
48
|
-
data:
|
|
44
|
+
const A = ["CIRCLE", "RECTANGLE", "TRIANGLE"], Re = (L) => {
|
|
45
|
+
const n = z({ props: L, name: "HCMultipleValueAxes" }), {
|
|
46
|
+
dimensions: s,
|
|
47
|
+
values: t,
|
|
48
|
+
data: d,
|
|
49
49
|
initDelay: X = 0,
|
|
50
50
|
baseInterval: Y,
|
|
51
51
|
colors: R,
|
|
52
|
-
sx:
|
|
53
|
-
...
|
|
54
|
-
} = n,
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
if (
|
|
58
|
-
let
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
52
|
+
sx: I,
|
|
53
|
+
...O
|
|
54
|
+
} = n, m = U(), _ = `hc-multiple-value-axes-${$().replace(/:/g, "")}`, y = H(null);
|
|
55
|
+
let h = null;
|
|
56
|
+
s.length < 1 ? h = "MultipleValueAxes requires at least 1 dimension" : t.length < 1 && (h = "MultipleValueAxes requires at least 1 value"), J(() => {
|
|
57
|
+
if (h) return;
|
|
58
|
+
let b;
|
|
59
|
+
return b = setTimeout(() => {
|
|
60
|
+
var N;
|
|
61
|
+
const e = M.new(_);
|
|
62
|
+
y.current = e, e.setThemes([j.new(e)]), e.interfaceColors.setAll({
|
|
63
|
+
text: D(m.palette.text.primary),
|
|
64
|
+
grid: D(m.palette.divider),
|
|
65
|
+
stroke: D(m.palette.divider)
|
|
65
66
|
});
|
|
66
|
-
const
|
|
67
|
-
|
|
67
|
+
const r = e.container.children.push(
|
|
68
|
+
Z.new(e, {
|
|
68
69
|
panX: !1,
|
|
69
70
|
panY: !1,
|
|
70
71
|
wheelX: "none",
|
|
@@ -72,36 +73,36 @@ const A = ["CIRCLE", "RECTANGLE", "TRIANGLE"], De = (L) => {
|
|
|
72
73
|
layout: e.verticalLayout
|
|
73
74
|
})
|
|
74
75
|
);
|
|
75
|
-
|
|
76
|
-
const B =
|
|
77
|
-
|
|
78
|
-
), o =
|
|
79
|
-
let u,
|
|
80
|
-
o.type === "date" ? (u =
|
|
81
|
-
|
|
76
|
+
r.set("colors", K(e, R)), r.get("colors", {}).set("step", 3);
|
|
77
|
+
const B = r.children.push(
|
|
78
|
+
te.new(e, { centerX: w, x: w })
|
|
79
|
+
), o = s[0];
|
|
80
|
+
let u, p = d;
|
|
81
|
+
o.type === "date" ? (u = r.xAxes.push(
|
|
82
|
+
re.new(e, {
|
|
82
83
|
maxDeviation: 0.1,
|
|
83
84
|
groupData: !1,
|
|
84
85
|
baseInterval: Y || { timeUnit: "day", count: 1 },
|
|
85
|
-
renderer:
|
|
86
|
+
renderer: F.new(e, {}),
|
|
86
87
|
tooltip: T.new(e, {})
|
|
87
88
|
})
|
|
88
|
-
),
|
|
89
|
-
|
|
89
|
+
), p = C.orderBy(d, [o.value])) : (u = r.xAxes.push(
|
|
90
|
+
ae.new(e, {
|
|
90
91
|
categoryField: o.value,
|
|
91
|
-
renderer:
|
|
92
|
+
renderer: F.new(e, {}),
|
|
92
93
|
tooltip: T.new(e, {})
|
|
93
94
|
})
|
|
94
95
|
), e.numberFormatter.setAll({
|
|
95
96
|
numberFormat: "#",
|
|
96
97
|
numericFields: ["valueX"]
|
|
97
|
-
}),
|
|
98
|
-
function E(l, i, c, G, S,
|
|
99
|
-
const f =
|
|
100
|
-
|
|
98
|
+
}), p = C.orderBy(d, [o.value]), u.data.setAll(p));
|
|
99
|
+
function E(l, i, c, G, S, v, W) {
|
|
100
|
+
const f = se.new(e, { opposite: S }), k = r.yAxes.push(
|
|
101
|
+
ee.new(e, { maxDeviation: 1, renderer: f })
|
|
101
102
|
);
|
|
102
|
-
|
|
103
|
-
const a =
|
|
104
|
-
|
|
103
|
+
r.yAxes.indexOf(k) > 0 && k.set("syncWithAxis", r.yAxes.getIndex(0));
|
|
104
|
+
const a = r.series.push(
|
|
105
|
+
oe.new(e, {
|
|
105
106
|
name: i,
|
|
106
107
|
xAxis: u,
|
|
107
108
|
yAxis: k,
|
|
@@ -117,12 +118,12 @@ const A = ["CIRCLE", "RECTANGLE", "TRIANGLE"], De = (L) => {
|
|
|
117
118
|
stroke: a.get("fill"),
|
|
118
119
|
strokeOpacity: 1,
|
|
119
120
|
opacity: 1
|
|
120
|
-
}),
|
|
121
|
+
}), W === "date" && (a.data.processor = le.new(e, {
|
|
121
122
|
dateFormat: "i",
|
|
122
123
|
dateFields: [c]
|
|
123
|
-
})),
|
|
124
|
+
})), v !== void 0 && a.bullets.push(function() {
|
|
124
125
|
let g;
|
|
125
|
-
return
|
|
126
|
+
return v === "RECTANGLE" ? g = q.new(e, {
|
|
126
127
|
width: 10,
|
|
127
128
|
height: 10,
|
|
128
129
|
centerX: w,
|
|
@@ -130,39 +131,39 @@ const A = ["CIRCLE", "RECTANGLE", "TRIANGLE"], De = (L) => {
|
|
|
130
131
|
strokeWidth: 2,
|
|
131
132
|
stroke: a.get("stroke"),
|
|
132
133
|
fill: e.interfaceColors.get("background")
|
|
133
|
-
}) :
|
|
134
|
+
}) : v === "TRIANGLE" ? g = x.new(e, {
|
|
134
135
|
width: 10,
|
|
135
136
|
height: 10,
|
|
136
137
|
strokeWidth: 2,
|
|
137
138
|
stroke: a.get("stroke"),
|
|
138
139
|
fill: e.interfaceColors.get("background")
|
|
139
|
-
}) : g =
|
|
140
|
+
}) : g = ne.new(e, {
|
|
140
141
|
strokeWidth: 2,
|
|
141
142
|
radius: 4,
|
|
142
143
|
stroke: a.get("stroke"),
|
|
143
144
|
fill: e.interfaceColors.get("background")
|
|
144
|
-
}),
|
|
145
|
+
}), ce.new(e, { sprite: g });
|
|
145
146
|
}), a.data.setAll(l);
|
|
146
147
|
}
|
|
147
|
-
if (
|
|
148
|
+
if (r.set(
|
|
148
149
|
"cursor",
|
|
149
|
-
|
|
150
|
-
).lineY.set("visible", !1),
|
|
151
|
-
const l = C.groupBy(
|
|
150
|
+
ie.new(e, { xAxis: u, behavior: "none" })
|
|
151
|
+
).lineY.set("visible", !1), s.length > 1) {
|
|
152
|
+
const l = C.groupBy(p, s[1].value);
|
|
152
153
|
Object.keys(l).forEach((i, c) => {
|
|
153
154
|
E(
|
|
154
155
|
l[i],
|
|
155
156
|
i,
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
s[0].value,
|
|
158
|
+
t[0].dataFieldName,
|
|
158
159
|
c !== 0,
|
|
159
160
|
A[c % A.length]
|
|
160
161
|
);
|
|
161
162
|
});
|
|
162
163
|
} else
|
|
163
|
-
|
|
164
|
+
t.forEach((l, i) => {
|
|
164
165
|
E(
|
|
165
|
-
|
|
166
|
+
p,
|
|
166
167
|
l.name,
|
|
167
168
|
o.value,
|
|
168
169
|
l.dataFieldName,
|
|
@@ -171,15 +172,15 @@ const A = ["CIRCLE", "RECTANGLE", "TRIANGLE"], De = (L) => {
|
|
|
171
172
|
o.type
|
|
172
173
|
);
|
|
173
174
|
});
|
|
174
|
-
B.data.setAll(
|
|
175
|
+
B.data.setAll(r.series.values), Q(e, (N = t == null ? void 0 : t[0]) == null ? void 0 : N.format), r.appear(1e3, 100);
|
|
175
176
|
}, X), () => {
|
|
176
177
|
var e;
|
|
177
|
-
|
|
178
|
+
b && clearTimeout(b), (e = y.current) == null || e.dispose(), y.current = null;
|
|
178
179
|
};
|
|
179
|
-
}, [
|
|
180
|
-
const
|
|
181
|
-
return { chartId: _, ownerState:
|
|
180
|
+
}, [d, s, t, m.palette.mode, R]);
|
|
181
|
+
const V = { ...n };
|
|
182
|
+
return { chartId: _, ownerState: V, sx: I, error: h, other: O };
|
|
182
183
|
};
|
|
183
184
|
export {
|
|
184
|
-
|
|
185
|
+
Re as useMultipleValueAxesLogic
|
|
185
186
|
};
|
|
@@ -1,52 +1,53 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
1
|
+
import { R as S, A as E } from "../../../AnimatedTheme-jnasw6rT.js";
|
|
2
|
+
import { useThemeProps as L, useTheme as j } from "@mui/material";
|
|
3
|
+
import q from "dayjs";
|
|
4
4
|
import T from "lodash";
|
|
5
|
-
import { useId as
|
|
6
|
-
import { colorSetFromPalette as
|
|
5
|
+
import { useId as B, useRef as H, useEffect as I } from "react";
|
|
6
|
+
import { applyValueFormat as W, colorSetFromPalette as O } from "../_common/utils.js";
|
|
7
7
|
import { c as n, p as o } from "../../../ColorSet-C7vpNXhM.js";
|
|
8
|
-
import { P as
|
|
9
|
-
const
|
|
10
|
-
const
|
|
8
|
+
import { P as V, a as N } from "../../../PieSeries-B2fW3z0s.js";
|
|
9
|
+
const Z = (b) => {
|
|
10
|
+
const g = L({ props: b, name: "HCNestedPie" }), {
|
|
11
11
|
dimensions: a,
|
|
12
|
-
values:
|
|
12
|
+
values: r,
|
|
13
13
|
data: d,
|
|
14
|
-
initDelay:
|
|
15
|
-
colors:
|
|
16
|
-
sx:
|
|
17
|
-
...
|
|
18
|
-
} =
|
|
14
|
+
initDelay: x = 0,
|
|
15
|
+
colors: v,
|
|
16
|
+
sx: k,
|
|
17
|
+
...w
|
|
18
|
+
} = g, i = j(), y = `hc-nested-pie-${B().replace(/:/g, "")}`, m = H(null);
|
|
19
19
|
let c = null;
|
|
20
|
-
a.length < 2 ? c = "NestedPie requires at least 2 dimensions" :
|
|
20
|
+
a.length < 2 ? c = "NestedPie requires at least 2 dimensions" : r.length < 1 && (c = "NestedPie requires at least 1 value"), I(() => {
|
|
21
21
|
if (c) return;
|
|
22
22
|
let p;
|
|
23
23
|
return p = setTimeout(() => {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
var Y;
|
|
25
|
+
const e = S.new(y);
|
|
26
|
+
m.current = e, W(e, (Y = r == null ? void 0 : r[0]) == null ? void 0 : Y.format), e.setThemes([E.new(e)]), e.interfaceColors.setAll({
|
|
26
27
|
text: n(i.palette.text.primary),
|
|
27
28
|
grid: n(i.palette.divider),
|
|
28
29
|
stroke: n(i.palette.divider)
|
|
29
30
|
});
|
|
30
31
|
const f = e.container.children.push(
|
|
31
|
-
|
|
32
|
+
V.new(e, {
|
|
32
33
|
layout: e.verticalLayout,
|
|
33
34
|
radius: o(100)
|
|
34
35
|
})
|
|
35
36
|
);
|
|
36
|
-
a[0].type === "date" && d.forEach((
|
|
37
|
+
a[0].type === "date" && d.forEach((s) => {
|
|
37
38
|
let l = "YYYY";
|
|
38
|
-
a[0].value.includes("month") ? l = "MMM YYYY" : a[0].value.includes("day") && (l = "DD MMM YYYY"),
|
|
39
|
+
a[0].value.includes("month") ? l = "MMM YYYY" : a[0].value.includes("day") && (l = "DD MMM YYYY"), s[a[0].value] = q(s[a[0].value]).format(
|
|
39
40
|
l
|
|
40
41
|
);
|
|
41
42
|
});
|
|
42
|
-
const h = T.orderBy(d, (
|
|
43
|
-
a.forEach((
|
|
44
|
-
const
|
|
43
|
+
const h = T.orderBy(d, (s) => s[a[0].value]);
|
|
44
|
+
a.forEach((s, l) => {
|
|
45
|
+
const A = e.interfaceColors.get("background");
|
|
45
46
|
if (l === 0) {
|
|
46
47
|
const t = f.series.push(
|
|
47
|
-
|
|
48
|
-
valueField:
|
|
49
|
-
categoryField:
|
|
48
|
+
N.new(e, {
|
|
49
|
+
valueField: r[0].dataFieldName,
|
|
50
|
+
categoryField: s.value,
|
|
50
51
|
alignLabels: !1,
|
|
51
52
|
radius: o(80),
|
|
52
53
|
innerRadius: o(25)
|
|
@@ -58,47 +59,47 @@ const U = (N) => {
|
|
|
58
59
|
textType: "radial",
|
|
59
60
|
centerX: o(100)
|
|
60
61
|
}), t.slices.template.setAll({
|
|
61
|
-
stroke:
|
|
62
|
+
stroke: A,
|
|
62
63
|
strokeWidth: 2,
|
|
63
64
|
fill: n(11184810),
|
|
64
65
|
tooltipText: "{category}: {valuePercentTotal.formatNumber('0.00')}% ({value})"
|
|
65
66
|
}), t.slices.template.states.create("hover", { scale: 0.95 }), a.length > 1) {
|
|
66
|
-
const u = [],
|
|
67
|
-
Object.keys(
|
|
68
|
-
const
|
|
67
|
+
const u = [], F = T.groupBy(h, s.value);
|
|
68
|
+
Object.keys(F).forEach((P) => {
|
|
69
|
+
const M = F[P].reduce((R, C) => R + C[r[0].dataFieldName], 0);
|
|
69
70
|
u.push({
|
|
70
|
-
[
|
|
71
|
-
[
|
|
71
|
+
[s.value]: P,
|
|
72
|
+
[r[0].dataFieldName]: M
|
|
72
73
|
});
|
|
73
74
|
}), t.data.setAll(u);
|
|
74
75
|
} else
|
|
75
76
|
t.data.setAll(h);
|
|
76
77
|
} else if (l === 1) {
|
|
77
78
|
const t = f.series.push(
|
|
78
|
-
|
|
79
|
-
valueField:
|
|
80
|
-
categoryField:
|
|
79
|
+
N.new(e, {
|
|
80
|
+
valueField: r[0].dataFieldName,
|
|
81
|
+
categoryField: s.value,
|
|
81
82
|
alignLabels: !0,
|
|
82
83
|
innerRadius: o(80),
|
|
83
84
|
radius: o(100)
|
|
84
85
|
})
|
|
85
|
-
), u =
|
|
86
|
+
), u = O(e, v);
|
|
86
87
|
t.set("colors", u), t.slices.template.setAll({
|
|
87
|
-
stroke:
|
|
88
|
+
stroke: A,
|
|
88
89
|
strokeWidth: 2,
|
|
89
90
|
templateField: "settings",
|
|
90
91
|
tooltipText: "{category}: {valuePercentTotal.formatNumber('0.00')}% ({value})"
|
|
91
92
|
}), t.labels.template.setAll({ text: "{category}" }), t.data.setAll(h);
|
|
92
93
|
}
|
|
93
94
|
}), f.appear(1e3, 100);
|
|
94
|
-
},
|
|
95
|
+
}, x), () => {
|
|
95
96
|
var e;
|
|
96
97
|
p && clearTimeout(p), (e = m.current) == null || e.dispose(), m.current = null;
|
|
97
98
|
};
|
|
98
|
-
}, [d, a,
|
|
99
|
-
const
|
|
100
|
-
return { chartId: y, ownerState:
|
|
99
|
+
}, [d, a, r, i.palette.mode, v]);
|
|
100
|
+
const D = { ...g };
|
|
101
|
+
return { chartId: y, ownerState: D, sx: k, error: c, other: w };
|
|
101
102
|
};
|
|
102
103
|
export {
|
|
103
|
-
|
|
104
|
+
Z as useNestedPieLogic
|
|
104
105
|
};
|