@thebuoyant-tsdev/mui-ts-library 3.26.0 → 3.27.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 +22 -0
- package/README.md +22 -0
- package/dist/components/chord-chart/ChordChart.d.ts +1 -1
- package/dist/components/chord-chart/ChordChart.js +138 -128
- package/dist/components/chord-chart/ChordChart.types.d.ts +4 -0
- package/dist/components/circle-packing-chart/CirclePackingChart.d.ts +1 -1
- package/dist/components/circle-packing-chart/CirclePackingChart.js +142 -142
- package/dist/components/circle-packing-chart/CirclePackingChart.types.d.ts +2 -0
- package/dist/components/gantt-chart/GanttChart.js +29 -29
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.d.ts +1 -1
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +131 -125
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.types.d.ts +2 -0
- package/dist/components/radial-stacked-bar-chart/RadialStackedBarChart.d.ts +1 -1
- package/dist/components/radial-stacked-bar-chart/RadialStackedBarChart.js +60 -50
- package/dist/components/radial-stacked-bar-chart/RadialStackedBarChart.types.d.ts +2 -0
- package/dist/components/radial-tree-chart/RadialTreeChart.d.ts +1 -1
- package/dist/components/radial-tree-chart/RadialTreeChart.js +115 -111
- 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 +120 -106
- package/dist/components/sunburst-chart/SunburstChart.types.d.ts +2 -0
- package/dist/index.cjs +2 -2
- package/package.json +1 -1
|
@@ -5,61 +5,61 @@ import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
|
5
5
|
import * as p from "d3";
|
|
6
6
|
//#region src/components/circle-packing-chart/CirclePackingChart.tsx
|
|
7
7
|
var m = .56;
|
|
8
|
-
function
|
|
8
|
+
function ee(e, t, n) {
|
|
9
9
|
return e.length * n * m <= t ? e : t >= 3 * n * m + n * 2 ? "…" : "";
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
let
|
|
11
|
+
function h({ data: m, size: h = 600, padding: g = 3, sortBy: _ = "value", showLabels: v = !0, showAllLabels: y = !1, labelFontSize: te = 13, innerLabelFontSize: b = 9, labelColor: ne, chartColors: x, depthColorStart: S, depthColorEnd: C, background: re, duration: w = 750, zoomable: T = !1, disabled: E = !1, onCircleClick: ie, onCircleHover: D, onZoomChange: O, valueFormatter: k, translation: ae }) {
|
|
12
|
+
let A = u(), oe = {
|
|
13
13
|
...e,
|
|
14
|
-
...
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
],
|
|
14
|
+
...ae
|
|
15
|
+
}, se = !m.children?.length && !m.value, ce = [
|
|
16
|
+
A.palette.primary.main,
|
|
17
|
+
A.palette.secondary.main,
|
|
18
|
+
A.palette.error.main,
|
|
19
|
+
A.palette.warning.main,
|
|
20
|
+
A.palette.success.main,
|
|
21
|
+
A.palette.info.main
|
|
22
|
+
], j = ne || A.palette.text.primary, M = re || A.palette.background.default, le = A.typography.fontFamily, N = i(() => {
|
|
23
23
|
let e = p.hierarchy(m).sum((e) => e.value ?? 0);
|
|
24
|
-
return
|
|
24
|
+
return _ === "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, {
|
|
25
25
|
numeric: !0,
|
|
26
26
|
sensitivity: "base"
|
|
27
|
-
})), p.pack().size([
|
|
27
|
+
})), p.pack().size([h, h]).padding(g)(e);
|
|
28
28
|
}, [
|
|
29
29
|
m,
|
|
30
|
+
h,
|
|
30
31
|
g,
|
|
31
|
-
_
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
_
|
|
33
|
+
]), P = N.descendants(), F = i(() => p.max(P, (e) => e.depth) ?? 0, [P]), I = !!(S && C), L = i(() => I ? p.scaleSequential(p.interpolateHcl(S, C)).domain([0, Math.max(1, F)]) : null, [
|
|
34
|
+
I,
|
|
35
|
+
S,
|
|
35
36
|
C,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (!D || O || !e.ctrlKey) return;
|
|
37
|
+
F
|
|
38
|
+
]), R = x && x.length > 0 ? x : ce, ue = t((e) => e.data.colorConfig?.fill ? e.data.colorConfig.fill : I && L ? e.children ? L(e.depth) : A.palette.background.paper : R[e.depth % R.length], [
|
|
39
|
+
I,
|
|
40
|
+
L,
|
|
41
|
+
R,
|
|
42
|
+
A
|
|
43
|
+
]), [z, B] = o(1), V = t((e) => {
|
|
44
|
+
if (!T || E || !e.ctrlKey) return;
|
|
45
45
|
e.preventDefault();
|
|
46
46
|
let t = e.deltaY < 0 ? 1.15 : 1 / 1.15;
|
|
47
|
-
|
|
48
|
-
}, [
|
|
47
|
+
B((e) => Math.max(.25, Math.min(8, e * t)));
|
|
48
|
+
}, [T, E]);
|
|
49
49
|
r(() => {
|
|
50
|
-
if (!
|
|
50
|
+
if (!T) return;
|
|
51
51
|
let e = (e) => {
|
|
52
|
-
e.key === "Escape" &&
|
|
52
|
+
e.key === "Escape" && B(1);
|
|
53
53
|
};
|
|
54
54
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
55
|
-
}, [
|
|
56
|
-
let
|
|
57
|
-
let e = `${-
|
|
58
|
-
if (
|
|
59
|
-
let t =
|
|
60
|
-
return `${-
|
|
61
|
-
}, [
|
|
62
|
-
let t = e.value ?? 0, n =
|
|
55
|
+
}, [T]);
|
|
56
|
+
let H = i(() => {
|
|
57
|
+
let e = `${-h / 2} ${-h / 2} ${h} ${h}`;
|
|
58
|
+
if (z === 1) return e;
|
|
59
|
+
let t = h / z, n = (h - t) / 2;
|
|
60
|
+
return `${-h / 2 + n} ${-h / 2 + n} ${t} ${t}`;
|
|
61
|
+
}, [h, z]), de = t((e) => {
|
|
62
|
+
let t = e.value ?? 0, n = N.value ?? 0;
|
|
63
63
|
return {
|
|
64
64
|
id: e.data.id ?? null,
|
|
65
65
|
name: e.data.name,
|
|
@@ -70,95 +70,95 @@ function g({ data: m, size: g = 600, padding: _ = 3, sortBy: v = "value", showLa
|
|
|
70
70
|
childrenCount: e.children?.length ?? 0,
|
|
71
71
|
data: e.data
|
|
72
72
|
};
|
|
73
|
-
}, [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
]),
|
|
78
|
-
|
|
79
|
-
}, []), [
|
|
80
|
-
|
|
73
|
+
}, [N]), U = a(null), W = a([
|
|
74
|
+
N.x,
|
|
75
|
+
N.y,
|
|
76
|
+
N.r * 2
|
|
77
|
+
]), G = a(N), [K, fe] = o(N), q = t((e) => {
|
|
78
|
+
G.current = e, fe(e);
|
|
79
|
+
}, []), [pe, J] = o(N);
|
|
80
|
+
pe !== N && (J(N), q(N), G.current = N);
|
|
81
81
|
let Y = t((e) => {
|
|
82
|
-
let t =
|
|
82
|
+
let t = U.current;
|
|
83
83
|
if (!t) return;
|
|
84
|
-
|
|
85
|
-
let n =
|
|
86
|
-
for (let t = 0; t <
|
|
87
|
-
let r =
|
|
84
|
+
W.current = e;
|
|
85
|
+
let n = h / e[2], r = G.current, i = t.querySelectorAll("g[data-role='nodes'] > g"), a = t.querySelectorAll("g[data-role='nodes'] > g > circle");
|
|
86
|
+
for (let t = 0; t < P.length; t++) {
|
|
87
|
+
let r = P[t], o = i[t];
|
|
88
88
|
o && o.setAttribute("transform", `translate(${(r.x - e[0]) * n},${(r.y - e[1]) * n})`);
|
|
89
89
|
let s = t - 1;
|
|
90
90
|
s >= 0 && a[s] && a[s].setAttribute("r", String(r.r * n));
|
|
91
91
|
}
|
|
92
|
-
if (
|
|
92
|
+
if (v) {
|
|
93
93
|
let r = t.querySelectorAll("g[data-role='labels'] > text");
|
|
94
|
-
for (let t = 0; t <
|
|
95
|
-
let i =
|
|
94
|
+
for (let t = 0; t < P.length; t++) {
|
|
95
|
+
let i = P[t], a = r[t];
|
|
96
96
|
a && (a.setAttribute("transform", `translate(${(i.x - e[0]) * n},${(i.y - e[1]) * n})`), a.setAttribute("font-weight", i.children ? "bold" : "normal"));
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
if (
|
|
99
|
+
if (y) {
|
|
100
100
|
let i = t.querySelectorAll("g[data-role='inner-labels'] > text");
|
|
101
|
-
for (let t = 0; t <
|
|
102
|
-
let a =
|
|
101
|
+
for (let t = 0; t < P.length; t++) {
|
|
102
|
+
let a = P[t], o = i[t];
|
|
103
103
|
if (!o) continue;
|
|
104
|
-
let s = a.r * n, c = s * 1.6, l = r ===
|
|
104
|
+
let s = a.r * n, c = s * 1.6, l = r === N ? a !== N : a.ancestors().includes(r), u = a.parent === r;
|
|
105
105
|
if (l && !u && s >= 14) {
|
|
106
|
-
let t =
|
|
106
|
+
let t = ee(a.data.name, c, b);
|
|
107
107
|
t ? (o.textContent = t, o.setAttribute("transform", `translate(${(a.x - e[0]) * n},${(a.y - e[1]) * n})`), o.setAttribute("font-weight", a.children ? "bold" : "normal"), o.style.display = "inline") : o.style.display = "none";
|
|
108
108
|
} else o.style.display = "none";
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
}, [
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
P,
|
|
113
|
+
h,
|
|
114
|
+
v,
|
|
114
115
|
y,
|
|
115
116
|
b,
|
|
116
|
-
|
|
117
|
-
I
|
|
117
|
+
N
|
|
118
118
|
]);
|
|
119
119
|
r(() => {
|
|
120
120
|
Y([
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
K.x,
|
|
122
|
+
K.y,
|
|
123
|
+
K.r * 2
|
|
124
124
|
]);
|
|
125
125
|
}, [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
N,
|
|
127
|
+
h,
|
|
128
|
+
K,
|
|
129
129
|
Y
|
|
130
130
|
]);
|
|
131
131
|
let X = t((e, t) => {
|
|
132
|
-
let n =
|
|
132
|
+
let n = U.current;
|
|
133
133
|
if (!n) return;
|
|
134
|
-
let r =
|
|
134
|
+
let r = K, i = W.current, a = [
|
|
135
135
|
e.x,
|
|
136
136
|
e.y,
|
|
137
137
|
e.r * 2
|
|
138
138
|
];
|
|
139
|
-
|
|
139
|
+
q(e), p.select(n).transition().duration(t).ease(p.easeCubic).tween("zoom", () => {
|
|
140
140
|
let e = p.interpolateZoom(i, a);
|
|
141
141
|
return (t) => Y(e(t));
|
|
142
142
|
});
|
|
143
143
|
let o = n.querySelectorAll("g[data-role='labels'] > text");
|
|
144
|
-
p.selectAll(o).transition().duration(t).ease(p.easeCubic).style("fill-opacity", (t, n) => +(
|
|
145
|
-
|
|
144
|
+
p.selectAll(o).transition().duration(t).ease(p.easeCubic).style("fill-opacity", (t, n) => +(P[n].parent === e)).on("start", function(t, n) {
|
|
145
|
+
P[n].parent === e && (this.style.display = "inline");
|
|
146
146
|
}).on("end", function(t, n) {
|
|
147
|
-
|
|
148
|
-
}),
|
|
147
|
+
P[n].parent !== e && (this.style.display = "none");
|
|
148
|
+
}), O?.({
|
|
149
149
|
previousName: r.data.name,
|
|
150
150
|
currentName: e.data.name,
|
|
151
151
|
currentDepth: e.depth,
|
|
152
|
-
isRoot: e ===
|
|
152
|
+
isRoot: e === N
|
|
153
153
|
});
|
|
154
154
|
}, [
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
K,
|
|
156
|
+
P,
|
|
157
|
+
N,
|
|
158
158
|
Y,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
]), Z = a(null),
|
|
159
|
+
O,
|
|
160
|
+
q
|
|
161
|
+
]), Z = a(null), me = (e) => {
|
|
162
162
|
Z.current &&= (clearTimeout(Z.current), null), Z.current = setTimeout(() => {
|
|
163
163
|
e(), Z.current = null;
|
|
164
164
|
}, 250);
|
|
@@ -168,63 +168,63 @@ function g({ data: m, size: g = 600, padding: _ = 3, sortBy: v = "value", showLa
|
|
|
168
168
|
n(() => {
|
|
169
169
|
$.current = X;
|
|
170
170
|
}, [X]), r(() => {
|
|
171
|
-
if (
|
|
171
|
+
if (E) return;
|
|
172
172
|
let e = (e) => {
|
|
173
|
-
e.key === "Escape" && (Q(), $.current(
|
|
173
|
+
e.key === "Escape" && (Q(), $.current(N, w));
|
|
174
174
|
};
|
|
175
175
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
176
176
|
}, [
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
E,
|
|
178
|
+
N,
|
|
179
|
+
w
|
|
180
180
|
]);
|
|
181
|
-
let
|
|
182
|
-
if (
|
|
181
|
+
let he = (e) => {
|
|
182
|
+
if (E || !(e.ctrlKey || e.metaKey)) return;
|
|
183
183
|
Q(), e.preventDefault();
|
|
184
|
-
let t =
|
|
185
|
-
t !==
|
|
186
|
-
},
|
|
184
|
+
let t = K.parent ?? N;
|
|
185
|
+
t !== K && X(t, e.altKey ? Math.max(250, w * 10) : w);
|
|
186
|
+
}, ge = {
|
|
187
187
|
followCursor: !0,
|
|
188
188
|
enterDelay: 50,
|
|
189
189
|
enterNextDelay: 0,
|
|
190
|
-
disableHoverListener:
|
|
190
|
+
disableHoverListener: E,
|
|
191
191
|
slotProps: { tooltip: { sx: { maxWidth: 220 } } }
|
|
192
192
|
};
|
|
193
193
|
return /* @__PURE__ */ f(s, {
|
|
194
194
|
sx: {
|
|
195
195
|
display: "inline-flex",
|
|
196
196
|
position: "relative",
|
|
197
|
-
opacity:
|
|
198
|
-
cursor:
|
|
197
|
+
opacity: E ? .5 : 1,
|
|
198
|
+
cursor: E ? "not-allowed" : "default",
|
|
199
199
|
userSelect: "none"
|
|
200
200
|
},
|
|
201
201
|
children: [/* @__PURE__ */ f("svg", {
|
|
202
|
-
ref:
|
|
203
|
-
width:
|
|
204
|
-
height:
|
|
205
|
-
viewBox:
|
|
206
|
-
onWheel:
|
|
202
|
+
ref: U,
|
|
203
|
+
width: h,
|
|
204
|
+
height: h,
|
|
205
|
+
viewBox: H,
|
|
206
|
+
onWheel: V,
|
|
207
207
|
style: {
|
|
208
208
|
display: "block",
|
|
209
|
-
background:
|
|
210
|
-
fontFamily:
|
|
211
|
-
overflow:
|
|
209
|
+
background: M,
|
|
210
|
+
fontFamily: le ?? "sans-serif",
|
|
211
|
+
overflow: T && z > 1 ? "hidden" : "visible"
|
|
212
212
|
},
|
|
213
213
|
role: "img",
|
|
214
214
|
"aria-label": m.name,
|
|
215
|
-
onDoubleClick:
|
|
215
|
+
onDoubleClick: he,
|
|
216
216
|
children: [
|
|
217
|
-
|
|
217
|
+
se && /* @__PURE__ */ d("text", {
|
|
218
218
|
textAnchor: "middle",
|
|
219
219
|
dy: "0.35em",
|
|
220
220
|
fontSize: 13,
|
|
221
|
-
fill:
|
|
222
|
-
children:
|
|
221
|
+
fill: A.palette.text.secondary,
|
|
222
|
+
children: oe.noData
|
|
223
223
|
}),
|
|
224
224
|
/* @__PURE__ */ d("g", {
|
|
225
225
|
"data-role": "nodes",
|
|
226
|
-
children:
|
|
227
|
-
let n =
|
|
226
|
+
children: P.map((e, t) => {
|
|
227
|
+
let n = de(e), r = /* @__PURE__ */ f(s, {
|
|
228
228
|
sx: {
|
|
229
229
|
py: .5,
|
|
230
230
|
minWidth: 160
|
|
@@ -256,7 +256,7 @@ function g({ data: m, size: g = 600, padding: _ = 3, sortBy: v = "value", showLa
|
|
|
256
256
|
children: "Value"
|
|
257
257
|
}), /* @__PURE__ */ d(l, {
|
|
258
258
|
variant: "caption",
|
|
259
|
-
children:
|
|
259
|
+
children: k ? k(e.value ?? 0) : (e.value ?? 0).toLocaleString()
|
|
260
260
|
})]
|
|
261
261
|
}),
|
|
262
262
|
/* @__PURE__ */ f(s, {
|
|
@@ -293,42 +293,42 @@ function g({ data: m, size: g = 600, padding: _ = 3, sortBy: v = "value", showLa
|
|
|
293
293
|
})]
|
|
294
294
|
});
|
|
295
295
|
return /* @__PURE__ */ d("g", {
|
|
296
|
-
transform: `translate(${e.x -
|
|
296
|
+
transform: `translate(${e.x - h / 2},${e.y - h / 2})`,
|
|
297
297
|
children: t === 0 ? null : /* @__PURE__ */ d(c, {
|
|
298
|
-
...
|
|
298
|
+
...ge,
|
|
299
299
|
title: r,
|
|
300
300
|
children: /* @__PURE__ */ d("circle", {
|
|
301
301
|
r: e.r,
|
|
302
|
-
fill:
|
|
303
|
-
stroke: e.data.colorConfig?.stroke ??
|
|
302
|
+
fill: ue(e),
|
|
303
|
+
stroke: e.data.colorConfig?.stroke ?? A.palette.background.paper,
|
|
304
304
|
strokeWidth: .75,
|
|
305
305
|
style: {
|
|
306
|
-
cursor:
|
|
306
|
+
cursor: E ? "not-allowed" : e.children ? "pointer" : "default",
|
|
307
307
|
transition: "stroke-width 0.1s"
|
|
308
308
|
},
|
|
309
309
|
onMouseEnter: (e) => {
|
|
310
|
-
|
|
310
|
+
E || (e.currentTarget.style.strokeWidth = "2", D?.(n, e));
|
|
311
311
|
},
|
|
312
312
|
onMouseLeave: (e) => {
|
|
313
|
-
e.currentTarget.style.strokeWidth = "0.75";
|
|
313
|
+
e.currentTarget.style.strokeWidth = "0.75", D?.(null, e);
|
|
314
314
|
},
|
|
315
315
|
onClick: (t) => {
|
|
316
|
-
if (!
|
|
316
|
+
if (!E) {
|
|
317
317
|
if (t.ctrlKey || t.metaKey) {
|
|
318
318
|
if (e.children) {
|
|
319
|
-
let n = t.altKey ? Math.max(250,
|
|
320
|
-
|
|
319
|
+
let n = t.altKey ? Math.max(250, w * 10) : w;
|
|
320
|
+
me(() => X(e, n));
|
|
321
321
|
}
|
|
322
322
|
return;
|
|
323
323
|
}
|
|
324
|
-
|
|
324
|
+
ie?.(n, t);
|
|
325
325
|
}
|
|
326
326
|
},
|
|
327
327
|
onDoubleClick: (e) => {
|
|
328
|
-
if (!
|
|
328
|
+
if (!E && (e.ctrlKey || e.metaKey)) {
|
|
329
329
|
Q(), e.preventDefault(), e.stopPropagation();
|
|
330
|
-
let t =
|
|
331
|
-
t !==
|
|
330
|
+
let t = K.parent ?? N;
|
|
331
|
+
t !== K && X(t, e.altKey ? Math.max(250, w * 10) : w);
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
})
|
|
@@ -336,36 +336,36 @@ function g({ data: m, size: g = 600, padding: _ = 3, sortBy: v = "value", showLa
|
|
|
336
336
|
}, `n-${t}`);
|
|
337
337
|
})
|
|
338
338
|
}),
|
|
339
|
-
|
|
339
|
+
v && /* @__PURE__ */ d("g", {
|
|
340
340
|
"data-role": "labels",
|
|
341
341
|
textAnchor: "middle",
|
|
342
342
|
dominantBaseline: "middle",
|
|
343
343
|
pointerEvents: "none",
|
|
344
|
-
fontSize:
|
|
345
|
-
fill:
|
|
346
|
-
children:
|
|
347
|
-
transform: `translate(${e.x -
|
|
344
|
+
fontSize: te,
|
|
345
|
+
fill: j,
|
|
346
|
+
children: P.map((e, t) => /* @__PURE__ */ d("text", {
|
|
347
|
+
transform: `translate(${e.x - h / 2},${e.y - h / 2})`,
|
|
348
348
|
style: {
|
|
349
|
-
display: e.parent ===
|
|
350
|
-
fillOpacity: +(e.parent ===
|
|
349
|
+
display: e.parent === N ? "inline" : "none",
|
|
350
|
+
fillOpacity: +(e.parent === N)
|
|
351
351
|
},
|
|
352
352
|
children: e.data.name
|
|
353
353
|
}, `lbl-${t}`))
|
|
354
354
|
}),
|
|
355
|
-
|
|
355
|
+
y && /* @__PURE__ */ d("g", {
|
|
356
356
|
"data-role": "inner-labels",
|
|
357
357
|
textAnchor: "middle",
|
|
358
358
|
dominantBaseline: "middle",
|
|
359
359
|
pointerEvents: "none",
|
|
360
|
-
fontSize:
|
|
361
|
-
fill:
|
|
362
|
-
children:
|
|
363
|
-
transform: `translate(${e.x -
|
|
360
|
+
fontSize: b,
|
|
361
|
+
fill: j,
|
|
362
|
+
children: P.map((e, t) => /* @__PURE__ */ d("text", {
|
|
363
|
+
transform: `translate(${e.x - h / 2},${e.y - h / 2})`,
|
|
364
364
|
style: { display: "none" }
|
|
365
365
|
}, `inner-lbl-${t}`))
|
|
366
366
|
})
|
|
367
367
|
]
|
|
368
|
-
}),
|
|
368
|
+
}), K !== N && !E && /* @__PURE__ */ d(s, {
|
|
369
369
|
sx: {
|
|
370
370
|
position: "absolute",
|
|
371
371
|
bottom: 6,
|
|
@@ -385,11 +385,11 @@ function g({ data: m, size: g = 600, padding: _ = 3, sortBy: v = "value", showLa
|
|
|
385
385
|
color: "text.secondary",
|
|
386
386
|
fontSize: "0.7rem"
|
|
387
387
|
},
|
|
388
|
-
children: [
|
|
388
|
+
children: [K.ancestors().map((e) => e.data.name).reverse().join(" › "), " · Ctrl / Cmd ⌘+DblClick to zoom out · Escape to reset"]
|
|
389
389
|
})
|
|
390
390
|
})]
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
|
-
|
|
393
|
+
h.displayName = "CirclePackingChart";
|
|
394
394
|
//#endregion
|
|
395
|
-
export {
|
|
395
|
+
export { h as CirclePackingChart };
|
|
@@ -97,6 +97,8 @@ export type CirclePackingChartProps = {
|
|
|
97
97
|
disabled?: boolean;
|
|
98
98
|
/** Fires on regular click — immediately, no delay */
|
|
99
99
|
onCircleClick?: (info: CirclePackingNodeInfo, event: React.MouseEvent<SVGCircleElement>) => void;
|
|
100
|
+
/** Fired on mouse enter/leave a circle — `null` on leave. Use for linked-view highlighting. */
|
|
101
|
+
onCircleHover?: (info: CirclePackingNodeInfo | null, event: React.MouseEvent<SVGCircleElement> | null) => void;
|
|
100
102
|
/** Fires when the zoom focus changes */
|
|
101
103
|
onZoomChange?: (zoom: CirclePackingZoomInfo) => void;
|
|
102
104
|
/**
|
|
@@ -49,11 +49,11 @@ var E = [
|
|
|
49
49
|
showExportCSV: !1,
|
|
50
50
|
showAssigneeFilter: !1
|
|
51
51
|
};
|
|
52
|
-
function
|
|
53
|
-
let U = T(
|
|
52
|
+
function ee({ tasks: t, onTaskClick: n, onMilestoneClick: r, onAddTask: s, onEditTask: l, onDeleteTask: _, onStatusChange: v, onTasksChange: x, enableBuiltinDialogs: S = !0, onTaskCreated: C, onTaskUpdated: w, onTaskDeleted: ee, showToolbar: O = !0, toolbarConfig: k, height: A, width: te, minPanelWidth: j = 200, maxPanelWidth: M = 600, zoomable: N = !1, draggable: P = !1, resizable: F = !1, inlineEdit: I = !1, progressDraggable: ne = !1, showCriticalPath: re = !1, virtualizeRows: L = !1, showAssigneeColumn: R = !1, onExportCSV: z, onDragStart: B, onTaskMoved: V, onTaskResized: H }) {
|
|
53
|
+
let U = T(A, 400), W = d(() => ({
|
|
54
54
|
...D,
|
|
55
|
-
...
|
|
56
|
-
}), [
|
|
55
|
+
...k
|
|
56
|
+
}), [k]), G = T(te, "100%"), K = y((e) => e.setTasks), q = y((e) => e.timeScale), J = y((e) => e.setTimeScale), Y = y((e) => e.timelineRange), X = f(null), Z = f(null), Q = f(!1), [$, ie] = p(320 + (R ? 110 : 0)), ae = b(), oe = c(() => {
|
|
57
57
|
let e = ae.getState().tasks, t = [[
|
|
58
58
|
"id",
|
|
59
59
|
"name",
|
|
@@ -98,7 +98,7 @@ function O({ tasks: t, onTaskClick: n, onMilestoneClick: r, onAddTask: s, onEdit
|
|
|
98
98
|
Z.current.scrollLeft = Math.max(0, a - Z.current.clientWidth / 2);
|
|
99
99
|
}, [Y, q]);
|
|
100
100
|
u(() => {
|
|
101
|
-
if (!
|
|
101
|
+
if (!N || !Z.current) return;
|
|
102
102
|
let e = Z.current, t = (e) => {
|
|
103
103
|
if (!e.ctrlKey) return;
|
|
104
104
|
e.preventDefault();
|
|
@@ -107,7 +107,7 @@ function O({ tasks: t, onTaskClick: n, onMilestoneClick: r, onAddTask: s, onEdit
|
|
|
107
107
|
};
|
|
108
108
|
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
109
109
|
}, [
|
|
110
|
-
|
|
110
|
+
N,
|
|
111
111
|
q,
|
|
112
112
|
J
|
|
113
113
|
]);
|
|
@@ -115,15 +115,15 @@ function O({ tasks: t, onTaskClick: n, onMilestoneClick: r, onAddTask: s, onEdit
|
|
|
115
115
|
e.preventDefault();
|
|
116
116
|
let t = e.clientX, n = $, r = (e) => {
|
|
117
117
|
let r = e.clientX - t;
|
|
118
|
-
ie(Math.max(
|
|
118
|
+
ie(Math.max(j, Math.min(M, n + r)));
|
|
119
119
|
}, i = () => {
|
|
120
120
|
document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
121
121
|
};
|
|
122
122
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
123
123
|
}, [
|
|
124
124
|
$,
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
j,
|
|
126
|
+
M
|
|
127
127
|
]);
|
|
128
128
|
return /* @__PURE__ */ g(m, {
|
|
129
129
|
sx: {
|
|
@@ -136,7 +136,7 @@ function O({ tasks: t, onTaskClick: n, onMilestoneClick: r, onAddTask: s, onEdit
|
|
|
136
136
|
borderRadius: 1,
|
|
137
137
|
overflow: "hidden"
|
|
138
138
|
},
|
|
139
|
-
children: [
|
|
139
|
+
children: [O && /* @__PURE__ */ h(o, {
|
|
140
140
|
onScrollToToday: le,
|
|
141
141
|
config: W,
|
|
142
142
|
onExportCSV: W.showExportCSV ? oe : void 0
|
|
@@ -160,8 +160,8 @@ function O({ tasks: t, onTaskClick: n, onMilestoneClick: r, onAddTask: s, onEdit
|
|
|
160
160
|
enableBuiltinDialogs: S,
|
|
161
161
|
onTaskCreated: C,
|
|
162
162
|
onTaskUpdated: w,
|
|
163
|
-
onTaskDeleted:
|
|
164
|
-
inlineEdit:
|
|
163
|
+
onTaskDeleted: ee,
|
|
164
|
+
inlineEdit: I,
|
|
165
165
|
virtualizeRows: L,
|
|
166
166
|
showAssigneeColumn: R
|
|
167
167
|
}),
|
|
@@ -181,8 +181,8 @@ function O({ tasks: t, onTaskClick: n, onMilestoneClick: r, onAddTask: s, onEdit
|
|
|
181
181
|
onScroll: ce,
|
|
182
182
|
onTaskClick: n,
|
|
183
183
|
onMilestoneClick: r,
|
|
184
|
-
draggable:
|
|
185
|
-
resizable:
|
|
184
|
+
draggable: P,
|
|
185
|
+
resizable: F,
|
|
186
186
|
progressDraggable: ne,
|
|
187
187
|
showCriticalPath: re,
|
|
188
188
|
virtualizeRows: L,
|
|
@@ -196,7 +196,7 @@ function O({ tasks: t, onTaskClick: n, onMilestoneClick: r, onAddTask: s, onEdit
|
|
|
196
196
|
})]
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function O({ tasks: e, timeScale: i = "months", initialExpandAll: a = !1, showToolbar: o = !0, defaultRangeStart: s, defaultRangeEnd: c, translations: l, enableBuiltinDialogs: u = !0, toolbarConfig: f, zoomable: m = !1, draggable: g = !1, resizable: _ = !1, inlineEdit: y = !1, progressDraggable: b = !1, showCriticalPath: S = !1, virtualizeRows: w = !1, showAssigneeColumn: T = !1, cascadeDependencies: E = !1, statusColors: D, ganttTheme: O, onExportCSV: k, onDragStart: A, onTaskClick: te, onMilestoneClick: j, onAddTask: M, onEditTask: N, onDeleteTask: P, onStatusChange: F, onTasksChange: I, onTaskMoved: ne, onTaskResized: re, onTaskCreated: L, onTaskUpdated: R, onTaskDeleted: z, height: B, width: V, minPanelWidth: H, maxPanelWidth: U }) {
|
|
200
200
|
let W = d(() => ({
|
|
201
201
|
...r,
|
|
202
202
|
...l
|
|
@@ -208,19 +208,19 @@ function k({ tasks: e, timeScale: i = "months", initialExpandAll: a = !1, showTo
|
|
|
208
208
|
end: c ?? r.end
|
|
209
209
|
}, E);
|
|
210
210
|
}), K = d(() => ({
|
|
211
|
-
...
|
|
211
|
+
...O,
|
|
212
212
|
statusColors: {
|
|
213
213
|
...D,
|
|
214
|
-
...
|
|
214
|
+
...O?.statusColors
|
|
215
215
|
}
|
|
216
|
-
}), [D,
|
|
216
|
+
}), [D, O]);
|
|
217
217
|
return /* @__PURE__ */ h(x.Provider, {
|
|
218
218
|
value: W,
|
|
219
219
|
children: /* @__PURE__ */ h(C.Provider, {
|
|
220
220
|
value: K,
|
|
221
221
|
children: /* @__PURE__ */ h(v.Provider, {
|
|
222
222
|
value: G,
|
|
223
|
-
children: /* @__PURE__ */ h(
|
|
223
|
+
children: /* @__PURE__ */ h(ee, {
|
|
224
224
|
tasks: e,
|
|
225
225
|
timeScale: i,
|
|
226
226
|
enableBuiltinDialogs: u,
|
|
@@ -234,15 +234,15 @@ function k({ tasks: e, timeScale: i = "months", initialExpandAll: a = !1, showTo
|
|
|
234
234
|
showCriticalPath: S,
|
|
235
235
|
virtualizeRows: w,
|
|
236
236
|
showAssigneeColumn: T,
|
|
237
|
-
onExportCSV:
|
|
238
|
-
onDragStart:
|
|
239
|
-
onTaskClick:
|
|
240
|
-
onMilestoneClick:
|
|
241
|
-
onAddTask:
|
|
242
|
-
onEditTask:
|
|
243
|
-
onDeleteTask:
|
|
244
|
-
onStatusChange:
|
|
245
|
-
onTasksChange:
|
|
237
|
+
onExportCSV: k,
|
|
238
|
+
onDragStart: A,
|
|
239
|
+
onTaskClick: te,
|
|
240
|
+
onMilestoneClick: j,
|
|
241
|
+
onAddTask: M,
|
|
242
|
+
onEditTask: N,
|
|
243
|
+
onDeleteTask: P,
|
|
244
|
+
onStatusChange: F,
|
|
245
|
+
onTasksChange: I,
|
|
246
246
|
onTaskMoved: ne,
|
|
247
247
|
onTaskResized: re,
|
|
248
248
|
onTaskCreated: L,
|
|
@@ -258,4 +258,4 @@ function k({ tasks: e, timeScale: i = "months", initialExpandAll: a = !1, showTo
|
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
//#endregion
|
|
261
|
-
export {
|
|
261
|
+
export { O as GanttChart, y as useGanttChartStore, w as useGanttTheme, S as useGanttTranslations, b as useRawGanttChartStore };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HorizontalTreeChartProps } from "./HorizontalTreeChart.types";
|
|
2
|
-
export declare function HorizontalTreeChart({ data, orientation, width, height, levelSpacing, nodeRadius, sortBy, showLabels, labelFontSize, labelColor, showIcons, chartColors, linkStrokeOpacity, linkStrokeWidth, linkColor, zoomable, drillable, onFocusChange, showNodePopover, renderNodePopoverContent, onNodeClick, duration, disabled, translation, }: HorizontalTreeChartProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function HorizontalTreeChart({ data, orientation, width, height, levelSpacing, nodeRadius, sortBy, showLabels, labelFontSize, labelColor, showIcons, chartColors, linkStrokeOpacity, linkStrokeWidth, linkColor, zoomable, drillable, onFocusChange, showNodePopover, renderNodePopoverContent, onNodeClick, onNodeHover, duration, disabled, translation, }: HorizontalTreeChartProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare namespace HorizontalTreeChart {
|
|
4
4
|
var displayName: string;
|
|
5
5
|
}
|