@dpuse/dpuse-tool-d3-visualiser 1.0.118 → 1.0.122

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 (38) hide show
  1. package/README.md +205 -243
  2. package/dist/chordDiagram-Cm91Tmgo.js +1729 -0
  3. package/dist/d3-hierarchy-Dtx4jD78.js +269 -0
  4. package/dist/{linear-CNetDix0.js → d3-scale-BYykLEPO.js} +238 -177
  5. package/dist/{select-SZKizDc7.js → d3-selection-CL8c_tE2.js} +230 -232
  6. package/dist/d3-shape-gf8U18pS.js +1133 -0
  7. package/dist/dpuse-tool-d3-visualiser.es.js +6 -6
  8. package/dist/{erdDiagram-DKsqCN08.js → erdDiagram-DmYSx8Dh.js} +1 -1
  9. package/dist/{networkDiagram-BiCPMNf8.js → networkDiagram-UdFs1ySs.js} +385 -368
  10. package/dist/{sankeyDiagram-DcI-D1uh.js → sankeyDiagram-Dbl1-v5p.js} +31 -31
  11. package/dist/shipped-packages.json +11 -20
  12. package/dist/{src-DAMkWOaT.js → src-YHHReglY.js} +32 -32
  13. package/dist/{tanStackCharts-5HHGfe6p.js → tanStackCharts-DEINbmRi.js} +1041 -1096
  14. package/dist/treeDiagram-t0oFwi1c.js +49 -0
  15. package/dist/types/src/networkDiagram.d.ts +4 -0
  16. package/package.json +25 -23
  17. package/dist/array-CpxKKsZm.js +0 -12
  18. package/dist/array-CpxKKsZm.js.map +0 -1
  19. package/dist/chordDiagram-Dbu2uT_s.js +0 -3588
  20. package/dist/chordDiagram-Dbu2uT_s.js.map +0 -1
  21. package/dist/dpuse-tool-d3-visualiser.es.js.map +0 -1
  22. package/dist/erdDiagram-DKsqCN08.js.map +0 -1
  23. package/dist/hierarchy-DU9LihDu.js +0 -135
  24. package/dist/hierarchy-DU9LihDu.js.map +0 -1
  25. package/dist/linear-CNetDix0.js.map +0 -1
  26. package/dist/link-CAkrxHYd.js +0 -62
  27. package/dist/link-CAkrxHYd.js.map +0 -1
  28. package/dist/networkDiagram-BiCPMNf8.js.map +0 -1
  29. package/dist/palette-D5DTPmuA.js.map +0 -1
  30. package/dist/point-_U9MxSuk.js +0 -85
  31. package/dist/point-_U9MxSuk.js.map +0 -1
  32. package/dist/sankeyDiagram-DcI-D1uh.js.map +0 -1
  33. package/dist/select-SZKizDc7.js.map +0 -1
  34. package/dist/src-DAMkWOaT.js.map +0 -1
  35. package/dist/string-BzfQLSds.js.map +0 -1
  36. package/dist/tanStackCharts-5HHGfe6p.js.map +0 -1
  37. package/dist/treeDiagram-fmrYqvXl.js +0 -126
  38. package/dist/treeDiagram-fmrYqvXl.js.map +0 -1
@@ -1,24 +1,5 @@
1
- import { n as e, r as t, t as n } from "./src-DAMkWOaT.js";
2
- import { t as r } from "./select-SZKizDc7.js";
3
- // 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
- }
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";
22
3
  // node_modules/d3-quadtree/src/add.js
23
4
  function a(e) {
24
5
  let t = +this._x.call(null, e), n = +this._y.call(null, e);
@@ -216,18 +197,34 @@ E.copy = function() {
216
197
  }) : t.target[i] = T(r));
217
198
  return e;
218
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;
219
- // node_modules/d3-force/src/constant.js
220
- function D(e) {
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) {
221
220
  return function() {
222
221
  return e;
223
222
  };
224
223
  }
225
- // node_modules/d3-force/src/jiggle.js
226
- function O(e) {
224
+ function k(e) {
227
225
  return (e() - .5) * 1e-6;
228
226
  }
229
- // node_modules/d3-force/src/link.js
230
- function k(e) {
227
+ function ee(e) {
231
228
  return e.index;
232
229
  }
233
230
  function A(e, t) {
@@ -236,13 +233,13 @@ function A(e, t) {
236
233
  return n;
237
234
  }
238
235
  function j(e) {
239
- var t = k, n = d, r, i = D(30), a, o, s, c, l, u = 1;
236
+ var t = ee, n = d, r, i = O(30), a, o, s, c, l, u = 1;
240
237
  e ??= [];
241
238
  function d(e) {
242
239
  return 1 / Math.min(s[e.source.index], s[e.target.index]);
243
240
  }
244
241
  function f(t) {
245
- 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;
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;
246
243
  }
247
244
  function p() {
248
245
  if (o) {
@@ -267,98 +264,95 @@ function j(e) {
267
264
  }, f.iterations = function(e) {
268
265
  return arguments.length ? (u = +e, f) : u;
269
266
  }, f.strength = function(e) {
270
- return arguments.length ? (n = typeof e == "function" ? e : D(+e), m(), f) : n;
267
+ return arguments.length ? (n = typeof e == "function" ? e : O(+e), m(), f) : n;
271
268
  }, f.distance = function(e) {
272
- return arguments.length ? (i = typeof e == "function" ? e : D(+e), h(), f) : i;
269
+ return arguments.length ? (i = typeof e == "function" ? e : O(+e), h(), f) : i;
273
270
  }, f;
274
271
  }
275
- // node_modules/d3-force/src/lcg.js
276
- var M = 1664525, ee = 1013904223, N = 4294967296;
277
- function te() {
272
+ var M = 1664525, te = 1013904223, N = 4294967296;
273
+ function ne() {
278
274
  let e = 1;
279
- return () => (e = (M * e + ee) % N) / N;
275
+ return () => (e = (M * e + te) % N) / N;
280
276
  }
281
- // node_modules/d3-force/src/simulation.js
282
- function ne(e) {
277
+ function re(e) {
283
278
  return e.x;
284
279
  }
285
- function re(e) {
280
+ function ie(e) {
286
281
  return e.y;
287
282
  }
288
- var ie = 10, ae = Math.PI * (3 - Math.sqrt(5));
289
- function oe(n) {
290
- 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();
291
- n ??= [];
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 ??= [];
292
287
  function p() {
293
- m(), d.call("tick", r), i < a && (u.stop(), d.call("end", r));
288
+ m(), d.call("tick", t), i < a && (u.stop(), d.call("end", t));
294
289
  }
295
- function m(e) {
296
- var t, a = n.length, u;
297
- e === void 0 && (e = 1);
298
- for (var d = 0; d < e; ++d) for (i += (s - i) * o, l.forEach(function(e) {
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) {
299
294
  e(i);
300
- }), 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);
301
- return r;
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;
302
297
  }
303
298
  function h() {
304
- for (var e = 0, t = n.length, r; e < t; ++e) {
305
- 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)) {
306
- var i = ie * Math.sqrt(.5 + e), a = e * ae;
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;
307
302
  r.x = i * Math.cos(a), r.y = i * Math.sin(a);
308
303
  }
309
304
  (isNaN(r.vx) || isNaN(r.vy)) && (r.vx = r.vy = 0);
310
305
  }
311
306
  }
312
- function g(e) {
313
- return e.initialize && e.initialize(n, f), e;
307
+ function g(t) {
308
+ return t.initialize && t.initialize(e, f), t;
314
309
  }
315
- return h(), r = {
310
+ return h(), t = {
316
311
  tick: m,
317
312
  restart: function() {
318
- return u.restart(p), r;
313
+ return u.restart(p), t;
319
314
  },
320
315
  stop: function() {
321
- return u.stop(), r;
316
+ return u.stop(), t;
322
317
  },
323
- nodes: function(e) {
324
- return arguments.length ? (n = e, h(), l.forEach(g), r) : n;
318
+ nodes: function(n) {
319
+ return arguments.length ? (e = n, h(), l.forEach(g), t) : e;
325
320
  },
326
321
  alpha: function(e) {
327
- return arguments.length ? (i = +e, r) : i;
322
+ return arguments.length ? (i = +e, t) : i;
328
323
  },
329
324
  alphaMin: function(e) {
330
- return arguments.length ? (a = +e, r) : a;
325
+ return arguments.length ? (a = +e, t) : a;
331
326
  },
332
327
  alphaDecay: function(e) {
333
- return arguments.length ? (o = +e, r) : +o;
328
+ return arguments.length ? (o = +e, t) : +o;
334
329
  },
335
330
  alphaTarget: function(e) {
336
- return arguments.length ? (s = +e, r) : s;
331
+ return arguments.length ? (s = +e, t) : s;
337
332
  },
338
333
  velocityDecay: function(e) {
339
- return arguments.length ? (c = 1 - e, r) : 1 - c;
334
+ return arguments.length ? (c = 1 - e, t) : 1 - c;
340
335
  },
341
336
  randomSource: function(e) {
342
- return arguments.length ? (f = e, l.forEach(g), r) : f;
337
+ return arguments.length ? (f = e, l.forEach(g), t) : f;
343
338
  },
344
- force: function(e, t) {
345
- return arguments.length > 1 ? (t == null ? l.delete(e) : l.set(e, g(t)), r) : l.get(e);
339
+ force: function(e, n) {
340
+ return arguments.length > 1 ? (n == null ? l.delete(e) : l.set(e, g(n)), t) : l.get(e);
346
341
  },
347
- find: function(e, t, r) {
348
- var i = 0, a = n.length, o, s, c, l, u;
349
- 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);
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);
350
345
  return u;
351
346
  },
352
- on: function(e, t) {
353
- return arguments.length > 1 ? (d.on(e, t), r) : d.on(e);
347
+ on: function(e, n) {
348
+ return arguments.length > 1 ? (d.on(e, n), t) : d.on(e);
354
349
  }
355
350
  };
356
351
  }
357
- // node_modules/d3-force/src/manyBody.js
358
- function se() {
359
- var e, t, n, r, i = D(-30), a, o = 1, s = Infinity, c = .81;
352
+ function ce() {
353
+ var e, t, n, r, i = O(-30), a, o = 1, s = Infinity, c = .81;
360
354
  function l(n) {
361
- var i, a = e.length, o = C(e, ne, re).visitAfter(d);
355
+ var i, a = e.length, o = C(e, re, ie).visitAfter(d);
362
356
  for (r = n, i = 0; i < a; ++i) t = e[i], o.visit(f);
363
357
  }
364
358
  function u() {
@@ -383,9 +377,9 @@ function se() {
383
377
  function f(e, i, l, u) {
384
378
  if (!e.value) return !0;
385
379
  var d = e.x - t.x, f = e.y - t.y, p = u - i, m = d * d + f * f;
386
- 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;
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;
387
381
  if (!(e.length || m >= s)) {
388
- (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)));
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)));
389
383
  do
390
384
  e.data !== t && (p = a[e.data.index] * r / m, t.vx += d * p, t.vy += f * p);
391
385
  while (e = e.next);
@@ -394,7 +388,7 @@ function se() {
394
388
  return l.initialize = function(t, r) {
395
389
  e = t, n = r, u();
396
390
  }, l.strength = function(e) {
397
- return arguments.length ? (i = typeof e == "function" ? e : D(+e), u(), l) : i;
391
+ return arguments.length ? (i = typeof e == "function" ? e : O(+e), u(), l) : i;
398
392
  }, l.distanceMin = function(e) {
399
393
  return arguments.length ? (o = e * e, l) : Math.sqrt(o);
400
394
  }, l.distanceMax = function(e) {
@@ -403,30 +397,9 @@ function se() {
403
397
  return arguments.length ? (c = e * e, l) : Math.sqrt(c);
404
398
  }, l;
405
399
  }
406
- // node_modules/d3-selection/src/sourceEvent.js
407
- function ce(e) {
408
- let t;
409
- for (; t = e.sourceEvent;) e = t;
410
- return e;
411
- }
412
- // node_modules/d3-selection/src/pointer.js
413
- function P(e, t) {
414
- if (e = ce(e), t === void 0 && (t = e.currentTarget), t) {
415
- var n = t.ownerSVGElement || t;
416
- if (n.createSVGPoint) {
417
- var r = n.createSVGPoint();
418
- return r.x = e.clientX, r.y = e.clientY, r = r.matrixTransform(t.getScreenCTM().inverse()), [r.x, r.y];
419
- }
420
- if (t.getBoundingClientRect) {
421
- var i = t.getBoundingClientRect();
422
- return [e.clientX - i.left - t.clientLeft, e.clientY - i.top - t.clientTop];
423
- }
424
- }
425
- return [e.pageX, e.pageY];
426
- }
427
400
  // node_modules/d3-interpolate/src/zoom.js
428
401
  var le = 1e-12;
429
- function F(e) {
402
+ function P(e) {
430
403
  return ((e = Math.exp(e)) + 1 / e) / 2;
431
404
  }
432
405
  function ue(e) {
@@ -448,11 +421,11 @@ var fe = (function e(t, n, r) {
448
421
  else {
449
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) - _);
450
423
  h = (Math.log(Math.sqrt(v * v + 1) - v) - y) / t, m = function(e) {
451
- var r = e * h, i = F(y), c = s / (n * g) * (i * de(t * r + y) - ue(y));
424
+ var r = e * h, i = P(y), c = s / (n * g) * (i * de(t * r + y) - ue(y));
452
425
  return [
453
426
  a + c * d,
454
427
  o + c * f,
455
- s * i / F(t * r + y)
428
+ s * i / P(t * r + y)
456
429
  ];
457
430
  };
458
431
  }
@@ -462,31 +435,28 @@ var fe = (function e(t, n, r) {
462
435
  var n = Math.max(.001, +t), r = n * n;
463
436
  return e(n, r, r * r);
464
437
  }, i;
465
- })(Math.SQRT2, 2, 4), pe = { passive: !1 }, I = {
438
+ })(Math.SQRT2, 2, 4), pe = { passive: !1 }, F = {
466
439
  capture: !0,
467
440
  passive: !1
468
441
  };
469
- function L(e) {
442
+ function I(e) {
470
443
  e.stopImmediatePropagation();
471
444
  }
472
- function R(e) {
445
+ function L(e) {
473
446
  e.preventDefault(), e.stopImmediatePropagation();
474
447
  }
475
- // node_modules/d3-drag/src/nodrag.js
476
- function z(e) {
477
- var t = e.document.documentElement, n = r(e).on("dragstart.drag", R, I);
478
- "onselectstart" in t ? n.on("selectstart.drag", R, I) : (t.__noselect = t.style.MozUserSelect, t.style.MozUserSelect = "none");
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");
479
451
  }
480
- function B(e, t) {
481
- var n = e.document.documentElement, i = r(e).on("dragstart.drag", null);
482
- t && (i.on("click.drag", R, I), setTimeout(function() {
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() {
483
455
  i.on("click.drag", null);
484
- }, 0)), "onselectstart" in n ? i.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect);
456
+ }, 0)), "onselectstart" in r ? i.on("selectstart.drag", null) : (r.style.MozUserSelect = r.__noselect, delete r.__noselect);
485
457
  }
486
- // node_modules/d3-drag/src/constant.js
487
- var V = (e) => () => e;
488
- // node_modules/d3-drag/src/event.js
489
- function H(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a, x: o, y: s, dx: c, dy: l, dispatch: u }) {
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 }) {
490
460
  Object.defineProperties(this, {
491
461
  type: {
492
462
  value: e,
@@ -541,11 +511,10 @@ function H(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a,
541
511
  _: { value: u }
542
512
  });
543
513
  }
544
- H.prototype.on = function() {
514
+ V.prototype.on = function() {
545
515
  var e = this._.on.apply(this._, arguments);
546
516
  return e === this._ ? this : e;
547
517
  };
548
- // node_modules/d3-drag/src/drag.js
549
518
  function me(e) {
550
519
  return !e.ctrlKey && !e.button;
551
520
  }
@@ -562,91 +531,90 @@ function _e() {
562
531
  return navigator.maxTouchPoints || "ontouchstart" in this;
563
532
  }
564
533
  function ve() {
565
- var e = me, n = he, i = ge, a = _e, o = {}, s = t("start", "drag", "end"), c = 0, l, u, d, f, p = 0;
566
- function m(e) {
567
- 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)");
568
- }
569
- function h(t, i) {
570
- if (!f && e.call(this, t, i)) {
571
- var a = x(this, n.call(this, t, i), t, i, "mouse");
572
- 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));
573
- }
574
- }
575
- function g(e) {
576
- if (R(e), !d) {
577
- var t = e.clientX - l, n = e.clientY - u;
578
- d = t * t + n * n > p;
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));
579
542
  }
580
- o.mouse("drag", e);
581
543
  }
582
544
  function _(e) {
583
- r(e.view).on("mousemove.drag mouseup.drag", null), B(e.view, d), R(e), o.mouse("end", 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);
584
550
  }
585
- function v(t, r) {
586
- 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]));
551
+ function v(t) {
552
+ e(t.view).on("mousemove.drag mouseup.drag", null), z(t.view, f), L(t), s.mouse("end", t);
587
553
  }
588
- function y(e) {
589
- 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]));
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]));
590
556
  }
591
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) {
592
561
  var t = e.changedTouches, n = t.length, r, i;
593
- for (f && clearTimeout(f), f = setTimeout(function() {
594
- f = null;
595
- }, 500), r = 0; r < n; ++r) (i = o[t[r].identifier]) && (L(e), i("end", e, t[r]));
596
- }
597
- function x(e, t, n, r, a, l) {
598
- var u = s.copy(), d = P(l || n, t), f, p, h;
599
- if ((h = i.call(e, new H("beforestart", {
600
- sourceEvent: n,
601
- target: m,
602
- identifier: a,
603
- active: c,
604
- x: d[0],
605
- y: d[1],
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],
606
575
  dx: 0,
607
576
  dy: 0,
608
- dispatch: u
609
- }), r)) != null) return f = h.x - d[0] || 0, p = h.y - d[1] || 0, function n(i, s, l) {
610
- var g = d, _;
611
- switch (i) {
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) {
612
581
  case "start":
613
- o[a] = n, _ = c++;
582
+ s[o] = r, v = l++;
614
583
  break;
615
- case "end": delete o[a], --c;
616
- case "drag": d = P(l || s, t), _ = c;
584
+ case "end": delete s[o], --l;
585
+ case "drag": f = t(u || c, n), v = l;
617
586
  }
618
- u.call(i, e, new H(i, {
619
- sourceEvent: s,
620
- subject: h,
621
- target: m,
622
- identifier: a,
623
- active: _,
624
- x: d[0] + f,
625
- y: d[1] + p,
626
- dx: d[0] - g[0],
627
- dy: d[1] - g[1],
628
- dispatch: u
629
- }), r);
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);
630
599
  };
631
600
  }
632
- return m.filter = function(t) {
633
- return arguments.length ? (e = typeof t == "function" ? t : V(!!t), m) : e;
634
- }, m.container = function(e) {
635
- return arguments.length ? (n = typeof e == "function" ? e : V(e), m) : n;
636
- }, m.subject = function(e) {
637
- return arguments.length ? (i = typeof e == "function" ? e : V(e), m) : i;
638
- }, m.touchable = function(e) {
639
- return arguments.length ? (a = typeof e == "function" ? e : V(!!e), m) : a;
640
- }, m.on = function() {
641
- var e = s.on.apply(s, arguments);
642
- return e === s ? m : e;
643
- }, m.clickDistance = function(e) {
644
- return arguments.length ? (p = (e = +e) * e, m) : Math.sqrt(p);
645
- }, m;
646
- }
647
- // node_modules/d3-zoom/src/constant.js
648
- var U = (e) => () => e;
649
- // node_modules/d3-zoom/src/event.js
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;
650
618
  function ye(e, { sourceEvent: t, target: n, transform: r, dispatch: i }) {
651
619
  Object.defineProperties(this, {
652
620
  type: {
@@ -672,17 +640,16 @@ function ye(e, { sourceEvent: t, target: n, transform: r, dispatch: i }) {
672
640
  _: { value: i }
673
641
  });
674
642
  }
675
- // node_modules/d3-zoom/src/transform.js
676
- function W(e, t, n) {
643
+ function U(e, t, n) {
677
644
  this.k = e, this.x = t, this.y = n;
678
645
  }
679
- W.prototype = {
680
- constructor: W,
646
+ U.prototype = {
647
+ constructor: U,
681
648
  scale: function(e) {
682
- return e === 1 ? this : new W(this.k * e, this.x, this.y);
649
+ return e === 1 ? this : new U(this.k * e, this.x, this.y);
683
650
  },
684
651
  translate: function(e, t) {
685
- return e === 0 & t === 0 ? this : new W(this.k, this.x + this.k * e, this.y + this.k * t);
652
+ return e === 0 & t === 0 ? this : new U(this.k, this.x + this.k * e, this.y + this.k * t);
686
653
  },
687
654
  apply: function(e) {
688
655
  return [e[0] * this.k + this.x, e[1] * this.k + this.y];
@@ -712,20 +679,18 @@ W.prototype = {
712
679
  return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
713
680
  }
714
681
  };
715
- var G = new W(1, 0, 0);
716
- be.prototype = W.prototype;
682
+ var W = new U(1, 0, 0);
683
+ be.prototype = U.prototype;
717
684
  function be(e) {
718
- for (; !e.__zoom;) if (!(e = e.parentNode)) return G;
685
+ for (; !e.__zoom;) if (!(e = e.parentNode)) return W;
719
686
  return e.__zoom;
720
687
  }
721
- // node_modules/d3-zoom/src/noevent.js
722
- function K(e) {
688
+ function G(e) {
723
689
  e.stopImmediatePropagation();
724
690
  }
725
- function q(e) {
691
+ function K(e) {
726
692
  e.preventDefault(), e.stopImmediatePropagation();
727
693
  }
728
- // node_modules/d3-zoom/src/zoom.js
729
694
  function xe(e) {
730
695
  return (!e.ctrlKey || e.type === "wheel") && !e.button;
731
696
  }
@@ -733,8 +698,8 @@ function Se() {
733
698
  var e = this;
734
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]];
735
700
  }
736
- function J() {
737
- return this.__zoom || G;
701
+ function q() {
702
+ return this.__zoom || W;
738
703
  }
739
704
  function Ce(e) {
740
705
  return -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * (e.ctrlKey ? 10 : 1);
@@ -742,73 +707,73 @@ function Ce(e) {
742
707
  function we() {
743
708
  return navigator.maxTouchPoints || "ontouchstart" in this;
744
709
  }
745
- function Y(e, t, n) {
710
+ function Te(e, t, n) {
746
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];
747
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));
748
713
  }
749
- function Te() {
750
- 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;
751
- function b(e) {
752
- 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)");
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)");
753
718
  }
754
- b.transform = function(e, t, n, r) {
719
+ x.transform = function(e, t, n, r) {
755
720
  var i = e.selection ? e.selection() : e;
756
- i.property("__zoom", J), e === i ? i.interrupt().each(function() {
757
- T(this, arguments).event(r).start().zoom(null, typeof t == "function" ? t.apply(this, arguments) : t).end();
758
- }) : w(e, t, n, r);
759
- }, b.scaleBy = function(e, t, n, r) {
760
- b.scaleTo(e, function() {
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() {
761
726
  return this.__zoom.k * (typeof t == "function" ? t.apply(this, arguments) : t);
762
727
  }, n, r);
763
- }, b.scaleTo = function(e, t, n, r) {
764
- b.transform(e, function() {
765
- 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;
766
- return a(S(x(r, c), o, s), e, l);
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);
767
732
  }, n, r);
768
- }, b.translateBy = function(e, t, n, r) {
769
- b.transform(e, function() {
770
- 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);
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);
771
736
  }, null, r);
772
- }, b.translateTo = function(e, t, n, r, o) {
773
- b.transform(e, function() {
774
- var e = i.apply(this, arguments), o = this.__zoom, s = r == null ? C(e) : typeof r == "function" ? r.apply(this, arguments) : r;
775
- 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);
776
- }, r, o);
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);
777
742
  };
778
- function x(e, t) {
779
- return t = Math.max(c[0], Math.min(c[1], t)), t === e.k ? e : new W(t, e.x, e.y);
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);
780
745
  }
781
- function S(e, t, n) {
746
+ function C(e, t, n) {
782
747
  var r = t[0] - n[0] * e.k, i = t[1] - n[1] * e.k;
783
- return r === e.x && i === e.y ? e : new W(e.k, r, i);
748
+ return r === e.x && i === e.y ? e : new U(e.k, r, i);
784
749
  }
785
- function C(e) {
750
+ function w(e) {
786
751
  return [(+e[0][0] + +e[1][0]) / 2, (+e[0][1] + +e[1][1]) / 2];
787
752
  }
788
- function w(e, t, n, r) {
753
+ function T(e, t, n, r) {
789
754
  e.on("start.zoom", function() {
790
- T(this, arguments).event(r).start();
755
+ E(this, arguments).event(r).start();
791
756
  }).on("interrupt.zoom end.zoom", function() {
792
- T(this, arguments).event(r).end();
757
+ E(this, arguments).event(r).end();
793
758
  }).tween("zoom", function() {
794
- 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));
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));
795
760
  return function(e) {
796
- if (e === 1) e = f;
761
+ if (e === 1) e = d;
797
762
  else {
798
763
  var t = p(e), n = l / t[2];
799
- e = new W(n, c[0] - t[0] * n, c[1] - t[1] * n);
764
+ e = new U(n, c[0] - t[0] * n, c[1] - t[1] * n);
800
765
  }
801
766
  o.zoom(null, e);
802
767
  };
803
768
  });
804
769
  }
805
- function T(e, t, n) {
806
- return !n && e.__zooming || new E(e, t);
770
+ function E(e, t, n) {
771
+ return !n && e.__zooming || new D(e, t);
807
772
  }
808
- function E(e, t) {
809
- this.that = e, this.args = t, this.active = 0, this.sourceEvent = null, this.extent = i.apply(e, t), this.taps = 0;
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;
810
775
  }
811
- E.prototype = {
776
+ D.prototype = {
812
777
  event: function(e) {
813
778
  return e && (this.sourceEvent = e), this;
814
779
  },
@@ -821,175 +786,227 @@ function Te() {
821
786
  end: function() {
822
787
  return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
823
788
  },
824
- emit: function(e) {
825
- var t = r(this.that).datum();
826
- f.call(e, this.that, new ye(e, {
789
+ emit: function(t) {
790
+ var n = e(this.that).datum();
791
+ p.call(t, this.that, new ye(t, {
827
792
  sourceEvent: this.sourceEvent,
828
- target: b,
829
- type: e,
793
+ target: x,
830
794
  transform: this.that.__zoom,
831
- dispatch: f
832
- }), t);
795
+ dispatch: p
796
+ }), n);
833
797
  }
834
798
  };
835
- function D(t, ...r) {
836
- if (!e.apply(this, arguments)) return;
837
- 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);
838
- 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);
839
- else if (s.k === u) return;
840
- else i.mouse = [d, s.invert(d)], n(this), i.start();
841
- q(t), i.wheel = setTimeout(f, _), i.zoom("mouse", a(S(x(s, u), i.mouse[0], i.mouse[1]), i.extent, l));
842
- function f() {
843
- i.wheel = null, i.end();
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();
844
808
  }
845
809
  }
846
- function O(t, ...i) {
847
- if (h || !e.apply(this, arguments)) return;
848
- 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;
849
- z(t.view), K(t), s.mouse = [u, this.__zoom.invert(u)], n(this), s.start();
850
- function p(e) {
851
- if (q(e), !s.moved) {
852
- var t = e.clientX - d, n = e.clientY - f;
853
- s.moved = t * t + n * n > v;
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;
854
818
  }
855
- s.event(e).zoom("mouse", a(S(s.that.__zoom, s.mouse[0] = P(e, o), s.mouse[1]), s.extent, l));
819
+ c.event(e).zoom("mouse", o(C(c.that.__zoom, c.mouse[0] = t(e, s), c.mouse[1]), c.extent, u));
856
820
  }
857
- function m(e) {
858
- c.on("mousemove.zoom mouseup.zoom", null), B(e.view, s.moved), q(e), s.event(e).end();
821
+ function h(e) {
822
+ l.on("mousemove.zoom mouseup.zoom", null), z(e.view, c.moved), K(e), c.event(e).end();
859
823
  }
860
824
  }
861
- function k(t, ...n) {
862
- if (e.apply(this, arguments)) {
863
- 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);
864
- q(t), u > 0 ? r(this).transition().duration(u).call(w, f, s, t) : r(this).call(b.transform, f, s, t);
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);
865
829
  }
866
830
  }
867
- function A(t, ...r) {
868
- if (e.apply(this, arguments)) {
869
- var i = t.touches, a = i.length, o = T(this, r, t.changedTouches.length === a).event(t), s, c, l, u;
870
- for (K(t), c = 0; c < a; ++c) l = i[c], u = P(l, this), u = [
871
- u,
872
- this.__zoom.invert(u),
873
- l.identifier
874
- ], o.touch0 ? !o.touch1 && o.touch0[2] !== u[2] && (o.touch1 = u, o.taps = 0) : (o.touch0 = u, s = !0, o.taps = 1 + !!p);
875
- p &&= clearTimeout(p), s && (o.taps < 2 && (m = u[0], p = setTimeout(function() {
876
- p = null;
877
- }, g)), n(this), o.start());
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());
878
842
  }
879
843
  }
880
- function j(e, ...t) {
844
+ function j(e, ...n) {
881
845
  if (this.__zooming) {
882
- var n = T(this, t).event(e), r = e.changedTouches, i = r.length, o, s, c, u;
883
- 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);
884
- if (s = n.that.__zoom, n.touch1) {
885
- 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;
886
- 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];
887
- } else if (n.touch0) c = n.touch0[0], u = n.touch0[1];
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];
888
852
  else return;
889
- n.zoom("touch", a(S(s, c, u), n.extent, l));
853
+ r.zoom("touch", o(C(c, l, d), r.extent, u));
890
854
  }
891
855
  }
892
- function M(e, ...t) {
856
+ function M(n, ...r) {
893
857
  if (this.__zooming) {
894
- var n = T(this, t).event(e), i = e.changedTouches, a = i.length, o, s;
895
- for (K(e), h && clearTimeout(h), h = setTimeout(function() {
896
- h = null;
897
- }, 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;
898
- if (n.touch1 && !n.touch0 && (n.touch0 = n.touch1, delete n.touch1), n.touch0) n.touch0[1] = this.__zoom.invert(n.touch0[0]);
899
- else if (n.end(), n.taps === 2 && (s = P(s, this), Math.hypot(m[0] - s[0], m[1] - s[1]) < y)) {
900
- var c = r(this).on("dblclick.zoom");
901
- c && c.apply(this, arguments);
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);
902
866
  }
903
867
  }
904
868
  }
905
- return b.wheelDelta = function(e) {
906
- return arguments.length ? (o = typeof e == "function" ? e : U(+e), b) : o;
907
- }, b.filter = function(t) {
908
- return arguments.length ? (e = typeof t == "function" ? t : U(!!t), b) : e;
909
- }, b.touchable = function(e) {
910
- return arguments.length ? (s = typeof e == "function" ? e : U(!!e), b) : s;
911
- }, b.extent = function(e) {
912
- return arguments.length ? (i = typeof e == "function" ? e : U([[+e[0][0], +e[0][1]], [+e[1][0], +e[1][1]]]), b) : i;
913
- }, b.scaleExtent = function(e) {
914
- return arguments.length ? (c[0] = +e[0], c[1] = +e[1], b) : [c[0], c[1]];
915
- }, b.translateExtent = function(e) {
916
- 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]]];
917
- }, b.constrain = function(e) {
918
- return arguments.length ? (a = e, b) : a;
919
- }, b.duration = function(e) {
920
- return arguments.length ? (u = +e, b) : u;
921
- }, b.interpolate = function(e) {
922
- return arguments.length ? (d = e, b) : d;
923
- }, b.on = function() {
924
- var e = f.on.apply(f, arguments);
925
- return e === f ? b : e;
926
- }, b.clickDistance = function(e) {
927
- return arguments.length ? (v = (e = +e) * e, b) : Math.sqrt(v);
928
- }, b.tapDistance = function(e) {
929
- return arguments.length ? (y = +e, b) : y;
930
- }, b;
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;
931
895
  }
932
896
  // src/networkDiagram.ts
933
- var Ee = -300, De = 100, X = 640, Z = 480, Oe = 180, Q = 20, ke = 22, $ = {
897
+ var De = -300, Oe = 100, J = 640, Y = 480, ke = 180, Ae = 1, je = 2, Me = 14, X = .25, Ne = 4, Z = {
934
898
  linkStroke: "#9ca3af",
935
- nodeFill: "#2563eb",
936
- nodeFillHovered: "#3b82f6",
937
899
  nodeFillSelected: "#f59e0b",
938
- nodeStroke: "#1e40af",
939
- nodeStrokeHovered: "#1d4ed8",
940
900
  nodeStrokeSelected: "#b45309",
941
901
  nodeText: "#ffffff"
942
- };
943
- function Ae(e, t, n = {}) {
944
- 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;
945
- for (let [e, t] of s.entries()) {
946
- let n = e / s.length * Math.PI * 2;
947
- t.x = a / 2 + Math.cos(n) * l, t.y = o / 2 + Math.sin(n) * l;
948
- }
949
- 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");
950
- 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);
951
- let h = null, g = null, _ = () => {
952
- 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);
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
+ fill: "#db2777",
933
+ fillHovered: "#ec4899",
934
+ radius: 8,
935
+ stroke: "#9d174d",
936
+ strokeHovered: "#be185d"
937
+ }
938
+ ];
939
+ function Fe(t, n, r = {}) {
940
+ 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;
941
+ for (let [e, t] of o.entries()) {
942
+ let n = e / o.length * Math.PI * 2;
943
+ t.x = i / 2 + Math.cos(n) * c, t.y = a / 2 + Math.sin(n) * c;
944
+ }
945
+ 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");
946
+ 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");
947
+ let m = null, h = null, g = () => {
948
+ 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) => {
949
+ let t = e.id === m || e.id === h;
950
+ return Q(e).radius + (t ? je : 0);
951
+ });
953
952
  };
954
- m.on("mouseenter", (e, t) => {
955
- g = t.id, _();
953
+ p.on("mouseenter", (e, t) => {
954
+ h = t.id, g();
956
955
  }).on("mouseleave", (e, t) => {
957
- g === t.id && (g = null), _();
958
- }).on("click", (e, t) => {
959
- e.stopPropagation(), h = h === t.id ? null : t.id, _();
960
- }), d.on("click", () => {
961
- h = null, _();
956
+ h === t.id && (h = null), g();
957
+ }).on("click", (e, n) => {
958
+ e.stopPropagation(), m = m === n.id ? null : n.id, g(), r.onNodeClick?.($(t.nodes.find((e) => e.id === n.id)));
959
+ }), u.on("click", () => {
960
+ m = null, g();
962
961
  });
963
- let v = Te().scaleExtent([.5, 4]).on("zoom", (e) => {
964
- f.attr("transform", e.transform.toString());
962
+ let _ = Ee().scaleExtent([X, Ne]).on("zoom", (e) => {
963
+ d.attr("transform", e.transform.toString());
965
964
  });
966
- d.call(v).on("dblclick.zoom", null);
967
- let y = (e, t) => typeof e == "object" ? e[t] ?? 0 : 0, b = () => {
968
- 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)})`);
965
+ u.call(_).on("dblclick.zoom", null);
966
+ let v = (e, t) => typeof e == "object" ? e[t] ?? 0 : 0, y = () => {
967
+ 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)})`);
968
+ }, b = () => {
969
+ if (o.length === 0) return;
970
+ let e = o.map((e) => e.x ?? 0), t = o.map((e) => e.y ?? 0), [r, i, a, s] = [
971
+ Math.min(...e),
972
+ Math.max(...e),
973
+ Math.min(...t),
974
+ Math.max(...t)
975
+ ], 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);
976
+ u.call((e) => {
977
+ _.transform(e, f);
978
+ });
969
979
  };
970
- u.stop(), m.call(ve().on("start", (e, t) => {
980
+ l.stop(), p.call(ve().on("start", (e, t) => {
971
981
  e.sourceEvent?.stopPropagation(), t.fx = t.x, t.fy = t.y;
972
982
  }).on("drag", (e, t) => {
973
- t.x = e.x, t.y = e.y, t.fx = e.x, t.fy = e.y, b();
983
+ t.x = e.x, t.y = e.y, t.fx = e.x, t.fy = e.y, y();
974
984
  }).on("end", (e, t) => {
975
985
  t.fx = null, t.fy = null;
976
- })), b();
977
- let x = d.node();
986
+ })), y();
987
+ let x = u.node();
978
988
  if (x == null) throw Error("Failed to create network diagram SVG element.");
979
989
  return {
980
990
  destroy: () => {
981
- u.stop(), d.remove();
991
+ l.stop(), u.remove();
982
992
  },
983
993
  resize: () => {
984
- let e = t.clientWidth || X, n = t.clientHeight || Z;
985
- d.attr("width", e).attr("height", n).attr("viewBox", `0 0 ${String(e)} ${String(n)}`), u.force("center", i(e / 2, n / 2));
994
+ let e = n.clientWidth || J, t = n.clientHeight || Y;
995
+ u.attr("width", e).attr("height", t).attr("viewBox", `0 0 ${String(e)} ${String(t)}`), l.force("center", D(e / 2, t / 2));
986
996
  },
987
997
  svg: x,
988
998
  triggerAutoLayout: () => {
989
- u.alpha(1);
990
- for (let e = 0; e < Oe; e += 1) u.tick();
991
- u.stop(), b();
999
+ l.alpha(1);
1000
+ for (let e = 0; e < ke; e += 1) l.tick();
1001
+ l.stop(), y(), r.fitsView === !0 && b();
992
1002
  }
993
1003
  };
994
1004
  }
995
- export { Ae as renderNetworkDiagram };
1005
+ function Q(e) {
1006
+ return $(Pe[Math.max(0, Math.min(e.level ?? Ae, Pe.length - 1))]);
1007
+ }
1008
+ function $(e) {
1009
+ if (e === void 0) throw Error("Expected a value in the network diagram.");
1010
+ return e;
1011
+ }
1012
+ export { Fe as renderNetworkDiagram };