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