vue3-network-graph 0.2.3 → 0.2.4
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 +10 -2
- package/README.md +86 -77
- package/dist/index.mjs +785 -750
- package/dist/index.umd.cjs +5 -5
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -421,7 +421,7 @@ var y = {
|
|
|
421
421
|
setup(g, { expose: ie, emit: ae }) {
|
|
422
422
|
let _ = g, v = ae, fn = 0, pn = () => {
|
|
423
423
|
fn++;
|
|
424
|
-
},
|
|
424
|
+
}, b = (e) => e && typeof e == "object" ? {
|
|
425
425
|
text: e.text,
|
|
426
426
|
rotation: e.rotation || 0,
|
|
427
427
|
fontSize: e.fontSize,
|
|
@@ -431,131 +431,131 @@ var y = {
|
|
|
431
431
|
rotation: 0,
|
|
432
432
|
fontSize: void 0,
|
|
433
433
|
color: void 0
|
|
434
|
-
},
|
|
435
|
-
|
|
434
|
+
}, mn = (e, t = 11) => e.fontSize || t, hn = (e) => e.fontColor || "#000000", gn = (e, t = 500) => e.fontWeight || t, _n = (e, t) => e.fontSize || b(t).fontSize || 8, vn = (e, t) => e.fontColor || b(t).color || t != null && t === e.centerText && ra.value || "#000000", x = f(_.nodes.map((e) => ({ ...e }))), yn = null, S = () => {
|
|
435
|
+
yn = x.value, v("update:nodes", x.value);
|
|
436
436
|
};
|
|
437
437
|
ne(() => _.nodes, (e) => {
|
|
438
438
|
let t = Array.isArray(e) ? e : [];
|
|
439
|
-
if (t ===
|
|
439
|
+
if (t === yn) return;
|
|
440
440
|
let n = null, r = null;
|
|
441
441
|
try {
|
|
442
|
-
n = JSON.stringify(t), r = JSON.stringify(
|
|
442
|
+
n = JSON.stringify(t), r = JSON.stringify(x.value);
|
|
443
443
|
} catch {
|
|
444
444
|
n = null;
|
|
445
445
|
}
|
|
446
|
-
(n === null || n !== r) && (pn(),
|
|
446
|
+
(n === null || n !== r) && (pn(), x.value = t.map((e) => ({ ...e })));
|
|
447
447
|
}, { deep: !0 });
|
|
448
|
-
let
|
|
448
|
+
let bn = f(_.lineMode);
|
|
449
449
|
ne(() => _.lineMode, (e) => {
|
|
450
|
-
|
|
450
|
+
bn.value = e;
|
|
451
451
|
});
|
|
452
|
-
let
|
|
453
|
-
get: () =>
|
|
452
|
+
let xn = t({
|
|
453
|
+
get: () => bn.value,
|
|
454
454
|
set: (e) => {
|
|
455
|
-
|
|
455
|
+
bn.value = e, v("update:lineMode", e);
|
|
456
456
|
}
|
|
457
|
-
}),
|
|
457
|
+
}), C = f(null), w = f(null), Sn = f({
|
|
458
458
|
x: 0,
|
|
459
459
|
y: 0
|
|
460
|
-
}),
|
|
460
|
+
}), Cn = f(null), wn = null, Tn = !1, En = !1, T = f([]), E = f(/* @__PURE__ */ new Map()), D = f(/* @__PURE__ */ new Set()), O = t(() => {
|
|
461
461
|
let e = _.edges, t = [];
|
|
462
|
-
if (
|
|
462
|
+
if (T.value.length) {
|
|
463
463
|
let n = new Set(e.map((e) => e.id));
|
|
464
|
-
t =
|
|
464
|
+
t = T.value.filter((e) => !n.has(e.id));
|
|
465
465
|
}
|
|
466
|
-
let n = t.length ? [...e, ...t] : e, r =
|
|
466
|
+
let n = t.length ? [...e, ...t] : e, r = E.value;
|
|
467
467
|
r.size && (n = n.map((e) => r.has(e.id) ? {
|
|
468
468
|
...e,
|
|
469
469
|
...r.get(e.id)
|
|
470
470
|
} : e));
|
|
471
|
-
let i = new Set(
|
|
471
|
+
let i = new Set(x.value.map((e) => e.id)), a = D.value;
|
|
472
472
|
return n.filter((e) => !a.has(e.id) && i.has(e.from) && i.has(e.to));
|
|
473
|
-
}),
|
|
473
|
+
}), Dn = t(() => _.config.watchDataChanges === !0), On = f({
|
|
474
474
|
nodes: [],
|
|
475
475
|
edges: []
|
|
476
|
-
}),
|
|
477
|
-
nodes:
|
|
478
|
-
edges:
|
|
479
|
-
})),
|
|
476
|
+
}), kn = "", k = null, An = () => JSON.parse(JSON.stringify({
|
|
477
|
+
nodes: x.value,
|
|
478
|
+
edges: O.value
|
|
479
|
+
})), jn = (e, t) => {
|
|
480
480
|
let n = new Map(e.map((e) => [e.id, e])), r = new Map(t.map((e) => [e.id, e]));
|
|
481
481
|
return {
|
|
482
482
|
added: t.filter((e) => !n.has(e.id)).map((e) => e.id),
|
|
483
483
|
removed: e.filter((e) => !r.has(e.id)).map((e) => e.id),
|
|
484
484
|
updated: t.filter((e) => n.has(e.id) && JSON.stringify(n.get(e.id)) !== JSON.stringify(e)).map((e) => e.id)
|
|
485
485
|
};
|
|
486
|
-
},
|
|
487
|
-
nodes:
|
|
488
|
-
edges:
|
|
489
|
-
}),
|
|
490
|
-
if (
|
|
491
|
-
let e =
|
|
492
|
-
if (t ===
|
|
493
|
-
let n =
|
|
494
|
-
|
|
486
|
+
}, Mn = (e) => ({
|
|
487
|
+
nodes: jn(On.value.nodes, e.nodes),
|
|
488
|
+
edges: jn(On.value.edges, e.edges)
|
|
489
|
+
}), Nn = () => {
|
|
490
|
+
if (k = null, !Dn.value) return;
|
|
491
|
+
let e = An(), t = JSON.stringify(e);
|
|
492
|
+
if (t === kn) return;
|
|
493
|
+
let n = Mn(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;
|
|
494
|
+
kn = t, r && v("data-change", {
|
|
495
495
|
nodes: e.nodes,
|
|
496
496
|
edges: e.edges,
|
|
497
497
|
summary: n
|
|
498
498
|
});
|
|
499
|
+
}, Pn = () => {
|
|
500
|
+
Dn.value && (k && clearTimeout(k), k = setTimeout(Nn, 300));
|
|
499
501
|
}, Fn = () => {
|
|
500
|
-
|
|
501
|
-
}, In = () => {
|
|
502
|
-
O &&= (clearTimeout(O), null), kn.value = jn(), An = "";
|
|
502
|
+
k &&= (clearTimeout(k), null), On.value = An(), kn = "";
|
|
503
503
|
};
|
|
504
504
|
ne([
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
], () =>
|
|
510
|
-
e ?
|
|
505
|
+
x,
|
|
506
|
+
T,
|
|
507
|
+
D,
|
|
508
|
+
E
|
|
509
|
+
], () => Pn(), { deep: !0 }), ne(Dn, (e) => {
|
|
510
|
+
e ? Fn() : k &&= (clearTimeout(k), null);
|
|
511
511
|
}), u(() => {
|
|
512
|
-
|
|
512
|
+
Dn.value && Fn();
|
|
513
513
|
});
|
|
514
|
-
let
|
|
515
|
-
let e = new Set(
|
|
514
|
+
let In = () => An(), Ln = () => {
|
|
515
|
+
let e = new Set(R.value), t = new Set(z.value);
|
|
516
516
|
return {
|
|
517
517
|
nodeIds: e,
|
|
518
|
-
nodes:
|
|
519
|
-
edges:
|
|
518
|
+
nodes: x.value.filter((t) => e.has(t.id)),
|
|
519
|
+
edges: O.value.filter((n) => t.has(n.id) || e.has(n.from) || e.has(n.to))
|
|
520
520
|
};
|
|
521
|
-
},
|
|
522
|
-
let { nodeIds: e, nodes: t, edges: n } =
|
|
521
|
+
}, Rn = () => {
|
|
522
|
+
let { nodeIds: e, nodes: t, edges: n } = Ln();
|
|
523
523
|
return !t.length && !n.length ? {
|
|
524
524
|
nodes: [],
|
|
525
525
|
edges: []
|
|
526
|
-
} : (t.length && (
|
|
526
|
+
} : (t.length && (x.value = x.value.filter((t) => !e.has(t.id)), S()), n.length && (D.value = /* @__PURE__ */ new Set([...D.value, ...n.map((e) => e.id)]), T.value = T.value.filter((e) => !D.value.has(e.id)), v("edge-remove", n.map((e) => JSON.parse(JSON.stringify(e))))), R.value = [], z.value = [], v("node-select", null), v("edge-select", null), B(), JSON.parse(JSON.stringify({
|
|
527
527
|
nodes: t,
|
|
528
528
|
edges: n
|
|
529
529
|
})));
|
|
530
|
-
},
|
|
530
|
+
}, zn = (e) => {
|
|
531
531
|
let t = e.target;
|
|
532
532
|
if (!t || t === document.body) return !1;
|
|
533
533
|
let n = String(t.tagName || "").toLowerCase();
|
|
534
534
|
return n === "input" || n === "textarea" || n === "select" || t.isContentEditable;
|
|
535
|
-
},
|
|
536
|
-
let e =
|
|
535
|
+
}, Bn = o(), Vn = () => {
|
|
536
|
+
let e = Bn?.vnode?.props;
|
|
537
537
|
return !!e && "onDeleteRequest" in e;
|
|
538
|
-
},
|
|
539
|
-
let { nodes: e, edges: t } =
|
|
538
|
+
}, Hn = () => {
|
|
539
|
+
let { nodes: e, edges: t } = Ln();
|
|
540
540
|
v("delete-request", JSON.parse(JSON.stringify({
|
|
541
541
|
nodes: e,
|
|
542
542
|
edges: t
|
|
543
543
|
})));
|
|
544
|
-
},
|
|
545
|
-
e.key !== "Delete" && e.key !== "Backspace" || e.isComposing || e.ctrlKey || e.metaKey || e.altKey || _.config?.enableDeleteKey !== !1 && _.editable && (
|
|
544
|
+
}, Un = (e) => {
|
|
545
|
+
e.key !== "Delete" && e.key !== "Backspace" || e.isComposing || e.ctrlKey || e.metaKey || e.altKey || _.config?.enableDeleteKey !== !1 && _.editable && (zn(e) || (R.value.length || z.value.length) && (C.value || Y.value || X.value || (e.preventDefault(), Vn() ? Hn() : Rn())));
|
|
546
546
|
};
|
|
547
|
-
u(() => window.addEventListener("keydown",
|
|
548
|
-
let
|
|
549
|
-
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(
|
|
547
|
+
u(() => window.addEventListener("keydown", Un)), l(() => window.removeEventListener("keydown", Un));
|
|
548
|
+
let Wn = (e) => {
|
|
549
|
+
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(x.value.map((e) => e.id)), r = [];
|
|
550
550
|
for (let e of t) {
|
|
551
551
|
let t = JSON.parse(JSON.stringify(e));
|
|
552
552
|
if (t.id == null) t.id = oe();
|
|
553
553
|
else if (n.has(t.id)) continue;
|
|
554
554
|
n.add(t.id), r.push(t);
|
|
555
555
|
}
|
|
556
|
-
return r.length ? (
|
|
557
|
-
},
|
|
558
|
-
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(
|
|
556
|
+
return r.length ? (x.value = [...x.value, ...r], S(), JSON.parse(JSON.stringify(r))) : [];
|
|
557
|
+
}, Gn = (e) => {
|
|
558
|
+
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(O.value.map((e) => e.id)), r = [];
|
|
559
559
|
for (let e of t) {
|
|
560
560
|
let t = JSON.parse(JSON.stringify(e));
|
|
561
561
|
if (t.from != null && t.to != null) {
|
|
@@ -565,13 +565,13 @@ var y = {
|
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
if (!r.length) return [];
|
|
568
|
-
let i = r.filter((e) =>
|
|
568
|
+
let i = r.filter((e) => D.value.has(e.id));
|
|
569
569
|
if (i.length) {
|
|
570
570
|
let e = new Set(i.map((e) => e.id));
|
|
571
|
-
|
|
571
|
+
D.value = new Set([...D.value].filter((t) => !e.has(t)));
|
|
572
572
|
}
|
|
573
|
-
return
|
|
574
|
-
},
|
|
573
|
+
return T.value = [...T.value, ...r], r.forEach((e) => v("edge-create", JSON.parse(JSON.stringify(e)))), JSON.parse(JSON.stringify(r));
|
|
574
|
+
}, Kn = (e) => {
|
|
575
575
|
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && e.id != null);
|
|
576
576
|
if (!t.length) return [];
|
|
577
577
|
let n = /* @__PURE__ */ new Map();
|
|
@@ -584,7 +584,7 @@ var y = {
|
|
|
584
584
|
});
|
|
585
585
|
}
|
|
586
586
|
let r = [];
|
|
587
|
-
return
|
|
587
|
+
return x.value = x.value.map((e) => {
|
|
588
588
|
let t = n.get(e.id);
|
|
589
589
|
if (!t) return e;
|
|
590
590
|
let i = {
|
|
@@ -592,11 +592,11 @@ var y = {
|
|
|
592
592
|
...t
|
|
593
593
|
};
|
|
594
594
|
return r.push(i), i;
|
|
595
|
-
}), r.length ? (
|
|
596
|
-
},
|
|
595
|
+
}), r.length ? (S(), JSON.parse(JSON.stringify(r))) : [];
|
|
596
|
+
}, qn = (e) => {
|
|
597
597
|
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && e.id != null);
|
|
598
598
|
if (!t.length) return [];
|
|
599
|
-
let n = new Set(
|
|
599
|
+
let n = new Set(O.value.map((e) => e.id)), r = new Map(E.value), i = [];
|
|
600
600
|
for (let e of t) {
|
|
601
601
|
let { id: t, ...a } = e;
|
|
602
602
|
if (!n.has(t)) continue;
|
|
@@ -607,36 +607,36 @@ var y = {
|
|
|
607
607
|
...o
|
|
608
608
|
};
|
|
609
609
|
r.set(t, s);
|
|
610
|
-
let c =
|
|
610
|
+
let c = O.value.find((e) => e.id === t);
|
|
611
611
|
i.push({
|
|
612
612
|
...c,
|
|
613
613
|
...s
|
|
614
614
|
});
|
|
615
615
|
}
|
|
616
|
-
return i.length ? (
|
|
617
|
-
},
|
|
616
|
+
return i.length ? (E.value = r, v("edge-update", JSON.parse(JSON.stringify(i))), JSON.parse(JSON.stringify(i))) : [];
|
|
617
|
+
}, Jn = (e) => {
|
|
618
618
|
let t = e && typeof e == "object" ? e : null;
|
|
619
|
-
return
|
|
619
|
+
return T.value = [], D.value = /* @__PURE__ */ new Set(), E.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (x.value = JSON.parse(JSON.stringify(t.nodes)), S()) : (x.value = (Array.isArray(_.nodes) ? _.nodes : []).map((e) => ({ ...e })), yn = x.value), R.value = [], z.value = [], v("node-select", null), v("edge-select", null), B(), Fn(), An();
|
|
620
620
|
};
|
|
621
621
|
ne(() => _.edges, (e) => {
|
|
622
622
|
pn();
|
|
623
623
|
let t = Array.isArray(e) ? e : [], n = new Set(t.map((e) => e.id));
|
|
624
|
-
if (
|
|
625
|
-
let e =
|
|
626
|
-
e.length !==
|
|
624
|
+
if (T.value.length) {
|
|
625
|
+
let e = T.value.filter((e) => !n.has(e.id));
|
|
626
|
+
e.length !== T.value.length && (T.value = e);
|
|
627
627
|
}
|
|
628
|
-
if (
|
|
629
|
-
let e = new Map(
|
|
628
|
+
if (E.value.size) {
|
|
629
|
+
let e = new Map(E.value), n = new Set(T.value.map((e) => e.id)), r = !1;
|
|
630
630
|
for (let [i, a] of e) {
|
|
631
631
|
let o = t.find((e) => e.id === i);
|
|
632
632
|
o ? Object.entries(a).every(([e, t]) => JSON.stringify(o[e] ?? null) === JSON.stringify(t ?? null)) && (e.delete(i), r = !0) : n.has(i) || (e.delete(i), r = !0);
|
|
633
633
|
}
|
|
634
|
-
r && (
|
|
634
|
+
r && (E.value = e);
|
|
635
635
|
}
|
|
636
636
|
}, { deep: !0 });
|
|
637
|
-
let
|
|
637
|
+
let A = t(() => {
|
|
638
638
|
let e = {};
|
|
639
|
-
|
|
639
|
+
O.value.forEach((t) => {
|
|
640
640
|
let n = [t.from, t.to].sort().join("__");
|
|
641
641
|
e[n] || (e[n] = []), e[n].push(t);
|
|
642
642
|
});
|
|
@@ -672,48 +672,48 @@ var y = {
|
|
|
672
672
|
};
|
|
673
673
|
});
|
|
674
674
|
}), t;
|
|
675
|
-
}),
|
|
675
|
+
}), Yn = t(() => {
|
|
676
676
|
let e = /* @__PURE__ */ new Map();
|
|
677
|
-
for (let t of
|
|
677
|
+
for (let t of x.value) e.set(t.id, t);
|
|
678
678
|
return e;
|
|
679
|
-
}),
|
|
679
|
+
}), j = (e) => Yn.value.get(e), M = (e) => e.state != "none" && y[e.state] && y[e.state].color || "#00f0ff", Xn = (e) => y[e.state] || y.normal, Zn = (e) => e.nodeType === "text", Qn = (e) => e.nodeType === "border-only", N = (e) => e.nodeType === "region", $n = (e) => e.background || "#f60f60", er = (e) => e.borderStyle !== "none", tr = (e) => {
|
|
680
680
|
let t = Number(e.borderWidth);
|
|
681
681
|
return Number.isFinite(t) && t > 0 ? t : 1.5;
|
|
682
|
-
},
|
|
682
|
+
}, nr = (e, t) => {
|
|
683
683
|
let n = Number(e);
|
|
684
684
|
return Number.isFinite(n) && n > 0 ? n : t;
|
|
685
|
-
},
|
|
685
|
+
}, rr = t(() => nr(_.config?.baseIconWidth, 60)), ir = t(() => nr(_.config?.baseIconHeight, 60)), ar = [
|
|
686
686
|
"image",
|
|
687
687
|
"img",
|
|
688
688
|
"picture"
|
|
689
|
-
],
|
|
689
|
+
], or = (e) => {
|
|
690
690
|
if (!e) return "";
|
|
691
691
|
let t = e.image ?? e.src ?? e.img ?? e.imageUrl;
|
|
692
692
|
return typeof t == "string" && t.trim() ? t.trim() : "";
|
|
693
|
-
},
|
|
694
|
-
if (!e ||
|
|
695
|
-
|
|
693
|
+
}, sr = (e) => e ? ar.includes(String(e.nodeType ?? "").toLowerCase()) ? !0 : (_.config?.imageNodeBySource || !e.nodeType) && !!or(e) : !1, cr = t(() => _.config?.imageFit === "cover" ? "cover" : "contain"), lr = t(() => cr.value === "contain" ? "xMidYMid meet" : "xMidYMid slice"), ur = t(() => `${-rr.value / 2} ${-ir.value / 2} ${rr.value} ${ir.value}`), dr = /* @__PURE__ */ new Map(), fr = f(0), pr = (e) => {
|
|
694
|
+
if (!e || dr.has(e) || typeof Image > "u") return;
|
|
695
|
+
dr.set(e, null);
|
|
696
696
|
let t = new Image();
|
|
697
697
|
t.onload = () => {
|
|
698
|
-
|
|
698
|
+
dr.set(e, {
|
|
699
699
|
w: t.naturalWidth || 1,
|
|
700
700
|
h: t.naturalHeight || 1
|
|
701
|
-
}),
|
|
701
|
+
}), fr.value++;
|
|
702
702
|
}, t.onerror = () => {
|
|
703
|
-
|
|
703
|
+
dr.set(e, {
|
|
704
704
|
w: 1,
|
|
705
705
|
h: 1
|
|
706
|
-
}),
|
|
706
|
+
}), fr.value++;
|
|
707
707
|
}, t.src = e;
|
|
708
|
-
},
|
|
709
|
-
|
|
710
|
-
let t =
|
|
708
|
+
}, mr = (e) => {
|
|
709
|
+
fr.value;
|
|
710
|
+
let t = or(e), n = t ? dr.get(t) : null, { w: r, h: i } = F(e);
|
|
711
711
|
if (!n) return {
|
|
712
712
|
w: r,
|
|
713
713
|
h: i
|
|
714
714
|
};
|
|
715
|
-
let a = n.w, o = n.h, s, c =
|
|
716
|
-
if (
|
|
715
|
+
let a = n.w, o = n.h, s, c = rr.value, l = ir.value;
|
|
716
|
+
if (cr.value === "contain") s = Math.min(c / a, l / o);
|
|
717
717
|
else {
|
|
718
718
|
let e = Math.max(r / c, i / l);
|
|
719
719
|
s = Math.max(r / e / a, i / e / o);
|
|
@@ -724,28 +724,28 @@ var y = {
|
|
|
724
724
|
};
|
|
725
725
|
};
|
|
726
726
|
re(() => {
|
|
727
|
-
for (let e of
|
|
727
|
+
for (let e of x.value) sr(e) && pr(or(e));
|
|
728
728
|
});
|
|
729
|
-
let
|
|
729
|
+
let hr = (e, t) => {
|
|
730
730
|
let n = Number(e);
|
|
731
731
|
return Number.isFinite(n) && n > 0 ? n : t;
|
|
732
|
-
},
|
|
733
|
-
let t =
|
|
732
|
+
}, gr = (e) => {
|
|
733
|
+
let t = hr(e.width, rr.value), n = hr(e.height, ir.value);
|
|
734
734
|
return {
|
|
735
|
-
sx: t /
|
|
736
|
-
sy: n /
|
|
735
|
+
sx: t / rr.value,
|
|
736
|
+
sy: n / ir.value
|
|
737
737
|
};
|
|
738
|
-
},
|
|
739
|
-
let { w: t, h: n } =
|
|
738
|
+
}, _r = (e) => {
|
|
739
|
+
let { w: t, h: n } = F(e), r = Math.min(t, n) / 2;
|
|
740
740
|
return Number.isFinite(r) && r > 0 ? r : 30;
|
|
741
|
-
},
|
|
741
|
+
}, vr = [
|
|
742
742
|
"warning",
|
|
743
743
|
"error",
|
|
744
744
|
"master"
|
|
745
|
-
],
|
|
745
|
+
], yr = t(() => {
|
|
746
746
|
let e = _.config.alertStates;
|
|
747
|
-
return Array.isArray(e) && e.length ? e.map((e) => String(e)) :
|
|
748
|
-
}),
|
|
747
|
+
return Array.isArray(e) && e.length ? e.map((e) => String(e)) : vr;
|
|
748
|
+
}), br = (e) => !!e && e.state != null && yr.value.includes(String(e.state)), xr = {
|
|
749
749
|
warning: {
|
|
750
750
|
dur: 2.2,
|
|
751
751
|
scale: 1.5,
|
|
@@ -764,21 +764,21 @@ var y = {
|
|
|
764
764
|
opacity: .55,
|
|
765
765
|
ripple: !0
|
|
766
766
|
}
|
|
767
|
-
},
|
|
767
|
+
}, Sr = (e) => xr[e.state] || {
|
|
768
768
|
dur: 2,
|
|
769
769
|
scale: 1.6,
|
|
770
770
|
opacity: .4,
|
|
771
771
|
ripple: !1
|
|
772
|
-
},
|
|
772
|
+
}, Cr = (e, t = 1) => {
|
|
773
773
|
let n = String(e.id ?? ""), r = 0;
|
|
774
774
|
for (let e = 0; e < n.length; e++) r = (r * 31 + n.charCodeAt(e)) % 997;
|
|
775
|
-
return -(r / 997) *
|
|
776
|
-
},
|
|
775
|
+
return -(r / 997) * Sr(e).dur * t;
|
|
776
|
+
}, wr = [
|
|
777
777
|
"ring",
|
|
778
778
|
"fill",
|
|
779
779
|
"ripple",
|
|
780
780
|
"blink"
|
|
781
|
-
],
|
|
781
|
+
], Tr = t(() => wr.includes(_.config.alertStyle) ? _.config.alertStyle : "ring"), Er = (e) => wr.includes(e?.alertStyle) ? e.alertStyle : Tr.value, P = (e) => Number(Number(e).toFixed(2)), Dr = (e, t = .1) => `${P(e)};${P(e * t)};${P(e)}`, Or = [
|
|
782
782
|
{
|
|
783
783
|
offset: "0%",
|
|
784
784
|
opacity: 1
|
|
@@ -795,7 +795,7 @@ var y = {
|
|
|
795
795
|
offset: "100%",
|
|
796
796
|
opacity: 0
|
|
797
797
|
}
|
|
798
|
-
],
|
|
798
|
+
], kr = [
|
|
799
799
|
{
|
|
800
800
|
offset: "0%",
|
|
801
801
|
opacity: 0
|
|
@@ -816,42 +816,42 @@ var y = {
|
|
|
816
816
|
offset: "100%",
|
|
817
817
|
opacity: 0
|
|
818
818
|
}
|
|
819
|
-
],
|
|
819
|
+
], Ar = (e) => String(e).replace(/[^a-zA-Z0-9]/g, ""), jr = t(() => {
|
|
820
820
|
let e = /* @__PURE__ */ new Map();
|
|
821
821
|
for (let t of Object.values(y)) {
|
|
822
|
-
let n =
|
|
822
|
+
let n = Ar(t.color);
|
|
823
823
|
n && !e.has(n) && e.set(n, t.color);
|
|
824
824
|
}
|
|
825
825
|
let t = [];
|
|
826
826
|
for (let [n, r] of e) t.push({
|
|
827
827
|
id: `alert-fill-${n}`,
|
|
828
828
|
color: r,
|
|
829
|
-
stops:
|
|
829
|
+
stops: Or
|
|
830
830
|
}), t.push({
|
|
831
831
|
id: `alert-glow-${n}`,
|
|
832
832
|
color: r,
|
|
833
|
-
stops:
|
|
833
|
+
stops: kr
|
|
834
834
|
});
|
|
835
835
|
return t;
|
|
836
|
-
}),
|
|
837
|
-
if (!
|
|
838
|
-
let t =
|
|
836
|
+
}), Mr = t(() => _.config.alertGlow !== !1), Nr = (e) => {
|
|
837
|
+
if (!la.value || !br(e)) return [];
|
|
838
|
+
let t = Sr(e), n = Xn(e).color, r = P(_r(e)), i = t.dur, a = P(Cr(e)), o = Er(e);
|
|
839
839
|
if (o === "fill") {
|
|
840
|
-
let o =
|
|
840
|
+
let o = Ar(n), s = P(t.opacity * .55), c = r * (1 + (t.scale - 1) * .55), l = {
|
|
841
841
|
key: "fill",
|
|
842
842
|
r,
|
|
843
|
-
fill:
|
|
843
|
+
fill: Mr.value ? `url(#alert-fill-${o})` : n,
|
|
844
844
|
stroke: "none",
|
|
845
845
|
strokeWidth: 0,
|
|
846
846
|
opacity: s,
|
|
847
|
-
rValues: `${r};${
|
|
848
|
-
opacityValues:
|
|
847
|
+
rValues: `${r};${P(c)};${r}`,
|
|
848
|
+
opacityValues: Dr(s),
|
|
849
849
|
keyTimes: null,
|
|
850
|
-
dur: `${
|
|
850
|
+
dur: `${P(i)}s`,
|
|
851
851
|
begin: `${a}s`
|
|
852
852
|
};
|
|
853
|
-
if (!
|
|
854
|
-
let u =
|
|
853
|
+
if (!Mr.value) return [l];
|
|
854
|
+
let u = P(r * 1.04), d = P(c * 1.14), f = P(Math.min(.95, t.opacity * 1.6));
|
|
855
855
|
return [l, {
|
|
856
856
|
key: "fill-glow",
|
|
857
857
|
r: u,
|
|
@@ -860,10 +860,10 @@ var y = {
|
|
|
860
860
|
strokeWidth: 0,
|
|
861
861
|
opacity: f,
|
|
862
862
|
rValues: `${u};${d};${u}`,
|
|
863
|
-
opacityValues:
|
|
863
|
+
opacityValues: Dr(f),
|
|
864
864
|
keyTimes: null,
|
|
865
|
-
dur: `${
|
|
866
|
-
begin: `${
|
|
865
|
+
dur: `${P(i * 1.15)}s`,
|
|
866
|
+
begin: `${P(Cr(e, 1.15))}s`
|
|
867
867
|
}];
|
|
868
868
|
}
|
|
869
869
|
if (o === "ripple") {
|
|
@@ -873,7 +873,7 @@ var y = {
|
|
|
873
873
|
1,
|
|
874
874
|
2
|
|
875
875
|
].map((i) => {
|
|
876
|
-
let o =
|
|
876
|
+
let o = P(r * (.92 + i * .02)), s = P(t.opacity * (1 - i * .15));
|
|
877
877
|
return {
|
|
878
878
|
key: `ripple-${i}`,
|
|
879
879
|
r: o,
|
|
@@ -881,19 +881,19 @@ var y = {
|
|
|
881
881
|
stroke: n,
|
|
882
882
|
strokeWidth: 1.8,
|
|
883
883
|
opacity: s,
|
|
884
|
-
rValues: `${o};${
|
|
884
|
+
rValues: `${o};${P(r * t.scale)};${o}`,
|
|
885
885
|
opacityValues: `${s};0;${s}`,
|
|
886
886
|
keyTimes: null,
|
|
887
|
-
dur: `${
|
|
888
|
-
begin: `${
|
|
887
|
+
dur: `${P(e)}s`,
|
|
888
|
+
begin: `${P(a - e * i / 3)}s`
|
|
889
889
|
};
|
|
890
890
|
});
|
|
891
891
|
}
|
|
892
892
|
if (o === "blink") {
|
|
893
|
-
let e =
|
|
893
|
+
let e = P(Math.min(.9, t.opacity * 1.7)), o = Math.max(.8, i * .8);
|
|
894
894
|
return [{
|
|
895
895
|
key: "blink",
|
|
896
|
-
r:
|
|
896
|
+
r: P(r * 1.06),
|
|
897
897
|
fill: "none",
|
|
898
898
|
stroke: n,
|
|
899
899
|
strokeWidth: 3,
|
|
@@ -901,7 +901,7 @@ var y = {
|
|
|
901
901
|
rValues: null,
|
|
902
902
|
opacityValues: `${e};${e};0.04;${e};${e};0.04;${e}`,
|
|
903
903
|
keyTimes: "0;0.18;0.22;0.4;0.58;0.62;1",
|
|
904
|
-
dur: `${
|
|
904
|
+
dur: `${P(o)}s`,
|
|
905
905
|
begin: `${a}s`
|
|
906
906
|
}];
|
|
907
907
|
}
|
|
@@ -911,15 +911,15 @@ var y = {
|
|
|
911
911
|
fill: "none",
|
|
912
912
|
stroke: n,
|
|
913
913
|
strokeWidth: 2.5,
|
|
914
|
-
opacity:
|
|
915
|
-
rValues: `${r};${
|
|
916
|
-
opacityValues:
|
|
914
|
+
opacity: P(t.opacity),
|
|
915
|
+
rValues: `${r};${P(r * t.scale)};${r}`,
|
|
916
|
+
opacityValues: Dr(t.opacity),
|
|
917
917
|
keyTimes: null,
|
|
918
|
-
dur: `${
|
|
918
|
+
dur: `${P(i)}s`,
|
|
919
919
|
begin: `${a}s`
|
|
920
920
|
}];
|
|
921
921
|
if (t.ripple) {
|
|
922
|
-
let a =
|
|
922
|
+
let a = P(r * 1.12), o = P(t.opacity * .45);
|
|
923
923
|
s.push({
|
|
924
924
|
key: "ring-ripple",
|
|
925
925
|
r: a,
|
|
@@ -927,180 +927,189 @@ var y = {
|
|
|
927
927
|
stroke: n,
|
|
928
928
|
strokeWidth: 1.5,
|
|
929
929
|
opacity: o,
|
|
930
|
-
rValues: `${a};${
|
|
931
|
-
opacityValues:
|
|
930
|
+
rValues: `${a};${P(r * (t.scale - .12))};${a}`,
|
|
931
|
+
opacityValues: Dr(o),
|
|
932
932
|
keyTimes: null,
|
|
933
|
-
dur: `${
|
|
934
|
-
begin: `${
|
|
933
|
+
dur: `${P(i * 1.25)}s`,
|
|
934
|
+
begin: `${P(Cr(e, 1.25))}s`
|
|
935
935
|
});
|
|
936
936
|
}
|
|
937
937
|
return s;
|
|
938
|
-
},
|
|
939
|
-
let { sx: t, sy: n } =
|
|
938
|
+
}, Pr = t(() => x.value.filter((e) => br(e)).length), Fr = (e) => {
|
|
939
|
+
let { sx: t, sy: n } = gr(e);
|
|
940
940
|
return t === 1 && n === 1 ? "" : `scale(${t}, ${n})`;
|
|
941
|
-
},
|
|
942
|
-
let { w: t, h: n } =
|
|
941
|
+
}, Ir = (e) => {
|
|
942
|
+
let { w: t, h: n } = F(e), r = Math.min(10, t * .3), i = Math.min(10, n * .3);
|
|
943
943
|
return `translate(${t / 2 - r}, ${-(n / 2 - i)})`;
|
|
944
|
-
},
|
|
944
|
+
}, Lr = t(() => {
|
|
945
945
|
let e = Number(_.config.labelGap);
|
|
946
946
|
return Number.isFinite(e) && e >= 0 ? e : 18;
|
|
947
|
-
}),
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
947
|
+
}), Rr = [
|
|
948
|
+
"top",
|
|
949
|
+
"center",
|
|
950
|
+
"bottom"
|
|
951
|
+
], zr = (e) => {
|
|
952
|
+
let t = e?.labelPosition;
|
|
953
|
+
if (Rr.includes(t)) return t;
|
|
954
|
+
let n = _.config.nodeLabelPosition;
|
|
955
|
+
return Rr.includes(n) ? n : "bottom";
|
|
951
956
|
}, Br = (e) => {
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
957
|
+
if (Zn(e)) return 4;
|
|
958
|
+
let { h: t } = F(e), n = zr(e);
|
|
959
|
+
return n === "top" ? -(t / 2 + Lr.value) : n === "center" ? 0 : t / 2 + Lr.value;
|
|
960
|
+
}, Vr = (e) => {
|
|
961
|
+
let t = I(e);
|
|
962
|
+
if (Zn(e) || !e.label) return t;
|
|
963
|
+
let n = mn(e), r = Br(e), i = zr(e);
|
|
964
|
+
if (i === "top") {
|
|
956
965
|
let e = r - n - 4;
|
|
957
966
|
e < t.y && (t.height += t.y - e, t.y = e);
|
|
958
|
-
} else if (
|
|
967
|
+
} else if (i !== "center") {
|
|
959
968
|
let i = r + (String(e.label).split("\n").length - 1) * 1.2 * n + n + 4;
|
|
960
969
|
i > t.y + t.height && (t.height = i - t.y);
|
|
961
970
|
}
|
|
962
971
|
return t;
|
|
963
|
-
},
|
|
964
|
-
let t =
|
|
972
|
+
}, Hr = (e) => e.borderStyle !== "none" && (e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0), F = (e) => {
|
|
973
|
+
let t = Zn(e), n = Qn(e), r = N(e);
|
|
965
974
|
return {
|
|
966
|
-
w:
|
|
967
|
-
h:
|
|
975
|
+
w: hr(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : r ? 240 : n ? Math.max(80, String(e.label).length * 8 + 24) : rr.value),
|
|
976
|
+
h: hr(e.height, t ? 26 : r ? 160 : n ? 40 : ir.value)
|
|
968
977
|
};
|
|
969
|
-
},
|
|
970
|
-
let { w: t, h: n } =
|
|
978
|
+
}, I = (e) => {
|
|
979
|
+
let { w: t, h: n } = F(e);
|
|
971
980
|
return {
|
|
972
981
|
x: -t / 2,
|
|
973
982
|
y: -n / 2,
|
|
974
983
|
width: t,
|
|
975
984
|
height: n
|
|
976
985
|
};
|
|
977
|
-
},
|
|
978
|
-
t(() =>
|
|
979
|
-
let
|
|
986
|
+
}, L = (e) => N(e) ? null : Hr(e) ? I(e) : null, Ur = (e) => !N(e) && e.background && e.background !== "none" ? e.background : null, R = f([]), z = f([]);
|
|
987
|
+
t(() => R.value.length === 1 ? R.value[0] : null), t(() => z.value.length === 1 ? z.value[0] : null);
|
|
988
|
+
let Wr = (e) => R.value.includes(e.id), Gr = (e) => z.value.includes(e.id), B = () => {
|
|
980
989
|
v("selection-change", {
|
|
981
|
-
nodes:
|
|
982
|
-
edges:
|
|
990
|
+
nodes: x.value.filter((e) => R.value.includes(e.id)),
|
|
991
|
+
edges: O.value.filter((e) => z.value.includes(e.id))
|
|
983
992
|
});
|
|
984
|
-
},
|
|
993
|
+
}, Kr = (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, qr = t(() => Kr(_.config.maxSelectNodes)), Jr = t(() => Kr(_.config.maxSelectEdges)), V = (e, t, n) => {
|
|
985
994
|
let r = new Set(e), i = [];
|
|
986
995
|
for (let e of t) r.has(e) || (r.add(e), i.push(e));
|
|
987
996
|
if (n === Infinity) return [...e, ...i];
|
|
988
997
|
let a = Math.max(0, n - e.length);
|
|
989
998
|
return [...e, ...i.slice(0, a)];
|
|
990
999
|
};
|
|
991
|
-
ne([
|
|
1000
|
+
ne([qr, Jr], ([e, t]) => {
|
|
992
1001
|
let n = !1;
|
|
993
|
-
|
|
1002
|
+
R.value.length > e && (R.value = R.value.slice(0, e), n = !0), z.value.length > t && (z.value = z.value.slice(0, t), n = !0), n && B();
|
|
994
1003
|
});
|
|
995
|
-
let
|
|
996
|
-
if (!
|
|
1004
|
+
let Yr = t(() => _.config.selectedBorderColor || "#fbbf24"), Xr = t(() => _.config?.edgeLayer !== "below"), Zr = t(() => _.config?.highlightEdgeOnTop !== !1), Qr = (e, t) => {
|
|
1005
|
+
if (!ci()) {
|
|
997
1006
|
if (t && (t.ctrlKey || t.metaKey)) {
|
|
998
|
-
let t =
|
|
999
|
-
t >= 0 ?
|
|
1007
|
+
let t = R.value.indexOf(e.id);
|
|
1008
|
+
t >= 0 ? R.value.splice(t, 1) : R.value = V(R.value, [e.id], qr.value);
|
|
1000
1009
|
} else {
|
|
1001
|
-
let t =
|
|
1002
|
-
|
|
1010
|
+
let t = R.value.length === 1 && R.value[0] === e.id;
|
|
1011
|
+
R.value = t ? [] : V([], [e.id], qr.value), z.value = [];
|
|
1003
1012
|
}
|
|
1004
|
-
v("node-click", e), v("node-select",
|
|
1013
|
+
v("node-click", e), v("node-select", Wr(e) ? e : null), B();
|
|
1005
1014
|
}
|
|
1006
|
-
},
|
|
1007
|
-
let t =
|
|
1015
|
+
}, $r = (e) => {
|
|
1016
|
+
let t = x.value.find((t) => t.id === e);
|
|
1008
1017
|
if (!t || _.config.enableZOrder === !1) return !1;
|
|
1009
|
-
let n = t.zIndex ?? 0, r =
|
|
1018
|
+
let n = t.zIndex ?? 0, r = x.value.filter((e) => (e.zIndex ?? 0) > n);
|
|
1010
1019
|
return r.length !== 0 && (t.zIndex = Math.min(...r.map((e) => e.zIndex ?? 0)), !0);
|
|
1011
|
-
},
|
|
1012
|
-
let t =
|
|
1020
|
+
}, ei = (e) => {
|
|
1021
|
+
let t = x.value.find((t) => t.id === e);
|
|
1013
1022
|
if (!t || _.config.enableZOrder === !1) return !1;
|
|
1014
|
-
let n = t.zIndex ?? 0, r =
|
|
1023
|
+
let n = t.zIndex ?? 0, r = x.value.filter((e) => (e.zIndex ?? 0) < n);
|
|
1015
1024
|
return r.length !== 0 && (t.zIndex = Math.max(...r.map((e) => e.zIndex ?? 0)), !0);
|
|
1016
|
-
}, ei = (e) => {
|
|
1017
|
-
let t = b.value.find((t) => t.id === e);
|
|
1018
|
-
return !t || _.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.max(...b.value.map((e) => e.zIndex ?? 0), 0) + 1, !0);
|
|
1019
1025
|
}, ti = (e) => {
|
|
1020
|
-
let t =
|
|
1021
|
-
return !t || _.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.
|
|
1022
|
-
}, ni = () => {
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
+
let t = x.value.find((t) => t.id === e);
|
|
1027
|
+
return !t || _.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.max(...x.value.map((e) => e.zIndex ?? 0), 0) + 1, !0);
|
|
1028
|
+
}, ni = (e) => {
|
|
1029
|
+
let t = x.value.find((t) => t.id === e);
|
|
1030
|
+
return !t || _.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.min(...x.value.map((e) => e.zIndex ?? 0), 0) - 1, !0);
|
|
1031
|
+
}, ri = () => {
|
|
1032
|
+
if (!w.value) return;
|
|
1033
|
+
let e = w.value.cloneNode(!0);
|
|
1034
|
+
e.querySelectorAll("animate, animateMotion, animateTransform, set").forEach((e) => e.remove()), e.querySelectorAll(".center-crosshair").forEach((e) => e.remove()), e.setAttribute("width", H.value || "800"), e.setAttribute("height", U.value || "600");
|
|
1026
1035
|
let t = new XMLSerializer().serializeToString(e);
|
|
1027
1036
|
t = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + t;
|
|
1028
1037
|
let n = new Blob([t], { type: "image/svg+xml;charset=utf-8" }), r = URL.createObjectURL(n), i = document.createElement("a");
|
|
1029
1038
|
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);
|
|
1030
|
-
},
|
|
1031
|
-
if (
|
|
1032
|
-
let n =
|
|
1033
|
-
let t =
|
|
1039
|
+
}, ii = t(() => _.config.selectedLineColor || "#fbbf24"), ai = (e, t) => {
|
|
1040
|
+
if (ci()) return;
|
|
1041
|
+
let n = A.value[e.id], r = !!(n && n.merged && n.representative), i = r ? O.value.filter((e) => {
|
|
1042
|
+
let t = A.value[e.id];
|
|
1034
1043
|
return t && t.key === n.key;
|
|
1035
1044
|
}) : null, a = r ? i.map((e) => e.id) : [e.id], o = r ? {
|
|
1036
1045
|
...e,
|
|
1037
1046
|
bundleEdges: i
|
|
1038
1047
|
} : e;
|
|
1039
|
-
if (t && (t.ctrlKey || t.metaKey)) a.every((e) =>
|
|
1048
|
+
if (t && (t.ctrlKey || t.metaKey)) a.every((e) => z.value.includes(e)) ? z.value = z.value.filter((e) => !a.includes(e)) : z.value = V(z.value, a, Jr.value);
|
|
1040
1049
|
else {
|
|
1041
|
-
let e = a.length ===
|
|
1042
|
-
|
|
1050
|
+
let e = a.length === z.value.length && a.every((e) => z.value.includes(e));
|
|
1051
|
+
z.value = e ? [] : V([], a, Jr.value), R.value = [];
|
|
1043
1052
|
}
|
|
1044
|
-
v("edge-select",
|
|
1045
|
-
},
|
|
1046
|
-
|
|
1047
|
-
},
|
|
1048
|
-
|
|
1049
|
-
},
|
|
1050
|
-
if (
|
|
1053
|
+
v("edge-select", Gr(e) ? o : null), B();
|
|
1054
|
+
}, oi = 0, si = (e = 200) => {
|
|
1055
|
+
oi = performance.now() + e;
|
|
1056
|
+
}, ci = () => performance.now() < oi, li = () => {
|
|
1057
|
+
R.value = [], z.value = [], v("node-select", null), v("edge-select", null), B();
|
|
1058
|
+
}, ui = (e) => {
|
|
1059
|
+
if (ci()) return;
|
|
1051
1060
|
let t = e.target;
|
|
1052
|
-
t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) ||
|
|
1053
|
-
},
|
|
1061
|
+
t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) || li();
|
|
1062
|
+
}, di = f({
|
|
1054
1063
|
width: 1e3,
|
|
1055
1064
|
height: 650
|
|
1056
|
-
}),
|
|
1065
|
+
}), fi = f(1), pi = f(0), mi = f(0), hi = t(() => -_i.value / 2 + pi.value), gi = t(() => -vi.value / 2 + mi.value), _i = t(() => _.width ?? di.value.width), vi = t(() => _.height ?? di.value.height), yi = null;
|
|
1057
1066
|
u(() => {
|
|
1058
|
-
let e =
|
|
1067
|
+
let e = w.value;
|
|
1059
1068
|
if (e) {
|
|
1060
1069
|
let t = e.getBoundingClientRect();
|
|
1061
|
-
t.width > 0 && t.height > 0 && (
|
|
1070
|
+
t.width > 0 && t.height > 0 && (di.value = {
|
|
1062
1071
|
width: t.width,
|
|
1063
1072
|
height: t.height
|
|
1064
1073
|
});
|
|
1065
1074
|
}
|
|
1066
|
-
e && typeof ResizeObserver < "u" && (
|
|
1075
|
+
e && typeof ResizeObserver < "u" && (yi = new ResizeObserver(() => {
|
|
1067
1076
|
let t = e.getBoundingClientRect();
|
|
1068
|
-
t.width > 0 && t.height > 0 && (
|
|
1077
|
+
t.width > 0 && t.height > 0 && (di.value = {
|
|
1069
1078
|
width: t.width,
|
|
1070
1079
|
height: t.height
|
|
1071
1080
|
});
|
|
1072
|
-
}),
|
|
1081
|
+
}), yi.observe(e));
|
|
1073
1082
|
}), l(() => {
|
|
1074
|
-
|
|
1083
|
+
yi &&= (yi.disconnect(), null), ha &&= (cancelAnimationFrame(ha), 0), Fi &&= (cancelAnimationFrame(Fi), 0), za &&= (cancelAnimationFrame(za), 0), Ka(), Vi();
|
|
1075
1084
|
});
|
|
1076
|
-
let
|
|
1077
|
-
x0:
|
|
1078
|
-
y0:
|
|
1079
|
-
x1:
|
|
1080
|
-
y1:
|
|
1081
|
-
})),
|
|
1082
|
-
let e =
|
|
1083
|
-
let { w: n, h: r } =
|
|
1085
|
+
let H = t(() => _i.value / fi.value), U = t(() => vi.value / fi.value), bi = t(() => ({
|
|
1086
|
+
x0: hi.value - rn,
|
|
1087
|
+
y0: gi.value - rn,
|
|
1088
|
+
x1: hi.value + H.value + rn,
|
|
1089
|
+
y1: gi.value + U.value + rn
|
|
1090
|
+
})), xi = t(() => {
|
|
1091
|
+
let e = bi.value, t = x.value.filter((t) => {
|
|
1092
|
+
let { w: n, h: r } = F(t);
|
|
1084
1093
|
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;
|
|
1085
1094
|
});
|
|
1086
1095
|
return _.config.enableZOrder !== !1 && t.sort((e, t) => (e.zIndex ?? 0) - (t.zIndex ?? 0)), t;
|
|
1087
|
-
}),
|
|
1088
|
-
let e =
|
|
1089
|
-
return
|
|
1090
|
-
if (!
|
|
1091
|
-
let n =
|
|
1096
|
+
}), Si = t(() => xi.value.filter((e) => N(e))), Ci = t(() => xi.value.filter((e) => !N(e))), W = t(() => {
|
|
1097
|
+
let e = bi.value;
|
|
1098
|
+
return O.value.filter((t) => {
|
|
1099
|
+
if (!co(t)) return !1;
|
|
1100
|
+
let n = j(t.from), r = j(t.to);
|
|
1092
1101
|
if (!n || !r) return !1;
|
|
1093
|
-
let i =
|
|
1102
|
+
let i = F(n).w / 2, a = F(n).h / 2, o = F(r).w / 2, s = F(r).h / 2;
|
|
1094
1103
|
return Math.min(n.x - i, r.x - o) - an <= e.x1 && Math.max(n.x + i, r.x + o) + an >= e.x0 && Math.min(n.y - a, r.y - s) - an <= e.y1 && Math.max(n.y + a, r.y + s) + an >= e.y0;
|
|
1095
1104
|
});
|
|
1096
|
-
}),
|
|
1105
|
+
}), wi = (e) => {
|
|
1097
1106
|
if (_.config.enableZoom === !1) return;
|
|
1098
1107
|
e.preventDefault();
|
|
1099
|
-
let t =
|
|
1100
|
-
|
|
1101
|
-
},
|
|
1102
|
-
let t =
|
|
1103
|
-
|
|
1108
|
+
let t = w.value.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, i = n / t.width, a = r / t.height, o = H.value, s = U.value, c = e.deltaY > 0 ? .9 : 1.1, l = Math.min(nn, Math.max(tn, fi.value * c)), u = _i.value / l, d = vi.value / l;
|
|
1109
|
+
pi.value += (o - u) * i, mi.value += (s - d) * a, fi.value = l;
|
|
1110
|
+
}, G = f(null), K = f(null), Ti = (e) => {
|
|
1111
|
+
let t = w.value, n = t ? t.getBoundingClientRect() : null;
|
|
1112
|
+
G.value = {
|
|
1104
1113
|
startX: e.clientX,
|
|
1105
1114
|
startY: e.clientY,
|
|
1106
1115
|
lastX: e.clientX,
|
|
@@ -1108,9 +1117,9 @@ var y = {
|
|
|
1108
1117
|
moved: !1,
|
|
1109
1118
|
rectWidth: n && n.width ? n.width : 0,
|
|
1110
1119
|
rectHeight: n && n.height ? n.height : 0
|
|
1111
|
-
},
|
|
1112
|
-
},
|
|
1113
|
-
let t =
|
|
1120
|
+
}, Bi();
|
|
1121
|
+
}, Ei = (e) => {
|
|
1122
|
+
let t = G.value, n = w.value;
|
|
1114
1123
|
if (!t || !n) return;
|
|
1115
1124
|
let r = t.rectWidth, i = t.rectHeight;
|
|
1116
1125
|
if (!r || !i) return;
|
|
@@ -1120,13 +1129,13 @@ var y = {
|
|
|
1120
1129
|
return;
|
|
1121
1130
|
}
|
|
1122
1131
|
let a = e.clientX - t.lastX, o = e.clientY - t.lastY;
|
|
1123
|
-
t.lastX = e.clientX, t.lastY = e.clientY,
|
|
1124
|
-
},
|
|
1125
|
-
let e =
|
|
1126
|
-
|
|
1127
|
-
},
|
|
1128
|
-
let t =
|
|
1129
|
-
|
|
1132
|
+
t.lastX = e.clientX, t.lastY = e.clientY, pi.value -= a * (H.value / r), mi.value -= o * (U.value / i);
|
|
1133
|
+
}, Di = () => {
|
|
1134
|
+
let e = G.value;
|
|
1135
|
+
G.value = null, e && e.moved && si(), Hi();
|
|
1136
|
+
}, Oi = (e) => {
|
|
1137
|
+
let t = Z(e);
|
|
1138
|
+
K.value = {
|
|
1130
1139
|
start: {
|
|
1131
1140
|
x: t.x,
|
|
1132
1141
|
y: t.y
|
|
@@ -1138,17 +1147,17 @@ var y = {
|
|
|
1138
1147
|
startClientX: e.clientX,
|
|
1139
1148
|
startClientY: e.clientY,
|
|
1140
1149
|
moved: !1
|
|
1141
|
-
},
|
|
1142
|
-
},
|
|
1143
|
-
let t =
|
|
1150
|
+
}, Bi();
|
|
1151
|
+
}, ki = (e) => {
|
|
1152
|
+
let t = K.value;
|
|
1144
1153
|
if (!t) return;
|
|
1145
|
-
let n =
|
|
1154
|
+
let n = Z(e);
|
|
1146
1155
|
t.current = {
|
|
1147
1156
|
x: n.x,
|
|
1148
1157
|
y: n.y
|
|
1149
1158
|
}, !t.moved && Math.hypot(e.clientX - t.startClientX, e.clientY - t.startClientY) > 3 && (t.moved = !0);
|
|
1150
|
-
},
|
|
1151
|
-
let e =
|
|
1159
|
+
}, Ai = t(() => {
|
|
1160
|
+
let e = K.value;
|
|
1152
1161
|
return e ? {
|
|
1153
1162
|
x: Math.min(e.start.x, e.current.x),
|
|
1154
1163
|
y: Math.min(e.start.y, e.current.y),
|
|
@@ -1160,58 +1169,58 @@ var y = {
|
|
|
1160
1169
|
width: 0,
|
|
1161
1170
|
height: 0
|
|
1162
1171
|
};
|
|
1163
|
-
}),
|
|
1164
|
-
let e =
|
|
1165
|
-
if (
|
|
1172
|
+
}), ji = () => {
|
|
1173
|
+
let e = K.value;
|
|
1174
|
+
if (K.value = null, e && e.moved) {
|
|
1166
1175
|
let t = {
|
|
1167
1176
|
x: Math.min(e.start.x, e.current.x),
|
|
1168
1177
|
y: Math.min(e.start.y, e.current.y),
|
|
1169
1178
|
w: Math.abs(e.current.x - e.start.x),
|
|
1170
1179
|
h: Math.abs(e.current.y - e.start.y)
|
|
1171
|
-
}, n =
|
|
1172
|
-
let n =
|
|
1173
|
-
return r + n.width < t.x || r > t.x + t.w || i + n.height < t.y || i > t.y + t.h ? !1 : !
|
|
1180
|
+
}, n = x.value.filter((e) => {
|
|
1181
|
+
let n = I(e), r = e.x + n.x, i = e.y + n.y;
|
|
1182
|
+
return r + n.width < t.x || r > t.x + t.w || i + n.height < t.y || i > t.y + t.h ? !1 : !N(e) || r >= t.x && i >= t.y && r + n.width <= t.x + t.w && i + n.height <= t.y + t.h;
|
|
1174
1183
|
});
|
|
1175
|
-
n.length && (
|
|
1184
|
+
n.length && (R.value = V(R.value, n.map((e) => e.id), qr.value), B()), si();
|
|
1176
1185
|
}
|
|
1177
|
-
|
|
1178
|
-
},
|
|
1179
|
-
if (
|
|
1186
|
+
Hi();
|
|
1187
|
+
}, Mi = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), Ni = (e) => {
|
|
1188
|
+
if (w.value) {
|
|
1180
1189
|
if (e.button === 1) {
|
|
1181
1190
|
if (_.config.enablePan === !1) return;
|
|
1182
|
-
e.preventDefault(),
|
|
1183
|
-
} else if (e.button === 0 && !
|
|
1191
|
+
e.preventDefault(), Ti(e);
|
|
1192
|
+
} else if (e.button === 0 && !Mi(e.target)) {
|
|
1184
1193
|
if (e.ctrlKey || e.metaKey) {
|
|
1185
1194
|
if (_.config.enableMarquee === !1) return;
|
|
1186
|
-
e.preventDefault(),
|
|
1187
|
-
} else _.config.enablePan !== !1 && (e.preventDefault(),
|
|
1195
|
+
e.preventDefault(), Oi(e);
|
|
1196
|
+
} else _.config.enablePan !== !1 && (e.preventDefault(), Ti(e));
|
|
1188
1197
|
}
|
|
1189
1198
|
}
|
|
1190
|
-
},
|
|
1191
|
-
|
|
1192
|
-
let e =
|
|
1193
|
-
|
|
1194
|
-
},
|
|
1195
|
-
|
|
1196
|
-
}, Ri = () => {
|
|
1197
|
-
Pi && (cancelAnimationFrame(Pi), Ii()), W.value && Ei(), G.value && Ai();
|
|
1199
|
+
}, Pi = !1, Fi = 0, Ii = null, Li = () => {
|
|
1200
|
+
Fi = 0;
|
|
1201
|
+
let e = Ii;
|
|
1202
|
+
Ii = null, e && (G.value ? Ei(e) : K.value && ki(e));
|
|
1203
|
+
}, Ri = (e) => {
|
|
1204
|
+
Ii = e, Fi ||= requestAnimationFrame(Li);
|
|
1198
1205
|
}, zi = () => {
|
|
1199
|
-
|
|
1206
|
+
Fi && (cancelAnimationFrame(Fi), Li()), G.value && Di(), K.value && ji();
|
|
1200
1207
|
}, Bi = () => {
|
|
1201
|
-
|
|
1208
|
+
Pi || (Pi = !0, window.addEventListener("mousemove", Ri, !0), window.addEventListener("mouseup", zi, !0));
|
|
1202
1209
|
}, Vi = () => {
|
|
1203
|
-
!
|
|
1204
|
-
}, Hi =
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
if (
|
|
1208
|
-
|
|
1210
|
+
Pi && (Pi = !1, window.removeEventListener("mousemove", Ri, !0), window.removeEventListener("mouseup", zi, !0));
|
|
1211
|
+
}, Hi = () => {
|
|
1212
|
+
!G.value && !K.value && Vi();
|
|
1213
|
+
}, Ui = t(() => {
|
|
1214
|
+
if (Y.value && Y.value.side) return { cursor: ka(Y.value.side) };
|
|
1215
|
+
if (K.value) return { cursor: "crosshair" };
|
|
1216
|
+
if (G.value && G.value.moved) return { cursor: "grabbing" };
|
|
1217
|
+
}), Wi = t(() => _.config.showGrid !== !1), Gi = t(() => _.config.gridColor || "#1a2240"), Ki = t(() => {
|
|
1209
1218
|
let e = Number(_.config.gridStep);
|
|
1210
|
-
return (Number.isFinite(e) && e > 0 ? e : 40) /
|
|
1211
|
-
}),
|
|
1219
|
+
return (Number.isFinite(e) && e > 0 ? e : 40) / fi.value;
|
|
1220
|
+
}), qi = t(() => {
|
|
1212
1221
|
let e = Number(_.config.gridOpacity);
|
|
1213
1222
|
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .5;
|
|
1214
|
-
}),
|
|
1223
|
+
}), Ji = t(() => {
|
|
1215
1224
|
let e = _.config.radialGradient && typeof _.config.radialGradient == "object" ? _.config.radialGradient : {}, t = Array.isArray(e.stops) && e.stops.length ? e.stops.filter((e) => e && e.color).map((e, t) => ({
|
|
1216
1225
|
offset: e.offset == null ? t === 0 ? "0%" : "100%" : e.offset,
|
|
1217
1226
|
color: e.color,
|
|
@@ -1231,113 +1240,113 @@ var y = {
|
|
|
1231
1240
|
r: e.r || "60%",
|
|
1232
1241
|
stops: n
|
|
1233
1242
|
};
|
|
1234
|
-
}),
|
|
1243
|
+
}), Yi = t(() => _.config.showCenterPoint === !0), Xi = t(() => _.config.showEdgeTextBg === !0), Zi = t(() => _.config.edgeTextBgColor || "#0a0e1a"), Qi = t(() => {
|
|
1235
1244
|
let e = Number(_.config.edgeTextBgOpacity);
|
|
1236
1245
|
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .92;
|
|
1237
|
-
}),
|
|
1246
|
+
}), $i = t(() => _.config.edgeColor || _.config.defaultEdgeColor || null), ea = t(() => _.config.edgeBaseColor || null), ta = (e) => e.baseColor ? e.baseColor : ea.value ? ea.value : e.color || $i.value ? Q(e) : "#1a2744", na = (e) => {
|
|
1238
1247
|
let t = e.baseDimOpacity ?? _.config.edgeBaseDimOpacity;
|
|
1239
1248
|
if (t != null) {
|
|
1240
1249
|
let e = Number(t);
|
|
1241
1250
|
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : 1;
|
|
1242
1251
|
}
|
|
1243
|
-
return
|
|
1244
|
-
},
|
|
1252
|
+
return sa.value === "none" || ua(e) === "none" ? 1 : .45;
|
|
1253
|
+
}, ra = t(() => _.config.edgeCenterTextColor || null), ia = t(() => _.config.showNodeHandles === !0), aa = t(() => _.config.showStatusDot !== !1), oa = (e, t) => {
|
|
1245
1254
|
let n = Number(e);
|
|
1246
1255
|
return Number.isFinite(n) && n >= 0 ? n : t;
|
|
1247
|
-
},
|
|
1256
|
+
}, sa = t(() => {
|
|
1248
1257
|
let e = _.config.motionFx ?? _.config.fx;
|
|
1249
1258
|
return typeof e == "boolean" ? e ? "all" : "none" : [
|
|
1250
1259
|
"none",
|
|
1251
1260
|
"flow",
|
|
1252
1261
|
"particle",
|
|
1253
1262
|
"all"
|
|
1254
|
-
].includes(e) ? e :
|
|
1255
|
-
}), sa = t(() => {
|
|
1256
|
-
let e = _.config.glowFx ?? _.config.fx;
|
|
1257
|
-
return typeof e == "boolean" ? e : D.value.length <= aa(_.config.fxGlowMaxEdges, 500);
|
|
1263
|
+
].includes(e) ? e : O.value.length <= oa(_.config.fxMotionMaxEdges, 200) ? "all" : "none";
|
|
1258
1264
|
}), ca = t(() => {
|
|
1265
|
+
let e = _.config.glowFx ?? _.config.fx;
|
|
1266
|
+
return typeof e == "boolean" ? e : O.value.length <= oa(_.config.fxGlowMaxEdges, 500);
|
|
1267
|
+
}), la = t(() => {
|
|
1259
1268
|
let e = _.config.breatheFx ?? _.config.fx;
|
|
1260
|
-
return typeof e == "boolean" ? e :
|
|
1261
|
-
}),
|
|
1269
|
+
return typeof e == "boolean" ? e : Pr.value <= oa(_.config.fxAlertMaxNodes, 300);
|
|
1270
|
+
}), ua = (e) => {
|
|
1262
1271
|
if (e.animatedMode !== void 0) {
|
|
1263
1272
|
let t = e.animatedMode;
|
|
1264
|
-
return !t || t === "all" ?
|
|
1273
|
+
return !t || t === "all" ? sa.value : t === "none" ? "none" : t;
|
|
1265
1274
|
}
|
|
1266
|
-
return e.animated === void 0 || e.animated ?
|
|
1267
|
-
},
|
|
1275
|
+
return e.animated === void 0 || e.animated ? sa.value : "none";
|
|
1276
|
+
}, da = (e) => e.borderColor || M(e) || "#94a3b8", fa = (e) => e.borderWidth || 0, pa = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, q = (e) => {
|
|
1268
1277
|
let t = e.borderRadius;
|
|
1269
|
-
if (t == null || t === "") return
|
|
1278
|
+
if (t == null || t === "") return N(e) ? 16 : 6;
|
|
1270
1279
|
let n = Number(t);
|
|
1271
|
-
return !Number.isFinite(n) || n < 0 ?
|
|
1272
|
-
},
|
|
1280
|
+
return !Number.isFinite(n) || n < 0 ? N(e) ? 16 : 6 : n;
|
|
1281
|
+
}, ma = (e, t) => {
|
|
1273
1282
|
if (e.button !== 0 || !_.editable || _.config.nodeDraggable === !1) return;
|
|
1274
1283
|
e.stopPropagation();
|
|
1275
|
-
let n =
|
|
1276
|
-
if (
|
|
1284
|
+
let n = j(t), r = Z(e);
|
|
1285
|
+
if (Sn.value = {
|
|
1277
1286
|
x: r.x - n.x,
|
|
1278
1287
|
y: r.y - n.y
|
|
1279
|
-
},
|
|
1288
|
+
}, wn = {
|
|
1280
1289
|
x: e.clientX,
|
|
1281
1290
|
y: e.clientY
|
|
1282
|
-
},
|
|
1291
|
+
}, Tn = !1, En = !!(e.ctrlKey || e.metaKey), R.value.length > 1 && R.value.includes(t)) {
|
|
1283
1292
|
let e = {};
|
|
1284
|
-
|
|
1285
|
-
let n =
|
|
1286
|
-
n && !
|
|
1293
|
+
R.value.forEach((t) => {
|
|
1294
|
+
let n = j(t);
|
|
1295
|
+
n && !N(n) && (e[t] = {
|
|
1287
1296
|
x: n.x,
|
|
1288
1297
|
y: n.y
|
|
1289
1298
|
});
|
|
1290
|
-
}),
|
|
1299
|
+
}), Cn.value = {
|
|
1291
1300
|
origins: e,
|
|
1292
1301
|
start: {
|
|
1293
1302
|
x: r.x,
|
|
1294
1303
|
y: r.y
|
|
1295
1304
|
}
|
|
1296
1305
|
};
|
|
1297
|
-
} else
|
|
1298
|
-
|
|
1299
|
-
},
|
|
1300
|
-
|
|
1301
|
-
let e =
|
|
1302
|
-
|
|
1303
|
-
},
|
|
1304
|
-
(
|
|
1306
|
+
} else Cn.value = null;
|
|
1307
|
+
C.value = t, v("node-drag-start", n);
|
|
1308
|
+
}, ha = 0, ga = null, _a = () => {
|
|
1309
|
+
ha = 0;
|
|
1310
|
+
let e = ga;
|
|
1311
|
+
ga = null, e && ya(e);
|
|
1312
|
+
}, va = (e) => {
|
|
1313
|
+
(Y.value || C.value || J.value) && (ga = {
|
|
1305
1314
|
clientX: e.clientX,
|
|
1306
1315
|
clientY: e.clientY
|
|
1307
|
-
},
|
|
1308
|
-
},
|
|
1309
|
-
if (
|
|
1310
|
-
|
|
1316
|
+
}, ha ||= requestAnimationFrame(_a));
|
|
1317
|
+
}, ya = (e) => {
|
|
1318
|
+
if (J.value) {
|
|
1319
|
+
wa(e);
|
|
1311
1320
|
return;
|
|
1312
1321
|
}
|
|
1313
|
-
if (
|
|
1314
|
-
|
|
1322
|
+
if (Y.value) {
|
|
1323
|
+
ja(e);
|
|
1315
1324
|
return;
|
|
1316
1325
|
}
|
|
1317
|
-
if (!
|
|
1318
|
-
let t =
|
|
1319
|
-
!
|
|
1320
|
-
let n =
|
|
1326
|
+
if (!C.value) return;
|
|
1327
|
+
let t = Z(e);
|
|
1328
|
+
!Tn && wn && Math.hypot(e.clientX - wn.x, e.clientY - wn.y) > en && (Tn = !0, !En && !R.value.includes(C.value) && (R.value = V([], [C.value], qr.value), z.value = [], v("node-select", R.value.includes(C.value) ? j(C.value) : null), B()));
|
|
1329
|
+
let n = Cn.value;
|
|
1321
1330
|
if (n) {
|
|
1322
1331
|
let e = t.x - n.start.x, r = t.y - n.start.y;
|
|
1323
|
-
|
|
1332
|
+
x.value = x.value.map((t) => n.origins[t.id] ? {
|
|
1324
1333
|
...t,
|
|
1325
1334
|
x: n.origins[t.id].x + e,
|
|
1326
1335
|
y: n.origins[t.id].y + r
|
|
1327
1336
|
} : t);
|
|
1328
|
-
} else
|
|
1337
|
+
} else x.value = x.value.map((e) => e.id === C.value ? {
|
|
1329
1338
|
...e,
|
|
1330
|
-
x: t.x -
|
|
1331
|
-
y: t.y -
|
|
1339
|
+
x: t.x - Sn.value.x,
|
|
1340
|
+
y: t.y - Sn.value.y
|
|
1332
1341
|
} : e);
|
|
1333
|
-
|
|
1334
|
-
},
|
|
1335
|
-
|
|
1336
|
-
},
|
|
1337
|
-
if (e.button !== 0 || e.ctrlKey || e.metaKey || !
|
|
1342
|
+
S();
|
|
1343
|
+
}, ba = () => {
|
|
1344
|
+
ha && (cancelAnimationFrame(ha), _a()), J.value ? Ta() : Y.value ? Ma() : C.value && (Tn && si(), C.value = null, Cn.value = null, wn = null, Tn = !1, v("node-drag-end"));
|
|
1345
|
+
}, J = f(null), xa = t(() => _.editable && _.config.regionDraggable !== !1), Sa = t(() => _.config.regionHitArea === "border" ? "border" : "box"), Ca = (e, t) => {
|
|
1346
|
+
if (e.button !== 0 || e.ctrlKey || e.metaKey || !xa.value) return;
|
|
1338
1347
|
e.stopPropagation(), e.preventDefault();
|
|
1339
|
-
let n =
|
|
1340
|
-
|
|
1348
|
+
let n = Z(e);
|
|
1349
|
+
J.value = {
|
|
1341
1350
|
id: t.id,
|
|
1342
1351
|
offset: {
|
|
1343
1352
|
x: n.x - t.x,
|
|
@@ -1349,26 +1358,26 @@ var y = {
|
|
|
1349
1358
|
},
|
|
1350
1359
|
moved: !1
|
|
1351
1360
|
}, v("node-drag-start", t);
|
|
1352
|
-
},
|
|
1353
|
-
let t =
|
|
1361
|
+
}, wa = (e) => {
|
|
1362
|
+
let t = J.value;
|
|
1354
1363
|
if (!t) return;
|
|
1355
1364
|
if (!t.moved) {
|
|
1356
1365
|
if (Math.hypot(e.clientX - t.startClient.x, e.clientY - t.startClient.y) <= en) return;
|
|
1357
|
-
t.moved = !0,
|
|
1366
|
+
t.moved = !0, R.value.includes(t.id) || (R.value = V([], [t.id], qr.value), z.value = [], v("node-select", j(t.id) || null), B());
|
|
1358
1367
|
}
|
|
1359
|
-
let n =
|
|
1360
|
-
|
|
1368
|
+
let n = Z(e);
|
|
1369
|
+
x.value = x.value.map((e) => e.id === t.id ? {
|
|
1361
1370
|
...e,
|
|
1362
1371
|
x: n.x - t.offset.x,
|
|
1363
1372
|
y: n.y - t.offset.y
|
|
1364
|
-
} : e),
|
|
1365
|
-
},
|
|
1366
|
-
let e =
|
|
1367
|
-
|
|
1368
|
-
},
|
|
1369
|
-
|
|
1370
|
-
},
|
|
1371
|
-
let t =
|
|
1373
|
+
} : e), S();
|
|
1374
|
+
}, Ta = () => {
|
|
1375
|
+
let e = J.value;
|
|
1376
|
+
J.value = null, e && (e.moved && si(), v("node-drag-end", j(e.id) || null));
|
|
1377
|
+
}, Ea = (e, t) => {
|
|
1378
|
+
ci() || Qr(e, t);
|
|
1379
|
+
}, Y = f(null), Da = (e, t, n) => Math.min(n, Math.max(t, e)), Oa = (e) => {
|
|
1380
|
+
let t = I(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
|
|
1372
1381
|
return [
|
|
1373
1382
|
{
|
|
1374
1383
|
side: "nw",
|
|
@@ -1411,10 +1420,10 @@ var y = {
|
|
|
1411
1420
|
y: 0
|
|
1412
1421
|
}
|
|
1413
1422
|
];
|
|
1414
|
-
},
|
|
1423
|
+
}, ka = (e) => e === "nw" || e === "se" ? "nwse-resize" : e === "ne" || e === "sw" ? "nesw-resize" : e === "n" || e === "s" ? "ns-resize" : "ew-resize", Aa = (e, t, n) => {
|
|
1415
1424
|
if (!_.editable || _.config.nodeResizable === !1 || !t) return;
|
|
1416
|
-
let { w: r, h: i } =
|
|
1417
|
-
|
|
1425
|
+
let { w: r, h: i } = F(t);
|
|
1426
|
+
Y.value = {
|
|
1418
1427
|
id: t.id,
|
|
1419
1428
|
side: n,
|
|
1420
1429
|
anchorX: n.includes("e") ? t.x - r / 2 : n.includes("w") ? t.x + r / 2 : null,
|
|
@@ -1422,36 +1431,36 @@ var y = {
|
|
|
1422
1431
|
startW: r,
|
|
1423
1432
|
startH: i
|
|
1424
1433
|
}, v("node-resize-start", t);
|
|
1425
|
-
},
|
|
1426
|
-
let t =
|
|
1434
|
+
}, ja = (e) => {
|
|
1435
|
+
let t = Y.value;
|
|
1427
1436
|
if (!t) return;
|
|
1428
|
-
let n =
|
|
1437
|
+
let n = j(t.id);
|
|
1429
1438
|
if (!n) return;
|
|
1430
|
-
let r =
|
|
1439
|
+
let r = Z(e), i = t.startW, a = t.startH, o = n.x, s = n.y;
|
|
1431
1440
|
if (t.anchorX !== null) {
|
|
1432
1441
|
let e = t.side.includes("e");
|
|
1433
|
-
i =
|
|
1442
|
+
i = Da(e ? r.x - t.anchorX : t.anchorX - r.x, on, sn), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
|
|
1434
1443
|
}
|
|
1435
1444
|
if (t.anchorY !== null) {
|
|
1436
1445
|
let e = t.side.includes("s");
|
|
1437
|
-
a =
|
|
1446
|
+
a = Da(e ? r.y - t.anchorY : t.anchorY - r.y, cn, ln), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
|
|
1438
1447
|
}
|
|
1439
|
-
|
|
1448
|
+
x.value = x.value.map((e) => e.id === t.id ? {
|
|
1440
1449
|
...e,
|
|
1441
1450
|
x: o,
|
|
1442
1451
|
y: s,
|
|
1443
1452
|
width: i,
|
|
1444
1453
|
height: a
|
|
1445
|
-
} : e),
|
|
1446
|
-
},
|
|
1447
|
-
let e =
|
|
1448
|
-
|
|
1449
|
-
},
|
|
1450
|
-
if (!
|
|
1451
|
-
let e =
|
|
1452
|
-
return e.length === 1 &&
|
|
1453
|
-
}),
|
|
1454
|
-
let t =
|
|
1454
|
+
} : e), S();
|
|
1455
|
+
}, Ma = () => {
|
|
1456
|
+
let e = Y.value;
|
|
1457
|
+
Y.value = null, e && (si(), v("node-resize-end", j(e.id) || null));
|
|
1458
|
+
}, Na = t(() => _.editable && _.config.nodeResizable !== !1), Pa = t(() => {
|
|
1459
|
+
if (!Na.value) return null;
|
|
1460
|
+
let e = R.value;
|
|
1461
|
+
return e.length === 1 && j(e[0]) || null;
|
|
1462
|
+
}), X = f(null), Fa = (e) => {
|
|
1463
|
+
let t = I(e);
|
|
1455
1464
|
return [
|
|
1456
1465
|
{
|
|
1457
1466
|
side: "top",
|
|
@@ -1474,8 +1483,8 @@ var y = {
|
|
|
1474
1483
|
y: 0
|
|
1475
1484
|
}
|
|
1476
1485
|
];
|
|
1477
|
-
},
|
|
1478
|
-
let n =
|
|
1486
|
+
}, Ia = (e, t) => {
|
|
1487
|
+
let n = w.value;
|
|
1479
1488
|
if (!n) return null;
|
|
1480
1489
|
let r = e, i = t;
|
|
1481
1490
|
if (e && typeof e == "object" && (r = e.clientX, i = e.clientY), r == null || i == null) return null;
|
|
@@ -1488,8 +1497,8 @@ var y = {
|
|
|
1488
1497
|
x: s.x,
|
|
1489
1498
|
y: s.y
|
|
1490
1499
|
};
|
|
1491
|
-
},
|
|
1492
|
-
let n =
|
|
1500
|
+
}, La = (e, t) => {
|
|
1501
|
+
let n = w.value;
|
|
1493
1502
|
if (!n) return null;
|
|
1494
1503
|
let r = n.createSVGPoint();
|
|
1495
1504
|
r.x = Number(e) || 0, r.y = Number(t) || 0;
|
|
@@ -1500,14 +1509,14 @@ var y = {
|
|
|
1500
1509
|
x: a.x,
|
|
1501
1510
|
y: a.y
|
|
1502
1511
|
};
|
|
1503
|
-
},
|
|
1512
|
+
}, Z = (e) => Ia(e) ?? {
|
|
1504
1513
|
x: 0,
|
|
1505
1514
|
y: 0
|
|
1506
|
-
},
|
|
1507
|
-
let r =
|
|
1508
|
-
if (!r || !
|
|
1509
|
-
let i =
|
|
1510
|
-
|
|
1515
|
+
}, Ra = (e, t, n) => {
|
|
1516
|
+
let r = j(t);
|
|
1517
|
+
if (!r || !w.value) return;
|
|
1518
|
+
let i = Z(e);
|
|
1519
|
+
X.value = {
|
|
1511
1520
|
fromId: t,
|
|
1512
1521
|
side: n.side,
|
|
1513
1522
|
ax: r.x + n.x,
|
|
@@ -1519,42 +1528,42 @@ var y = {
|
|
|
1519
1528
|
try {
|
|
1520
1529
|
e.target.setPointerCapture?.(e.pointerId);
|
|
1521
1530
|
} catch {}
|
|
1522
|
-
|
|
1523
|
-
},
|
|
1524
|
-
|
|
1525
|
-
let e =
|
|
1526
|
-
|
|
1527
|
-
},
|
|
1528
|
-
|
|
1531
|
+
Ga();
|
|
1532
|
+
}, za = 0, Ba = null, Va = () => {
|
|
1533
|
+
za = 0;
|
|
1534
|
+
let e = Ba;
|
|
1535
|
+
Ba = null, e && X.value && Ja(e);
|
|
1536
|
+
}, Ha = (e) => {
|
|
1537
|
+
X.value && (Ba = {
|
|
1529
1538
|
clientX: e.clientX,
|
|
1530
1539
|
clientY: e.clientY
|
|
1531
|
-
},
|
|
1532
|
-
},
|
|
1533
|
-
|
|
1534
|
-
},
|
|
1535
|
-
|
|
1536
|
-
},
|
|
1537
|
-
|
|
1538
|
-
},
|
|
1539
|
-
let r =
|
|
1540
|
+
}, za ||= requestAnimationFrame(Va));
|
|
1541
|
+
}, Ua = () => {
|
|
1542
|
+
za && (cancelAnimationFrame(za), Va()), X.value && Ya();
|
|
1543
|
+
}, Wa = !1, Ga = () => {
|
|
1544
|
+
Wa || (Wa = !0, window.addEventListener("mousemove", Ha, !0), window.addEventListener("mouseup", Ua, !0));
|
|
1545
|
+
}, Ka = () => {
|
|
1546
|
+
Wa && (Wa = !1, window.removeEventListener("mousemove", Ha, !0), window.removeEventListener("mouseup", Ua, !0));
|
|
1547
|
+
}, qa = (e, t, n) => {
|
|
1548
|
+
let r = x.value;
|
|
1540
1549
|
for (let i = r.length - 1; i >= 0; i--) {
|
|
1541
1550
|
let a = r[i];
|
|
1542
1551
|
if (a.id === n) continue;
|
|
1543
|
-
let o =
|
|
1552
|
+
let o = I(a);
|
|
1544
1553
|
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;
|
|
1545
1554
|
}
|
|
1546
1555
|
return null;
|
|
1547
|
-
},
|
|
1548
|
-
let t =
|
|
1556
|
+
}, Ja = (e) => {
|
|
1557
|
+
let t = X.value;
|
|
1549
1558
|
if (!t) return;
|
|
1550
|
-
let n =
|
|
1559
|
+
let n = Z(e);
|
|
1551
1560
|
t.px = n.x, t.py = n.y;
|
|
1552
|
-
let r =
|
|
1561
|
+
let r = qa(n.x, n.y, t.fromId);
|
|
1553
1562
|
t.overId = r ? r.id : null;
|
|
1554
|
-
},
|
|
1555
|
-
|
|
1556
|
-
let e =
|
|
1557
|
-
if (
|
|
1563
|
+
}, Ya = () => {
|
|
1564
|
+
Ka();
|
|
1565
|
+
let e = X.value;
|
|
1566
|
+
if (X.value = null, !e || !e.overId || e.overId === e.fromId) return;
|
|
1558
1567
|
let t = {
|
|
1559
1568
|
id: `${oe()}`,
|
|
1560
1569
|
from: e.fromId,
|
|
@@ -1563,9 +1572,9 @@ var y = {
|
|
|
1563
1572
|
fromAnchor: "edge",
|
|
1564
1573
|
toAnchor: "edge"
|
|
1565
1574
|
};
|
|
1566
|
-
|
|
1567
|
-
},
|
|
1568
|
-
let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } =
|
|
1575
|
+
T.value.push(t), v("edge-create", t);
|
|
1576
|
+
}, Xa = (e, t, n) => {
|
|
1577
|
+
let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = F(e);
|
|
1569
1578
|
if (!n || n === "center" || a === 0 && o === 0) return {
|
|
1570
1579
|
x: r,
|
|
1571
1580
|
y: i
|
|
@@ -1575,20 +1584,20 @@ var y = {
|
|
|
1575
1584
|
x: r + a * p,
|
|
1576
1585
|
y: i + o * p
|
|
1577
1586
|
};
|
|
1578
|
-
},
|
|
1587
|
+
}, Za = t(() => {
|
|
1579
1588
|
let e = /* @__PURE__ */ new Map();
|
|
1580
|
-
|
|
1581
|
-
let n =
|
|
1589
|
+
O.value.forEach((t) => {
|
|
1590
|
+
let n = A.value[t.id];
|
|
1582
1591
|
n && !n.hidden && (e.has(n.key) || e.set(n.key, []), e.get(n.key).push(t));
|
|
1583
1592
|
});
|
|
1584
1593
|
let t = {};
|
|
1585
1594
|
return e.forEach((e, n) => {
|
|
1586
|
-
let [r, i] = n.split("__"), a =
|
|
1595
|
+
let [r, i] = n.split("__"), a = j(r), o = j(i);
|
|
1587
1596
|
if (!a || !o) return;
|
|
1588
1597
|
let s = o.x - a.x, c = o.y - a.y, l = Math.sqrt(s * s + c * c) || 1, u = s / l, d = c / l, f = -d, p = u, ee = e.length, m = $t;
|
|
1589
1598
|
if (ee > 1) {
|
|
1590
1599
|
let e = (ee - 1) / 2 * $t, t = (e) => {
|
|
1591
|
-
let { w: t, h: n } =
|
|
1600
|
+
let { w: t, h: n } = F(e);
|
|
1592
1601
|
return Math.max(4, (Math.abs(f) * t + Math.abs(p) * n) / 2 - 6);
|
|
1593
1602
|
}, n = Math.min(1, t(a) / e, t(o) / e);
|
|
1594
1603
|
m = $t * Math.max(.35, n);
|
|
@@ -1607,12 +1616,12 @@ var y = {
|
|
|
1607
1616
|
bulge: Math.min(l * .15, 50)
|
|
1608
1617
|
};
|
|
1609
1618
|
}), t;
|
|
1610
|
-
}),
|
|
1611
|
-
let t =
|
|
1619
|
+
}), Qa = (e) => {
|
|
1620
|
+
let t = A.value[e.id], n = t && Za.value[t.key];
|
|
1612
1621
|
if (!n) return null;
|
|
1613
|
-
let r =
|
|
1622
|
+
let r = j(e.from), i = j(e.to);
|
|
1614
1623
|
if (!r || !i) return null;
|
|
1615
|
-
let a = n.slots[e.id] || 0, o = a * n.gap, s =
|
|
1624
|
+
let a = n.slots[e.id] || 0, o = a * n.gap, s = Xa(r, i, e.fromAnchor), c = Xa(i, r, e.toAnchor);
|
|
1616
1625
|
return {
|
|
1617
1626
|
frame: n,
|
|
1618
1627
|
slot: a,
|
|
@@ -1625,12 +1634,12 @@ var y = {
|
|
|
1625
1634
|
y: c.y + n.ny * o
|
|
1626
1635
|
}
|
|
1627
1636
|
};
|
|
1628
|
-
},
|
|
1629
|
-
let t =
|
|
1637
|
+
}, $a = (e) => {
|
|
1638
|
+
let t = Qa(e);
|
|
1630
1639
|
if (!t) return "";
|
|
1631
1640
|
let { from: n, to: r, frame: i, slot: a } = t, o = a * i.gap;
|
|
1632
|
-
if (
|
|
1633
|
-
if (
|
|
1641
|
+
if (xn.value === "straight") return `M ${n.x} ${n.y} L ${r.x} ${r.y}`;
|
|
1642
|
+
if (xn.value === "polyline") {
|
|
1634
1643
|
if (i.dominant === "v") {
|
|
1635
1644
|
let e = (n.y + r.y) / 2 + o;
|
|
1636
1645
|
return `M ${n.x} ${n.y} L ${n.x} ${e} L ${r.x} ${e} L ${r.x} ${r.y}`;
|
|
@@ -1640,18 +1649,18 @@ var y = {
|
|
|
1640
1649
|
}
|
|
1641
1650
|
let s = (n.x + r.x) / 2 + i.nx * i.bulge, c = (n.y + r.y) / 2 + i.ny * i.bulge;
|
|
1642
1651
|
return `M ${n.x} ${n.y} Q ${s} ${c} ${r.x} ${r.y}`;
|
|
1643
|
-
},
|
|
1644
|
-
let n =
|
|
1652
|
+
}, eo = (e, t) => {
|
|
1653
|
+
let n = Qa(e);
|
|
1645
1654
|
if (!n) return {
|
|
1646
1655
|
x: 0,
|
|
1647
1656
|
y: 0
|
|
1648
1657
|
};
|
|
1649
1658
|
let { from: r, to: i, frame: a, slot: o } = n, s = o * a.gap;
|
|
1650
|
-
if (
|
|
1659
|
+
if (xn.value === "straight") return {
|
|
1651
1660
|
x: r.x + (i.x - r.x) * t,
|
|
1652
1661
|
y: r.y + (i.y - r.y) * t
|
|
1653
1662
|
};
|
|
1654
|
-
if (
|
|
1663
|
+
if (xn.value === "polyline") {
|
|
1655
1664
|
if (a.dominant === "v") {
|
|
1656
1665
|
let e = (r.y + i.y) / 2 + s, n = Math.abs(e - r.y), a = Math.abs(i.x - r.x), o = Math.abs(i.y - e), c = t * (n + a + o || 1);
|
|
1657
1666
|
return c <= n ? {
|
|
@@ -1682,29 +1691,29 @@ var y = {
|
|
|
1682
1691
|
x: (1 - t) * (1 - t) * r.x + 2 * (1 - t) * t * c + t * t * i.x,
|
|
1683
1692
|
y: (1 - t) * (1 - t) * r.y + 2 * (1 - t) * t * l + t * t * i.y
|
|
1684
1693
|
};
|
|
1685
|
-
},
|
|
1686
|
-
let e =
|
|
1694
|
+
}, to = t(() => X.value ? j(X.value.fromId) : null), no = t(() => X.value && X.value.overId ? j(X.value.overId) : null), ro = t(() => to.value ? M(to.value) : "#00f0ff"), io = t(() => {
|
|
1695
|
+
let e = X.value;
|
|
1687
1696
|
if (!e) return {
|
|
1688
1697
|
x: 0,
|
|
1689
1698
|
y: 0
|
|
1690
1699
|
};
|
|
1691
|
-
let t =
|
|
1692
|
-
return t &&
|
|
1700
|
+
let t = no.value;
|
|
1701
|
+
return t && to.value ? Xa(t, to.value, "edge") : {
|
|
1693
1702
|
x: e.px,
|
|
1694
1703
|
y: e.py
|
|
1695
1704
|
};
|
|
1696
|
-
}),
|
|
1697
|
-
let e =
|
|
1705
|
+
}), ao = t(() => {
|
|
1706
|
+
let e = no.value;
|
|
1698
1707
|
if (!e) return null;
|
|
1699
|
-
let t =
|
|
1708
|
+
let t = I(e);
|
|
1700
1709
|
return {
|
|
1701
1710
|
x: e.x + t.x - 4,
|
|
1702
1711
|
y: e.y + t.y - 4,
|
|
1703
1712
|
w: t.width + 8,
|
|
1704
1713
|
h: t.height + 8
|
|
1705
1714
|
};
|
|
1706
|
-
}),
|
|
1707
|
-
let t = e.nodeIds.map((e) =>
|
|
1715
|
+
}), oo = (e) => {
|
|
1716
|
+
let t = e.nodeIds.map((e) => j(e)).filter(Boolean);
|
|
1708
1717
|
if (t.length === 0) return null;
|
|
1709
1718
|
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;
|
|
1710
1719
|
return {
|
|
@@ -1713,62 +1722,62 @@ var y = {
|
|
|
1713
1722
|
width: a - r,
|
|
1714
1723
|
height: o - i
|
|
1715
1724
|
};
|
|
1716
|
-
},
|
|
1725
|
+
}, so = t(() => _.groups.map((e) => ({
|
|
1717
1726
|
...e,
|
|
1718
|
-
rect:
|
|
1719
|
-
})).filter((e) => e.rect)), Q = (e) =>
|
|
1720
|
-
let t =
|
|
1727
|
+
rect: oo(e)
|
|
1728
|
+
})).filter((e) => e.rect)), Q = (e) => Gr(e) ? ii.value : e.color ? e.color : $i.value ? $i.value : e.centerText && e.centerText.color || "#00f0ff", co = (e) => {
|
|
1729
|
+
let t = A.value[e.id];
|
|
1721
1730
|
return !!t && !t.hidden;
|
|
1722
|
-
},
|
|
1731
|
+
}, lo = t(() => [...new Set(O.value.map(Q))].map((e) => ({
|
|
1723
1732
|
key: String(e).replace("#", ""),
|
|
1724
1733
|
color: e
|
|
1725
|
-
}))),
|
|
1734
|
+
}))), uo = (e) => {
|
|
1726
1735
|
let t = e.endMarker;
|
|
1727
1736
|
if (!t || t === "none") return "";
|
|
1728
1737
|
let n = Q(e) || "#00f0ff", r = String(n).replace("#", "");
|
|
1729
1738
|
return `url(#${t === "dot" ? "edge-dot" : "edge-arrow"}-${r})`;
|
|
1730
|
-
},
|
|
1739
|
+
}, fo = /* @__PURE__ */ new Map(), po = {
|
|
1731
1740
|
nodes: null,
|
|
1732
1741
|
edges: null,
|
|
1733
1742
|
mode: null,
|
|
1734
1743
|
epoch: -1
|
|
1735
|
-
},
|
|
1736
|
-
let e =
|
|
1737
|
-
(e.nodes !==
|
|
1738
|
-
nodes:
|
|
1739
|
-
edges:
|
|
1740
|
-
mode:
|
|
1744
|
+
}, mo = () => {
|
|
1745
|
+
let e = po;
|
|
1746
|
+
(e.nodes !== x.value || e.edges !== O.value || e.mode !== xn.value || e.epoch !== fn) && (po = {
|
|
1747
|
+
nodes: x.value,
|
|
1748
|
+
edges: O.value,
|
|
1749
|
+
mode: xn.value,
|
|
1741
1750
|
epoch: fn
|
|
1742
|
-
},
|
|
1751
|
+
}, fo = /* @__PURE__ */ new Map());
|
|
1743
1752
|
}, $ = (e) => {
|
|
1744
|
-
|
|
1745
|
-
let t =
|
|
1746
|
-
return t === void 0 && (t =
|
|
1747
|
-
},
|
|
1753
|
+
mo();
|
|
1754
|
+
let t = fo.get(e.id);
|
|
1755
|
+
return t === void 0 && (t = $a(e), fo.set(e.id, t)), t;
|
|
1756
|
+
}, ho = (e, t = 1) => `${2 / e.speed * t}s`, go = (e) => `${3 / e.speed}s`, _o = t(() => _.config.edgeDashFlow === !0), vo = t(() => {
|
|
1748
1757
|
let e = _.config.edgeDashPattern, t = null;
|
|
1749
1758
|
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];
|
|
1750
|
-
}),
|
|
1759
|
+
}), yo = t(() => vo.value.join(" ")), bo = t(() => vo.value.reduce((e, t) => e + t, 0)), xo = (e) => {
|
|
1751
1760
|
let t = Number(e.dashFlowWidth ?? _.config.edgeDashFlowWidth);
|
|
1752
1761
|
return Number.isFinite(t) && t > 0 ? t : 2;
|
|
1753
|
-
},
|
|
1762
|
+
}, So = (e) => {
|
|
1754
1763
|
let t = Number(e.speed);
|
|
1755
1764
|
return `${1.2 / (Number.isFinite(t) && t > 0 ? t : 1)}s`;
|
|
1756
|
-
},
|
|
1757
|
-
let t =
|
|
1765
|
+
}, Co = (e) => e.animated === !1 ? !1 : e.dashFlow === !0 || e.dashFlow !== !1 && _o.value, wo = (e) => {
|
|
1766
|
+
let t = ua(e);
|
|
1758
1767
|
return t === "flow" || t === "all";
|
|
1759
|
-
},
|
|
1760
|
-
let t =
|
|
1768
|
+
}, To = (e) => {
|
|
1769
|
+
let t = ua(e);
|
|
1761
1770
|
return t === "particle" || t === "all";
|
|
1762
|
-
},
|
|
1771
|
+
}, Eo = (e) => b(e).text, Do = (e) => !!e && String(b(e).text ?? "").trim() !== "", Oo = (e, t) => {
|
|
1763
1772
|
if (!e) return null;
|
|
1764
|
-
let n =
|
|
1773
|
+
let n = b(e), r = Number(t.fontSize) || Number(n.fontSize) || 8, i = String(n.text ?? ""), a = 0;
|
|
1765
1774
|
for (let e of i) a += e.charCodeAt(0) > 11904 ? 1 : .62;
|
|
1766
1775
|
return {
|
|
1767
1776
|
w: Math.max(14, a * r + 8),
|
|
1768
1777
|
h: Math.max(12, r + 6)
|
|
1769
1778
|
};
|
|
1770
|
-
},
|
|
1771
|
-
let n = t && typeof t == "object" ? t : {}, r = n.showBg === void 0 ?
|
|
1779
|
+
}, ko = (e, t) => {
|
|
1780
|
+
let n = t && typeof t == "object" ? t : {}, r = n.showBg === void 0 ? Xi.value : !!n.showBg, i = n.bgColor || Zi.value, a = Qi.value;
|
|
1772
1781
|
if (n.bgOpacity !== void 0 && n.bgOpacity !== null) {
|
|
1773
1782
|
let e = Number(n.bgOpacity);
|
|
1774
1783
|
Number.isFinite(e) && (a = Math.min(1, Math.max(0, e)));
|
|
@@ -1777,7 +1786,7 @@ var y = {
|
|
|
1777
1786
|
"solid",
|
|
1778
1787
|
"dashed",
|
|
1779
1788
|
"none"
|
|
1780
|
-
].includes(n.borderStyle) ? n.borderStyle : "solid", s = n.borderColor ||
|
|
1789
|
+
].includes(n.borderStyle) ? n.borderStyle : "solid", s = n.borderColor || vn(e, t), c = n.borderColor ? 1 : .35;
|
|
1781
1790
|
return {
|
|
1782
1791
|
show: r,
|
|
1783
1792
|
fill: i,
|
|
@@ -1786,18 +1795,40 @@ var y = {
|
|
|
1786
1795
|
borderColor: s,
|
|
1787
1796
|
borderOpacity: c
|
|
1788
1797
|
};
|
|
1789
|
-
},
|
|
1790
|
-
let n =
|
|
1798
|
+
}, Ao = (e, t) => {
|
|
1799
|
+
let n = eo(e, Math.max(0, t - .005)), r = eo(e, Math.min(1, t + .005));
|
|
1791
1800
|
return Math.atan2(r.y - n.y, r.x - n.x) * 180 / Math.PI;
|
|
1792
|
-
},
|
|
1801
|
+
}, jo = (e) => {
|
|
1793
1802
|
let t = e % 180;
|
|
1794
1803
|
return t > 90 && (t -= 180), t < -90 && (t += 180), t;
|
|
1795
|
-
},
|
|
1804
|
+
}, Mo = [
|
|
1805
|
+
"above",
|
|
1806
|
+
"center",
|
|
1807
|
+
"below"
|
|
1808
|
+
], No = (e, t) => {
|
|
1809
|
+
let n = e && typeof e == "object" ? e.position : void 0;
|
|
1810
|
+
if (Mo.includes(n)) return n;
|
|
1811
|
+
let r = _.config?.[`edge${t}TextPosition`];
|
|
1812
|
+
if (Mo.includes(r)) return r;
|
|
1813
|
+
let i = _.config?.edgeTextPosition;
|
|
1814
|
+
return Mo.includes(i) ? i : "center";
|
|
1815
|
+
}, Po = t(() => {
|
|
1816
|
+
let e = Number(_.config?.edgeTextGap);
|
|
1817
|
+
return Number.isFinite(e) && e >= 0 ? e : 2;
|
|
1818
|
+
}), Fo = (e, t, n) => {
|
|
1819
|
+
let r = No(e, t);
|
|
1820
|
+
if (r === "center") return 0;
|
|
1821
|
+
let i = (n && n.h ? n.h : 14) / 2 + Po.value;
|
|
1822
|
+
return P(r === "above" ? -i : i);
|
|
1823
|
+
}, Io = (e, t, n, r = 0) => {
|
|
1824
|
+
let i = (b(e).rotation || 0) + (n || 0), a = `translate(${t.x}, ${t.y}) rotate(${i})`;
|
|
1825
|
+
return r ? `${a} translate(0, ${r})` : a;
|
|
1826
|
+
}, Lo = t(() => _.config?.edgeCenterTextFollowLine !== !1), Ro = (e, t) => Lo.value ? Math.abs(e) <= un || _.config?.edgeCenterTextFollowLine ? e : t > 0 ? Math.abs(e) : -Math.abs(e) : 0, zo = (e, t = 120) => {
|
|
1796
1827
|
let n = [];
|
|
1797
|
-
for (let r = 0; r <= t; r++) n.push(
|
|
1828
|
+
for (let r = 0; r <= t; r++) n.push(eo(e, r / t));
|
|
1798
1829
|
return n;
|
|
1799
|
-
},
|
|
1800
|
-
let r =
|
|
1830
|
+
}, Bo = (e, t, n = !1) => {
|
|
1831
|
+
let r = zo(e), i = [], a = 0;
|
|
1801
1832
|
for (let e = 1; e < r.length; e++) {
|
|
1802
1833
|
let t = Math.hypot(r[e].x - r[e - 1].x, r[e].y - r[e - 1].y);
|
|
1803
1834
|
i.push(t), a += t;
|
|
@@ -1811,75 +1842,79 @@ var y = {
|
|
|
1811
1842
|
c += i[e];
|
|
1812
1843
|
}
|
|
1813
1844
|
return +!!n;
|
|
1814
|
-
},
|
|
1845
|
+
}, Vo = t(() => {
|
|
1815
1846
|
let e = [];
|
|
1816
|
-
for (let t of
|
|
1817
|
-
let n =
|
|
1847
|
+
for (let t of W.value) {
|
|
1848
|
+
let n = A.value[t.id];
|
|
1818
1849
|
if (!n) continue;
|
|
1819
1850
|
let r = n.merged && n.representative, i = !n.merged && (t.fromText || t.centerText || t.toText);
|
|
1820
1851
|
if (!r && !i) continue;
|
|
1821
|
-
let a =
|
|
1852
|
+
let a = j(t.from), o = j(t.to);
|
|
1822
1853
|
if (!a || !o) continue;
|
|
1823
|
-
let s =
|
|
1854
|
+
let s = Bo(t, dn), c = Bo(t, dn, !0), l = Oo(t.fromText, t), u = Oo(t.centerText, t), d = Oo(t.toText, t);
|
|
1824
1855
|
e.push({
|
|
1825
1856
|
id: t.id,
|
|
1826
1857
|
edge: t,
|
|
1827
1858
|
info: n,
|
|
1828
1859
|
color: a && se[a.nodeType] || "#00f0ff",
|
|
1829
|
-
start:
|
|
1830
|
-
center:
|
|
1831
|
-
end:
|
|
1832
|
-
startAngle:
|
|
1833
|
-
centerRaw:
|
|
1834
|
-
centerAngle:
|
|
1835
|
-
endAngle:
|
|
1836
|
-
fromBox:
|
|
1837
|
-
centerBox:
|
|
1838
|
-
toBox:
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1860
|
+
start: eo(t, s),
|
|
1861
|
+
center: eo(t, .5),
|
|
1862
|
+
end: eo(t, c),
|
|
1863
|
+
startAngle: jo(Ao(t, s)),
|
|
1864
|
+
centerRaw: Ao(t, .5),
|
|
1865
|
+
centerAngle: jo(Ao(t, .5)),
|
|
1866
|
+
endAngle: jo(Ao(t, c)),
|
|
1867
|
+
fromBox: l,
|
|
1868
|
+
centerBox: u,
|
|
1869
|
+
toBox: d,
|
|
1870
|
+
fromShift: Fo(t.fromText, "From", l),
|
|
1871
|
+
centerShift: Fo(t.centerText, "Center", u),
|
|
1872
|
+
toShift: Fo(t.toText, "To", d),
|
|
1873
|
+
mergedShift: Fo(null, "Center", { h: Number(t.fontSize) || 8 }),
|
|
1874
|
+
fromPlate: ko(t, t.fromText),
|
|
1875
|
+
centerPlate: ko(t, t.centerText),
|
|
1876
|
+
toPlate: ko(t, t.toText)
|
|
1842
1877
|
});
|
|
1843
1878
|
}
|
|
1844
1879
|
return e;
|
|
1845
1880
|
});
|
|
1846
1881
|
return ie({
|
|
1847
|
-
resetDataBaseline:
|
|
1848
|
-
getData:
|
|
1849
|
-
setData:
|
|
1850
|
-
removeSelected:
|
|
1851
|
-
addNodes:
|
|
1852
|
-
addEdges:
|
|
1853
|
-
updateNodes:
|
|
1854
|
-
updateEdges:
|
|
1855
|
-
clientToSvg:
|
|
1856
|
-
svgToClient:
|
|
1857
|
-
moveLayerUp:
|
|
1858
|
-
moveLayerDown:
|
|
1859
|
-
moveToFront:
|
|
1860
|
-
moveToBack:
|
|
1861
|
-
downloadSVG:
|
|
1882
|
+
resetDataBaseline: Fn,
|
|
1883
|
+
getData: In,
|
|
1884
|
+
setData: Jn,
|
|
1885
|
+
removeSelected: Rn,
|
|
1886
|
+
addNodes: Wn,
|
|
1887
|
+
addEdges: Gn,
|
|
1888
|
+
updateNodes: Kn,
|
|
1889
|
+
updateEdges: qn,
|
|
1890
|
+
clientToSvg: Ia,
|
|
1891
|
+
svgToClient: La,
|
|
1892
|
+
moveLayerUp: $r,
|
|
1893
|
+
moveLayerDown: ei,
|
|
1894
|
+
moveToFront: ti,
|
|
1895
|
+
moveToBack: ni,
|
|
1896
|
+
downloadSVG: ri
|
|
1862
1897
|
}), (t, o) => (d(), r("svg", {
|
|
1863
1898
|
ref_key: "svgRef",
|
|
1864
|
-
ref:
|
|
1899
|
+
ref: w,
|
|
1865
1900
|
class: "topology-svg",
|
|
1866
|
-
style: c(
|
|
1867
|
-
viewBox: `${
|
|
1868
|
-
onMousedown:
|
|
1869
|
-
onMousemove:
|
|
1870
|
-
onMouseup:
|
|
1871
|
-
onMouseleave:
|
|
1872
|
-
onClick:
|
|
1873
|
-
onWheel: h(
|
|
1901
|
+
style: c(Ui.value),
|
|
1902
|
+
viewBox: `${hi.value} ${gi.value} ${H.value} ${U.value}`,
|
|
1903
|
+
onMousedown: Ni,
|
|
1904
|
+
onMousemove: va,
|
|
1905
|
+
onMouseup: ba,
|
|
1906
|
+
onMouseleave: ba,
|
|
1907
|
+
onClick: ui,
|
|
1908
|
+
onWheel: h(wi, ["prevent"])
|
|
1874
1909
|
}, [
|
|
1875
1910
|
i("defs", null, [
|
|
1876
1911
|
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),
|
|
1877
1912
|
i("radialGradient", {
|
|
1878
1913
|
id: "bg-grid",
|
|
1879
|
-
cx:
|
|
1880
|
-
cy:
|
|
1881
|
-
r:
|
|
1882
|
-
}, [(d(!0), r(e, null, p(
|
|
1914
|
+
cx: Ji.value.cx,
|
|
1915
|
+
cy: Ji.value.cy,
|
|
1916
|
+
r: Ji.value.r
|
|
1917
|
+
}, [(d(!0), r(e, null, p(Ji.value.stops, (e, t) => (d(), r("stop", {
|
|
1883
1918
|
key: `bg-stop-${t}`,
|
|
1884
1919
|
offset: e.offset,
|
|
1885
1920
|
"stop-color": e.color,
|
|
@@ -1905,7 +1940,7 @@ var y = {
|
|
|
1905
1940
|
"stop-opacity": "0"
|
|
1906
1941
|
}, null, 8, me)
|
|
1907
1942
|
], 8, de))), 128)),
|
|
1908
|
-
(d(!0), r(e, null, p(
|
|
1943
|
+
(d(!0), r(e, null, p(jr.value, (t) => (d(), r("radialGradient", {
|
|
1909
1944
|
key: t.id,
|
|
1910
1945
|
id: t.id
|
|
1911
1946
|
}, [(d(!0), r(e, null, p(t.stops, (e, n) => (d(), r("stop", {
|
|
@@ -1915,7 +1950,7 @@ var y = {
|
|
|
1915
1950
|
"stop-opacity": e.opacity
|
|
1916
1951
|
}, null, 8, ge))), 128))], 8, he))), 128)),
|
|
1917
1952
|
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),
|
|
1918
|
-
(d(!0), r(e, null, p(
|
|
1953
|
+
(d(!0), r(e, null, p(lo.value, (e) => (d(), r("marker", {
|
|
1919
1954
|
key: `m-arrow-${e.key}`,
|
|
1920
1955
|
id: `edge-arrow-${e.key}`,
|
|
1921
1956
|
viewBox: "0 0 10 10",
|
|
@@ -1929,7 +1964,7 @@ var y = {
|
|
|
1929
1964
|
d: "M1,2.5 L9,5 L1,7.5 Z",
|
|
1930
1965
|
fill: e.color
|
|
1931
1966
|
}, null, 8, ve)], 8, _e))), 128)),
|
|
1932
|
-
(d(!0), r(e, null, p(
|
|
1967
|
+
(d(!0), r(e, null, p(lo.value, (e) => (d(), r("marker", {
|
|
1933
1968
|
key: `m-dot-${e.key}`,
|
|
1934
1969
|
id: `edge-dot-${e.key}`,
|
|
1935
1970
|
viewBox: "0 0 10 10",
|
|
@@ -1947,31 +1982,31 @@ var y = {
|
|
|
1947
1982
|
}, null, 8, be)], 8, ye))), 128))
|
|
1948
1983
|
]),
|
|
1949
1984
|
i("rect", {
|
|
1950
|
-
width:
|
|
1951
|
-
height:
|
|
1952
|
-
x:
|
|
1953
|
-
y:
|
|
1985
|
+
width: H.value,
|
|
1986
|
+
height: U.value,
|
|
1987
|
+
x: hi.value,
|
|
1988
|
+
y: gi.value,
|
|
1954
1989
|
fill: "url(#bg-grid)"
|
|
1955
1990
|
}, null, 8, xe),
|
|
1956
|
-
|
|
1991
|
+
Wi.value ? (d(), r(e, { key: 0 }, [i("pattern", {
|
|
1957
1992
|
id: "grid",
|
|
1958
|
-
width:
|
|
1959
|
-
height:
|
|
1993
|
+
width: Ki.value,
|
|
1994
|
+
height: Ki.value,
|
|
1960
1995
|
patternUnits: "userSpaceOnUse"
|
|
1961
1996
|
}, [i("path", {
|
|
1962
|
-
d: `M ${
|
|
1997
|
+
d: `M ${Ki.value} 0 L 0 0 0 ${Ki.value}`,
|
|
1963
1998
|
fill: "none",
|
|
1964
|
-
stroke:
|
|
1999
|
+
stroke: Gi.value,
|
|
1965
2000
|
"stroke-width": "0.5"
|
|
1966
2001
|
}, null, 8, Ce)], 8, Se), i("rect", {
|
|
1967
|
-
width:
|
|
1968
|
-
height:
|
|
1969
|
-
x:
|
|
1970
|
-
y:
|
|
2002
|
+
width: H.value,
|
|
2003
|
+
height: U.value,
|
|
2004
|
+
x: hi.value,
|
|
2005
|
+
y: gi.value,
|
|
1971
2006
|
fill: "url(#grid)",
|
|
1972
|
-
opacity:
|
|
2007
|
+
opacity: qi.value
|
|
1973
2008
|
}, null, 8, we)], 64)) : n("", !0),
|
|
1974
|
-
|
|
2009
|
+
Yi.value ? (d(), r("g", Te, [...o[5] ||= [
|
|
1975
2010
|
i("line", {
|
|
1976
2011
|
x1: "-22",
|
|
1977
2012
|
y1: "0",
|
|
@@ -2003,7 +2038,7 @@ var y = {
|
|
|
2003
2038
|
opacity: "0.8"
|
|
2004
2039
|
}, null, -1)
|
|
2005
2040
|
]])) : n("", !0),
|
|
2006
|
-
(d(!0), r(e, null, p(
|
|
2041
|
+
(d(!0), r(e, null, p(so.value, (e) => (d(), r("g", { key: e.id }, [
|
|
2007
2042
|
i("rect", {
|
|
2008
2043
|
x: e.rect.x,
|
|
2009
2044
|
y: e.rect.y,
|
|
@@ -2063,67 +2098,67 @@ var y = {
|
|
|
2063
2098
|
"letter-spacing": "0.5"
|
|
2064
2099
|
}, m(e.label), 9, Me)
|
|
2065
2100
|
]))), 128)),
|
|
2066
|
-
(d(!0), r(e, null, p(
|
|
2101
|
+
(d(!0), r(e, null, p(Si.value, (e) => (d(), r("g", {
|
|
2067
2102
|
key: `region-${e.id}`,
|
|
2068
2103
|
transform: `translate(${e.x}, ${e.y})`,
|
|
2069
2104
|
"pointer-events": "none"
|
|
2070
2105
|
}, [i("rect", {
|
|
2071
|
-
x:
|
|
2072
|
-
y:
|
|
2073
|
-
width:
|
|
2074
|
-
height:
|
|
2075
|
-
rx:
|
|
2076
|
-
fill:
|
|
2106
|
+
x: I(e).x,
|
|
2107
|
+
y: I(e).y,
|
|
2108
|
+
width: I(e).width,
|
|
2109
|
+
height: I(e).height,
|
|
2110
|
+
rx: q(e),
|
|
2111
|
+
fill: $n(e),
|
|
2077
2112
|
opacity: "0.03"
|
|
2078
|
-
}, null, 8, Pe),
|
|
2113
|
+
}, null, 8, Pe), er(e) ? (d(), r("rect", {
|
|
2079
2114
|
key: 0,
|
|
2080
|
-
x:
|
|
2081
|
-
y:
|
|
2082
|
-
width:
|
|
2083
|
-
height:
|
|
2084
|
-
rx:
|
|
2115
|
+
x: I(e).x,
|
|
2116
|
+
y: I(e).y,
|
|
2117
|
+
width: I(e).width,
|
|
2118
|
+
height: I(e).height,
|
|
2119
|
+
rx: q(e),
|
|
2085
2120
|
fill: "none",
|
|
2086
|
-
stroke:
|
|
2087
|
-
"stroke-width":
|
|
2088
|
-
"stroke-dasharray":
|
|
2121
|
+
stroke: da(e),
|
|
2122
|
+
"stroke-width": tr(e),
|
|
2123
|
+
"stroke-dasharray": pa(e),
|
|
2089
2124
|
opacity: "0.35"
|
|
2090
2125
|
}, null, 8, Fe)) : n("", !0)], 8, Ne))), 128)),
|
|
2091
|
-
|
|
2126
|
+
Xr.value ? (d(), r("g", Ie, [(d(!0), r(e, null, p(Ci.value, (e) => (d(), r("g", {
|
|
2092
2127
|
key: `node-base-${e.id}`,
|
|
2093
2128
|
transform: `translate(${e.x}, ${e.y})`
|
|
2094
|
-
}, [
|
|
2129
|
+
}, [Ur(e) && g.viewMode !== "3d" ? (d(), r("rect", {
|
|
2095
2130
|
key: 0,
|
|
2096
|
-
x: F(e).x,
|
|
2097
|
-
y: F(e).y,
|
|
2098
|
-
width: F(e).width,
|
|
2099
|
-
height: F(e).height,
|
|
2100
|
-
rx: K(e),
|
|
2101
|
-
fill: Hr(e),
|
|
2102
|
-
opacity: "0.15"
|
|
2103
|
-
}, null, 8, Re)) : n("", !0), I(e) && g.viewMode !== "3d" ? (d(), r("rect", {
|
|
2104
|
-
key: 1,
|
|
2105
2131
|
x: I(e).x,
|
|
2106
2132
|
y: I(e).y,
|
|
2107
2133
|
width: I(e).width,
|
|
2108
2134
|
height: I(e).height,
|
|
2109
|
-
rx:
|
|
2135
|
+
rx: q(e),
|
|
2136
|
+
fill: Ur(e),
|
|
2137
|
+
opacity: "0.15"
|
|
2138
|
+
}, null, 8, Re)) : n("", !0), L(e) && g.viewMode !== "3d" ? (d(), r("rect", {
|
|
2139
|
+
key: 1,
|
|
2140
|
+
x: L(e).x,
|
|
2141
|
+
y: L(e).y,
|
|
2142
|
+
width: L(e).width,
|
|
2143
|
+
height: L(e).height,
|
|
2144
|
+
rx: q(e),
|
|
2110
2145
|
fill: "none",
|
|
2111
|
-
stroke:
|
|
2112
|
-
"stroke-width":
|
|
2113
|
-
"stroke-dasharray":
|
|
2146
|
+
stroke: da(e),
|
|
2147
|
+
"stroke-width": fa(e),
|
|
2148
|
+
"stroke-dasharray": pa(e),
|
|
2114
2149
|
opacity: "0.8"
|
|
2115
2150
|
}, null, 8, ze)) : n("", !0)], 8, Le))), 128))])) : n("", !0),
|
|
2116
|
-
(d(!0), r(e, null, p(
|
|
2151
|
+
(d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `base-${t.id}` }, [Co(t) ? n("", !0) : (d(), r("path", {
|
|
2117
2152
|
key: 0,
|
|
2118
2153
|
d: $(t),
|
|
2119
2154
|
fill: "none",
|
|
2120
|
-
stroke:
|
|
2121
|
-
opacity:
|
|
2155
|
+
stroke: ta(t),
|
|
2156
|
+
opacity: na(t),
|
|
2122
2157
|
"stroke-width": "2",
|
|
2123
2158
|
"stroke-linecap": "round",
|
|
2124
|
-
"marker-end":
|
|
2159
|
+
"marker-end": uo(t)
|
|
2125
2160
|
}, null, 8, Be))], 64))), 128)),
|
|
2126
|
-
(d(!0), r(e, null, p(
|
|
2161
|
+
(d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `glow-${t.id}` }, [ca.value ? (d(), r("path", {
|
|
2127
2162
|
key: 0,
|
|
2128
2163
|
d: $(t),
|
|
2129
2164
|
fill: "none",
|
|
@@ -2133,16 +2168,16 @@ var y = {
|
|
|
2133
2168
|
opacity: "0.15",
|
|
2134
2169
|
filter: "url(#glow-strong)"
|
|
2135
2170
|
}, null, 8, Ve)) : n("", !0)], 64))), 128)),
|
|
2136
|
-
(d(!0), r(e, null, p(
|
|
2171
|
+
(d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `sel-${t.id}` }, [Gr(t) ? (d(), r("path", {
|
|
2137
2172
|
key: 0,
|
|
2138
2173
|
d: $(t),
|
|
2139
2174
|
fill: "none",
|
|
2140
|
-
stroke:
|
|
2175
|
+
stroke: ii.value,
|
|
2141
2176
|
"stroke-width": "4",
|
|
2142
2177
|
opacity: "0.35",
|
|
2143
2178
|
filter: "url(#glow-strong)"
|
|
2144
2179
|
}, null, 8, He)) : n("", !0)], 64))), 128)),
|
|
2145
|
-
(d(!0), r(e, null, p(
|
|
2180
|
+
(d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `flow-${t.id}` }, [wo(t) ? (d(), r("g", Ue, [
|
|
2146
2181
|
i("path", {
|
|
2147
2182
|
d: $(t),
|
|
2148
2183
|
fill: "none",
|
|
@@ -2155,7 +2190,7 @@ var y = {
|
|
|
2155
2190
|
attributeName: "stroke-dashoffset",
|
|
2156
2191
|
from: "0",
|
|
2157
2192
|
to: "-52",
|
|
2158
|
-
dur:
|
|
2193
|
+
dur: ho(t),
|
|
2159
2194
|
repeatCount: "indefinite"
|
|
2160
2195
|
}, null, 8, Ge)], 8, We),
|
|
2161
2196
|
i("path", {
|
|
@@ -2170,7 +2205,7 @@ var y = {
|
|
|
2170
2205
|
attributeName: "stroke-dashoffset",
|
|
2171
2206
|
from: "-30",
|
|
2172
2207
|
to: "-82",
|
|
2173
|
-
dur:
|
|
2208
|
+
dur: ho(t, 1.3),
|
|
2174
2209
|
repeatCount: "indefinite"
|
|
2175
2210
|
}, null, 8, qe)], 8, Ke),
|
|
2176
2211
|
i("path", {
|
|
@@ -2186,35 +2221,35 @@ var y = {
|
|
|
2186
2221
|
attributeName: "stroke-dashoffset",
|
|
2187
2222
|
from: "0",
|
|
2188
2223
|
to: "-84",
|
|
2189
|
-
dur:
|
|
2224
|
+
dur: ho(t, .8),
|
|
2190
2225
|
repeatCount: "indefinite"
|
|
2191
2226
|
}, null, 8, Ye)], 8, Je)
|
|
2192
2227
|
])) : n("", !0)], 64))), 128)),
|
|
2193
|
-
(d(!0), r(e, null, p(
|
|
2228
|
+
(d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `dash-${t.id}` }, [Co(t) ? (d(), r("path", {
|
|
2194
2229
|
key: 0,
|
|
2195
2230
|
d: $(t),
|
|
2196
2231
|
fill: "none",
|
|
2197
2232
|
stroke: Q(t),
|
|
2198
|
-
"stroke-width":
|
|
2233
|
+
"stroke-width": xo(t),
|
|
2199
2234
|
"stroke-linecap": "round",
|
|
2200
|
-
"stroke-dasharray":
|
|
2201
|
-
"marker-end":
|
|
2235
|
+
"stroke-dasharray": yo.value,
|
|
2236
|
+
"marker-end": uo(t),
|
|
2202
2237
|
opacity: "0.9"
|
|
2203
2238
|
}, [i("animate", {
|
|
2204
2239
|
attributeName: "stroke-dashoffset",
|
|
2205
2240
|
from: "0",
|
|
2206
|
-
to: `${-
|
|
2207
|
-
dur:
|
|
2241
|
+
to: `${-bo.value}`,
|
|
2242
|
+
dur: So(t),
|
|
2208
2243
|
repeatCount: "indefinite"
|
|
2209
2244
|
}, null, 8, Ze)], 8, Xe)) : n("", !0)], 64))), 128)),
|
|
2210
|
-
(d(!0), r(e, null, p(
|
|
2245
|
+
(d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `particle-${t.id}` }, [To(t) ? (d(), r("g", Qe, [i("circle", {
|
|
2211
2246
|
r: "3",
|
|
2212
2247
|
fill: Q(t),
|
|
2213
2248
|
opacity: "0.9",
|
|
2214
2249
|
filter: "url(#glow-core)"
|
|
2215
2250
|
}, [i("animateMotion", {
|
|
2216
2251
|
path: $(t),
|
|
2217
|
-
dur:
|
|
2252
|
+
dur: go(t),
|
|
2218
2253
|
repeatCount: "indefinite"
|
|
2219
2254
|
}, null, 8, et)], 8, $e), i("circle", {
|
|
2220
2255
|
r: "8",
|
|
@@ -2223,17 +2258,17 @@ var y = {
|
|
|
2223
2258
|
filter: "url(#glow-strong)"
|
|
2224
2259
|
}, [i("animateMotion", {
|
|
2225
2260
|
path: $(t),
|
|
2226
|
-
dur:
|
|
2261
|
+
dur: go(t),
|
|
2227
2262
|
repeatCount: "indefinite"
|
|
2228
2263
|
}, null, 8, nt)], 8, tt)])) : n("", !0)], 64))), 128)),
|
|
2229
|
-
(d(!0), r(e, null, p(
|
|
2264
|
+
(d(!0), r(e, null, p(Vo.value, (t) => (d(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (d(), r("g", {
|
|
2230
2265
|
key: 0,
|
|
2231
|
-
transform: `translate(${t.center.x}, ${t.center.y}) rotate(${t.centerAngle})`
|
|
2266
|
+
transform: `translate(${t.center.x}, ${t.center.y}) rotate(${t.centerAngle})${t.mergedShift ? ` translate(0, ${t.mergedShift})` : ""}`
|
|
2232
2267
|
}, [i("rect", {
|
|
2233
2268
|
x: "-7",
|
|
2234
|
-
y: -
|
|
2269
|
+
y: -_n(t.edge, null) / 2,
|
|
2235
2270
|
width: 14,
|
|
2236
|
-
height:
|
|
2271
|
+
height: _n(t.edge, null),
|
|
2237
2272
|
rx: "2",
|
|
2238
2273
|
fill: "#FFFFFF",
|
|
2239
2274
|
opacity: "0.9",
|
|
@@ -2243,13 +2278,13 @@ var y = {
|
|
|
2243
2278
|
y: "0",
|
|
2244
2279
|
"dominant-baseline": "central",
|
|
2245
2280
|
"text-anchor": "middle",
|
|
2246
|
-
"font-size":
|
|
2247
|
-
fill:
|
|
2281
|
+
"font-size": _n(t.edge, null),
|
|
2282
|
+
fill: vn(t.edge, null),
|
|
2248
2283
|
opacity: "1"
|
|
2249
2284
|
}, m(t.info.count), 9, at)], 8, rt)) : t.info.merged ? n("", !0) : (d(), r("g", ot, [
|
|
2250
|
-
|
|
2285
|
+
Do(t.edge.fromText) ? (d(), r("g", {
|
|
2251
2286
|
key: 0,
|
|
2252
|
-
transform:
|
|
2287
|
+
transform: Io(t.edge.fromText, t.start, t.startAngle, t.fromShift)
|
|
2253
2288
|
}, [t.fromPlate.show ? (d(), r("rect", {
|
|
2254
2289
|
key: 0,
|
|
2255
2290
|
x: -t.fromBox.w / 2,
|
|
@@ -2267,13 +2302,13 @@ var y = {
|
|
|
2267
2302
|
y: "0",
|
|
2268
2303
|
"dominant-baseline": "central",
|
|
2269
2304
|
"text-anchor": "middle",
|
|
2270
|
-
"font-size":
|
|
2271
|
-
fill:
|
|
2305
|
+
"font-size": _n(t.edge, t.edge.fromText),
|
|
2306
|
+
fill: vn(t.edge, t.edge.fromText),
|
|
2272
2307
|
opacity: "0.9"
|
|
2273
|
-
}, m(
|
|
2274
|
-
|
|
2308
|
+
}, m(Eo(t.edge.fromText)), 9, lt)], 8, st)) : n("", !0),
|
|
2309
|
+
Do(t.edge.centerText) ? (d(), r("g", {
|
|
2275
2310
|
key: 1,
|
|
2276
|
-
transform:
|
|
2311
|
+
transform: Io(t.edge.centerText, t.center, Ro(t.centerAngle, t.centerRaw), t.centerShift)
|
|
2277
2312
|
}, [t.centerPlate.show ? (d(), r("rect", {
|
|
2278
2313
|
key: 0,
|
|
2279
2314
|
x: -t.centerBox.w / 2,
|
|
@@ -2291,13 +2326,13 @@ var y = {
|
|
|
2291
2326
|
y: "0",
|
|
2292
2327
|
"dominant-baseline": "central",
|
|
2293
2328
|
"text-anchor": "middle",
|
|
2294
|
-
"font-size":
|
|
2295
|
-
fill:
|
|
2329
|
+
"font-size": _n(t.edge, t.edge.centerText),
|
|
2330
|
+
fill: vn(t.edge, t.edge.centerText),
|
|
2296
2331
|
opacity: "1"
|
|
2297
|
-
}, m(
|
|
2298
|
-
|
|
2332
|
+
}, m(Eo(t.edge.centerText)), 9, ft)], 8, ut)) : n("", !0),
|
|
2333
|
+
Do(t.edge.toText) ? (d(), r("g", {
|
|
2299
2334
|
key: 2,
|
|
2300
|
-
transform:
|
|
2335
|
+
transform: Io(t.edge.toText, t.end, t.endAngle, t.toShift)
|
|
2301
2336
|
}, [t.toPlate.show ? (d(), r("rect", {
|
|
2302
2337
|
key: 0,
|
|
2303
2338
|
x: -t.toBox.w / 2,
|
|
@@ -2315,85 +2350,85 @@ var y = {
|
|
|
2315
2350
|
y: "0",
|
|
2316
2351
|
"dominant-baseline": "central",
|
|
2317
2352
|
"text-anchor": "middle",
|
|
2318
|
-
"font-size":
|
|
2319
|
-
fill:
|
|
2353
|
+
"font-size": _n(t.edge, t.edge.toText),
|
|
2354
|
+
fill: vn(t.edge, t.edge.toText),
|
|
2320
2355
|
opacity: "0.9"
|
|
2321
|
-
}, m(
|
|
2356
|
+
}, m(Eo(t.edge.toText)), 9, ht)], 8, pt)) : n("", !0)
|
|
2322
2357
|
]))], 64))), 128)),
|
|
2323
|
-
|
|
2358
|
+
X.value ? (d(), r("g", gt, [
|
|
2324
2359
|
i("line", {
|
|
2325
|
-
x1:
|
|
2326
|
-
y1:
|
|
2327
|
-
x2:
|
|
2328
|
-
y2:
|
|
2329
|
-
stroke:
|
|
2360
|
+
x1: X.value.ax,
|
|
2361
|
+
y1: X.value.ay,
|
|
2362
|
+
x2: io.value.x,
|
|
2363
|
+
y2: io.value.y,
|
|
2364
|
+
stroke: ro.value,
|
|
2330
2365
|
"stroke-width": "2",
|
|
2331
2366
|
"stroke-dasharray": "6 6",
|
|
2332
2367
|
"stroke-linecap": "round",
|
|
2333
2368
|
opacity: "0.9"
|
|
2334
2369
|
}, null, 8, _t),
|
|
2335
2370
|
i("circle", {
|
|
2336
|
-
cx:
|
|
2337
|
-
cy:
|
|
2371
|
+
cx: X.value.px,
|
|
2372
|
+
cy: X.value.py,
|
|
2338
2373
|
r: "3.5",
|
|
2339
|
-
fill:
|
|
2374
|
+
fill: ro.value,
|
|
2340
2375
|
opacity: "0.9"
|
|
2341
2376
|
}, null, 8, vt),
|
|
2342
|
-
|
|
2377
|
+
X.value.overId && ao.value ? (d(), r("rect", {
|
|
2343
2378
|
key: 0,
|
|
2344
|
-
x:
|
|
2345
|
-
y:
|
|
2346
|
-
width:
|
|
2347
|
-
height:
|
|
2379
|
+
x: ao.value.x,
|
|
2380
|
+
y: ao.value.y,
|
|
2381
|
+
width: ao.value.w,
|
|
2382
|
+
height: ao.value.h,
|
|
2348
2383
|
rx: "6",
|
|
2349
2384
|
fill: "none",
|
|
2350
|
-
stroke:
|
|
2385
|
+
stroke: ro.value,
|
|
2351
2386
|
"stroke-width": "1.5",
|
|
2352
2387
|
"stroke-dasharray": "6 4",
|
|
2353
2388
|
opacity: "0.9"
|
|
2354
2389
|
}, null, 8, yt)) : n("", !0)
|
|
2355
2390
|
])) : n("", !0),
|
|
2356
|
-
i("g", bt, [(d(!0), r(e, null, p(
|
|
2391
|
+
i("g", bt, [(d(!0), r(e, null, p(Si.value, (e) => (d(), r("g", {
|
|
2357
2392
|
key: `region-hit-${e.id}`,
|
|
2358
2393
|
transform: `translate(${e.x}, ${e.y})`,
|
|
2359
|
-
style: c({ cursor:
|
|
2360
|
-
onMousedown: (t) =>
|
|
2361
|
-
onClick: h((t) =>
|
|
2362
|
-
}, [
|
|
2394
|
+
style: c({ cursor: xa.value ? "move" : "default" }),
|
|
2395
|
+
onMousedown: (t) => Ca(t, e),
|
|
2396
|
+
onClick: h((t) => Ea(e, t), ["stop"])
|
|
2397
|
+
}, [Sa.value === "box" ? (d(), r("rect", {
|
|
2363
2398
|
key: 0,
|
|
2364
2399
|
class: "region-hit-area",
|
|
2365
|
-
x:
|
|
2366
|
-
y:
|
|
2367
|
-
width:
|
|
2368
|
-
height:
|
|
2369
|
-
rx:
|
|
2400
|
+
x: I(e).x,
|
|
2401
|
+
y: I(e).y,
|
|
2402
|
+
width: I(e).width,
|
|
2403
|
+
height: I(e).height,
|
|
2404
|
+
rx: q(e),
|
|
2370
2405
|
fill: "transparent",
|
|
2371
2406
|
"pointer-events": "all"
|
|
2372
2407
|
}, null, 8, St)) : (d(), r("rect", {
|
|
2373
2408
|
key: 1,
|
|
2374
2409
|
class: "region-hit-area region-hit-frame",
|
|
2375
|
-
x:
|
|
2376
|
-
y:
|
|
2377
|
-
width:
|
|
2378
|
-
height:
|
|
2379
|
-
rx:
|
|
2410
|
+
x: I(e).x,
|
|
2411
|
+
y: I(e).y,
|
|
2412
|
+
width: I(e).width,
|
|
2413
|
+
height: I(e).height,
|
|
2414
|
+
rx: q(e),
|
|
2380
2415
|
fill: "none",
|
|
2381
2416
|
stroke: "transparent",
|
|
2382
2417
|
"stroke-width": "14",
|
|
2383
2418
|
"pointer-events": "stroke"
|
|
2384
|
-
}, null, 8, Ct)),
|
|
2419
|
+
}, null, 8, Ct)), Wr(e) && g.viewMode !== "3d" ? (d(), r("rect", {
|
|
2385
2420
|
key: 2,
|
|
2386
|
-
x:
|
|
2387
|
-
y:
|
|
2388
|
-
width:
|
|
2389
|
-
height:
|
|
2390
|
-
rx:
|
|
2421
|
+
x: I(e).x,
|
|
2422
|
+
y: I(e).y,
|
|
2423
|
+
width: I(e).width,
|
|
2424
|
+
height: I(e).height,
|
|
2425
|
+
rx: q(e),
|
|
2391
2426
|
fill: "none",
|
|
2392
|
-
stroke:
|
|
2427
|
+
stroke: Yr.value,
|
|
2393
2428
|
"stroke-width": "2.5",
|
|
2394
2429
|
"pointer-events": "none"
|
|
2395
2430
|
}, null, 8, wt)) : n("", !0)], 44, xt))), 128))]),
|
|
2396
|
-
(d(!0), r(e, null, p(
|
|
2431
|
+
(d(!0), r(e, null, p(W.value, (e) => (d(), r("path", {
|
|
2397
2432
|
key: `hit-${e.id}`,
|
|
2398
2433
|
d: $(e),
|
|
2399
2434
|
fill: "none",
|
|
@@ -2403,90 +2438,90 @@ var y = {
|
|
|
2403
2438
|
"pointer-events": "stroke",
|
|
2404
2439
|
cursor: "pointer"
|
|
2405
2440
|
},
|
|
2406
|
-
onClick: h((t) =>
|
|
2441
|
+
onClick: h((t) => ai(e, t), ["stop"])
|
|
2407
2442
|
}, null, 8, Tt))), 128)),
|
|
2408
|
-
(d(!0), r(e, null, p(
|
|
2443
|
+
(d(!0), r(e, null, p(Ci.value, (a) => (d(), r("g", {
|
|
2409
2444
|
key: a.id,
|
|
2410
2445
|
transform: `translate(${a.x}, ${a.y})`,
|
|
2411
|
-
class: s(["topology-node",
|
|
2412
|
-
onMousedown: (e) =>
|
|
2413
|
-
onClick: (e) =>
|
|
2446
|
+
class: s(["topology-node", C.value === a.id ? "dragging" : ""]),
|
|
2447
|
+
onMousedown: (e) => ma(e, a.id),
|
|
2448
|
+
onClick: (e) => Qr(a, e),
|
|
2414
2449
|
style: c({
|
|
2415
2450
|
cursor: _.editable && _.config.nodeDraggable !== !1 ? "grab" : "default",
|
|
2416
|
-
color:
|
|
2451
|
+
color: M(a)
|
|
2417
2452
|
})
|
|
2418
2453
|
}, [
|
|
2419
|
-
|
|
2454
|
+
Qn(a) ? (d(), r("rect", {
|
|
2420
2455
|
key: 0,
|
|
2421
2456
|
class: "node-hit-area node-hit-frame",
|
|
2422
|
-
x:
|
|
2423
|
-
y:
|
|
2424
|
-
width:
|
|
2425
|
-
height:
|
|
2426
|
-
rx:
|
|
2457
|
+
x: I(a).x,
|
|
2458
|
+
y: I(a).y,
|
|
2459
|
+
width: I(a).width,
|
|
2460
|
+
height: I(a).height,
|
|
2461
|
+
rx: q(a),
|
|
2427
2462
|
fill: "none",
|
|
2428
2463
|
stroke: "transparent",
|
|
2429
|
-
"stroke-width": Math.max(
|
|
2464
|
+
"stroke-width": Math.max(fa(a), 12),
|
|
2430
2465
|
"pointer-events": "stroke"
|
|
2431
2466
|
}, null, 8, Dt)) : (d(), r("rect", {
|
|
2432
2467
|
key: 1,
|
|
2433
2468
|
class: "node-hit-area",
|
|
2434
|
-
x:
|
|
2435
|
-
y:
|
|
2436
|
-
width:
|
|
2437
|
-
height:
|
|
2469
|
+
x: Vr(a).x,
|
|
2470
|
+
y: Vr(a).y,
|
|
2471
|
+
width: Vr(a).width,
|
|
2472
|
+
height: Vr(a).height,
|
|
2438
2473
|
fill: "transparent",
|
|
2439
2474
|
"pointer-events": "all"
|
|
2440
2475
|
}, null, 8, Ot)),
|
|
2441
|
-
!
|
|
2476
|
+
!Xr.value && Ur(a) && g.viewMode !== "3d" ? (d(), r("rect", {
|
|
2442
2477
|
key: 2,
|
|
2443
|
-
x: F(a).x,
|
|
2444
|
-
y: F(a).y,
|
|
2445
|
-
width: F(a).width,
|
|
2446
|
-
height: F(a).height,
|
|
2447
|
-
rx: K(a),
|
|
2448
|
-
fill: Hr(a),
|
|
2449
|
-
opacity: "0.15"
|
|
2450
|
-
}, null, 8, kt)) : n("", !0),
|
|
2451
|
-
!Yr.value && I(a) && g.viewMode !== "3d" ? (d(), r("rect", {
|
|
2452
|
-
key: 3,
|
|
2453
2478
|
x: I(a).x,
|
|
2454
2479
|
y: I(a).y,
|
|
2455
2480
|
width: I(a).width,
|
|
2456
2481
|
height: I(a).height,
|
|
2457
|
-
rx:
|
|
2482
|
+
rx: q(a),
|
|
2483
|
+
fill: Ur(a),
|
|
2484
|
+
opacity: "0.15"
|
|
2485
|
+
}, null, 8, kt)) : n("", !0),
|
|
2486
|
+
!Xr.value && L(a) && g.viewMode !== "3d" ? (d(), r("rect", {
|
|
2487
|
+
key: 3,
|
|
2488
|
+
x: L(a).x,
|
|
2489
|
+
y: L(a).y,
|
|
2490
|
+
width: L(a).width,
|
|
2491
|
+
height: L(a).height,
|
|
2492
|
+
rx: q(a),
|
|
2458
2493
|
fill: "none",
|
|
2459
|
-
stroke:
|
|
2460
|
-
"stroke-width":
|
|
2461
|
-
"stroke-dasharray":
|
|
2494
|
+
stroke: da(a),
|
|
2495
|
+
"stroke-width": fa(a),
|
|
2496
|
+
"stroke-dasharray": pa(a),
|
|
2462
2497
|
opacity: "0.8"
|
|
2463
2498
|
}, null, 8, At)) : n("", !0),
|
|
2464
|
-
|
|
2499
|
+
Wr(a) && g.viewMode !== "3d" ? (d(), r("rect", {
|
|
2465
2500
|
key: 4,
|
|
2466
|
-
x:
|
|
2467
|
-
y:
|
|
2468
|
-
width:
|
|
2469
|
-
height:
|
|
2470
|
-
rx:
|
|
2501
|
+
x: I(a).x,
|
|
2502
|
+
y: I(a).y,
|
|
2503
|
+
width: I(a).width,
|
|
2504
|
+
height: I(a).height,
|
|
2505
|
+
rx: q(a),
|
|
2471
2506
|
fill: "none",
|
|
2472
|
-
stroke:
|
|
2507
|
+
stroke: Yr.value,
|
|
2473
2508
|
"stroke-width": "2.5",
|
|
2474
2509
|
transform: "scale(1.1)",
|
|
2475
2510
|
style: { "pointer-events": "none" }
|
|
2476
2511
|
}, null, 8, jt)) : n("", !0),
|
|
2477
|
-
|
|
2512
|
+
Zn(a) ? (d(), r("text", {
|
|
2478
2513
|
key: 5,
|
|
2479
2514
|
y: "4",
|
|
2480
2515
|
transform: `rotate(${a.rotation || 0} 0 4)`,
|
|
2481
2516
|
"text-anchor": "middle",
|
|
2482
|
-
fill:
|
|
2483
|
-
"font-size":
|
|
2517
|
+
fill: hn(a) || M(a) || Xn(a).color,
|
|
2518
|
+
"font-size": mn(a, 12)
|
|
2484
2519
|
}, [(d(!0), r(e, null, p(String(a.label ?? "").split("\n"), (e, t) => (d(), r("tspan", {
|
|
2485
2520
|
key: t,
|
|
2486
2521
|
x: "0",
|
|
2487
2522
|
dy: t === 0 ? 0 : "1.2em"
|
|
2488
|
-
}, m(e), 9, Nt))), 128))], 8, Mt)) :
|
|
2489
|
-
(d(!0), r(e, null, p(
|
|
2523
|
+
}, m(e), 9, Nt))), 128))], 8, Mt)) : Qn(a) ? (d(), r(e, { key: 6 }, [], 64)) : N(a) ? (d(), r(e, { key: 7 }, [], 64)) : (d(), r(e, { key: 8 }, [
|
|
2524
|
+
(d(!0), r(e, null, p(Nr(a), (e) => (d(), r("circle", {
|
|
2490
2525
|
key: `alert-${a.id}-${e.key}`,
|
|
2491
2526
|
r: e.r,
|
|
2492
2527
|
fill: e.fill,
|
|
@@ -2508,70 +2543,70 @@ var y = {
|
|
|
2508
2543
|
begin: e.begin,
|
|
2509
2544
|
repeatCount: "indefinite"
|
|
2510
2545
|
}, null, 8, It)], 8, Pt))), 128)),
|
|
2511
|
-
|
|
2546
|
+
sr(a) ? (d(), r("svg", {
|
|
2512
2547
|
key: 0,
|
|
2513
2548
|
class: "node-icon",
|
|
2514
|
-
x:
|
|
2515
|
-
y:
|
|
2516
|
-
width:
|
|
2517
|
-
height:
|
|
2518
|
-
viewBox:
|
|
2519
|
-
preserveAspectRatio:
|
|
2549
|
+
x: I(a).x,
|
|
2550
|
+
y: I(a).y,
|
|
2551
|
+
width: I(a).width,
|
|
2552
|
+
height: I(a).height,
|
|
2553
|
+
viewBox: ur.value,
|
|
2554
|
+
preserveAspectRatio: lr.value
|
|
2520
2555
|
}, [ee(t.$slots, "node-icon", {
|
|
2521
2556
|
node: a,
|
|
2522
|
-
color:
|
|
2557
|
+
color: M(a),
|
|
2523
2558
|
viewMode: g.viewMode,
|
|
2524
2559
|
isImage: !0,
|
|
2525
|
-
image:
|
|
2526
|
-
fit:
|
|
2527
|
-
imageWidth:
|
|
2528
|
-
imageHeight:
|
|
2529
|
-
width:
|
|
2530
|
-
height:
|
|
2560
|
+
image: or(a),
|
|
2561
|
+
fit: cr.value,
|
|
2562
|
+
imageWidth: mr(a).w,
|
|
2563
|
+
imageHeight: mr(a).h,
|
|
2564
|
+
width: I(a).width,
|
|
2565
|
+
height: I(a).height
|
|
2531
2566
|
}, () => [i("image", {
|
|
2532
|
-
href:
|
|
2533
|
-
x: -
|
|
2534
|
-
y: -
|
|
2535
|
-
width:
|
|
2536
|
-
height:
|
|
2567
|
+
href: or(a),
|
|
2568
|
+
x: -mr(a).w / 2,
|
|
2569
|
+
y: -mr(a).h / 2,
|
|
2570
|
+
width: mr(a).w,
|
|
2571
|
+
height: mr(a).h
|
|
2537
2572
|
}, null, 8, Rt)])], 8, Lt)) : (d(), r("g", {
|
|
2538
2573
|
key: 1,
|
|
2539
2574
|
class: "node-icon",
|
|
2540
|
-
transform:
|
|
2575
|
+
transform: Fr(a)
|
|
2541
2576
|
}, [ee(t.$slots, "node-icon", {
|
|
2542
2577
|
node: a,
|
|
2543
|
-
color:
|
|
2578
|
+
color: M(a),
|
|
2544
2579
|
viewMode: g.viewMode,
|
|
2545
2580
|
isImage: !1,
|
|
2546
|
-
image:
|
|
2547
|
-
fit:
|
|
2548
|
-
width:
|
|
2549
|
-
height:
|
|
2581
|
+
image: or(a),
|
|
2582
|
+
fit: cr.value,
|
|
2583
|
+
width: I(a).width,
|
|
2584
|
+
height: I(a).height
|
|
2550
2585
|
}, () => [i("rect", {
|
|
2551
2586
|
x: "-18",
|
|
2552
2587
|
y: "-18",
|
|
2553
2588
|
width: "36",
|
|
2554
2589
|
height: "36",
|
|
2555
2590
|
rx: "6",
|
|
2556
|
-
fill:
|
|
2591
|
+
fill: M(a),
|
|
2557
2592
|
opacity: "0.9"
|
|
2558
2593
|
}, null, 8, Bt)])], 8, zt)),
|
|
2559
|
-
|
|
2594
|
+
aa.value ? (d(), r("g", {
|
|
2560
2595
|
key: 2,
|
|
2561
|
-
transform:
|
|
2596
|
+
transform: Ir(a)
|
|
2562
2597
|
}, [i("circle", {
|
|
2563
2598
|
r: "4",
|
|
2564
|
-
fill:
|
|
2599
|
+
fill: Xn(a).color,
|
|
2565
2600
|
stroke: "#0a0e1a",
|
|
2566
2601
|
"stroke-width": "2"
|
|
2567
2602
|
}, null, 8, Ht)], 8, Vt)) : n("", !0),
|
|
2568
2603
|
i("text", {
|
|
2569
|
-
y:
|
|
2570
|
-
transform: `rotate(${a.rotation || 0} 0 ${
|
|
2604
|
+
y: Br(a),
|
|
2605
|
+
transform: `rotate(${a.rotation || 0} 0 ${Br(a)})`,
|
|
2571
2606
|
"text-anchor": "middle",
|
|
2572
|
-
fill:
|
|
2573
|
-
"font-size":
|
|
2574
|
-
"font-weight":
|
|
2607
|
+
fill: hn(a),
|
|
2608
|
+
"font-size": mn(a),
|
|
2609
|
+
"font-weight": gn(a),
|
|
2575
2610
|
opacity: "0.9"
|
|
2576
2611
|
}, [(d(!0), r(e, null, p(String(a.label ?? "").split("\n"), (e, t) => (d(), r("tspan", {
|
|
2577
2612
|
key: t,
|
|
@@ -2579,50 +2614,50 @@ var y = {
|
|
|
2579
2614
|
dy: t === 0 ? 0 : "1.2em"
|
|
2580
2615
|
}, m(e), 9, Wt))), 128))], 8, Ut)
|
|
2581
2616
|
], 64)),
|
|
2582
|
-
|
|
2617
|
+
ia.value && !N(a) ? (d(), r("g", Gt, [(d(!0), r(e, null, p(Fa(a), (e) => (d(), r("circle", {
|
|
2583
2618
|
key: e.side,
|
|
2584
2619
|
cx: e.x,
|
|
2585
2620
|
cy: e.y,
|
|
2586
2621
|
r: "4.5",
|
|
2587
2622
|
class: "node-handle",
|
|
2588
2623
|
fill: "#0a0e1a",
|
|
2589
|
-
stroke:
|
|
2624
|
+
stroke: M(a),
|
|
2590
2625
|
"stroke-width": "1.5",
|
|
2591
|
-
onPointerdown: h((t) =>
|
|
2592
|
-
onPointermove: h(
|
|
2593
|
-
onPointerup: h(
|
|
2594
|
-
onPointercancel: h(
|
|
2595
|
-
onLostpointercapture:
|
|
2626
|
+
onPointerdown: h((t) => Ra(t, a.id, e), ["stop", "prevent"]),
|
|
2627
|
+
onPointermove: h(Ja, ["stop"]),
|
|
2628
|
+
onPointerup: h(Ya, ["stop"]),
|
|
2629
|
+
onPointercancel: h(Ya, ["stop"]),
|
|
2630
|
+
onLostpointercapture: Ya,
|
|
2596
2631
|
onMousedown: o[0] ||= h(() => {}, ["stop", "prevent"]),
|
|
2597
2632
|
onClick: o[1] ||= h(() => {}, ["stop"])
|
|
2598
2633
|
}, null, 40, Kt))), 128))])) : n("", !0)
|
|
2599
2634
|
], 46, Et))), 128)),
|
|
2600
|
-
|
|
2635
|
+
Pa.value ? (d(), r("g", qt, [(d(!0), r(e, null, p(Oa(Pa.value), (e) => (d(), r("rect", {
|
|
2601
2636
|
key: e.side,
|
|
2602
|
-
x:
|
|
2603
|
-
y:
|
|
2637
|
+
x: Pa.value.x + e.x - 4.5,
|
|
2638
|
+
y: Pa.value.y + e.y - 4.5,
|
|
2604
2639
|
width: "9",
|
|
2605
2640
|
height: "9",
|
|
2606
2641
|
rx: "2",
|
|
2607
2642
|
class: s(["node-resize-handle", `rt-${e.side}`]),
|
|
2608
|
-
onMousedown: h((t) =>
|
|
2643
|
+
onMousedown: h((t) => Aa(t, Pa.value, e.side), ["stop", "prevent"]),
|
|
2609
2644
|
onClick: o[2] ||= h(() => {}, ["stop"])
|
|
2610
2645
|
}, null, 42, Jt))), 128))])) : n("", !0),
|
|
2611
|
-
|
|
2646
|
+
Zr.value ? (d(!0), r(e, { key: 5 }, p(W.value, (t) => (d(), r(e, { key: `front-${t.id}` }, [Gr(t) ? (d(), r("g", Yt, [i("path", {
|
|
2612
2647
|
d: $(t),
|
|
2613
2648
|
fill: "none",
|
|
2614
2649
|
stroke: Q(t),
|
|
2615
2650
|
"stroke-width": "2.5",
|
|
2616
2651
|
"stroke-linecap": "round",
|
|
2617
|
-
"marker-end":
|
|
2652
|
+
"marker-end": uo(t)
|
|
2618
2653
|
}, null, 8, Xt)])) : n("", !0)], 64))), 128)) : n("", !0),
|
|
2619
|
-
|
|
2654
|
+
K.value ? (d(), r("rect", {
|
|
2620
2655
|
key: 6,
|
|
2621
2656
|
class: "marquee-box",
|
|
2622
|
-
x:
|
|
2623
|
-
y:
|
|
2624
|
-
width:
|
|
2625
|
-
height:
|
|
2657
|
+
x: Ai.value.x,
|
|
2658
|
+
y: Ai.value.y,
|
|
2659
|
+
width: Ai.value.width,
|
|
2660
|
+
height: Ai.value.height,
|
|
2626
2661
|
rx: "2",
|
|
2627
2662
|
"vector-effect": "non-scaling-stroke"
|
|
2628
2663
|
}, null, 8, Zt)) : n("", !0)
|