@dpuse/dpuse-tool-d3-visualiser 1.0.131 → 1.0.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -238,7 +238,7 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
238
238
 
239
239
  | Chunk/Module/File | Composition |
240
240
  | :------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------- |
241
- | **All 14 files** | 415.9 kB · gzip 122.7 kB |
241
+ | **All 14 files** | 416.5 kB · gzip 122.8 kB |
242
242
  | **dist/tanStackCharts-DEINbmRi.js** | 125.4 kB · gzip 36.7 kB · 30.1% of the build |
243
243
  |     @tanstack/charts → dist/scene.js + 41 more | `██████████████████░░` 90.1% · 113.0 kB |
244
244
  |     d3-scale → src/band.js + 2 more | `░░░░░░░░░░░░░░░░░░░░` 1.7% · 2.1 kB |
@@ -248,7 +248,7 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
248
248
  |     @dagrejs/dagre → dist/dagre.esm.js | `██████████████████░░` 88.3% · 56.0 kB |
249
249
  |     src → erdDiagram.ts | `█░░░░░░░░░░░░░░░░░░░` 5.4% · 3.4 kB |
250
250
  |     (bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░` 6.3% · 4.0 kB |
251
- | **dist/chordDiagram-Cm91Tmgo.js** | 56.8 kB · gzip 17.7 kB · 13.7% of the build |
251
+ | **dist/chordDiagram-Cm91Tmgo.js** | 56.8 kB · gzip 17.7 kB · 13.6% of the build |
252
252
  |     @unovis/ts → components/chord-diagram/index.js + 36 more | `██████████████░░░░░░` 71.0% · 40.3 kB |
253
253
  |     stylis → src/Parser.js + 5 more | `██░░░░░░░░░░░░░░░░░░` 8.4% · 4.8 kB |
254
254
  |     d3-chord → dist/d3-chord.mjs | `█░░░░░░░░░░░░░░░░░░░` 4.2% · 2.4 kB |
@@ -256,12 +256,12 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
256
256
  |     src → chordDiagram.ts | `░░░░░░░░░░░░░░░░░░░░` 0.8% · 494 B |
257
257
  |     d3-array → src/group.js + 1 more | `░░░░░░░░░░░░░░░░░░░░` 0.8% · 487 B |
258
258
  |     (bundler output, whitespace & JSON) | `███░░░░░░░░░░░░░░░░░` 13.5% · 7.6 kB |
259
- | **dist/networkDiagram-CM8txK7Y.js** | 44.4 kB · gzip 13.5 kB · 10.7% of the build |
260
- |     src → networkDiagram.ts | `█████░░░░░░░░░░░░░░░` 25.9% · 11.5 kB |
261
- |     d3-zoom → dist/d3-zoom.mjs | `█████░░░░░░░░░░░░░░░` 24.2% · 10.7 kB |
262
- |     d3-force → dist/d3-force.mjs | `███░░░░░░░░░░░░░░░░░` 17.1% · 7.6 kB |
263
- |     d3-quadtree → src/add.js + 13 more | `███░░░░░░░░░░░░░░░░░` 14.0% · 6.2 kB |
264
- |     d3-drag → dist/d3-drag.mjs | `██░░░░░░░░░░░░░░░░░░` 9.7% · 4.3 kB |
259
+ | **dist/networkDiagram-DAy9A8N3.js** | 45.0 kB · gzip 13.6 kB · 10.8% of the build |
260
+ |     src → networkDiagram.ts | `█████░░░░░░░░░░░░░░░` 26.8% · 12.1 kB |
261
+ |     d3-zoom → dist/d3-zoom.mjs | `█████░░░░░░░░░░░░░░░` 23.9% · 10.7 kB |
262
+ |     d3-force → dist/d3-force.mjs | `███░░░░░░░░░░░░░░░░░` 16.9% · 7.6 kB |
263
+ |     d3-quadtree → src/add.js + 13 more | `███░░░░░░░░░░░░░░░░░` 13.8% · 6.2 kB |
264
+ |     d3-drag → dist/d3-drag.mjs | `██░░░░░░░░░░░░░░░░░░` 9.6% · 4.3 kB |
265
265
  |     d3-interpolate → src/zoom.js | `░░░░░░░░░░░░░░░░░░░░` 2.2% · 1007 B |
266
266
  |     (bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░` 6.9% · 3.1 kB |
267
267
  | **dist/d3-shape-gf8U18pS.js** | 36.9 kB · gzip 7.9 kB · 8.9% of the build |
@@ -300,7 +300,7 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
300
300
  | **dist/treeDiagram-t0oFwi1c.js** | 2.2 kB · gzip 1.0 kB · 0.5% of the build |
301
301
  |     src → treeDiagram.ts | `█████████████████░░░` 87.2% · 1.9 kB |
302
302
  |     (bundler output, whitespace & JSON) | `███░░░░░░░░░░░░░░░░░` 12.8% · 290 B |
303
- | **dist/dpuse-tool-d3-visualiser.es.js** | 1.6 kB · gzip 439 B · 0.4% of the build |
303
+ | **dist/dpuse-tool-d3-visualiser.es.js** | 1.6 kB · gzip 437 B · 0.4% of the build |
304
304
  |     src → index.ts | `██████████████████░░` 88.0% · 1.4 kB |
305
305
  |     (bundler output, whitespace & JSON) | `██░░░░░░░░░░░░░░░░░░` 12.0% · 194 B |
306
306
  | **dist/palette-D5DTPmuA.js** | 1.2 kB · gzip 567 B · 0.3% of the build |
@@ -32,7 +32,7 @@ var e = class {
32
32
  };
33
33
  }
34
34
  async renderNetworkDiagram(e, t, n, r) {
35
- let { renderNetworkDiagram: i } = await import("./networkDiagram-CM8txK7Y.js"), a = i(e, t, n);
35
+ let { renderNetworkDiagram: i } = await import("./networkDiagram-DAy9A8N3.js"), a = i(e, t, n);
36
36
  return r?.(), {
37
37
  destroy: a.destroy,
38
38
  resize: a.resize,
@@ -227,14 +227,14 @@ function k(e) {
227
227
  function A(e) {
228
228
  return e.x + e.vx;
229
229
  }
230
- function j(e) {
230
+ function ee(e) {
231
231
  return e.y + e.vy;
232
232
  }
233
- function ee(e) {
233
+ function te(e) {
234
234
  var t, n, r, i = 1, a = 1;
235
235
  typeof e != "function" && (e = O(e == null ? 1 : +e));
236
236
  function o() {
237
- for (var e, o = t.length, c, l, u, d, f, p, m = 0; m < a; ++m) for (c = C(t, A, j).visitAfter(s), e = 0; e < o; ++e) l = t[e], f = n[l.index], p = f * f, u = l.x + l.vx, d = l.y + l.vy, c.visit(h);
237
+ for (var e, o = t.length, c, l, u, d, f, p, m = 0; m < a; ++m) for (c = C(t, A, ee).visitAfter(s), e = 0; e < o; ++e) l = t[e], f = n[l.index], p = f * f, u = l.x + l.vx, d = l.y + l.vy, c.visit(h);
238
238
  function h(e, t, n, a, o) {
239
239
  var s = e.data, c = e.r, m = f + c;
240
240
  if (s) {
@@ -265,16 +265,16 @@ function ee(e) {
265
265
  return arguments.length ? (e = typeof t == "function" ? t : O(+t), c(), o) : e;
266
266
  }, o;
267
267
  }
268
- function M(e) {
268
+ function ne(e) {
269
269
  return e.index;
270
270
  }
271
- function N(e, t) {
271
+ function j(e, t) {
272
272
  var n = e.get(t);
273
273
  if (!n) throw Error("node not found: " + t);
274
274
  return n;
275
275
  }
276
- function te(e) {
277
- var t = M, n = d, r, i = O(30), a, o, s, c, l, u = 1;
276
+ function re(e) {
277
+ var t = ne, n = d, r, i = O(30), a, o, s, c, l, u = 1;
278
278
  e ??= [];
279
279
  function d(e) {
280
280
  return 1 / Math.min(s[e.source.index], s[e.target.index]);
@@ -285,7 +285,7 @@ function te(e) {
285
285
  function p() {
286
286
  if (o) {
287
287
  var n, i = o.length, l = e.length, u = new Map(o.map((e, n) => [t(e, n, o), e])), d;
288
- for (n = 0, s = Array(i); n < l; ++n) d = e[n], d.index = n, typeof d.source != "object" && (d.source = N(u, d.source)), typeof d.target != "object" && (d.target = N(u, d.target)), s[d.source.index] = (s[d.source.index] || 0) + 1, s[d.target.index] = (s[d.target.index] || 0) + 1;
288
+ for (n = 0, s = Array(i); n < l; ++n) d = e[n], d.index = n, typeof d.source != "object" && (d.source = j(u, d.source)), typeof d.target != "object" && (d.target = j(u, d.target)), s[d.source.index] = (s[d.source.index] || 0) + 1, s[d.target.index] = (s[d.target.index] || 0) + 1;
289
289
  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]);
290
290
  r = Array(l), m(), a = Array(l), h();
291
291
  }
@@ -310,20 +310,20 @@ function te(e) {
310
310
  return arguments.length ? (i = typeof e == "function" ? e : O(+e), h(), f) : i;
311
311
  }, f;
312
312
  }
313
- var P = 1664525, F = 1013904223, I = 4294967296;
314
- function L() {
313
+ var ie = 1664525, M = 1013904223, N = 4294967296;
314
+ function P() {
315
315
  let e = 1;
316
- return () => (e = (P * e + F) % I) / I;
316
+ return () => (e = (ie * e + M) % N) / N;
317
317
  }
318
- function R(e) {
318
+ function ae(e) {
319
319
  return e.x;
320
320
  }
321
- function ne(e) {
321
+ function F(e) {
322
322
  return e.y;
323
323
  }
324
- var re = 10, ie = Math.PI * (3 - Math.sqrt(5));
325
- function ae(n) {
326
- 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 = L();
324
+ var I = 10, oe = Math.PI * (3 - Math.sqrt(5));
325
+ function se(n) {
326
+ 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 = P();
327
327
  n ??= [];
328
328
  function p() {
329
329
  m(), d.call("tick", r), i < a && (u.stop(), d.call("end", r));
@@ -339,7 +339,7 @@ function ae(n) {
339
339
  function h() {
340
340
  for (var e = 0, t = n.length, r; e < t; ++e) {
341
341
  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)) {
342
- var i = re * Math.sqrt(.5 + e), a = e * ie;
342
+ var i = I * Math.sqrt(.5 + e), a = e * oe;
343
343
  r.x = i * Math.cos(a), r.y = i * Math.sin(a);
344
344
  }
345
345
  (isNaN(r.vx) || isNaN(r.vy)) && (r.vx = r.vy = 0);
@@ -390,10 +390,10 @@ function ae(n) {
390
390
  }
391
391
  };
392
392
  }
393
- function oe() {
393
+ function ce() {
394
394
  var e, t, n, r, i = O(-30), a, o = 1, s = Infinity, c = .81;
395
395
  function l(n) {
396
- var i, a = e.length, o = C(e, R, ne).visitAfter(d);
396
+ var i, a = e.length, o = C(e, ae, F).visitAfter(d);
397
397
  for (r = n, i = 0; i < a; ++i) t = e[i], o.visit(f);
398
398
  }
399
399
  function u() {
@@ -439,20 +439,20 @@ function oe() {
439
439
  }, l;
440
440
  }
441
441
  // node_modules/d3-interpolate/src/zoom.js
442
- var se = 1e-12;
443
- function ce(e) {
442
+ var le = 1e-12;
443
+ function ue(e) {
444
444
  return ((e = Math.exp(e)) + 1 / e) / 2;
445
445
  }
446
- function le(e) {
446
+ function de(e) {
447
447
  return ((e = Math.exp(e)) - 1 / e) / 2;
448
448
  }
449
- function ue(e) {
449
+ function fe(e) {
450
450
  return ((e = Math.exp(2 * e)) - 1) / (e + 1);
451
451
  }
452
- var de = (function e(t, n, r) {
452
+ var pe = (function e(t, n, r) {
453
453
  function i(e, i) {
454
454
  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;
455
- if (p < se) h = Math.log(u / s) / t, m = function(e) {
455
+ if (p < le) h = Math.log(u / s) / t, m = function(e) {
456
456
  return [
457
457
  a + e * d,
458
458
  o + e * f,
@@ -462,11 +462,11 @@ var de = (function e(t, n, r) {
462
462
  else {
463
463
  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) - _);
464
464
  h = (Math.log(Math.sqrt(v * v + 1) - v) - y) / t, m = function(e) {
465
- var r = e * h, i = ce(y), c = s / (n * g) * (i * ue(t * r + y) - le(y));
465
+ var r = e * h, i = ue(y), c = s / (n * g) * (i * fe(t * r + y) - de(y));
466
466
  return [
467
467
  a + c * d,
468
468
  o + c * f,
469
- s * i / ce(t * r + y)
469
+ s * i / ue(t * r + y)
470
470
  ];
471
471
  };
472
472
  }
@@ -476,28 +476,28 @@ var de = (function e(t, n, r) {
476
476
  var n = Math.max(.001, +t), r = n * n;
477
477
  return e(n, r, r * r);
478
478
  }, i;
479
- })(Math.SQRT2, 2, 4), fe = { passive: !1 }, z = {
479
+ })(Math.SQRT2, 2, 4), me = { passive: !1 }, L = {
480
480
  capture: !0,
481
481
  passive: !1
482
482
  };
483
- function pe(e) {
483
+ function he(e) {
484
484
  e.stopImmediatePropagation();
485
485
  }
486
- function B(e) {
486
+ function R(e) {
487
487
  e.preventDefault(), e.stopImmediatePropagation();
488
488
  }
489
- function me(e) {
490
- var t = e.document.documentElement, n = r(e).on("dragstart.drag", B, z);
491
- "onselectstart" in t ? n.on("selectstart.drag", B, z) : (t.__noselect = t.style.MozUserSelect, t.style.MozUserSelect = "none");
489
+ function ge(e) {
490
+ var t = e.document.documentElement, n = r(e).on("dragstart.drag", R, L);
491
+ "onselectstart" in t ? n.on("selectstart.drag", R, L) : (t.__noselect = t.style.MozUserSelect, t.style.MozUserSelect = "none");
492
492
  }
493
- function he(e, t) {
493
+ function _e(e, t) {
494
494
  var n = e.document.documentElement, i = r(e).on("dragstart.drag", null);
495
- t && (i.on("click.drag", B, z), setTimeout(function() {
495
+ t && (i.on("click.drag", R, L), setTimeout(function() {
496
496
  i.on("click.drag", null);
497
497
  }, 0)), "onselectstart" in n ? i.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect);
498
498
  }
499
- var V = (e) => () => e;
500
- function ge(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a, x: o, y: s, dx: c, dy: l, dispatch: u }) {
499
+ var z = (e) => () => e;
500
+ function ve(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a, x: o, y: s, dx: c, dy: l, dispatch: u }) {
501
501
  Object.defineProperties(this, {
502
502
  type: {
503
503
  value: e,
@@ -552,61 +552,61 @@ function ge(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a
552
552
  _: { value: u }
553
553
  });
554
554
  }
555
- ge.prototype.on = function() {
555
+ ve.prototype.on = function() {
556
556
  var e = this._.on.apply(this._, arguments);
557
557
  return e === this._ ? this : e;
558
558
  };
559
- function _e(e) {
559
+ function ye(e) {
560
560
  return !e.ctrlKey && !e.button;
561
561
  }
562
- function ve() {
562
+ function be() {
563
563
  return this.parentNode;
564
564
  }
565
- function ye(e, t) {
565
+ function xe(e, t) {
566
566
  return t ?? {
567
567
  x: e.x,
568
568
  y: e.y
569
569
  };
570
570
  }
571
- function be() {
571
+ function Se() {
572
572
  return navigator.maxTouchPoints || "ontouchstart" in this;
573
573
  }
574
- function xe() {
575
- var e = _e, n = ve, a = ye, o = be, s = {}, c = t("start", "drag", "end"), l = 0, u, d, f, p, m = 0;
574
+ function Ce() {
575
+ var e = ye, n = be, a = xe, o = Se, s = {}, c = t("start", "drag", "end"), l = 0, u, d, f, p, m = 0;
576
576
  function h(e) {
577
- e.on("mousedown.drag", g).filter(o).on("touchstart.drag", y).on("touchmove.drag", b, fe).on("touchend.drag touchcancel.drag", x).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
577
+ e.on("mousedown.drag", g).filter(o).on("touchstart.drag", y).on("touchmove.drag", b, me).on("touchend.drag touchcancel.drag", x).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
578
578
  }
579
579
  function g(t, i) {
580
580
  if (!p && e.call(this, t, i)) {
581
581
  var a = S(this, n.call(this, t, i), t, i, "mouse");
582
- a && (r(t.view).on("mousemove.drag", _, z).on("mouseup.drag", v, z), me(t.view), pe(t), f = !1, u = t.clientX, d = t.clientY, a("start", t));
582
+ a && (r(t.view).on("mousemove.drag", _, L).on("mouseup.drag", v, L), ge(t.view), he(t), f = !1, u = t.clientX, d = t.clientY, a("start", t));
583
583
  }
584
584
  }
585
585
  function _(e) {
586
- if (B(e), !f) {
586
+ if (R(e), !f) {
587
587
  var t = e.clientX - u, n = e.clientY - d;
588
588
  f = t * t + n * n > m;
589
589
  }
590
590
  s.mouse("drag", e);
591
591
  }
592
592
  function v(e) {
593
- r(e.view).on("mousemove.drag mouseup.drag", null), he(e.view, f), B(e), s.mouse("end", e);
593
+ r(e.view).on("mousemove.drag mouseup.drag", null), _e(e.view, f), R(e), s.mouse("end", e);
594
594
  }
595
595
  function y(t, r) {
596
- 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 = S(this, a, t, r, i[s].identifier, i[s])) && (pe(t), c("start", t, i[s]));
596
+ 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 = S(this, a, t, r, i[s].identifier, i[s])) && (he(t), c("start", t, i[s]));
597
597
  }
598
598
  function b(e) {
599
- for (var t = e.changedTouches, n = t.length, r = 0, i; r < n; ++r) (i = s[t[r].identifier]) && (B(e), i("drag", e, t[r]));
599
+ for (var t = e.changedTouches, n = t.length, r = 0, i; r < n; ++r) (i = s[t[r].identifier]) && (R(e), i("drag", e, t[r]));
600
600
  }
601
601
  function x(e) {
602
602
  var t = e.changedTouches, n = t.length, r, i;
603
603
  for (p && clearTimeout(p), p = setTimeout(function() {
604
604
  p = null;
605
- }, 500), r = 0; r < n; ++r) (i = s[t[r].identifier]) && (pe(e), i("end", e, t[r]));
605
+ }, 500), r = 0; r < n; ++r) (i = s[t[r].identifier]) && (he(e), i("end", e, t[r]));
606
606
  }
607
607
  function S(e, t, n, r, o, u) {
608
608
  var d = c.copy(), f = i(u || n, t), p, m, g;
609
- if ((g = a.call(e, new ge("beforestart", {
609
+ if ((g = a.call(e, new ve("beforestart", {
610
610
  sourceEvent: n,
611
611
  target: h,
612
612
  identifier: o,
@@ -625,7 +625,7 @@ function xe() {
625
625
  case "end": delete s[o], --l;
626
626
  case "drag": f = i(u || c, t), v = l;
627
627
  }
628
- d.call(a, e, new ge(a, {
628
+ d.call(a, e, new ve(a, {
629
629
  sourceEvent: c,
630
630
  subject: g,
631
631
  target: h,
@@ -640,13 +640,13 @@ function xe() {
640
640
  };
641
641
  }
642
642
  return h.filter = function(t) {
643
- return arguments.length ? (e = typeof t == "function" ? t : V(!!t), h) : e;
643
+ return arguments.length ? (e = typeof t == "function" ? t : z(!!t), h) : e;
644
644
  }, h.container = function(e) {
645
- return arguments.length ? (n = typeof e == "function" ? e : V(e), h) : n;
645
+ return arguments.length ? (n = typeof e == "function" ? e : z(e), h) : n;
646
646
  }, h.subject = function(e) {
647
- return arguments.length ? (a = typeof e == "function" ? e : V(e), h) : a;
647
+ return arguments.length ? (a = typeof e == "function" ? e : z(e), h) : a;
648
648
  }, h.touchable = function(e) {
649
- return arguments.length ? (o = typeof e == "function" ? e : V(!!e), h) : o;
649
+ return arguments.length ? (o = typeof e == "function" ? e : z(!!e), h) : o;
650
650
  }, h.on = function() {
651
651
  var e = c.on.apply(c, arguments);
652
652
  return e === c ? h : e;
@@ -655,8 +655,8 @@ function xe() {
655
655
  }, h;
656
656
  }
657
657
  // node_modules/d3-zoom/dist/d3-zoom.mjs
658
- var H = (e) => () => e;
659
- function Se(e, { sourceEvent: t, target: n, transform: r, dispatch: i }) {
658
+ var B = (e) => () => e;
659
+ function we(e, { sourceEvent: t, target: n, transform: r, dispatch: i }) {
660
660
  Object.defineProperties(this, {
661
661
  type: {
662
662
  value: e,
@@ -681,16 +681,16 @@ function Se(e, { sourceEvent: t, target: n, transform: r, dispatch: i }) {
681
681
  _: { value: i }
682
682
  });
683
683
  }
684
- function U(e, t, n) {
684
+ function V(e, t, n) {
685
685
  this.k = e, this.x = t, this.y = n;
686
686
  }
687
- U.prototype = {
688
- constructor: U,
687
+ V.prototype = {
688
+ constructor: V,
689
689
  scale: function(e) {
690
- return e === 1 ? this : new U(this.k * e, this.x, this.y);
690
+ return e === 1 ? this : new V(this.k * e, this.x, this.y);
691
691
  },
692
692
  translate: function(e, t) {
693
- return e === 0 & t === 0 ? this : new U(this.k, this.x + this.k * e, this.y + this.k * t);
693
+ return e === 0 & t === 0 ? this : new V(this.k, this.x + this.k * e, this.y + this.k * t);
694
694
  },
695
695
  apply: function(e) {
696
696
  return [e[0] * this.k + this.x, e[1] * this.k + this.y];
@@ -720,46 +720,46 @@ U.prototype = {
720
720
  return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
721
721
  }
722
722
  };
723
- var W = new U(1, 0, 0);
724
- Ce.prototype = U.prototype;
725
- function Ce(e) {
726
- for (; !e.__zoom;) if (!(e = e.parentNode)) return W;
723
+ var H = new V(1, 0, 0);
724
+ Te.prototype = V.prototype;
725
+ function Te(e) {
726
+ for (; !e.__zoom;) if (!(e = e.parentNode)) return H;
727
727
  return e.__zoom;
728
728
  }
729
- function we(e) {
729
+ function Ee(e) {
730
730
  e.stopImmediatePropagation();
731
731
  }
732
- function G(e) {
732
+ function U(e) {
733
733
  e.preventDefault(), e.stopImmediatePropagation();
734
734
  }
735
- function Te(e) {
735
+ function De(e) {
736
736
  return (!e.ctrlKey || e.type === "wheel") && !e.button;
737
737
  }
738
- function Ee() {
738
+ function Oe() {
739
739
  var e = this;
740
740
  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]];
741
741
  }
742
- function De() {
743
- return this.__zoom || W;
742
+ function ke() {
743
+ return this.__zoom || H;
744
744
  }
745
- function Oe(e) {
745
+ function Ae(e) {
746
746
  return -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * (e.ctrlKey ? 10 : 1);
747
747
  }
748
- function ke() {
748
+ function je() {
749
749
  return navigator.maxTouchPoints || "ontouchstart" in this;
750
750
  }
751
- function Ae(e, t, n) {
751
+ function Me(e, t, n) {
752
752
  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];
753
753
  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));
754
754
  }
755
- function je() {
756
- var e = Te, a = Ee, o = Ae, s = Oe, c = ke, l = [0, Infinity], u = [[-Infinity, -Infinity], [Infinity, Infinity]], d = 250, f = de, p = t("start", "zoom", "end"), m, h, g, _ = 500, v = 150, y = 0, b = 10;
755
+ function Ne() {
756
+ var e = De, a = Oe, o = Me, s = Ae, c = je, l = [0, Infinity], u = [[-Infinity, -Infinity], [Infinity, Infinity]], d = 250, f = pe, p = t("start", "zoom", "end"), m, h, g, _ = 500, v = 150, y = 0, b = 10;
757
757
  function x(e) {
758
- e.property("__zoom", De).on("wheel.zoom", O, { passive: !1 }).on("mousedown.zoom", k).on("dblclick.zoom", A).filter(c).on("touchstart.zoom", j).on("touchmove.zoom", ee).on("touchend.zoom touchcancel.zoom", M).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
758
+ e.property("__zoom", ke).on("wheel.zoom", O, { passive: !1 }).on("mousedown.zoom", k).on("dblclick.zoom", A).filter(c).on("touchstart.zoom", ee).on("touchmove.zoom", te).on("touchend.zoom touchcancel.zoom", ne).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
759
759
  }
760
760
  x.transform = function(e, t, n, r) {
761
761
  var i = e.selection ? e.selection() : e;
762
- i.property("__zoom", De), e === i ? i.interrupt().each(function() {
762
+ i.property("__zoom", ke), e === i ? i.interrupt().each(function() {
763
763
  E(this, arguments).event(r).start().zoom(null, typeof t == "function" ? t.apply(this, arguments) : t).end();
764
764
  }) : T(e, t, n, r);
765
765
  }, x.scaleBy = function(e, t, n, r) {
@@ -778,15 +778,15 @@ function je() {
778
778
  }, x.translateTo = function(e, t, n, r, i) {
779
779
  x.transform(e, function() {
780
780
  var e = a.apply(this, arguments), i = this.__zoom, s = r == null ? w(e) : typeof r == "function" ? r.apply(this, arguments) : r;
781
- 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);
781
+ return o(H.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);
782
782
  }, r, i);
783
783
  };
784
784
  function S(e, t) {
785
- return t = Math.max(l[0], Math.min(l[1], t)), t === e.k ? e : new U(t, e.x, e.y);
785
+ return t = Math.max(l[0], Math.min(l[1], t)), t === e.k ? e : new V(t, e.x, e.y);
786
786
  }
787
787
  function C(e, t, n) {
788
788
  var r = t[0] - n[0] * e.k, i = t[1] - n[1] * e.k;
789
- return r === e.x && i === e.y ? e : new U(e.k, r, i);
789
+ return r === e.x && i === e.y ? e : new V(e.k, r, i);
790
790
  }
791
791
  function w(e) {
792
792
  return [(+e[0][0] + +e[1][0]) / 2, (+e[0][1] + +e[1][1]) / 2];
@@ -802,7 +802,7 @@ function je() {
802
802
  if (e === 1) e = d;
803
803
  else {
804
804
  var t = p(e), n = l / t[2];
805
- e = new U(n, c[0] - t[0] * n, c[1] - t[1] * n);
805
+ e = new V(n, c[0] - t[0] * n, c[1] - t[1] * n);
806
806
  }
807
807
  o.zoom(null, e);
808
808
  };
@@ -829,7 +829,7 @@ function je() {
829
829
  },
830
830
  emit: function(e) {
831
831
  var t = r(this.that).datum();
832
- p.call(e, this.that, new Se(e, {
832
+ p.call(e, this.that, new we(e, {
833
833
  sourceEvent: this.sourceEvent,
834
834
  target: x,
835
835
  transform: this.that.__zoom,
@@ -843,7 +843,7 @@ function je() {
843
843
  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);
844
844
  else if (c.k === d) return;
845
845
  else a.mouse = [f, c.invert(f)], n(this), a.start();
846
- G(t), a.wheel = setTimeout(p, v), a.zoom("mouse", o(C(S(c, d), a.mouse[0], a.mouse[1]), a.extent, u));
846
+ U(t), a.wheel = setTimeout(p, v), a.zoom("mouse", o(C(S(c, d), a.mouse[0], a.mouse[1]), a.extent, u));
847
847
  function p() {
848
848
  a.wheel = null, a.end();
849
849
  }
@@ -851,28 +851,28 @@ function je() {
851
851
  function k(t, ...a) {
852
852
  if (g || !e.apply(this, arguments)) return;
853
853
  var s = t.currentTarget, c = E(this, a, !0).event(t), l = r(t.view).on("mousemove.zoom", m, !0).on("mouseup.zoom", h, !0), d = i(t, s), f = t.clientX, p = t.clientY;
854
- me(t.view), we(t), c.mouse = [d, this.__zoom.invert(d)], n(this), c.start();
854
+ ge(t.view), Ee(t), c.mouse = [d, this.__zoom.invert(d)], n(this), c.start();
855
855
  function m(e) {
856
- if (G(e), !c.moved) {
856
+ if (U(e), !c.moved) {
857
857
  var t = e.clientX - f, n = e.clientY - p;
858
858
  c.moved = t * t + n * n > y;
859
859
  }
860
860
  c.event(e).zoom("mouse", o(C(c.that.__zoom, c.mouse[0] = i(e, s), c.mouse[1]), c.extent, u));
861
861
  }
862
862
  function h(e) {
863
- l.on("mousemove.zoom mouseup.zoom", null), he(e.view, c.moved), G(e), c.event(e).end();
863
+ l.on("mousemove.zoom mouseup.zoom", null), _e(e.view, c.moved), U(e), c.event(e).end();
864
864
  }
865
865
  }
866
866
  function A(t, ...n) {
867
867
  if (e.apply(this, arguments)) {
868
868
  var s = this.__zoom, c = i(t.changedTouches ? t.changedTouches[0] : t, this), l = s.invert(c), f = s.k * (t.shiftKey ? .5 : 2), p = o(C(S(s, f), c, l), a.apply(this, n), u);
869
- G(t), d > 0 ? r(this).transition().duration(d).call(T, p, c, t) : r(this).call(x.transform, p, c, t);
869
+ U(t), d > 0 ? r(this).transition().duration(d).call(T, p, c, t) : r(this).call(x.transform, p, c, t);
870
870
  }
871
871
  }
872
- function j(t, ...r) {
872
+ function ee(t, ...r) {
873
873
  if (e.apply(this, arguments)) {
874
874
  var a = t.touches, o = a.length, s = E(this, r, t.changedTouches.length === o).event(t), c, l, u, d;
875
- for (we(t), l = 0; l < o; ++l) u = a[l], d = i(u, this), d = [
875
+ for (Ee(t), l = 0; l < o; ++l) u = a[l], d = i(u, this), d = [
876
876
  d,
877
877
  this.__zoom.invert(d),
878
878
  u.identifier
@@ -882,10 +882,10 @@ function je() {
882
882
  }, _)), n(this), s.start());
883
883
  }
884
884
  }
885
- function ee(e, ...t) {
885
+ function te(e, ...t) {
886
886
  if (this.__zooming) {
887
887
  var n = E(this, t).event(e), r = e.changedTouches, a = r.length, s, c, l, d;
888
- for (G(e), s = 0; s < a; ++s) c = r[s], l = i(c, this), n.touch0 && n.touch0[2] === c.identifier ? n.touch0[0] = l : n.touch1 && n.touch1[2] === c.identifier && (n.touch1[0] = l);
888
+ for (U(e), s = 0; s < a; ++s) c = r[s], l = i(c, this), n.touch0 && n.touch0[2] === c.identifier ? n.touch0[0] = l : n.touch1 && n.touch1[2] === c.identifier && (n.touch1[0] = l);
889
889
  if (c = n.that.__zoom, n.touch1) {
890
890
  var f = n.touch0[0], p = n.touch0[1], m = n.touch1[0], h = n.touch1[1], g = (g = m[0] - f[0]) * g + (g = m[1] - f[1]) * g, _ = (_ = h[0] - p[0]) * _ + (_ = h[1] - p[1]) * _;
891
891
  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];
@@ -894,10 +894,10 @@ function je() {
894
894
  n.zoom("touch", o(C(c, l, d), n.extent, u));
895
895
  }
896
896
  }
897
- function M(e, ...t) {
897
+ function ne(e, ...t) {
898
898
  if (this.__zooming) {
899
899
  var n = E(this, t).event(e), a = e.changedTouches, o = a.length, s, c;
900
- for (we(e), g && clearTimeout(g), g = setTimeout(function() {
900
+ for (Ee(e), g && clearTimeout(g), g = setTimeout(function() {
901
901
  g = null;
902
902
  }, _), s = 0; s < o; ++s) c = a[s], n.touch0 && n.touch0[2] === c.identifier ? delete n.touch0 : n.touch1 && n.touch1[2] === c.identifier && delete n.touch1;
903
903
  if (n.touch1 && !n.touch0 && (n.touch0 = n.touch1, delete n.touch1), n.touch0) n.touch0[1] = this.__zoom.invert(n.touch0[0]);
@@ -908,13 +908,13 @@ function je() {
908
908
  }
909
909
  }
910
910
  return x.wheelDelta = function(e) {
911
- return arguments.length ? (s = typeof e == "function" ? e : H(+e), x) : s;
911
+ return arguments.length ? (s = typeof e == "function" ? e : B(+e), x) : s;
912
912
  }, x.filter = function(t) {
913
- return arguments.length ? (e = typeof t == "function" ? t : H(!!t), x) : e;
913
+ return arguments.length ? (e = typeof t == "function" ? t : B(!!t), x) : e;
914
914
  }, x.touchable = function(e) {
915
- return arguments.length ? (c = typeof e == "function" ? e : H(!!e), x) : c;
915
+ return arguments.length ? (c = typeof e == "function" ? e : B(!!e), x) : c;
916
916
  }, x.extent = function(e) {
917
- return arguments.length ? (a = typeof e == "function" ? e : H([[+e[0][0], +e[0][1]], [+e[1][0], +e[1][1]]]), x) : a;
917
+ return arguments.length ? (a = typeof e == "function" ? e : B([[+e[0][0], +e[0][1]], [+e[1][0], +e[1][1]]]), x) : a;
918
918
  }, x.scaleExtent = function(e) {
919
919
  return arguments.length ? (l[0] = +e[0], l[1] = +e[1], x) : [l[0], l[1]];
920
920
  }, x.translateExtent = function(e) {
@@ -935,19 +935,19 @@ function je() {
935
935
  }, x;
936
936
  }
937
937
  // src/networkDiagram.ts
938
- var Me = -300, Ne = 100, Pe = 2, Fe = 400, Ie = 640, Le = 480, Re = 180, ze = 1, Be = 2, Ve = 14, He = 70, Ue = 130, We = .25, Ge = 4, Ke = 12, K = 14, qe = 6.2, Je = 4, Ye = 8, Xe = .35, Ze = Math.PI * .75, Qe = 10, $e = .6, et = 16, tt = 10, nt = 3, rt = 12, q = {
938
+ var Pe = -300, Fe = 100, Ie = 2, Le = 2, Re = 400, ze = 640, Be = 480, Ve = 180, He = 1, Ue = 2, We = 14, Ge = 70, Ke = 130, qe = .25, Je = 4, Ye = 12, W = 14, Xe = 6.2, Ze = 4, Qe = 8, $e = .35, et = Math.PI * .75, tt = 10, nt = .6, rt = 16, it = 10, at = 3, ot = 12, G = {
939
939
  linkStroke: "#9ca3af",
940
940
  nodeFillSelected: "#f59e0b",
941
941
  nodeStrokeSelected: "#b45309",
942
942
  nodeText: "#ffffff"
943
- }, it = {
943
+ }, st = {
944
944
  fill: "#dbeafe",
945
945
  fillHovered: "#bfdbfe",
946
- radius: 16,
946
+ radius: 20,
947
947
  stroke: "#2563eb",
948
948
  strokeHovered: "#1d4ed8",
949
949
  symbol: "#1d4ed8"
950
- }, at = "icon", ot = "#ffffff", st = 16, ct = 20, J = "symbol", lt = 20, ut = 6, dt = 2.5, ft = [
950
+ }, ct = "icon", lt = "#ffffff", ut = 20, dt = 24, K = "symbol", ft = 20, pt = 20, mt = 583 / 100, ht = Math.round(pt * 1.25 / 24 * 100) / 100, gt = [
951
951
  {
952
952
  fill: "#475569",
953
953
  fillHovered: "#64748b",
@@ -984,80 +984,86 @@ var Me = -300, Ne = 100, Pe = 2, Fe = 400, Ie = 640, Le = 480, Re = 180, ze = 1,
984
984
  strokeHovered: "#be185d"
985
985
  }
986
986
  ];
987
- function pt(e, t, n = {}) {
988
- let i = n.labelPlacementId ?? "below", a = n.transitionDuration ?? Fe, o = t.clientWidth || Ie, s = t.clientHeight || Le, c = te().id((e) => e.id), l = ae().force("link", c).force("charge", oe().strength(n.chargeStrength ?? Me)).force("center", D(o / 2, s / 2));
989
- n.reservesLabelRoom === !0 && l.force("collide", ee((e) => Z(e).radius + tt)), l.stop();
987
+ function _t(e, t, n = {}) {
988
+ let i = n.labelPlacementId ?? "below", a = n.transitionDuration ?? Re, o = t.clientWidth || ze, s = t.clientHeight || Be, c = re().id((e) => e.id), l = se().force("link", c).force("charge", ce().strength(n.chargeStrength ?? Pe)).force("center", D(o / 2, s / 2));
989
+ n.reservesLabelRoom === !0 && l.force("collide", te((e) => Z(e).radius + it)), l.stop();
990
990
  let u = r(t).append("svg").attr("width", o).attr("height", s).attr("viewBox", `0 0 ${String(o)} ${String(s)}`).style("touch-action", "none"), d = u.append("g"), f = d.append("g"), p = d.append("g"), m = u.node();
991
991
  if (m == null) throw Error("Failed to create network diagram SVG element.");
992
992
  let h = e, g = [], _ = [], v = /* @__PURE__ */ new Map(), y, b = null, x = null, S = f.selectAll("line"), C = p.selectAll("g"), w = (e, t) => {
993
993
  let r = v.get(e) ?? [];
994
- if (r.length < nt) return 0;
994
+ if (r.length < at) return 0;
995
995
  let a = 0, o = 0;
996
996
  for (let e of r) {
997
997
  let r = t.get(e);
998
998
  if (!r) continue;
999
- let i = r.label == null ? 0 : mt(Y(r, n.wrapsLabels === !0)) * $e;
1000
- a += Math.max(Z(r).radius * 2, i) + et, o = Math.max(o, Z(r).radius);
999
+ let i = r.label == null ? 0 : J(q(r, n.wrapsLabels === !0)) * nt;
1000
+ a += Math.max(Z(r).radius * 2, i) + rt, o = Math.max(o, Z(r).radius);
1001
1001
  }
1002
1002
  let s = a / (Math.PI * 2), c = t.get(e);
1003
1003
  if (i === "below" || c?.label == null) return s;
1004
- let l = mt(Y(c, n.wrapsLabels === !0));
1004
+ let l = J(q(c, n.wrapsLabels === !0));
1005
1005
  return Math.max(s, Z(c).radius + 16 + l + o);
1006
1006
  };
1007
1007
  c.distance((e) => {
1008
- let t = n.linkDistance ?? Ne;
1008
+ let t = n.linkDistance ?? Fe;
1009
1009
  if (n.reservesLabelRoom !== !0) return t;
1010
1010
  let r = new Map(g.map((e) => [e.id, e]));
1011
- return Math.max(t, w(X(e.source), r), w(X(e.target), r));
1011
+ return Math.max(t, w(Y(e.source), r), w(Y(e.target), r));
1012
1012
  });
1013
- let T = n.selectsOnClick !== !1, E = (e) => e.isAction !== !0 && (T ? e.id === b : e.isSelected === !0), O = n.nodeBorderWidth ?? Pe, k = (e) => E(e) && e.icon != null && n.selectedIconNodeColor != null, A = (e) => E(e) && !k(e), j = () => {
1014
- C.select("circle").attr("fill", (e) => e.icon == null ? A(e) ? q.nodeFillSelected : e.id === x ? Z(e).fillHovered : Z(e).fill : null).style("fill", (e) => e.icon == null ? A(e) ? null : e.color ?? null : (k(e) ? n.selectedIconNodeColor : n.iconNodeColor) ?? ot).attr("stroke", (e) => A(e) ? q.nodeStrokeSelected : e.id === x ? Z(e).strokeHovered : Z(e).stroke).style("stroke", (e) => A(e) || e.isAction === !0 ? null : e.color ?? null).attr("stroke-width", (e) => A(e) ? O + 1 : O).attr("r", (e) => Z(e).radius + (E(e) || e.id === x ? Be : 0));
1013
+ let T = n.selectsOnClick !== !1, E = (e) => e.isAction !== !0 && (T ? e.id === b : e.isSelected === !0), O = n.nodeBorderWidth ?? Le, k = (e) => E(e) && e.icon != null && n.selectedIconNodeColor != null, A = (e) => E(e) && !k(e), ee = (e) => {
1014
+ let t = n.actionNodeColors;
1015
+ return t == null ? null : e.id === x ? t.fillHovered ?? t.fill : t.fill;
1016
+ }, ne = (e) => e.id === x && n.hoveredIconNodeColor != null ? n.hoveredIconNodeColor : k(e) && n.selectedIconNodeColor != null ? n.selectedIconNodeColor : e.discColor ?? n.iconNodeColor ?? lt, j = () => {
1017
+ C.select("circle").attr("fill", (e) => e.icon == null ? A(e) ? G.nodeFillSelected : e.id === x ? Z(e).fillHovered : Z(e).fill : null).style("fill", (e) => e.isAction === !0 ? ee(e) : e.icon == null ? A(e) ? null : e.color ?? null : ne(e)).attr("stroke", (e) => A(e) ? G.nodeStrokeSelected : e.id === x ? Z(e).strokeHovered : Z(e).stroke).style("stroke", (e) => e.isAction === !0 ? n.actionNodeColors?.border ?? null : A(e) ? null : e.color ?? null).attr("stroke-width", (e) => A(e) ? O + 1 : O).attr("r", (e) => {
1018
+ let t = E(e) || e.id === x;
1019
+ return Z(e).radius + (t && n.growsActiveNodes !== !1 ? Ue : 0);
1020
+ });
1015
1021
  };
1016
1022
  u.on("click", () => {
1017
1023
  b = null, j();
1018
1024
  });
1019
- let M = je().scaleExtent([We, Ge]).on("zoom", (e) => {
1025
+ let ie = Ne().scaleExtent([qe, Je]).on("zoom", (e) => {
1020
1026
  d.attr("transform", e.transform.toString());
1021
1027
  });
1022
- u.call(M).on("dblclick.zoom", null);
1023
- let N = () => {
1024
- S.attr("x1", (e) => xt(e.source, "x")).attr("y1", (e) => xt(e.source, "y")).attr("x2", (e) => xt(e.target, "x")).attr("y2", (e) => xt(e.target, "y")), C.attr("transform", (e) => `translate(${String(e.x ?? 0)},${String(e.y ?? 0)})`);
1028
+ u.call(ie).on("dblclick.zoom", null);
1029
+ let M = () => {
1030
+ S.attr("x1", (e) => X(e.source, "x")).attr("y1", (e) => X(e.source, "y")).attr("x2", (e) => X(e.target, "x")).attr("y2", (e) => X(e.target, "y")), C.attr("transform", (e) => `translate(${String(e.x ?? 0)},${String(e.y ?? 0)})`);
1025
1031
  let e = new Map(g.map((e) => [e.id, e]));
1026
1032
  C.each((t, a, o) => {
1027
1033
  if (t.label == null) return;
1028
- let s = ht(t, (v.get(t.id) ?? []).map((t) => e.get(t)).filter((e) => e !== void 0), i, Y(t, n.wrapsLabels === !0));
1034
+ let s = vt(t, (v.get(t.id) ?? []).map((t) => e.get(t)).filter((e) => e !== void 0), i, q(t, n.wrapsLabels === !0));
1029
1035
  r($(o[a])).select("text").attr("text-anchor", s.anchor).attr("y", s.y).selectAll("tspan").attr("x", s.x);
1030
1036
  });
1031
- }, P = () => {
1037
+ }, N = () => {
1032
1038
  if (g.length === 0) return;
1033
1039
  let e = g.map((e) => e.x ?? 0), n = g.map((e) => e.y ?? 0), [r, a, o, s] = [
1034
1040
  Math.min(...e),
1035
1041
  Math.max(...e),
1036
1042
  Math.min(...n),
1037
1043
  Math.max(...n)
1038
- ], c = t.clientWidth || Ie, l = t.clientHeight || Le, u = i === "outside" ? Ue : He, d = Math.max(We, Math.min(1, c / (a - r + u * 2), l / (s - o + u * 2)));
1039
- return W.translate(c / 2, l / 2).scale(d).translate(-(r + a) / 2, -(o + s) / 2);
1040
- }, F = (e) => {
1044
+ ], c = t.clientWidth || ze, l = t.clientHeight || Be, u = i === "outside" ? Ke : Ge, d = Math.max(qe, Math.min(1, c / (a - r + u * 2), l / (s - o + u * 2)));
1045
+ return H.translate(c / 2, l / 2).scale(d).translate(-(r + a) / 2, -(o + s) / 2);
1046
+ }, P = (e) => {
1041
1047
  u.call((t) => {
1042
- M.transform(t, e);
1048
+ ie.transform(t, e);
1043
1049
  });
1044
- }, I = () => {
1050
+ }, ae = () => {
1045
1051
  l.alpha(1);
1046
- for (let e = 0; e < Re; e += 1) l.tick();
1052
+ for (let e = 0; e < Ve; e += 1) l.tick();
1047
1053
  l.stop();
1048
- }, L = () => {
1054
+ }, F = () => {
1049
1055
  y !== void 0 && cancelAnimationFrame(y), y = void 0;
1050
- }, R = (e) => {
1056
+ }, I = (e) => {
1051
1057
  let t = new Map(g.map((e) => [e.id, e]));
1052
- h = e, v = yt(e), g = e.nodes.map((e) => ({ ...e })), _ = e.links.map((e) => ({ ...e }));
1058
+ h = e, v = St(e), g = e.nodes.map((e) => ({ ...e })), _ = e.links.map((e) => ({ ...e }));
1053
1059
  let r = Math.min(o, s) * .22;
1054
1060
  for (let [e, n] of g.entries()) {
1055
1061
  let i = t.get(n.id), a = (v.get(n.id) ?? []).find((e) => t.has(e)), c = a == null ? void 0 : t.get(a), l = e / g.length * Math.PI * 2;
1056
- i ? (n.x = i.x, n.y = i.y) : c ? (n.x = (c.x ?? 0) + Math.cos(l) * rt, n.y = (c.y ?? 0) + Math.sin(l) * rt) : (n.x = o / 2 + Math.cos(l) * r, n.y = s / 2 + Math.sin(l) * r);
1062
+ i ? (n.x = i.x, n.y = i.y) : c ? (n.x = (c.x ?? 0) + Math.cos(l) * ot, n.y = (c.y ?? 0) + Math.sin(l) * ot) : (n.x = o / 2 + Math.cos(l) * r, n.y = s / 2 + Math.sin(l) * r);
1057
1063
  }
1058
1064
  l.nodes(g), c.links(_);
1059
- let i = S.data(_, bt), a = i.exit();
1060
- S = i.enter().append("line").attr("stroke", q.linkStroke).attr("stroke-width", 2).merge(i);
1065
+ let i = S.data(_, Ct), a = i.exit();
1066
+ S = i.enter().append("line").attr("stroke", G.linkStroke).attr("stroke-width", n.linkWidth ?? Ie).merge(i);
1061
1067
  let u = C.data(g, (e) => e.id), d = u.exit().style("pointer-events", "none"), f = u.enter().append("g").style("cursor", "pointer");
1062
1068
  return f.append("title"), f.append("circle"), f.append("text"), f.on("mouseenter", (e, t) => {
1063
1069
  x = t.id, j();
@@ -1065,56 +1071,56 @@ function pt(e, t, n = {}) {
1065
1071
  x === t.id && (x = null), j();
1066
1072
  }).on("click", (e, t) => {
1067
1073
  e.stopPropagation(), T && (b = b === t.id ? null : t.id), j(), n.onNodeClick?.($(h.nodes.find((e) => e.id === t.id)));
1068
- }).call(xe().on("start", (e, t) => {
1074
+ }).call(Ce().on("start", (e, t) => {
1069
1075
  e.sourceEvent?.stopPropagation(), t.fx = t.x, t.fy = t.y;
1070
1076
  }).on("drag", (e, t) => {
1071
- t.x = e.x, t.y = e.y, t.fx = e.x, t.fy = e.y, N();
1077
+ t.x = e.x, t.y = e.y, t.fx = e.x, t.fy = e.y, M();
1072
1078
  }).on("end", (e, t) => {
1073
1079
  t.fx = null, t.fy = null;
1074
- })), C = f.merge(u), C.select("text").attr("text-anchor", "middle").attr("y", (e) => e.label == null ? 4 : Z(e).radius + Ve).attr("font-size", (e) => e.label == null ? null : Ke).attr("fill", (e) => e.label == null ? q.nodeText : "currentColor").style("paint-order", (e) => e.label == null || n.labelHaloColor == null ? null : "stroke").style("stroke", (e) => e.label == null ? null : n.labelHaloColor ?? null).style("stroke-linejoin", (e) => e.label == null || n.labelHaloColor == null ? null : "round").style("stroke-width", (e) => e.label == null || n.labelHaloColor == null ? null : `${String(Je)}px`).selectAll("tspan").data((e) => Y(e, n.wrapsLabels === !0)).join("tspan").attr("x", 0).attr("dy", (e, t) => t === 0 ? 0 : K).text((e) => e), C.selectAll(`image.${at}`).data((e) => e.icon == null ? [] : [e]).join("image").attr("class", at).attr("href", (e) => `data:image/svg+xml,${encodeURIComponent(e.icon ?? "")}`).attr("x", -10).attr("y", -10).attr("width", ct).attr("height", ct).style("pointer-events", "none"), C.select("title").text((e) => e.title ?? ""), C.selectAll(`path.${J}`).data((e) => gt(e) == null ? [] : [e]).join("path").attr("class", J).attr("d", (e) => gt(e) ?? "").attr("fill", "none").attr("stroke", _t).attr("stroke-linecap", "round").attr("stroke-width", dt).style("pointer-events", "none"), C.selectAll(`text.${J}`).data((e) => e.symbol == null || gt(e) != null ? [] : [e]).join("text").attr("class", J).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", lt).attr("font-weight", 600).attr("fill", _t).style("pointer-events", "none").text((e) => e.symbol ?? ""), j(), {
1080
+ })), C = f.merge(u), C.select("text").attr("text-anchor", "middle").attr("y", (e) => e.label == null ? 4 : Z(e).radius + We).attr("font-size", (e) => e.label == null ? null : Ye).attr("fill", (e) => e.label == null ? G.nodeText : "currentColor").style("paint-order", (e) => e.label == null || n.labelHaloColor == null ? null : "stroke").style("stroke", (e) => e.label == null ? null : n.labelHaloColor ?? null).style("stroke-linejoin", (e) => e.label == null || n.labelHaloColor == null ? null : "round").style("stroke-width", (e) => e.label == null || n.labelHaloColor == null ? null : `${String(Ze)}px`).selectAll("tspan").data((e) => q(e, n.wrapsLabels === !0)).join("tspan").attr("x", 0).attr("dy", (e, t) => t === 0 ? 0 : W).text((e) => e), C.selectAll(`image.${ct}`).data((e) => e.icon == null ? [] : [e]).join("image").attr("class", ct).attr("href", (e) => `data:image/svg+xml,${encodeURIComponent(e.icon ?? "")}`).attr("x", -12).attr("y", -12).attr("width", dt).attr("height", dt).style("pointer-events", "none"), C.select("title").text((e) => e.title ?? ""), C.selectAll(`path.${K}`).data((e) => yt(e) == null ? [] : [e]).join("path").attr("class", K).attr("d", (e) => yt(e) ?? "").attr("fill", "none").attr("stroke", bt).style("stroke", (e) => e.isAction === !0 ? n.actionNodeColors?.symbol ?? null : null).attr("stroke-linecap", "round").attr("stroke-width", ht).style("pointer-events", "none"), C.selectAll(`text.${K}`).data((e) => e.symbol == null || yt(e) != null ? [] : [e]).join("text").attr("class", K).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", ft).attr("font-weight", 600).attr("fill", bt).style("pointer-events", "none").text((e) => e.symbol ?? ""), j(), {
1075
1081
  enteringNodes: f,
1076
1082
  exitingLinks: a,
1077
1083
  exitingNodes: d
1078
1084
  };
1079
1085
  };
1080
- return R(e), N(), {
1086
+ return I(e), M(), {
1081
1087
  destroy: () => {
1082
- L(), l.stop(), u.remove();
1088
+ F(), l.stop(), u.remove();
1083
1089
  },
1084
1090
  resize: () => {
1085
- let e = t.clientWidth || Ie, r = t.clientHeight || Le;
1091
+ let e = t.clientWidth || ze, r = t.clientHeight || Be;
1086
1092
  if (u.attr("width", e).attr("height", r).attr("viewBox", `0 0 ${String(e)} ${String(r)}`), l.force("center", D(e / 2, r / 2)), y !== void 0 || n.fitsView !== !0) return;
1087
- let i = P();
1088
- i && F(i);
1093
+ let i = N();
1094
+ i && P(i);
1089
1095
  },
1090
1096
  svg: m,
1091
1097
  triggerAutoLayout: () => {
1092
- L(), I(), N();
1093
- let e = n.fitsView === !0 ? P() : void 0;
1094
- e && F(e);
1098
+ F(), ae(), M();
1099
+ let e = n.fitsView === !0 ? N() : void 0;
1100
+ e && P(e);
1095
1101
  },
1096
1102
  update: (e) => {
1097
- if (vt(e) === vt(h)) {
1098
- R(e), y === void 0 && N();
1103
+ if (xt(e) === xt(h)) {
1104
+ I(e), y === void 0 && M();
1099
1105
  return;
1100
1106
  }
1101
- L();
1102
- let { enteringNodes: t, exitingLinks: r, exitingNodes: i } = R(e), o = new Map(g.map((e) => [e.id, {
1107
+ F();
1108
+ let { enteringNodes: t, exitingLinks: r, exitingNodes: i } = I(e), o = new Map(g.map((e) => [e.id, {
1103
1109
  x: e.x ?? 0,
1104
1110
  y: e.y ?? 0
1105
1111
  }]));
1106
- I();
1112
+ ae();
1107
1113
  let s = new Map(g.map((e) => [e.id, {
1108
1114
  x: e.x ?? 0,
1109
1115
  y: e.y ?? 0
1110
- }])), c = Ce(m), l = (n.fitsView === !0 ? P() : void 0) ?? c, u = (e) => {
1116
+ }])), c = Te(m), l = (n.fitsView === !0 ? N() : void 0) ?? c, u = (e) => {
1111
1117
  for (let t of g) {
1112
- let n = St($(o.get(t.id)), $(s.get(t.id)), e);
1118
+ let n = wt($(o.get(t.id)), $(s.get(t.id)), e);
1113
1119
  t.x = n.x, t.y = n.y;
1114
1120
  }
1115
- if (N(), t.style("opacity", e), i.style("opacity", 1 - e), r.style("opacity", 1 - e), F(W.translate(Q(c.x, l.x, e), Q(c.y, l.y, e)).scale(Q(c.k, l.k, e))), e < 1) return;
1116
- let a = n.fitsView === !0 ? P() : void 0;
1117
- a && F(a), t.style("opacity", null), i.remove(), r.remove();
1121
+ if (M(), t.style("opacity", e), i.style("opacity", 1 - e), r.style("opacity", 1 - e), P(H.translate(Q(c.x, l.x, e), Q(c.y, l.y, e)).scale(Q(c.k, l.k, e))), e < 1) return;
1122
+ let a = n.fitsView === !0 ? N() : void 0;
1123
+ a && P(a), t.style("opacity", null), i.remove(), r.remove();
1118
1124
  };
1119
1125
  if (a <= 0) {
1120
1126
  u(1);
@@ -1123,28 +1129,28 @@ function pt(e, t, n = {}) {
1123
1129
  u(0);
1124
1130
  let d = performance.now(), f = (e) => {
1125
1131
  let t = Math.min(1, (e - d) / a);
1126
- u(Ct(t)), y = t < 1 ? requestAnimationFrame(f) : void 0;
1132
+ u(Tt(t)), y = t < 1 ? requestAnimationFrame(f) : void 0;
1127
1133
  };
1128
1134
  y = requestAnimationFrame(f);
1129
1135
  }
1130
1136
  };
1131
1137
  }
1132
- function Y(e, t) {
1138
+ function q(e, t) {
1133
1139
  if (e.label == null && e.symbol != null) return [];
1134
1140
  let n = e.label ?? e.id;
1135
- if (!t || e.label == null || n.length <= Qe) return [n];
1141
+ if (!t || e.label == null || n.length <= tt) return [n];
1136
1142
  let r = n.length / 2, i = -1;
1137
1143
  for (let e = n.indexOf(" "); e !== -1; e = n.indexOf(" ", e + 1)) (i === -1 || Math.abs(e - r) < Math.abs(i - r)) && (i = e);
1138
1144
  return i === -1 ? [n] : [n.slice(0, i), n.slice(i + 1)];
1139
1145
  }
1140
- function mt(e) {
1141
- return e.length === 0 ? 0 : Math.max(...e.map((e) => e.length)) * qe;
1146
+ function J(e) {
1147
+ return e.length === 0 ? 0 : Math.max(...e.map((e) => e.length)) * Xe;
1142
1148
  }
1143
- function ht(e, t, n, r) {
1149
+ function vt(e, t, n, r) {
1144
1150
  let { radius: i } = Z(e), a = {
1145
1151
  anchor: "middle",
1146
1152
  x: 0,
1147
- y: i + Ve
1153
+ y: i + We
1148
1154
  };
1149
1155
  if (n === "below" || t.length === 0) return a;
1150
1156
  let o = t.map((t) => Math.atan2((t.y ?? 0) - (e.y ?? 0), (t.x ?? 0) - (e.x ?? 0))).toSorted((e, t) => e - t), s = 0, c = 0;
@@ -1152,35 +1158,35 @@ function ht(e, t, n, r) {
1152
1158
  let n = e === o.length - 1 ? $(o[0]) + Math.PI * 2 : $(o[e + 1]);
1153
1159
  n - t <= s || (s = n - t, c = t + s / 2);
1154
1160
  }
1155
- let l = Math.cos(c), u = Math.sin(c), d = (r.length - 1) * K;
1156
- if (s < Ze) {
1157
- let e = mt(r), t = r.length * K, n = (Math.abs(l) * e + Math.abs(u) * t) / 2, a = (Math.abs(l) * t + Math.abs(u) * e) / 2, o = i + Ye + n, c = a / Math.tan(s / 2) + n, f = Math.min(Math.max(o, c), o + e);
1161
+ let l = Math.cos(c), u = Math.sin(c), d = (r.length - 1) * W;
1162
+ if (s < et) {
1163
+ let e = J(r), t = r.length * W, n = (Math.abs(l) * e + Math.abs(u) * t) / 2, a = (Math.abs(l) * t + Math.abs(u) * e) / 2, o = i + Qe + n, c = a / Math.tan(s / 2) + n, f = Math.min(Math.max(o, c), o + e);
1158
1164
  return {
1159
1165
  anchor: "middle",
1160
1166
  x: l * f,
1161
- y: u * f + Ke / 3 - d / 2
1167
+ y: u * f + Ye / 3 - d / 2
1162
1168
  };
1163
1169
  }
1164
- if (Math.abs(l) < Xe) return u > 0 ? a : {
1170
+ if (Math.abs(l) < $e) return u > 0 ? a : {
1165
1171
  anchor: "middle",
1166
1172
  x: 0,
1167
- y: -(i + Ye) - d
1173
+ y: -(i + Qe) - d
1168
1174
  };
1169
- let f = i + Ye + Math.abs(u) * r.length * K / 2;
1175
+ let f = i + Qe + Math.abs(u) * r.length * W / 2;
1170
1176
  return {
1171
1177
  anchor: l > 0 ? "start" : "end",
1172
1178
  x: l * f,
1173
- y: u * f + Ke / 3 - d / 2
1179
+ y: u * f + Ye / 3 - d / 2
1174
1180
  };
1175
1181
  }
1176
- function gt(e) {
1177
- let t = ut;
1178
- return e.symbol === "+" ? `M-6,0H${String(t)}M0,-6V${String(t)}` : void 0;
1182
+ function yt(e) {
1183
+ let t = mt;
1184
+ return e.symbol === "+" ? `M-5.83,0H${String(t)}M0,-5.83V${String(t)}` : void 0;
1179
1185
  }
1180
- function _t(e) {
1181
- return e.isAction === !0 ? it.symbol : q.nodeText;
1186
+ function bt(e) {
1187
+ return e.isAction === !0 ? st.symbol : G.nodeText;
1182
1188
  }
1183
- function vt(e) {
1189
+ function xt(e) {
1184
1190
  return JSON.stringify([e.nodes.map((e) => [
1185
1191
  e.id,
1186
1192
  e.label,
@@ -1189,26 +1195,26 @@ function vt(e) {
1189
1195
  e.icon != null
1190
1196
  ]), e.links.map((e) => [e.source, e.target])]);
1191
1197
  }
1192
- function yt(e) {
1198
+ function St(e) {
1193
1199
  let t = /* @__PURE__ */ new Map();
1194
1200
  for (let n of e.links) t.set(n.source, [...t.get(n.source) ?? [], n.target]), t.set(n.target, [...t.get(n.target) ?? [], n.source]);
1195
1201
  return t;
1196
1202
  }
1197
- function bt(e) {
1198
- return `${X(e.source)}>${X(e.target)}`;
1203
+ function Ct(e) {
1204
+ return `${Y(e.source)}>${Y(e.target)}`;
1199
1205
  }
1200
- function X(e) {
1206
+ function Y(e) {
1201
1207
  return typeof e == "object" ? e.id : String(e);
1202
1208
  }
1203
- function xt(e, t) {
1209
+ function X(e, t) {
1204
1210
  return typeof e == "object" ? e[t] ?? 0 : 0;
1205
1211
  }
1206
1212
  function Z(e) {
1207
- if (e.isAction === !0) return it;
1208
- let t = $(ft[Math.max(0, Math.min(e.level ?? ze, ft.length - 1))]);
1213
+ if (e.isAction === !0) return st;
1214
+ let t = $(gt[Math.max(0, Math.min(e.level ?? He, gt.length - 1))]);
1209
1215
  return e.icon == null ? t : {
1210
1216
  ...t,
1211
- radius: st,
1217
+ radius: ut,
1212
1218
  stroke: t.fill,
1213
1219
  strokeHovered: t.stroke
1214
1220
  };
@@ -1216,17 +1222,17 @@ function Z(e) {
1216
1222
  function Q(e, t, n) {
1217
1223
  return e + (t - e) * n;
1218
1224
  }
1219
- function St(e, t, n) {
1225
+ function wt(e, t, n) {
1220
1226
  return {
1221
1227
  x: Q(e.x, t.x, n),
1222
1228
  y: Q(e.y, t.y, n)
1223
1229
  };
1224
1230
  }
1225
- function Ct(e) {
1231
+ function Tt(e) {
1226
1232
  return e < .5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2;
1227
1233
  }
1228
1234
  function $(e) {
1229
1235
  if (e === void 0) throw Error("Expected a value in the network diagram.");
1230
1236
  return e;
1231
1237
  }
1232
- export { pt as renderNetworkDiagram };
1238
+ export { _t as renderNetworkDiagram };
@@ -8,7 +8,8 @@ import { TreeDiagramNode, TreeDiagramOptions } from './treeDiagram';
8
8
  export type { BarChartData, BarChartSeries } from './tanStackCharts';
9
9
  export type { ChordDiagramData, ChordDiagramLink, ChordDiagramNode, ChordDiagramOptions } from './chordDiagram';
10
10
  export type { ErdDiagramData, ErdDiagramEdge, ErdDiagramNode, ErdDiagramNodeTypeId, ErdDiagramOptions } from './erdDiagram';
11
- export type { NetworkDiagramData, NetworkDiagramLabelPlacementId, NetworkDiagramLink, NetworkDiagramNode, NetworkDiagramOptions } from './networkDiagram';
11
+ export type { NetworkDiagramActionNodeColors, NetworkDiagramData, NetworkDiagramLabelPlacementId } from './networkDiagram';
12
+ export type { NetworkDiagramLink, NetworkDiagramNode, NetworkDiagramOptions } from './networkDiagram';
12
13
  export type { SankeyDiagramData, SankeyDiagramLink, SankeyDiagramNode, SankeyDiagramOptions } from './sankeyDiagram';
13
14
  export type { TreeDiagramNode, TreeDiagramNodeRoleId, TreeDiagramOptions } from './treeDiagram';
14
15
  export interface D3View extends PresentationView {
@@ -1,5 +1,6 @@
1
1
  export interface NetworkDiagramNode {
2
2
  id: string;
3
+ discColor?: string;
3
4
  color?: string;
4
5
  icon?: string;
5
6
  isAction?: boolean;
@@ -18,12 +19,16 @@ export interface NetworkDiagramData {
18
19
  nodes: NetworkDiagramNode[];
19
20
  }
20
21
  export interface NetworkDiagramOptions {
22
+ actionNodeColors?: NetworkDiagramActionNodeColors;
21
23
  chargeStrength?: number;
22
24
  fitsView?: boolean;
25
+ growsActiveNodes?: boolean;
26
+ hoveredIconNodeColor?: string;
23
27
  iconNodeColor?: string;
24
28
  labelHaloColor?: string;
25
29
  labelPlacementId?: NetworkDiagramLabelPlacementId;
26
30
  linkDistance?: number;
31
+ linkWidth?: number;
27
32
  nodeBorderWidth?: number;
28
33
  onNodeClick?: (node: NetworkDiagramNode) => void;
29
34
  reservesLabelRoom?: boolean;
@@ -32,6 +37,12 @@ export interface NetworkDiagramOptions {
32
37
  transitionDuration?: number;
33
38
  wrapsLabels?: boolean;
34
39
  }
40
+ export interface NetworkDiagramActionNodeColors {
41
+ border: string;
42
+ fill: string;
43
+ fillHovered?: string;
44
+ symbol: string;
45
+ }
35
46
  export type NetworkDiagramLabelPlacementId = 'below' | 'outside';
36
47
  export interface NetworkDiagramHandle {
37
48
  destroy: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dpuse/dpuse-tool-d3-visualiser",
3
- "version": "1.0.131",
3
+ "version": "1.0.133",
4
4
  "private": false,
5
5
  "description": "A TypeScript wrapper for D3, TanStack Charts, and Unovis that implements the Data Positioning chart-rendering interface, providing ERD (dagre), Sankey (d3-sankey), chord (Unovis), network (d3-force), tree (d3-hierarchy), and bar chart (TanStack Charts) renderers.",
6
6
  "license": "MIT",