@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
|
@@ -88,6 +88,8 @@ export type HorizontalTreeChartProps = {
|
|
|
88
88
|
renderNodePopoverContent?: (info: HorizontalTreeNodeInfo) => React.ReactNode;
|
|
89
89
|
/** Fires on every node click */
|
|
90
90
|
onNodeClick?: (info: HorizontalTreeNodeInfo, event: React.MouseEvent<SVGGElement>) => void;
|
|
91
|
+
/** Drill-down/out crossfade duration in ms — set to 0 to disable (default: 750) */
|
|
92
|
+
duration?: number;
|
|
91
93
|
/** Disables all interactions (default: false) */
|
|
92
94
|
disabled?: boolean;
|
|
93
95
|
/** Override translation strings */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RadialTreeChartProps } from "./RadialTreeChart.types";
|
|
2
|
-
export declare function RadialTreeChart({ data, size, autoFit, sortBy, showLabels, showIcons, chartColors, rootNodeRadius, branchNodeRadius, leafNodeRadius, linkColor, linkStrokeOpacity, linkStrokeWidth, labelFontSize, labelColor, separationSibling, separationCousin, zoomable, drillable, onFocusChange, showNodePopover, renderNodePopoverContent, onNodeClick, disabled, translation, }: RadialTreeChartProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function RadialTreeChart({ data, size, autoFit, sortBy, showLabels, showIcons, chartColors, rootNodeRadius, branchNodeRadius, leafNodeRadius, linkColor, linkStrokeOpacity, linkStrokeWidth, labelFontSize, labelColor, separationSibling, separationCousin, zoomable, drillable, onFocusChange, duration, showNodePopover, renderNodePopoverContent, onNodeClick, disabled, translation, }: RadialTreeChartProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare namespace RadialTreeChart {
|
|
4
4
|
var displayName: string;
|
|
5
5
|
}
|
|
@@ -1,87 +1,87 @@
|
|
|
1
1
|
import { DEFAULT_RADIAL_TREE_CHART_TRANSLATION as e } from "./RadialTreeChart.types.js";
|
|
2
|
-
import { useCallback as t,
|
|
3
|
-
import { Avatar as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import * as
|
|
2
|
+
import { useCallback as t, useEffect as n, useLayoutEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
3
|
+
import { Avatar as s, Box as c, Divider as l, Popover as ee, Tooltip as te, Typography as u, useTheme as ne } from "@mui/material";
|
|
4
|
+
import { Fragment as re, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
5
|
+
import * as p from "d3";
|
|
6
6
|
//#region src/components/radial-tree-chart/RadialTreeChart.tsx
|
|
7
|
-
var
|
|
7
|
+
var m = {
|
|
8
8
|
folder: "M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z",
|
|
9
9
|
person: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
|
|
10
10
|
};
|
|
11
|
-
function
|
|
11
|
+
function ie({ path: e, size: t }) {
|
|
12
12
|
let n = t / 2;
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ d("g", {
|
|
14
14
|
transform: `translate(${-n},${-n})`,
|
|
15
15
|
pointerEvents: "none",
|
|
16
|
-
children: /* @__PURE__ */
|
|
16
|
+
children: /* @__PURE__ */ d("svg", {
|
|
17
17
|
width: t,
|
|
18
18
|
height: t,
|
|
19
19
|
viewBox: "0 0 24 24",
|
|
20
20
|
overflow: "visible",
|
|
21
|
-
children: /* @__PURE__ */
|
|
21
|
+
children: /* @__PURE__ */ d("path", {
|
|
22
22
|
d: e,
|
|
23
23
|
fill: "white"
|
|
24
24
|
})
|
|
25
25
|
})
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return /* @__PURE__ */
|
|
28
|
+
function ae({ info: e, labelA: t, labelB: n }) {
|
|
29
|
+
return /* @__PURE__ */ f(c, {
|
|
30
30
|
sx: {
|
|
31
31
|
p: 2,
|
|
32
32
|
minWidth: 200,
|
|
33
33
|
maxWidth: 280
|
|
34
34
|
},
|
|
35
|
-
children: [/* @__PURE__ */
|
|
35
|
+
children: [/* @__PURE__ */ f(c, {
|
|
36
36
|
sx: {
|
|
37
37
|
display: "flex",
|
|
38
38
|
alignItems: "center",
|
|
39
39
|
gap: 1.5,
|
|
40
40
|
mb: 1.5
|
|
41
41
|
},
|
|
42
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ d(s, {
|
|
43
43
|
sx: {
|
|
44
44
|
bgcolor: "primary.main",
|
|
45
45
|
width: 40,
|
|
46
46
|
height: 40
|
|
47
47
|
},
|
|
48
48
|
children: e.name.charAt(0).toUpperCase()
|
|
49
|
-
}), /* @__PURE__ */
|
|
49
|
+
}), /* @__PURE__ */ f(c, { children: [/* @__PURE__ */ d(u, {
|
|
50
50
|
variant: "body2",
|
|
51
51
|
sx: { fontWeight: "bold" },
|
|
52
52
|
children: e.name
|
|
53
|
-
}), e.subname && /* @__PURE__ */
|
|
53
|
+
}), e.subname && /* @__PURE__ */ d(u, {
|
|
54
54
|
variant: "caption",
|
|
55
55
|
color: "text.secondary",
|
|
56
56
|
children: e.subname
|
|
57
57
|
})] })]
|
|
58
|
-
}), (e.specialValueA != null || e.specialValueB != null) && /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
e.specialValueA != null && /* @__PURE__ */
|
|
58
|
+
}), (e.specialValueA != null || e.specialValueB != null) && /* @__PURE__ */ f(re, { children: [
|
|
59
|
+
/* @__PURE__ */ d(l, { sx: { mb: 1.5 } }),
|
|
60
|
+
e.specialValueA != null && /* @__PURE__ */ f(c, {
|
|
61
61
|
sx: {
|
|
62
62
|
display: "flex",
|
|
63
63
|
justifyContent: "space-between",
|
|
64
64
|
mb: .5
|
|
65
65
|
},
|
|
66
|
-
children: [/* @__PURE__ */
|
|
66
|
+
children: [/* @__PURE__ */ d(u, {
|
|
67
67
|
variant: "caption",
|
|
68
68
|
color: "text.secondary",
|
|
69
69
|
children: t
|
|
70
|
-
}), /* @__PURE__ */
|
|
70
|
+
}), /* @__PURE__ */ d(u, {
|
|
71
71
|
variant: "caption",
|
|
72
72
|
children: String(e.specialValueA)
|
|
73
73
|
})]
|
|
74
74
|
}),
|
|
75
|
-
e.specialValueB != null && /* @__PURE__ */
|
|
75
|
+
e.specialValueB != null && /* @__PURE__ */ f(c, {
|
|
76
76
|
sx: {
|
|
77
77
|
display: "flex",
|
|
78
78
|
justifyContent: "space-between"
|
|
79
79
|
},
|
|
80
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ d(u, {
|
|
81
81
|
variant: "caption",
|
|
82
82
|
color: "text.secondary",
|
|
83
83
|
children: n
|
|
84
|
-
}), /* @__PURE__ */
|
|
84
|
+
}), /* @__PURE__ */ d(u, {
|
|
85
85
|
variant: "caption",
|
|
86
86
|
children: String(e.specialValueB)
|
|
87
87
|
})]
|
|
@@ -89,33 +89,54 @@ function re({ info: e, labelA: t, labelB: n }) {
|
|
|
89
89
|
] })]
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
let
|
|
92
|
+
function h({ data: s, size: l = 600, autoFit: re = !0, sortBy: h = "name", showLabels: g = !0, showIcons: _ = !0, chartColors: v, rootNodeRadius: y = 22, branchNodeRadius: b = 16, leafNodeRadius: x = 11, linkColor: oe, linkStrokeOpacity: S = 1, linkStrokeWidth: C = 1.5, labelFontSize: se = 12, labelColor: ce, separationSibling: w = 1, separationCousin: le = 2, zoomable: T = !1, drillable: E = !1, onFocusChange: D, duration: O = 750, showNodePopover: k = !1, renderNodePopoverContent: A, onNodeClick: ue, disabled: j = !1, translation: de }) {
|
|
93
|
+
let M = ne(), N = {
|
|
94
94
|
...e,
|
|
95
95
|
...de
|
|
96
96
|
}, fe = [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
],
|
|
97
|
+
M.palette.primary.main,
|
|
98
|
+
M.palette.secondary.main,
|
|
99
|
+
M.palette.info.main,
|
|
100
|
+
M.palette.success.main,
|
|
101
|
+
M.palette.warning.main,
|
|
102
|
+
M.palette.error.main
|
|
103
|
+
], P = v && v.length > 0 ? v : fe, F = t((e) => e.depth === 0 ? y : e.children ? b : x, [
|
|
104
104
|
y,
|
|
105
105
|
b,
|
|
106
106
|
x
|
|
107
|
-
]),
|
|
108
|
-
|
|
109
|
-
let
|
|
110
|
-
let e =
|
|
111
|
-
return
|
|
107
|
+
]), I = t((e) => e.data.colorConfig?.fill ?? P[e.depth % P.length], [P]), [L, R] = o([s]), z = L[L.length - 1], [pe, me] = o(s), [B, V] = o(!1);
|
|
108
|
+
pe !== s && (me(s), R([s]), V(!0));
|
|
109
|
+
let H = Math.max(1, l / 2 - 70), U = i(() => {
|
|
110
|
+
let e = p.hierarchy(z);
|
|
111
|
+
return h === "value" ? (e.sum((e) => e.value ?? 0), e.sort((e, t) => (t.value ?? 0) - (e.value ?? 0))) : e.sort((e, t) => p.ascending(e.data.name, t.data.name)), p.tree().size([2 * Math.PI, H]).separation((e, t) => (e.parent === t.parent ? w : le) * 1.4 / Math.max(1, e.depth))(e);
|
|
112
112
|
}, [
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
]),
|
|
113
|
+
z,
|
|
114
|
+
h,
|
|
115
|
+
H,
|
|
116
|
+
w,
|
|
117
|
+
le
|
|
118
|
+
]), he = U.links(), W = U.descendants(), G = a(U), K = a(null), [q, J] = o(null), [ge, _e] = o(0);
|
|
119
|
+
n(() => {
|
|
120
|
+
let e = G.current;
|
|
121
|
+
if (G.current = U, e === U) return;
|
|
122
|
+
if (K.current != null && (cancelAnimationFrame(K.current), K.current = null), B || O <= 0) {
|
|
123
|
+
V(!1), J(null);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
J(e), _e(1);
|
|
127
|
+
let t = performance.now(), n = (e) => {
|
|
128
|
+
let r = Math.min(1, (e - t) / O);
|
|
129
|
+
_e(1 - p.easeCubic(r)), r < 1 ? K.current = requestAnimationFrame(n) : (K.current = null, J(null));
|
|
130
|
+
};
|
|
131
|
+
return K.current = requestAnimationFrame(n), () => {
|
|
132
|
+
K.current != null && cancelAnimationFrame(K.current);
|
|
133
|
+
};
|
|
134
|
+
}, [
|
|
135
|
+
U,
|
|
136
|
+
O,
|
|
137
|
+
B
|
|
138
|
+
]);
|
|
139
|
+
let Y = i(() => p.linkRadial().angle((e) => e.x).radius((e) => e.y), []), ve = t((e) => ({
|
|
119
140
|
id: e.data.id,
|
|
120
141
|
name: e.data.name,
|
|
121
142
|
subname: e.data.subname ?? null,
|
|
@@ -126,61 +147,61 @@ function g({ data: o, size: c = 600, autoFit: d = !0, sortBy: g = "name", showLa
|
|
|
126
147
|
path: e.ancestors().map((e) => e.data.name).reverse(),
|
|
127
148
|
childrenCount: e.children?.length ?? 0,
|
|
128
149
|
data: e.data
|
|
129
|
-
}), []),
|
|
130
|
-
|
|
131
|
-
let e =
|
|
150
|
+
}), []), ye = a(null), [X, be] = o(`-${l / 2} -${l / 2} ${l} ${l}`), [Z, xe] = o(1);
|
|
151
|
+
r(() => {
|
|
152
|
+
let e = ye.current;
|
|
132
153
|
if (!e) return;
|
|
133
154
|
let t = requestAnimationFrame(() => {
|
|
134
155
|
try {
|
|
135
156
|
let t = e.getBBox();
|
|
136
|
-
|
|
157
|
+
be(`${t.x - 20} ${t.y - 20} ${t.width + 40} ${t.height + 40}`);
|
|
137
158
|
} catch {
|
|
138
|
-
|
|
159
|
+
be(`-${l / 2} -${l / 2} ${l} ${l}`);
|
|
139
160
|
}
|
|
140
161
|
});
|
|
141
162
|
return () => cancelAnimationFrame(t);
|
|
142
163
|
}, [
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
164
|
+
l,
|
|
165
|
+
U,
|
|
166
|
+
g,
|
|
167
|
+
re
|
|
147
168
|
]);
|
|
148
|
-
let
|
|
149
|
-
if (
|
|
150
|
-
let [e, t, n, r] =
|
|
169
|
+
let Se = i(() => {
|
|
170
|
+
if (Z === 1) return X;
|
|
171
|
+
let [e, t, n, r] = X.split(" ").map(Number), i = n / Z, a = r / Z;
|
|
151
172
|
return `${e + (n - i) / 2} ${t + (r - a) / 2} ${i} ${a}`;
|
|
152
|
-
}, [
|
|
153
|
-
if (!
|
|
173
|
+
}, [X, Z]), Ce = t((e) => {
|
|
174
|
+
if (!T || j || !e.ctrlKey) return;
|
|
154
175
|
e.preventDefault();
|
|
155
176
|
let t = e.deltaY < 0 ? 1.15 : 1 / 1.15;
|
|
156
|
-
|
|
157
|
-
}, [
|
|
158
|
-
|
|
159
|
-
if (!
|
|
177
|
+
xe((e) => Math.max(.25, Math.min(8, e * t)));
|
|
178
|
+
}, [T, j]);
|
|
179
|
+
r(() => {
|
|
180
|
+
if (!T && !E) return;
|
|
160
181
|
let e = (e) => {
|
|
161
|
-
e.key === "Escape" && (
|
|
182
|
+
e.key === "Escape" && (T && xe(1), E && (R([s]), D?.(null)));
|
|
162
183
|
};
|
|
163
184
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
164
185
|
}, [
|
|
165
|
-
w,
|
|
166
186
|
T,
|
|
167
|
-
|
|
168
|
-
|
|
187
|
+
E,
|
|
188
|
+
s,
|
|
189
|
+
D
|
|
169
190
|
]);
|
|
170
|
-
let
|
|
171
|
-
|
|
172
|
-
e(),
|
|
191
|
+
let Q = a(null), we = (e) => {
|
|
192
|
+
Q.current &&= (clearTimeout(Q.current), null), Q.current = setTimeout(() => {
|
|
193
|
+
e(), Q.current = null;
|
|
173
194
|
}, 250);
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
}, [
|
|
195
|
+
}, Te = () => {
|
|
196
|
+
Q.current &&= (clearTimeout(Q.current), null);
|
|
197
|
+
}, [Ee, De] = o(null), Oe = a(null), ke = a(null), [Ae, je] = o(!1), [Me, Ne] = o(null), [Pe, Fe] = o({
|
|
177
198
|
left: 0,
|
|
178
199
|
top: 0
|
|
179
|
-
}), [
|
|
180
|
-
|
|
200
|
+
}), [$, Ie] = o(null), Le = t(() => {
|
|
201
|
+
R((e) => {
|
|
181
202
|
if (e.length <= 1) return e;
|
|
182
203
|
let t = e.slice(0, -1);
|
|
183
|
-
return
|
|
204
|
+
return D?.(t.length <= 1 ? null : {
|
|
184
205
|
id: t[t.length - 1].id,
|
|
185
206
|
name: t[t.length - 1].name,
|
|
186
207
|
subname: t[t.length - 1].subname ?? null,
|
|
@@ -193,39 +214,39 @@ function g({ data: o, size: c = 600, autoFit: d = !0, sortBy: g = "name", showLa
|
|
|
193
214
|
data: t[t.length - 1]
|
|
194
215
|
}), t;
|
|
195
216
|
});
|
|
196
|
-
}, [
|
|
197
|
-
|
|
198
|
-
},
|
|
199
|
-
if (
|
|
200
|
-
let t =
|
|
217
|
+
}, [D]), Re = (e) => {
|
|
218
|
+
j || !E || (e.ctrlKey || e.metaKey) && (Te(), Le());
|
|
219
|
+
}, ze = (e) => {
|
|
220
|
+
if (j) return;
|
|
221
|
+
let t = W[Number(e.currentTarget.getAttribute("data-idx"))];
|
|
201
222
|
if (!t) return;
|
|
202
|
-
let n =
|
|
203
|
-
if ((e.ctrlKey || e.metaKey) &&
|
|
204
|
-
|
|
205
|
-
|
|
223
|
+
let n = ve(t);
|
|
224
|
+
if ((e.ctrlKey || e.metaKey) && E && t.children) {
|
|
225
|
+
we(() => {
|
|
226
|
+
R((e) => [...e, t.data]), D?.(n);
|
|
206
227
|
});
|
|
207
228
|
return;
|
|
208
229
|
}
|
|
209
|
-
if (
|
|
210
|
-
let t =
|
|
211
|
-
|
|
230
|
+
if (k) {
|
|
231
|
+
let t = Oe.current?.getBoundingClientRect();
|
|
232
|
+
Fe({
|
|
212
233
|
left: t ? e.clientX - t.left : e.clientX,
|
|
213
234
|
top: t ? e.clientY - t.top : e.clientY
|
|
214
|
-
}),
|
|
235
|
+
}), Ne(ke.current), Ie(n), je(!0);
|
|
215
236
|
}
|
|
216
237
|
ue?.(n, e);
|
|
217
|
-
},
|
|
218
|
-
return /* @__PURE__ */
|
|
219
|
-
ref:
|
|
238
|
+
}, Be = ce || M.palette.text.primary, Ve = oe || M.palette.text.secondary, He = M.palette.background.paper, Ue = M.typography.fontFamily;
|
|
239
|
+
return /* @__PURE__ */ f(c, {
|
|
240
|
+
ref: Oe,
|
|
220
241
|
sx: {
|
|
221
242
|
display: "inline-flex",
|
|
222
243
|
position: "relative",
|
|
223
|
-
opacity:
|
|
224
|
-
cursor:
|
|
244
|
+
opacity: j ? .5 : 1,
|
|
245
|
+
cursor: j ? "not-allowed" : "default",
|
|
225
246
|
userSelect: "none"
|
|
226
247
|
},
|
|
227
248
|
children: [
|
|
228
|
-
|
|
249
|
+
E && L.length > 1 && /* @__PURE__ */ d(c, {
|
|
229
250
|
sx: {
|
|
230
251
|
position: "absolute",
|
|
231
252
|
top: 4,
|
|
@@ -237,7 +258,7 @@ function g({ data: o, size: c = 600, autoFit: d = !0, sortBy: g = "name", showLa
|
|
|
237
258
|
pointerEvents: "none",
|
|
238
259
|
zIndex: 1
|
|
239
260
|
},
|
|
240
|
-
children: /* @__PURE__ */
|
|
261
|
+
children: /* @__PURE__ */ d(u, {
|
|
241
262
|
variant: "caption",
|
|
242
263
|
sx: {
|
|
243
264
|
bgcolor: "action.hover",
|
|
@@ -247,50 +268,50 @@ function g({ data: o, size: c = 600, autoFit: d = !0, sortBy: g = "name", showLa
|
|
|
247
268
|
color: "text.secondary",
|
|
248
269
|
fontSize: "0.7rem"
|
|
249
270
|
},
|
|
250
|
-
children:
|
|
271
|
+
children: L.map((e) => e.name).join(" › ")
|
|
251
272
|
})
|
|
252
273
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
-
ref:
|
|
274
|
+
/* @__PURE__ */ d(c, {
|
|
275
|
+
ref: ke,
|
|
255
276
|
sx: {
|
|
256
277
|
position: "absolute",
|
|
257
|
-
left:
|
|
258
|
-
top:
|
|
278
|
+
left: Pe.left,
|
|
279
|
+
top: Pe.top,
|
|
259
280
|
width: 0,
|
|
260
281
|
height: 0
|
|
261
282
|
}
|
|
262
283
|
}),
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
-
width:
|
|
265
|
-
height:
|
|
266
|
-
viewBox:
|
|
267
|
-
onWheel:
|
|
284
|
+
/* @__PURE__ */ d("svg", {
|
|
285
|
+
width: l,
|
|
286
|
+
height: l,
|
|
287
|
+
viewBox: Se,
|
|
288
|
+
onWheel: Ce,
|
|
268
289
|
style: {
|
|
269
|
-
fontFamily:
|
|
270
|
-
overflow:
|
|
290
|
+
fontFamily: Ue ?? "sans-serif",
|
|
291
|
+
overflow: T && Z > 1 ? "hidden" : "visible"
|
|
271
292
|
},
|
|
272
293
|
role: "img",
|
|
273
|
-
"aria-label":
|
|
274
|
-
children: /* @__PURE__ */
|
|
275
|
-
ref:
|
|
294
|
+
"aria-label": s.name,
|
|
295
|
+
children: /* @__PURE__ */ f("g", {
|
|
296
|
+
ref: ye,
|
|
276
297
|
children: [
|
|
277
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ d("g", {
|
|
278
299
|
fill: "none",
|
|
279
|
-
stroke:
|
|
280
|
-
strokeOpacity:
|
|
281
|
-
strokeWidth:
|
|
282
|
-
children:
|
|
300
|
+
stroke: Ve,
|
|
301
|
+
strokeOpacity: S,
|
|
302
|
+
strokeWidth: C,
|
|
303
|
+
children: he.map((e, t) => /* @__PURE__ */ d("path", { d: Y(e) }, `link-${t}`))
|
|
283
304
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
let n =
|
|
286
|
-
return /* @__PURE__ */
|
|
287
|
-
title: /* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ d("g", { children: W.map((e, t) => {
|
|
306
|
+
let n = F(e), r = I(e), i = ve(e), a = Ee === t, o = e.children ? m.folder : m.person, s = Math.round(n * 1.3);
|
|
307
|
+
return /* @__PURE__ */ d(te, {
|
|
308
|
+
title: /* @__PURE__ */ f(c, {
|
|
288
309
|
sx: {
|
|
289
310
|
py: .5,
|
|
290
311
|
minWidth: 160
|
|
291
312
|
},
|
|
292
313
|
children: [
|
|
293
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ d(u, {
|
|
294
315
|
variant: "caption",
|
|
295
316
|
sx: {
|
|
296
317
|
fontWeight: "bold",
|
|
@@ -299,7 +320,7 @@ function g({ data: o, size: c = 600, autoFit: d = !0, sortBy: g = "name", showLa
|
|
|
299
320
|
},
|
|
300
321
|
children: e.data.name
|
|
301
322
|
}),
|
|
302
|
-
e.data.subname && /* @__PURE__ */
|
|
323
|
+
e.data.subname && /* @__PURE__ */ d(u, {
|
|
303
324
|
variant: "caption",
|
|
304
325
|
sx: {
|
|
305
326
|
display: "block",
|
|
@@ -307,54 +328,54 @@ function g({ data: o, size: c = 600, autoFit: d = !0, sortBy: g = "name", showLa
|
|
|
307
328
|
},
|
|
308
329
|
children: e.data.subname
|
|
309
330
|
}),
|
|
310
|
-
(i.specialValueA != null || i.specialValueB != null || e.children) && /* @__PURE__ */
|
|
331
|
+
(i.specialValueA != null || i.specialValueB != null || e.children) && /* @__PURE__ */ f(c, {
|
|
311
332
|
sx: {
|
|
312
333
|
mt: .75,
|
|
313
334
|
borderTop: "1px solid rgba(255,255,255,0.2)",
|
|
314
335
|
pt: .75
|
|
315
336
|
},
|
|
316
337
|
children: [
|
|
317
|
-
i.specialValueA != null && /* @__PURE__ */
|
|
338
|
+
i.specialValueA != null && /* @__PURE__ */ f(c, {
|
|
318
339
|
sx: {
|
|
319
340
|
display: "flex",
|
|
320
341
|
justifyContent: "space-between",
|
|
321
342
|
gap: 2
|
|
322
343
|
},
|
|
323
|
-
children: [/* @__PURE__ */
|
|
344
|
+
children: [/* @__PURE__ */ d(u, {
|
|
324
345
|
variant: "caption",
|
|
325
346
|
sx: { opacity: .6 },
|
|
326
|
-
children:
|
|
327
|
-
}), /* @__PURE__ */
|
|
347
|
+
children: N.specialValueA ?? "A"
|
|
348
|
+
}), /* @__PURE__ */ d(u, {
|
|
328
349
|
variant: "caption",
|
|
329
350
|
children: String(i.specialValueA)
|
|
330
351
|
})]
|
|
331
352
|
}),
|
|
332
|
-
i.specialValueB != null && /* @__PURE__ */
|
|
353
|
+
i.specialValueB != null && /* @__PURE__ */ f(c, {
|
|
333
354
|
sx: {
|
|
334
355
|
display: "flex",
|
|
335
356
|
justifyContent: "space-between",
|
|
336
357
|
gap: 2
|
|
337
358
|
},
|
|
338
|
-
children: [/* @__PURE__ */
|
|
359
|
+
children: [/* @__PURE__ */ d(u, {
|
|
339
360
|
variant: "caption",
|
|
340
361
|
sx: { opacity: .6 },
|
|
341
|
-
children:
|
|
342
|
-
}), /* @__PURE__ */
|
|
362
|
+
children: N.specialValueB ?? "B"
|
|
363
|
+
}), /* @__PURE__ */ d(u, {
|
|
343
364
|
variant: "caption",
|
|
344
365
|
children: String(i.specialValueB)
|
|
345
366
|
})]
|
|
346
367
|
}),
|
|
347
|
-
e.children && /* @__PURE__ */
|
|
368
|
+
e.children && /* @__PURE__ */ f(c, {
|
|
348
369
|
sx: {
|
|
349
370
|
display: "flex",
|
|
350
371
|
justifyContent: "space-between",
|
|
351
372
|
gap: 2
|
|
352
373
|
},
|
|
353
|
-
children: [/* @__PURE__ */
|
|
374
|
+
children: [/* @__PURE__ */ d(u, {
|
|
354
375
|
variant: "caption",
|
|
355
376
|
sx: { opacity: .6 },
|
|
356
377
|
children: "Reports"
|
|
357
|
-
}), /* @__PURE__ */
|
|
378
|
+
}), /* @__PURE__ */ d(u, {
|
|
358
379
|
variant: "caption",
|
|
359
380
|
children: e.children.length
|
|
360
381
|
})]
|
|
@@ -366,52 +387,81 @@ function g({ data: o, size: c = 600, autoFit: d = !0, sortBy: g = "name", showLa
|
|
|
366
387
|
followCursor: !0,
|
|
367
388
|
enterDelay: 50,
|
|
368
389
|
enterNextDelay: 0,
|
|
369
|
-
disableHoverListener:
|
|
390
|
+
disableHoverListener: j,
|
|
370
391
|
slotProps: { tooltip: { sx: { maxWidth: 260 } } },
|
|
371
|
-
children: /* @__PURE__ */
|
|
392
|
+
children: /* @__PURE__ */ f("g", {
|
|
372
393
|
"data-idx": t,
|
|
373
394
|
transform: `rotate(${e.x * 180 / Math.PI - 90}) translate(${e.y},0)`,
|
|
374
|
-
onClick:
|
|
375
|
-
onDoubleClick:
|
|
376
|
-
onMouseEnter: () => !
|
|
377
|
-
onMouseLeave: () =>
|
|
378
|
-
style: { cursor:
|
|
395
|
+
onClick: ze,
|
|
396
|
+
onDoubleClick: Re,
|
|
397
|
+
onMouseEnter: () => !j && De(t),
|
|
398
|
+
onMouseLeave: () => De(null),
|
|
399
|
+
style: { cursor: j ? "not-allowed" : "pointer" },
|
|
379
400
|
children: [
|
|
380
|
-
/* @__PURE__ */
|
|
401
|
+
/* @__PURE__ */ d("circle", {
|
|
381
402
|
r: Math.max(n + 8, 24),
|
|
382
403
|
fill: "transparent"
|
|
383
404
|
}),
|
|
384
|
-
/* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ d("circle", {
|
|
385
406
|
r: n + 2,
|
|
386
407
|
fill: r,
|
|
387
408
|
fillOpacity: .15
|
|
388
409
|
}),
|
|
389
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ d("circle", {
|
|
390
411
|
r: n,
|
|
391
412
|
fill: r,
|
|
392
413
|
fillOpacity: a ? .85 : 1,
|
|
393
414
|
style: { transition: "fill-opacity 0.15s" }
|
|
394
415
|
}),
|
|
395
|
-
|
|
416
|
+
_ && /* @__PURE__ */ d(ie, {
|
|
396
417
|
path: o,
|
|
397
|
-
size:
|
|
418
|
+
size: s
|
|
398
419
|
})
|
|
399
420
|
]
|
|
400
421
|
})
|
|
401
422
|
}, `node-${e.data.id}-${t}`);
|
|
402
423
|
}) }),
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
424
|
+
q && ((e, t) => /* @__PURE__ */ f("g", {
|
|
425
|
+
"data-testid": "drill-ghost-layer",
|
|
426
|
+
opacity: t,
|
|
427
|
+
pointerEvents: "none",
|
|
428
|
+
children: [/* @__PURE__ */ d("g", {
|
|
429
|
+
fill: "none",
|
|
430
|
+
stroke: Ve,
|
|
431
|
+
strokeOpacity: S,
|
|
432
|
+
strokeWidth: C,
|
|
433
|
+
children: e.links().map((e, t) => /* @__PURE__ */ d("path", { d: Y(e) }, `ghost-link-${t}`))
|
|
434
|
+
}), /* @__PURE__ */ d("g", { children: e.descendants().map((e, t) => /* @__PURE__ */ f("g", {
|
|
435
|
+
transform: `rotate(${e.x * 180 / Math.PI - 90}) translate(${e.y},0)`,
|
|
436
|
+
children: [
|
|
437
|
+
/* @__PURE__ */ d("circle", {
|
|
438
|
+
r: F(e) + 2,
|
|
439
|
+
fill: I(e),
|
|
440
|
+
fillOpacity: .15
|
|
441
|
+
}),
|
|
442
|
+
/* @__PURE__ */ d("circle", {
|
|
443
|
+
r: F(e),
|
|
444
|
+
fill: I(e)
|
|
445
|
+
}),
|
|
446
|
+
_ && /* @__PURE__ */ d(ie, {
|
|
447
|
+
path: e.children ? m.folder : m.person,
|
|
448
|
+
size: Math.round(F(e) * 1.3)
|
|
449
|
+
})
|
|
450
|
+
]
|
|
451
|
+
}, `ghost-node-${t}`)) })]
|
|
452
|
+
}))(q, ge),
|
|
453
|
+
g && /* @__PURE__ */ d("g", { children: W.map((e, t) => {
|
|
454
|
+
let n = F(e), r = e.x < Math.PI == !e.children, i = n + 6, a = r ? i : -i, o = r ? "start" : "end";
|
|
455
|
+
return /* @__PURE__ */ d("text", {
|
|
406
456
|
transform: `rotate(${e.x * 180 / Math.PI - 90}) translate(${e.y},0) rotate(${e.x >= Math.PI ? 180 : 0})`,
|
|
407
457
|
dy: "0.35em",
|
|
408
458
|
x: a,
|
|
409
459
|
textAnchor: o,
|
|
410
460
|
paintOrder: "stroke",
|
|
411
|
-
stroke:
|
|
461
|
+
stroke: He,
|
|
412
462
|
strokeWidth: 3,
|
|
413
|
-
fill:
|
|
414
|
-
fontSize:
|
|
463
|
+
fill: Be,
|
|
464
|
+
fontSize: se,
|
|
415
465
|
fontWeight: e.depth === 0 ? "bold" : "normal",
|
|
416
466
|
pointerEvents: "none",
|
|
417
467
|
children: e.data.name
|
|
@@ -420,10 +470,10 @@ function g({ data: o, size: c = 600, autoFit: d = !0, sortBy: g = "name", showLa
|
|
|
420
470
|
]
|
|
421
471
|
})
|
|
422
472
|
}),
|
|
423
|
-
|
|
424
|
-
open:
|
|
425
|
-
anchorEl:
|
|
426
|
-
onClose: () =>
|
|
473
|
+
k && /* @__PURE__ */ d(ee, {
|
|
474
|
+
open: Ae,
|
|
475
|
+
anchorEl: Me,
|
|
476
|
+
onClose: () => je(!1),
|
|
427
477
|
anchorOrigin: {
|
|
428
478
|
vertical: "top",
|
|
429
479
|
horizontal: "right"
|
|
@@ -433,15 +483,15 @@ function g({ data: o, size: c = 600, autoFit: d = !0, sortBy: g = "name", showLa
|
|
|
433
483
|
horizontal: "left"
|
|
434
484
|
},
|
|
435
485
|
slotProps: { paper: { elevation: 4 } },
|
|
436
|
-
children:
|
|
437
|
-
info:
|
|
438
|
-
labelA:
|
|
439
|
-
labelB:
|
|
486
|
+
children: $ && (A ? A($) : /* @__PURE__ */ d(ae, {
|
|
487
|
+
info: $,
|
|
488
|
+
labelA: N.specialValueA ?? "Value A",
|
|
489
|
+
labelB: N.specialValueB ?? "Value B"
|
|
440
490
|
}))
|
|
441
491
|
})
|
|
442
492
|
]
|
|
443
493
|
});
|
|
444
494
|
}
|
|
445
|
-
|
|
495
|
+
h.displayName = "RadialTreeChart";
|
|
446
496
|
//#endregion
|
|
447
|
-
export {
|
|
497
|
+
export { h as RadialTreeChart };
|