vue3-network-graph 0.1.2 → 0.1.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 +600 -210
- package/README.md +607 -212
- package/dist/index.d.ts +18 -1
- package/dist/index.mjs +414 -356
- package/dist/index.umd.cjs +4 -3
- package/package.json +5 -3
package/dist/index.mjs
CHANGED
|
@@ -190,12 +190,14 @@ var b = {
|
|
|
190
190
|
"y",
|
|
191
191
|
"width",
|
|
192
192
|
"height",
|
|
193
|
+
"rx",
|
|
193
194
|
"fill"
|
|
194
195
|
], ut = [
|
|
195
196
|
"x",
|
|
196
197
|
"y",
|
|
197
198
|
"width",
|
|
198
199
|
"height",
|
|
200
|
+
"rx",
|
|
199
201
|
"stroke",
|
|
200
202
|
"stroke-width",
|
|
201
203
|
"stroke-dasharray"
|
|
@@ -204,6 +206,7 @@ var b = {
|
|
|
204
206
|
"y",
|
|
205
207
|
"width",
|
|
206
208
|
"height",
|
|
209
|
+
"rx",
|
|
207
210
|
"stroke"
|
|
208
211
|
], ft = ["fill"], pt = [
|
|
209
212
|
"transform",
|
|
@@ -216,7 +219,7 @@ var b = {
|
|
|
216
219
|
"font-size",
|
|
217
220
|
"font-weight"
|
|
218
221
|
], xt = ["dy"], St = {
|
|
219
|
-
key:
|
|
222
|
+
key: 6,
|
|
220
223
|
class: "node-handles"
|
|
221
224
|
}, Ct = [
|
|
222
225
|
"cx",
|
|
@@ -386,11 +389,11 @@ var b = {
|
|
|
386
389
|
Zt.value && on();
|
|
387
390
|
});
|
|
388
391
|
let sn = () => en(), cn = () => {
|
|
389
|
-
let e = new Set(
|
|
392
|
+
let e = new Set(z.value), t = new Set(B.value), n = w.value.filter((t) => e.has(t.id)), r = M.value.filter((n) => t.has(n.id) || e.has(n.from) || e.has(n.to));
|
|
390
393
|
return !n.length && !r.length ? {
|
|
391
394
|
nodes: [],
|
|
392
395
|
edges: []
|
|
393
|
-
} : (n.length && (w.value = w.value.filter((t) => !e.has(t.id)), T()), r.length && (j.value = /* @__PURE__ */ new Set([...j.value, ...r.map((e) => e.id)]), k.value = k.value.filter((e) => !j.value.has(e.id)), y("edge-remove", r.map((e) => JSON.parse(JSON.stringify(e))))),
|
|
396
|
+
} : (n.length && (w.value = w.value.filter((t) => !e.has(t.id)), T()), r.length && (j.value = /* @__PURE__ */ new Set([...j.value, ...r.map((e) => e.id)]), k.value = k.value.filter((e) => !j.value.has(e.id)), y("edge-remove", r.map((e) => JSON.parse(JSON.stringify(e))))), z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V(), JSON.parse(JSON.stringify({
|
|
394
397
|
nodes: n,
|
|
395
398
|
edges: r
|
|
396
399
|
})));
|
|
@@ -465,7 +468,7 @@ var b = {
|
|
|
465
468
|
return i.length ? (A.value = r, y("edge-update", JSON.parse(JSON.stringify(i))), JSON.parse(JSON.stringify(i))) : [];
|
|
466
469
|
}, pn = (e) => {
|
|
467
470
|
let t = e && typeof e == "object" ? e : null;
|
|
468
|
-
return k.value = [], j.value = /* @__PURE__ */ new Set(), A.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (w.value = JSON.parse(JSON.stringify(t.nodes)), T()) : (w.value = (Array.isArray(v.nodes) ? v.nodes : []).map((e) => ({ ...e })), Wt = w.value),
|
|
471
|
+
return k.value = [], j.value = /* @__PURE__ */ new Set(), A.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (w.value = JSON.parse(JSON.stringify(t.nodes)), T()) : (w.value = (Array.isArray(v.nodes) ? v.nodes : []).map((e) => ({ ...e })), Wt = w.value), z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V(), on(), en();
|
|
469
472
|
};
|
|
470
473
|
h(() => v.edges, (e) => {
|
|
471
474
|
Bt();
|
|
@@ -483,7 +486,7 @@ var b = {
|
|
|
483
486
|
r && (A.value = e);
|
|
484
487
|
}
|
|
485
488
|
}, { deep: !0 });
|
|
486
|
-
let
|
|
489
|
+
let P = t(() => {
|
|
487
490
|
let e = {};
|
|
488
491
|
M.value.forEach((t) => {
|
|
489
492
|
let n = [t.from, t.to].sort().join("__");
|
|
@@ -521,11 +524,11 @@ var b = {
|
|
|
521
524
|
};
|
|
522
525
|
});
|
|
523
526
|
}), t;
|
|
524
|
-
}),
|
|
527
|
+
}), mn = t(() => {
|
|
525
528
|
let e = /* @__PURE__ */ new Map();
|
|
526
529
|
for (let t of w.value) e.set(t.id, t);
|
|
527
530
|
return e;
|
|
528
|
-
}),
|
|
531
|
+
}), F = (e) => mn.value.get(e), I = (e) => e.state != "none" && b[e.state] && b[e.state].color || "#00f0ff", hn = (e) => b[e.state] || b.normal, gn = (e) => e.nodeType === "text", _n = (e) => e.nodeType === "border-only", vn = (e, t) => {
|
|
529
532
|
let n = Number(e);
|
|
530
533
|
return Number.isFinite(n) && n > 0 ? n : t;
|
|
531
534
|
}, yn = (e) => {
|
|
@@ -538,14 +541,18 @@ var b = {
|
|
|
538
541
|
let { sx: t, sy: n } = yn(e);
|
|
539
542
|
return t === 1 && n === 1 ? "" : `scale(${t}, ${n})`;
|
|
540
543
|
}, xn = (e) => {
|
|
541
|
-
let { w: t, h: n } =
|
|
544
|
+
let { w: t, h: n } = L(e), r = Math.min(10, t * .3), i = Math.min(10, n * .3);
|
|
542
545
|
return `translate(${t / 2 - r}, ${-(n / 2 - i)})`;
|
|
543
|
-
}, Sn = (
|
|
544
|
-
let
|
|
545
|
-
return
|
|
546
|
-
}, Cn = (e) =>
|
|
547
|
-
|
|
548
|
-
|
|
546
|
+
}, Sn = t(() => {
|
|
547
|
+
let e = Number(v.config.labelGap);
|
|
548
|
+
return Number.isFinite(e) && e >= 0 ? e : 18;
|
|
549
|
+
}), Cn = (e) => {
|
|
550
|
+
if (gn(e)) return 4;
|
|
551
|
+
let { h: t } = L(e);
|
|
552
|
+
return e.labelPosition === "top" ? -(t / 2 + Sn.value) : e.labelPosition === "center" ? 0 : t / 2 + Sn.value;
|
|
553
|
+
}, wn = (e) => {
|
|
554
|
+
let t = R(e);
|
|
555
|
+
if (gn(e) || !e.label) return t;
|
|
549
556
|
let n = Vt(e), r = Cn(e);
|
|
550
557
|
if (e.labelPosition === "top") {
|
|
551
558
|
let e = r - n - 4;
|
|
@@ -555,28 +562,28 @@ var b = {
|
|
|
555
562
|
i > t.y + t.height && (t.height = i - t.y);
|
|
556
563
|
}
|
|
557
564
|
return t;
|
|
558
|
-
}, Tn = (e) => e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0,
|
|
559
|
-
let t = _n(e);
|
|
565
|
+
}, Tn = (e) => e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0, L = (e) => {
|
|
566
|
+
let t = gn(e), n = _n(e);
|
|
560
567
|
return {
|
|
561
|
-
w: vn(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : At),
|
|
562
|
-
h: vn(e.height, t ? 26 : At)
|
|
568
|
+
w: vn(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : n ? Math.max(80, String(e.label).length * 8 + 24) : At),
|
|
569
|
+
h: vn(e.height, t ? 26 : n ? 40 : At)
|
|
563
570
|
};
|
|
564
|
-
},
|
|
565
|
-
let { w: t, h: n } =
|
|
571
|
+
}, R = (e) => {
|
|
572
|
+
let { w: t, h: n } = L(e);
|
|
566
573
|
return {
|
|
567
574
|
x: -t / 2,
|
|
568
575
|
y: -n / 2,
|
|
569
576
|
width: t,
|
|
570
577
|
height: n
|
|
571
578
|
};
|
|
572
|
-
}, En = (e) => Tn(e) ?
|
|
573
|
-
t(() =>
|
|
574
|
-
let On = (e) =>
|
|
579
|
+
}, En = (e) => Tn(e) ? R(e) : null, Dn = (e) => e.background && e.background !== "none" ? e.background : null, z = d([]), B = d([]);
|
|
580
|
+
t(() => z.value.length === 1 ? z.value[0] : null), t(() => B.value.length === 1 ? B.value[0] : null);
|
|
581
|
+
let On = (e) => z.value.includes(e.id), kn = (e) => B.value.includes(e.id), V = () => {
|
|
575
582
|
y("selection-change", {
|
|
576
|
-
nodes: w.value.filter((e) =>
|
|
577
|
-
edges: M.value.filter((e) =>
|
|
583
|
+
nodes: w.value.filter((e) => z.value.includes(e.id)),
|
|
584
|
+
edges: M.value.filter((e) => B.value.includes(e.id))
|
|
578
585
|
});
|
|
579
|
-
}, An = (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, jn = t(() => An(v.config.maxSelectNodes)), Mn = t(() => An(v.config.maxSelectEdges)),
|
|
586
|
+
}, An = (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, jn = t(() => An(v.config.maxSelectNodes)), Mn = t(() => An(v.config.maxSelectEdges)), H = (e, t, n) => {
|
|
580
587
|
let r = new Set(e), i = [];
|
|
581
588
|
for (let e of t) r.has(e) || (r.add(e), i.push(e));
|
|
582
589
|
if (n === Infinity) return [...e, ...i];
|
|
@@ -585,93 +592,117 @@ var b = {
|
|
|
585
592
|
};
|
|
586
593
|
h([jn, Mn], ([e, t]) => {
|
|
587
594
|
let n = !1;
|
|
588
|
-
|
|
595
|
+
z.value.length > e && (z.value = z.value.slice(0, e), n = !0), B.value.length > t && (B.value = B.value.slice(0, t), n = !0), n && V();
|
|
589
596
|
});
|
|
590
597
|
let Nn = t(() => v.config.selectedBorderColor || "#fbbf24"), Pn = (e, t) => {
|
|
591
|
-
if (!
|
|
598
|
+
if (!Wn()) {
|
|
592
599
|
if (t && (t.ctrlKey || t.metaKey)) {
|
|
593
|
-
let t =
|
|
594
|
-
t >= 0 ?
|
|
600
|
+
let t = z.value.indexOf(e.id);
|
|
601
|
+
t >= 0 ? z.value.splice(t, 1) : z.value = H(z.value, [e.id], jn.value);
|
|
595
602
|
} else {
|
|
596
|
-
let t =
|
|
597
|
-
|
|
603
|
+
let t = z.value.length === 1 && z.value[0] === e.id;
|
|
604
|
+
z.value = t ? [] : H([], [e.id], jn.value), B.value = [];
|
|
598
605
|
}
|
|
599
|
-
y("node-click", e), y("node-select", On(e) ? e : null),
|
|
606
|
+
y("node-click", e), y("node-select", On(e) ? e : null), V();
|
|
600
607
|
}
|
|
601
|
-
}, Fn =
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
608
|
+
}, Fn = (e) => {
|
|
609
|
+
let t = w.value.find((t) => t.id === e);
|
|
610
|
+
if (!t || v.config.enableZOrder === !1) return !1;
|
|
611
|
+
let n = t.zIndex ?? 0, r = w.value.filter((e) => (e.zIndex ?? 0) > n);
|
|
612
|
+
return r.length !== 0 && (t.zIndex = Math.min(...r.map((e) => e.zIndex ?? 0)), !0);
|
|
613
|
+
}, In = (e) => {
|
|
614
|
+
let t = w.value.find((t) => t.id === e);
|
|
615
|
+
if (!t || v.config.enableZOrder === !1) return !1;
|
|
616
|
+
let n = t.zIndex ?? 0, r = w.value.filter((e) => (e.zIndex ?? 0) < n);
|
|
617
|
+
return r.length !== 0 && (t.zIndex = Math.max(...r.map((e) => e.zIndex ?? 0)), !0);
|
|
618
|
+
}, Ln = (e) => {
|
|
619
|
+
let t = w.value.find((t) => t.id === e);
|
|
620
|
+
return !t || v.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.max(...w.value.map((e) => e.zIndex ?? 0), 0) + 1, !0);
|
|
621
|
+
}, Rn = (e) => {
|
|
622
|
+
let t = w.value.find((t) => t.id === e);
|
|
623
|
+
return !t || v.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.min(...w.value.map((e) => e.zIndex ?? 0), 0) - 1, !0);
|
|
624
|
+
}, zn = () => {
|
|
625
|
+
if (!O.value) return;
|
|
626
|
+
let e = O.value.cloneNode(!0);
|
|
627
|
+
e.querySelectorAll("animate, animateMotion, animateTransform, set").forEach((e) => e.remove()), e.querySelectorAll(".center-crosshair").forEach((e) => e.remove()), e.setAttribute("width", U.value || "800"), e.setAttribute("height", W.value || "600");
|
|
628
|
+
let t = new XMLSerializer().serializeToString(e);
|
|
629
|
+
t = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + t;
|
|
630
|
+
let n = new Blob([t], { type: "image/svg+xml;charset=utf-8" }), r = URL.createObjectURL(n), i = document.createElement("a");
|
|
631
|
+
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);
|
|
632
|
+
}, Bn = t(() => v.config.selectedLineColor || "#fbbf24"), Vn = (e, t) => {
|
|
633
|
+
if (Wn()) return;
|
|
634
|
+
let n = P.value[e.id], r = !!(n && n.merged && n.representative), i = r ? M.value.filter((e) => {
|
|
635
|
+
let t = P.value[e.id];
|
|
605
636
|
return t && t.key === n.key;
|
|
606
637
|
}) : null, a = r ? i.map((e) => e.id) : [e.id], o = r ? {
|
|
607
638
|
...e,
|
|
608
639
|
bundleEdges: i
|
|
609
640
|
} : e;
|
|
610
|
-
if (t && (t.ctrlKey || t.metaKey)) a.every((e) =>
|
|
641
|
+
if (t && (t.ctrlKey || t.metaKey)) a.every((e) => B.value.includes(e)) ? B.value = B.value.filter((e) => !a.includes(e)) : B.value = H(B.value, a, Mn.value);
|
|
611
642
|
else {
|
|
612
|
-
let e = a.length ===
|
|
613
|
-
|
|
643
|
+
let e = a.length === B.value.length && a.every((e) => B.value.includes(e));
|
|
644
|
+
B.value = e ? [] : H([], a, Mn.value), z.value = [];
|
|
614
645
|
}
|
|
615
|
-
y("edge-select", kn(e) ? o : null),
|
|
616
|
-
},
|
|
617
|
-
|
|
618
|
-
},
|
|
619
|
-
|
|
620
|
-
},
|
|
621
|
-
if (
|
|
646
|
+
y("edge-select", kn(e) ? o : null), V();
|
|
647
|
+
}, Hn = 0, Un = (e = 200) => {
|
|
648
|
+
Hn = performance.now() + e;
|
|
649
|
+
}, Wn = () => performance.now() < Hn, Gn = () => {
|
|
650
|
+
z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V();
|
|
651
|
+
}, Kn = (e) => {
|
|
652
|
+
if (Wn()) return;
|
|
622
653
|
let t = e.target;
|
|
623
|
-
t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) ||
|
|
624
|
-
},
|
|
654
|
+
t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) || Gn();
|
|
655
|
+
}, qn = d({
|
|
625
656
|
width: 1e3,
|
|
626
657
|
height: 650
|
|
627
|
-
}),
|
|
658
|
+
}), Jn = d(1), Yn = d(0), Xn = d(0), Zn = t(() => -$n.value / 2 + Yn.value), Qn = t(() => -er.value / 2 + Xn.value), $n = t(() => v.width ?? qn.value.width), er = t(() => v.height ?? qn.value.height), tr = null;
|
|
628
659
|
l(() => {
|
|
629
660
|
let e = O.value;
|
|
630
661
|
if (e) {
|
|
631
662
|
let t = e.getBoundingClientRect();
|
|
632
|
-
t.width > 0 && t.height > 0 && (
|
|
663
|
+
t.width > 0 && t.height > 0 && (qn.value = {
|
|
633
664
|
width: t.width,
|
|
634
665
|
height: t.height
|
|
635
666
|
});
|
|
636
667
|
}
|
|
637
|
-
e && typeof ResizeObserver < "u" && (
|
|
668
|
+
e && typeof ResizeObserver < "u" && (tr = new ResizeObserver(() => {
|
|
638
669
|
let t = e.getBoundingClientRect();
|
|
639
|
-
t.width > 0 && t.height > 0 && (
|
|
670
|
+
t.width > 0 && t.height > 0 && (qn.value = {
|
|
640
671
|
width: t.width,
|
|
641
672
|
height: t.height
|
|
642
673
|
});
|
|
643
|
-
}),
|
|
674
|
+
}), tr.observe(e));
|
|
644
675
|
}), c(() => {
|
|
645
|
-
|
|
676
|
+
tr &&= (tr.disconnect(), null), Wr &&= (cancelAnimationFrame(Wr), 0), hr &&= (cancelAnimationFrame(hr), 0), Z &&= (cancelAnimationFrame(Z), 0), mi(), xr();
|
|
646
677
|
});
|
|
647
|
-
let
|
|
648
|
-
x0:
|
|
649
|
-
y0:
|
|
650
|
-
x1:
|
|
651
|
-
y1:
|
|
652
|
-
})),
|
|
653
|
-
let e =
|
|
654
|
-
|
|
655
|
-
let { w: n, h: r } = I(t);
|
|
678
|
+
let U = t(() => $n.value / Jn.value), W = t(() => er.value / Jn.value), nr = t(() => ({
|
|
679
|
+
x0: Zn.value - Nt,
|
|
680
|
+
y0: Qn.value - Nt,
|
|
681
|
+
x1: Zn.value + U.value + Nt,
|
|
682
|
+
y1: Qn.value + W.value + Nt
|
|
683
|
+
})), rr = t(() => {
|
|
684
|
+
let e = nr.value, t = w.value.filter((t) => {
|
|
685
|
+
let { w: n, h: r } = L(t);
|
|
656
686
|
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;
|
|
657
687
|
});
|
|
658
|
-
|
|
659
|
-
|
|
688
|
+
return v.config.enableZOrder !== !1 && t.sort((e, t) => (e.zIndex ?? 0) - (t.zIndex ?? 0)), t;
|
|
689
|
+
}), G = t(() => {
|
|
690
|
+
let e = nr.value;
|
|
660
691
|
return M.value.filter((t) => {
|
|
661
|
-
if (!
|
|
662
|
-
let n =
|
|
692
|
+
if (!Ai(t)) return !1;
|
|
693
|
+
let n = F(t.from), r = F(t.to);
|
|
663
694
|
if (!n || !r) return !1;
|
|
664
|
-
let i =
|
|
695
|
+
let i = L(n).w / 2, a = L(n).h / 2, o = L(r).w / 2, s = L(r).h / 2;
|
|
665
696
|
return Math.min(n.x - i, r.x - o) - Pt <= e.x1 && Math.max(n.x + i, r.x + o) + Pt >= e.x0 && Math.min(n.y - a, r.y - s) - Pt <= e.y1 && Math.max(n.y + a, r.y + s) + Pt >= e.y0;
|
|
666
697
|
});
|
|
667
|
-
}),
|
|
698
|
+
}), ir = (e) => {
|
|
668
699
|
if (v.config.enableZoom === !1) return;
|
|
669
700
|
e.preventDefault();
|
|
670
|
-
let t = O.value.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, i = n / t.width, a = r / t.height, o =
|
|
671
|
-
|
|
672
|
-
},
|
|
701
|
+
let t = O.value.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, i = n / t.width, a = r / t.height, o = U.value, s = W.value, c = e.deltaY > 0 ? .9 : 1.1, l = Math.min(Mt, Math.max(jt, Jn.value * c)), u = $n.value / l, d = er.value / l;
|
|
702
|
+
Yn.value += (o - u) * i, Xn.value += (s - d) * a, Jn.value = l;
|
|
703
|
+
}, K = d(null), q = d(null), ar = (e) => {
|
|
673
704
|
let t = O.value, n = t ? t.getBoundingClientRect() : null;
|
|
674
|
-
|
|
705
|
+
K.value = {
|
|
675
706
|
startX: e.clientX,
|
|
676
707
|
startY: e.clientY,
|
|
677
708
|
lastX: e.clientX,
|
|
@@ -679,9 +710,9 @@ var b = {
|
|
|
679
710
|
moved: !1,
|
|
680
711
|
rectWidth: n && n.width ? n.width : 0,
|
|
681
712
|
rectHeight: n && n.height ? n.height : 0
|
|
682
|
-
},
|
|
683
|
-
},
|
|
684
|
-
let t =
|
|
713
|
+
}, br();
|
|
714
|
+
}, or = (e) => {
|
|
715
|
+
let t = K.value, n = O.value;
|
|
685
716
|
if (!t || !n) return;
|
|
686
717
|
let r = t.rectWidth, i = t.rectHeight;
|
|
687
718
|
if (!r || !i) return;
|
|
@@ -691,13 +722,13 @@ var b = {
|
|
|
691
722
|
return;
|
|
692
723
|
}
|
|
693
724
|
let a = e.clientX - t.lastX, o = e.clientY - t.lastY;
|
|
694
|
-
t.lastX = e.clientX, t.lastY = e.clientY,
|
|
695
|
-
},
|
|
696
|
-
let e =
|
|
697
|
-
|
|
698
|
-
},
|
|
725
|
+
t.lastX = e.clientX, t.lastY = e.clientY, Yn.value -= a * (U.value / r), Xn.value -= o * (W.value / i);
|
|
726
|
+
}, sr = () => {
|
|
727
|
+
let e = K.value;
|
|
728
|
+
K.value = null, e && e.moved && Un(), Sr();
|
|
729
|
+
}, cr = (e) => {
|
|
699
730
|
let t = X(e);
|
|
700
|
-
|
|
731
|
+
q.value = {
|
|
701
732
|
start: {
|
|
702
733
|
x: t.x,
|
|
703
734
|
y: t.y
|
|
@@ -709,17 +740,17 @@ var b = {
|
|
|
709
740
|
startClientX: e.clientX,
|
|
710
741
|
startClientY: e.clientY,
|
|
711
742
|
moved: !1
|
|
712
|
-
},
|
|
713
|
-
},
|
|
714
|
-
let t =
|
|
743
|
+
}, br();
|
|
744
|
+
}, lr = (e) => {
|
|
745
|
+
let t = q.value;
|
|
715
746
|
if (!t) return;
|
|
716
747
|
let n = X(e);
|
|
717
748
|
t.current = {
|
|
718
749
|
x: n.x,
|
|
719
750
|
y: n.y
|
|
720
751
|
}, !t.moved && Math.hypot(e.clientX - t.startClientX, e.clientY - t.startClientY) > 3 && (t.moved = !0);
|
|
721
|
-
},
|
|
722
|
-
let e =
|
|
752
|
+
}, ur = t(() => {
|
|
753
|
+
let e = q.value;
|
|
723
754
|
return e ? {
|
|
724
755
|
x: Math.min(e.start.x, e.current.x),
|
|
725
756
|
y: Math.min(e.start.y, e.current.y),
|
|
@@ -731,62 +762,62 @@ var b = {
|
|
|
731
762
|
width: 0,
|
|
732
763
|
height: 0
|
|
733
764
|
};
|
|
734
|
-
}),
|
|
735
|
-
let e =
|
|
736
|
-
if (
|
|
765
|
+
}), dr = () => {
|
|
766
|
+
let e = q.value;
|
|
767
|
+
if (q.value = null, e && e.moved) {
|
|
737
768
|
let t = {
|
|
738
769
|
x: Math.min(e.start.x, e.current.x),
|
|
739
770
|
y: Math.min(e.start.y, e.current.y),
|
|
740
771
|
w: Math.abs(e.current.x - e.start.x),
|
|
741
772
|
h: Math.abs(e.current.y - e.start.y)
|
|
742
773
|
}, n = w.value.filter((e) => {
|
|
743
|
-
let n =
|
|
774
|
+
let n = R(e), r = e.x + n.x, i = e.y + n.y;
|
|
744
775
|
return !(r + n.width < t.x || r > t.x + t.w || i + n.height < t.y || i > t.y + t.h);
|
|
745
776
|
});
|
|
746
|
-
n.length && (
|
|
777
|
+
n.length && (z.value = H(z.value, n.map((e) => e.id), jn.value), V()), Un();
|
|
747
778
|
}
|
|
748
|
-
|
|
749
|
-
},
|
|
779
|
+
Sr();
|
|
780
|
+
}, fr = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), pr = (e) => {
|
|
750
781
|
if (O.value) {
|
|
751
782
|
if (e.button === 1) {
|
|
752
783
|
if (v.config.enablePan === !1) return;
|
|
753
|
-
e.preventDefault(),
|
|
784
|
+
e.preventDefault(), ar(e);
|
|
754
785
|
return;
|
|
755
786
|
}
|
|
756
|
-
if (e.button === 0 && !
|
|
787
|
+
if (e.button === 0 && !fr(e.target)) {
|
|
757
788
|
if (e.ctrlKey || e.metaKey) {
|
|
758
789
|
if (v.config.enableMarquee === !1) return;
|
|
759
|
-
e.preventDefault(),
|
|
790
|
+
e.preventDefault(), cr(e);
|
|
760
791
|
return;
|
|
761
792
|
}
|
|
762
|
-
v.config.enablePan !== !1 && (e.preventDefault(),
|
|
793
|
+
v.config.enablePan !== !1 && (e.preventDefault(), ar(e));
|
|
763
794
|
}
|
|
764
795
|
}
|
|
765
|
-
},
|
|
766
|
-
|
|
767
|
-
let e =
|
|
768
|
-
|
|
769
|
-
},
|
|
770
|
-
|
|
771
|
-
},
|
|
772
|
-
|
|
773
|
-
},
|
|
774
|
-
|
|
775
|
-
},
|
|
776
|
-
|
|
777
|
-
},
|
|
778
|
-
!
|
|
779
|
-
},
|
|
780
|
-
if (J.value && J.value.side) return { cursor:
|
|
781
|
-
if (
|
|
782
|
-
if (
|
|
783
|
-
}),
|
|
796
|
+
}, mr = !1, hr = 0, gr = null, _r = () => {
|
|
797
|
+
hr = 0;
|
|
798
|
+
let e = gr;
|
|
799
|
+
gr = null, e && (K.value ? or(e) : q.value && lr(e));
|
|
800
|
+
}, vr = (e) => {
|
|
801
|
+
gr = e, hr ||= requestAnimationFrame(_r);
|
|
802
|
+
}, yr = () => {
|
|
803
|
+
hr && (cancelAnimationFrame(hr), _r()), K.value && sr(), q.value && dr();
|
|
804
|
+
}, br = () => {
|
|
805
|
+
mr || (mr = !0, window.addEventListener("mousemove", vr, !0), window.addEventListener("mouseup", yr, !0));
|
|
806
|
+
}, xr = () => {
|
|
807
|
+
mr && (mr = !1, window.removeEventListener("mousemove", vr, !0), window.removeEventListener("mouseup", yr, !0));
|
|
808
|
+
}, Sr = () => {
|
|
809
|
+
!K.value && !q.value && xr();
|
|
810
|
+
}, Cr = t(() => {
|
|
811
|
+
if (J.value && J.value.side) return { cursor: Qr(J.value.side) };
|
|
812
|
+
if (q.value) return { cursor: "crosshair" };
|
|
813
|
+
if (K.value && K.value.moved) return { cursor: "grabbing" };
|
|
814
|
+
}), wr = t(() => v.config.showGrid !== !1), Tr = t(() => v.config.gridColor || "#1a2240"), Er = t(() => {
|
|
784
815
|
let e = Number(v.config.gridStep);
|
|
785
|
-
return (Number.isFinite(e) && e > 0 ? e : 40) /
|
|
786
|
-
}),
|
|
816
|
+
return (Number.isFinite(e) && e > 0 ? e : 40) / Jn.value;
|
|
817
|
+
}), Dr = t(() => {
|
|
787
818
|
let e = Number(v.config.gridOpacity);
|
|
788
819
|
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .5;
|
|
789
|
-
}),
|
|
820
|
+
}), Or = t(() => {
|
|
790
821
|
let e = v.config.radialGradient && typeof v.config.radialGradient == "object" ? v.config.radialGradient : {}, t = Array.isArray(e.stops) && e.stops.length ? e.stops.filter((e) => e && e.color).map((e, t) => ({
|
|
791
822
|
offset: e.offset == null ? t === 0 ? "0%" : "100%" : e.offset,
|
|
792
823
|
color: e.color,
|
|
@@ -806,32 +837,48 @@ var b = {
|
|
|
806
837
|
r: e.r || "60%",
|
|
807
838
|
stops: n
|
|
808
839
|
};
|
|
809
|
-
}),
|
|
840
|
+
}), kr = t(() => v.config.showCenterPoint === !0), Ar = t(() => v.config.showEdgeTextBg === !0), jr = t(() => v.config.edgeTextBgColor || "#0a0e1a"), Mr = t(() => v.config.showNodeHandles === !0), Nr = t(() => v.config.showStatusDot !== !1), Pr = (e, t) => {
|
|
810
841
|
let n = Number(e);
|
|
811
842
|
return Number.isFinite(n) && n >= 0 ? n : t;
|
|
812
|
-
},
|
|
843
|
+
}, Fr = t(() => {
|
|
813
844
|
let e = v.config.motionFx ?? v.config.fx;
|
|
814
|
-
return typeof e == "boolean" ? e :
|
|
815
|
-
|
|
845
|
+
return typeof e == "boolean" ? e ? "all" : "none" : [
|
|
846
|
+
"none",
|
|
847
|
+
"flow",
|
|
848
|
+
"particle",
|
|
849
|
+
"all"
|
|
850
|
+
].includes(e) ? e : M.value.length <= Pr(v.config.fxMotionMaxEdges, 200) ? "all" : "none";
|
|
851
|
+
}), Ir = t(() => {
|
|
816
852
|
let e = v.config.glowFx ?? v.config.fx;
|
|
817
|
-
return typeof e == "boolean" ? e : M.value.length <=
|
|
818
|
-
}),
|
|
853
|
+
return typeof e == "boolean" ? e : M.value.length <= Pr(v.config.fxGlowMaxEdges, 500);
|
|
854
|
+
}), Lr = t(() => {
|
|
819
855
|
let e = v.config.breatheFx ?? v.config.fx;
|
|
820
|
-
return typeof e == "boolean" ? e : w.value.length <=
|
|
821
|
-
}),
|
|
856
|
+
return typeof e == "boolean" ? e : w.value.length <= Pr(v.config.fxBreatheMaxNodes, 300);
|
|
857
|
+
}), Rr = (e) => {
|
|
858
|
+
if (e.animatedMode !== void 0) {
|
|
859
|
+
let t = e.animatedMode;
|
|
860
|
+
return !t || t === "all" ? Fr.value : t === "none" ? "none" : t;
|
|
861
|
+
}
|
|
862
|
+
return e.animated === void 0 || e.animated ? Fr.value : "none";
|
|
863
|
+
}, zr = (e) => e.borderColor || I(e) || "#94a3b8", Br = (e) => e.borderWidth || 0, Vr = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, Hr = (e) => {
|
|
864
|
+
let t = e.borderRadius;
|
|
865
|
+
if (t == null || t === "") return 6;
|
|
866
|
+
let n = Number(t);
|
|
867
|
+
return Number.isFinite(n) && n >= 0 ? n : 6;
|
|
868
|
+
}, Ur = (e, t) => {
|
|
822
869
|
if (e.button !== 0 || !v.editable || v.config.nodeDraggable === !1) return;
|
|
823
870
|
e.stopPropagation();
|
|
824
|
-
let n =
|
|
871
|
+
let n = F(t), r = X(e);
|
|
825
872
|
if (Kt.value = {
|
|
826
873
|
x: r.x - n.x,
|
|
827
874
|
y: r.y - n.y
|
|
828
875
|
}, Jt = {
|
|
829
876
|
x: e.clientX,
|
|
830
877
|
y: e.clientY
|
|
831
|
-
}, Yt = !1, Xt = !!(e.ctrlKey || e.metaKey),
|
|
878
|
+
}, Yt = !1, Xt = !!(e.ctrlKey || e.metaKey), z.value.length > 1 && z.value.includes(t)) {
|
|
832
879
|
let e = {};
|
|
833
|
-
|
|
834
|
-
let n =
|
|
880
|
+
z.value.forEach((t) => {
|
|
881
|
+
let n = F(t);
|
|
835
882
|
n && (e[t] = {
|
|
836
883
|
x: n.x,
|
|
837
884
|
y: n.y
|
|
@@ -845,23 +892,23 @@ var b = {
|
|
|
845
892
|
};
|
|
846
893
|
} else qt.value = null;
|
|
847
894
|
D.value = t, y("node-drag-start", n);
|
|
848
|
-
},
|
|
849
|
-
|
|
850
|
-
let e =
|
|
851
|
-
|
|
852
|
-
},
|
|
853
|
-
(J.value || D.value) && (
|
|
895
|
+
}, Wr = 0, Gr = null, Kr = () => {
|
|
896
|
+
Wr = 0;
|
|
897
|
+
let e = Gr;
|
|
898
|
+
Gr = null, e && Jr(e);
|
|
899
|
+
}, qr = (e) => {
|
|
900
|
+
(J.value || D.value) && (Gr = {
|
|
854
901
|
clientX: e.clientX,
|
|
855
902
|
clientY: e.clientY
|
|
856
|
-
},
|
|
857
|
-
},
|
|
903
|
+
}, Wr ||= requestAnimationFrame(Kr));
|
|
904
|
+
}, Jr = (e) => {
|
|
858
905
|
if (J.value) {
|
|
859
|
-
|
|
906
|
+
ei(e);
|
|
860
907
|
return;
|
|
861
908
|
}
|
|
862
909
|
if (!D.value) return;
|
|
863
910
|
let t = X(e);
|
|
864
|
-
!Yt && Jt && Math.hypot(e.clientX - Jt.x, e.clientY - Jt.y) > kt && (Yt = !0, !Xt && !
|
|
911
|
+
!Yt && Jt && Math.hypot(e.clientX - Jt.x, e.clientY - Jt.y) > kt && (Yt = !0, !Xt && !z.value.includes(D.value) && (z.value = H([], [D.value], jn.value), B.value = [], y("node-select", z.value.includes(D.value) ? F(D.value) : null), V()));
|
|
865
912
|
let n = qt.value;
|
|
866
913
|
if (n) {
|
|
867
914
|
let e = t.x - n.start.x, r = t.y - n.start.y;
|
|
@@ -876,14 +923,14 @@ var b = {
|
|
|
876
923
|
y: t.y - Kt.value.y
|
|
877
924
|
} : e);
|
|
878
925
|
T();
|
|
879
|
-
},
|
|
880
|
-
if (
|
|
881
|
-
|
|
926
|
+
}, Yr = () => {
|
|
927
|
+
if (Wr && (cancelAnimationFrame(Wr), Kr()), J.value) {
|
|
928
|
+
ti();
|
|
882
929
|
return;
|
|
883
930
|
}
|
|
884
|
-
D.value && (Yt &&
|
|
885
|
-
}, J = d(null),
|
|
886
|
-
let t =
|
|
931
|
+
D.value && (Yt && Un(), D.value = null, qt.value = null, Jt = null, Yt = !1, y("node-drag-end"));
|
|
932
|
+
}, J = d(null), Xr = (e, t, n) => Math.min(n, Math.max(t, e)), Zr = (e) => {
|
|
933
|
+
let t = R(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
|
|
887
934
|
return [
|
|
888
935
|
{
|
|
889
936
|
side: "nw",
|
|
@@ -926,9 +973,9 @@ var b = {
|
|
|
926
973
|
y: 0
|
|
927
974
|
}
|
|
928
975
|
];
|
|
929
|
-
},
|
|
976
|
+
}, Qr = (e) => e === "nw" || e === "se" ? "nwse-resize" : e === "ne" || e === "sw" ? "nesw-resize" : e === "n" || e === "s" ? "ns-resize" : "ew-resize", $r = (e, t, n) => {
|
|
930
977
|
if (!v.editable || v.config.nodeResizable === !1 || !t) return;
|
|
931
|
-
let { w: r, h: i } =
|
|
978
|
+
let { w: r, h: i } = L(t);
|
|
932
979
|
J.value = {
|
|
933
980
|
id: t.id,
|
|
934
981
|
side: n,
|
|
@@ -937,19 +984,19 @@ var b = {
|
|
|
937
984
|
startW: r,
|
|
938
985
|
startH: i
|
|
939
986
|
}, y("node-resize-start", t);
|
|
940
|
-
},
|
|
987
|
+
}, ei = (e) => {
|
|
941
988
|
let t = J.value;
|
|
942
989
|
if (!t) return;
|
|
943
|
-
let n =
|
|
990
|
+
let n = F(t.id);
|
|
944
991
|
if (!n) return;
|
|
945
992
|
let r = X(e), i = t.startW, a = t.startH, o = n.x, s = n.y;
|
|
946
993
|
if (t.anchorX !== null) {
|
|
947
994
|
let e = t.side.includes("e");
|
|
948
|
-
i =
|
|
995
|
+
i = Xr(e ? r.x - t.anchorX : t.anchorX - r.x, Ft, It), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
|
|
949
996
|
}
|
|
950
997
|
if (t.anchorY !== null) {
|
|
951
998
|
let e = t.side.includes("s");
|
|
952
|
-
a =
|
|
999
|
+
a = Xr(e ? r.y - t.anchorY : t.anchorY - r.y, Lt, Rt), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
|
|
953
1000
|
}
|
|
954
1001
|
w.value = w.value.map((e) => e.id === t.id ? {
|
|
955
1002
|
...e,
|
|
@@ -958,15 +1005,15 @@ var b = {
|
|
|
958
1005
|
width: i,
|
|
959
1006
|
height: a
|
|
960
1007
|
} : e), T();
|
|
961
|
-
},
|
|
1008
|
+
}, ti = () => {
|
|
962
1009
|
let e = J.value;
|
|
963
|
-
J.value = null, e && (
|
|
964
|
-
},
|
|
965
|
-
if (!
|
|
966
|
-
let e =
|
|
967
|
-
return e.length === 1 &&
|
|
968
|
-
}), Y = d(null),
|
|
969
|
-
let t =
|
|
1010
|
+
J.value = null, e && (Un(), y("node-resize-end", F(e.id) || null));
|
|
1011
|
+
}, ni = t(() => v.editable && v.config.nodeResizable !== !1), ri = t(() => {
|
|
1012
|
+
if (!ni.value) return null;
|
|
1013
|
+
let e = z.value;
|
|
1014
|
+
return e.length === 1 && F(e[0]) || null;
|
|
1015
|
+
}), Y = d(null), ii = (e) => {
|
|
1016
|
+
let t = R(e);
|
|
970
1017
|
return [
|
|
971
1018
|
{
|
|
972
1019
|
side: "top",
|
|
@@ -989,7 +1036,7 @@ var b = {
|
|
|
989
1036
|
y: 0
|
|
990
1037
|
}
|
|
991
1038
|
];
|
|
992
|
-
},
|
|
1039
|
+
}, ai = (e, t) => {
|
|
993
1040
|
let n = O.value;
|
|
994
1041
|
if (!n) return null;
|
|
995
1042
|
let r = e, i = t;
|
|
@@ -1003,7 +1050,7 @@ var b = {
|
|
|
1003
1050
|
x: s.x,
|
|
1004
1051
|
y: s.y
|
|
1005
1052
|
};
|
|
1006
|
-
},
|
|
1053
|
+
}, oi = (e, t) => {
|
|
1007
1054
|
let n = O.value;
|
|
1008
1055
|
if (!n) return null;
|
|
1009
1056
|
let r = n.createSVGPoint();
|
|
@@ -1015,11 +1062,11 @@ var b = {
|
|
|
1015
1062
|
x: a.x,
|
|
1016
1063
|
y: a.y
|
|
1017
1064
|
};
|
|
1018
|
-
}, X = (e) =>
|
|
1065
|
+
}, X = (e) => ai(e) ?? {
|
|
1019
1066
|
x: 0,
|
|
1020
1067
|
y: 0
|
|
1021
|
-
},
|
|
1022
|
-
let r =
|
|
1068
|
+
}, si = (e, t, n) => {
|
|
1069
|
+
let r = F(t);
|
|
1023
1070
|
if (!r || !O.value) return;
|
|
1024
1071
|
let i = X(e);
|
|
1025
1072
|
Y.value = {
|
|
@@ -1034,40 +1081,40 @@ var b = {
|
|
|
1034
1081
|
try {
|
|
1035
1082
|
e.target.setPointerCapture?.(e.pointerId);
|
|
1036
1083
|
} catch {}
|
|
1037
|
-
|
|
1038
|
-
}, Z = 0,
|
|
1084
|
+
pi();
|
|
1085
|
+
}, Z = 0, ci = null, li = () => {
|
|
1039
1086
|
Z = 0;
|
|
1040
|
-
let e =
|
|
1041
|
-
|
|
1042
|
-
},
|
|
1043
|
-
Y.value && (
|
|
1087
|
+
let e = ci;
|
|
1088
|
+
ci = null, e && Y.value && gi(e);
|
|
1089
|
+
}, ui = (e) => {
|
|
1090
|
+
Y.value && (ci = {
|
|
1044
1091
|
clientX: e.clientX,
|
|
1045
1092
|
clientY: e.clientY
|
|
1046
|
-
}, Z ||= requestAnimationFrame(
|
|
1047
|
-
},
|
|
1048
|
-
Z && (cancelAnimationFrame(Z),
|
|
1049
|
-
},
|
|
1050
|
-
|
|
1051
|
-
},
|
|
1052
|
-
|
|
1053
|
-
},
|
|
1093
|
+
}, Z ||= requestAnimationFrame(li));
|
|
1094
|
+
}, di = () => {
|
|
1095
|
+
Z && (cancelAnimationFrame(Z), li()), Y.value && _i();
|
|
1096
|
+
}, fi = !1, pi = () => {
|
|
1097
|
+
fi || (fi = !0, window.addEventListener("mousemove", ui, !0), window.addEventListener("mouseup", di, !0));
|
|
1098
|
+
}, mi = () => {
|
|
1099
|
+
fi && (fi = !1, window.removeEventListener("mousemove", ui, !0), window.removeEventListener("mouseup", di, !0));
|
|
1100
|
+
}, hi = (e, t, n) => {
|
|
1054
1101
|
let r = w.value;
|
|
1055
1102
|
for (let i = r.length - 1; i >= 0; i--) {
|
|
1056
1103
|
let a = r[i];
|
|
1057
1104
|
if (a.id === n) continue;
|
|
1058
|
-
let o =
|
|
1105
|
+
let o = R(a);
|
|
1059
1106
|
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;
|
|
1060
1107
|
}
|
|
1061
1108
|
return null;
|
|
1062
|
-
},
|
|
1109
|
+
}, gi = (e) => {
|
|
1063
1110
|
let t = Y.value;
|
|
1064
1111
|
if (!t) return;
|
|
1065
1112
|
let n = X(e);
|
|
1066
1113
|
t.px = n.x, t.py = n.y;
|
|
1067
|
-
let r =
|
|
1114
|
+
let r = hi(n.x, n.y, t.fromId);
|
|
1068
1115
|
t.overId = r ? r.id : null;
|
|
1069
|
-
},
|
|
1070
|
-
|
|
1116
|
+
}, _i = () => {
|
|
1117
|
+
mi();
|
|
1071
1118
|
let e = Y.value;
|
|
1072
1119
|
if (Y.value = null, !e || !e.overId || e.overId === e.fromId) return;
|
|
1073
1120
|
let t = {
|
|
@@ -1079,8 +1126,8 @@ var b = {
|
|
|
1079
1126
|
toAnchor: "edge"
|
|
1080
1127
|
};
|
|
1081
1128
|
k.value.push(t), y("edge-create", t);
|
|
1082
|
-
},
|
|
1083
|
-
let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } =
|
|
1129
|
+
}, vi = (e, t, n) => {
|
|
1130
|
+
let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = L(e);
|
|
1084
1131
|
if (!n || n === "center" || a === 0 && o === 0) return {
|
|
1085
1132
|
x: r,
|
|
1086
1133
|
y: i
|
|
@@ -1090,20 +1137,20 @@ var b = {
|
|
|
1090
1137
|
x: r + a * p,
|
|
1091
1138
|
y: i + o * p
|
|
1092
1139
|
};
|
|
1093
|
-
},
|
|
1140
|
+
}, yi = t(() => {
|
|
1094
1141
|
let e = /* @__PURE__ */ new Map();
|
|
1095
1142
|
M.value.forEach((t) => {
|
|
1096
|
-
let n =
|
|
1143
|
+
let n = P.value[t.id];
|
|
1097
1144
|
n && !n.hidden && (e.has(n.key) || e.set(n.key, []), e.get(n.key).push(t));
|
|
1098
1145
|
});
|
|
1099
1146
|
let t = {};
|
|
1100
1147
|
return e.forEach((e, n) => {
|
|
1101
|
-
let [r, i] = n.split("__"), a =
|
|
1148
|
+
let [r, i] = n.split("__"), a = F(r), o = F(i);
|
|
1102
1149
|
if (!a || !o) return;
|
|
1103
1150
|
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, m = e.length, ee = Ot;
|
|
1104
1151
|
if (m > 1) {
|
|
1105
1152
|
let e = (m - 1) / 2 * Ot, t = (e) => {
|
|
1106
|
-
let { w: t, h: n } =
|
|
1153
|
+
let { w: t, h: n } = L(e);
|
|
1107
1154
|
return Math.max(4, (Math.abs(f) * t + Math.abs(p) * n) / 2 - 6);
|
|
1108
1155
|
}, n = Math.min(1, t(a) / e, t(o) / e);
|
|
1109
1156
|
ee = Ot * Math.max(.35, n);
|
|
@@ -1122,12 +1169,12 @@ var b = {
|
|
|
1122
1169
|
bulge: Math.min(l * .15, 50)
|
|
1123
1170
|
};
|
|
1124
1171
|
}), t;
|
|
1125
|
-
}),
|
|
1126
|
-
let t =
|
|
1172
|
+
}), bi = (e) => {
|
|
1173
|
+
let t = P.value[e.id], n = t && yi.value[t.key];
|
|
1127
1174
|
if (!n) return null;
|
|
1128
|
-
let r =
|
|
1175
|
+
let r = F(e.from), i = F(e.to);
|
|
1129
1176
|
if (!r || !i) return null;
|
|
1130
|
-
let a = n.slots[e.id] || 0, o = a * n.gap, s =
|
|
1177
|
+
let a = n.slots[e.id] || 0, o = a * n.gap, s = vi(r, i, e.fromAnchor), c = vi(i, r, e.toAnchor);
|
|
1131
1178
|
return {
|
|
1132
1179
|
frame: n,
|
|
1133
1180
|
slot: a,
|
|
@@ -1140,8 +1187,8 @@ var b = {
|
|
|
1140
1187
|
y: c.y + n.ny * o
|
|
1141
1188
|
}
|
|
1142
1189
|
};
|
|
1143
|
-
},
|
|
1144
|
-
let t =
|
|
1190
|
+
}, xi = (e) => {
|
|
1191
|
+
let t = bi(e);
|
|
1145
1192
|
if (!t) return "";
|
|
1146
1193
|
let { from: n, to: r, frame: i, slot: a } = t, o = a * i.gap;
|
|
1147
1194
|
if (E.value === "straight") return `M ${n.x} ${n.y} L ${r.x} ${r.y}`;
|
|
@@ -1155,8 +1202,8 @@ var b = {
|
|
|
1155
1202
|
}
|
|
1156
1203
|
let s = (n.x + r.x) / 2 + i.nx * i.bulge, c = (n.y + r.y) / 2 + i.ny * i.bulge;
|
|
1157
1204
|
return `M ${n.x} ${n.y} Q ${s} ${c} ${r.x} ${r.y}`;
|
|
1158
|
-
},
|
|
1159
|
-
let n =
|
|
1205
|
+
}, Si = (e, t) => {
|
|
1206
|
+
let n = bi(e);
|
|
1160
1207
|
if (!n) return {
|
|
1161
1208
|
x: 0,
|
|
1162
1209
|
y: 0
|
|
@@ -1197,29 +1244,29 @@ var b = {
|
|
|
1197
1244
|
x: (1 - t) * (1 - t) * r.x + 2 * (1 - t) * t * c + t * t * i.x,
|
|
1198
1245
|
y: (1 - t) * (1 - t) * r.y + 2 * (1 - t) * t * l + t * t * i.y
|
|
1199
1246
|
};
|
|
1200
|
-
},
|
|
1247
|
+
}, Ci = t(() => Y.value ? F(Y.value.fromId) : null), wi = t(() => Y.value && Y.value.overId ? F(Y.value.overId) : null), Ti = t(() => Ci.value ? I(Ci.value) : "#00f0ff"), Ei = t(() => {
|
|
1201
1248
|
let e = Y.value;
|
|
1202
1249
|
if (!e) return {
|
|
1203
1250
|
x: 0,
|
|
1204
1251
|
y: 0
|
|
1205
1252
|
};
|
|
1206
|
-
let t =
|
|
1207
|
-
return t &&
|
|
1253
|
+
let t = wi.value;
|
|
1254
|
+
return t && Ci.value ? vi(t, Ci.value, "edge") : {
|
|
1208
1255
|
x: e.px,
|
|
1209
1256
|
y: e.py
|
|
1210
1257
|
};
|
|
1211
|
-
}),
|
|
1212
|
-
let e =
|
|
1258
|
+
}), Di = t(() => {
|
|
1259
|
+
let e = wi.value;
|
|
1213
1260
|
if (!e) return null;
|
|
1214
|
-
let t =
|
|
1261
|
+
let t = R(e);
|
|
1215
1262
|
return {
|
|
1216
1263
|
x: e.x + t.x - 4,
|
|
1217
1264
|
y: e.y + t.y - 4,
|
|
1218
1265
|
w: t.width + 8,
|
|
1219
1266
|
h: t.height + 8
|
|
1220
1267
|
};
|
|
1221
|
-
}),
|
|
1222
|
-
let t = e.nodeIds.map((e) =>
|
|
1268
|
+
}), Oi = (e) => {
|
|
1269
|
+
let t = e.nodeIds.map((e) => F(e)).filter(Boolean);
|
|
1223
1270
|
if (t.length === 0) return null;
|
|
1224
1271
|
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;
|
|
1225
1272
|
return {
|
|
@@ -1228,38 +1275,44 @@ var b = {
|
|
|
1228
1275
|
width: a - r,
|
|
1229
1276
|
height: o - i
|
|
1230
1277
|
};
|
|
1231
|
-
},
|
|
1278
|
+
}, ki = t(() => v.groups.map((e) => ({
|
|
1232
1279
|
...e,
|
|
1233
|
-
rect:
|
|
1234
|
-
})).filter((e) => e.rect)), Q = (e) => kn(e) ?
|
|
1235
|
-
let t =
|
|
1280
|
+
rect: Oi(e)
|
|
1281
|
+
})).filter((e) => e.rect)), Q = (e) => kn(e) ? Bn.value : (F(e.from), e.centerText && e.centerText.color || "#00f0ff"), Ai = (e) => {
|
|
1282
|
+
let t = P.value[e.id];
|
|
1236
1283
|
return !!t && !t.hidden;
|
|
1237
|
-
},
|
|
1284
|
+
}, ji = t(() => [...new Set(M.value.map(Q))].map((e) => ({
|
|
1238
1285
|
key: String(e).replace("#", ""),
|
|
1239
1286
|
color: e
|
|
1240
|
-
}))),
|
|
1287
|
+
}))), Mi = (e) => {
|
|
1241
1288
|
let t = e.endMarker;
|
|
1242
1289
|
if (!t || t === "none") return "";
|
|
1243
1290
|
let n = Q(e) || "#00f0ff", r = String(n).replace("#", "");
|
|
1244
1291
|
return `url(#${t === "dot" ? "edge-dot" : "edge-arrow"}-${r})`;
|
|
1245
|
-
},
|
|
1292
|
+
}, Ni = /* @__PURE__ */ new Map(), Pi = {
|
|
1246
1293
|
nodes: null,
|
|
1247
1294
|
edges: null,
|
|
1248
1295
|
mode: null,
|
|
1249
1296
|
epoch: -1
|
|
1250
|
-
},
|
|
1251
|
-
let e =
|
|
1252
|
-
(e.nodes !== w.value || e.edges !== M.value || e.mode !== E.value || e.epoch !== zt) && (
|
|
1297
|
+
}, Fi = () => {
|
|
1298
|
+
let e = Pi;
|
|
1299
|
+
(e.nodes !== w.value || e.edges !== M.value || e.mode !== E.value || e.epoch !== zt) && (Pi = {
|
|
1253
1300
|
nodes: w.value,
|
|
1254
1301
|
edges: M.value,
|
|
1255
1302
|
mode: E.value,
|
|
1256
1303
|
epoch: zt
|
|
1257
|
-
},
|
|
1304
|
+
}, Ni = /* @__PURE__ */ new Map());
|
|
1258
1305
|
}, $ = (e) => {
|
|
1259
|
-
|
|
1260
|
-
let t =
|
|
1261
|
-
return t === void 0 && (t =
|
|
1262
|
-
},
|
|
1306
|
+
Fi();
|
|
1307
|
+
let t = Ni.get(e.id);
|
|
1308
|
+
return t === void 0 && (t = xi(e), Ni.set(e.id, t)), t;
|
|
1309
|
+
}, Ii = (e, t = 1) => `${2 / e.speed * t}s`, Li = (e) => `${3 / e.speed}s`, Ri = (e) => {
|
|
1310
|
+
let t = Rr(e);
|
|
1311
|
+
return t === "flow" || t === "all";
|
|
1312
|
+
}, zi = (e) => {
|
|
1313
|
+
let t = Rr(e);
|
|
1314
|
+
return t === "particle" || t === "all";
|
|
1315
|
+
}, Bi = (e) => x(e).text, Vi = (e) => !!e && String(x(e).text ?? "").trim() !== "", Hi = (e, t) => {
|
|
1263
1316
|
if (!e) return null;
|
|
1264
1317
|
let n = x(e), r = Number(t.fontSize) || Number(n.fontSize) || 8, i = String(n.text ?? ""), a = 0;
|
|
1265
1318
|
for (let e of i) a += e.charCodeAt(0) > 11904 ? 1 : .62;
|
|
@@ -1267,34 +1320,34 @@ var b = {
|
|
|
1267
1320
|
w: Math.max(14, a * r + 8),
|
|
1268
1321
|
h: Math.max(12, r + 6)
|
|
1269
1322
|
};
|
|
1270
|
-
},
|
|
1271
|
-
let n =
|
|
1323
|
+
}, Ui = (e, t) => {
|
|
1324
|
+
let n = Si(e, Math.max(0, t - .005)), r = Si(e, Math.min(1, t + .005));
|
|
1272
1325
|
return Math.atan2(r.y - n.y, r.x - n.x) * 180 / Math.PI;
|
|
1273
|
-
},
|
|
1326
|
+
}, Wi = (e) => {
|
|
1274
1327
|
let t = e % 180;
|
|
1275
1328
|
return t > 90 && (t -= 180), t < -90 && (t += 180), t;
|
|
1276
|
-
},
|
|
1329
|
+
}, Gi = (e, t, n) => `translate(${t.x}, ${t.y}) rotate(${(x(e).rotation || 0) + (n || 0)})`, Ki = t(() => {
|
|
1277
1330
|
let e = [];
|
|
1278
|
-
for (let t of
|
|
1279
|
-
let n =
|
|
1331
|
+
for (let t of G.value) {
|
|
1332
|
+
let n = P.value[t.id];
|
|
1280
1333
|
if (!n) continue;
|
|
1281
1334
|
let r = n.merged && n.representative, i = !n.merged && (t.fromText || t.centerText || t.toText);
|
|
1282
1335
|
if (!r && !i) continue;
|
|
1283
|
-
let a =
|
|
1336
|
+
let a = F(t.from), o = F(t.to);
|
|
1284
1337
|
a && o && e.push({
|
|
1285
1338
|
id: t.id,
|
|
1286
1339
|
edge: t,
|
|
1287
1340
|
info: n,
|
|
1288
|
-
color: a && ie[a.
|
|
1289
|
-
start:
|
|
1290
|
-
center:
|
|
1291
|
-
end:
|
|
1292
|
-
startAngle:
|
|
1293
|
-
centerAngle:
|
|
1294
|
-
endAngle:
|
|
1295
|
-
fromBox:
|
|
1296
|
-
centerBox:
|
|
1297
|
-
toBox:
|
|
1341
|
+
color: a && ie[a.nodeType] || "#00f0ff",
|
|
1342
|
+
start: Si(t, .28),
|
|
1343
|
+
center: Si(t, .5),
|
|
1344
|
+
end: Si(t, .72),
|
|
1345
|
+
startAngle: Wi(Ui(t, .28)),
|
|
1346
|
+
centerAngle: Wi(Ui(t, .5)),
|
|
1347
|
+
endAngle: Wi(Ui(t, .72)),
|
|
1348
|
+
fromBox: Hi(t.fromText, t),
|
|
1349
|
+
centerBox: Hi(t.centerText, t),
|
|
1350
|
+
toBox: Hi(t.toText, t)
|
|
1298
1351
|
});
|
|
1299
1352
|
}
|
|
1300
1353
|
return e;
|
|
@@ -1308,29 +1361,34 @@ var b = {
|
|
|
1308
1361
|
addEdges: un,
|
|
1309
1362
|
updateNodes: dn,
|
|
1310
1363
|
updateEdges: fn,
|
|
1311
|
-
clientToSvg:
|
|
1312
|
-
svgToClient:
|
|
1364
|
+
clientToSvg: ai,
|
|
1365
|
+
svgToClient: oi,
|
|
1366
|
+
moveLayerUp: Fn,
|
|
1367
|
+
moveLayerDown: In,
|
|
1368
|
+
moveToFront: Ln,
|
|
1369
|
+
moveToBack: Rn,
|
|
1370
|
+
downloadSVG: zn
|
|
1313
1371
|
}), (t, c) => (u(), r("svg", {
|
|
1314
1372
|
ref_key: "svgRef",
|
|
1315
1373
|
ref: O,
|
|
1316
1374
|
class: "topology-svg",
|
|
1317
|
-
style: s(
|
|
1318
|
-
viewBox: `${
|
|
1319
|
-
onMousedown:
|
|
1320
|
-
onMousemove:
|
|
1321
|
-
onMouseup:
|
|
1322
|
-
onMouseleave:
|
|
1323
|
-
onClick:
|
|
1324
|
-
onWheel: g(
|
|
1375
|
+
style: s(Cr.value),
|
|
1376
|
+
viewBox: `${Zn.value} ${Qn.value} ${U.value} ${W.value}`,
|
|
1377
|
+
onMousedown: pr,
|
|
1378
|
+
onMousemove: qr,
|
|
1379
|
+
onMouseup: Yr,
|
|
1380
|
+
onMouseleave: Yr,
|
|
1381
|
+
onClick: Kn,
|
|
1382
|
+
onWheel: g(ir, ["prevent"])
|
|
1325
1383
|
}, [
|
|
1326
1384
|
i("defs", null, [
|
|
1327
1385
|
c[3] ||= a("<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>", 2),
|
|
1328
1386
|
i("radialGradient", {
|
|
1329
1387
|
id: "bg-grid",
|
|
1330
|
-
cx:
|
|
1331
|
-
cy:
|
|
1332
|
-
r:
|
|
1333
|
-
}, [(u(!0), r(e, null, f(
|
|
1388
|
+
cx: Or.value.cx,
|
|
1389
|
+
cy: Or.value.cy,
|
|
1390
|
+
r: Or.value.r
|
|
1391
|
+
}, [(u(!0), r(e, null, f(Or.value.stops, (e, t) => (u(), r("stop", {
|
|
1334
1392
|
key: `bg-stop-${t}`,
|
|
1335
1393
|
offset: e.offset,
|
|
1336
1394
|
"stop-color": e.color,
|
|
@@ -1357,7 +1415,7 @@ var b = {
|
|
|
1357
1415
|
}, null, 8, de)
|
|
1358
1416
|
], 8, ce))), 128)),
|
|
1359
1417
|
c[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),
|
|
1360
|
-
(u(!0), r(e, null, f(
|
|
1418
|
+
(u(!0), r(e, null, f(ji.value, (e) => (u(), r("marker", {
|
|
1361
1419
|
key: `m-arrow-${e.key}`,
|
|
1362
1420
|
id: `edge-arrow-${e.key}`,
|
|
1363
1421
|
viewBox: "0 0 10 10",
|
|
@@ -1371,7 +1429,7 @@ var b = {
|
|
|
1371
1429
|
d: "M1,2.5 L9,5 L1,7.5 Z",
|
|
1372
1430
|
fill: e.color
|
|
1373
1431
|
}, null, 8, pe)], 8, fe))), 128)),
|
|
1374
|
-
(u(!0), r(e, null, f(
|
|
1432
|
+
(u(!0), r(e, null, f(ji.value, (e) => (u(), r("marker", {
|
|
1375
1433
|
key: `m-dot-${e.key}`,
|
|
1376
1434
|
id: `edge-dot-${e.key}`,
|
|
1377
1435
|
viewBox: "0 0 10 10",
|
|
@@ -1389,31 +1447,31 @@ var b = {
|
|
|
1389
1447
|
}, null, 8, he)], 8, me))), 128))
|
|
1390
1448
|
]),
|
|
1391
1449
|
i("rect", {
|
|
1392
|
-
width:
|
|
1393
|
-
height:
|
|
1394
|
-
x:
|
|
1395
|
-
y:
|
|
1450
|
+
width: U.value,
|
|
1451
|
+
height: W.value,
|
|
1452
|
+
x: Zn.value,
|
|
1453
|
+
y: Qn.value,
|
|
1396
1454
|
fill: "url(#bg-grid)"
|
|
1397
1455
|
}, null, 8, ge),
|
|
1398
|
-
|
|
1456
|
+
wr.value ? (u(), r(e, { key: 0 }, [i("pattern", {
|
|
1399
1457
|
id: "grid",
|
|
1400
|
-
width:
|
|
1401
|
-
height:
|
|
1458
|
+
width: Er.value,
|
|
1459
|
+
height: Er.value,
|
|
1402
1460
|
patternUnits: "userSpaceOnUse"
|
|
1403
1461
|
}, [i("path", {
|
|
1404
|
-
d: `M ${
|
|
1462
|
+
d: `M ${Er.value} 0 L 0 0 0 ${Er.value}`,
|
|
1405
1463
|
fill: "none",
|
|
1406
|
-
stroke:
|
|
1464
|
+
stroke: Tr.value,
|
|
1407
1465
|
"stroke-width": "0.5"
|
|
1408
1466
|
}, null, 8, ve)], 8, _e), i("rect", {
|
|
1409
|
-
width:
|
|
1410
|
-
height:
|
|
1411
|
-
x:
|
|
1412
|
-
y:
|
|
1467
|
+
width: U.value,
|
|
1468
|
+
height: W.value,
|
|
1469
|
+
x: Zn.value,
|
|
1470
|
+
y: Qn.value,
|
|
1413
1471
|
fill: "url(#grid)",
|
|
1414
|
-
opacity:
|
|
1472
|
+
opacity: Dr.value
|
|
1415
1473
|
}, null, 8, ye)], 64)) : n("", !0),
|
|
1416
|
-
|
|
1474
|
+
kr.value ? (u(), r("g", be, [...c[5] ||= [
|
|
1417
1475
|
i("line", {
|
|
1418
1476
|
x1: "-22",
|
|
1419
1477
|
y1: "0",
|
|
@@ -1445,7 +1503,7 @@ var b = {
|
|
|
1445
1503
|
opacity: "0.8"
|
|
1446
1504
|
}, null, -1)
|
|
1447
1505
|
]])) : n("", !0),
|
|
1448
|
-
(u(!0), r(e, null, f(
|
|
1506
|
+
(u(!0), r(e, null, f(ki.value, (e) => (u(), r("g", { key: e.id }, [
|
|
1449
1507
|
i("rect", {
|
|
1450
1508
|
x: e.rect.x,
|
|
1451
1509
|
y: e.rect.y,
|
|
@@ -1507,16 +1565,16 @@ var b = {
|
|
|
1507
1565
|
"letter-spacing": "0.5"
|
|
1508
1566
|
}, m(e.label), 9, De)
|
|
1509
1567
|
]))), 128)),
|
|
1510
|
-
(u(!0), r(e, null, f(
|
|
1568
|
+
(u(!0), r(e, null, f(G.value, (e) => (u(), r("path", {
|
|
1511
1569
|
key: `base-${e.id}`,
|
|
1512
1570
|
d: $(e),
|
|
1513
1571
|
fill: "none",
|
|
1514
1572
|
stroke: "#1a2744",
|
|
1515
1573
|
"stroke-width": "2",
|
|
1516
1574
|
"stroke-linecap": "round",
|
|
1517
|
-
"marker-end":
|
|
1575
|
+
"marker-end": Mi(e)
|
|
1518
1576
|
}, null, 8, Oe))), 128)),
|
|
1519
|
-
(u(!0), r(e, null, f(
|
|
1577
|
+
(u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `glow-${t.id}` }, [Ir.value ? (u(), r("path", {
|
|
1520
1578
|
key: 0,
|
|
1521
1579
|
d: $(t),
|
|
1522
1580
|
fill: "none",
|
|
@@ -1526,16 +1584,16 @@ var b = {
|
|
|
1526
1584
|
opacity: "0.15",
|
|
1527
1585
|
filter: "url(#glow-strong)"
|
|
1528
1586
|
}, null, 8, ke)) : n("", !0)], 64))), 128)),
|
|
1529
|
-
(u(!0), r(e, null, f(
|
|
1587
|
+
(u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `sel-${t.id}` }, [kn(t) ? (u(), r("path", {
|
|
1530
1588
|
key: 0,
|
|
1531
1589
|
d: $(t),
|
|
1532
1590
|
fill: "none",
|
|
1533
|
-
stroke:
|
|
1591
|
+
stroke: Bn.value,
|
|
1534
1592
|
"stroke-width": "4",
|
|
1535
1593
|
opacity: "0.35",
|
|
1536
1594
|
filter: "url(#glow-strong)"
|
|
1537
1595
|
}, null, 8, Ae)) : n("", !0)], 64))), 128)),
|
|
1538
|
-
(u(!0), r(e, null, f(
|
|
1596
|
+
(u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `flow-${t.id}` }, [Ri(t) ? (u(), r("g", je, [
|
|
1539
1597
|
i("path", {
|
|
1540
1598
|
d: $(t),
|
|
1541
1599
|
fill: "none",
|
|
@@ -1548,7 +1606,7 @@ var b = {
|
|
|
1548
1606
|
attributeName: "stroke-dashoffset",
|
|
1549
1607
|
from: "0",
|
|
1550
1608
|
to: "-52",
|
|
1551
|
-
dur:
|
|
1609
|
+
dur: Ii(t),
|
|
1552
1610
|
repeatCount: "indefinite"
|
|
1553
1611
|
}, null, 8, Ne)], 8, Me),
|
|
1554
1612
|
i("path", {
|
|
@@ -1563,7 +1621,7 @@ var b = {
|
|
|
1563
1621
|
attributeName: "stroke-dashoffset",
|
|
1564
1622
|
from: "-30",
|
|
1565
1623
|
to: "-82",
|
|
1566
|
-
dur:
|
|
1624
|
+
dur: Ii(t, 1.3),
|
|
1567
1625
|
repeatCount: "indefinite"
|
|
1568
1626
|
}, null, 8, Fe)], 8, Pe),
|
|
1569
1627
|
i("path", {
|
|
@@ -1579,18 +1637,18 @@ var b = {
|
|
|
1579
1637
|
attributeName: "stroke-dashoffset",
|
|
1580
1638
|
from: "0",
|
|
1581
1639
|
to: "-84",
|
|
1582
|
-
dur:
|
|
1640
|
+
dur: Ii(t, .8),
|
|
1583
1641
|
repeatCount: "indefinite"
|
|
1584
1642
|
}, null, 8, Le)], 8, Ie)
|
|
1585
1643
|
])) : n("", !0)], 64))), 128)),
|
|
1586
|
-
(u(!0), r(e, null, f(
|
|
1644
|
+
(u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `particle-${t.id}` }, [zi(t) ? (u(), r("g", Re, [i("circle", {
|
|
1587
1645
|
r: "3",
|
|
1588
1646
|
fill: Q(t),
|
|
1589
1647
|
opacity: "0.9",
|
|
1590
1648
|
filter: "url(#glow-core)"
|
|
1591
1649
|
}, [i("animateMotion", {
|
|
1592
1650
|
path: $(t),
|
|
1593
|
-
dur:
|
|
1651
|
+
dur: Li(t),
|
|
1594
1652
|
repeatCount: "indefinite"
|
|
1595
1653
|
}, null, 8, Be)], 8, ze), i("circle", {
|
|
1596
1654
|
r: "8",
|
|
@@ -1599,10 +1657,10 @@ var b = {
|
|
|
1599
1657
|
filter: "url(#glow-strong)"
|
|
1600
1658
|
}, [i("animateMotion", {
|
|
1601
1659
|
path: $(t),
|
|
1602
|
-
dur:
|
|
1660
|
+
dur: Li(t),
|
|
1603
1661
|
repeatCount: "indefinite"
|
|
1604
1662
|
}, null, 8, He)], 8, Ve)])) : n("", !0)], 64))), 128)),
|
|
1605
|
-
(u(!0), r(e, null, f(
|
|
1663
|
+
(u(!0), r(e, null, f(Ki.value, (t) => (u(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (u(), r("g", {
|
|
1606
1664
|
key: 0,
|
|
1607
1665
|
transform: `translate(${t.center.x}, ${t.center.y}) rotate(${t.centerAngle})`
|
|
1608
1666
|
}, [i("rect", {
|
|
@@ -1624,17 +1682,17 @@ var b = {
|
|
|
1624
1682
|
"font-family": "'SF Mono', monospace",
|
|
1625
1683
|
opacity: "1"
|
|
1626
1684
|
}, m(t.info.count), 9, Ge)], 8, Ue)) : t.info.merged ? n("", !0) : (u(), r("g", Ke, [
|
|
1627
|
-
|
|
1685
|
+
Vi(t.edge.fromText) ? (u(), r("g", {
|
|
1628
1686
|
key: 0,
|
|
1629
|
-
transform:
|
|
1630
|
-
}, [
|
|
1687
|
+
transform: Gi(t.edge.fromText, t.start, t.startAngle)
|
|
1688
|
+
}, [Ar.value ? (u(), r("rect", {
|
|
1631
1689
|
key: 0,
|
|
1632
1690
|
x: -t.fromBox.w / 2,
|
|
1633
1691
|
y: -t.fromBox.h / 2,
|
|
1634
1692
|
width: t.fromBox.w,
|
|
1635
1693
|
height: t.fromBox.h,
|
|
1636
1694
|
rx: "3",
|
|
1637
|
-
fill:
|
|
1695
|
+
fill: jr.value,
|
|
1638
1696
|
opacity: "0.92",
|
|
1639
1697
|
stroke: C(t.edge, t.edge.fromText),
|
|
1640
1698
|
"stroke-opacity": "0.35",
|
|
@@ -1648,18 +1706,18 @@ var b = {
|
|
|
1648
1706
|
"font-family": "'SF Mono', monospace",
|
|
1649
1707
|
"font-weight": "500",
|
|
1650
1708
|
opacity: "0.9"
|
|
1651
|
-
}, m(
|
|
1652
|
-
|
|
1709
|
+
}, m(Bi(t.edge.fromText)), 9, Ye)], 8, qe)) : n("", !0),
|
|
1710
|
+
Vi(t.edge.centerText) ? (u(), r("g", {
|
|
1653
1711
|
key: 1,
|
|
1654
|
-
transform:
|
|
1655
|
-
}, [
|
|
1712
|
+
transform: Gi(t.edge.centerText, t.center, t.centerAngle)
|
|
1713
|
+
}, [Ar.value ? (u(), r("rect", {
|
|
1656
1714
|
key: 0,
|
|
1657
1715
|
x: -t.centerBox.w / 2,
|
|
1658
1716
|
y: -t.centerBox.h / 2,
|
|
1659
1717
|
width: t.centerBox.w,
|
|
1660
1718
|
height: t.centerBox.h,
|
|
1661
1719
|
rx: "3",
|
|
1662
|
-
fill:
|
|
1720
|
+
fill: jr.value,
|
|
1663
1721
|
opacity: "0.92",
|
|
1664
1722
|
stroke: C(t.edge, t.edge.centerText),
|
|
1665
1723
|
"stroke-opacity": "0.35",
|
|
@@ -1673,18 +1731,18 @@ var b = {
|
|
|
1673
1731
|
"font-family": "'SF Mono', monospace",
|
|
1674
1732
|
"font-weight": "600",
|
|
1675
1733
|
opacity: "1"
|
|
1676
|
-
}, m(
|
|
1677
|
-
|
|
1734
|
+
}, m(Bi(t.edge.centerText)), 9, Qe)], 8, Xe)) : n("", !0),
|
|
1735
|
+
Vi(t.edge.toText) ? (u(), r("g", {
|
|
1678
1736
|
key: 2,
|
|
1679
|
-
transform:
|
|
1680
|
-
}, [
|
|
1737
|
+
transform: Gi(t.edge.toText, t.end, t.endAngle)
|
|
1738
|
+
}, [Ar.value ? (u(), r("rect", {
|
|
1681
1739
|
key: 0,
|
|
1682
1740
|
x: -t.toBox.w / 2,
|
|
1683
1741
|
y: -t.toBox.h / 2,
|
|
1684
1742
|
width: t.toBox.w,
|
|
1685
1743
|
height: t.toBox.h,
|
|
1686
1744
|
rx: "3",
|
|
1687
|
-
fill:
|
|
1745
|
+
fill: jr.value,
|
|
1688
1746
|
opacity: "0.92",
|
|
1689
1747
|
stroke: C(t.edge, t.edge.toText),
|
|
1690
1748
|
"stroke-opacity": "0.35",
|
|
@@ -1698,15 +1756,15 @@ var b = {
|
|
|
1698
1756
|
"font-family": "'SF Mono', monospace",
|
|
1699
1757
|
"font-weight": "500",
|
|
1700
1758
|
opacity: "0.9"
|
|
1701
|
-
}, m(
|
|
1759
|
+
}, m(Bi(t.edge.toText)), 9, tt)], 8, $e)) : n("", !0)
|
|
1702
1760
|
]))], 64))), 128)),
|
|
1703
1761
|
Y.value ? (u(), r("g", nt, [
|
|
1704
1762
|
i("line", {
|
|
1705
1763
|
x1: Y.value.ax,
|
|
1706
1764
|
y1: Y.value.ay,
|
|
1707
|
-
x2:
|
|
1708
|
-
y2:
|
|
1709
|
-
stroke:
|
|
1765
|
+
x2: Ei.value.x,
|
|
1766
|
+
y2: Ei.value.y,
|
|
1767
|
+
stroke: Ti.value,
|
|
1710
1768
|
"stroke-width": "2",
|
|
1711
1769
|
"stroke-dasharray": "6 6",
|
|
1712
1770
|
"stroke-linecap": "round",
|
|
@@ -1716,24 +1774,24 @@ var b = {
|
|
|
1716
1774
|
cx: Y.value.px,
|
|
1717
1775
|
cy: Y.value.py,
|
|
1718
1776
|
r: "3.5",
|
|
1719
|
-
fill:
|
|
1777
|
+
fill: Ti.value,
|
|
1720
1778
|
opacity: "0.9"
|
|
1721
1779
|
}, null, 8, it),
|
|
1722
|
-
Y.value.overId &&
|
|
1780
|
+
Y.value.overId && Di.value ? (u(), r("rect", {
|
|
1723
1781
|
key: 0,
|
|
1724
|
-
x:
|
|
1725
|
-
y:
|
|
1726
|
-
width:
|
|
1727
|
-
height:
|
|
1782
|
+
x: Di.value.x,
|
|
1783
|
+
y: Di.value.y,
|
|
1784
|
+
width: Di.value.w,
|
|
1785
|
+
height: Di.value.h,
|
|
1728
1786
|
rx: "6",
|
|
1729
1787
|
fill: "none",
|
|
1730
|
-
stroke:
|
|
1788
|
+
stroke: Ti.value,
|
|
1731
1789
|
"stroke-width": "1.5",
|
|
1732
1790
|
"stroke-dasharray": "6 4",
|
|
1733
1791
|
opacity: "0.9"
|
|
1734
1792
|
}, null, 8, at)) : n("", !0)
|
|
1735
1793
|
])) : n("", !0),
|
|
1736
|
-
(u(!0), r(e, null, f(
|
|
1794
|
+
(u(!0), r(e, null, f(G.value, (e) => (u(), r("path", {
|
|
1737
1795
|
key: `hit-${e.id}`,
|
|
1738
1796
|
d: $(e),
|
|
1739
1797
|
fill: "none",
|
|
@@ -1743,17 +1801,17 @@ var b = {
|
|
|
1743
1801
|
"pointer-events": "stroke",
|
|
1744
1802
|
cursor: "pointer"
|
|
1745
1803
|
},
|
|
1746
|
-
onClick: g((t) =>
|
|
1804
|
+
onClick: g((t) => Vn(e, t), ["stop"])
|
|
1747
1805
|
}, null, 8, ot))), 128)),
|
|
1748
|
-
(u(!0), r(e, null, f(
|
|
1806
|
+
(u(!0), r(e, null, f(rr.value, (a) => (u(), r("g", {
|
|
1749
1807
|
key: a.id,
|
|
1750
1808
|
transform: `translate(${a.x}, ${a.y})`,
|
|
1751
1809
|
class: o(["topology-node", D.value === a.id ? "dragging" : ""]),
|
|
1752
|
-
onMousedown: (e) =>
|
|
1810
|
+
onMousedown: (e) => Ur(e, a.id),
|
|
1753
1811
|
onClick: (e) => Pn(a, e),
|
|
1754
1812
|
style: s({
|
|
1755
1813
|
cursor: v.editable && v.config.nodeDraggable !== !1 ? "grab" : "default",
|
|
1756
|
-
color:
|
|
1814
|
+
color: I(a)
|
|
1757
1815
|
})
|
|
1758
1816
|
}, [
|
|
1759
1817
|
i("rect", {
|
|
@@ -1767,11 +1825,11 @@ var b = {
|
|
|
1767
1825
|
}, null, 8, ct),
|
|
1768
1826
|
Dn(a) && _.viewMode !== "3d" ? (u(), r("rect", {
|
|
1769
1827
|
key: 0,
|
|
1770
|
-
x:
|
|
1771
|
-
y:
|
|
1772
|
-
width:
|
|
1773
|
-
height:
|
|
1774
|
-
rx:
|
|
1828
|
+
x: R(a).x,
|
|
1829
|
+
y: R(a).y,
|
|
1830
|
+
width: R(a).width,
|
|
1831
|
+
height: R(a).height,
|
|
1832
|
+
rx: Hr(a),
|
|
1775
1833
|
fill: Dn(a),
|
|
1776
1834
|
opacity: "0.15"
|
|
1777
1835
|
}, null, 8, lt)) : n("", !0),
|
|
@@ -1781,47 +1839,47 @@ var b = {
|
|
|
1781
1839
|
y: En(a).y,
|
|
1782
1840
|
width: En(a).width,
|
|
1783
1841
|
height: En(a).height,
|
|
1784
|
-
rx:
|
|
1842
|
+
rx: Hr(a),
|
|
1785
1843
|
fill: "none",
|
|
1786
|
-
stroke:
|
|
1787
|
-
"stroke-width":
|
|
1788
|
-
"stroke-dasharray":
|
|
1844
|
+
stroke: zr(a),
|
|
1845
|
+
"stroke-width": Br(a),
|
|
1846
|
+
"stroke-dasharray": Vr(a),
|
|
1789
1847
|
opacity: "0.8"
|
|
1790
1848
|
}, null, 8, ut)) : n("", !0),
|
|
1791
1849
|
On(a) && _.viewMode !== "3d" ? (u(), r("rect", {
|
|
1792
1850
|
key: 2,
|
|
1793
|
-
x:
|
|
1794
|
-
y:
|
|
1795
|
-
width:
|
|
1796
|
-
height:
|
|
1797
|
-
rx:
|
|
1851
|
+
x: R(a).x,
|
|
1852
|
+
y: R(a).y,
|
|
1853
|
+
width: R(a).width,
|
|
1854
|
+
height: R(a).height,
|
|
1855
|
+
rx: Hr(a),
|
|
1798
1856
|
fill: "none",
|
|
1799
1857
|
stroke: Nn.value,
|
|
1800
1858
|
"stroke-width": "2.5",
|
|
1801
1859
|
transform: "scale(1.1)",
|
|
1802
1860
|
style: { "pointer-events": "none" }
|
|
1803
1861
|
}, null, 8, dt)) : n("", !0),
|
|
1804
|
-
|
|
1862
|
+
gn(a) ? (u(), r(e, { key: 3 }, [i("rect", {
|
|
1805
1863
|
x: "-4",
|
|
1806
1864
|
y: "-10",
|
|
1807
1865
|
width: "8",
|
|
1808
1866
|
height: "20",
|
|
1809
|
-
fill:
|
|
1867
|
+
fill: hn(a).color,
|
|
1810
1868
|
opacity: "0.06"
|
|
1811
1869
|
}, null, 8, ft), i("text", {
|
|
1812
1870
|
y: "4",
|
|
1813
1871
|
transform: `rotate(${a.rotation || 0} 0 4)`,
|
|
1814
1872
|
"text-anchor": "middle",
|
|
1815
|
-
fill: Ht(a) ||
|
|
1873
|
+
fill: Ht(a) || I(a) || hn(a).color,
|
|
1816
1874
|
"font-size": Vt(a, 12),
|
|
1817
1875
|
"font-family": "'SF Mono', 'Cascadia Code', 'Consolas', monospace",
|
|
1818
1876
|
"font-weight": "600"
|
|
1819
|
-
}, m(a.label), 9, pt)], 64)) : (u(), r(e, { key: 4 }, [
|
|
1820
|
-
i("g", { transform: bn(a) }, [a.state !== "none" &&
|
|
1877
|
+
}, m(a.label), 9, pt)], 64)) : _n(a) ? (u(), r(e, { key: 4 }, [], 64)) : (u(), r(e, { key: 5 }, [
|
|
1878
|
+
i("g", { transform: bn(a) }, [a.state !== "none" && Lr.value ? (u(), r("circle", {
|
|
1821
1879
|
key: 0,
|
|
1822
1880
|
r: "30",
|
|
1823
1881
|
fill: "none",
|
|
1824
|
-
stroke:
|
|
1882
|
+
stroke: hn(a).color,
|
|
1825
1883
|
"stroke-width": "2.5",
|
|
1826
1884
|
opacity: "0"
|
|
1827
1885
|
}, [...c[6] ||= [i("animate", {
|
|
@@ -1836,7 +1894,7 @@ var b = {
|
|
|
1836
1894
|
repeatCount: "indefinite"
|
|
1837
1895
|
}, null, -1)]], 8, ht)) : n("", !0), i("g", gt, [p(t.$slots, "node-icon", {
|
|
1838
1896
|
node: a,
|
|
1839
|
-
color:
|
|
1897
|
+
color: I(a),
|
|
1840
1898
|
viewMode: _.viewMode
|
|
1841
1899
|
}, () => [i("rect", {
|
|
1842
1900
|
x: "-18",
|
|
@@ -1844,15 +1902,15 @@ var b = {
|
|
|
1844
1902
|
width: "36",
|
|
1845
1903
|
height: "36",
|
|
1846
1904
|
rx: "6",
|
|
1847
|
-
fill:
|
|
1905
|
+
fill: I(a),
|
|
1848
1906
|
opacity: "0.9"
|
|
1849
1907
|
}, null, 8, _t)])])], 8, mt),
|
|
1850
|
-
|
|
1908
|
+
Nr.value ? (u(), r("g", {
|
|
1851
1909
|
key: 0,
|
|
1852
1910
|
transform: xn(a)
|
|
1853
1911
|
}, [i("circle", {
|
|
1854
1912
|
r: "4",
|
|
1855
|
-
fill:
|
|
1913
|
+
fill: hn(a).color,
|
|
1856
1914
|
stroke: "#0a0e1a",
|
|
1857
1915
|
"stroke-width": "2"
|
|
1858
1916
|
}, null, 8, yt)], 8, vt)) : n("", !0),
|
|
@@ -1871,42 +1929,42 @@ var b = {
|
|
|
1871
1929
|
dy: t === 0 ? 0 : "1.2em"
|
|
1872
1930
|
}, m(e), 9, xt))), 128))], 8, bt)
|
|
1873
1931
|
], 64)),
|
|
1874
|
-
|
|
1932
|
+
Mr.value ? (u(), r("g", St, [(u(!0), r(e, null, f(ii(a), (e) => (u(), r("circle", {
|
|
1875
1933
|
key: e.side,
|
|
1876
1934
|
cx: e.x,
|
|
1877
1935
|
cy: e.y,
|
|
1878
1936
|
r: "4.5",
|
|
1879
1937
|
class: "node-handle",
|
|
1880
1938
|
fill: "#0a0e1a",
|
|
1881
|
-
stroke:
|
|
1939
|
+
stroke: I(a),
|
|
1882
1940
|
"stroke-width": "1.5",
|
|
1883
|
-
onPointerdown: g((t) =>
|
|
1884
|
-
onPointermove: g(
|
|
1885
|
-
onPointerup: g(
|
|
1886
|
-
onPointercancel: g(
|
|
1887
|
-
onLostpointercapture:
|
|
1941
|
+
onPointerdown: g((t) => si(t, a.id, e), ["stop", "prevent"]),
|
|
1942
|
+
onPointermove: g(gi, ["stop"]),
|
|
1943
|
+
onPointerup: g(_i, ["stop"]),
|
|
1944
|
+
onPointercancel: g(_i, ["stop"]),
|
|
1945
|
+
onLostpointercapture: _i,
|
|
1888
1946
|
onMousedown: c[0] ||= g(() => {}, ["stop", "prevent"]),
|
|
1889
1947
|
onClick: c[1] ||= g(() => {}, ["stop"])
|
|
1890
1948
|
}, null, 40, Ct))), 128))])) : n("", !0)
|
|
1891
1949
|
], 46, st))), 128)),
|
|
1892
|
-
|
|
1950
|
+
ri.value ? (u(), r("g", wt, [(u(!0), r(e, null, f(Zr(ri.value), (e) => (u(), r("rect", {
|
|
1893
1951
|
key: e.side,
|
|
1894
|
-
x:
|
|
1895
|
-
y:
|
|
1952
|
+
x: ri.value.x + e.x - 4.5,
|
|
1953
|
+
y: ri.value.y + e.y - 4.5,
|
|
1896
1954
|
width: "9",
|
|
1897
1955
|
height: "9",
|
|
1898
1956
|
rx: "2",
|
|
1899
1957
|
class: o(["node-resize-handle", `rt-${e.side}`]),
|
|
1900
|
-
onMousedown: g((t) =>
|
|
1958
|
+
onMousedown: g((t) => $r(t, ri.value, e.side), ["stop", "prevent"]),
|
|
1901
1959
|
onClick: c[2] ||= g(() => {}, ["stop"])
|
|
1902
1960
|
}, null, 42, Tt))), 128))])) : n("", !0),
|
|
1903
|
-
|
|
1961
|
+
q.value ? (u(), r("rect", {
|
|
1904
1962
|
key: 4,
|
|
1905
1963
|
class: "marquee-box",
|
|
1906
|
-
x:
|
|
1907
|
-
y:
|
|
1908
|
-
width:
|
|
1909
|
-
height:
|
|
1964
|
+
x: ur.value.x,
|
|
1965
|
+
y: ur.value.y,
|
|
1966
|
+
width: ur.value.width,
|
|
1967
|
+
height: ur.value.height,
|
|
1910
1968
|
rx: "2",
|
|
1911
1969
|
"vector-effect": "non-scaling-stroke"
|
|
1912
1970
|
}, null, 8, Et)) : n("", !0)
|