vue3-network-graph 0.2.1 → 0.2.2
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.en.md +1 -0
- package/README.md +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.mjs +461 -455
- package/dist/index.umd.cjs +5 -5
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -304,7 +304,7 @@ var b = {
|
|
|
304
304
|
"y",
|
|
305
305
|
"width",
|
|
306
306
|
"height"
|
|
307
|
-
], Bt = 6, Vt = 14, Ht = 3, x = 60, Ut = .2, Wt = 5, Gt = 160, Kt = 140, qt = 12, Jt = 4e3, Yt = 12, Xt = 4e3, Zt = {
|
|
307
|
+
], Bt = 6, Vt = 14, Ht = 3, x = 60, Ut = .2, Wt = 5, Gt = 160, Kt = 140, qt = 12, Jt = 4e3, Yt = 12, Xt = 4e3, Zt = 45, Qt = {
|
|
308
308
|
__name: "Topology",
|
|
309
309
|
props: {
|
|
310
310
|
nodes: {
|
|
@@ -363,9 +363,9 @@ var b = {
|
|
|
363
363
|
"delete-request"
|
|
364
364
|
],
|
|
365
365
|
setup(_, { expose: re, emit: ie }) {
|
|
366
|
-
let v = _, y = ie,
|
|
367
|
-
|
|
368
|
-
},
|
|
366
|
+
let v = _, y = ie, Qt = 0, $t = () => {
|
|
367
|
+
Qt++;
|
|
368
|
+
}, en = (e) => e && typeof e == "object" ? {
|
|
369
369
|
text: e.text,
|
|
370
370
|
rotation: e.rotation || 0,
|
|
371
371
|
fontSize: e.fontSize,
|
|
@@ -375,33 +375,33 @@ var b = {
|
|
|
375
375
|
rotation: 0,
|
|
376
376
|
fontSize: void 0,
|
|
377
377
|
color: void 0
|
|
378
|
-
},
|
|
379
|
-
|
|
378
|
+
}, tn = (e, t = 11) => e.fontSize || t, nn = (e) => e.fontColor || "#000000", rn = (e, t = 500) => e.fontWeight || t, an = (e, t) => e.fontSize || en(t).fontSize || 8, on = (e, t) => e.fontColor || en(t).color || t != null && t === e.centerText && gi.value || "#000000", S = f(v.nodes.map((e) => ({ ...e }))), sn = null, C = () => {
|
|
379
|
+
sn = S.value, y("update:nodes", S.value);
|
|
380
380
|
};
|
|
381
381
|
te(() => v.nodes, (e) => {
|
|
382
382
|
let t = Array.isArray(e) ? e : [];
|
|
383
|
-
if (t ===
|
|
383
|
+
if (t === sn) return;
|
|
384
384
|
let n = null, r = null;
|
|
385
385
|
try {
|
|
386
386
|
n = JSON.stringify(t), r = JSON.stringify(S.value);
|
|
387
387
|
} catch {
|
|
388
388
|
n = null;
|
|
389
389
|
}
|
|
390
|
-
(n === null || n !== r) && (
|
|
390
|
+
(n === null || n !== r) && ($t(), S.value = t.map((e) => ({ ...e })));
|
|
391
391
|
}, { deep: !0 });
|
|
392
|
-
let
|
|
392
|
+
let cn = f(v.lineMode);
|
|
393
393
|
te(() => v.lineMode, (e) => {
|
|
394
|
-
|
|
394
|
+
cn.value = e;
|
|
395
395
|
});
|
|
396
396
|
let w = t({
|
|
397
|
-
get: () =>
|
|
397
|
+
get: () => cn.value,
|
|
398
398
|
set: (e) => {
|
|
399
|
-
|
|
399
|
+
cn.value = e, y("update:lineMode", e);
|
|
400
400
|
}
|
|
401
|
-
}), T = f(null), E = f(null),
|
|
401
|
+
}), T = f(null), E = f(null), ln = f({
|
|
402
402
|
x: 0,
|
|
403
403
|
y: 0
|
|
404
|
-
}),
|
|
404
|
+
}), un = f(null), dn = null, fn = !1, pn = !1, D = f([]), O = f(/* @__PURE__ */ new Map()), k = f(/* @__PURE__ */ new Set()), A = t(() => {
|
|
405
405
|
let e = v.edges, t = [];
|
|
406
406
|
if (D.value.length) {
|
|
407
407
|
let n = new Set(e.map((e) => e.id));
|
|
@@ -414,56 +414,56 @@ var b = {
|
|
|
414
414
|
} : e));
|
|
415
415
|
let i = new Set(S.value.map((e) => e.id)), a = k.value;
|
|
416
416
|
return n.filter((e) => !a.has(e.id) && i.has(e.from) && i.has(e.to));
|
|
417
|
-
}),
|
|
417
|
+
}), mn = t(() => v.config.watchDataChanges === !0), hn = f({
|
|
418
418
|
nodes: [],
|
|
419
419
|
edges: []
|
|
420
|
-
}),
|
|
420
|
+
}), gn = "", j = null, _n = () => JSON.parse(JSON.stringify({
|
|
421
421
|
nodes: S.value,
|
|
422
422
|
edges: A.value
|
|
423
|
-
})),
|
|
423
|
+
})), vn = (e, t) => {
|
|
424
424
|
let n = new Map(e.map((e) => [e.id, e])), r = new Map(t.map((e) => [e.id, e]));
|
|
425
425
|
return {
|
|
426
426
|
added: t.filter((e) => !n.has(e.id)).map((e) => e.id),
|
|
427
427
|
removed: e.filter((e) => !r.has(e.id)).map((e) => e.id),
|
|
428
428
|
updated: t.filter((e) => n.has(e.id) && JSON.stringify(n.get(e.id)) !== JSON.stringify(e)).map((e) => e.id)
|
|
429
429
|
};
|
|
430
|
-
},
|
|
431
|
-
nodes:
|
|
432
|
-
edges:
|
|
433
|
-
}),
|
|
434
|
-
if (j = null, !
|
|
435
|
-
let e =
|
|
436
|
-
if (t ===
|
|
437
|
-
let n =
|
|
438
|
-
|
|
430
|
+
}, yn = (e) => ({
|
|
431
|
+
nodes: vn(hn.value.nodes, e.nodes),
|
|
432
|
+
edges: vn(hn.value.edges, e.edges)
|
|
433
|
+
}), bn = () => {
|
|
434
|
+
if (j = null, !mn.value) return;
|
|
435
|
+
let e = _n(), t = JSON.stringify(e);
|
|
436
|
+
if (t === gn) return;
|
|
437
|
+
let n = yn(e), r = n.nodes.added.length + n.nodes.removed.length + n.nodes.updated.length + n.edges.added.length + n.edges.removed.length + n.edges.updated.length;
|
|
438
|
+
gn = t, r && y("data-change", {
|
|
439
439
|
nodes: e.nodes,
|
|
440
440
|
edges: e.edges,
|
|
441
441
|
summary: n
|
|
442
442
|
});
|
|
443
|
-
}, bn = () => {
|
|
444
|
-
pn.value && (j && clearTimeout(j), j = setTimeout(yn, 300));
|
|
445
443
|
}, xn = () => {
|
|
446
|
-
j
|
|
444
|
+
mn.value && (j && clearTimeout(j), j = setTimeout(bn, 300));
|
|
445
|
+
}, Sn = () => {
|
|
446
|
+
j &&= (clearTimeout(j), null), hn.value = _n(), gn = "";
|
|
447
447
|
};
|
|
448
448
|
te([
|
|
449
449
|
S,
|
|
450
450
|
D,
|
|
451
451
|
k,
|
|
452
452
|
O
|
|
453
|
-
], () =>
|
|
454
|
-
e ?
|
|
453
|
+
], () => xn(), { deep: !0 }), te(mn, (e) => {
|
|
454
|
+
e ? Sn() : j &&= (clearTimeout(j), null);
|
|
455
455
|
}), u(() => {
|
|
456
|
-
|
|
456
|
+
mn.value && Sn();
|
|
457
457
|
});
|
|
458
|
-
let
|
|
458
|
+
let Cn = () => _n(), wn = () => {
|
|
459
459
|
let e = new Set(z.value), t = new Set(B.value);
|
|
460
460
|
return {
|
|
461
461
|
nodeIds: e,
|
|
462
462
|
nodes: S.value.filter((t) => e.has(t.id)),
|
|
463
463
|
edges: A.value.filter((n) => t.has(n.id) || e.has(n.from) || e.has(n.to))
|
|
464
464
|
};
|
|
465
|
-
},
|
|
466
|
-
let { nodeIds: e, nodes: t, edges: n } =
|
|
465
|
+
}, Tn = () => {
|
|
466
|
+
let { nodeIds: e, nodes: t, edges: n } = wn();
|
|
467
467
|
return !t.length && !n.length ? {
|
|
468
468
|
nodes: [],
|
|
469
469
|
edges: []
|
|
@@ -471,25 +471,25 @@ var b = {
|
|
|
471
471
|
nodes: t,
|
|
472
472
|
edges: n
|
|
473
473
|
})));
|
|
474
|
-
},
|
|
474
|
+
}, En = (e) => {
|
|
475
475
|
let t = e.target;
|
|
476
476
|
if (!t || t === document.body) return !1;
|
|
477
477
|
let n = String(t.tagName || "").toLowerCase();
|
|
478
478
|
return n === "input" || n === "textarea" || n === "select" || t.isContentEditable;
|
|
479
|
-
},
|
|
480
|
-
let e =
|
|
479
|
+
}, Dn = o(), On = () => {
|
|
480
|
+
let e = Dn?.vnode?.props;
|
|
481
481
|
return !!e && "onDeleteRequest" in e;
|
|
482
|
-
},
|
|
483
|
-
let { nodes: e, edges: t } =
|
|
482
|
+
}, kn = () => {
|
|
483
|
+
let { nodes: e, edges: t } = wn();
|
|
484
484
|
y("delete-request", JSON.parse(JSON.stringify({
|
|
485
485
|
nodes: e,
|
|
486
486
|
edges: t
|
|
487
487
|
})));
|
|
488
|
-
},
|
|
489
|
-
(e.key === "Delete" || e.key === "Backspace") && (e.isComposing || e.ctrlKey || e.metaKey || e.altKey || v.config?.enableDeleteKey !== !1 && v.editable && (
|
|
488
|
+
}, An = (e) => {
|
|
489
|
+
(e.key === "Delete" || e.key === "Backspace") && (e.isComposing || e.ctrlKey || e.metaKey || e.altKey || v.config?.enableDeleteKey !== !1 && v.editable && (En(e) || (z.value.length || B.value.length) && (T.value || J.value || Y.value || (e.preventDefault(), On() ? kn() : Tn()))));
|
|
490
490
|
};
|
|
491
|
-
u(() => window.addEventListener("keydown",
|
|
492
|
-
let
|
|
491
|
+
u(() => window.addEventListener("keydown", An)), l(() => window.removeEventListener("keydown", An));
|
|
492
|
+
let jn = (e) => {
|
|
493
493
|
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(S.value.map((e) => e.id)), r = [];
|
|
494
494
|
for (let e of t) {
|
|
495
495
|
let t = JSON.parse(JSON.stringify(e));
|
|
@@ -498,7 +498,7 @@ var b = {
|
|
|
498
498
|
n.add(t.id), r.push(t);
|
|
499
499
|
}
|
|
500
500
|
return r.length ? (S.value = [...S.value, ...r], C(), JSON.parse(JSON.stringify(r))) : [];
|
|
501
|
-
},
|
|
501
|
+
}, Mn = (e) => {
|
|
502
502
|
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(A.value.map((e) => e.id)), r = [];
|
|
503
503
|
for (let e of t) {
|
|
504
504
|
let t = JSON.parse(JSON.stringify(e));
|
|
@@ -515,7 +515,7 @@ var b = {
|
|
|
515
515
|
k.value = new Set([...k.value].filter((t) => !e.has(t)));
|
|
516
516
|
}
|
|
517
517
|
return D.value = [...D.value, ...r], r.forEach((e) => y("edge-create", JSON.parse(JSON.stringify(e)))), JSON.parse(JSON.stringify(r));
|
|
518
|
-
},
|
|
518
|
+
}, Nn = (e) => {
|
|
519
519
|
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && e.id != null);
|
|
520
520
|
if (!t.length) return [];
|
|
521
521
|
let n = /* @__PURE__ */ new Map();
|
|
@@ -537,7 +537,7 @@ var b = {
|
|
|
537
537
|
};
|
|
538
538
|
return r.push(i), i;
|
|
539
539
|
}), r.length ? (C(), JSON.parse(JSON.stringify(r))) : [];
|
|
540
|
-
},
|
|
540
|
+
}, Pn = (e) => {
|
|
541
541
|
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && e.id != null);
|
|
542
542
|
if (!t.length) return [];
|
|
543
543
|
let n = new Set(A.value.map((e) => e.id)), r = new Map(O.value), i = [];
|
|
@@ -558,12 +558,12 @@ var b = {
|
|
|
558
558
|
});
|
|
559
559
|
}
|
|
560
560
|
return i.length ? (O.value = r, y("edge-update", JSON.parse(JSON.stringify(i))), JSON.parse(JSON.stringify(i))) : [];
|
|
561
|
-
},
|
|
561
|
+
}, Fn = (e) => {
|
|
562
562
|
let t = e && typeof e == "object" ? e : null;
|
|
563
|
-
return D.value = [], k.value = /* @__PURE__ */ new Set(), O.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (S.value = JSON.parse(JSON.stringify(t.nodes)), C()) : (S.value = (Array.isArray(v.nodes) ? v.nodes : []).map((e) => ({ ...e })),
|
|
563
|
+
return D.value = [], k.value = /* @__PURE__ */ new Set(), O.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (S.value = JSON.parse(JSON.stringify(t.nodes)), C()) : (S.value = (Array.isArray(v.nodes) ? v.nodes : []).map((e) => ({ ...e })), sn = S.value), z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V(), Sn(), _n();
|
|
564
564
|
};
|
|
565
565
|
te(() => v.edges, (e) => {
|
|
566
|
-
|
|
566
|
+
$t();
|
|
567
567
|
let t = Array.isArray(e) ? e : [], n = new Set(t.map((e) => e.id));
|
|
568
568
|
if (D.value.length) {
|
|
569
569
|
let e = D.value.filter((e) => !n.has(e.id));
|
|
@@ -578,7 +578,7 @@ var b = {
|
|
|
578
578
|
r && (O.value = e);
|
|
579
579
|
}
|
|
580
580
|
}, { deep: !0 });
|
|
581
|
-
let
|
|
581
|
+
let In = t(() => {
|
|
582
582
|
let e = {};
|
|
583
583
|
A.value.forEach((t) => {
|
|
584
584
|
let n = [t.from, t.to].sort().join("__");
|
|
@@ -616,11 +616,11 @@ var b = {
|
|
|
616
616
|
};
|
|
617
617
|
});
|
|
618
618
|
}), t;
|
|
619
|
-
}),
|
|
619
|
+
}), Ln = t(() => {
|
|
620
620
|
let e = /* @__PURE__ */ new Map();
|
|
621
621
|
for (let t of S.value) e.set(t.id, t);
|
|
622
622
|
return e;
|
|
623
|
-
}), M = (e) =>
|
|
623
|
+
}), M = (e) => Ln.value.get(e), N = (e) => e.state != "none" && b[e.state] && b[e.state].color || "#00f0ff", Rn = (e) => b[e.state] || b.normal, zn = (e) => e.nodeType === "text", Bn = (e) => e.nodeType === "border-only", Vn = [
|
|
624
624
|
"image",
|
|
625
625
|
"img",
|
|
626
626
|
"picture"
|
|
@@ -628,30 +628,30 @@ var b = {
|
|
|
628
628
|
if (!e) return "";
|
|
629
629
|
let t = e.image ?? e.src ?? e.img ?? e.imageUrl;
|
|
630
630
|
return typeof t == "string" && t.trim() ? t.trim() : "";
|
|
631
|
-
},
|
|
632
|
-
if (!e ||
|
|
633
|
-
|
|
631
|
+
}, Hn = (e) => e ? Vn.includes(String(e.nodeType ?? "").toLowerCase()) ? !0 : (v.config?.imageNodeBySource || !e.nodeType) && !!P(e) : !1, Un = t(() => v.config?.imageFit === "cover" ? "cover" : "contain"), Wn = t(() => Un.value === "contain" ? "xMidYMid meet" : "xMidYMid slice"), Gn = `-30 -30 ${x} ${x}`, Kn = /* @__PURE__ */ new Map(), qn = f(0), Jn = (e) => {
|
|
632
|
+
if (!e || Kn.has(e) || typeof Image > "u") return;
|
|
633
|
+
Kn.set(e, null);
|
|
634
634
|
let t = new Image();
|
|
635
635
|
t.onload = () => {
|
|
636
|
-
|
|
636
|
+
Kn.set(e, {
|
|
637
637
|
w: t.naturalWidth || 1,
|
|
638
638
|
h: t.naturalHeight || 1
|
|
639
|
-
}),
|
|
639
|
+
}), qn.value++;
|
|
640
640
|
}, t.onerror = () => {
|
|
641
|
-
|
|
641
|
+
Kn.set(e, {
|
|
642
642
|
w: 1,
|
|
643
643
|
h: 1
|
|
644
|
-
}),
|
|
644
|
+
}), qn.value++;
|
|
645
645
|
}, t.src = e;
|
|
646
646
|
}, F = (e) => {
|
|
647
|
-
|
|
648
|
-
let t = P(e), n = t ?
|
|
647
|
+
qn.value;
|
|
648
|
+
let t = P(e), n = t ? Kn.get(t) : null, { w: r, h: i } = I(e);
|
|
649
649
|
if (!n) return {
|
|
650
650
|
w: r,
|
|
651
651
|
h: i
|
|
652
652
|
};
|
|
653
653
|
let a = n.w, o = n.h, s;
|
|
654
|
-
if (
|
|
654
|
+
if (Un.value === "contain") s = Math.min(x / a, x / o);
|
|
655
655
|
else {
|
|
656
656
|
let e = Math.max(r, i) / x;
|
|
657
657
|
s = Math.max(r / e / a, i / e / o);
|
|
@@ -662,37 +662,37 @@ var b = {
|
|
|
662
662
|
};
|
|
663
663
|
};
|
|
664
664
|
ne(() => {
|
|
665
|
-
for (let e of S.value)
|
|
665
|
+
for (let e of S.value) Hn(e) && Jn(P(e));
|
|
666
666
|
});
|
|
667
|
-
let
|
|
667
|
+
let Yn = (e, t) => {
|
|
668
668
|
let n = Number(e);
|
|
669
669
|
return Number.isFinite(n) && n > 0 ? n : t;
|
|
670
|
-
},
|
|
671
|
-
let t =
|
|
670
|
+
}, Xn = (e) => {
|
|
671
|
+
let t = Yn(e.width, x), n = Yn(e.height, x);
|
|
672
672
|
return {
|
|
673
673
|
sx: t / x,
|
|
674
674
|
sy: n / x
|
|
675
675
|
};
|
|
676
|
-
},
|
|
676
|
+
}, Zn = (e) => {
|
|
677
677
|
let t = Math.max(e.width, e.height);
|
|
678
678
|
return isNaN(t) ? 30 : t / 2;
|
|
679
|
-
}, Zn = (e) => {
|
|
680
|
-
let { sx: t, sy: n } = Yn(e);
|
|
681
|
-
return t === 1 && n === 1 ? "" : `scale(${t}, ${n})`;
|
|
682
679
|
}, Qn = (e) => {
|
|
680
|
+
let { sx: t, sy: n } = Xn(e);
|
|
681
|
+
return t === 1 && n === 1 ? "" : `scale(${t}, ${n})`;
|
|
682
|
+
}, $n = (e) => {
|
|
683
683
|
let { w: t, h: n } = I(e), r = Math.min(10, t * .3), i = Math.min(10, n * .3);
|
|
684
684
|
return `translate(${t / 2 - r}, ${-(n / 2 - i)})`;
|
|
685
|
-
},
|
|
685
|
+
}, er = t(() => {
|
|
686
686
|
let e = Number(v.config.labelGap);
|
|
687
687
|
return Number.isFinite(e) && e >= 0 ? e : 18;
|
|
688
|
-
}),
|
|
689
|
-
if (
|
|
688
|
+
}), tr = (e) => {
|
|
689
|
+
if (zn(e)) return 4;
|
|
690
690
|
let { h: t } = I(e);
|
|
691
|
-
return e.labelPosition === "top" ? -(t / 2 +
|
|
692
|
-
},
|
|
691
|
+
return e.labelPosition === "top" ? -(t / 2 + er.value) : e.labelPosition === "center" ? 0 : t / 2 + er.value;
|
|
692
|
+
}, nr = (e) => {
|
|
693
693
|
let t = L(e);
|
|
694
|
-
if (
|
|
695
|
-
let n =
|
|
694
|
+
if (zn(e) || !e.label) return t;
|
|
695
|
+
let n = tn(e), r = tr(e);
|
|
696
696
|
if (e.labelPosition === "top") {
|
|
697
697
|
let e = r - n - 4;
|
|
698
698
|
e < t.y && (t.height += t.y - e, t.y = e);
|
|
@@ -701,11 +701,11 @@ var b = {
|
|
|
701
701
|
i > t.y + t.height && (t.height = i - t.y);
|
|
702
702
|
}
|
|
703
703
|
return t;
|
|
704
|
-
},
|
|
705
|
-
let t =
|
|
704
|
+
}, rr = (e) => e.borderStyle !== "none" && (e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0), I = (e) => {
|
|
705
|
+
let t = zn(e), n = Bn(e);
|
|
706
706
|
return {
|
|
707
|
-
w:
|
|
708
|
-
h:
|
|
707
|
+
w: Yn(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : n ? Math.max(80, String(e.label).length * 8 + 24) : x),
|
|
708
|
+
h: Yn(e.height, t ? 26 : n ? 40 : x)
|
|
709
709
|
};
|
|
710
710
|
}, L = (e) => {
|
|
711
711
|
let { w: t, h: n } = I(e);
|
|
@@ -715,52 +715,52 @@ var b = {
|
|
|
715
715
|
width: t,
|
|
716
716
|
height: n
|
|
717
717
|
};
|
|
718
|
-
}, R = (e) =>
|
|
718
|
+
}, R = (e) => rr(e) ? L(e) : null, ir = (e) => e.background && e.background !== "none" ? e.background : null, z = f([]), B = f([]);
|
|
719
719
|
t(() => z.value.length === 1 ? z.value[0] : null), t(() => B.value.length === 1 ? B.value[0] : null);
|
|
720
|
-
let
|
|
720
|
+
let ar = (e) => z.value.includes(e.id), or = (e) => B.value.includes(e.id), V = () => {
|
|
721
721
|
y("selection-change", {
|
|
722
722
|
nodes: S.value.filter((e) => z.value.includes(e.id)),
|
|
723
723
|
edges: A.value.filter((e) => B.value.includes(e.id))
|
|
724
724
|
});
|
|
725
|
-
},
|
|
725
|
+
}, sr = (e) => typeof e == "number" ? Number.isFinite(e) && e >= 0 ? Math.floor(e) : Infinity : typeof e == "string" && /^\d+$/.test(e.trim()) ? parseInt(e.trim(), 10) : Infinity, cr = t(() => sr(v.config.maxSelectNodes)), lr = t(() => sr(v.config.maxSelectEdges)), H = (e, t, n) => {
|
|
726
726
|
let r = new Set(e), i = [];
|
|
727
727
|
for (let e of t) r.has(e) || (r.add(e), i.push(e));
|
|
728
728
|
if (n === Infinity) return [...e, ...i];
|
|
729
729
|
let a = Math.max(0, n - e.length);
|
|
730
730
|
return [...e, ...i.slice(0, a)];
|
|
731
731
|
};
|
|
732
|
-
te([
|
|
732
|
+
te([cr, lr], ([e, t]) => {
|
|
733
733
|
let n = !1;
|
|
734
734
|
z.value.length > e && (z.value = z.value.slice(0, e), n = !0), B.value.length > t && (B.value = B.value.slice(0, t), n = !0), n && V();
|
|
735
735
|
});
|
|
736
|
-
let
|
|
737
|
-
if (!
|
|
736
|
+
let ur = t(() => v.config.selectedBorderColor || "#fbbf24"), dr = t(() => v.config?.edgeLayer !== "below"), fr = t(() => v.config?.highlightEdgeOnTop !== !1), pr = (e, t) => {
|
|
737
|
+
if (!Cr()) {
|
|
738
738
|
if (t && (t.ctrlKey || t.metaKey)) {
|
|
739
739
|
let t = z.value.indexOf(e.id);
|
|
740
|
-
t >= 0 ? z.value.splice(t, 1) : z.value = H(z.value, [e.id],
|
|
740
|
+
t >= 0 ? z.value.splice(t, 1) : z.value = H(z.value, [e.id], cr.value);
|
|
741
741
|
} else {
|
|
742
742
|
let t = z.value.length === 1 && z.value[0] === e.id;
|
|
743
|
-
z.value = t ? [] : H([], [e.id],
|
|
743
|
+
z.value = t ? [] : H([], [e.id], cr.value), B.value = [];
|
|
744
744
|
}
|
|
745
|
-
y("node-click", e), y("node-select",
|
|
745
|
+
y("node-click", e), y("node-select", ar(e) ? e : null), V();
|
|
746
746
|
}
|
|
747
|
-
},
|
|
747
|
+
}, mr = (e) => {
|
|
748
748
|
let t = S.value.find((t) => t.id === e);
|
|
749
749
|
if (!t || v.config.enableZOrder === !1) return !1;
|
|
750
750
|
let n = t.zIndex ?? 0, r = S.value.filter((e) => (e.zIndex ?? 0) > n);
|
|
751
751
|
return r.length !== 0 && (t.zIndex = Math.min(...r.map((e) => e.zIndex ?? 0)), !0);
|
|
752
|
-
},
|
|
752
|
+
}, hr = (e) => {
|
|
753
753
|
let t = S.value.find((t) => t.id === e);
|
|
754
754
|
if (!t || v.config.enableZOrder === !1) return !1;
|
|
755
755
|
let n = t.zIndex ?? 0, r = S.value.filter((e) => (e.zIndex ?? 0) < n);
|
|
756
756
|
return r.length !== 0 && (t.zIndex = Math.max(...r.map((e) => e.zIndex ?? 0)), !0);
|
|
757
|
-
},
|
|
757
|
+
}, gr = (e) => {
|
|
758
758
|
let t = S.value.find((t) => t.id === e);
|
|
759
759
|
return !t || v.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.max(...S.value.map((e) => e.zIndex ?? 0), 0) + 1, !0);
|
|
760
|
-
},
|
|
760
|
+
}, _r = (e) => {
|
|
761
761
|
let t = S.value.find((t) => t.id === e);
|
|
762
762
|
return !t || v.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.min(...S.value.map((e) => e.zIndex ?? 0), 0) - 1, !0);
|
|
763
|
-
},
|
|
763
|
+
}, vr = () => {
|
|
764
764
|
if (!E.value) return;
|
|
765
765
|
let e = E.value.cloneNode(!0);
|
|
766
766
|
e.querySelectorAll("animate, animateMotion, animateTransform, set").forEach((e) => e.remove()), e.querySelectorAll(".center-crosshair").forEach((e) => e.remove()), e.setAttribute("width", U.value || "800"), e.setAttribute("height", W.value || "600");
|
|
@@ -768,78 +768,78 @@ var b = {
|
|
|
768
768
|
t = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + t;
|
|
769
769
|
let n = new Blob([t], { type: "image/svg+xml;charset=utf-8" }), r = URL.createObjectURL(n), i = document.createElement("a");
|
|
770
770
|
i.href = r, i.download = `topology-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.svg`, document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(r);
|
|
771
|
-
},
|
|
772
|
-
if (
|
|
773
|
-
let n =
|
|
774
|
-
let t =
|
|
771
|
+
}, yr = t(() => v.config.selectedLineColor || "#fbbf24"), br = (e, t) => {
|
|
772
|
+
if (Cr()) return;
|
|
773
|
+
let n = In.value[e.id], r = !!(n && n.merged && n.representative), i = r ? A.value.filter((e) => {
|
|
774
|
+
let t = In.value[e.id];
|
|
775
775
|
return t && t.key === n.key;
|
|
776
776
|
}) : null, a = r ? i.map((e) => e.id) : [e.id], o = r ? {
|
|
777
777
|
...e,
|
|
778
778
|
bundleEdges: i
|
|
779
779
|
} : e;
|
|
780
|
-
if (t && (t.ctrlKey || t.metaKey)) a.every((e) => B.value.includes(e)) ? B.value = B.value.filter((e) => !a.includes(e)) : B.value = H(B.value, a,
|
|
780
|
+
if (t && (t.ctrlKey || t.metaKey)) a.every((e) => B.value.includes(e)) ? B.value = B.value.filter((e) => !a.includes(e)) : B.value = H(B.value, a, lr.value);
|
|
781
781
|
else {
|
|
782
782
|
let e = a.length === B.value.length && a.every((e) => B.value.includes(e));
|
|
783
|
-
B.value = e ? [] : H([], a,
|
|
783
|
+
B.value = e ? [] : H([], a, lr.value), z.value = [];
|
|
784
784
|
}
|
|
785
|
-
y("edge-select",
|
|
786
|
-
},
|
|
787
|
-
|
|
788
|
-
},
|
|
785
|
+
y("edge-select", or(e) ? o : null), V();
|
|
786
|
+
}, xr = 0, Sr = (e = 200) => {
|
|
787
|
+
xr = performance.now() + e;
|
|
788
|
+
}, Cr = () => performance.now() < xr, wr = () => {
|
|
789
789
|
z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V();
|
|
790
|
-
},
|
|
791
|
-
if (
|
|
790
|
+
}, Tr = (e) => {
|
|
791
|
+
if (Cr()) return;
|
|
792
792
|
let t = e.target;
|
|
793
|
-
t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) ||
|
|
794
|
-
},
|
|
793
|
+
t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) || wr();
|
|
794
|
+
}, Er = f({
|
|
795
795
|
width: 1e3,
|
|
796
796
|
height: 650
|
|
797
|
-
}),
|
|
797
|
+
}), Dr = f(1), Or = f(0), kr = f(0), Ar = t(() => -Mr.value / 2 + Or.value), jr = t(() => -Nr.value / 2 + kr.value), Mr = t(() => v.width ?? Er.value.width), Nr = t(() => v.height ?? Er.value.height), Pr = null;
|
|
798
798
|
u(() => {
|
|
799
799
|
let e = E.value;
|
|
800
800
|
if (e) {
|
|
801
801
|
let t = e.getBoundingClientRect();
|
|
802
|
-
t.width > 0 && t.height > 0 && (
|
|
802
|
+
t.width > 0 && t.height > 0 && (Er.value = {
|
|
803
803
|
width: t.width,
|
|
804
804
|
height: t.height
|
|
805
805
|
});
|
|
806
806
|
}
|
|
807
|
-
e && typeof ResizeObserver < "u" && (
|
|
807
|
+
e && typeof ResizeObserver < "u" && (Pr = new ResizeObserver(() => {
|
|
808
808
|
let t = e.getBoundingClientRect();
|
|
809
|
-
t.width > 0 && t.height > 0 && (
|
|
809
|
+
t.width > 0 && t.height > 0 && (Er.value = {
|
|
810
810
|
width: t.width,
|
|
811
811
|
height: t.height
|
|
812
812
|
});
|
|
813
|
-
}),
|
|
813
|
+
}), Pr.observe(e));
|
|
814
814
|
}), l(() => {
|
|
815
|
-
|
|
815
|
+
Pr &&= (Pr.disconnect(), null), ki &&= (cancelAnimationFrame(ki), 0), Jr &&= (cancelAnimationFrame(Jr), 0), Z &&= (cancelAnimationFrame(Z), 0), $i(), ei();
|
|
816
816
|
});
|
|
817
|
-
let U = t(() =>
|
|
818
|
-
x0:
|
|
819
|
-
y0:
|
|
820
|
-
x1:
|
|
821
|
-
y1:
|
|
822
|
-
})),
|
|
823
|
-
let e =
|
|
817
|
+
let U = t(() => Mr.value / Dr.value), W = t(() => Nr.value / Dr.value), Fr = t(() => ({
|
|
818
|
+
x0: Ar.value - Gt,
|
|
819
|
+
y0: jr.value - Gt,
|
|
820
|
+
x1: Ar.value + U.value + Gt,
|
|
821
|
+
y1: jr.value + W.value + Gt
|
|
822
|
+
})), Ir = t(() => {
|
|
823
|
+
let e = Fr.value, t = S.value.filter((t) => {
|
|
824
824
|
let { w: n, h: r } = I(t);
|
|
825
825
|
return t.x + n / 2 >= e.x0 && t.x - n / 2 <= e.x1 && t.y + r / 2 >= e.y0 && t.y - r / 2 <= e.y1;
|
|
826
826
|
});
|
|
827
827
|
return v.config.enableZOrder !== !1 && t.sort((e, t) => (e.zIndex ?? 0) - (t.zIndex ?? 0)), t;
|
|
828
828
|
}), G = t(() => {
|
|
829
|
-
let e =
|
|
829
|
+
let e = Fr.value;
|
|
830
830
|
return A.value.filter((t) => {
|
|
831
|
-
if (!
|
|
831
|
+
if (!ha(t)) return !1;
|
|
832
832
|
let n = M(t.from), r = M(t.to);
|
|
833
833
|
if (!n || !r) return !1;
|
|
834
834
|
let i = I(n).w / 2, a = I(n).h / 2, o = I(r).w / 2, s = I(r).h / 2;
|
|
835
835
|
return Math.min(n.x - i, r.x - o) - Kt <= e.x1 && Math.max(n.x + i, r.x + o) + Kt >= e.x0 && Math.min(n.y - a, r.y - s) - Kt <= e.y1 && Math.max(n.y + a, r.y + s) + Kt >= e.y0;
|
|
836
836
|
});
|
|
837
|
-
}),
|
|
837
|
+
}), Lr = (e) => {
|
|
838
838
|
if (v.config.enableZoom === !1) return;
|
|
839
839
|
e.preventDefault();
|
|
840
|
-
let t = E.value.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, i = n / t.width, a = r / t.height, o = U.value, s = W.value, c = e.deltaY > 0 ? .9 : 1.1, l = Math.min(Wt, Math.max(Ut,
|
|
841
|
-
|
|
842
|
-
}, K = f(null), q = f(null),
|
|
840
|
+
let t = E.value.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, i = n / t.width, a = r / t.height, o = U.value, s = W.value, c = e.deltaY > 0 ? .9 : 1.1, l = Math.min(Wt, Math.max(Ut, Dr.value * c)), u = Mr.value / l, d = Nr.value / l;
|
|
841
|
+
Or.value += (o - u) * i, kr.value += (s - d) * a, Dr.value = l;
|
|
842
|
+
}, K = f(null), q = f(null), Rr = (e) => {
|
|
843
843
|
let t = E.value, n = t ? t.getBoundingClientRect() : null;
|
|
844
844
|
K.value = {
|
|
845
845
|
startX: e.clientX,
|
|
@@ -849,8 +849,8 @@ var b = {
|
|
|
849
849
|
moved: !1,
|
|
850
850
|
rectWidth: n && n.width ? n.width : 0,
|
|
851
851
|
rectHeight: n && n.height ? n.height : 0
|
|
852
|
-
},
|
|
853
|
-
},
|
|
852
|
+
}, $r();
|
|
853
|
+
}, zr = (e) => {
|
|
854
854
|
let t = K.value, n = E.value;
|
|
855
855
|
if (!t || !n) return;
|
|
856
856
|
let r = t.rectWidth, i = t.rectHeight;
|
|
@@ -861,11 +861,11 @@ var b = {
|
|
|
861
861
|
return;
|
|
862
862
|
}
|
|
863
863
|
let a = e.clientX - t.lastX, o = e.clientY - t.lastY;
|
|
864
|
-
t.lastX = e.clientX, t.lastY = e.clientY,
|
|
865
|
-
},
|
|
864
|
+
t.lastX = e.clientX, t.lastY = e.clientY, Or.value -= a * (U.value / r), kr.value -= o * (W.value / i);
|
|
865
|
+
}, Br = () => {
|
|
866
866
|
let e = K.value;
|
|
867
|
-
K.value = null, e && e.moved &&
|
|
868
|
-
},
|
|
867
|
+
K.value = null, e && e.moved && Sr(), ti();
|
|
868
|
+
}, Vr = (e) => {
|
|
869
869
|
let t = X(e);
|
|
870
870
|
q.value = {
|
|
871
871
|
start: {
|
|
@@ -879,8 +879,8 @@ var b = {
|
|
|
879
879
|
startClientX: e.clientX,
|
|
880
880
|
startClientY: e.clientY,
|
|
881
881
|
moved: !1
|
|
882
|
-
},
|
|
883
|
-
},
|
|
882
|
+
}, $r();
|
|
883
|
+
}, Hr = (e) => {
|
|
884
884
|
let t = q.value;
|
|
885
885
|
if (!t) return;
|
|
886
886
|
let n = X(e);
|
|
@@ -888,7 +888,7 @@ var b = {
|
|
|
888
888
|
x: n.x,
|
|
889
889
|
y: n.y
|
|
890
890
|
}, !t.moved && Math.hypot(e.clientX - t.startClientX, e.clientY - t.startClientY) > 3 && (t.moved = !0);
|
|
891
|
-
},
|
|
891
|
+
}, Ur = t(() => {
|
|
892
892
|
let e = q.value;
|
|
893
893
|
return e ? {
|
|
894
894
|
x: Math.min(e.start.x, e.current.x),
|
|
@@ -901,7 +901,7 @@ var b = {
|
|
|
901
901
|
width: 0,
|
|
902
902
|
height: 0
|
|
903
903
|
};
|
|
904
|
-
}),
|
|
904
|
+
}), Wr = () => {
|
|
905
905
|
let e = q.value;
|
|
906
906
|
if (q.value = null, e && e.moved) {
|
|
907
907
|
let t = {
|
|
@@ -913,50 +913,50 @@ var b = {
|
|
|
913
913
|
let n = L(e), r = e.x + n.x, i = e.y + n.y;
|
|
914
914
|
return !(r + n.width < t.x || r > t.x + t.w || i + n.height < t.y || i > t.y + t.h);
|
|
915
915
|
});
|
|
916
|
-
n.length && (z.value = H(z.value, n.map((e) => e.id),
|
|
916
|
+
n.length && (z.value = H(z.value, n.map((e) => e.id), cr.value), V()), Sr();
|
|
917
917
|
}
|
|
918
|
-
|
|
919
|
-
},
|
|
918
|
+
ti();
|
|
919
|
+
}, Gr = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), Kr = (e) => {
|
|
920
920
|
if (E.value) {
|
|
921
921
|
if (e.button === 1) {
|
|
922
922
|
if (v.config.enablePan === !1) return;
|
|
923
|
-
e.preventDefault(),
|
|
923
|
+
e.preventDefault(), Rr(e);
|
|
924
924
|
return;
|
|
925
925
|
}
|
|
926
|
-
if (e.button === 0 && !
|
|
926
|
+
if (e.button === 0 && !Gr(e.target)) {
|
|
927
927
|
if (e.ctrlKey || e.metaKey) {
|
|
928
928
|
if (v.config.enableMarquee === !1) return;
|
|
929
|
-
e.preventDefault(),
|
|
929
|
+
e.preventDefault(), Vr(e);
|
|
930
930
|
return;
|
|
931
931
|
}
|
|
932
|
-
v.config.enablePan !== !1 && (e.preventDefault(),
|
|
932
|
+
v.config.enablePan !== !1 && (e.preventDefault(), Rr(e));
|
|
933
933
|
}
|
|
934
934
|
}
|
|
935
|
-
},
|
|
936
|
-
|
|
937
|
-
let e =
|
|
938
|
-
|
|
939
|
-
},
|
|
940
|
-
|
|
941
|
-
}, Zr = () => {
|
|
942
|
-
qr && (cancelAnimationFrame(qr), Yr()), K.value && zr(), q.value && Ur();
|
|
935
|
+
}, qr = !1, Jr = 0, Yr = null, Xr = () => {
|
|
936
|
+
Jr = 0;
|
|
937
|
+
let e = Yr;
|
|
938
|
+
Yr = null, e && (K.value ? zr(e) : q.value && Hr(e));
|
|
939
|
+
}, Zr = (e) => {
|
|
940
|
+
Yr = e, Jr ||= requestAnimationFrame(Xr);
|
|
943
941
|
}, Qr = () => {
|
|
944
|
-
|
|
942
|
+
Jr && (cancelAnimationFrame(Jr), Xr()), K.value && Br(), q.value && Wr();
|
|
945
943
|
}, $r = () => {
|
|
946
|
-
|
|
944
|
+
qr || (qr = !0, window.addEventListener("mousemove", Zr, !0), window.addEventListener("mouseup", Qr, !0));
|
|
947
945
|
}, ei = () => {
|
|
948
|
-
!
|
|
949
|
-
}, ti =
|
|
950
|
-
|
|
946
|
+
qr && (qr = !1, window.removeEventListener("mousemove", Zr, !0), window.removeEventListener("mouseup", Qr, !0));
|
|
947
|
+
}, ti = () => {
|
|
948
|
+
!K.value && !q.value && ei();
|
|
949
|
+
}, ni = t(() => {
|
|
950
|
+
if (J.value && J.value.side) return { cursor: Li(J.value.side) };
|
|
951
951
|
if (q.value) return { cursor: "crosshair" };
|
|
952
952
|
if (K.value && K.value.moved) return { cursor: "grabbing" };
|
|
953
|
-
}),
|
|
953
|
+
}), ri = t(() => v.config.showGrid !== !1), ii = t(() => v.config.gridColor || "#1a2240"), ai = t(() => {
|
|
954
954
|
let e = Number(v.config.gridStep);
|
|
955
|
-
return (Number.isFinite(e) && e > 0 ? e : 40) /
|
|
956
|
-
}),
|
|
955
|
+
return (Number.isFinite(e) && e > 0 ? e : 40) / Dr.value;
|
|
956
|
+
}), oi = t(() => {
|
|
957
957
|
let e = Number(v.config.gridOpacity);
|
|
958
958
|
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .5;
|
|
959
|
-
}),
|
|
959
|
+
}), si = t(() => {
|
|
960
960
|
let e = v.config.radialGradient && typeof v.config.radialGradient == "object" ? v.config.radialGradient : {}, t = Array.isArray(e.stops) && e.stops.length ? e.stops.filter((e) => e && e.color).map((e, t) => ({
|
|
961
961
|
offset: e.offset == null ? t === 0 ? "0%" : "100%" : e.offset,
|
|
962
962
|
color: e.color,
|
|
@@ -976,55 +976,55 @@ var b = {
|
|
|
976
976
|
r: e.r || "60%",
|
|
977
977
|
stops: n
|
|
978
978
|
};
|
|
979
|
-
}),
|
|
979
|
+
}), ci = t(() => v.config.showCenterPoint === !0), li = t(() => v.config.showEdgeTextBg === !0), ui = t(() => v.config.edgeTextBgColor || "#0a0e1a"), di = t(() => {
|
|
980
980
|
let e = Number(v.config.edgeTextBgOpacity);
|
|
981
981
|
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .92;
|
|
982
|
-
}),
|
|
982
|
+
}), fi = t(() => v.config.edgeColor || v.config.defaultEdgeColor || null), pi = t(() => v.config.edgeBaseColor || null), mi = (e) => e.baseColor ? e.baseColor : pi.value ? pi.value : e.color || fi.value ? Q(e) : "#1a2744", hi = (e) => {
|
|
983
983
|
let t = e.baseDimOpacity ?? v.config.edgeBaseDimOpacity;
|
|
984
984
|
if (t != null) {
|
|
985
985
|
let e = Number(t);
|
|
986
986
|
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : 1;
|
|
987
987
|
}
|
|
988
|
-
return
|
|
989
|
-
},
|
|
988
|
+
return bi.value === "none" || Ci(e) === "none" ? 1 : .45;
|
|
989
|
+
}, gi = t(() => v.config.edgeCenterTextColor || null), _i = t(() => v.config.showNodeHandles === !0), vi = t(() => v.config.showStatusDot !== !1), yi = (e, t) => {
|
|
990
990
|
let n = Number(e);
|
|
991
991
|
return Number.isFinite(n) && n >= 0 ? n : t;
|
|
992
|
-
},
|
|
992
|
+
}, bi = t(() => {
|
|
993
993
|
let e = v.config.motionFx ?? v.config.fx;
|
|
994
994
|
return typeof e == "boolean" ? e ? "all" : "none" : [
|
|
995
995
|
"none",
|
|
996
996
|
"flow",
|
|
997
997
|
"particle",
|
|
998
998
|
"all"
|
|
999
|
-
].includes(e) ? e : A.value.length <=
|
|
1000
|
-
}), bi = t(() => {
|
|
1001
|
-
let e = v.config.glowFx ?? v.config.fx;
|
|
1002
|
-
return typeof e == "boolean" ? e : A.value.length <= vi(v.config.fxGlowMaxEdges, 500);
|
|
999
|
+
].includes(e) ? e : A.value.length <= yi(v.config.fxMotionMaxEdges, 200) ? "all" : "none";
|
|
1003
1000
|
}), xi = t(() => {
|
|
1001
|
+
let e = v.config.glowFx ?? v.config.fx;
|
|
1002
|
+
return typeof e == "boolean" ? e : A.value.length <= yi(v.config.fxGlowMaxEdges, 500);
|
|
1003
|
+
}), Si = t(() => {
|
|
1004
1004
|
let e = v.config.breatheFx ?? v.config.fx;
|
|
1005
|
-
return typeof e == "boolean" ? e : S.value.length <=
|
|
1006
|
-
}),
|
|
1005
|
+
return typeof e == "boolean" ? e : S.value.length <= yi(v.config.fxBreatheMaxNodes, 300);
|
|
1006
|
+
}), Ci = (e) => {
|
|
1007
1007
|
if (e.animatedMode !== void 0) {
|
|
1008
1008
|
let t = e.animatedMode;
|
|
1009
|
-
return !t || t === "all" ?
|
|
1009
|
+
return !t || t === "all" ? bi.value : t === "none" ? "none" : t;
|
|
1010
1010
|
}
|
|
1011
|
-
return e.animated === void 0 || e.animated ?
|
|
1012
|
-
},
|
|
1011
|
+
return e.animated === void 0 || e.animated ? bi.value : "none";
|
|
1012
|
+
}, wi = (e) => e.borderColor || N(e) || "#94a3b8", Ti = (e) => e.borderWidth || 0, Ei = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, Di = (e) => {
|
|
1013
1013
|
let t = e.borderRadius;
|
|
1014
1014
|
if (t == null || t === "") return 6;
|
|
1015
1015
|
let n = Number(t);
|
|
1016
1016
|
return Number.isFinite(n) && n >= 0 ? n : 6;
|
|
1017
|
-
},
|
|
1017
|
+
}, Oi = (e, t) => {
|
|
1018
1018
|
if (e.button !== 0 || !v.editable || v.config.nodeDraggable === !1) return;
|
|
1019
1019
|
e.stopPropagation();
|
|
1020
1020
|
let n = M(t), r = X(e);
|
|
1021
|
-
if (
|
|
1021
|
+
if (ln.value = {
|
|
1022
1022
|
x: r.x - n.x,
|
|
1023
1023
|
y: r.y - n.y
|
|
1024
|
-
},
|
|
1024
|
+
}, dn = {
|
|
1025
1025
|
x: e.clientX,
|
|
1026
1026
|
y: e.clientY
|
|
1027
|
-
},
|
|
1027
|
+
}, fn = !1, pn = !!(e.ctrlKey || e.metaKey), z.value.length > 1 && z.value.includes(t)) {
|
|
1028
1028
|
let e = {};
|
|
1029
1029
|
z.value.forEach((t) => {
|
|
1030
1030
|
let n = M(t);
|
|
@@ -1032,33 +1032,33 @@ var b = {
|
|
|
1032
1032
|
x: n.x,
|
|
1033
1033
|
y: n.y
|
|
1034
1034
|
});
|
|
1035
|
-
}),
|
|
1035
|
+
}), un.value = {
|
|
1036
1036
|
origins: e,
|
|
1037
1037
|
start: {
|
|
1038
1038
|
x: r.x,
|
|
1039
1039
|
y: r.y
|
|
1040
1040
|
}
|
|
1041
1041
|
};
|
|
1042
|
-
} else
|
|
1042
|
+
} else un.value = null;
|
|
1043
1043
|
T.value = t, y("node-drag-start", n);
|
|
1044
|
-
},
|
|
1045
|
-
|
|
1046
|
-
let e =
|
|
1047
|
-
|
|
1048
|
-
},
|
|
1049
|
-
(J.value || T.value) && (
|
|
1044
|
+
}, ki = 0, Ai = null, ji = () => {
|
|
1045
|
+
ki = 0;
|
|
1046
|
+
let e = Ai;
|
|
1047
|
+
Ai = null, e && Ni(e);
|
|
1048
|
+
}, Mi = (e) => {
|
|
1049
|
+
(J.value || T.value) && (Ai = {
|
|
1050
1050
|
clientX: e.clientX,
|
|
1051
1051
|
clientY: e.clientY
|
|
1052
|
-
},
|
|
1053
|
-
},
|
|
1052
|
+
}, ki ||= requestAnimationFrame(ji));
|
|
1053
|
+
}, Ni = (e) => {
|
|
1054
1054
|
if (J.value) {
|
|
1055
|
-
|
|
1055
|
+
zi(e);
|
|
1056
1056
|
return;
|
|
1057
1057
|
}
|
|
1058
1058
|
if (!T.value) return;
|
|
1059
1059
|
let t = X(e);
|
|
1060
|
-
!
|
|
1061
|
-
let n =
|
|
1060
|
+
!fn && dn && Math.hypot(e.clientX - dn.x, e.clientY - dn.y) > Ht && (fn = !0, !pn && !z.value.includes(T.value) && (z.value = H([], [T.value], cr.value), B.value = [], y("node-select", z.value.includes(T.value) ? M(T.value) : null), V()));
|
|
1061
|
+
let n = un.value;
|
|
1062
1062
|
if (n) {
|
|
1063
1063
|
let e = t.x - n.start.x, r = t.y - n.start.y;
|
|
1064
1064
|
S.value = S.value.map((t) => n.origins[t.id] ? {
|
|
@@ -1068,17 +1068,17 @@ var b = {
|
|
|
1068
1068
|
} : t);
|
|
1069
1069
|
} else S.value = S.value.map((e) => e.id === T.value ? {
|
|
1070
1070
|
...e,
|
|
1071
|
-
x: t.x -
|
|
1072
|
-
y: t.y -
|
|
1071
|
+
x: t.x - ln.value.x,
|
|
1072
|
+
y: t.y - ln.value.y
|
|
1073
1073
|
} : e);
|
|
1074
1074
|
C();
|
|
1075
|
-
},
|
|
1076
|
-
if (
|
|
1077
|
-
|
|
1075
|
+
}, Pi = () => {
|
|
1076
|
+
if (ki && (cancelAnimationFrame(ki), ji()), J.value) {
|
|
1077
|
+
Bi();
|
|
1078
1078
|
return;
|
|
1079
1079
|
}
|
|
1080
|
-
T.value && (
|
|
1081
|
-
}, J = f(null),
|
|
1080
|
+
T.value && (fn && Sr(), T.value = null, un.value = null, dn = null, fn = !1, y("node-drag-end"));
|
|
1081
|
+
}, J = f(null), Fi = (e, t, n) => Math.min(n, Math.max(t, e)), Ii = (e) => {
|
|
1082
1082
|
let t = L(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
|
|
1083
1083
|
return [
|
|
1084
1084
|
{
|
|
@@ -1122,7 +1122,7 @@ var b = {
|
|
|
1122
1122
|
y: 0
|
|
1123
1123
|
}
|
|
1124
1124
|
];
|
|
1125
|
-
},
|
|
1125
|
+
}, Li = (e) => e === "nw" || e === "se" ? "nwse-resize" : e === "ne" || e === "sw" ? "nesw-resize" : e === "n" || e === "s" ? "ns-resize" : "ew-resize", Ri = (e, t, n) => {
|
|
1126
1126
|
if (!v.editable || v.config.nodeResizable === !1 || !t) return;
|
|
1127
1127
|
let { w: r, h: i } = I(t);
|
|
1128
1128
|
J.value = {
|
|
@@ -1133,7 +1133,7 @@ var b = {
|
|
|
1133
1133
|
startW: r,
|
|
1134
1134
|
startH: i
|
|
1135
1135
|
}, y("node-resize-start", t);
|
|
1136
|
-
},
|
|
1136
|
+
}, zi = (e) => {
|
|
1137
1137
|
let t = J.value;
|
|
1138
1138
|
if (!t) return;
|
|
1139
1139
|
let n = M(t.id);
|
|
@@ -1141,11 +1141,11 @@ var b = {
|
|
|
1141
1141
|
let r = X(e), i = t.startW, a = t.startH, o = n.x, s = n.y;
|
|
1142
1142
|
if (t.anchorX !== null) {
|
|
1143
1143
|
let e = t.side.includes("e");
|
|
1144
|
-
i =
|
|
1144
|
+
i = Fi(e ? r.x - t.anchorX : t.anchorX - r.x, qt, Jt), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
|
|
1145
1145
|
}
|
|
1146
1146
|
if (t.anchorY !== null) {
|
|
1147
1147
|
let e = t.side.includes("s");
|
|
1148
|
-
a =
|
|
1148
|
+
a = Fi(e ? r.y - t.anchorY : t.anchorY - r.y, Yt, Xt), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
|
|
1149
1149
|
}
|
|
1150
1150
|
S.value = S.value.map((e) => e.id === t.id ? {
|
|
1151
1151
|
...e,
|
|
@@ -1154,14 +1154,14 @@ var b = {
|
|
|
1154
1154
|
width: i,
|
|
1155
1155
|
height: a
|
|
1156
1156
|
} : e), C();
|
|
1157
|
-
},
|
|
1157
|
+
}, Bi = () => {
|
|
1158
1158
|
let e = J.value;
|
|
1159
|
-
J.value = null, e && (
|
|
1160
|
-
},
|
|
1161
|
-
if (!
|
|
1159
|
+
J.value = null, e && (Sr(), y("node-resize-end", M(e.id) || null));
|
|
1160
|
+
}, Vi = t(() => v.editable && v.config.nodeResizable !== !1), Hi = t(() => {
|
|
1161
|
+
if (!Vi.value) return null;
|
|
1162
1162
|
let e = z.value;
|
|
1163
1163
|
return e.length === 1 && M(e[0]) || null;
|
|
1164
|
-
}), Y = f(null),
|
|
1164
|
+
}), Y = f(null), Ui = (e) => {
|
|
1165
1165
|
let t = L(e);
|
|
1166
1166
|
return [
|
|
1167
1167
|
{
|
|
@@ -1185,7 +1185,7 @@ var b = {
|
|
|
1185
1185
|
y: 0
|
|
1186
1186
|
}
|
|
1187
1187
|
];
|
|
1188
|
-
},
|
|
1188
|
+
}, Wi = (e, t) => {
|
|
1189
1189
|
let n = E.value;
|
|
1190
1190
|
if (!n) return null;
|
|
1191
1191
|
let r = e, i = t;
|
|
@@ -1199,7 +1199,7 @@ var b = {
|
|
|
1199
1199
|
x: s.x,
|
|
1200
1200
|
y: s.y
|
|
1201
1201
|
};
|
|
1202
|
-
},
|
|
1202
|
+
}, Gi = (e, t) => {
|
|
1203
1203
|
let n = E.value;
|
|
1204
1204
|
if (!n) return null;
|
|
1205
1205
|
let r = n.createSVGPoint();
|
|
@@ -1211,10 +1211,10 @@ var b = {
|
|
|
1211
1211
|
x: a.x,
|
|
1212
1212
|
y: a.y
|
|
1213
1213
|
};
|
|
1214
|
-
}, X = (e) =>
|
|
1214
|
+
}, X = (e) => Wi(e) ?? {
|
|
1215
1215
|
x: 0,
|
|
1216
1216
|
y: 0
|
|
1217
|
-
},
|
|
1217
|
+
}, Ki = (e, t, n) => {
|
|
1218
1218
|
let r = M(t);
|
|
1219
1219
|
if (!r || !E.value) return;
|
|
1220
1220
|
let i = X(e);
|
|
@@ -1230,23 +1230,23 @@ var b = {
|
|
|
1230
1230
|
try {
|
|
1231
1231
|
e.target.setPointerCapture?.(e.pointerId);
|
|
1232
1232
|
} catch {}
|
|
1233
|
-
|
|
1234
|
-
}, Z = 0,
|
|
1233
|
+
Qi();
|
|
1234
|
+
}, Z = 0, qi = null, Ji = () => {
|
|
1235
1235
|
Z = 0;
|
|
1236
|
-
let e =
|
|
1237
|
-
|
|
1238
|
-
},
|
|
1239
|
-
Y.value && (
|
|
1236
|
+
let e = qi;
|
|
1237
|
+
qi = null, e && Y.value && ta(e);
|
|
1238
|
+
}, Yi = (e) => {
|
|
1239
|
+
Y.value && (qi = {
|
|
1240
1240
|
clientX: e.clientX,
|
|
1241
1241
|
clientY: e.clientY
|
|
1242
|
-
}, Z ||= requestAnimationFrame(
|
|
1243
|
-
},
|
|
1244
|
-
Z && (cancelAnimationFrame(Z),
|
|
1245
|
-
},
|
|
1246
|
-
|
|
1247
|
-
},
|
|
1248
|
-
|
|
1249
|
-
},
|
|
1242
|
+
}, Z ||= requestAnimationFrame(Ji));
|
|
1243
|
+
}, Xi = () => {
|
|
1244
|
+
Z && (cancelAnimationFrame(Z), Ji()), Y.value && na();
|
|
1245
|
+
}, Zi = !1, Qi = () => {
|
|
1246
|
+
Zi || (Zi = !0, window.addEventListener("mousemove", Yi, !0), window.addEventListener("mouseup", Xi, !0));
|
|
1247
|
+
}, $i = () => {
|
|
1248
|
+
Zi && (Zi = !1, window.removeEventListener("mousemove", Yi, !0), window.removeEventListener("mouseup", Xi, !0));
|
|
1249
|
+
}, ea = (e, t, n) => {
|
|
1250
1250
|
let r = S.value;
|
|
1251
1251
|
for (let i = r.length - 1; i >= 0; i--) {
|
|
1252
1252
|
let a = r[i];
|
|
@@ -1255,15 +1255,15 @@ var b = {
|
|
|
1255
1255
|
if (e >= a.x + o.x - 2 && e <= a.x + o.x + o.width + 2 && t >= a.y + o.y - 2 && t <= a.y + o.y + o.height + 2) return a;
|
|
1256
1256
|
}
|
|
1257
1257
|
return null;
|
|
1258
|
-
},
|
|
1258
|
+
}, ta = (e) => {
|
|
1259
1259
|
let t = Y.value;
|
|
1260
1260
|
if (!t) return;
|
|
1261
1261
|
let n = X(e);
|
|
1262
1262
|
t.px = n.x, t.py = n.y;
|
|
1263
|
-
let r =
|
|
1263
|
+
let r = ea(n.x, n.y, t.fromId);
|
|
1264
1264
|
t.overId = r ? r.id : null;
|
|
1265
|
-
},
|
|
1266
|
-
|
|
1265
|
+
}, na = () => {
|
|
1266
|
+
$i();
|
|
1267
1267
|
let e = Y.value;
|
|
1268
1268
|
if (Y.value = null, !e || !e.overId || e.overId === e.fromId) return;
|
|
1269
1269
|
let t = {
|
|
@@ -1275,7 +1275,7 @@ var b = {
|
|
|
1275
1275
|
toAnchor: "edge"
|
|
1276
1276
|
};
|
|
1277
1277
|
D.value.push(t), y("edge-create", t);
|
|
1278
|
-
},
|
|
1278
|
+
}, ra = (e, t, n) => {
|
|
1279
1279
|
let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = I(e);
|
|
1280
1280
|
if (!n || n === "center" || a === 0 && o === 0) return {
|
|
1281
1281
|
x: r,
|
|
@@ -1286,10 +1286,10 @@ var b = {
|
|
|
1286
1286
|
x: r + a * p,
|
|
1287
1287
|
y: i + o * p
|
|
1288
1288
|
};
|
|
1289
|
-
},
|
|
1289
|
+
}, ia = t(() => {
|
|
1290
1290
|
let e = /* @__PURE__ */ new Map();
|
|
1291
1291
|
A.value.forEach((t) => {
|
|
1292
|
-
let n =
|
|
1292
|
+
let n = In.value[t.id];
|
|
1293
1293
|
n && !n.hidden && (e.has(n.key) || e.set(n.key, []), e.get(n.key).push(t));
|
|
1294
1294
|
});
|
|
1295
1295
|
let t = {};
|
|
@@ -1318,12 +1318,12 @@ var b = {
|
|
|
1318
1318
|
bulge: Math.min(l * .15, 50)
|
|
1319
1319
|
};
|
|
1320
1320
|
}), t;
|
|
1321
|
-
}),
|
|
1322
|
-
let t =
|
|
1321
|
+
}), aa = (e) => {
|
|
1322
|
+
let t = In.value[e.id], n = t && ia.value[t.key];
|
|
1323
1323
|
if (!n) return null;
|
|
1324
1324
|
let r = M(e.from), i = M(e.to);
|
|
1325
1325
|
if (!r || !i) return null;
|
|
1326
|
-
let a = n.slots[e.id] || 0, o = a * n.gap, s =
|
|
1326
|
+
let a = n.slots[e.id] || 0, o = a * n.gap, s = ra(r, i, e.fromAnchor), c = ra(i, r, e.toAnchor);
|
|
1327
1327
|
return {
|
|
1328
1328
|
frame: n,
|
|
1329
1329
|
slot: a,
|
|
@@ -1336,8 +1336,8 @@ var b = {
|
|
|
1336
1336
|
y: c.y + n.ny * o
|
|
1337
1337
|
}
|
|
1338
1338
|
};
|
|
1339
|
-
},
|
|
1340
|
-
let t =
|
|
1339
|
+
}, oa = (e) => {
|
|
1340
|
+
let t = aa(e);
|
|
1341
1341
|
if (!t) return "";
|
|
1342
1342
|
let { from: n, to: r, frame: i, slot: a } = t, o = a * i.gap;
|
|
1343
1343
|
if (w.value === "straight") return `M ${n.x} ${n.y} L ${r.x} ${r.y}`;
|
|
@@ -1351,8 +1351,8 @@ var b = {
|
|
|
1351
1351
|
}
|
|
1352
1352
|
let s = (n.x + r.x) / 2 + i.nx * i.bulge, c = (n.y + r.y) / 2 + i.ny * i.bulge;
|
|
1353
1353
|
return `M ${n.x} ${n.y} Q ${s} ${c} ${r.x} ${r.y}`;
|
|
1354
|
-
},
|
|
1355
|
-
let n =
|
|
1354
|
+
}, sa = (e, t) => {
|
|
1355
|
+
let n = aa(e);
|
|
1356
1356
|
if (!n) return {
|
|
1357
1357
|
x: 0,
|
|
1358
1358
|
y: 0
|
|
@@ -1393,19 +1393,19 @@ var b = {
|
|
|
1393
1393
|
x: (1 - t) * (1 - t) * r.x + 2 * (1 - t) * t * c + t * t * i.x,
|
|
1394
1394
|
y: (1 - t) * (1 - t) * r.y + 2 * (1 - t) * t * l + t * t * i.y
|
|
1395
1395
|
};
|
|
1396
|
-
},
|
|
1396
|
+
}, ca = t(() => Y.value ? M(Y.value.fromId) : null), la = t(() => Y.value && Y.value.overId ? M(Y.value.overId) : null), ua = t(() => ca.value ? N(ca.value) : "#00f0ff"), da = t(() => {
|
|
1397
1397
|
let e = Y.value;
|
|
1398
1398
|
if (!e) return {
|
|
1399
1399
|
x: 0,
|
|
1400
1400
|
y: 0
|
|
1401
1401
|
};
|
|
1402
|
-
let t =
|
|
1403
|
-
return t &&
|
|
1402
|
+
let t = la.value;
|
|
1403
|
+
return t && ca.value ? ra(t, ca.value, "edge") : {
|
|
1404
1404
|
x: e.px,
|
|
1405
1405
|
y: e.py
|
|
1406
1406
|
};
|
|
1407
|
-
}),
|
|
1408
|
-
let e =
|
|
1407
|
+
}), fa = t(() => {
|
|
1408
|
+
let e = la.value;
|
|
1409
1409
|
if (!e) return null;
|
|
1410
1410
|
let t = L(e);
|
|
1411
1411
|
return {
|
|
@@ -1414,7 +1414,7 @@ var b = {
|
|
|
1414
1414
|
w: t.width + 8,
|
|
1415
1415
|
h: t.height + 8
|
|
1416
1416
|
};
|
|
1417
|
-
}),
|
|
1417
|
+
}), pa = (e) => {
|
|
1418
1418
|
let t = e.nodeIds.map((e) => M(e)).filter(Boolean);
|
|
1419
1419
|
if (t.length === 0) return null;
|
|
1420
1420
|
let n = e.padding, r = Math.min(...t.map((e) => e.x)) - n, i = Math.min(...t.map((e) => e.y)) - n, a = Math.max(...t.map((e) => e.x)) + n, o = Math.max(...t.map((e) => e.y)) + n;
|
|
@@ -1424,62 +1424,62 @@ var b = {
|
|
|
1424
1424
|
width: a - r,
|
|
1425
1425
|
height: o - i
|
|
1426
1426
|
};
|
|
1427
|
-
},
|
|
1427
|
+
}, ma = t(() => v.groups.map((e) => ({
|
|
1428
1428
|
...e,
|
|
1429
|
-
rect:
|
|
1430
|
-
})).filter((e) => e.rect)), Q = (e) =>
|
|
1431
|
-
let t =
|
|
1429
|
+
rect: pa(e)
|
|
1430
|
+
})).filter((e) => e.rect)), Q = (e) => or(e) ? yr.value : e.color ? e.color : fi.value ? fi.value : e.centerText && e.centerText.color || "#00f0ff", ha = (e) => {
|
|
1431
|
+
let t = In.value[e.id];
|
|
1432
1432
|
return !!t && !t.hidden;
|
|
1433
|
-
},
|
|
1433
|
+
}, ga = t(() => [...new Set(A.value.map(Q))].map((e) => ({
|
|
1434
1434
|
key: String(e).replace("#", ""),
|
|
1435
1435
|
color: e
|
|
1436
|
-
}))),
|
|
1436
|
+
}))), _a = (e) => {
|
|
1437
1437
|
let t = e.endMarker;
|
|
1438
1438
|
if (!t || t === "none") return "";
|
|
1439
1439
|
let n = Q(e) || "#00f0ff", r = String(n).replace("#", "");
|
|
1440
1440
|
return `url(#${t === "dot" ? "edge-dot" : "edge-arrow"}-${r})`;
|
|
1441
|
-
},
|
|
1441
|
+
}, va = /* @__PURE__ */ new Map(), ya = {
|
|
1442
1442
|
nodes: null,
|
|
1443
1443
|
edges: null,
|
|
1444
1444
|
mode: null,
|
|
1445
1445
|
epoch: -1
|
|
1446
|
-
},
|
|
1447
|
-
let e =
|
|
1448
|
-
(e.nodes !== S.value || e.edges !== A.value || e.mode !== w.value || e.epoch !==
|
|
1446
|
+
}, ba = () => {
|
|
1447
|
+
let e = ya;
|
|
1448
|
+
(e.nodes !== S.value || e.edges !== A.value || e.mode !== w.value || e.epoch !== Qt) && (ya = {
|
|
1449
1449
|
nodes: S.value,
|
|
1450
1450
|
edges: A.value,
|
|
1451
1451
|
mode: w.value,
|
|
1452
|
-
epoch:
|
|
1453
|
-
},
|
|
1452
|
+
epoch: Qt
|
|
1453
|
+
}, va = /* @__PURE__ */ new Map());
|
|
1454
1454
|
}, $ = (e) => {
|
|
1455
|
-
|
|
1456
|
-
let t =
|
|
1457
|
-
return t === void 0 && (t =
|
|
1458
|
-
},
|
|
1455
|
+
ba();
|
|
1456
|
+
let t = va.get(e.id);
|
|
1457
|
+
return t === void 0 && (t = oa(e), va.set(e.id, t)), t;
|
|
1458
|
+
}, xa = (e, t = 1) => `${2 / e.speed * t}s`, Sa = (e) => `${3 / e.speed}s`, Ca = t(() => v.config.edgeDashFlow === !0), wa = t(() => {
|
|
1459
1459
|
let e = v.config.edgeDashPattern, t = null;
|
|
1460
1460
|
return typeof e == "string" && e.trim() ? t = e.trim().split(/\s+/).map(Number).filter((e) => Number.isFinite(e) && e > 0) : Array.isArray(e) && (t = e.map(Number).filter((e) => Number.isFinite(e) && e > 0)), t && t.length ? t : [10, 8];
|
|
1461
|
-
}),
|
|
1461
|
+
}), Ta = t(() => wa.value.join(" ")), Ea = t(() => wa.value.reduce((e, t) => e + t, 0)), Da = (e) => {
|
|
1462
1462
|
let t = Number(e.dashFlowWidth ?? v.config.edgeDashFlowWidth);
|
|
1463
1463
|
return Number.isFinite(t) && t > 0 ? t : 2;
|
|
1464
|
-
},
|
|
1464
|
+
}, Oa = (e) => {
|
|
1465
1465
|
let t = Number(e.speed);
|
|
1466
1466
|
return `${1.2 / (Number.isFinite(t) && t > 0 ? t : 1)}s`;
|
|
1467
|
-
},
|
|
1468
|
-
let t =
|
|
1467
|
+
}, ka = (e) => e.animated === !1 ? !1 : e.dashFlow === !0 || e.dashFlow !== !1 && Ca.value, Aa = (e) => {
|
|
1468
|
+
let t = Ci(e);
|
|
1469
1469
|
return t === "flow" || t === "all";
|
|
1470
|
-
},
|
|
1471
|
-
let t =
|
|
1470
|
+
}, ja = (e) => {
|
|
1471
|
+
let t = Ci(e);
|
|
1472
1472
|
return t === "particle" || t === "all";
|
|
1473
|
-
},
|
|
1473
|
+
}, Ma = (e) => en(e).text, Na = (e) => !!e && String(en(e).text ?? "").trim() !== "", Pa = (e, t) => {
|
|
1474
1474
|
if (!e) return null;
|
|
1475
|
-
let n =
|
|
1475
|
+
let n = en(e), r = Number(t.fontSize) || Number(n.fontSize) || 8, i = String(n.text ?? ""), a = 0;
|
|
1476
1476
|
for (let e of i) a += e.charCodeAt(0) > 11904 ? 1 : .62;
|
|
1477
1477
|
return {
|
|
1478
1478
|
w: Math.max(14, a * r + 8),
|
|
1479
1479
|
h: Math.max(12, r + 6)
|
|
1480
1480
|
};
|
|
1481
|
-
},
|
|
1482
|
-
let n = t && typeof t == "object" ? t : {}, r = n.showBg === void 0 ?
|
|
1481
|
+
}, Fa = (e, t) => {
|
|
1482
|
+
let n = t && typeof t == "object" ? t : {}, r = n.showBg === void 0 ? li.value : !!n.showBg, i = n.bgColor || ui.value, a = di.value;
|
|
1483
1483
|
if (n.bgOpacity !== void 0 && n.bgOpacity !== null) {
|
|
1484
1484
|
let e = Number(n.bgOpacity);
|
|
1485
1485
|
Number.isFinite(e) && (a = Math.min(1, Math.max(0, e)));
|
|
@@ -1488,7 +1488,7 @@ var b = {
|
|
|
1488
1488
|
"solid",
|
|
1489
1489
|
"dashed",
|
|
1490
1490
|
"none"
|
|
1491
|
-
].includes(n.borderStyle) ? n.borderStyle : "solid", s = n.borderColor ||
|
|
1491
|
+
].includes(n.borderStyle) ? n.borderStyle : "solid", s = n.borderColor || on(e, t), c = n.borderColor ? 1 : .35;
|
|
1492
1492
|
return {
|
|
1493
1493
|
show: r,
|
|
1494
1494
|
fill: i,
|
|
@@ -1497,78 +1497,84 @@ var b = {
|
|
|
1497
1497
|
borderColor: s,
|
|
1498
1498
|
borderOpacity: c
|
|
1499
1499
|
};
|
|
1500
|
-
},
|
|
1501
|
-
let n =
|
|
1500
|
+
}, Ia = (e, t) => {
|
|
1501
|
+
let n = sa(e, Math.max(0, t - .005)), r = sa(e, Math.min(1, t + .005));
|
|
1502
1502
|
return Math.atan2(r.y - n.y, r.x - n.x) * 180 / Math.PI;
|
|
1503
|
-
},
|
|
1503
|
+
}, La = (e) => {
|
|
1504
1504
|
let t = e % 180;
|
|
1505
1505
|
return t > 90 && (t -= 180), t < -90 && (t += 180), t;
|
|
1506
|
-
},
|
|
1506
|
+
}, Ra = (e, t, n) => `translate(${t.x}, ${t.y}) rotate(${(en(e).rotation || 0) + (n || 0)})`, za = t(() => v.config?.edgeCenterTextFollowLine !== !1), Ba = (e, t) => za.value ? Math.abs(e) <= Zt || v.config?.edgeCenterTextFollowLine ? e : t > 0 ? Math.abs(e) : -Math.abs(e) : 0, Va = () => ({
|
|
1507
|
+
fromT: .28,
|
|
1508
|
+
toT: .72
|
|
1509
|
+
}), Ha = t(() => {
|
|
1507
1510
|
let e = [];
|
|
1508
1511
|
for (let t of G.value) {
|
|
1509
|
-
let n =
|
|
1512
|
+
let n = In.value[t.id];
|
|
1510
1513
|
if (!n) continue;
|
|
1511
1514
|
let r = n.merged && n.representative, i = !n.merged && (t.fromText || t.centerText || t.toText);
|
|
1512
1515
|
if (!r && !i) continue;
|
|
1513
1516
|
let a = M(t.from), o = M(t.to);
|
|
1514
|
-
a
|
|
1517
|
+
if (!a || !o) continue;
|
|
1518
|
+
let { fromT: s, toT: c } = Va();
|
|
1519
|
+
e.push({
|
|
1515
1520
|
id: t.id,
|
|
1516
1521
|
edge: t,
|
|
1517
1522
|
info: n,
|
|
1518
1523
|
color: a && oe[a.nodeType] || "#00f0ff",
|
|
1519
|
-
start:
|
|
1520
|
-
center:
|
|
1521
|
-
end:
|
|
1522
|
-
startAngle: Ia(
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1524
|
+
start: sa(t, s),
|
|
1525
|
+
center: sa(t, .5),
|
|
1526
|
+
end: sa(t, c),
|
|
1527
|
+
startAngle: La(Ia(t, s)),
|
|
1528
|
+
centerRaw: Ia(t, .5),
|
|
1529
|
+
centerAngle: La(Ia(t, .5)),
|
|
1530
|
+
endAngle: La(Ia(t, c)),
|
|
1531
|
+
fromBox: Pa(t.fromText, t),
|
|
1532
|
+
centerBox: Pa(t.centerText, t),
|
|
1533
|
+
toBox: Pa(t.toText, t),
|
|
1534
|
+
fromPlate: Fa(t, t.fromText),
|
|
1535
|
+
centerPlate: Fa(t, t.centerText),
|
|
1536
|
+
toPlate: Fa(t, t.toText)
|
|
1531
1537
|
});
|
|
1532
1538
|
}
|
|
1533
1539
|
return e;
|
|
1534
1540
|
});
|
|
1535
1541
|
return re({
|
|
1536
|
-
resetDataBaseline:
|
|
1537
|
-
getData:
|
|
1538
|
-
setData:
|
|
1539
|
-
removeSelected:
|
|
1540
|
-
addNodes:
|
|
1541
|
-
addEdges:
|
|
1542
|
-
updateNodes:
|
|
1543
|
-
updateEdges:
|
|
1544
|
-
clientToSvg:
|
|
1545
|
-
svgToClient:
|
|
1546
|
-
moveLayerUp:
|
|
1547
|
-
moveLayerDown:
|
|
1548
|
-
moveToFront:
|
|
1549
|
-
moveToBack:
|
|
1550
|
-
downloadSVG:
|
|
1542
|
+
resetDataBaseline: Sn,
|
|
1543
|
+
getData: Cn,
|
|
1544
|
+
setData: Fn,
|
|
1545
|
+
removeSelected: Tn,
|
|
1546
|
+
addNodes: jn,
|
|
1547
|
+
addEdges: Mn,
|
|
1548
|
+
updateNodes: Nn,
|
|
1549
|
+
updateEdges: Pn,
|
|
1550
|
+
clientToSvg: Wi,
|
|
1551
|
+
svgToClient: Gi,
|
|
1552
|
+
moveLayerUp: mr,
|
|
1553
|
+
moveLayerDown: hr,
|
|
1554
|
+
moveToFront: gr,
|
|
1555
|
+
moveToBack: _r,
|
|
1556
|
+
downloadSVG: vr
|
|
1551
1557
|
}), (t, o) => (d(), r("svg", {
|
|
1552
1558
|
ref_key: "svgRef",
|
|
1553
1559
|
ref: E,
|
|
1554
1560
|
class: "topology-svg",
|
|
1555
|
-
style: c(
|
|
1556
|
-
viewBox: `${
|
|
1557
|
-
onMousedown:
|
|
1558
|
-
onMousemove:
|
|
1559
|
-
onMouseup:
|
|
1560
|
-
onMouseleave:
|
|
1561
|
-
onClick:
|
|
1562
|
-
onWheel: g(
|
|
1561
|
+
style: c(ni.value),
|
|
1562
|
+
viewBox: `${Ar.value} ${jr.value} ${U.value} ${W.value}`,
|
|
1563
|
+
onMousedown: Kr,
|
|
1564
|
+
onMousemove: Mi,
|
|
1565
|
+
onMouseup: Pi,
|
|
1566
|
+
onMouseleave: Pi,
|
|
1567
|
+
onClick: Tr,
|
|
1568
|
+
onWheel: g(Lr, ["prevent"])
|
|
1563
1569
|
}, [
|
|
1564
1570
|
i("defs", null, [
|
|
1565
1571
|
o[3] ||= a("<linearGradient id=\"glassHighlight\" x1=\"0%\" y1=\"0%\" x2=\"60%\" y2=\"100%\"><stop offset=\"0%\" stop-color=\"rgba(255,255,255,0.9)\"></stop><stop offset=\"30%\" stop-color=\"rgba(255,255,255,0.25)\"></stop><stop offset=\"100%\" stop-color=\"rgba(255,255,255,0)\"></stop></linearGradient><filter id=\"glow-core\" x=\"-50%\" y=\"-50%\" width=\"200%\" height=\"200%\"><feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"3\" result=\"blur\"></feGaussianBlur><feMerge><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"SourceGraphic\"></feMergeNode></feMerge></filter><filter id=\"glow-strong\" x=\"-50%\" y=\"-50%\" width=\"200%\" height=\"200%\"><feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"6\" result=\"blur\"></feGaussianBlur><feMerge><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"SourceGraphic\"></feMergeNode></feMerge></filter>", 3),
|
|
1566
1572
|
i("radialGradient", {
|
|
1567
1573
|
id: "bg-grid",
|
|
1568
|
-
cx:
|
|
1569
|
-
cy:
|
|
1570
|
-
r:
|
|
1571
|
-
}, [(d(!0), r(e, null, p(
|
|
1574
|
+
cx: si.value.cx,
|
|
1575
|
+
cy: si.value.cy,
|
|
1576
|
+
r: si.value.r
|
|
1577
|
+
}, [(d(!0), r(e, null, p(si.value.stops, (e, t) => (d(), r("stop", {
|
|
1572
1578
|
key: `bg-stop-${t}`,
|
|
1573
1579
|
offset: e.offset,
|
|
1574
1580
|
"stop-color": e.color,
|
|
@@ -1595,7 +1601,7 @@ var b = {
|
|
|
1595
1601
|
}, null, 8, pe)
|
|
1596
1602
|
], 8, ue))), 128)),
|
|
1597
1603
|
o[4] ||= a("<linearGradient id=\"flow-grad-1\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0%\" stop-color=\"#00f0ff\" stop-opacity=\"0\"></stop><stop offset=\"40%\" stop-color=\"#00f0ff\" stop-opacity=\"1\"></stop><stop offset=\"60%\" stop-color=\"#00f0ff\" stop-opacity=\"1\"></stop><stop offset=\"100%\" stop-color=\"#00f0ff\" stop-opacity=\"0\"></stop></linearGradient>", 1),
|
|
1598
|
-
(d(!0), r(e, null, p(
|
|
1604
|
+
(d(!0), r(e, null, p(ga.value, (e) => (d(), r("marker", {
|
|
1599
1605
|
key: `m-arrow-${e.key}`,
|
|
1600
1606
|
id: `edge-arrow-${e.key}`,
|
|
1601
1607
|
viewBox: "0 0 10 10",
|
|
@@ -1609,7 +1615,7 @@ var b = {
|
|
|
1609
1615
|
d: "M1,2.5 L9,5 L1,7.5 Z",
|
|
1610
1616
|
fill: e.color
|
|
1611
1617
|
}, null, 8, he)], 8, me))), 128)),
|
|
1612
|
-
(d(!0), r(e, null, p(
|
|
1618
|
+
(d(!0), r(e, null, p(ga.value, (e) => (d(), r("marker", {
|
|
1613
1619
|
key: `m-dot-${e.key}`,
|
|
1614
1620
|
id: `edge-dot-${e.key}`,
|
|
1615
1621
|
viewBox: "0 0 10 10",
|
|
@@ -1629,29 +1635,29 @@ var b = {
|
|
|
1629
1635
|
i("rect", {
|
|
1630
1636
|
width: U.value,
|
|
1631
1637
|
height: W.value,
|
|
1632
|
-
x:
|
|
1633
|
-
y:
|
|
1638
|
+
x: Ar.value,
|
|
1639
|
+
y: jr.value,
|
|
1634
1640
|
fill: "url(#bg-grid)"
|
|
1635
1641
|
}, null, 8, ve),
|
|
1636
|
-
|
|
1642
|
+
ri.value ? (d(), r(e, { key: 0 }, [i("pattern", {
|
|
1637
1643
|
id: "grid",
|
|
1638
|
-
width:
|
|
1639
|
-
height:
|
|
1644
|
+
width: ai.value,
|
|
1645
|
+
height: ai.value,
|
|
1640
1646
|
patternUnits: "userSpaceOnUse"
|
|
1641
1647
|
}, [i("path", {
|
|
1642
|
-
d: `M ${
|
|
1648
|
+
d: `M ${ai.value} 0 L 0 0 0 ${ai.value}`,
|
|
1643
1649
|
fill: "none",
|
|
1644
|
-
stroke:
|
|
1650
|
+
stroke: ii.value,
|
|
1645
1651
|
"stroke-width": "0.5"
|
|
1646
1652
|
}, null, 8, be)], 8, ye), i("rect", {
|
|
1647
1653
|
width: U.value,
|
|
1648
1654
|
height: W.value,
|
|
1649
|
-
x:
|
|
1650
|
-
y:
|
|
1655
|
+
x: Ar.value,
|
|
1656
|
+
y: jr.value,
|
|
1651
1657
|
fill: "url(#grid)",
|
|
1652
|
-
opacity:
|
|
1658
|
+
opacity: oi.value
|
|
1653
1659
|
}, null, 8, xe)], 64)) : n("", !0),
|
|
1654
|
-
|
|
1660
|
+
ci.value ? (d(), r("g", Se, [...o[5] ||= [
|
|
1655
1661
|
i("line", {
|
|
1656
1662
|
x1: "-22",
|
|
1657
1663
|
y1: "0",
|
|
@@ -1683,7 +1689,7 @@ var b = {
|
|
|
1683
1689
|
opacity: "0.8"
|
|
1684
1690
|
}, null, -1)
|
|
1685
1691
|
]])) : n("", !0),
|
|
1686
|
-
(d(!0), r(e, null, p(
|
|
1692
|
+
(d(!0), r(e, null, p(ma.value, (e) => (d(), r("g", { key: e.id }, [
|
|
1687
1693
|
i("rect", {
|
|
1688
1694
|
x: e.rect.x,
|
|
1689
1695
|
y: e.rect.y,
|
|
@@ -1745,17 +1751,17 @@ var b = {
|
|
|
1745
1751
|
"letter-spacing": "0.5"
|
|
1746
1752
|
}, h(e.label), 9, ke)
|
|
1747
1753
|
]))), 128)),
|
|
1748
|
-
|
|
1754
|
+
dr.value ? (d(), r("g", Ae, [(d(!0), r(e, null, p(Ir.value, (e) => (d(), r("g", {
|
|
1749
1755
|
key: `node-base-${e.id}`,
|
|
1750
1756
|
transform: `translate(${e.x}, ${e.y})`
|
|
1751
|
-
}, [
|
|
1757
|
+
}, [ir(e) && _.viewMode !== "3d" ? (d(), r("rect", {
|
|
1752
1758
|
key: 0,
|
|
1753
1759
|
x: L(e).x,
|
|
1754
1760
|
y: L(e).y,
|
|
1755
1761
|
width: L(e).width,
|
|
1756
1762
|
height: L(e).height,
|
|
1757
|
-
rx:
|
|
1758
|
-
fill:
|
|
1763
|
+
rx: Di(e),
|
|
1764
|
+
fill: ir(e),
|
|
1759
1765
|
opacity: "0.15"
|
|
1760
1766
|
}, null, 8, Me)) : n("", !0), R(e) && _.viewMode !== "3d" ? (d(), r("rect", {
|
|
1761
1767
|
key: 1,
|
|
@@ -1763,24 +1769,24 @@ var b = {
|
|
|
1763
1769
|
y: R(e).y,
|
|
1764
1770
|
width: R(e).width,
|
|
1765
1771
|
height: R(e).height,
|
|
1766
|
-
rx:
|
|
1772
|
+
rx: Di(e),
|
|
1767
1773
|
fill: "none",
|
|
1768
|
-
stroke:
|
|
1769
|
-
"stroke-width":
|
|
1770
|
-
"stroke-dasharray":
|
|
1774
|
+
stroke: wi(e),
|
|
1775
|
+
"stroke-width": Ti(e),
|
|
1776
|
+
"stroke-dasharray": Ei(e),
|
|
1771
1777
|
opacity: "0.8"
|
|
1772
1778
|
}, null, 8, Ne)) : n("", !0)], 8, je))), 128))])) : n("", !0),
|
|
1773
|
-
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `base-${t.id}` }, [
|
|
1779
|
+
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `base-${t.id}` }, [ka(t) ? n("", !0) : (d(), r("path", {
|
|
1774
1780
|
key: 0,
|
|
1775
1781
|
d: $(t),
|
|
1776
1782
|
fill: "none",
|
|
1777
|
-
stroke:
|
|
1778
|
-
opacity:
|
|
1783
|
+
stroke: mi(t),
|
|
1784
|
+
opacity: hi(t),
|
|
1779
1785
|
"stroke-width": "2",
|
|
1780
1786
|
"stroke-linecap": "round",
|
|
1781
|
-
"marker-end":
|
|
1787
|
+
"marker-end": _a(t)
|
|
1782
1788
|
}, null, 8, Pe))], 64))), 128)),
|
|
1783
|
-
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `glow-${t.id}` }, [
|
|
1789
|
+
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `glow-${t.id}` }, [xi.value ? (d(), r("path", {
|
|
1784
1790
|
key: 0,
|
|
1785
1791
|
d: $(t),
|
|
1786
1792
|
fill: "none",
|
|
@@ -1790,16 +1796,16 @@ var b = {
|
|
|
1790
1796
|
opacity: "0.15",
|
|
1791
1797
|
filter: "url(#glow-strong)"
|
|
1792
1798
|
}, null, 8, Fe)) : n("", !0)], 64))), 128)),
|
|
1793
|
-
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `sel-${t.id}` }, [
|
|
1799
|
+
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `sel-${t.id}` }, [or(t) ? (d(), r("path", {
|
|
1794
1800
|
key: 0,
|
|
1795
1801
|
d: $(t),
|
|
1796
1802
|
fill: "none",
|
|
1797
|
-
stroke:
|
|
1803
|
+
stroke: yr.value,
|
|
1798
1804
|
"stroke-width": "4",
|
|
1799
1805
|
opacity: "0.35",
|
|
1800
1806
|
filter: "url(#glow-strong)"
|
|
1801
1807
|
}, null, 8, Ie)) : n("", !0)], 64))), 128)),
|
|
1802
|
-
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `flow-${t.id}` }, [
|
|
1808
|
+
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `flow-${t.id}` }, [Aa(t) ? (d(), r("g", Le, [
|
|
1803
1809
|
i("path", {
|
|
1804
1810
|
d: $(t),
|
|
1805
1811
|
fill: "none",
|
|
@@ -1812,7 +1818,7 @@ var b = {
|
|
|
1812
1818
|
attributeName: "stroke-dashoffset",
|
|
1813
1819
|
from: "0",
|
|
1814
1820
|
to: "-52",
|
|
1815
|
-
dur:
|
|
1821
|
+
dur: xa(t),
|
|
1816
1822
|
repeatCount: "indefinite"
|
|
1817
1823
|
}, null, 8, ze)], 8, Re),
|
|
1818
1824
|
i("path", {
|
|
@@ -1827,7 +1833,7 @@ var b = {
|
|
|
1827
1833
|
attributeName: "stroke-dashoffset",
|
|
1828
1834
|
from: "-30",
|
|
1829
1835
|
to: "-82",
|
|
1830
|
-
dur:
|
|
1836
|
+
dur: xa(t, 1.3),
|
|
1831
1837
|
repeatCount: "indefinite"
|
|
1832
1838
|
}, null, 8, Ve)], 8, Be),
|
|
1833
1839
|
i("path", {
|
|
@@ -1843,35 +1849,35 @@ var b = {
|
|
|
1843
1849
|
attributeName: "stroke-dashoffset",
|
|
1844
1850
|
from: "0",
|
|
1845
1851
|
to: "-84",
|
|
1846
|
-
dur:
|
|
1852
|
+
dur: xa(t, .8),
|
|
1847
1853
|
repeatCount: "indefinite"
|
|
1848
1854
|
}, null, 8, Ue)], 8, He)
|
|
1849
1855
|
])) : n("", !0)], 64))), 128)),
|
|
1850
|
-
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `dash-${t.id}` }, [
|
|
1856
|
+
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `dash-${t.id}` }, [ka(t) ? (d(), r("path", {
|
|
1851
1857
|
key: 0,
|
|
1852
1858
|
d: $(t),
|
|
1853
1859
|
fill: "none",
|
|
1854
1860
|
stroke: Q(t),
|
|
1855
|
-
"stroke-width":
|
|
1861
|
+
"stroke-width": Da(t),
|
|
1856
1862
|
"stroke-linecap": "round",
|
|
1857
|
-
"stroke-dasharray":
|
|
1858
|
-
"marker-end":
|
|
1863
|
+
"stroke-dasharray": Ta.value,
|
|
1864
|
+
"marker-end": _a(t),
|
|
1859
1865
|
opacity: "0.9"
|
|
1860
1866
|
}, [i("animate", {
|
|
1861
1867
|
attributeName: "stroke-dashoffset",
|
|
1862
1868
|
from: "0",
|
|
1863
|
-
to: `${-
|
|
1864
|
-
dur:
|
|
1869
|
+
to: `${-Ea.value}`,
|
|
1870
|
+
dur: Oa(t),
|
|
1865
1871
|
repeatCount: "indefinite"
|
|
1866
1872
|
}, null, 8, Ge)], 8, We)) : n("", !0)], 64))), 128)),
|
|
1867
|
-
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `particle-${t.id}` }, [
|
|
1873
|
+
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `particle-${t.id}` }, [ja(t) ? (d(), r("g", Ke, [i("circle", {
|
|
1868
1874
|
r: "3",
|
|
1869
1875
|
fill: Q(t),
|
|
1870
1876
|
opacity: "0.9",
|
|
1871
1877
|
filter: "url(#glow-core)"
|
|
1872
1878
|
}, [i("animateMotion", {
|
|
1873
1879
|
path: $(t),
|
|
1874
|
-
dur:
|
|
1880
|
+
dur: Sa(t),
|
|
1875
1881
|
repeatCount: "indefinite"
|
|
1876
1882
|
}, null, 8, Je)], 8, qe), i("circle", {
|
|
1877
1883
|
r: "8",
|
|
@@ -1880,17 +1886,17 @@ var b = {
|
|
|
1880
1886
|
filter: "url(#glow-strong)"
|
|
1881
1887
|
}, [i("animateMotion", {
|
|
1882
1888
|
path: $(t),
|
|
1883
|
-
dur:
|
|
1889
|
+
dur: Sa(t),
|
|
1884
1890
|
repeatCount: "indefinite"
|
|
1885
1891
|
}, null, 8, Xe)], 8, Ye)])) : n("", !0)], 64))), 128)),
|
|
1886
|
-
(d(!0), r(e, null, p(
|
|
1892
|
+
(d(!0), r(e, null, p(Ha.value, (t) => (d(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (d(), r("g", {
|
|
1887
1893
|
key: 0,
|
|
1888
1894
|
transform: `translate(${t.center.x}, ${t.center.y}) rotate(${t.centerAngle})`
|
|
1889
1895
|
}, [i("rect", {
|
|
1890
1896
|
x: "-7",
|
|
1891
|
-
y: -
|
|
1897
|
+
y: -an(t.edge, null) / 2,
|
|
1892
1898
|
width: 14,
|
|
1893
|
-
height:
|
|
1899
|
+
height: an(t.edge, null),
|
|
1894
1900
|
rx: "2",
|
|
1895
1901
|
fill: "#FFFFFF",
|
|
1896
1902
|
opacity: "0.9",
|
|
@@ -1900,14 +1906,14 @@ var b = {
|
|
|
1900
1906
|
y: "0",
|
|
1901
1907
|
"dominant-baseline": "central",
|
|
1902
1908
|
"text-anchor": "middle",
|
|
1903
|
-
"font-size":
|
|
1904
|
-
fill:
|
|
1909
|
+
"font-size": an(t.edge, null),
|
|
1910
|
+
fill: on(t.edge, null),
|
|
1905
1911
|
"font-family": "'SF Mono', monospace",
|
|
1906
1912
|
opacity: "1"
|
|
1907
1913
|
}, h(t.info.count), 9, $e)], 8, Ze)) : t.info.merged ? n("", !0) : (d(), r("g", et, [
|
|
1908
|
-
|
|
1914
|
+
Na(t.edge.fromText) ? (d(), r("g", {
|
|
1909
1915
|
key: 0,
|
|
1910
|
-
transform:
|
|
1916
|
+
transform: Ra(t.edge.fromText, t.start, t.startAngle)
|
|
1911
1917
|
}, [t.fromPlate.show ? (d(), r("rect", {
|
|
1912
1918
|
key: 0,
|
|
1913
1919
|
x: -t.fromBox.w / 2,
|
|
@@ -1925,15 +1931,15 @@ var b = {
|
|
|
1925
1931
|
y: "0",
|
|
1926
1932
|
"dominant-baseline": "central",
|
|
1927
1933
|
"text-anchor": "middle",
|
|
1928
|
-
"font-size":
|
|
1929
|
-
fill:
|
|
1934
|
+
"font-size": an(t.edge, t.edge.fromText),
|
|
1935
|
+
fill: on(t.edge, t.edge.fromText),
|
|
1930
1936
|
"font-family": "'SF Mono', monospace",
|
|
1931
1937
|
"font-weight": "500",
|
|
1932
1938
|
opacity: "0.9"
|
|
1933
|
-
}, h(
|
|
1934
|
-
|
|
1939
|
+
}, h(Ma(t.edge.fromText)), 9, rt)], 8, tt)) : n("", !0),
|
|
1940
|
+
Na(t.edge.centerText) ? (d(), r("g", {
|
|
1935
1941
|
key: 1,
|
|
1936
|
-
transform:
|
|
1942
|
+
transform: Ra(t.edge.centerText, t.center, Ba(t.centerAngle, t.centerRaw))
|
|
1937
1943
|
}, [t.centerPlate.show ? (d(), r("rect", {
|
|
1938
1944
|
key: 0,
|
|
1939
1945
|
x: -t.centerBox.w / 2,
|
|
@@ -1951,15 +1957,15 @@ var b = {
|
|
|
1951
1957
|
y: "0",
|
|
1952
1958
|
"dominant-baseline": "central",
|
|
1953
1959
|
"text-anchor": "middle",
|
|
1954
|
-
"font-size":
|
|
1955
|
-
fill:
|
|
1960
|
+
"font-size": an(t.edge, t.edge.centerText),
|
|
1961
|
+
fill: on(t.edge, t.edge.centerText),
|
|
1956
1962
|
"font-family": "'SF Mono', monospace",
|
|
1957
1963
|
"font-weight": "600",
|
|
1958
1964
|
opacity: "1"
|
|
1959
|
-
}, h(
|
|
1960
|
-
|
|
1965
|
+
}, h(Ma(t.edge.centerText)), 9, ot)], 8, it)) : n("", !0),
|
|
1966
|
+
Na(t.edge.toText) ? (d(), r("g", {
|
|
1961
1967
|
key: 2,
|
|
1962
|
-
transform:
|
|
1968
|
+
transform: Ra(t.edge.toText, t.end, t.endAngle)
|
|
1963
1969
|
}, [t.toPlate.show ? (d(), r("rect", {
|
|
1964
1970
|
key: 0,
|
|
1965
1971
|
x: -t.toBox.w / 2,
|
|
@@ -1977,20 +1983,20 @@ var b = {
|
|
|
1977
1983
|
y: "0",
|
|
1978
1984
|
"dominant-baseline": "central",
|
|
1979
1985
|
"text-anchor": "middle",
|
|
1980
|
-
"font-size":
|
|
1981
|
-
fill:
|
|
1986
|
+
"font-size": an(t.edge, t.edge.toText),
|
|
1987
|
+
fill: on(t.edge, t.edge.toText),
|
|
1982
1988
|
"font-family": "'SF Mono', monospace",
|
|
1983
1989
|
"font-weight": "500",
|
|
1984
1990
|
opacity: "0.9"
|
|
1985
|
-
}, h(
|
|
1991
|
+
}, h(Ma(t.edge.toText)), 9, lt)], 8, st)) : n("", !0)
|
|
1986
1992
|
]))], 64))), 128)),
|
|
1987
1993
|
Y.value ? (d(), r("g", ut, [
|
|
1988
1994
|
i("line", {
|
|
1989
1995
|
x1: Y.value.ax,
|
|
1990
1996
|
y1: Y.value.ay,
|
|
1991
|
-
x2:
|
|
1992
|
-
y2:
|
|
1993
|
-
stroke:
|
|
1997
|
+
x2: da.value.x,
|
|
1998
|
+
y2: da.value.y,
|
|
1999
|
+
stroke: ua.value,
|
|
1994
2000
|
"stroke-width": "2",
|
|
1995
2001
|
"stroke-dasharray": "6 6",
|
|
1996
2002
|
"stroke-linecap": "round",
|
|
@@ -2000,18 +2006,18 @@ var b = {
|
|
|
2000
2006
|
cx: Y.value.px,
|
|
2001
2007
|
cy: Y.value.py,
|
|
2002
2008
|
r: "3.5",
|
|
2003
|
-
fill:
|
|
2009
|
+
fill: ua.value,
|
|
2004
2010
|
opacity: "0.9"
|
|
2005
2011
|
}, null, 8, ft),
|
|
2006
|
-
Y.value.overId &&
|
|
2012
|
+
Y.value.overId && fa.value ? (d(), r("rect", {
|
|
2007
2013
|
key: 0,
|
|
2008
|
-
x:
|
|
2009
|
-
y:
|
|
2010
|
-
width:
|
|
2011
|
-
height:
|
|
2014
|
+
x: fa.value.x,
|
|
2015
|
+
y: fa.value.y,
|
|
2016
|
+
width: fa.value.w,
|
|
2017
|
+
height: fa.value.h,
|
|
2012
2018
|
rx: "6",
|
|
2013
2019
|
fill: "none",
|
|
2014
|
-
stroke:
|
|
2020
|
+
stroke: ua.value,
|
|
2015
2021
|
"stroke-width": "1.5",
|
|
2016
2022
|
"stroke-dasharray": "6 4",
|
|
2017
2023
|
opacity: "0.9"
|
|
@@ -2027,101 +2033,101 @@ var b = {
|
|
|
2027
2033
|
"pointer-events": "stroke",
|
|
2028
2034
|
cursor: "pointer"
|
|
2029
2035
|
},
|
|
2030
|
-
onClick: g((t) =>
|
|
2036
|
+
onClick: g((t) => br(e, t), ["stop"])
|
|
2031
2037
|
}, null, 8, mt))), 128)),
|
|
2032
|
-
(d(!0), r(e, null, p(
|
|
2038
|
+
(d(!0), r(e, null, p(Ir.value, (a) => (d(), r("g", {
|
|
2033
2039
|
key: a.id,
|
|
2034
2040
|
transform: `translate(${a.x}, ${a.y})`,
|
|
2035
2041
|
class: s(["topology-node", T.value === a.id ? "dragging" : ""]),
|
|
2036
|
-
onMousedown: (e) =>
|
|
2037
|
-
onClick: (e) =>
|
|
2042
|
+
onMousedown: (e) => Oi(e, a.id),
|
|
2043
|
+
onClick: (e) => pr(a, e),
|
|
2038
2044
|
style: c({
|
|
2039
2045
|
cursor: v.editable && v.config.nodeDraggable !== !1 ? "grab" : "default",
|
|
2040
2046
|
color: N(a)
|
|
2041
2047
|
})
|
|
2042
2048
|
}, [
|
|
2043
|
-
|
|
2049
|
+
Bn(a) ? (d(), r("rect", {
|
|
2044
2050
|
key: 0,
|
|
2045
2051
|
class: "node-hit-area node-hit-frame",
|
|
2046
2052
|
x: L(a).x,
|
|
2047
2053
|
y: L(a).y,
|
|
2048
2054
|
width: L(a).width,
|
|
2049
2055
|
height: L(a).height,
|
|
2050
|
-
rx:
|
|
2056
|
+
rx: Di(a),
|
|
2051
2057
|
fill: "none",
|
|
2052
2058
|
stroke: "transparent",
|
|
2053
|
-
"stroke-width": Math.max(
|
|
2059
|
+
"stroke-width": Math.max(Ti(a), 12),
|
|
2054
2060
|
"pointer-events": "stroke"
|
|
2055
2061
|
}, null, 8, gt)) : (d(), r("rect", {
|
|
2056
2062
|
key: 1,
|
|
2057
2063
|
class: "node-hit-area",
|
|
2058
|
-
x:
|
|
2059
|
-
y:
|
|
2060
|
-
width:
|
|
2061
|
-
height:
|
|
2064
|
+
x: nr(a).x,
|
|
2065
|
+
y: nr(a).y,
|
|
2066
|
+
width: nr(a).width,
|
|
2067
|
+
height: nr(a).height,
|
|
2062
2068
|
fill: "transparent",
|
|
2063
2069
|
"pointer-events": "all"
|
|
2064
2070
|
}, null, 8, _t)),
|
|
2065
|
-
!
|
|
2071
|
+
!dr.value && ir(a) && _.viewMode !== "3d" ? (d(), r("rect", {
|
|
2066
2072
|
key: 2,
|
|
2067
2073
|
x: L(a).x,
|
|
2068
2074
|
y: L(a).y,
|
|
2069
2075
|
width: L(a).width,
|
|
2070
2076
|
height: L(a).height,
|
|
2071
|
-
rx:
|
|
2072
|
-
fill:
|
|
2077
|
+
rx: Di(a),
|
|
2078
|
+
fill: ir(a),
|
|
2073
2079
|
opacity: "0.15"
|
|
2074
2080
|
}, null, 8, vt)) : n("", !0),
|
|
2075
|
-
!
|
|
2081
|
+
!dr.value && R(a) && _.viewMode !== "3d" ? (d(), r("rect", {
|
|
2076
2082
|
key: 3,
|
|
2077
2083
|
x: R(a).x,
|
|
2078
2084
|
y: R(a).y,
|
|
2079
2085
|
width: R(a).width,
|
|
2080
2086
|
height: R(a).height,
|
|
2081
|
-
rx:
|
|
2087
|
+
rx: Di(a),
|
|
2082
2088
|
fill: "none",
|
|
2083
|
-
stroke:
|
|
2084
|
-
"stroke-width":
|
|
2085
|
-
"stroke-dasharray":
|
|
2089
|
+
stroke: wi(a),
|
|
2090
|
+
"stroke-width": Ti(a),
|
|
2091
|
+
"stroke-dasharray": Ei(a),
|
|
2086
2092
|
opacity: "0.8"
|
|
2087
2093
|
}, null, 8, yt)) : n("", !0),
|
|
2088
|
-
|
|
2094
|
+
ar(a) && _.viewMode !== "3d" ? (d(), r("rect", {
|
|
2089
2095
|
key: 4,
|
|
2090
2096
|
x: L(a).x,
|
|
2091
2097
|
y: L(a).y,
|
|
2092
2098
|
width: L(a).width,
|
|
2093
2099
|
height: L(a).height,
|
|
2094
|
-
rx:
|
|
2100
|
+
rx: Di(a),
|
|
2095
2101
|
fill: "none",
|
|
2096
|
-
stroke:
|
|
2102
|
+
stroke: ur.value,
|
|
2097
2103
|
"stroke-width": "2.5",
|
|
2098
2104
|
transform: "scale(1.1)",
|
|
2099
2105
|
style: { "pointer-events": "none" }
|
|
2100
2106
|
}, null, 8, bt)) : n("", !0),
|
|
2101
|
-
|
|
2107
|
+
zn(a) ? (d(), r("text", {
|
|
2102
2108
|
key: 5,
|
|
2103
2109
|
y: "4",
|
|
2104
2110
|
transform: `rotate(${a.rotation || 0} 0 4)`,
|
|
2105
2111
|
"text-anchor": "middle",
|
|
2106
|
-
fill:
|
|
2107
|
-
"font-size":
|
|
2112
|
+
fill: nn(a) || N(a) || Rn(a).color,
|
|
2113
|
+
"font-size": tn(a, 12),
|
|
2108
2114
|
"font-family": "'SF Mono', monospace",
|
|
2109
2115
|
"font-weight": "600"
|
|
2110
2116
|
}, [(d(!0), r(e, null, p(String(a.label ?? "").split("\n"), (e, t) => (d(), r("tspan", {
|
|
2111
2117
|
key: t,
|
|
2112
2118
|
x: "0",
|
|
2113
2119
|
dy: t === 0 ? 0 : "1.2em"
|
|
2114
|
-
}, h(e), 9, St))), 128))], 8, xt)) :
|
|
2115
|
-
a.state !== "none" &&
|
|
2120
|
+
}, h(e), 9, St))), 128))], 8, xt)) : Bn(a) ? (d(), r(e, { key: 6 }, [], 64)) : (d(), r(e, { key: 7 }, [
|
|
2121
|
+
a.state !== "none" && Si.value ? (d(), r("circle", {
|
|
2116
2122
|
key: 0,
|
|
2117
|
-
r:
|
|
2123
|
+
r: Zn(a),
|
|
2118
2124
|
fill: "none",
|
|
2119
|
-
stroke:
|
|
2125
|
+
stroke: Rn(a).color,
|
|
2120
2126
|
"stroke-width": "2.5",
|
|
2121
2127
|
opacity: "0"
|
|
2122
2128
|
}, [i("animate", {
|
|
2123
2129
|
attributeName: "r",
|
|
2124
|
-
values: `${
|
|
2130
|
+
values: `${Zn(a)};${Zn(a) * 1.6};${Zn(a)}`,
|
|
2125
2131
|
dur: "2s",
|
|
2126
2132
|
repeatCount: "indefinite"
|
|
2127
2133
|
}, null, 8, wt), o[6] ||= i("animate", {
|
|
@@ -2130,22 +2136,22 @@ var b = {
|
|
|
2130
2136
|
dur: "2s",
|
|
2131
2137
|
repeatCount: "indefinite"
|
|
2132
2138
|
}, null, -1)], 8, Ct)) : n("", !0),
|
|
2133
|
-
|
|
2139
|
+
Hn(a) ? (d(), r("svg", {
|
|
2134
2140
|
key: 1,
|
|
2135
2141
|
class: "node-icon",
|
|
2136
2142
|
x: L(a).x,
|
|
2137
2143
|
y: L(a).y,
|
|
2138
2144
|
width: L(a).width,
|
|
2139
2145
|
height: L(a).height,
|
|
2140
|
-
viewBox:
|
|
2141
|
-
preserveAspectRatio:
|
|
2146
|
+
viewBox: Gn,
|
|
2147
|
+
preserveAspectRatio: Wn.value
|
|
2142
2148
|
}, [m(t.$slots, "node-icon", {
|
|
2143
2149
|
node: a,
|
|
2144
2150
|
color: N(a),
|
|
2145
2151
|
viewMode: _.viewMode,
|
|
2146
2152
|
isImage: !0,
|
|
2147
2153
|
image: P(a),
|
|
2148
|
-
fit:
|
|
2154
|
+
fit: Un.value,
|
|
2149
2155
|
imageWidth: F(a).w,
|
|
2150
2156
|
imageHeight: F(a).h,
|
|
2151
2157
|
width: L(a).width,
|
|
@@ -2159,14 +2165,14 @@ var b = {
|
|
|
2159
2165
|
}, null, 8, Et)])], 8, Tt)) : (d(), r("g", {
|
|
2160
2166
|
key: 2,
|
|
2161
2167
|
class: "node-icon",
|
|
2162
|
-
transform:
|
|
2168
|
+
transform: Qn(a)
|
|
2163
2169
|
}, [m(t.$slots, "node-icon", {
|
|
2164
2170
|
node: a,
|
|
2165
2171
|
color: N(a),
|
|
2166
2172
|
viewMode: _.viewMode,
|
|
2167
2173
|
isImage: !1,
|
|
2168
2174
|
image: P(a),
|
|
2169
|
-
fit:
|
|
2175
|
+
fit: Un.value,
|
|
2170
2176
|
width: L(a).width,
|
|
2171
2177
|
height: L(a).height
|
|
2172
2178
|
}, () => [i("rect", {
|
|
@@ -2178,22 +2184,22 @@ var b = {
|
|
|
2178
2184
|
fill: N(a),
|
|
2179
2185
|
opacity: "0.9"
|
|
2180
2186
|
}, null, 8, Ot)])], 8, Dt)),
|
|
2181
|
-
|
|
2187
|
+
vi.value ? (d(), r("g", {
|
|
2182
2188
|
key: 3,
|
|
2183
|
-
transform:
|
|
2189
|
+
transform: $n(a)
|
|
2184
2190
|
}, [i("circle", {
|
|
2185
2191
|
r: "4",
|
|
2186
|
-
fill:
|
|
2192
|
+
fill: Rn(a).color,
|
|
2187
2193
|
stroke: "#0a0e1a",
|
|
2188
2194
|
"stroke-width": "2"
|
|
2189
2195
|
}, null, 8, At)], 8, kt)) : n("", !0),
|
|
2190
2196
|
i("text", {
|
|
2191
|
-
y:
|
|
2192
|
-
transform: `rotate(${a.rotation || 0} 0 ${
|
|
2197
|
+
y: tr(a),
|
|
2198
|
+
transform: `rotate(${a.rotation || 0} 0 ${tr(a)})`,
|
|
2193
2199
|
"text-anchor": "middle",
|
|
2194
|
-
fill:
|
|
2195
|
-
"font-size":
|
|
2196
|
-
"font-weight":
|
|
2200
|
+
fill: nn(a),
|
|
2201
|
+
"font-size": tn(a),
|
|
2202
|
+
"font-weight": rn(a),
|
|
2197
2203
|
"font-family": "'Segoe UI', system-ui, sans-serif",
|
|
2198
2204
|
opacity: "0.9"
|
|
2199
2205
|
}, [(d(!0), r(e, null, p(String(a.label ?? "").split("\n"), (e, t) => (d(), r("tspan", {
|
|
@@ -2202,7 +2208,7 @@ var b = {
|
|
|
2202
2208
|
dy: t === 0 ? 0 : "1.2em"
|
|
2203
2209
|
}, h(e), 9, Mt))), 128))], 8, jt)
|
|
2204
2210
|
], 64)),
|
|
2205
|
-
|
|
2211
|
+
_i.value ? (d(), r("g", Nt, [(d(!0), r(e, null, p(Ui(a), (e) => (d(), r("circle", {
|
|
2206
2212
|
key: e.side,
|
|
2207
2213
|
cx: e.x,
|
|
2208
2214
|
cy: e.y,
|
|
@@ -2211,48 +2217,48 @@ var b = {
|
|
|
2211
2217
|
fill: "#0a0e1a",
|
|
2212
2218
|
stroke: N(a),
|
|
2213
2219
|
"stroke-width": "1.5",
|
|
2214
|
-
onPointerdown: g((t) =>
|
|
2215
|
-
onPointermove: g(
|
|
2216
|
-
onPointerup: g(
|
|
2217
|
-
onPointercancel: g(
|
|
2218
|
-
onLostpointercapture:
|
|
2220
|
+
onPointerdown: g((t) => Ki(t, a.id, e), ["stop", "prevent"]),
|
|
2221
|
+
onPointermove: g(ta, ["stop"]),
|
|
2222
|
+
onPointerup: g(na, ["stop"]),
|
|
2223
|
+
onPointercancel: g(na, ["stop"]),
|
|
2224
|
+
onLostpointercapture: na,
|
|
2219
2225
|
onMousedown: o[0] ||= g(() => {}, ["stop", "prevent"]),
|
|
2220
2226
|
onClick: o[1] ||= g(() => {}, ["stop"])
|
|
2221
2227
|
}, null, 40, Pt))), 128))])) : n("", !0)
|
|
2222
2228
|
], 46, ht))), 128)),
|
|
2223
|
-
|
|
2229
|
+
Hi.value ? (d(), r("g", Ft, [(d(!0), r(e, null, p(Ii(Hi.value), (e) => (d(), r("rect", {
|
|
2224
2230
|
key: e.side,
|
|
2225
|
-
x:
|
|
2226
|
-
y:
|
|
2231
|
+
x: Hi.value.x + e.x - 4.5,
|
|
2232
|
+
y: Hi.value.y + e.y - 4.5,
|
|
2227
2233
|
width: "9",
|
|
2228
2234
|
height: "9",
|
|
2229
2235
|
rx: "2",
|
|
2230
2236
|
class: s(["node-resize-handle", `rt-${e.side}`]),
|
|
2231
|
-
onMousedown: g((t) =>
|
|
2237
|
+
onMousedown: g((t) => Ri(t, Hi.value, e.side), ["stop", "prevent"]),
|
|
2232
2238
|
onClick: o[2] ||= g(() => {}, ["stop"])
|
|
2233
2239
|
}, null, 42, It))), 128))])) : n("", !0),
|
|
2234
|
-
|
|
2240
|
+
fr.value ? (d(!0), r(e, { key: 5 }, p(G.value, (t) => (d(), r(e, { key: `front-${t.id}` }, [or(t) ? (d(), r("g", Lt, [i("path", {
|
|
2235
2241
|
d: $(t),
|
|
2236
2242
|
fill: "none",
|
|
2237
2243
|
stroke: Q(t),
|
|
2238
2244
|
"stroke-width": "2.5",
|
|
2239
2245
|
"stroke-linecap": "round",
|
|
2240
|
-
"marker-end":
|
|
2246
|
+
"marker-end": _a(t)
|
|
2241
2247
|
}, null, 8, Rt)])) : n("", !0)], 64))), 128)) : n("", !0),
|
|
2242
2248
|
q.value ? (d(), r("rect", {
|
|
2243
2249
|
key: 6,
|
|
2244
2250
|
class: "marquee-box",
|
|
2245
|
-
x:
|
|
2246
|
-
y:
|
|
2247
|
-
width:
|
|
2248
|
-
height:
|
|
2251
|
+
x: Ur.value.x,
|
|
2252
|
+
y: Ur.value.y,
|
|
2253
|
+
width: Ur.value.width,
|
|
2254
|
+
height: Ur.value.height,
|
|
2249
2255
|
rx: "2",
|
|
2250
2256
|
"vector-effect": "non-scaling-stroke"
|
|
2251
2257
|
}, null, 8, zt)) : n("", !0)
|
|
2252
2258
|
], 44, se));
|
|
2253
2259
|
}
|
|
2254
|
-
},
|
|
2255
|
-
e.component("Topology",
|
|
2260
|
+
}, $t = { install(e) {
|
|
2261
|
+
e.component("Topology", Qt);
|
|
2256
2262
|
} };
|
|
2257
2263
|
//#endregion
|
|
2258
|
-
export {
|
|
2264
|
+
export { Qt as Topology, $t as default, oe as nodeColors, b as nodeStates };
|