@hybridcore/ui 1.6.8 → 1.6.9
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/dist/AnimatedTheme-BOKdw2Oy.js +7708 -0
- package/dist/{AxisRenderer-DTyLLA6c.js → AxisRenderer-lUbezuh7.js} +51 -49
- package/dist/{AxisRendererY-C_ItLPNV.js → AxisRendererY-DbSiyb45.js} +3 -3
- package/dist/{Bullet-DVczI2TD.js → Bullet-PgoNb3Jv.js} +1 -1
- package/dist/{Button-CcsPEIDh.js → Button-XBf4Mwz-.js} +3 -3
- package/dist/{CategoryAxis-CwnfaGc8.js → CategoryAxis-B8KQp1pE.js} +3 -3
- package/dist/{Circle-Cy5s-pVc.js → Circle-BWRdiMpG.js} +1 -1
- package/dist/ColorSet-DDmFoKtZ.js +77 -0
- package/dist/{ColumnSeries-CjgdJ2QL.js → ColumnSeries-rgnGm-Bg.js} +4 -4
- package/dist/{DataProcessor-CHDO51q4.js → DataProcessor-CvIe9BVn.js} +1 -1
- package/dist/{DateAxis-YX3QNIB-.js → DateAxis-zNtbSVjW.js} +8 -7
- package/dist/{ColorSet-C7vpNXhM.js → Entity-CCUIdRAr.js} +638 -712
- package/dist/{Hierarchy-Bihj0S61.js → Hierarchy-CCvGsF1A.js} +25 -23
- package/dist/{Legend-Dp_MKfS4.js → Legend-kbCFjJAW.js} +11 -10
- package/dist/{LineSeries-Uiv5o56b.js → LineSeries-BLFvwrLT.js} +13 -12
- package/dist/{LinearGradient-DiRq5YcI.js → LinearGradient-C7rnipF7.js} +11 -11
- package/dist/{PieSeries-B2fW3z0s.js → PieSeries-3iLRbqFv.js} +34 -32
- package/dist/{RoundedRectangle-CWLi2PXn.js → RoundedRectangle-CqMMmPM0.js} +4 -4
- package/dist/{Scrollbar-D86MJyr2.js → Scrollbar-BzSBcIUt.js} +4 -4
- package/dist/{Slice-B19rbYDZ.js → Slice-CS23iLiS.js} +2 -2
- package/dist/{Tick-2bcLyHpF.js → Tick-BADQ8QeT.js} +15 -15
- package/dist/Tooltip-A_HlttXp.js +3606 -0
- package/dist/{XYCursor-C8WktvKM.js → XYCursor-gHAo40xC.js} +3 -3
- package/dist/{ZoomableContainer-DYyqwaMb.js → ZoomableContainer-Brs1wHM1.js} +9 -9
- package/dist/components/charts/_common/tooltip.js +73 -0
- package/dist/components/charts/_common/utils.js +10 -9
- package/dist/components/charts/candlestick/logic.js +181 -156
- package/dist/components/charts/column-line-mix/logic.js +80 -77
- package/dist/components/charts/donut-chart/logic.js +36 -34
- package/dist/components/charts/drill-down-treemap/logic.js +49 -48
- package/dist/components/charts/drill-down-voronoi-treemap/logic.js +102 -101
- package/dist/components/charts/heatmap/logic.js +33 -32
- package/dist/components/charts/highlighting-line-data/logic.js +26 -24
- package/dist/components/charts/line/logic.js +123 -174
- package/dist/components/charts/logaritmic-scale/logic.js +69 -60
- package/dist/components/charts/multiple-value-axes/logic.js +93 -88
- package/dist/components/charts/nested-pie/logic.js +3 -3
- package/dist/components/charts/packed-circles/logic.js +28 -27
- package/dist/components/charts/pie-chart/logic.js +43 -41
- package/dist/components/charts/stacked-area-radar/logic.js +124 -121
- package/dist/components/charts/stacked-column-chart/logic.js +107 -95
- package/dist/components/charts/xy-chart/logic.js +103 -91
- package/dist/components/metric-card/MetricChart.js +29 -28
- package/package.json +1 -1
- package/dist/AnimatedTheme-jnasw6rT.js +0 -11305
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
4
|
-
import { useId as V, useRef as
|
|
5
|
-
import { humanizeLabel as
|
|
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";
|
|
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
|
|
8
|
-
import { X as U, V as _ } from "../../../AxisRenderer-
|
|
9
|
-
import { S as $ } from "../../../Scrollbar-
|
|
10
|
-
import { D as j } from "../../../DateAxis-
|
|
11
|
-
import { A as
|
|
12
|
-
import { C as J } from "../../../CategoryAxis-
|
|
13
|
-
import { C as K } from "../../../ColumnSeries-
|
|
14
|
-
import { D as L } from "../../../DataProcessor-
|
|
15
|
-
import { L as Q } from "../../../LineSeries-
|
|
16
|
-
import { B as Z } from "../../../Bullet-
|
|
17
|
-
import { C as ee } from "../../../Circle-
|
|
18
|
-
import { X as te } from "../../../XYCursor-
|
|
19
|
-
import { L as re } from "../../../Legend-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
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" }), {
|
|
22
23
|
dimensions: t,
|
|
23
24
|
values: n,
|
|
24
25
|
data: p,
|
|
25
26
|
initDelay: Y = 0,
|
|
26
|
-
baseInterval:
|
|
27
|
-
colors:
|
|
27
|
+
baseInterval: h,
|
|
28
|
+
colors: x,
|
|
28
29
|
sx: S,
|
|
29
|
-
...
|
|
30
|
-
} =
|
|
31
|
-
|
|
32
|
-
if (
|
|
33
|
-
let
|
|
34
|
-
return
|
|
35
|
-
var y,
|
|
36
|
-
const e =
|
|
37
|
-
|
|
38
|
-
text: l(
|
|
39
|
-
grid: l(
|
|
40
|
-
stroke: l(
|
|
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;
|
|
34
|
+
let c;
|
|
35
|
+
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({
|
|
39
|
+
text: l(s.palette.text.primary),
|
|
40
|
+
grid: l(s.palette.divider),
|
|
41
|
+
stroke: l(s.palette.divider)
|
|
41
42
|
});
|
|
42
43
|
const r = e.container.children.push(
|
|
43
44
|
U.new(e, {
|
|
@@ -45,62 +46,57 @@ const ke = (T) => {
|
|
|
45
46
|
panY: !1,
|
|
46
47
|
wheelX: "none",
|
|
47
48
|
wheelY: "none",
|
|
49
|
+
maxTooltipDistance: -1,
|
|
48
50
|
paddingLeft: 0,
|
|
49
51
|
layout: e.verticalLayout
|
|
50
52
|
})
|
|
51
53
|
);
|
|
52
|
-
r.set("colors", W(e,
|
|
54
|
+
r.set("colors", W(e, x)), r.get("colors", {}).set("step", 3), r.set(
|
|
53
55
|
"scrollbarX",
|
|
54
56
|
$.new(e, { orientation: "horizontal" })
|
|
55
57
|
);
|
|
56
|
-
let
|
|
57
|
-
t[0].type === "date" ? (m =
|
|
58
|
+
let a, m = p;
|
|
59
|
+
t[0].type === "date" ? (m = k.orderBy(p, [t[0].value]), a = r.xAxes.push(
|
|
58
60
|
j.new(e, {
|
|
59
61
|
maxDeviation: 0.1,
|
|
60
62
|
groupData: !1,
|
|
61
|
-
baseInterval:
|
|
62
|
-
renderer:
|
|
63
|
-
tooltip: d.new(e, {})
|
|
63
|
+
baseInterval: h || { timeUnit: "day", count: 1 },
|
|
64
|
+
renderer: X.new(e, {})
|
|
64
65
|
})
|
|
65
|
-
), (y =
|
|
66
|
-
stroke: l(
|
|
66
|
+
), (y = a.get("renderer")) == null || y.grid.template.setAll({
|
|
67
|
+
stroke: l(s.palette.divider),
|
|
67
68
|
strokeOpacity: 1
|
|
68
|
-
})) : (
|
|
69
|
+
})) : (a = r.xAxes.push(
|
|
69
70
|
J.new(e, {
|
|
70
71
|
categoryField: t[0].value,
|
|
71
|
-
renderer:
|
|
72
|
-
tooltip: d.new(e, {})
|
|
72
|
+
renderer: X.new(e, {})
|
|
73
73
|
})
|
|
74
|
-
), (
|
|
75
|
-
stroke: l(
|
|
74
|
+
), (w = a.get("renderer")) == null || w.grid.template.setAll({
|
|
75
|
+
stroke: l(s.palette.divider),
|
|
76
76
|
strokeOpacity: 1
|
|
77
77
|
}), e.numberFormatter.setAll({
|
|
78
78
|
numberFormat: "#",
|
|
79
79
|
numericFields: ["valueX"]
|
|
80
|
-
}), m =
|
|
81
|
-
const
|
|
80
|
+
}), m = k.orderBy(p, [t[0].value]), a.data.setAll(m));
|
|
81
|
+
const u = r.yAxes.push(
|
|
82
82
|
_.new(e, {
|
|
83
83
|
min: 0,
|
|
84
84
|
extraMax: 0.1,
|
|
85
85
|
renderer: G.new(e, { strokeOpacity: 0.1 })
|
|
86
86
|
})
|
|
87
87
|
);
|
|
88
|
-
(v =
|
|
89
|
-
stroke: l(
|
|
88
|
+
(v = u.get("renderer")) == null || v.grid.template.setAll({
|
|
89
|
+
stroke: l(s.palette.divider),
|
|
90
90
|
strokeOpacity: 1
|
|
91
|
-
}), n.forEach((i,
|
|
92
|
-
if (
|
|
91
|
+
}), n.forEach((i, B) => {
|
|
92
|
+
if (B === 0) {
|
|
93
93
|
const o = r.series.push(
|
|
94
94
|
K.new(e, {
|
|
95
|
-
name: i.label ??
|
|
96
|
-
xAxis:
|
|
97
|
-
yAxis:
|
|
95
|
+
name: i.label ?? C(i.name),
|
|
96
|
+
xAxis: a,
|
|
97
|
+
yAxis: u,
|
|
98
98
|
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
|
-
})
|
|
99
|
+
...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
|
|
104
100
|
})
|
|
105
101
|
);
|
|
106
102
|
o.columns.template.setAll({
|
|
@@ -113,15 +109,11 @@ const ke = (T) => {
|
|
|
113
109
|
} else {
|
|
114
110
|
const o = r.series.push(
|
|
115
111
|
Q.new(e, {
|
|
116
|
-
name: i.label ??
|
|
117
|
-
xAxis:
|
|
118
|
-
yAxis:
|
|
112
|
+
name: i.label ?? C(i.name),
|
|
113
|
+
xAxis: a,
|
|
114
|
+
yAxis: u,
|
|
119
115
|
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
|
-
})
|
|
116
|
+
...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
|
|
125
117
|
})
|
|
126
118
|
);
|
|
127
119
|
o.strokes.template.setAll({
|
|
@@ -141,20 +133,31 @@ const ke = (T) => {
|
|
|
141
133
|
});
|
|
142
134
|
});
|
|
143
135
|
}
|
|
144
|
-
}), r.set(
|
|
136
|
+
}), r.set(
|
|
137
|
+
"cursor",
|
|
138
|
+
te.new(e, { xAxis: a, behavior: "none" })
|
|
139
|
+
).lineY.set("visible", !1), N({
|
|
140
|
+
root: e,
|
|
141
|
+
chart: r,
|
|
142
|
+
xAxis: a,
|
|
143
|
+
theme: s,
|
|
144
|
+
isDateAxis: t[0].type === "date",
|
|
145
|
+
baseInterval: h,
|
|
146
|
+
follow: !0
|
|
147
|
+
}), r.children.push(
|
|
145
148
|
re.new(e, {
|
|
146
|
-
centerX:
|
|
147
|
-
x:
|
|
149
|
+
centerX: b,
|
|
150
|
+
x: b
|
|
148
151
|
})
|
|
149
152
|
).data.setAll(r.series.values), q(e, (F = n == null ? void 0 : n[0]) == null ? void 0 : F.format), r.appear(1e3, 100);
|
|
150
153
|
}, Y), () => {
|
|
151
154
|
var e;
|
|
152
|
-
|
|
155
|
+
c && clearTimeout(c), (e = d.current) == null || e.dispose(), d.current = null;
|
|
153
156
|
};
|
|
154
|
-
}, [p, t, n,
|
|
155
|
-
const R = { ...
|
|
156
|
-
return { chartId:
|
|
157
|
+
}, [p, t, n, s.palette.mode, x]);
|
|
158
|
+
const R = { ...f };
|
|
159
|
+
return { chartId: A, ownerState: R, sx: S, error: g, other: T };
|
|
157
160
|
};
|
|
158
161
|
export {
|
|
159
|
-
|
|
162
|
+
Xe as useColumnLineMixLogic
|
|
160
163
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { R as
|
|
1
|
+
import { R as P, A } from "../../../AnimatedTheme-BOKdw2Oy.js";
|
|
2
2
|
import { useThemeProps as C, useTheme as D } from "@mui/material";
|
|
3
3
|
import F from "dayjs";
|
|
4
|
-
import { useId as
|
|
5
|
-
import { applyValueFormat as
|
|
6
|
-
import { P as E, a as
|
|
7
|
-
import { p as m, c as u } from "../../../
|
|
8
|
-
import { L as
|
|
9
|
-
const
|
|
10
|
-
const
|
|
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-3iLRbqFv.js";
|
|
7
|
+
import { p as m, c as u } from "../../../Entity-CCUIdRAr.js";
|
|
8
|
+
import { L as j } from "../../../Legend-kbCFjJAW.js";
|
|
9
|
+
const K = (y) => {
|
|
10
|
+
const p = C({ props: y, name: "HCDonutChart" }), {
|
|
11
11
|
dimensions: t,
|
|
12
12
|
values: o,
|
|
13
|
-
data:
|
|
14
|
-
initDelay:
|
|
15
|
-
colors:
|
|
16
|
-
sx:
|
|
17
|
-
...
|
|
18
|
-
} =
|
|
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!"),
|
|
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
|
|
25
|
-
const e =
|
|
26
|
-
|
|
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(
|
|
35
|
-
grid: u(
|
|
36
|
-
stroke: u(
|
|
34
|
+
text: u(a.palette.text.primary),
|
|
35
|
+
grid: u(a.palette.divider),
|
|
36
|
+
stroke: u(a.palette.divider)
|
|
37
37
|
});
|
|
38
|
-
const
|
|
39
|
-
|
|
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
|
-
|
|
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"),
|
|
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
|
-
}),
|
|
50
|
-
|
|
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(
|
|
57
|
-
},
|
|
58
|
+
).data.setAll(r.dataItems), r.appear(1e3, 100);
|
|
59
|
+
}, T), () => {
|
|
58
60
|
var e;
|
|
59
|
-
l && clearTimeout(l), (e =
|
|
61
|
+
l && clearTimeout(l), (e = n.current) == null || e.dispose(), n.current = null;
|
|
60
62
|
};
|
|
61
|
-
}, [
|
|
62
|
-
const w = { ...
|
|
63
|
-
return { chartId: f, ownerState: w, sx:
|
|
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
|
-
|
|
68
|
+
K as useDonutChartLogic
|
|
67
69
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useId as
|
|
6
|
-
import { applyValueFormat as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { R as W, T as E, A as Z } from "../../../AnimatedTheme-BOKdw2Oy.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-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";
|
|
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({}), () =>
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
92
|
-
if (n += c = h[m].value, c < f && (f = c), c > w && (w = c), _ = n * n *
|
|
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(
|
|
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,
|
|
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 -=
|
|
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 ? (
|
|
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,
|
|
143
|
-
for (c[0] =
|
|
144
|
-
c[s + 1] =
|
|
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,
|
|
153
|
-
var k =
|
|
154
|
-
c[k] < P ?
|
|
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[
|
|
157
|
-
var D = c[
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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:
|
|
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
|
|
308
|
-
const t =
|
|
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
|
-
...
|
|
316
|
-
} = t, c =
|
|
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"),
|
|
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
|
|
323
|
-
const n =
|
|
324
|
-
e.current = n,
|
|
325
|
-
const f =
|
|
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([
|
|
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",
|
|
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"),
|
|
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 =
|
|
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:
|
|
382
|
+
return { chartId: m, ownerState: g, sx: h, error: d, other: b };
|
|
382
383
|
};
|
|
383
384
|
export {
|
|
384
|
-
|
|
385
|
+
De as useDrillDownTreemapLogic
|
|
385
386
|
};
|