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