@dpuse/dpuse-tool-d3-visualiser 1.0.112 → 1.0.121

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.
Files changed (41) hide show
  1. package/README.md +203 -240
  2. package/dist/chordDiagram-Cm91Tmgo.js +1729 -0
  3. package/dist/d3-hierarchy-Dtx4jD78.js +269 -0
  4. package/dist/{linear-DytAYqu2.js → d3-scale-BYykLEPO.js} +271 -245
  5. package/dist/{select-Bs4oiNEZ.js → d3-selection-CL8c_tE2.js} +233 -281
  6. package/dist/d3-shape-gf8U18pS.js +1133 -0
  7. package/dist/dpuse-tool-d3-visualiser.es.js +7 -8
  8. package/dist/{erdDiagram-CHPY-zaP.js → erdDiagram-DmYSx8Dh.js} +78 -65
  9. package/dist/networkDiagram-p5z5B_vZ.js +1005 -0
  10. package/dist/{palette-Ca7C6aNE.js → palette-D5DTPmuA.js} +2 -4
  11. package/dist/{sankeyDiagram-w2TGSqb7.js → sankeyDiagram-Dbl1-v5p.js} +38 -45
  12. package/dist/shipped-packages.json +12 -21
  13. package/dist/{src-Bo8my4B8.js → src-YHHReglY.js} +71 -109
  14. package/dist/{string-iJh48M7Y.js → string-BzfQLSds.js} +7 -14
  15. package/dist/{tanStackCharts-LPqRQGD9.js → tanStackCharts-DEINbmRi.js} +1228 -1350
  16. package/dist/treeDiagram-t0oFwi1c.js +49 -0
  17. package/dist/types/src/networkDiagram.d.ts +4 -0
  18. package/package.json +28 -25
  19. package/dist/array-Cv4-2llb.js +0 -14
  20. package/dist/array-Cv4-2llb.js.map +0 -1
  21. package/dist/chordDiagram-BG0jW2g9.js +0 -3663
  22. package/dist/chordDiagram-BG0jW2g9.js.map +0 -1
  23. package/dist/dpuse-tool-d3-visualiser.es.js.map +0 -1
  24. package/dist/erdDiagram-CHPY-zaP.js.map +0 -1
  25. package/dist/hierarchy-CDFAetye.js +0 -149
  26. package/dist/hierarchy-CDFAetye.js.map +0 -1
  27. package/dist/linear-DytAYqu2.js.map +0 -1
  28. package/dist/link-BfoIl3p5.js +0 -64
  29. package/dist/link-BfoIl3p5.js.map +0 -1
  30. package/dist/networkDiagram-XI0c9kJR.js +0 -1029
  31. package/dist/networkDiagram-XI0c9kJR.js.map +0 -1
  32. package/dist/palette-Ca7C6aNE.js.map +0 -1
  33. package/dist/point-DSPrfIZi.js +0 -88
  34. package/dist/point-DSPrfIZi.js.map +0 -1
  35. package/dist/sankeyDiagram-w2TGSqb7.js.map +0 -1
  36. package/dist/select-Bs4oiNEZ.js.map +0 -1
  37. package/dist/src-Bo8my4B8.js.map +0 -1
  38. package/dist/string-iJh48M7Y.js.map +0 -1
  39. package/dist/tanStackCharts-LPqRQGD9.js.map +0 -1
  40. package/dist/treeDiagram-C798R8hL.js +0 -128
  41. package/dist/treeDiagram-C798R8hL.js.map +0 -1
@@ -1,1029 +0,0 @@
1
- import { n as e, r as t, t as n } from "./src-Bo8my4B8.js";
2
- import { t as r } from "./select-Bs4oiNEZ.js";
3
- //#region node_modules/d3-force/src/center.js
4
- function i(e, t) {
5
- var n, r = 1;
6
- e ??= 0, t ??= 0;
7
- function i() {
8
- var i, a = n.length, o, s = 0, c = 0;
9
- for (i = 0; i < a; ++i) o = n[i], s += o.x, c += o.y;
10
- for (s = (s / a - e) * r, c = (c / a - t) * r, i = 0; i < a; ++i) o = n[i], o.x -= s, o.y -= c;
11
- }
12
- return i.initialize = function(e) {
13
- n = e;
14
- }, i.x = function(t) {
15
- return arguments.length ? (e = +t, i) : e;
16
- }, i.y = function(e) {
17
- return arguments.length ? (t = +e, i) : t;
18
- }, i.strength = function(e) {
19
- return arguments.length ? (r = +e, i) : r;
20
- }, i;
21
- }
22
- //#endregion
23
- //#region node_modules/d3-quadtree/src/add.js
24
- function a(e) {
25
- let t = +this._x.call(null, e), n = +this._y.call(null, e);
26
- return o(this.cover(t, n), t, n, e);
27
- }
28
- function o(e, t, n, r) {
29
- if (isNaN(t) || isNaN(n)) return e;
30
- var i, a = e._root, o = { data: r }, s = e._x0, c = e._y0, l = e._x1, u = e._y1, d, f, p, m, h, g, _, v;
31
- if (!a) return e._root = o, e;
32
- for (; a.length;) if ((h = t >= (d = (s + l) / 2)) ? s = d : l = d, (g = n >= (f = (c + u) / 2)) ? c = f : u = f, i = a, !(a = a[_ = g << 1 | h])) return i[_] = o, e;
33
- if (p = +e._x.call(null, a.data), m = +e._y.call(null, a.data), t === p && n === m) return o.next = a, i ? i[_] = o : e._root = o, e;
34
- do
35
- i = i ? i[_] = [
36
- ,
37
- ,
38
- ,
39
- ,
40
- ] : e._root = [
41
- ,
42
- ,
43
- ,
44
- ,
45
- ], (h = t >= (d = (s + l) / 2)) ? s = d : l = d, (g = n >= (f = (c + u) / 2)) ? c = f : u = f;
46
- while ((_ = g << 1 | h) == (v = (m >= f) << 1 | p >= d));
47
- return i[v] = a, i[_] = o, e;
48
- }
49
- function s(e) {
50
- var t, n, r = e.length, i, a, s = Array(r), c = Array(r), l = Infinity, u = Infinity, d = -Infinity, f = -Infinity;
51
- for (n = 0; n < r; ++n) isNaN(i = +this._x.call(null, t = e[n])) || isNaN(a = +this._y.call(null, t)) || (s[n] = i, c[n] = a, i < l && (l = i), i > d && (d = i), a < u && (u = a), a > f && (f = a));
52
- if (l > d || u > f) return this;
53
- for (this.cover(l, u).cover(d, f), n = 0; n < r; ++n) o(this, s[n], c[n], e[n]);
54
- return this;
55
- }
56
- //#endregion
57
- //#region node_modules/d3-quadtree/src/cover.js
58
- function c(e, t) {
59
- if (isNaN(e = +e) || isNaN(t = +t)) return this;
60
- var n = this._x0, r = this._y0, i = this._x1, a = this._y1;
61
- if (isNaN(n)) i = (n = Math.floor(e)) + 1, a = (r = Math.floor(t)) + 1;
62
- else {
63
- for (var o = i - n || 1, s = this._root, c, l; n > e || e >= i || r > t || t >= a;) switch (l = (t < r) << 1 | e < n, c = [
64
- ,
65
- ,
66
- ,
67
- ,
68
- ], c[l] = s, s = c, o *= 2, l) {
69
- case 0:
70
- i = n + o, a = r + o;
71
- break;
72
- case 1:
73
- n = i - o, a = r + o;
74
- break;
75
- case 2:
76
- i = n + o, r = a - o;
77
- break;
78
- case 3: n = i - o, r = a - o;
79
- }
80
- this._root && this._root.length && (this._root = s);
81
- }
82
- return this._x0 = n, this._y0 = r, this._x1 = i, this._y1 = a, this;
83
- }
84
- //#endregion
85
- //#region node_modules/d3-quadtree/src/data.js
86
- function l() {
87
- var e = [];
88
- return this.visit(function(t) {
89
- if (!t.length) do
90
- e.push(t.data);
91
- while (t = t.next);
92
- }), e;
93
- }
94
- //#endregion
95
- //#region node_modules/d3-quadtree/src/extent.js
96
- function u(e) {
97
- return arguments.length ? this.cover(+e[0][0], +e[0][1]).cover(+e[1][0], +e[1][1]) : isNaN(this._x0) ? void 0 : [[this._x0, this._y0], [this._x1, this._y1]];
98
- }
99
- //#endregion
100
- //#region node_modules/d3-quadtree/src/quad.js
101
- function d(e, t, n, r, i) {
102
- this.node = e, this.x0 = t, this.y0 = n, this.x1 = r, this.y1 = i;
103
- }
104
- //#endregion
105
- //#region node_modules/d3-quadtree/src/find.js
106
- function f(e, t, n) {
107
- var r, i = this._x0, a = this._y0, o, s, c, l, u = this._x1, f = this._y1, p = [], m = this._root, h, g;
108
- for (m && p.push(new d(m, i, a, u, f)), n == null ? n = Infinity : (i = e - n, a = t - n, u = e + n, f = t + n, n *= n); h = p.pop();) if (!(!(m = h.node) || (o = h.x0) > u || (s = h.y0) > f || (c = h.x1) < i || (l = h.y1) < a)) {
109
- if (m.length) {
110
- var _ = (o + c) / 2, v = (s + l) / 2;
111
- p.push(new d(m[3], _, v, c, l), new d(m[2], o, v, _, l), new d(m[1], _, s, c, v), new d(m[0], o, s, _, v)), (g = (t >= v) << 1 | e >= _) && (h = p[p.length - 1], p[p.length - 1] = p[p.length - 1 - g], p[p.length - 1 - g] = h);
112
- } else {
113
- var y = e - +this._x.call(null, m.data), b = t - +this._y.call(null, m.data), x = y * y + b * b;
114
- if (x < n) {
115
- var S = Math.sqrt(n = x);
116
- i = e - S, a = t - S, u = e + S, f = t + S, r = m.data;
117
- }
118
- }
119
- }
120
- return r;
121
- }
122
- //#endregion
123
- //#region node_modules/d3-quadtree/src/remove.js
124
- function p(e) {
125
- if (isNaN(u = +this._x.call(null, e)) || isNaN(d = +this._y.call(null, e))) return this;
126
- var t, n = this._root, r, i, a, o = this._x0, s = this._y0, c = this._x1, l = this._y1, u, d, f, p, m, h, g, _;
127
- if (!n) return this;
128
- if (n.length) for (;;) {
129
- if ((m = u >= (f = (o + c) / 2)) ? o = f : c = f, (h = d >= (p = (s + l) / 2)) ? s = p : l = p, t = n, !(n = n[g = h << 1 | m])) return this;
130
- if (!n.length) break;
131
- (t[g + 1 & 3] || t[g + 2 & 3] || t[g + 3 & 3]) && (r = t, _ = g);
132
- }
133
- for (; n.data !== e;) if (i = n, !(n = n.next)) return this;
134
- return (a = n.next) && delete n.next, i ? (a ? i.next = a : delete i.next, this) : t ? (a ? t[g] = a : delete t[g], (n = t[0] || t[1] || t[2] || t[3]) && n === (t[3] || t[2] || t[1] || t[0]) && !n.length && (r ? r[_] = n : this._root = n), this) : (this._root = a, this);
135
- }
136
- function m(e) {
137
- for (var t = 0, n = e.length; t < n; ++t) this.remove(e[t]);
138
- return this;
139
- }
140
- //#endregion
141
- //#region node_modules/d3-quadtree/src/root.js
142
- function h() {
143
- return this._root;
144
- }
145
- //#endregion
146
- //#region node_modules/d3-quadtree/src/size.js
147
- function g() {
148
- var e = 0;
149
- return this.visit(function(t) {
150
- if (!t.length) do
151
- ++e;
152
- while (t = t.next);
153
- }), e;
154
- }
155
- //#endregion
156
- //#region node_modules/d3-quadtree/src/visit.js
157
- function _(e) {
158
- var t = [], n, r = this._root, i, a, o, s, c;
159
- for (r && t.push(new d(r, this._x0, this._y0, this._x1, this._y1)); n = t.pop();) if (!e(r = n.node, a = n.x0, o = n.y0, s = n.x1, c = n.y1) && r.length) {
160
- var l = (a + s) / 2, u = (o + c) / 2;
161
- (i = r[3]) && t.push(new d(i, l, u, s, c)), (i = r[2]) && t.push(new d(i, a, u, l, c)), (i = r[1]) && t.push(new d(i, l, o, s, u)), (i = r[0]) && t.push(new d(i, a, o, l, u));
162
- }
163
- return this;
164
- }
165
- //#endregion
166
- //#region node_modules/d3-quadtree/src/visitAfter.js
167
- function v(e) {
168
- var t = [], n = [], r;
169
- for (this._root && t.push(new d(this._root, this._x0, this._y0, this._x1, this._y1)); r = t.pop();) {
170
- var i = r.node;
171
- if (i.length) {
172
- var a, o = r.x0, s = r.y0, c = r.x1, l = r.y1, u = (o + c) / 2, f = (s + l) / 2;
173
- (a = i[0]) && t.push(new d(a, o, s, u, f)), (a = i[1]) && t.push(new d(a, u, s, c, f)), (a = i[2]) && t.push(new d(a, o, f, u, l)), (a = i[3]) && t.push(new d(a, u, f, c, l));
174
- }
175
- n.push(r);
176
- }
177
- for (; r = n.pop();) e(r.node, r.x0, r.y0, r.x1, r.y1);
178
- return this;
179
- }
180
- //#endregion
181
- //#region node_modules/d3-quadtree/src/x.js
182
- function y(e) {
183
- return e[0];
184
- }
185
- function b(e) {
186
- return arguments.length ? (this._x = e, this) : this._x;
187
- }
188
- //#endregion
189
- //#region node_modules/d3-quadtree/src/y.js
190
- function x(e) {
191
- return e[1];
192
- }
193
- function S(e) {
194
- return arguments.length ? (this._y = e, this) : this._y;
195
- }
196
- //#endregion
197
- //#region node_modules/d3-quadtree/src/quadtree.js
198
- function C(e, t, n) {
199
- var r = new w(t ?? y, n ?? x, NaN, NaN, NaN, NaN);
200
- return e == null ? r : r.addAll(e);
201
- }
202
- function w(e, t, n, r, i, a) {
203
- this._x = e, this._y = t, this._x0 = n, this._y0 = r, this._x1 = i, this._y1 = a, this._root = void 0;
204
- }
205
- function T(e) {
206
- for (var t = { data: e.data }, n = t; e = e.next;) n = n.next = { data: e.data };
207
- return t;
208
- }
209
- var E = C.prototype = w.prototype;
210
- E.copy = function() {
211
- var e = new w(this._x, this._y, this._x0, this._y0, this._x1, this._y1), t = this._root, n, r;
212
- if (!t) return e;
213
- if (!t.length) return e._root = T(t), e;
214
- for (n = [{
215
- source: t,
216
- target: e._root = [
217
- ,
218
- ,
219
- ,
220
- ,
221
- ]
222
- }]; t = n.pop();) for (var i = 0; i < 4; ++i) (r = t.source[i]) && (r.length ? n.push({
223
- source: r,
224
- target: t.target[i] = [
225
- ,
226
- ,
227
- ,
228
- ,
229
- ]
230
- }) : t.target[i] = T(r));
231
- return e;
232
- }, E.add = a, E.addAll = s, E.cover = c, E.data = l, E.extent = u, E.find = f, E.remove = p, E.removeAll = m, E.root = h, E.size = g, E.visit = _, E.visitAfter = v, E.x = b, E.y = S;
233
- //#endregion
234
- //#region node_modules/d3-force/src/constant.js
235
- function D(e) {
236
- return function() {
237
- return e;
238
- };
239
- }
240
- //#endregion
241
- //#region node_modules/d3-force/src/jiggle.js
242
- function O(e) {
243
- return (e() - .5) * 1e-6;
244
- }
245
- //#endregion
246
- //#region node_modules/d3-force/src/link.js
247
- function k(e) {
248
- return e.index;
249
- }
250
- function A(e, t) {
251
- var n = e.get(t);
252
- if (!n) throw Error("node not found: " + t);
253
- return n;
254
- }
255
- function j(e) {
256
- var t = k, n = d, r, i = D(30), a, o, s, c, l, u = 1;
257
- e ??= [];
258
- function d(e) {
259
- return 1 / Math.min(s[e.source.index], s[e.target.index]);
260
- }
261
- function f(t) {
262
- for (var n = 0, i = e.length; n < u; ++n) for (var o = 0, s, d, f, p, m, h, g; o < i; ++o) s = e[o], d = s.source, f = s.target, p = f.x + f.vx - d.x - d.vx || O(l), m = f.y + f.vy - d.y - d.vy || O(l), h = Math.sqrt(p * p + m * m), h = (h - a[o]) / h * t * r[o], p *= h, m *= h, f.vx -= p * (g = c[o]), f.vy -= m * g, d.vx += p * (g = 1 - g), d.vy += m * g;
263
- }
264
- function p() {
265
- if (o) {
266
- var n, i = o.length, l = e.length, u = new Map(o.map((e, n) => [t(e, n, o), e])), d;
267
- for (n = 0, s = Array(i); n < l; ++n) d = e[n], d.index = n, typeof d.source != "object" && (d.source = A(u, d.source)), typeof d.target != "object" && (d.target = A(u, d.target)), s[d.source.index] = (s[d.source.index] || 0) + 1, s[d.target.index] = (s[d.target.index] || 0) + 1;
268
- for (n = 0, c = Array(l); n < l; ++n) d = e[n], c[n] = s[d.source.index] / (s[d.source.index] + s[d.target.index]);
269
- r = Array(l), m(), a = Array(l), h();
270
- }
271
- }
272
- function m() {
273
- if (o) for (var t = 0, i = e.length; t < i; ++t) r[t] = +n(e[t], t, e);
274
- }
275
- function h() {
276
- if (o) for (var t = 0, n = e.length; t < n; ++t) a[t] = +i(e[t], t, e);
277
- }
278
- return f.initialize = function(e, t) {
279
- o = e, l = t, p();
280
- }, f.links = function(t) {
281
- return arguments.length ? (e = t, p(), f) : e;
282
- }, f.id = function(e) {
283
- return arguments.length ? (t = e, f) : t;
284
- }, f.iterations = function(e) {
285
- return arguments.length ? (u = +e, f) : u;
286
- }, f.strength = function(e) {
287
- return arguments.length ? (n = typeof e == "function" ? e : D(+e), m(), f) : n;
288
- }, f.distance = function(e) {
289
- return arguments.length ? (i = typeof e == "function" ? e : D(+e), h(), f) : i;
290
- }, f;
291
- }
292
- //#endregion
293
- //#region node_modules/d3-force/src/lcg.js
294
- var M = 1664525, ee = 1013904223, N = 4294967296;
295
- function te() {
296
- let e = 1;
297
- return () => (e = (M * e + ee) % N) / N;
298
- }
299
- //#endregion
300
- //#region node_modules/d3-force/src/simulation.js
301
- function ne(e) {
302
- return e.x;
303
- }
304
- function re(e) {
305
- return e.y;
306
- }
307
- var ie = 10, ae = Math.PI * (3 - Math.sqrt(5));
308
- function oe(n) {
309
- var r, i = 1, a = .001, o = 1 - a ** (1 / 300), s = 0, c = .6, l = /* @__PURE__ */ new Map(), u = e(p), d = t("tick", "end"), f = te();
310
- n ??= [];
311
- function p() {
312
- m(), d.call("tick", r), i < a && (u.stop(), d.call("end", r));
313
- }
314
- function m(e) {
315
- var t, a = n.length, u;
316
- e === void 0 && (e = 1);
317
- for (var d = 0; d < e; ++d) for (i += (s - i) * o, l.forEach(function(e) {
318
- e(i);
319
- }), t = 0; t < a; ++t) u = n[t], u.fx == null ? u.x += u.vx *= c : (u.x = u.fx, u.vx = 0), u.fy == null ? u.y += u.vy *= c : (u.y = u.fy, u.vy = 0);
320
- return r;
321
- }
322
- function h() {
323
- for (var e = 0, t = n.length, r; e < t; ++e) {
324
- if (r = n[e], r.index = e, r.fx != null && (r.x = r.fx), r.fy != null && (r.y = r.fy), isNaN(r.x) || isNaN(r.y)) {
325
- var i = ie * Math.sqrt(.5 + e), a = e * ae;
326
- r.x = i * Math.cos(a), r.y = i * Math.sin(a);
327
- }
328
- (isNaN(r.vx) || isNaN(r.vy)) && (r.vx = r.vy = 0);
329
- }
330
- }
331
- function g(e) {
332
- return e.initialize && e.initialize(n, f), e;
333
- }
334
- return h(), r = {
335
- tick: m,
336
- restart: function() {
337
- return u.restart(p), r;
338
- },
339
- stop: function() {
340
- return u.stop(), r;
341
- },
342
- nodes: function(e) {
343
- return arguments.length ? (n = e, h(), l.forEach(g), r) : n;
344
- },
345
- alpha: function(e) {
346
- return arguments.length ? (i = +e, r) : i;
347
- },
348
- alphaMin: function(e) {
349
- return arguments.length ? (a = +e, r) : a;
350
- },
351
- alphaDecay: function(e) {
352
- return arguments.length ? (o = +e, r) : +o;
353
- },
354
- alphaTarget: function(e) {
355
- return arguments.length ? (s = +e, r) : s;
356
- },
357
- velocityDecay: function(e) {
358
- return arguments.length ? (c = 1 - e, r) : 1 - c;
359
- },
360
- randomSource: function(e) {
361
- return arguments.length ? (f = e, l.forEach(g), r) : f;
362
- },
363
- force: function(e, t) {
364
- return arguments.length > 1 ? (t == null ? l.delete(e) : l.set(e, g(t)), r) : l.get(e);
365
- },
366
- find: function(e, t, r) {
367
- var i = 0, a = n.length, o, s, c, l, u;
368
- for (r == null ? r = Infinity : r *= r, i = 0; i < a; ++i) l = n[i], o = e - l.x, s = t - l.y, c = o * o + s * s, c < r && (u = l, r = c);
369
- return u;
370
- },
371
- on: function(e, t) {
372
- return arguments.length > 1 ? (d.on(e, t), r) : d.on(e);
373
- }
374
- };
375
- }
376
- //#endregion
377
- //#region node_modules/d3-force/src/manyBody.js
378
- function se() {
379
- var e, t, n, r, i = D(-30), a, o = 1, s = Infinity, c = .81;
380
- function l(n) {
381
- var i, a = e.length, o = C(e, ne, re).visitAfter(d);
382
- for (r = n, i = 0; i < a; ++i) t = e[i], o.visit(f);
383
- }
384
- function u() {
385
- if (e) {
386
- var t, n = e.length, r;
387
- for (a = Array(n), t = 0; t < n; ++t) r = e[t], a[r.index] = +i(r, t, e);
388
- }
389
- }
390
- function d(e) {
391
- var t = 0, n, r, i = 0, o, s, c;
392
- if (e.length) {
393
- for (o = s = c = 0; c < 4; ++c) (n = e[c]) && (r = Math.abs(n.value)) && (t += n.value, i += r, o += r * n.x, s += r * n.y);
394
- e.x = o / i, e.y = s / i;
395
- } else {
396
- n = e, n.x = n.data.x, n.y = n.data.y;
397
- do
398
- t += a[n.data.index];
399
- while (n = n.next);
400
- }
401
- e.value = t;
402
- }
403
- function f(e, i, l, u) {
404
- if (!e.value) return !0;
405
- var d = e.x - t.x, f = e.y - t.y, p = u - i, m = d * d + f * f;
406
- if (p * p / c < m) return m < s && (d === 0 && (d = O(n), m += d * d), f === 0 && (f = O(n), m += f * f), m < o && (m = Math.sqrt(o * m)), t.vx += d * e.value * r / m, t.vy += f * e.value * r / m), !0;
407
- if (!(e.length || m >= s)) {
408
- (e.data !== t || e.next) && (d === 0 && (d = O(n), m += d * d), f === 0 && (f = O(n), m += f * f), m < o && (m = Math.sqrt(o * m)));
409
- do
410
- e.data !== t && (p = a[e.data.index] * r / m, t.vx += d * p, t.vy += f * p);
411
- while (e = e.next);
412
- }
413
- }
414
- return l.initialize = function(t, r) {
415
- e = t, n = r, u();
416
- }, l.strength = function(e) {
417
- return arguments.length ? (i = typeof e == "function" ? e : D(+e), u(), l) : i;
418
- }, l.distanceMin = function(e) {
419
- return arguments.length ? (o = e * e, l) : Math.sqrt(o);
420
- }, l.distanceMax = function(e) {
421
- return arguments.length ? (s = e * e, l) : Math.sqrt(s);
422
- }, l.theta = function(e) {
423
- return arguments.length ? (c = e * e, l) : Math.sqrt(c);
424
- }, l;
425
- }
426
- //#endregion
427
- //#region node_modules/d3-selection/src/sourceEvent.js
428
- function ce(e) {
429
- let t;
430
- for (; t = e.sourceEvent;) e = t;
431
- return e;
432
- }
433
- //#endregion
434
- //#region node_modules/d3-selection/src/pointer.js
435
- function P(e, t) {
436
- if (e = ce(e), t === void 0 && (t = e.currentTarget), t) {
437
- var n = t.ownerSVGElement || t;
438
- if (n.createSVGPoint) {
439
- var r = n.createSVGPoint();
440
- return r.x = e.clientX, r.y = e.clientY, r = r.matrixTransform(t.getScreenCTM().inverse()), [r.x, r.y];
441
- }
442
- if (t.getBoundingClientRect) {
443
- var i = t.getBoundingClientRect();
444
- return [e.clientX - i.left - t.clientLeft, e.clientY - i.top - t.clientTop];
445
- }
446
- }
447
- return [e.pageX, e.pageY];
448
- }
449
- //#endregion
450
- //#region node_modules/d3-interpolate/src/zoom.js
451
- var le = 1e-12;
452
- function F(e) {
453
- return ((e = Math.exp(e)) + 1 / e) / 2;
454
- }
455
- function ue(e) {
456
- return ((e = Math.exp(e)) - 1 / e) / 2;
457
- }
458
- function de(e) {
459
- return ((e = Math.exp(2 * e)) - 1) / (e + 1);
460
- }
461
- var fe = (function e(t, n, r) {
462
- function i(e, i) {
463
- var a = e[0], o = e[1], s = e[2], c = i[0], l = i[1], u = i[2], d = c - a, f = l - o, p = d * d + f * f, m, h;
464
- if (p < le) h = Math.log(u / s) / t, m = function(e) {
465
- return [
466
- a + e * d,
467
- o + e * f,
468
- s * Math.exp(t * e * h)
469
- ];
470
- };
471
- else {
472
- var g = Math.sqrt(p), _ = (u * u - s * s + r * p) / (2 * s * n * g), v = (u * u - s * s - r * p) / (2 * u * n * g), y = Math.log(Math.sqrt(_ * _ + 1) - _);
473
- h = (Math.log(Math.sqrt(v * v + 1) - v) - y) / t, m = function(e) {
474
- var r = e * h, i = F(y), c = s / (n * g) * (i * de(t * r + y) - ue(y));
475
- return [
476
- a + c * d,
477
- o + c * f,
478
- s * i / F(t * r + y)
479
- ];
480
- };
481
- }
482
- return m.duration = h * 1e3 * t / Math.SQRT2, m;
483
- }
484
- return i.rho = function(t) {
485
- var n = Math.max(.001, +t), r = n * n;
486
- return e(n, r, r * r);
487
- }, i;
488
- })(Math.SQRT2, 2, 4), pe = { passive: !1 }, I = {
489
- capture: !0,
490
- passive: !1
491
- };
492
- function L(e) {
493
- e.stopImmediatePropagation();
494
- }
495
- function R(e) {
496
- e.preventDefault(), e.stopImmediatePropagation();
497
- }
498
- //#endregion
499
- //#region node_modules/d3-drag/src/nodrag.js
500
- function z(e) {
501
- var t = e.document.documentElement, n = r(e).on("dragstart.drag", R, I);
502
- "onselectstart" in t ? n.on("selectstart.drag", R, I) : (t.__noselect = t.style.MozUserSelect, t.style.MozUserSelect = "none");
503
- }
504
- function B(e, t) {
505
- var n = e.document.documentElement, i = r(e).on("dragstart.drag", null);
506
- t && (i.on("click.drag", R, I), setTimeout(function() {
507
- i.on("click.drag", null);
508
- }, 0)), "onselectstart" in n ? i.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect);
509
- }
510
- //#endregion
511
- //#region node_modules/d3-drag/src/constant.js
512
- var V = (e) => () => e;
513
- //#endregion
514
- //#region node_modules/d3-drag/src/event.js
515
- function H(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a, x: o, y: s, dx: c, dy: l, dispatch: u }) {
516
- Object.defineProperties(this, {
517
- type: {
518
- value: e,
519
- enumerable: !0,
520
- configurable: !0
521
- },
522
- sourceEvent: {
523
- value: t,
524
- enumerable: !0,
525
- configurable: !0
526
- },
527
- subject: {
528
- value: n,
529
- enumerable: !0,
530
- configurable: !0
531
- },
532
- target: {
533
- value: r,
534
- enumerable: !0,
535
- configurable: !0
536
- },
537
- identifier: {
538
- value: i,
539
- enumerable: !0,
540
- configurable: !0
541
- },
542
- active: {
543
- value: a,
544
- enumerable: !0,
545
- configurable: !0
546
- },
547
- x: {
548
- value: o,
549
- enumerable: !0,
550
- configurable: !0
551
- },
552
- y: {
553
- value: s,
554
- enumerable: !0,
555
- configurable: !0
556
- },
557
- dx: {
558
- value: c,
559
- enumerable: !0,
560
- configurable: !0
561
- },
562
- dy: {
563
- value: l,
564
- enumerable: !0,
565
- configurable: !0
566
- },
567
- _: { value: u }
568
- });
569
- }
570
- H.prototype.on = function() {
571
- var e = this._.on.apply(this._, arguments);
572
- return e === this._ ? this : e;
573
- };
574
- //#endregion
575
- //#region node_modules/d3-drag/src/drag.js
576
- function me(e) {
577
- return !e.ctrlKey && !e.button;
578
- }
579
- function he() {
580
- return this.parentNode;
581
- }
582
- function ge(e, t) {
583
- return t ?? {
584
- x: e.x,
585
- y: e.y
586
- };
587
- }
588
- function _e() {
589
- return navigator.maxTouchPoints || "ontouchstart" in this;
590
- }
591
- function ve() {
592
- var e = me, n = he, i = ge, a = _e, o = {}, s = t("start", "drag", "end"), c = 0, l, u, d, f, p = 0;
593
- function m(e) {
594
- e.on("mousedown.drag", h).filter(a).on("touchstart.drag", v).on("touchmove.drag", y, pe).on("touchend.drag touchcancel.drag", b).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
595
- }
596
- function h(t, i) {
597
- if (!f && e.call(this, t, i)) {
598
- var a = x(this, n.call(this, t, i), t, i, "mouse");
599
- a && (r(t.view).on("mousemove.drag", g, I).on("mouseup.drag", _, I), z(t.view), L(t), d = !1, l = t.clientX, u = t.clientY, a("start", t));
600
- }
601
- }
602
- function g(e) {
603
- if (R(e), !d) {
604
- var t = e.clientX - l, n = e.clientY - u;
605
- d = t * t + n * n > p;
606
- }
607
- o.mouse("drag", e);
608
- }
609
- function _(e) {
610
- r(e.view).on("mousemove.drag mouseup.drag", null), B(e.view, d), R(e), o.mouse("end", e);
611
- }
612
- function v(t, r) {
613
- if (e.call(this, t, r)) for (var i = t.changedTouches, a = n.call(this, t, r), o = i.length, s = 0, c; s < o; ++s) (c = x(this, a, t, r, i[s].identifier, i[s])) && (L(t), c("start", t, i[s]));
614
- }
615
- function y(e) {
616
- for (var t = e.changedTouches, n = t.length, r = 0, i; r < n; ++r) (i = o[t[r].identifier]) && (R(e), i("drag", e, t[r]));
617
- }
618
- function b(e) {
619
- var t = e.changedTouches, n = t.length, r, i;
620
- for (f && clearTimeout(f), f = setTimeout(function() {
621
- f = null;
622
- }, 500), r = 0; r < n; ++r) (i = o[t[r].identifier]) && (L(e), i("end", e, t[r]));
623
- }
624
- function x(e, t, n, r, a, l) {
625
- var u = s.copy(), d = P(l || n, t), f, p, h;
626
- if ((h = i.call(e, new H("beforestart", {
627
- sourceEvent: n,
628
- target: m,
629
- identifier: a,
630
- active: c,
631
- x: d[0],
632
- y: d[1],
633
- dx: 0,
634
- dy: 0,
635
- dispatch: u
636
- }), r)) != null) return f = h.x - d[0] || 0, p = h.y - d[1] || 0, function n(i, s, l) {
637
- var g = d, _;
638
- switch (i) {
639
- case "start":
640
- o[a] = n, _ = c++;
641
- break;
642
- case "end": delete o[a], --c;
643
- case "drag": d = P(l || s, t), _ = c;
644
- }
645
- u.call(i, e, new H(i, {
646
- sourceEvent: s,
647
- subject: h,
648
- target: m,
649
- identifier: a,
650
- active: _,
651
- x: d[0] + f,
652
- y: d[1] + p,
653
- dx: d[0] - g[0],
654
- dy: d[1] - g[1],
655
- dispatch: u
656
- }), r);
657
- };
658
- }
659
- return m.filter = function(t) {
660
- return arguments.length ? (e = typeof t == "function" ? t : V(!!t), m) : e;
661
- }, m.container = function(e) {
662
- return arguments.length ? (n = typeof e == "function" ? e : V(e), m) : n;
663
- }, m.subject = function(e) {
664
- return arguments.length ? (i = typeof e == "function" ? e : V(e), m) : i;
665
- }, m.touchable = function(e) {
666
- return arguments.length ? (a = typeof e == "function" ? e : V(!!e), m) : a;
667
- }, m.on = function() {
668
- var e = s.on.apply(s, arguments);
669
- return e === s ? m : e;
670
- }, m.clickDistance = function(e) {
671
- return arguments.length ? (p = (e = +e) * e, m) : Math.sqrt(p);
672
- }, m;
673
- }
674
- //#endregion
675
- //#region node_modules/d3-zoom/src/constant.js
676
- var U = (e) => () => e;
677
- //#endregion
678
- //#region node_modules/d3-zoom/src/event.js
679
- function ye(e, { sourceEvent: t, target: n, transform: r, dispatch: i }) {
680
- Object.defineProperties(this, {
681
- type: {
682
- value: e,
683
- enumerable: !0,
684
- configurable: !0
685
- },
686
- sourceEvent: {
687
- value: t,
688
- enumerable: !0,
689
- configurable: !0
690
- },
691
- target: {
692
- value: n,
693
- enumerable: !0,
694
- configurable: !0
695
- },
696
- transform: {
697
- value: r,
698
- enumerable: !0,
699
- configurable: !0
700
- },
701
- _: { value: i }
702
- });
703
- }
704
- //#endregion
705
- //#region node_modules/d3-zoom/src/transform.js
706
- function W(e, t, n) {
707
- this.k = e, this.x = t, this.y = n;
708
- }
709
- W.prototype = {
710
- constructor: W,
711
- scale: function(e) {
712
- return e === 1 ? this : new W(this.k * e, this.x, this.y);
713
- },
714
- translate: function(e, t) {
715
- return e === 0 & t === 0 ? this : new W(this.k, this.x + this.k * e, this.y + this.k * t);
716
- },
717
- apply: function(e) {
718
- return [e[0] * this.k + this.x, e[1] * this.k + this.y];
719
- },
720
- applyX: function(e) {
721
- return e * this.k + this.x;
722
- },
723
- applyY: function(e) {
724
- return e * this.k + this.y;
725
- },
726
- invert: function(e) {
727
- return [(e[0] - this.x) / this.k, (e[1] - this.y) / this.k];
728
- },
729
- invertX: function(e) {
730
- return (e - this.x) / this.k;
731
- },
732
- invertY: function(e) {
733
- return (e - this.y) / this.k;
734
- },
735
- rescaleX: function(e) {
736
- return e.copy().domain(e.range().map(this.invertX, this).map(e.invert, e));
737
- },
738
- rescaleY: function(e) {
739
- return e.copy().domain(e.range().map(this.invertY, this).map(e.invert, e));
740
- },
741
- toString: function() {
742
- return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
743
- }
744
- };
745
- var G = new W(1, 0, 0);
746
- be.prototype = W.prototype;
747
- function be(e) {
748
- for (; !e.__zoom;) if (!(e = e.parentNode)) return G;
749
- return e.__zoom;
750
- }
751
- //#endregion
752
- //#region node_modules/d3-zoom/src/noevent.js
753
- function K(e) {
754
- e.stopImmediatePropagation();
755
- }
756
- function q(e) {
757
- e.preventDefault(), e.stopImmediatePropagation();
758
- }
759
- //#endregion
760
- //#region node_modules/d3-zoom/src/zoom.js
761
- function xe(e) {
762
- return (!e.ctrlKey || e.type === "wheel") && !e.button;
763
- }
764
- function Se() {
765
- var e = this;
766
- return e instanceof SVGElement ? (e = e.ownerSVGElement || e, e.hasAttribute("viewBox") ? (e = e.viewBox.baseVal, [[e.x, e.y], [e.x + e.width, e.y + e.height]]) : [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]]) : [[0, 0], [e.clientWidth, e.clientHeight]];
767
- }
768
- function J() {
769
- return this.__zoom || G;
770
- }
771
- function Ce(e) {
772
- return -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * (e.ctrlKey ? 10 : 1);
773
- }
774
- function we() {
775
- return navigator.maxTouchPoints || "ontouchstart" in this;
776
- }
777
- function Y(e, t, n) {
778
- var r = e.invertX(t[0][0]) - n[0][0], i = e.invertX(t[1][0]) - n[1][0], a = e.invertY(t[0][1]) - n[0][1], o = e.invertY(t[1][1]) - n[1][1];
779
- return e.translate(i > r ? (r + i) / 2 : Math.min(0, r) || Math.max(0, i), o > a ? (a + o) / 2 : Math.min(0, a) || Math.max(0, o));
780
- }
781
- function Te() {
782
- var e = xe, i = Se, a = Y, o = Ce, s = we, c = [0, Infinity], l = [[-Infinity, -Infinity], [Infinity, Infinity]], u = 250, d = fe, f = t("start", "zoom", "end"), p, m, h, g = 500, _ = 150, v = 0, y = 10;
783
- function b(e) {
784
- e.property("__zoom", J).on("wheel.zoom", D, { passive: !1 }).on("mousedown.zoom", O).on("dblclick.zoom", k).filter(s).on("touchstart.zoom", A).on("touchmove.zoom", j).on("touchend.zoom touchcancel.zoom", M).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
785
- }
786
- b.transform = function(e, t, n, r) {
787
- var i = e.selection ? e.selection() : e;
788
- i.property("__zoom", J), e === i ? i.interrupt().each(function() {
789
- T(this, arguments).event(r).start().zoom(null, typeof t == "function" ? t.apply(this, arguments) : t).end();
790
- }) : w(e, t, n, r);
791
- }, b.scaleBy = function(e, t, n, r) {
792
- b.scaleTo(e, function() {
793
- return this.__zoom.k * (typeof t == "function" ? t.apply(this, arguments) : t);
794
- }, n, r);
795
- }, b.scaleTo = function(e, t, n, r) {
796
- b.transform(e, function() {
797
- var e = i.apply(this, arguments), r = this.__zoom, o = n == null ? C(e) : typeof n == "function" ? n.apply(this, arguments) : n, s = r.invert(o), c = typeof t == "function" ? t.apply(this, arguments) : t;
798
- return a(S(x(r, c), o, s), e, l);
799
- }, n, r);
800
- }, b.translateBy = function(e, t, n, r) {
801
- b.transform(e, function() {
802
- return a(this.__zoom.translate(typeof t == "function" ? t.apply(this, arguments) : t, typeof n == "function" ? n.apply(this, arguments) : n), i.apply(this, arguments), l);
803
- }, null, r);
804
- }, b.translateTo = function(e, t, n, r, o) {
805
- b.transform(e, function() {
806
- var e = i.apply(this, arguments), o = this.__zoom, s = r == null ? C(e) : typeof r == "function" ? r.apply(this, arguments) : r;
807
- return a(G.translate(s[0], s[1]).scale(o.k).translate(typeof t == "function" ? -t.apply(this, arguments) : -t, typeof n == "function" ? -n.apply(this, arguments) : -n), e, l);
808
- }, r, o);
809
- };
810
- function x(e, t) {
811
- return t = Math.max(c[0], Math.min(c[1], t)), t === e.k ? e : new W(t, e.x, e.y);
812
- }
813
- function S(e, t, n) {
814
- var r = t[0] - n[0] * e.k, i = t[1] - n[1] * e.k;
815
- return r === e.x && i === e.y ? e : new W(e.k, r, i);
816
- }
817
- function C(e) {
818
- return [(+e[0][0] + +e[1][0]) / 2, (+e[0][1] + +e[1][1]) / 2];
819
- }
820
- function w(e, t, n, r) {
821
- e.on("start.zoom", function() {
822
- T(this, arguments).event(r).start();
823
- }).on("interrupt.zoom end.zoom", function() {
824
- T(this, arguments).event(r).end();
825
- }).tween("zoom", function() {
826
- var e = this, a = arguments, o = T(e, a).event(r), s = i.apply(e, a), c = n == null ? C(s) : typeof n == "function" ? n.apply(e, a) : n, l = Math.max(s[1][0] - s[0][0], s[1][1] - s[0][1]), u = e.__zoom, f = typeof t == "function" ? t.apply(e, a) : t, p = d(u.invert(c).concat(l / u.k), f.invert(c).concat(l / f.k));
827
- return function(e) {
828
- if (e === 1) e = f;
829
- else {
830
- var t = p(e), n = l / t[2];
831
- e = new W(n, c[0] - t[0] * n, c[1] - t[1] * n);
832
- }
833
- o.zoom(null, e);
834
- };
835
- });
836
- }
837
- function T(e, t, n) {
838
- return !n && e.__zooming || new E(e, t);
839
- }
840
- function E(e, t) {
841
- this.that = e, this.args = t, this.active = 0, this.sourceEvent = null, this.extent = i.apply(e, t), this.taps = 0;
842
- }
843
- E.prototype = {
844
- event: function(e) {
845
- return e && (this.sourceEvent = e), this;
846
- },
847
- start: function() {
848
- return ++this.active === 1 && (this.that.__zooming = this, this.emit("start")), this;
849
- },
850
- zoom: function(e, t) {
851
- return this.mouse && e !== "mouse" && (this.mouse[1] = t.invert(this.mouse[0])), this.touch0 && e !== "touch" && (this.touch0[1] = t.invert(this.touch0[0])), this.touch1 && e !== "touch" && (this.touch1[1] = t.invert(this.touch1[0])), this.that.__zoom = t, this.emit("zoom"), this;
852
- },
853
- end: function() {
854
- return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
855
- },
856
- emit: function(e) {
857
- var t = r(this.that).datum();
858
- f.call(e, this.that, new ye(e, {
859
- sourceEvent: this.sourceEvent,
860
- target: b,
861
- type: e,
862
- transform: this.that.__zoom,
863
- dispatch: f
864
- }), t);
865
- }
866
- };
867
- function D(t, ...r) {
868
- if (!e.apply(this, arguments)) return;
869
- var i = T(this, r).event(t), s = this.__zoom, u = Math.max(c[0], Math.min(c[1], s.k * 2 ** o.apply(this, arguments))), d = P(t);
870
- if (i.wheel) (i.mouse[0][0] !== d[0] || i.mouse[0][1] !== d[1]) && (i.mouse[1] = s.invert(i.mouse[0] = d)), clearTimeout(i.wheel);
871
- else if (s.k === u) return;
872
- else i.mouse = [d, s.invert(d)], n(this), i.start();
873
- q(t), i.wheel = setTimeout(f, _), i.zoom("mouse", a(S(x(s, u), i.mouse[0], i.mouse[1]), i.extent, l));
874
- function f() {
875
- i.wheel = null, i.end();
876
- }
877
- }
878
- function O(t, ...i) {
879
- if (h || !e.apply(this, arguments)) return;
880
- var o = t.currentTarget, s = T(this, i, !0).event(t), c = r(t.view).on("mousemove.zoom", p, !0).on("mouseup.zoom", m, !0), u = P(t, o), d = t.clientX, f = t.clientY;
881
- z(t.view), K(t), s.mouse = [u, this.__zoom.invert(u)], n(this), s.start();
882
- function p(e) {
883
- if (q(e), !s.moved) {
884
- var t = e.clientX - d, n = e.clientY - f;
885
- s.moved = t * t + n * n > v;
886
- }
887
- s.event(e).zoom("mouse", a(S(s.that.__zoom, s.mouse[0] = P(e, o), s.mouse[1]), s.extent, l));
888
- }
889
- function m(e) {
890
- c.on("mousemove.zoom mouseup.zoom", null), B(e.view, s.moved), q(e), s.event(e).end();
891
- }
892
- }
893
- function k(t, ...n) {
894
- if (e.apply(this, arguments)) {
895
- var o = this.__zoom, s = P(t.changedTouches ? t.changedTouches[0] : t, this), c = o.invert(s), d = o.k * (t.shiftKey ? .5 : 2), f = a(S(x(o, d), s, c), i.apply(this, n), l);
896
- q(t), u > 0 ? r(this).transition().duration(u).call(w, f, s, t) : r(this).call(b.transform, f, s, t);
897
- }
898
- }
899
- function A(t, ...r) {
900
- if (e.apply(this, arguments)) {
901
- var i = t.touches, a = i.length, o = T(this, r, t.changedTouches.length === a).event(t), s, c, l, u;
902
- for (K(t), c = 0; c < a; ++c) l = i[c], u = P(l, this), u = [
903
- u,
904
- this.__zoom.invert(u),
905
- l.identifier
906
- ], o.touch0 ? !o.touch1 && o.touch0[2] !== u[2] && (o.touch1 = u, o.taps = 0) : (o.touch0 = u, s = !0, o.taps = 1 + !!p);
907
- p &&= clearTimeout(p), s && (o.taps < 2 && (m = u[0], p = setTimeout(function() {
908
- p = null;
909
- }, g)), n(this), o.start());
910
- }
911
- }
912
- function j(e, ...t) {
913
- if (this.__zooming) {
914
- var n = T(this, t).event(e), r = e.changedTouches, i = r.length, o, s, c, u;
915
- for (q(e), o = 0; o < i; ++o) s = r[o], c = P(s, this), n.touch0 && n.touch0[2] === s.identifier ? n.touch0[0] = c : n.touch1 && n.touch1[2] === s.identifier && (n.touch1[0] = c);
916
- if (s = n.that.__zoom, n.touch1) {
917
- var d = n.touch0[0], f = n.touch0[1], p = n.touch1[0], m = n.touch1[1], h = (h = p[0] - d[0]) * h + (h = p[1] - d[1]) * h, g = (g = m[0] - f[0]) * g + (g = m[1] - f[1]) * g;
918
- s = x(s, Math.sqrt(h / g)), c = [(d[0] + p[0]) / 2, (d[1] + p[1]) / 2], u = [(f[0] + m[0]) / 2, (f[1] + m[1]) / 2];
919
- } else if (n.touch0) c = n.touch0[0], u = n.touch0[1];
920
- else return;
921
- n.zoom("touch", a(S(s, c, u), n.extent, l));
922
- }
923
- }
924
- function M(e, ...t) {
925
- if (this.__zooming) {
926
- var n = T(this, t).event(e), i = e.changedTouches, a = i.length, o, s;
927
- for (K(e), h && clearTimeout(h), h = setTimeout(function() {
928
- h = null;
929
- }, g), o = 0; o < a; ++o) s = i[o], n.touch0 && n.touch0[2] === s.identifier ? delete n.touch0 : n.touch1 && n.touch1[2] === s.identifier && delete n.touch1;
930
- if (n.touch1 && !n.touch0 && (n.touch0 = n.touch1, delete n.touch1), n.touch0) n.touch0[1] = this.__zoom.invert(n.touch0[0]);
931
- else if (n.end(), n.taps === 2 && (s = P(s, this), Math.hypot(m[0] - s[0], m[1] - s[1]) < y)) {
932
- var c = r(this).on("dblclick.zoom");
933
- c && c.apply(this, arguments);
934
- }
935
- }
936
- }
937
- return b.wheelDelta = function(e) {
938
- return arguments.length ? (o = typeof e == "function" ? e : U(+e), b) : o;
939
- }, b.filter = function(t) {
940
- return arguments.length ? (e = typeof t == "function" ? t : U(!!t), b) : e;
941
- }, b.touchable = function(e) {
942
- return arguments.length ? (s = typeof e == "function" ? e : U(!!e), b) : s;
943
- }, b.extent = function(e) {
944
- return arguments.length ? (i = typeof e == "function" ? e : U([[+e[0][0], +e[0][1]], [+e[1][0], +e[1][1]]]), b) : i;
945
- }, b.scaleExtent = function(e) {
946
- return arguments.length ? (c[0] = +e[0], c[1] = +e[1], b) : [c[0], c[1]];
947
- }, b.translateExtent = function(e) {
948
- return arguments.length ? (l[0][0] = +e[0][0], l[1][0] = +e[1][0], l[0][1] = +e[0][1], l[1][1] = +e[1][1], b) : [[l[0][0], l[0][1]], [l[1][0], l[1][1]]];
949
- }, b.constrain = function(e) {
950
- return arguments.length ? (a = e, b) : a;
951
- }, b.duration = function(e) {
952
- return arguments.length ? (u = +e, b) : u;
953
- }, b.interpolate = function(e) {
954
- return arguments.length ? (d = e, b) : d;
955
- }, b.on = function() {
956
- var e = f.on.apply(f, arguments);
957
- return e === f ? b : e;
958
- }, b.clickDistance = function(e) {
959
- return arguments.length ? (v = (e = +e) * e, b) : Math.sqrt(v);
960
- }, b.tapDistance = function(e) {
961
- return arguments.length ? (y = +e, b) : y;
962
- }, b;
963
- }
964
- //#endregion
965
- //#region src/networkDiagram.ts
966
- var Ee = -300, De = 100, X = 640, Z = 480, Oe = 180, Q = 20, ke = 22, $ = {
967
- linkStroke: "#9ca3af",
968
- nodeFill: "#2563eb",
969
- nodeFillHovered: "#3b82f6",
970
- nodeFillSelected: "#f59e0b",
971
- nodeStroke: "#1e40af",
972
- nodeStrokeHovered: "#1d4ed8",
973
- nodeStrokeSelected: "#b45309",
974
- nodeText: "#ffffff"
975
- };
976
- function Ae(e, t, n = {}) {
977
- let a = t.clientWidth || X, o = t.clientHeight || Z, s = e.nodes.map((e) => ({ ...e })), c = e.links.map((e) => ({ ...e })), l = Math.min(a, o) * .22;
978
- for (let [e, t] of s.entries()) {
979
- let n = e / s.length * Math.PI * 2;
980
- t.x = a / 2 + Math.cos(n) * l, t.y = o / 2 + Math.sin(n) * l;
981
- }
982
- let u = oe(s).force("link", j(c).id((e) => e.id).distance(n.linkDistance ?? De)).force("charge", se().strength(n.chargeStrength ?? Ee)).force("center", i(a / 2, o / 2)), d = r(t).append("svg").attr("width", a).attr("height", o).attr("viewBox", `0 0 ${String(a)} ${String(o)}`).style("touch-action", "none"), f = d.append("g"), p = f.selectAll("line").data(c).join("line").attr("stroke", $.linkStroke).attr("stroke-width", 2), m = f.selectAll("g").data(s).join("g").style("cursor", "pointer");
983
- m.append("circle").attr("r", Q).attr("fill", $.nodeFill).attr("stroke", $.nodeStroke).attr("stroke-width", 2), m.append("text").text((e) => e.id).attr("text-anchor", "middle").attr("dy", 4).attr("fill", $.nodeText);
984
- let h = null, g = null, _ = () => {
985
- m.selectAll("circle").attr("fill", (e) => e.id === h ? $.nodeFillSelected : e.id === g ? $.nodeFillHovered : $.nodeFill).attr("stroke", (e) => e.id === h ? $.nodeStrokeSelected : e.id === g ? $.nodeStrokeHovered : $.nodeStroke).attr("stroke-width", (e) => e.id === h ? 3 : 2).attr("r", (e) => e.id === h || e.id === g ? ke : Q);
986
- };
987
- m.on("mouseenter", (e, t) => {
988
- g = t.id, _();
989
- }).on("mouseleave", (e, t) => {
990
- g === t.id && (g = null), _();
991
- }).on("click", (e, t) => {
992
- e.stopPropagation(), h = h === t.id ? null : t.id, _();
993
- }), d.on("click", () => {
994
- h = null, _();
995
- });
996
- let v = Te().scaleExtent([.5, 4]).on("zoom", (e) => {
997
- f.attr("transform", e.transform.toString());
998
- });
999
- d.call(v).on("dblclick.zoom", null);
1000
- let y = (e, t) => typeof e == "object" ? e[t] ?? 0 : 0, b = () => {
1001
- p.attr("x1", (e) => y(e.source, "x")).attr("y1", (e) => y(e.source, "y")).attr("x2", (e) => y(e.target, "x")).attr("y2", (e) => y(e.target, "y")), m.attr("transform", (e) => `translate(${String(e.x ?? 0)},${String(e.y ?? 0)})`);
1002
- };
1003
- u.stop(), m.call(ve().on("start", (e, t) => {
1004
- e.sourceEvent?.stopPropagation(), t.fx = t.x, t.fy = t.y;
1005
- }).on("drag", (e, t) => {
1006
- t.x = e.x, t.y = e.y, t.fx = e.x, t.fy = e.y, b();
1007
- }).on("end", (e, t) => {
1008
- t.fx = null, t.fy = null;
1009
- })), b();
1010
- let x = d.node();
1011
- if (x == null) throw Error("Failed to create network diagram SVG element.");
1012
- return {
1013
- destroy: () => {
1014
- u.stop(), d.remove();
1015
- },
1016
- resize: () => {
1017
- let e = t.clientWidth || X, n = t.clientHeight || Z;
1018
- d.attr("width", e).attr("height", n).attr("viewBox", `0 0 ${String(e)} ${String(n)}`), u.force("center", i(e / 2, n / 2));
1019
- },
1020
- svg: x,
1021
- triggerAutoLayout: () => {
1022
- u.alpha(1);
1023
- for (let e = 0; e < Oe; e += 1) u.tick();
1024
- u.stop(), b();
1025
- }
1026
- };
1027
- }
1028
- //#endregion
1029
- export { Ae as renderNetworkDiagram };