@thebuoyant-tsdev/mui-ts-library 3.9.1 → 3.11.0
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/README.de.md +79 -0
- package/README.md +79 -0
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.d.ts +1 -1
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +308 -252
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.types.d.ts +2 -0
- package/dist/components/radial-tree-chart/RadialTreeChart.d.ts +1 -1
- package/dist/components/radial-tree-chart/RadialTreeChart.js +210 -160
- package/dist/components/radial-tree-chart/RadialTreeChart.types.d.ts +2 -0
- package/dist/components/sunburst-chart/SunburstChart.d.ts +1 -1
- package/dist/components/sunburst-chart/SunburstChart.js +160 -128
- package/dist/components/sunburst-chart/SunburstChart.types.d.ts +2 -0
- package/dist/index.cjs +1 -1
- package/package.json +1 -1
|
@@ -87,6 +87,8 @@ export type RadialTreeChartProps = {
|
|
|
87
87
|
drillable?: boolean;
|
|
88
88
|
/** Fired when drill-down focus changes — null when reset to root */
|
|
89
89
|
onFocusChange?: (focusedNode: RadialTreeNodeInfo | null) => void;
|
|
90
|
+
/** Drill-down/out crossfade duration in ms — set to 0 to disable (default: 750) */
|
|
91
|
+
duration?: number;
|
|
90
92
|
/** Disables all interactions (default: false) */
|
|
91
93
|
disabled?: boolean;
|
|
92
94
|
/** Override translation strings */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type SunburstChartProps } from "./SunburstChart.types";
|
|
2
|
-
export declare function SunburstChart({ data, size, showSegmentLabels, innerRadius, sortBy, chartColors, showRootLabel, onSegmentClick, onZoomChange, valueDecimalCount, valueDecimalSeparator, valueThousandsSeparator, zoomable, disabled, }: SunburstChartProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function SunburstChart({ data, size, showSegmentLabels, innerRadius, sortBy, chartColors, showRootLabel, onSegmentClick, onZoomChange, valueDecimalCount, valueDecimalSeparator, valueThousandsSeparator, zoomable, duration, disabled, }: SunburstChartProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare namespace SunburstChart {
|
|
4
4
|
var displayName: string;
|
|
5
5
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { useCallback as e,
|
|
2
|
-
import { Box as
|
|
3
|
-
import { jsx as
|
|
4
|
-
import * as
|
|
1
|
+
import { useCallback as e, useEffect as t, useLayoutEffect as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
2
|
+
import { Box as o, Tooltip as s, Typography as c, useTheme as l } from "@mui/material";
|
|
3
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
4
|
+
import * as f from "d3";
|
|
5
5
|
//#region src/components/sunburst-chart/SunburstChart.tsx
|
|
6
|
-
var
|
|
7
|
-
function
|
|
6
|
+
var p = 2 * Math.PI, m = 11, h = m * .5, g = 5;
|
|
7
|
+
function _(e, t = 0, n = ".", r = ",") {
|
|
8
8
|
if (e == null || !isFinite(e)) return "0";
|
|
9
9
|
let [i, a] = e.toFixed(Math.max(0, t)).split("."), o = i.replace(/\B(?=(\d{3})+(?!\d))/g, r);
|
|
10
10
|
return a ? `${o}${n}${a}` : o;
|
|
11
11
|
}
|
|
12
12
|
function ee(e, t) {
|
|
13
|
-
let n = Math.floor(t /
|
|
14
|
-
return n <= 0 ? "" : e.length <= n ? e : n <
|
|
13
|
+
let n = Math.floor(t / h);
|
|
14
|
+
return n <= 0 ? "" : e.length <= n ? e : n < g ? "" : e.slice(0, n - 1) + "…";
|
|
15
15
|
}
|
|
16
16
|
function te({ node: e, valueDecimalCount: t, valueDecimalSep: n, valueThousandsSep: r }) {
|
|
17
|
-
let i = (e.value ?? 0) > 0,
|
|
18
|
-
return /* @__PURE__ */
|
|
17
|
+
let i = (e.value ?? 0) > 0, a = e.ancestors().map((e) => e.data.name).reverse().join(" › ");
|
|
18
|
+
return /* @__PURE__ */ d(o, {
|
|
19
19
|
sx: { py: .25 },
|
|
20
20
|
children: [
|
|
21
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ u(c, {
|
|
22
22
|
variant: "caption",
|
|
23
23
|
sx: {
|
|
24
24
|
fontWeight: "bold",
|
|
@@ -26,45 +26,45 @@ function te({ node: e, valueDecimalCount: t, valueDecimalSep: n, valueThousandsS
|
|
|
26
26
|
},
|
|
27
27
|
children: e.data.name
|
|
28
28
|
}),
|
|
29
|
-
i && /* @__PURE__ */
|
|
29
|
+
i && /* @__PURE__ */ u(c, {
|
|
30
30
|
variant: "caption",
|
|
31
31
|
sx: {
|
|
32
32
|
display: "block",
|
|
33
33
|
opacity: .85
|
|
34
34
|
},
|
|
35
|
-
children:
|
|
35
|
+
children: _(e.value ?? 0, t, n, r)
|
|
36
36
|
}),
|
|
37
|
-
e.depth > 0 && /* @__PURE__ */
|
|
37
|
+
e.depth > 0 && /* @__PURE__ */ u(c, {
|
|
38
38
|
variant: "caption",
|
|
39
39
|
sx: {
|
|
40
40
|
display: "block",
|
|
41
41
|
opacity: .65,
|
|
42
42
|
mt: .25
|
|
43
43
|
},
|
|
44
|
-
children:
|
|
44
|
+
children: a
|
|
45
45
|
})
|
|
46
46
|
]
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
let
|
|
51
|
-
if (
|
|
52
|
-
let [e, t, n, r] =
|
|
49
|
+
function v({ data: c, size: h = 500, showSegmentLabels: g = !0, innerRadius: _ = 0, sortBy: v = "value", chartColors: y, showRootLabel: b = !0, onSegmentClick: x, onZoomChange: S, valueDecimalCount: ne = 0, valueDecimalSeparator: re = ".", valueThousandsSeparator: ie = ",", zoomable: C = !1, duration: w = 750, disabled: T = !1 }) {
|
|
50
|
+
let E = l(), D = i(null), [O, k] = a(`-${h / 2} -${h / 2} ${h} ${h}`), [A, j] = a(1), ae = r(() => {
|
|
51
|
+
if (A === 1) return O;
|
|
52
|
+
let [e, t, n, r] = O.split(" ").map(Number), i = n / A, a = r / A;
|
|
53
53
|
return `${e + (n - i) / 2} ${t + (r - a) / 2} ${i} ${a}`;
|
|
54
|
-
}, [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
],
|
|
62
|
-
let e =
|
|
63
|
-
|
|
54
|
+
}, [O, A]), M = h / 2, N = Math.max(0, Math.min(_, Math.max(0, M - 1))), P = Math.max(1, M - N), oe = [
|
|
55
|
+
E.palette.primary.main,
|
|
56
|
+
E.palette.secondary.main,
|
|
57
|
+
E.palette.error.main,
|
|
58
|
+
E.palette.warning.main,
|
|
59
|
+
E.palette.success.main,
|
|
60
|
+
E.palette.info.main
|
|
61
|
+
], F = y && y.length > 0 ? y : oe, { root: I, ringThickness: L } = r(() => {
|
|
62
|
+
let e = f.hierarchy(c).sum((e) => e.value ?? 0);
|
|
63
|
+
v === "value" ? e.sort((e, t) => (t.value ?? 0) - (e.value ?? 0)) : e.sort((e, t) => String(e.data.name).localeCompare(String(t.data.name), void 0, {
|
|
64
64
|
numeric: !0,
|
|
65
65
|
sensitivity: "base"
|
|
66
66
|
}));
|
|
67
|
-
let t =
|
|
67
|
+
let t = f.partition().size([p, P])(e), n = f.max(t.descendants(), (e) => e.depth) ?? 0, r = n > 0 ? P / n : P;
|
|
68
68
|
return n > 0 && t.descendants().forEach((e) => {
|
|
69
69
|
e.depth === 0 ? (e.y0 = 0, e.y1 = 0) : (e.y0 = (e.depth - 1) * r, e.y1 = e.depth * r);
|
|
70
70
|
}), {
|
|
@@ -72,29 +72,61 @@ function _({ data: s, size: m = 500, showSegmentLabels: h = !0, innerRadius: g =
|
|
|
72
72
|
ringThickness: r
|
|
73
73
|
};
|
|
74
74
|
}, [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
]), [
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
c,
|
|
76
|
+
P,
|
|
77
|
+
v
|
|
78
|
+
]), [R, z] = a(I), [se, ce] = a(I), B = (e) => ({
|
|
79
|
+
x0: e.x0,
|
|
80
|
+
x1: e.x1,
|
|
81
|
+
yShift: e.depth === 0 ? 0 : (e.depth - 1) * L
|
|
82
|
+
}), [V, H] = a(() => B(I)), U = i(V);
|
|
83
|
+
if (se !== I) {
|
|
84
|
+
ce(I), z(I);
|
|
85
|
+
let e = B(I);
|
|
86
|
+
U.current = e, H(e);
|
|
87
|
+
}
|
|
88
|
+
let W = r(() => I.children?.map((e) => e.data.name) ?? [I.data.name], [I]), le = r(() => f.scaleOrdinal().domain(W).range(F), [F, W]), ue = (e) => {
|
|
81
89
|
if (e.data.colorConfig?.fill) return e.data.colorConfig.fill;
|
|
82
90
|
let t = e;
|
|
83
91
|
for (; t.depth > 1;) t = t.parent;
|
|
84
|
-
return
|
|
85
|
-
},
|
|
86
|
-
let t =
|
|
92
|
+
return le(t.data.name);
|
|
93
|
+
}, de = r(() => f.arc().startAngle((e) => e.x0).endAngle((e) => e.x1).padAngle((e) => Math.min((e.x1 - e.x0) / 2, .005)).padRadius(M / 2).innerRadius((e) => N + e.y0).outerRadius((e) => N + e.y1 - 1), [M, N]), G = e((e) => {
|
|
94
|
+
let t = p / (V.x1 - V.x0);
|
|
87
95
|
return {
|
|
88
|
-
x0:
|
|
89
|
-
x1:
|
|
90
|
-
y0: Math.max(0, e.y0 -
|
|
91
|
-
y1: Math.max(0, e.y1 -
|
|
96
|
+
x0: Math.max(0, Math.min(p, (e.x0 - V.x0) * t)),
|
|
97
|
+
x1: Math.max(0, Math.min(p, (e.x1 - V.x0) * t)),
|
|
98
|
+
y0: Math.max(0, e.y0 - V.yShift),
|
|
99
|
+
y1: Math.max(0, e.y1 - V.yShift)
|
|
100
|
+
};
|
|
101
|
+
}, [V]);
|
|
102
|
+
t(() => {
|
|
103
|
+
let e = B(R), t = U.current;
|
|
104
|
+
if (t.x0 === e.x0 && t.x1 === e.x1 && t.yShift === e.yShift) return;
|
|
105
|
+
if (w <= 0) {
|
|
106
|
+
U.current = e, H(e);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
let n = null, r = f.interpolateNumber(t.x0, e.x0), i = f.interpolateNumber(t.x1, e.x1), a = f.interpolateNumber(t.yShift, e.yShift), o = performance.now(), s = (e) => {
|
|
110
|
+
let t = Math.min(1, (e - o) / w), c = f.easeCubic(t), l = {
|
|
111
|
+
x0: r(c),
|
|
112
|
+
x1: i(c),
|
|
113
|
+
yShift: a(c)
|
|
114
|
+
};
|
|
115
|
+
U.current = l, H(l), n = t < 1 ? requestAnimationFrame(s) : null;
|
|
92
116
|
};
|
|
93
|
-
|
|
94
|
-
|
|
117
|
+
return n = requestAnimationFrame(s), () => {
|
|
118
|
+
n != null && cancelAnimationFrame(n);
|
|
119
|
+
};
|
|
120
|
+
}, [
|
|
121
|
+
R,
|
|
122
|
+
L,
|
|
123
|
+
w
|
|
124
|
+
]);
|
|
125
|
+
let fe = (e) => e.x1 > e.x0 && e.y1 > e.y0, pe = (e) => (N + (e.y0 + e.y1) / 2) * (e.x1 - e.x0) > 12, me = (e) => {
|
|
126
|
+
let t = (e.x0 + e.x1) / 2 * 180 / Math.PI, n = N + (e.y0 + e.y1) / 2, r = t < 180 ? 0 : 180;
|
|
95
127
|
return `rotate(${t - 90}) translate(${n},0) rotate(${r})`;
|
|
96
|
-
},
|
|
97
|
-
let t = e.ancestors().reverse(), n = e.value ?? 0, r =
|
|
128
|
+
}, he = e((e) => e.ancestors().includes(R), [R]), K = e((e) => {
|
|
129
|
+
let t = e.ancestors().reverse(), n = e.value ?? 0, r = I.value ?? 0;
|
|
98
130
|
return {
|
|
99
131
|
id: e.data.id,
|
|
100
132
|
name: e.data.name,
|
|
@@ -106,179 +138,179 @@ function _({ data: s, size: m = 500, showSegmentLabels: h = !0, innerRadius: g =
|
|
|
106
138
|
childrenCount: e.children?.length ?? 0,
|
|
107
139
|
data: e.data
|
|
108
140
|
};
|
|
109
|
-
}, [
|
|
110
|
-
|
|
141
|
+
}, [I]), q = e((e) => {
|
|
142
|
+
z(e), S && S({
|
|
111
143
|
focusNode: K(e),
|
|
112
|
-
isRoot: e ===
|
|
144
|
+
isRoot: e === I
|
|
113
145
|
});
|
|
114
146
|
}, [
|
|
115
|
-
|
|
147
|
+
I,
|
|
116
148
|
K,
|
|
117
|
-
|
|
149
|
+
S
|
|
118
150
|
]);
|
|
119
|
-
|
|
120
|
-
let e =
|
|
151
|
+
n(() => {
|
|
152
|
+
let e = D.current;
|
|
121
153
|
if (!e) return;
|
|
122
154
|
let t = requestAnimationFrame(() => {
|
|
123
155
|
try {
|
|
124
156
|
let t = e.getBBox();
|
|
125
|
-
|
|
157
|
+
k(`${t.x - 8} ${t.y - 8} ${t.width + 16} ${t.height + 16}`);
|
|
126
158
|
} catch {
|
|
127
|
-
|
|
159
|
+
k(`-${h / 2} -${h / 2} ${h} ${h}`);
|
|
128
160
|
}
|
|
129
161
|
});
|
|
130
162
|
return () => cancelAnimationFrame(t);
|
|
131
163
|
}, [
|
|
132
|
-
|
|
133
|
-
F,
|
|
134
|
-
L,
|
|
135
|
-
M,
|
|
164
|
+
h,
|
|
136
165
|
I,
|
|
137
|
-
|
|
166
|
+
R,
|
|
167
|
+
N,
|
|
168
|
+
L,
|
|
169
|
+
b
|
|
138
170
|
]);
|
|
139
|
-
let J =
|
|
171
|
+
let J = i(null), ge = (e) => {
|
|
140
172
|
J.current &&= (clearTimeout(J.current), null), J.current = setTimeout(() => {
|
|
141
173
|
e(), J.current = null;
|
|
142
174
|
}, 250);
|
|
143
175
|
}, Y = () => {
|
|
144
176
|
J.current &&= (clearTimeout(J.current), null);
|
|
145
177
|
};
|
|
146
|
-
|
|
147
|
-
if (
|
|
178
|
+
n(() => {
|
|
179
|
+
if (T) return;
|
|
148
180
|
let e = (e) => {
|
|
149
|
-
e.key === "Escape" && (Y(), q(
|
|
181
|
+
e.key === "Escape" && (Y(), q(I), j(1));
|
|
150
182
|
};
|
|
151
183
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
152
184
|
}, [
|
|
153
|
-
|
|
154
|
-
|
|
185
|
+
T,
|
|
186
|
+
I,
|
|
155
187
|
q
|
|
156
188
|
]);
|
|
157
|
-
let
|
|
158
|
-
if (!C ||
|
|
189
|
+
let _e = e((e) => {
|
|
190
|
+
if (!C || T || !e.ctrlKey) return;
|
|
159
191
|
e.preventDefault();
|
|
160
192
|
let t = e.deltaY < 0 ? 1.15 : 1 / 1.15;
|
|
161
|
-
|
|
162
|
-
}, [C,
|
|
163
|
-
if (
|
|
193
|
+
j((e) => Math.max(.25, Math.min(8, e * t)));
|
|
194
|
+
}, [C, T]), X = I.descendants().filter((e) => e.depth > 0), ve = (e) => {
|
|
195
|
+
if (T) return;
|
|
164
196
|
let t = X[Number(e.currentTarget.getAttribute("data-idx"))];
|
|
165
197
|
if (t) {
|
|
166
198
|
if (e.ctrlKey || e.metaKey) {
|
|
167
|
-
t.children &&
|
|
199
|
+
t.children && ge(() => q(t));
|
|
168
200
|
return;
|
|
169
201
|
}
|
|
170
|
-
|
|
202
|
+
x?.(K(t), e);
|
|
171
203
|
}
|
|
172
|
-
},
|
|
173
|
-
|
|
204
|
+
}, ye = (e) => {
|
|
205
|
+
T || (e.ctrlKey || e.metaKey) && (Y(), q(R.parent ?? I));
|
|
174
206
|
}, Z = (e) => {
|
|
175
|
-
if (!
|
|
207
|
+
if (!T) {
|
|
176
208
|
if (e.ctrlKey || e.metaKey) {
|
|
177
|
-
Y(), q(
|
|
209
|
+
Y(), q(R.parent ?? I);
|
|
178
210
|
return;
|
|
179
211
|
}
|
|
180
|
-
|
|
212
|
+
x?.(K(R.parent ?? I), e);
|
|
181
213
|
}
|
|
182
214
|
}, Q = {
|
|
183
215
|
followCursor: !0,
|
|
184
216
|
enterDelay: 50,
|
|
185
217
|
enterNextDelay: 0,
|
|
186
|
-
disableHoverListener:
|
|
218
|
+
disableHoverListener: T,
|
|
187
219
|
slotProps: { tooltip: { sx: { maxWidth: 260 } } }
|
|
188
|
-
}, $ =
|
|
189
|
-
return /* @__PURE__ */
|
|
220
|
+
}, $ = E.palette.text.primary, be = E.typography.fontFamily;
|
|
221
|
+
return /* @__PURE__ */ u(o, {
|
|
190
222
|
sx: {
|
|
191
223
|
display: "inline-flex",
|
|
192
|
-
opacity:
|
|
193
|
-
cursor:
|
|
224
|
+
opacity: T ? .5 : 1,
|
|
225
|
+
cursor: T ? "not-allowed" : "default",
|
|
194
226
|
userSelect: "none"
|
|
195
227
|
},
|
|
196
|
-
children: /* @__PURE__ */
|
|
197
|
-
width:
|
|
198
|
-
height:
|
|
199
|
-
viewBox:
|
|
200
|
-
onWheel:
|
|
228
|
+
children: /* @__PURE__ */ u("svg", {
|
|
229
|
+
width: h,
|
|
230
|
+
height: h,
|
|
231
|
+
viewBox: ae,
|
|
232
|
+
onWheel: _e,
|
|
201
233
|
style: {
|
|
202
|
-
fontFamily:
|
|
203
|
-
overflow: C &&
|
|
234
|
+
fontFamily: be ?? "sans-serif",
|
|
235
|
+
overflow: C && A > 1 ? "hidden" : "visible"
|
|
204
236
|
},
|
|
205
237
|
role: "img",
|
|
206
|
-
"aria-label":
|
|
207
|
-
children: /* @__PURE__ */
|
|
208
|
-
ref:
|
|
238
|
+
"aria-label": c.name,
|
|
239
|
+
children: /* @__PURE__ */ d("g", {
|
|
240
|
+
ref: D,
|
|
209
241
|
children: [
|
|
210
|
-
|
|
242
|
+
N > 0 && /* @__PURE__ */ u(s, {
|
|
211
243
|
...Q,
|
|
212
|
-
title:
|
|
244
|
+
title: R.data.name,
|
|
213
245
|
placement: "top",
|
|
214
|
-
children: /* @__PURE__ */
|
|
246
|
+
children: /* @__PURE__ */ u("circle", {
|
|
215
247
|
cx: 0,
|
|
216
248
|
cy: 0,
|
|
217
|
-
r:
|
|
249
|
+
r: N,
|
|
218
250
|
fill: "transparent",
|
|
219
|
-
pointerEvents:
|
|
251
|
+
pointerEvents: T ? "none" : "auto",
|
|
220
252
|
onClick: Z,
|
|
221
|
-
style: { cursor:
|
|
253
|
+
style: { cursor: T ? "not-allowed" : "pointer" }
|
|
222
254
|
})
|
|
223
255
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
let n =
|
|
226
|
-
return /* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ u("g", { children: X.map((e, t) => {
|
|
257
|
+
let n = G(e), r = fe(n), i = !!e.children;
|
|
258
|
+
return /* @__PURE__ */ u(s, {
|
|
227
259
|
...Q,
|
|
228
260
|
placement: "top",
|
|
229
|
-
title: r ? /* @__PURE__ */
|
|
261
|
+
title: r ? /* @__PURE__ */ u(te, {
|
|
230
262
|
node: e,
|
|
231
263
|
valueDecimalCount: ne,
|
|
232
264
|
valueDecimalSep: re,
|
|
233
|
-
valueThousandsSep:
|
|
265
|
+
valueThousandsSep: ie
|
|
234
266
|
}) : "",
|
|
235
|
-
children: /* @__PURE__ */
|
|
267
|
+
children: /* @__PURE__ */ u("path", {
|
|
236
268
|
"data-idx": t,
|
|
237
|
-
d:
|
|
238
|
-
fill:
|
|
269
|
+
d: de(n) || "",
|
|
270
|
+
fill: ue(e),
|
|
239
271
|
fillOpacity: r ? i ? .75 : .5 : 0,
|
|
240
272
|
style: {
|
|
241
|
-
pointerEvents: r && !
|
|
242
|
-
cursor: i && !
|
|
273
|
+
pointerEvents: r && !T ? "auto" : "none",
|
|
274
|
+
cursor: i && !T ? "pointer" : "default",
|
|
243
275
|
transition: "fill-opacity 0.15s"
|
|
244
276
|
},
|
|
245
|
-
onClick:
|
|
246
|
-
onDoubleClick:
|
|
277
|
+
onClick: ve,
|
|
278
|
+
onDoubleClick: ye
|
|
247
279
|
})
|
|
248
280
|
}, `tt-${e.data.id}-${t}`);
|
|
249
281
|
}) }),
|
|
250
|
-
|
|
282
|
+
g && /* @__PURE__ */ u("g", {
|
|
251
283
|
pointerEvents: "none",
|
|
252
284
|
textAnchor: "middle",
|
|
253
285
|
fill: $,
|
|
254
286
|
children: X.map((e, t) => {
|
|
255
|
-
if (!
|
|
256
|
-
let n =
|
|
257
|
-
if (!
|
|
258
|
-
let r = (
|
|
259
|
-
return i ? /* @__PURE__ */
|
|
260
|
-
transform:
|
|
287
|
+
if (!he(e)) return null;
|
|
288
|
+
let n = G(e);
|
|
289
|
+
if (!pe(n)) return null;
|
|
290
|
+
let r = (N + (n.y0 + n.y1) / 2) * (n.x1 - n.x0) * .88, i = ee(e.data.name, r);
|
|
291
|
+
return i ? /* @__PURE__ */ u("text", {
|
|
292
|
+
transform: me(n),
|
|
261
293
|
dy: "0.35em",
|
|
262
|
-
fontSize:
|
|
294
|
+
fontSize: m,
|
|
263
295
|
children: i
|
|
264
296
|
}, `lbl-${e.data.id}-${t}`) : null;
|
|
265
297
|
})
|
|
266
298
|
}),
|
|
267
|
-
|
|
299
|
+
b && /* @__PURE__ */ u(s, {
|
|
268
300
|
...Q,
|
|
269
301
|
placement: "top",
|
|
270
302
|
title: "",
|
|
271
|
-
children: /* @__PURE__ */
|
|
303
|
+
children: /* @__PURE__ */ u("g", {
|
|
272
304
|
textAnchor: "middle",
|
|
273
305
|
fill: $,
|
|
274
|
-
pointerEvents:
|
|
306
|
+
pointerEvents: T ? "none" : "auto",
|
|
275
307
|
onClick: Z,
|
|
276
|
-
style: { cursor:
|
|
277
|
-
children: /* @__PURE__ */
|
|
308
|
+
style: { cursor: R !== I && !T ? "pointer" : "default" },
|
|
309
|
+
children: /* @__PURE__ */ u("text", {
|
|
278
310
|
fontSize: 13,
|
|
279
311
|
dy: "0.35em",
|
|
280
312
|
fontWeight: "bold",
|
|
281
|
-
children:
|
|
313
|
+
children: R.data.name
|
|
282
314
|
})
|
|
283
315
|
})
|
|
284
316
|
})
|
|
@@ -287,6 +319,6 @@ function _({ data: s, size: m = 500, showSegmentLabels: h = !0, innerRadius: g =
|
|
|
287
319
|
})
|
|
288
320
|
});
|
|
289
321
|
}
|
|
290
|
-
|
|
322
|
+
v.displayName = "SunburstChart";
|
|
291
323
|
//#endregion
|
|
292
|
-
export {
|
|
324
|
+
export { v as SunburstChart };
|
|
@@ -66,6 +66,8 @@ export type SunburstChartProps = {
|
|
|
66
66
|
valueThousandsSeparator?: string;
|
|
67
67
|
/** Enable Ctrl+Scroll zoom — content outside `size` is clipped (default: false) */
|
|
68
68
|
zoomable?: boolean;
|
|
69
|
+
/** Drill-down/out transition duration in ms — set to 0 to disable animation (default: 750) */
|
|
70
|
+
duration?: number;
|
|
69
71
|
/** Disables all interactions (default: false) */
|
|
70
72
|
disabled?: boolean;
|
|
71
73
|
/** Override any translation string */
|