@hybridcore/ui 1.6.30 → 1.6.32
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/components/charts/_common/utils.js +50 -31
- package/dist/components/charts/candlestick/logic.js +83 -86
- package/dist/components/charts/column-line-mix/logic.js +66 -70
- package/dist/components/charts/donut-chart/logic.js +61 -64
- package/dist/components/charts/drill-down-treemap/logic.js +69 -69
- package/dist/components/charts/drill-down-voronoi-treemap/logic.js +75 -75
- package/dist/components/charts/forecast-cone/logic.js +110 -114
- package/dist/components/charts/heatmap/logic.js +115 -119
- package/dist/components/charts/highlighting-line-data/logic.js +65 -64
- package/dist/components/charts/histogram/logic.js +66 -70
- package/dist/components/charts/line/logic.js +95 -99
- package/dist/components/charts/logaritmic-scale/logic.js +79 -83
- package/dist/components/charts/multiple-value-axes/logic.js +65 -69
- package/dist/components/charts/nested-pie/logic.js +49 -53
- package/dist/components/charts/packed-circles/logic.js +139 -139
- package/dist/components/charts/pie-chart/logic.js +55 -59
- package/dist/components/charts/stacked-area-radar/logic.js +92 -96
- package/dist/components/charts/stacked-column-chart/logic.js +64 -68
- package/dist/components/charts/xy-chart/logic.js +82 -86
- package/dist/components/metric-card/MetricChart.js +6 -4
- package/dist/components/paginated-list/index.js +16 -15
- package/dist/components/paginated-list/styled.js +34 -17
- package/package.json +1 -1
|
@@ -1,51 +1,47 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
1
|
+
import { R as C, A as S } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
|
+
import { useThemeProps as E, useTheme as L } from "@mui/material";
|
|
3
|
+
import I from "dayjs";
|
|
4
4
|
import T from "lodash";
|
|
5
|
-
import { useId as
|
|
6
|
-
import { applyValueFormat as W, colorSetFromPalette as O } from "../_common/utils.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
const
|
|
10
|
-
const
|
|
5
|
+
import { useId as j, useRef as q, useEffect as B } from "react";
|
|
6
|
+
import { applyValueFormat as H, applyInterfaceColors as W, colorSetFromPalette as O } from "../_common/utils.js";
|
|
7
|
+
import { P as V, a as A } from "../../../PieSeries-CMH0Z7pz.js";
|
|
8
|
+
import { p as o, c as X } from "../../../Entity-BJCuhdq_.js";
|
|
9
|
+
const ee = (N) => {
|
|
10
|
+
const f = E({ props: N, name: "HCNestedPie" }), {
|
|
11
11
|
dimensions: a,
|
|
12
12
|
values: r,
|
|
13
|
-
data:
|
|
14
|
-
initDelay:
|
|
15
|
-
colors:
|
|
13
|
+
data: u,
|
|
14
|
+
initDelay: b = 0,
|
|
15
|
+
colors: h,
|
|
16
16
|
sx: k,
|
|
17
17
|
...w
|
|
18
|
-
} =
|
|
19
|
-
let
|
|
20
|
-
a.length < 2 ?
|
|
21
|
-
if (
|
|
22
|
-
let
|
|
23
|
-
return
|
|
24
|
-
var
|
|
25
|
-
const e =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
grid: n(i.palette.divider),
|
|
29
|
-
stroke: n(i.palette.divider)
|
|
30
|
-
});
|
|
31
|
-
const f = e.container.children.push(
|
|
18
|
+
} = f, g = L(), v = `hc-nested-pie-${j().replace(/:/g, "")}`, n = q(null);
|
|
19
|
+
let i = null;
|
|
20
|
+
a.length < 2 ? i = "NestedPie requires at least 2 dimensions" : r.length < 1 && (i = "NestedPie requires at least 1 value"), B(() => {
|
|
21
|
+
if (i) return;
|
|
22
|
+
let d;
|
|
23
|
+
return d = setTimeout(() => {
|
|
24
|
+
var y;
|
|
25
|
+
const e = C.new(v);
|
|
26
|
+
n.current = e, H(e, (y = r == null ? void 0 : r[0]) == null ? void 0 : y.format), e.setThemes([S.new(e)]), W(e, g);
|
|
27
|
+
const m = e.container.children.push(
|
|
32
28
|
V.new(e, {
|
|
33
29
|
layout: e.verticalLayout,
|
|
34
30
|
radius: o(100)
|
|
35
31
|
})
|
|
36
32
|
);
|
|
37
|
-
a[0].type === "date" &&
|
|
33
|
+
a[0].type === "date" && u.forEach((s) => {
|
|
38
34
|
let l = "YYYY";
|
|
39
|
-
a[0].value.includes("month") ? l = "MMM YYYY" : a[0].value.includes("day") && (l = "DD MMM YYYY"), s[a[0].value] =
|
|
35
|
+
a[0].value.includes("month") ? l = "MMM YYYY" : a[0].value.includes("day") && (l = "DD MMM YYYY"), s[a[0].value] = I(s[a[0].value]).format(
|
|
40
36
|
l
|
|
41
37
|
);
|
|
42
38
|
});
|
|
43
|
-
const
|
|
39
|
+
const p = T.orderBy(u, (s) => s[a[0].value]);
|
|
44
40
|
a.forEach((s, l) => {
|
|
45
|
-
const
|
|
41
|
+
const Y = e.interfaceColors.get("background");
|
|
46
42
|
if (l === 0) {
|
|
47
|
-
const t =
|
|
48
|
-
|
|
43
|
+
const t = m.series.push(
|
|
44
|
+
A.new(e, {
|
|
49
45
|
valueField: r[0].dataFieldName,
|
|
50
46
|
categoryField: s.value,
|
|
51
47
|
alignLabels: !1,
|
|
@@ -59,47 +55,47 @@ const Z = (b) => {
|
|
|
59
55
|
textType: "radial",
|
|
60
56
|
centerX: o(100)
|
|
61
57
|
}), t.slices.template.setAll({
|
|
62
|
-
stroke:
|
|
58
|
+
stroke: Y,
|
|
63
59
|
strokeWidth: 2,
|
|
64
|
-
fill:
|
|
60
|
+
fill: X(11184810),
|
|
65
61
|
tooltipText: "{category}: {valuePercentTotal.formatNumber('0.00')}% ({value})"
|
|
66
62
|
}), t.slices.template.states.create("hover", { scale: 0.95 }), a.length > 1) {
|
|
67
|
-
const
|
|
63
|
+
const c = [], F = T.groupBy(p, s.value);
|
|
68
64
|
Object.keys(F).forEach((P) => {
|
|
69
|
-
const
|
|
70
|
-
|
|
65
|
+
const D = F[P].reduce((M, R) => M + R[r[0].dataFieldName], 0);
|
|
66
|
+
c.push({
|
|
71
67
|
[s.value]: P,
|
|
72
|
-
[r[0].dataFieldName]:
|
|
68
|
+
[r[0].dataFieldName]: D
|
|
73
69
|
});
|
|
74
|
-
}), t.data.setAll(
|
|
70
|
+
}), t.data.setAll(c);
|
|
75
71
|
} else
|
|
76
|
-
t.data.setAll(
|
|
72
|
+
t.data.setAll(p);
|
|
77
73
|
} else if (l === 1) {
|
|
78
|
-
const t =
|
|
79
|
-
|
|
74
|
+
const t = m.series.push(
|
|
75
|
+
A.new(e, {
|
|
80
76
|
valueField: r[0].dataFieldName,
|
|
81
77
|
categoryField: s.value,
|
|
82
78
|
alignLabels: !0,
|
|
83
79
|
innerRadius: o(80),
|
|
84
80
|
radius: o(100)
|
|
85
81
|
})
|
|
86
|
-
),
|
|
87
|
-
t.set("colors",
|
|
88
|
-
stroke:
|
|
82
|
+
), c = O(e, h);
|
|
83
|
+
t.set("colors", c), t.slices.template.setAll({
|
|
84
|
+
stroke: Y,
|
|
89
85
|
strokeWidth: 2,
|
|
90
86
|
templateField: "settings",
|
|
91
87
|
tooltipText: "{category}: {valuePercentTotal.formatNumber('0.00')}% ({value})"
|
|
92
|
-
}), t.labels.template.setAll({ text: "{category}" }), t.data.setAll(
|
|
88
|
+
}), t.labels.template.setAll({ text: "{category}" }), t.data.setAll(p);
|
|
93
89
|
}
|
|
94
|
-
}),
|
|
95
|
-
},
|
|
90
|
+
}), m.appear(1e3, 100);
|
|
91
|
+
}, b), () => {
|
|
96
92
|
var e;
|
|
97
|
-
|
|
93
|
+
d && clearTimeout(d), (e = n.current) == null || e.dispose(), n.current = null;
|
|
98
94
|
};
|
|
99
|
-
}, [
|
|
100
|
-
const
|
|
101
|
-
return { chartId:
|
|
95
|
+
}, [u, a, r, g.palette.mode, h]);
|
|
96
|
+
const x = { ...f };
|
|
97
|
+
return { chartId: v, ownerState: x, sx: k, error: i, other: w };
|
|
102
98
|
};
|
|
103
99
|
export {
|
|
104
|
-
|
|
100
|
+
ee as useNestedPieLogic
|
|
105
101
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as ee } from "@mui/material";
|
|
3
|
-
import
|
|
4
|
-
import { useId as
|
|
5
|
-
import { applyValueFormat as
|
|
1
|
+
import { R as Q, A as X } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
|
+
import { useThemeProps as ee, useTheme as te } from "@mui/material";
|
|
3
|
+
import re from "dayjs";
|
|
4
|
+
import { useId as ne, useRef as se, useEffect as ie } from "react";
|
|
5
|
+
import { applyValueFormat as oe, applyInterfaceColors as ae, colorSetFromPalette as ue } from "../_common/utils.js";
|
|
6
6
|
import { Z as U } from "../../../ZoomableContainer-Ca_pDVYQ.js";
|
|
7
|
-
import { M as
|
|
8
|
-
import { C as $, G as A, a as
|
|
7
|
+
import { M as le, m as ce, e as he, b as q } from "../../../Entity-BJCuhdq_.js";
|
|
8
|
+
import { C as $, G as A, a as fe, b as de } from "../../../Tooltip-vyZRZWih.js";
|
|
9
9
|
import { B as O } from "../../../Button-BLY4PVJC.js";
|
|
10
|
-
import { H as
|
|
11
|
-
import { C as
|
|
12
|
-
import { o as
|
|
10
|
+
import { H as I } from "../../../Hierarchy-CEOK8Gzh.js";
|
|
11
|
+
import { C as me } from "../../../Circle-BnfBNKBD.js";
|
|
12
|
+
import { o as pe, c as z, a as ge } from "../../../constant-BiOGvlZc.js";
|
|
13
13
|
class j extends $ {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments), Object.defineProperty(this, "homeButton", {
|
|
@@ -58,7 +58,7 @@ class j extends $ {
|
|
|
58
58
|
n == r.get("minZoomLevel") ? this.minusButton.set("disabled", !0) : this.minusButton.set("disabled", !1), n == r.get("maxZoomLevel") ? this.plusButton.set("disabled", !0) : this.plusButton.set("disabled", !1);
|
|
59
59
|
})), this.root.events.once("frameended", () => {
|
|
60
60
|
r.get("scale") == r.get("minZoomLevel") && this.minusButton.set("disabled", !0);
|
|
61
|
-
})), this._disposer = new
|
|
61
|
+
})), this._disposer = new le([
|
|
62
62
|
this.plusButton.events.on("click", () => {
|
|
63
63
|
r.zoomIn();
|
|
64
64
|
}),
|
|
@@ -84,146 +84,146 @@ Object.defineProperty(j, "classNames", {
|
|
|
84
84
|
writable: !0,
|
|
85
85
|
value: $.classNames.concat([j.className])
|
|
86
86
|
});
|
|
87
|
-
const
|
|
88
|
-
function
|
|
87
|
+
const ye = 1664525, xe = 1013904223, E = 4294967296;
|
|
88
|
+
function be() {
|
|
89
89
|
let t = 1;
|
|
90
|
-
return () => (t = (
|
|
90
|
+
return () => (t = (ye * t + xe) % E) / E;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function ve(t) {
|
|
93
93
|
return typeof t == "object" && "length" in t ? t : Array.from(t);
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
let e = t.length, n,
|
|
95
|
+
function _e(t, r) {
|
|
96
|
+
let e = t.length, n, s;
|
|
97
97
|
for (; e; )
|
|
98
|
-
|
|
98
|
+
s = r() * e-- | 0, n = t[e], t[e] = t[s], t[s] = n;
|
|
99
99
|
return t;
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
for (var e = 0, n = (t =
|
|
103
|
-
|
|
101
|
+
function we(t, r) {
|
|
102
|
+
for (var e = 0, n = (t = _e(Array.from(t), r)).length, s = [], i, a; e < n; )
|
|
103
|
+
i = t[e], a && J(a, i) ? ++e : (a = Pe(s = ke(s, i)), e = 0);
|
|
104
104
|
return a;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function ke(t, r) {
|
|
107
107
|
var e, n;
|
|
108
108
|
if (L(r, t)) return [r];
|
|
109
109
|
for (e = 0; e < t.length; ++e)
|
|
110
|
-
if (D(r, t[e]) && L(
|
|
110
|
+
if (D(r, t[e]) && L(w(t[e], r), t))
|
|
111
111
|
return [t[e], r];
|
|
112
112
|
for (e = 0; e < t.length - 1; ++e)
|
|
113
113
|
for (n = e + 1; n < t.length; ++n)
|
|
114
|
-
if (D(
|
|
114
|
+
if (D(w(t[e], t[n]), r) && D(w(t[e], r), t[n]) && D(w(t[n], r), t[e]) && L(K(t[e], t[n], r), t))
|
|
115
115
|
return [t[e], t[n], r];
|
|
116
116
|
throw new Error();
|
|
117
117
|
}
|
|
118
118
|
function D(t, r) {
|
|
119
|
-
var e = t.r - r.r, n = r.x - t.x,
|
|
120
|
-
return e < 0 || e * e < n * n +
|
|
119
|
+
var e = t.r - r.r, n = r.x - t.x, s = r.y - t.y;
|
|
120
|
+
return e < 0 || e * e < n * n + s * s;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
123
|
-
var e = t.r - r.r + Math.max(t.r, r.r, 1) * 1e-9, n = r.x - t.x,
|
|
124
|
-
return e > 0 && e * e > n * n +
|
|
122
|
+
function J(t, r) {
|
|
123
|
+
var e = t.r - r.r + Math.max(t.r, r.r, 1) * 1e-9, n = r.x - t.x, s = r.y - t.y;
|
|
124
|
+
return e > 0 && e * e > n * n + s * s;
|
|
125
125
|
}
|
|
126
126
|
function L(t, r) {
|
|
127
127
|
for (var e = 0; e < r.length; ++e)
|
|
128
|
-
if (!
|
|
128
|
+
if (!J(t, r[e]))
|
|
129
129
|
return !1;
|
|
130
130
|
return !0;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function Pe(t) {
|
|
133
133
|
switch (t.length) {
|
|
134
134
|
case 1:
|
|
135
|
-
return
|
|
135
|
+
return Ne(t[0]);
|
|
136
136
|
case 2:
|
|
137
|
-
return
|
|
137
|
+
return w(t[0], t[1]);
|
|
138
138
|
case 3:
|
|
139
|
-
return
|
|
139
|
+
return K(t[0], t[1], t[2]);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function Ne(t) {
|
|
143
143
|
return {
|
|
144
144
|
x: t.x,
|
|
145
145
|
y: t.y,
|
|
146
146
|
r: t.r
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
var e = t.x, n = t.y,
|
|
149
|
+
function w(t, r) {
|
|
150
|
+
var e = t.x, n = t.y, s = t.r, i = r.x, a = r.y, l = r.r, o = i - e, u = a - n, c = l - s, f = Math.sqrt(o * o + u * u);
|
|
151
151
|
return {
|
|
152
|
-
x: (e +
|
|
153
|
-
y: (n + a + u /
|
|
154
|
-
r: (
|
|
152
|
+
x: (e + i + o / f * c) / 2,
|
|
153
|
+
y: (n + a + u / f * c) / 2,
|
|
154
|
+
r: (f + s + l) / 2
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
var n = t.x,
|
|
157
|
+
function K(t, r, e) {
|
|
158
|
+
var n = t.x, s = t.y, i = t.r, a = r.x, l = r.y, o = r.r, u = e.x, c = e.y, f = e.r, d = n - a, p = n - u, m = s - l, _ = s - c, x = o - i, h = f - i, b = n * n + s * s - i * i, v = b - a * a - l * l + o * o, k = b - u * u - c * c + f * f, g = p * m - d * _, y = (m * k - _ * v) / (g * 2) - n, P = (_ * x - m * h) / g, N = (p * v - d * k) / (g * 2) - s, M = (d * h - p * x) / g, H = P * P + M * M - 1, C = 2 * (i + y * P + N * M), Z = y * y + N * N - i * i, Y = -(Math.abs(H) > 1e-6 ? (C + Math.sqrt(C * C - 4 * H * Z)) / (2 * H) : Z / C);
|
|
159
159
|
return {
|
|
160
|
-
x: n +
|
|
161
|
-
y:
|
|
160
|
+
x: n + y + P * Y,
|
|
161
|
+
y: s + N + M * Y,
|
|
162
162
|
r: Y
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
function F(t, r, e) {
|
|
166
|
-
var n = t.x - r.x,
|
|
167
|
-
u ? (
|
|
166
|
+
var n = t.x - r.x, s, i, a = t.y - r.y, l, o, u = n * n + a * a;
|
|
167
|
+
u ? (i = r.r + e.r, i *= i, o = t.r + e.r, o *= o, i > o ? (s = (u + o - i) / (2 * u), l = Math.sqrt(Math.max(0, o / u - s * s)), e.x = t.x - s * n - l * a, e.y = t.y - s * a + l * n) : (s = (u + i - o) / (2 * u), l = Math.sqrt(Math.max(0, i / u - s * s)), e.x = r.x + s * n - l * a, e.y = r.y + s * a + l * n)) : (e.x = r.x + e.r, e.y = r.y);
|
|
168
168
|
}
|
|
169
169
|
function W(t, r) {
|
|
170
|
-
var e = t.r + r.r - 1e-6, n = r.x - t.x,
|
|
171
|
-
return e > 0 && e * e > n * n +
|
|
170
|
+
var e = t.r + r.r - 1e-6, n = r.x - t.x, s = r.y - t.y;
|
|
171
|
+
return e > 0 && e * e > n * n + s * s;
|
|
172
172
|
}
|
|
173
173
|
function V(t) {
|
|
174
|
-
var r = t._, e = t.next._, n = r.r + e.r,
|
|
175
|
-
return
|
|
174
|
+
var r = t._, e = t.next._, n = r.r + e.r, s = (r.x * e.r + e.x * r.r) / n, i = (r.y * e.r + e.y * r.r) / n;
|
|
175
|
+
return s * s + i * i;
|
|
176
176
|
}
|
|
177
177
|
function T(t) {
|
|
178
178
|
this._ = t, this.next = null, this.previous = null;
|
|
179
179
|
}
|
|
180
|
-
function
|
|
181
|
-
if (!(
|
|
182
|
-
var e, n,
|
|
183
|
-
if (e = t[0], e.x = 0, e.y = 0, !(
|
|
184
|
-
if (n = t[1], e.x = -n.r, n.x = e.r, n.y = 0, !(
|
|
185
|
-
F(n, e,
|
|
186
|
-
e: for (o = 3; o <
|
|
187
|
-
F(e._, n._,
|
|
180
|
+
function Me(t, r) {
|
|
181
|
+
if (!(i = (t = ve(t)).length)) return 0;
|
|
182
|
+
var e, n, s, i, a, l, o, u, c, f, d;
|
|
183
|
+
if (e = t[0], e.x = 0, e.y = 0, !(i > 1)) return e.r;
|
|
184
|
+
if (n = t[1], e.x = -n.r, n.x = e.r, n.y = 0, !(i > 2)) return e.r + n.r;
|
|
185
|
+
F(n, e, s = t[2]), e = new T(e), n = new T(n), s = new T(s), e.next = s.previous = n, n.next = e.previous = s, s.next = n.previous = e;
|
|
186
|
+
e: for (o = 3; o < i; ++o) {
|
|
187
|
+
F(e._, n._, s = t[o]), s = new T(s), u = n.next, c = e.previous, f = n._.r, d = e._.r;
|
|
188
188
|
do
|
|
189
|
-
if (
|
|
190
|
-
if (W(u._,
|
|
189
|
+
if (f <= d) {
|
|
190
|
+
if (W(u._, s._)) {
|
|
191
191
|
n = u, e.next = n, n.previous = e, --o;
|
|
192
192
|
continue e;
|
|
193
193
|
}
|
|
194
|
-
|
|
194
|
+
f += u._.r, u = u.next;
|
|
195
195
|
} else {
|
|
196
|
-
if (W(c._,
|
|
196
|
+
if (W(c._, s._)) {
|
|
197
197
|
e = c, e.next = n, n.previous = e, --o;
|
|
198
198
|
continue e;
|
|
199
199
|
}
|
|
200
200
|
d += c._.r, c = c.previous;
|
|
201
201
|
}
|
|
202
202
|
while (u !== c.next);
|
|
203
|
-
for (
|
|
204
|
-
(l = V(
|
|
203
|
+
for (s.previous = e, s.next = n, e.next = n.previous = n = s, a = V(e); (s = s.next) !== n; )
|
|
204
|
+
(l = V(s)) < a && (e = s, a = l);
|
|
205
205
|
n = e.next;
|
|
206
206
|
}
|
|
207
|
-
for (e = [n._],
|
|
208
|
-
for (
|
|
209
|
-
return
|
|
207
|
+
for (e = [n._], s = n; (s = s.next) !== n; ) e.push(s._);
|
|
208
|
+
for (s = we(e, r), o = 0; o < i; ++o) e = t[o], e.x -= s.x, e.y -= s.y;
|
|
209
|
+
return s.r;
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function Ce(t) {
|
|
212
212
|
return Math.sqrt(t.value);
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function De() {
|
|
215
215
|
var t = null, r = 1, e = 1, n = z;
|
|
216
|
-
function i
|
|
217
|
-
const a =
|
|
218
|
-
return
|
|
216
|
+
function s(i) {
|
|
217
|
+
const a = be();
|
|
218
|
+
return i.x = r / 2, i.y = e / 2, t ? i.eachBefore(B(t)).eachAfter(S(n, 0.5, a)).eachBefore(G(1)) : i.eachBefore(B(Ce)).eachAfter(S(z, 1, a)).eachAfter(S(n, i.r / Math.min(r, e), a)).eachBefore(G(Math.min(r, e) / (2 * i.r))), i;
|
|
219
219
|
}
|
|
220
|
-
return
|
|
221
|
-
return arguments.length ? (t =
|
|
222
|
-
},
|
|
223
|
-
return arguments.length ? (r = +
|
|
224
|
-
},
|
|
225
|
-
return arguments.length ? (n = typeof
|
|
226
|
-
},
|
|
220
|
+
return s.radius = function(i) {
|
|
221
|
+
return arguments.length ? (t = pe(i), s) : t;
|
|
222
|
+
}, s.size = function(i) {
|
|
223
|
+
return arguments.length ? (r = +i[0], e = +i[1], s) : [r, e];
|
|
224
|
+
}, s.padding = function(i) {
|
|
225
|
+
return arguments.length ? (n = typeof i == "function" ? i : ge(+i), s) : n;
|
|
226
|
+
}, s;
|
|
227
227
|
}
|
|
228
228
|
function B(t) {
|
|
229
229
|
return function(r) {
|
|
@@ -232,10 +232,10 @@ function B(t) {
|
|
|
232
232
|
}
|
|
233
233
|
function S(t, r, e) {
|
|
234
234
|
return function(n) {
|
|
235
|
-
if (
|
|
236
|
-
var
|
|
237
|
-
if (l) for (
|
|
238
|
-
if (o =
|
|
235
|
+
if (s = n.children) {
|
|
236
|
+
var s, i, a = s.length, l = t(n) * r || 0, o;
|
|
237
|
+
if (l) for (i = 0; i < a; ++i) s[i].r += l;
|
|
238
|
+
if (o = Me(s, e), l) for (i = 0; i < a; ++i) s[i].r -= l;
|
|
239
239
|
n.r = o + l;
|
|
240
240
|
}
|
|
241
241
|
};
|
|
@@ -246,7 +246,7 @@ function G(t) {
|
|
|
246
246
|
r.r *= t, e && (r.x = e.x + t * r.x, r.y = e.y + t * r.y);
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
|
-
class R extends
|
|
249
|
+
class R extends I {
|
|
250
250
|
constructor() {
|
|
251
251
|
super(...arguments), Object.defineProperty(this, "_tag", {
|
|
252
252
|
enumerable: !0,
|
|
@@ -257,7 +257,7 @@ class R extends J {
|
|
|
257
257
|
enumerable: !0,
|
|
258
258
|
configurable: !0,
|
|
259
259
|
writable: !0,
|
|
260
|
-
value:
|
|
260
|
+
value: De()
|
|
261
261
|
}), Object.defineProperty(this, "_packData", {
|
|
262
262
|
enumerable: !0,
|
|
263
263
|
configurable: !0,
|
|
@@ -267,8 +267,8 @@ class R extends J {
|
|
|
267
267
|
enumerable: !0,
|
|
268
268
|
configurable: !0,
|
|
269
269
|
writable: !0,
|
|
270
|
-
value: this.addDisposer(new
|
|
271
|
-
themeTags:
|
|
270
|
+
value: this.addDisposer(new fe(de.new({}), () => me._new(this._root, {
|
|
271
|
+
themeTags: ce(this.circles.template.get("themeTags", []), [this._tag, "shape"])
|
|
272
272
|
}, [this.circles.template])))
|
|
273
273
|
});
|
|
274
274
|
}
|
|
@@ -286,19 +286,19 @@ class R extends J {
|
|
|
286
286
|
}
|
|
287
287
|
_updateNode(r) {
|
|
288
288
|
super._updateNode(r);
|
|
289
|
-
const e = r.get("node"), n = r.get("circle"),
|
|
289
|
+
const e = r.get("node"), n = r.get("circle"), s = r.get("d3HierarchyNode"), i = this.getPrivate("scaleR", 1), a = s.x * i, l = s.y * i, o = s.r * i, u = this.get("animationDuration", 0), c = this.get("animationEasing");
|
|
290
290
|
if (e.animate({ key: "x", to: a, duration: u, easing: c }), e.animate({ key: "y", to: l, duration: u, easing: c }), n) {
|
|
291
|
-
const
|
|
292
|
-
n.animate({ key: "radius", to: o, duration: u, easing: c }), n._setDefault("fill",
|
|
291
|
+
const f = r.get("fill"), d = r.get("fillPattern");
|
|
292
|
+
n.animate({ key: "radius", to: o, duration: u, easing: c }), n._setDefault("fill", f), n._setDefault("fillPattern", d), n._setDefault("stroke", f);
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
_updateNodesScale(r) {
|
|
296
296
|
const e = r.data.dataItem;
|
|
297
297
|
if (e) {
|
|
298
|
-
const n = e.get("node"),
|
|
299
|
-
n.setAll({ x: a, y: l }),
|
|
298
|
+
const n = e.get("node"), s = e.get("circle"), i = this.getPrivate("scaleR", 1), a = r.x * i, l = r.y * i, o = r.r * i;
|
|
299
|
+
n.setAll({ x: a, y: l }), s.set("radius", o);
|
|
300
300
|
const u = r.children;
|
|
301
|
-
u &&
|
|
301
|
+
u && he(u, (c) => {
|
|
302
302
|
this._updateNodesScale(c);
|
|
303
303
|
});
|
|
304
304
|
}
|
|
@@ -309,20 +309,20 @@ class R extends J {
|
|
|
309
309
|
makeNode(r) {
|
|
310
310
|
const e = super.makeNode(r), n = e.children.moveValue(this.circles.make(), 0);
|
|
311
311
|
e.setPrivate("tooltipTarget", n), this.circles.push(n), r.setRaw("circle", n);
|
|
312
|
-
const
|
|
312
|
+
const s = r.get("label");
|
|
313
313
|
return n.on("radius", () => {
|
|
314
|
-
const
|
|
315
|
-
|
|
314
|
+
const i = n.get("radius", this.width()) * 2;
|
|
315
|
+
s.setAll({ maxWidth: i, maxHeight: i });
|
|
316
316
|
}), e;
|
|
317
317
|
}
|
|
318
318
|
_zoom(r) {
|
|
319
319
|
const e = r.get("d3HierarchyNode");
|
|
320
|
-
let n = e.x,
|
|
320
|
+
let n = e.x, s = e.y, i = e.r, a = Math.min(this.innerWidth(), this.innerHeight()) / (i * 2);
|
|
321
321
|
const l = this.get("animationEasing");
|
|
322
322
|
let o = this.get("animationDuration", 0);
|
|
323
323
|
this.inited || (o = 0), this.animatePrivate({ key: "scaleR", to: a, duration: o, easing: l });
|
|
324
324
|
const u = this.nodesContainer;
|
|
325
|
-
u.animate({ key: "x", from: u.x(), to: this.width() / 2 - n * a, duration: o, easing: l }), u.animate({ key: "y", from: u.y(), to: this.height() / 2 -
|
|
325
|
+
u.animate({ key: "x", from: u.x(), to: this.width() / 2 - n * a, duration: o, easing: l }), u.animate({ key: "y", from: u.y(), to: this.height() / 2 - s * a, duration: o, easing: l });
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
Object.defineProperty(R, "className", {
|
|
@@ -335,10 +335,10 @@ Object.defineProperty(R, "classNames", {
|
|
|
335
335
|
enumerable: !0,
|
|
336
336
|
configurable: !0,
|
|
337
337
|
writable: !0,
|
|
338
|
-
value:
|
|
338
|
+
value: I.classNames.concat([R.className])
|
|
339
339
|
});
|
|
340
|
-
function
|
|
341
|
-
const e =
|
|
340
|
+
function Te(t, r) {
|
|
341
|
+
const e = re(t);
|
|
342
342
|
switch (r) {
|
|
343
343
|
case "millisecond":
|
|
344
344
|
return e.format("HH:mm:ss.SSS");
|
|
@@ -360,27 +360,27 @@ function Ce(t, r) {
|
|
|
360
360
|
return e.format();
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
const
|
|
364
|
-
const r = ee({ props: t, name: "HCPackedCircles" }), {
|
|
365
|
-
dimensions:
|
|
366
|
-
values:
|
|
363
|
+
const Fe = (t) => {
|
|
364
|
+
const r = ee({ props: t, name: "HCPackedCircles" }), e = te(), {
|
|
365
|
+
dimensions: n,
|
|
366
|
+
values: s,
|
|
367
367
|
data: i,
|
|
368
|
-
initDelay:
|
|
369
|
-
baseInterval:
|
|
370
|
-
colors:
|
|
371
|
-
sx:
|
|
372
|
-
...
|
|
373
|
-
} = r,
|
|
368
|
+
initDelay: a = 0,
|
|
369
|
+
baseInterval: l = { timeUnit: "year", count: 1 },
|
|
370
|
+
colors: o,
|
|
371
|
+
sx: u,
|
|
372
|
+
...c
|
|
373
|
+
} = r, d = `hc-packed-circles-${ne().replace(/:/g, "")}`, p = se(null);
|
|
374
374
|
let m = null;
|
|
375
|
-
|
|
375
|
+
n.length < 1 ? m = "PackedCircles requires at least 1 dimension" : s.length < 1 && (m = "PackedCircles requires at least 1 value"), ie(() => {
|
|
376
376
|
if (m) return;
|
|
377
|
-
let
|
|
378
|
-
return
|
|
379
|
-
var
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
const
|
|
383
|
-
U.new(
|
|
377
|
+
let x;
|
|
378
|
+
return x = setTimeout(() => {
|
|
379
|
+
var g;
|
|
380
|
+
const h = Q.new(d);
|
|
381
|
+
p.current = h, oe(h, (g = s == null ? void 0 : s[0]) == null ? void 0 : g.format), h.setThemes([X.new(h)]), ae(h, e);
|
|
382
|
+
const b = h.container.children.push(
|
|
383
|
+
U.new(h, {
|
|
384
384
|
width: q,
|
|
385
385
|
height: q,
|
|
386
386
|
// Off by default for the same reason the XY charts set `wheelX`/`wheelY`
|
|
@@ -390,33 +390,33 @@ const ze = (t) => {
|
|
|
390
390
|
pinchZoom: !0
|
|
391
391
|
})
|
|
392
392
|
);
|
|
393
|
-
|
|
394
|
-
j.new(
|
|
393
|
+
b.children.push(
|
|
394
|
+
j.new(h, { target: b })
|
|
395
395
|
);
|
|
396
|
-
const
|
|
397
|
-
R.new(
|
|
396
|
+
const v = b.contents.children.push(
|
|
397
|
+
R.new(h, {
|
|
398
398
|
maskContent: !1,
|
|
399
399
|
topDepth: 1,
|
|
400
|
-
valueField:
|
|
401
|
-
categoryField:
|
|
400
|
+
valueField: s[0].dataFieldName,
|
|
401
|
+
categoryField: n[0].value,
|
|
402
402
|
childDataField: "children"
|
|
403
403
|
})
|
|
404
|
-
),
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
404
|
+
), k = ue(h, o);
|
|
405
|
+
v.set("colors", k), n[0].type === "date" && i.forEach((y) => {
|
|
406
|
+
y[n[0].value] = Te(
|
|
407
|
+
y[n[0].value],
|
|
408
|
+
l.timeUnit
|
|
409
409
|
);
|
|
410
|
-
}),
|
|
411
|
-
},
|
|
412
|
-
var
|
|
413
|
-
|
|
410
|
+
}), v.data.setAll([{ name: "Root", children: i }]), v.appear(1e3, 100);
|
|
411
|
+
}, a), () => {
|
|
412
|
+
var h;
|
|
413
|
+
x && clearTimeout(x), (h = p.current) == null || h.dispose(), p.current = null;
|
|
414
414
|
};
|
|
415
|
-
}, [i,
|
|
416
|
-
const
|
|
417
|
-
return { chartId:
|
|
415
|
+
}, [i, n, s, o, e.palette.mode]);
|
|
416
|
+
const _ = { ...r };
|
|
417
|
+
return { chartId: d, ownerState: _, sx: u, error: m, other: c };
|
|
418
418
|
};
|
|
419
419
|
export {
|
|
420
|
-
|
|
421
|
-
|
|
420
|
+
Te as formatTimeLabel,
|
|
421
|
+
Fe as usePackedCirclesLogic
|
|
422
422
|
};
|