@html-graph/html-graph 8.10.0 → 8.11.0
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/dist/html-graph.d.ts +11 -1
- package/dist/html-graph.js +416 -416
- package/dist/html-graph.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/html-graph.js
CHANGED
|
@@ -52,7 +52,7 @@ class Ee {
|
|
|
52
52
|
this.clear(), this.viewportStore.onAfterUpdated.unsubscribe(this.applyTransform), this.element.removeChild(this.host), this.host.removeChild(this.container);
|
|
53
53
|
}
|
|
54
54
|
updateNodePosition(e) {
|
|
55
|
-
const t = this.graphStore.getNode(e), { width: o, height: s } = t.element.getBoundingClientRect(),
|
|
55
|
+
const t = this.graphStore.getNode(e), { width: o, height: s } = t.element.getBoundingClientRect(), a = this.viewportStore.getViewportMatrix().scale, { payload: n } = t, h = n.centerFn(o, s), d = n.x - a * h.x, c = n.y - a * h.y;
|
|
56
56
|
t.element.style.transform = `translate(${d}px, ${c}px)`;
|
|
57
57
|
}
|
|
58
58
|
updateNodePriority(e) {
|
|
@@ -66,12 +66,12 @@ class Ee {
|
|
|
66
66
|
this.edgeIdToElementMap.set(e, s), this.container.appendChild(s);
|
|
67
67
|
}
|
|
68
68
|
renderEdge(e) {
|
|
69
|
-
const t = this.graphStore.getEdge(e), o = this.graphStore.getPort(t.from), s = this.graphStore.getPort(t.to),
|
|
69
|
+
const t = this.graphStore.getEdge(e), o = this.graphStore.getPort(t.from), s = this.graphStore.getPort(t.to), a = o.element.getBoundingClientRect(), n = s.element.getBoundingClientRect(), h = this.host.getBoundingClientRect(), d = this.viewportStore.getViewportMatrix().scale, c = this.createEdgeRenderPort(
|
|
70
70
|
o,
|
|
71
|
-
|
|
71
|
+
a,
|
|
72
72
|
h,
|
|
73
73
|
d
|
|
74
|
-
), g = this.createEdgeRenderPort(s,
|
|
74
|
+
), g = this.createEdgeRenderPort(s, n, h, d);
|
|
75
75
|
let u = L.Line;
|
|
76
76
|
o.element === s.element ? u = L.PortCycle : o.nodeId === s.nodeId && (u = L.NodeCycle), t.payload.shape.render({ from: c, to: g, category: u });
|
|
77
77
|
}
|
|
@@ -80,13 +80,13 @@ class Ee {
|
|
|
80
80
|
t.payload.shape.svg.style.zIndex = `${t.payload.priority}`;
|
|
81
81
|
}
|
|
82
82
|
createEdgeRenderPort(e, t, o, s) {
|
|
83
|
-
const
|
|
83
|
+
const a = this.viewportStore.createContentCoords({
|
|
84
84
|
x: t.left - o.left,
|
|
85
85
|
y: t.top - o.top
|
|
86
86
|
});
|
|
87
87
|
return {
|
|
88
|
-
x:
|
|
89
|
-
y:
|
|
88
|
+
x: a.x,
|
|
89
|
+
y: a.y,
|
|
90
90
|
width: t.width * s,
|
|
91
91
|
height: t.height * s,
|
|
92
92
|
direction: e.payload.direction
|
|
@@ -109,7 +109,7 @@ class et {
|
|
|
109
109
|
return o >= this.xFrom && o <= this.xTo && s >= this.yFrom && s <= this.yTo;
|
|
110
110
|
}
|
|
111
111
|
hasEdge(e) {
|
|
112
|
-
const t = this.graphStore.getEdge(e), o = this.graphStore.getPort(t.from).nodeId, s = this.graphStore.getPort(t.to).nodeId,
|
|
112
|
+
const t = this.graphStore.getEdge(e), o = this.graphStore.getPort(t.from).nodeId, s = this.graphStore.getPort(t.to).nodeId, a = this.graphStore.getNode(o).payload, n = this.graphStore.getNode(s).payload, h = Math.min(a.x, n.x), d = Math.max(a.x, n.x), c = Math.min(a.y, n.y), g = Math.max(a.y, n.y);
|
|
113
113
|
return h <= this.xTo && d >= this.xFrom && c <= this.yTo && g >= this.yFrom;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -120,21 +120,21 @@ class tt {
|
|
|
120
120
|
i(this, "renderingBox");
|
|
121
121
|
i(this, "updateViewport", (e) => {
|
|
122
122
|
this.renderingBox.setRenderingBox(e);
|
|
123
|
-
const t = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(),
|
|
124
|
-
this.graphStore.getAllNodeIds().forEach((
|
|
125
|
-
const h = this.renderingBox.hasNode(
|
|
126
|
-
h && !d ? t.add(
|
|
127
|
-
}), this.graphStore.getAllEdgeIds().forEach((
|
|
128
|
-
const h = this.renderingBox.hasEdge(
|
|
129
|
-
h && (this.renderingBox.hasNode(g) || (t.add(g), o.delete(g)), this.renderingBox.hasNode(u) || (t.add(u), o.delete(u))), h && !d ? s.add(
|
|
130
|
-
}),
|
|
131
|
-
this.handleDetachEdge(
|
|
132
|
-
}), o.forEach((
|
|
133
|
-
this.handleDetachNode(
|
|
134
|
-
}), t.forEach((
|
|
135
|
-
this.attachedNodes.has(
|
|
136
|
-
}), s.forEach((
|
|
137
|
-
this.handleAttachEdge(
|
|
123
|
+
const t = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
124
|
+
this.graphStore.getAllNodeIds().forEach((n) => {
|
|
125
|
+
const h = this.renderingBox.hasNode(n), d = this.attachedNodes.has(n);
|
|
126
|
+
h && !d ? t.add(n) : !h && d && o.add(n);
|
|
127
|
+
}), this.graphStore.getAllEdgeIds().forEach((n) => {
|
|
128
|
+
const h = this.renderingBox.hasEdge(n), d = this.attachedEdges.has(n), c = this.graphStore.getEdge(n), g = this.graphStore.getPort(c.from).nodeId, u = this.graphStore.getPort(c.to).nodeId;
|
|
129
|
+
h && (this.renderingBox.hasNode(g) || (t.add(g), o.delete(g)), this.renderingBox.hasNode(u) || (t.add(u), o.delete(u))), h && !d ? s.add(n) : !h && d && a.add(n);
|
|
130
|
+
}), a.forEach((n) => {
|
|
131
|
+
this.handleDetachEdge(n);
|
|
132
|
+
}), o.forEach((n) => {
|
|
133
|
+
this.handleDetachNode(n);
|
|
134
|
+
}), t.forEach((n) => {
|
|
135
|
+
this.attachedNodes.has(n) || this.handleAttachNode(n);
|
|
136
|
+
}), s.forEach((n) => {
|
|
137
|
+
this.handleAttachEdge(n);
|
|
138
138
|
});
|
|
139
139
|
});
|
|
140
140
|
this.htmlView = e, this.graphStore = t, this.trigger = o, this.params = s, this.renderingBox = new et(this.graphStore), this.trigger.subscribe(this.updateViewport);
|
|
@@ -556,13 +556,13 @@ class be {
|
|
|
556
556
|
throw new S(
|
|
557
557
|
b.updateNonexistentEdgeTarget(e, t.to)
|
|
558
558
|
);
|
|
559
|
-
const s = this.getEdge(e),
|
|
559
|
+
const s = this.getEdge(e), a = s.payload;
|
|
560
560
|
this.removeEdgeInternal(e), this.addEdgeInternal({
|
|
561
561
|
id: e,
|
|
562
562
|
from: t.from ?? s.from,
|
|
563
563
|
to: t.to ?? s.to,
|
|
564
|
-
shape:
|
|
565
|
-
priority:
|
|
564
|
+
shape: a.shape,
|
|
565
|
+
priority: a.priority
|
|
566
566
|
});
|
|
567
567
|
}
|
|
568
568
|
const o = this.edges.get(e);
|
|
@@ -613,47 +613,47 @@ class be {
|
|
|
613
613
|
getNodeIncomingEdgeIds(e) {
|
|
614
614
|
const t = Array.from(this.getNode(e).ports.keys()), o = [];
|
|
615
615
|
return t.forEach((s) => {
|
|
616
|
-
this.getPortIncomingEdgeIds(s).filter((
|
|
617
|
-
const
|
|
618
|
-
return this.getPort(
|
|
619
|
-
}).forEach((
|
|
620
|
-
o.push(
|
|
616
|
+
this.getPortIncomingEdgeIds(s).filter((a) => {
|
|
617
|
+
const n = this.getEdge(a);
|
|
618
|
+
return this.getPort(n.from).nodeId !== e;
|
|
619
|
+
}).forEach((a) => {
|
|
620
|
+
o.push(a);
|
|
621
621
|
});
|
|
622
622
|
}), o;
|
|
623
623
|
}
|
|
624
624
|
getNodeOutgoingEdgeIds(e) {
|
|
625
625
|
const t = Array.from(this.getNode(e).ports.keys()), o = [];
|
|
626
626
|
return t.forEach((s) => {
|
|
627
|
-
this.getPortOutgoingEdgeIds(s).filter((
|
|
628
|
-
const
|
|
629
|
-
return this.getPort(
|
|
630
|
-
}).forEach((
|
|
631
|
-
o.push(
|
|
627
|
+
this.getPortOutgoingEdgeIds(s).filter((a) => {
|
|
628
|
+
const n = this.getEdge(a);
|
|
629
|
+
return this.getPort(n.to).nodeId !== e;
|
|
630
|
+
}).forEach((a) => {
|
|
631
|
+
o.push(a);
|
|
632
632
|
});
|
|
633
633
|
}), o;
|
|
634
634
|
}
|
|
635
635
|
getNodeCycleEdgeIds(e) {
|
|
636
636
|
const t = Array.from(this.getNode(e).ports.keys()), o = [];
|
|
637
637
|
return t.forEach((s) => {
|
|
638
|
-
this.getPortCycleEdgeIds(s).forEach((
|
|
639
|
-
o.push(
|
|
640
|
-
}), this.getPortIncomingEdgeIds(s).filter((
|
|
641
|
-
const
|
|
642
|
-
return this.getPort(
|
|
643
|
-
}).forEach((
|
|
644
|
-
o.push(
|
|
638
|
+
this.getPortCycleEdgeIds(s).forEach((a) => {
|
|
639
|
+
o.push(a);
|
|
640
|
+
}), this.getPortIncomingEdgeIds(s).filter((a) => {
|
|
641
|
+
const n = this.getEdge(a);
|
|
642
|
+
return this.getPort(n.to).nodeId === e;
|
|
643
|
+
}).forEach((a) => {
|
|
644
|
+
o.push(a);
|
|
645
645
|
});
|
|
646
646
|
}), o;
|
|
647
647
|
}
|
|
648
648
|
getNodeAdjacentEdgeIds(e) {
|
|
649
649
|
const t = Array.from(this.getNode(e).ports.keys()), o = [];
|
|
650
650
|
return t.forEach((s) => {
|
|
651
|
-
this.getPortIncomingEdgeIds(s).forEach((
|
|
652
|
-
o.push(
|
|
653
|
-
}), this.getPortOutgoingEdgeIds(s).forEach((
|
|
654
|
-
o.push(
|
|
655
|
-
}), this.getPortCycleEdgeIds(s).forEach((
|
|
656
|
-
o.push(
|
|
651
|
+
this.getPortIncomingEdgeIds(s).forEach((a) => {
|
|
652
|
+
o.push(a);
|
|
653
|
+
}), this.getPortOutgoingEdgeIds(s).forEach((a) => {
|
|
654
|
+
o.push(a);
|
|
655
|
+
}), this.getPortCycleEdgeIds(s).forEach((a) => {
|
|
656
|
+
o.push(a);
|
|
657
657
|
});
|
|
658
658
|
}), o;
|
|
659
659
|
}
|
|
@@ -767,8 +767,8 @@ class q {
|
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
769
|
const it = (r, e, t) => {
|
|
770
|
-
const { x: o, y: s, width:
|
|
771
|
-
return e >= o && e <= o +
|
|
770
|
+
const { x: o, y: s, width: a, height: n } = r.getBoundingClientRect();
|
|
771
|
+
return e >= o && e <= o + a && t >= s && t <= s + n;
|
|
772
772
|
}, nt = (r, e, t) => e >= 0 && e <= r.innerWidth && t >= 0 && t <= r.innerHeight, F = (r, e, t, o) => it(e, t, o) && nt(r, t, o), k = (r, e) => {
|
|
773
773
|
e !== null ? r.style.cursor = e : r.style.removeProperty("cursor");
|
|
774
774
|
}, H = (r) => {
|
|
@@ -810,8 +810,8 @@ function* Ne(r, e) {
|
|
|
810
810
|
for (const o of t) {
|
|
811
811
|
if (o.shadowRoot !== null) {
|
|
812
812
|
const s = Ne(o.shadowRoot, e);
|
|
813
|
-
for (const
|
|
814
|
-
yield
|
|
813
|
+
for (const a of s)
|
|
814
|
+
yield a;
|
|
815
815
|
}
|
|
816
816
|
yield o;
|
|
817
817
|
}
|
|
@@ -841,14 +841,14 @@ const Ce = (r, e) => ({
|
|
|
841
841
|
}, s = {
|
|
842
842
|
x: e.x + e.width / 2,
|
|
843
843
|
y: e.y + e.height / 2
|
|
844
|
-
},
|
|
844
|
+
}, a = Math.min(o.x, s.x) - t, n = Math.min(o.y, s.y) - t, h = 2 * t, d = Math.abs(s.x - o.x) + h, c = Math.abs(s.y - o.y) + h;
|
|
845
845
|
return {
|
|
846
|
-
x:
|
|
847
|
-
y:
|
|
846
|
+
x: a,
|
|
847
|
+
y: n,
|
|
848
848
|
width: d,
|
|
849
849
|
height: c,
|
|
850
|
-
from: { x: o.x -
|
|
851
|
-
to: { x: s.x -
|
|
850
|
+
from: { x: o.x - a, y: o.y - n },
|
|
851
|
+
to: { x: s.x - a, y: s.y - n }
|
|
852
852
|
};
|
|
853
853
|
};
|
|
854
854
|
class ht {
|
|
@@ -859,8 +859,8 @@ class ht {
|
|
|
859
859
|
from: t,
|
|
860
860
|
to: o,
|
|
861
861
|
arrowLength: s,
|
|
862
|
-
fromDir:
|
|
863
|
-
toDir:
|
|
862
|
+
fromDir: a,
|
|
863
|
+
toDir: n,
|
|
864
864
|
curvature: h,
|
|
865
865
|
hasSourceArrow: d,
|
|
866
866
|
hasTargetArrow: c
|
|
@@ -868,18 +868,18 @@ class ht {
|
|
|
868
868
|
this.midpoint = { x: g, y: u };
|
|
869
869
|
const l = x(
|
|
870
870
|
{ x: t.x + s, y: t.y },
|
|
871
|
-
|
|
871
|
+
a,
|
|
872
872
|
t
|
|
873
873
|
), p = x(
|
|
874
874
|
{ x: o.x - s, y: o.y },
|
|
875
|
-
|
|
875
|
+
n,
|
|
876
876
|
o
|
|
877
877
|
), y = {
|
|
878
|
-
x: l.x +
|
|
879
|
-
y: l.y +
|
|
878
|
+
x: l.x + a.x * h,
|
|
879
|
+
y: l.y + a.y * h
|
|
880
880
|
}, w = {
|
|
881
|
-
x: p.x -
|
|
882
|
-
y: p.y -
|
|
881
|
+
x: p.x - n.x * h,
|
|
882
|
+
y: p.y - n.y * h
|
|
883
883
|
}, f = `M ${l.x} ${l.y} C ${y.x} ${y.y}, ${w.x} ${w.y}, ${p.x} ${p.y}`, m = d ? "" : `M ${t.x} ${t.y} L ${l.x} ${l.y} `, A = c ? "" : ` M ${p.x} ${p.y} L ${o.x} ${o.y}`;
|
|
884
884
|
this.path = `${m}${f}${A}`;
|
|
885
885
|
}
|
|
@@ -892,8 +892,8 @@ class dt {
|
|
|
892
892
|
hasSourceArrow: t,
|
|
893
893
|
hasTargetArrow: o,
|
|
894
894
|
curvature: s,
|
|
895
|
-
fromDir:
|
|
896
|
-
toDir:
|
|
895
|
+
fromDir: a,
|
|
896
|
+
toDir: n,
|
|
897
897
|
detourDir: h,
|
|
898
898
|
from: d,
|
|
899
899
|
to: c,
|
|
@@ -901,25 +901,25 @@ class dt {
|
|
|
901
901
|
detourDistance: u
|
|
902
902
|
} = e, l = t ? x(
|
|
903
903
|
{ x: d.x + g, y: d.y },
|
|
904
|
-
|
|
904
|
+
a,
|
|
905
905
|
d
|
|
906
906
|
) : d, p = o ? x(
|
|
907
907
|
{
|
|
908
908
|
x: c.x - g,
|
|
909
909
|
y: c.y
|
|
910
910
|
},
|
|
911
|
-
|
|
911
|
+
n,
|
|
912
912
|
c
|
|
913
913
|
) : c, y = Math.cos(h) * u, w = Math.sin(h) * u, f = x(
|
|
914
914
|
{ x: d.x + g, y: d.y },
|
|
915
|
-
|
|
915
|
+
a,
|
|
916
916
|
d
|
|
917
917
|
), m = {
|
|
918
918
|
x: f.x + y,
|
|
919
919
|
y: f.y + w
|
|
920
920
|
}, A = x(
|
|
921
921
|
{ x: c.x - g, y: c.y },
|
|
922
|
-
|
|
922
|
+
n,
|
|
923
923
|
c
|
|
924
924
|
), N = {
|
|
925
925
|
x: A.x + y,
|
|
@@ -928,11 +928,11 @@ class dt {
|
|
|
928
928
|
x: (m.x + N.x) / 2,
|
|
929
929
|
y: (m.y + N.y) / 2
|
|
930
930
|
}, T = {
|
|
931
|
-
x: f.x + s *
|
|
932
|
-
y: f.y + s *
|
|
931
|
+
x: f.x + s * a.x,
|
|
932
|
+
y: f.y + s * a.y
|
|
933
933
|
}, I = {
|
|
934
|
-
x: A.x - s *
|
|
935
|
-
y: A.y - s *
|
|
934
|
+
x: A.x - s * n.x,
|
|
935
|
+
y: A.y - s * n.y
|
|
936
936
|
}, V = {
|
|
937
937
|
x: f.x + y,
|
|
938
938
|
y: f.y + w
|
|
@@ -966,15 +966,15 @@ const ee = Object.freeze({
|
|
|
966
966
|
const t = [];
|
|
967
967
|
if (r.length > 0 && t.push(`M ${r[0].x} ${r[0].y}`), r.length === 2 && t.push(`L ${r[1].x} ${r[1].y}`), r.length > 2) {
|
|
968
968
|
const o = r.length - 1;
|
|
969
|
-
let s = 0,
|
|
969
|
+
let s = 0, a = 0, n = 0;
|
|
970
970
|
r.forEach((h, d) => {
|
|
971
971
|
let c = 0, g = 0, u = 0;
|
|
972
972
|
const l = d > 0, p = d < o, y = l && p;
|
|
973
|
-
if (l && (c = -s, g = -
|
|
973
|
+
if (l && (c = -s, g = -a, u = n), p) {
|
|
974
974
|
const T = r[d + 1];
|
|
975
|
-
s = T.x - h.x,
|
|
975
|
+
s = T.x - h.x, a = T.y - h.y, n = Math.sqrt(s * s + a * a);
|
|
976
976
|
}
|
|
977
|
-
const f =
|
|
977
|
+
const f = n !== 0 ? Math.min((y ? e : 0) / n, d < o - 1 ? 0.5 : 1) : 0, m = y ? { x: h.x + s * f, y: h.y + a * f } : h, N = u !== 0 ? Math.min((y ? e : 0) / u, d > 1 ? 0.5 : 1) : 0, C = y ? { x: h.x + c * N, y: h.y + g * N } : h;
|
|
978
978
|
d > 0 && t.push(`L ${C.x} ${C.y}`), y && t.push(
|
|
979
979
|
`C ${h.x} ${h.y} ${h.x} ${h.y} ${m.x} ${m.y}`
|
|
980
980
|
);
|
|
@@ -1003,8 +1003,8 @@ const ee = Object.freeze({
|
|
|
1003
1003
|
midpoint: l
|
|
1004
1004
|
};
|
|
1005
1005
|
}
|
|
1006
|
-
const
|
|
1007
|
-
if (
|
|
1006
|
+
const n = o === t, h = (r.y + e.y) / 2;
|
|
1007
|
+
if (n) {
|
|
1008
1008
|
const c = { x: e.x, y: r.y };
|
|
1009
1009
|
return {
|
|
1010
1010
|
points: [{ x: r.x, y: r.y }, c, { x: e.x, y: e.y }],
|
|
@@ -1025,28 +1025,28 @@ class lt {
|
|
|
1025
1025
|
from: t,
|
|
1026
1026
|
to: o,
|
|
1027
1027
|
fromDir: s,
|
|
1028
|
-
toDir:
|
|
1029
|
-
arrowLength:
|
|
1028
|
+
toDir: a,
|
|
1029
|
+
arrowLength: n,
|
|
1030
1030
|
arrowOffset: h,
|
|
1031
1031
|
roundness: d,
|
|
1032
1032
|
hasSourceArrow: c,
|
|
1033
1033
|
hasTargetArrow: g
|
|
1034
1034
|
} = e, u = c ? x(
|
|
1035
|
-
{ x: t.x +
|
|
1035
|
+
{ x: t.x + n, y: t.y },
|
|
1036
1036
|
s,
|
|
1037
1037
|
t
|
|
1038
1038
|
) : t, l = g ? x(
|
|
1039
1039
|
{
|
|
1040
|
-
x: o.x -
|
|
1040
|
+
x: o.x - n,
|
|
1041
1041
|
y: o.y
|
|
1042
1042
|
},
|
|
1043
|
-
|
|
1043
|
+
a,
|
|
1044
1044
|
o
|
|
1045
|
-
) : o, p =
|
|
1045
|
+
) : o, p = n + h, y = x(
|
|
1046
1046
|
{ x: t.x + p, y: t.y },
|
|
1047
1047
|
s,
|
|
1048
1048
|
t
|
|
1049
|
-
), w = x({ x: o.x - p, y: o.y },
|
|
1049
|
+
), w = x({ x: o.x - p, y: o.y }, a, o), f = ct(
|
|
1050
1050
|
{
|
|
1051
1051
|
x: y.x,
|
|
1052
1052
|
y: y.y,
|
|
@@ -1055,7 +1055,7 @@ class lt {
|
|
|
1055
1055
|
{
|
|
1056
1056
|
x: w.x,
|
|
1057
1057
|
y: w.y,
|
|
1058
|
-
dirX:
|
|
1058
|
+
dirX: a.x
|
|
1059
1059
|
}
|
|
1060
1060
|
);
|
|
1061
1061
|
this.path = R(
|
|
@@ -1072,8 +1072,8 @@ class gt {
|
|
|
1072
1072
|
hasSourceArrow: t,
|
|
1073
1073
|
hasTargetArrow: o,
|
|
1074
1074
|
from: s,
|
|
1075
|
-
to:
|
|
1076
|
-
arrowLength:
|
|
1075
|
+
to: a,
|
|
1076
|
+
arrowLength: n,
|
|
1077
1077
|
fromDir: h,
|
|
1078
1078
|
toDir: d,
|
|
1079
1079
|
arrowOffset: c,
|
|
@@ -1081,17 +1081,17 @@ class gt {
|
|
|
1081
1081
|
detourDistance: u,
|
|
1082
1082
|
roundness: l
|
|
1083
1083
|
} = e, p = t ? x(
|
|
1084
|
-
{ x: s.x +
|
|
1084
|
+
{ x: s.x + n, y: s.y },
|
|
1085
1085
|
h,
|
|
1086
1086
|
s
|
|
1087
1087
|
) : s, y = o ? x(
|
|
1088
1088
|
{
|
|
1089
|
-
x:
|
|
1090
|
-
y:
|
|
1089
|
+
x: a.x - n,
|
|
1090
|
+
y: a.y
|
|
1091
1091
|
},
|
|
1092
1092
|
d,
|
|
1093
|
-
|
|
1094
|
-
) :
|
|
1093
|
+
a
|
|
1094
|
+
) : a, w = n + c, f = Math.cos(g) * u, m = Math.sin(g) * u, A = x(
|
|
1095
1095
|
{ x: s.x + w, y: s.y },
|
|
1096
1096
|
h,
|
|
1097
1097
|
s
|
|
@@ -1099,9 +1099,9 @@ class gt {
|
|
|
1099
1099
|
x: A.x + f,
|
|
1100
1100
|
y: A.y + m
|
|
1101
1101
|
}, C = x(
|
|
1102
|
-
{ x:
|
|
1102
|
+
{ x: a.x - w, y: a.y },
|
|
1103
1103
|
d,
|
|
1104
|
-
|
|
1104
|
+
a
|
|
1105
1105
|
), T = {
|
|
1106
1106
|
x: C.x + f,
|
|
1107
1107
|
y: C.y + m
|
|
@@ -1123,8 +1123,8 @@ class ut {
|
|
|
1123
1123
|
from: t,
|
|
1124
1124
|
to: o,
|
|
1125
1125
|
hasSourceArrow: s,
|
|
1126
|
-
hasTargetArrow:
|
|
1127
|
-
arrowLength:
|
|
1126
|
+
hasTargetArrow: a,
|
|
1127
|
+
arrowLength: n,
|
|
1128
1128
|
fromDir: h,
|
|
1129
1129
|
toDir: d,
|
|
1130
1130
|
arrowOffset: c,
|
|
@@ -1133,13 +1133,13 @@ class ut {
|
|
|
1133
1133
|
s,
|
|
1134
1134
|
h,
|
|
1135
1135
|
t,
|
|
1136
|
-
|
|
1136
|
+
n
|
|
1137
1137
|
), l = this.createArrowPoint(
|
|
1138
|
-
|
|
1138
|
+
a,
|
|
1139
1139
|
d,
|
|
1140
1140
|
o,
|
|
1141
|
-
-
|
|
1142
|
-
), p =
|
|
1141
|
+
-n
|
|
1142
|
+
), p = n + c, y = { x: t.x + p, y: t.y }, w = x(y, h, t), f = { x: o.x - p, y: o.y }, m = x(f, d, o);
|
|
1143
1143
|
this.path = R(
|
|
1144
1144
|
[u, w, m, l],
|
|
1145
1145
|
g
|
|
@@ -1150,11 +1150,11 @@ class ut {
|
|
|
1150
1150
|
createArrowPoint(e, t, o, s) {
|
|
1151
1151
|
if (!e)
|
|
1152
1152
|
return o;
|
|
1153
|
-
const
|
|
1153
|
+
const a = {
|
|
1154
1154
|
x: o.x + s,
|
|
1155
1155
|
y: o.y
|
|
1156
1156
|
};
|
|
1157
|
-
return x(
|
|
1157
|
+
return x(a, t, o);
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
1160
1160
|
const pt = (r, e) => {
|
|
@@ -1179,8 +1179,8 @@ const pt = (r, e) => {
|
|
|
1179
1179
|
midpoint: l
|
|
1180
1180
|
};
|
|
1181
1181
|
}
|
|
1182
|
-
const
|
|
1183
|
-
if (
|
|
1182
|
+
const n = o === t, h = (r.x + e.x) / 2;
|
|
1183
|
+
if (n) {
|
|
1184
1184
|
const c = { x: r.x, y: e.y };
|
|
1185
1185
|
return {
|
|
1186
1186
|
points: [{ x: r.x, y: r.y }, c, { x: e.x, y: e.y }],
|
|
@@ -1201,24 +1201,24 @@ class yt {
|
|
|
1201
1201
|
from: t,
|
|
1202
1202
|
to: o,
|
|
1203
1203
|
hasSourceArrow: s,
|
|
1204
|
-
hasTargetArrow:
|
|
1205
|
-
arrowLength:
|
|
1204
|
+
hasTargetArrow: a,
|
|
1205
|
+
arrowLength: n,
|
|
1206
1206
|
arrowOffset: h,
|
|
1207
1207
|
fromDir: d,
|
|
1208
1208
|
toDir: c,
|
|
1209
1209
|
roundness: g
|
|
1210
1210
|
} = e, u = s ? x(
|
|
1211
|
-
{ x: t.x +
|
|
1211
|
+
{ x: t.x + n, y: t.y },
|
|
1212
1212
|
d,
|
|
1213
1213
|
t
|
|
1214
|
-
) : t, l =
|
|
1214
|
+
) : t, l = a ? x(
|
|
1215
1215
|
{
|
|
1216
|
-
x: o.x -
|
|
1216
|
+
x: o.x - n,
|
|
1217
1217
|
y: o.y
|
|
1218
1218
|
},
|
|
1219
1219
|
c,
|
|
1220
1220
|
o
|
|
1221
|
-
) : o, p =
|
|
1221
|
+
) : o, p = n + h, y = x(
|
|
1222
1222
|
{ x: t.x + p, y: t.y },
|
|
1223
1223
|
d,
|
|
1224
1224
|
t
|
|
@@ -1244,7 +1244,7 @@ class te {
|
|
|
1244
1244
|
constructor(e) {
|
|
1245
1245
|
i(this, "path");
|
|
1246
1246
|
i(this, "midpoint");
|
|
1247
|
-
const { side: t, arrowLength: o, arrowOffset: s, dir:
|
|
1247
|
+
const { side: t, arrowLength: o, arrowOffset: s, dir: a, origin: n, hasArrow: h } = e, d = o + s, c = d + 2 * t, u = [
|
|
1248
1248
|
{ x: o, y: 0 },
|
|
1249
1249
|
{ x: d, y: 0 },
|
|
1250
1250
|
{ x: d, y: t },
|
|
@@ -1253,7 +1253,7 @@ class te {
|
|
|
1253
1253
|
{ x: d, y: -t },
|
|
1254
1254
|
{ x: d, y: 0 },
|
|
1255
1255
|
{ x: o, y: 0 }
|
|
1256
|
-
].map((p) => x(p,
|
|
1256
|
+
].map((p) => x(p, a, { x: 0, y: 0 })).map((p) => ({ x: p.x + n.x, y: p.y + n.y })), l = `M ${n.x} ${n.y} L ${u[0].x} ${u[0].y} `;
|
|
1257
1257
|
this.path = `${h ? "" : l}${R(u, e.roundness)}`, this.midpoint = { x: (u[3].x + u[4].x) / 2, y: (u[3].y + u[4].y) / 2 };
|
|
1258
1258
|
}
|
|
1259
1259
|
}
|
|
@@ -1261,17 +1261,17 @@ class wt {
|
|
|
1261
1261
|
constructor(e) {
|
|
1262
1262
|
i(this, "path");
|
|
1263
1263
|
i(this, "midpoint");
|
|
1264
|
-
const { arrowLength: t, radius: o, smallRadius: s, dir:
|
|
1264
|
+
const { arrowLength: t, radius: o, smallRadius: s, dir: a, origin: n, hasArrow: h } = e, d = s + o, c = s * o / d, g = Math.sqrt(d * d - s * s), u = g * s / d, l = g + o + t, p = t + u, w = [
|
|
1265
1265
|
{ x: t, y: 0 },
|
|
1266
1266
|
{ x: p, y: c },
|
|
1267
1267
|
{ x: p, y: -c },
|
|
1268
1268
|
{ x: l, y: 0 }
|
|
1269
|
-
].map((A) => x(A,
|
|
1269
|
+
].map((A) => x(A, a, { x: 0, y: 0 })).map((A) => ({ x: A.x + n.x, y: A.y + n.y })), f = [
|
|
1270
1270
|
`M ${w[0].x} ${w[0].y}`,
|
|
1271
1271
|
`A ${s} ${s} 0 0 1 ${w[1].x} ${w[1].y}`,
|
|
1272
1272
|
`A ${o} ${o} 0 1 0 ${w[2].x} ${w[2].y}`,
|
|
1273
1273
|
`A ${s} ${s} 0 0 1 ${w[0].x} ${w[0].y}`
|
|
1274
|
-
].join(" "), m = `M ${
|
|
1274
|
+
].join(" "), m = `M ${n.x} ${n.y} L ${w[0].x} ${w[0].y} `;
|
|
1275
1275
|
this.path = `${h ? "" : m}${f}`, this.midpoint = w[3];
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
@@ -1284,8 +1284,8 @@ class ft {
|
|
|
1284
1284
|
from: t,
|
|
1285
1285
|
to: o,
|
|
1286
1286
|
sourceOffset: s,
|
|
1287
|
-
targetOffset:
|
|
1288
|
-
hasSourceArrow:
|
|
1287
|
+
targetOffset: a,
|
|
1288
|
+
hasSourceArrow: n,
|
|
1289
1289
|
hasTargetArrow: h,
|
|
1290
1290
|
arrowLength: d
|
|
1291
1291
|
} = e;
|
|
@@ -1297,13 +1297,13 @@ class ft {
|
|
|
1297
1297
|
}
|
|
1298
1298
|
const u = { x: c, y: g }, l = this.createDirectLinePoint({
|
|
1299
1299
|
offset: s,
|
|
1300
|
-
hasArrow:
|
|
1300
|
+
hasArrow: n,
|
|
1301
1301
|
flip: 1,
|
|
1302
1302
|
shift: t,
|
|
1303
1303
|
arrowLength: d,
|
|
1304
1304
|
dir: u
|
|
1305
1305
|
}), p = this.createDirectLinePoint({
|
|
1306
|
-
offset:
|
|
1306
|
+
offset: a,
|
|
1307
1307
|
hasArrow: h,
|
|
1308
1308
|
flip: -1,
|
|
1309
1309
|
shift: o,
|
|
@@ -1313,10 +1313,10 @@ class ft {
|
|
|
1313
1313
|
this.path = `M ${l.x} ${l.y} L ${p.x} ${p.y}`;
|
|
1314
1314
|
}
|
|
1315
1315
|
createDirectLinePoint(e) {
|
|
1316
|
-
const t = e.hasArrow ? e.arrowLength : 0, o = e.offset + t, s = e.flip * o / this.diagonalDistance, { dir:
|
|
1316
|
+
const t = e.hasArrow ? e.arrowLength : 0, o = e.offset + t, s = e.flip * o / this.diagonalDistance, { dir: a, shift: n } = e;
|
|
1317
1317
|
return {
|
|
1318
|
-
x:
|
|
1319
|
-
y:
|
|
1318
|
+
x: a.x * s + n.x,
|
|
1319
|
+
y: a.y * s + n.y
|
|
1320
1320
|
};
|
|
1321
1321
|
}
|
|
1322
1322
|
}
|
|
@@ -1332,32 +1332,32 @@ class xt {
|
|
|
1332
1332
|
hasSourceArrow: t,
|
|
1333
1333
|
hasTargetArrow: o,
|
|
1334
1334
|
arrowLength: s,
|
|
1335
|
-
from:
|
|
1336
|
-
to:
|
|
1335
|
+
from: a,
|
|
1336
|
+
to: n,
|
|
1337
1337
|
fromDir: h,
|
|
1338
1338
|
toDir: d,
|
|
1339
1339
|
arrowOffset: c,
|
|
1340
1340
|
roundness: g,
|
|
1341
1341
|
detourDistance: u
|
|
1342
1342
|
} = e, l = t ? x(
|
|
1343
|
-
{ x:
|
|
1343
|
+
{ x: a.x + s, y: a.y },
|
|
1344
1344
|
h,
|
|
1345
|
-
|
|
1346
|
-
) :
|
|
1345
|
+
a
|
|
1346
|
+
) : a, p = o ? x(
|
|
1347
1347
|
{
|
|
1348
|
-
x:
|
|
1349
|
-
y:
|
|
1348
|
+
x: n.x - s,
|
|
1349
|
+
y: n.y
|
|
1350
1350
|
},
|
|
1351
1351
|
d,
|
|
1352
|
-
a
|
|
1353
|
-
) : a, y = s + c, w = x(
|
|
1354
|
-
{ x: n.x + y, y: n.y },
|
|
1355
|
-
h,
|
|
1356
1352
|
n
|
|
1353
|
+
) : n, y = s + c, w = x(
|
|
1354
|
+
{ x: a.x + y, y: a.y },
|
|
1355
|
+
h,
|
|
1356
|
+
a
|
|
1357
1357
|
), f = x(
|
|
1358
|
-
{ x:
|
|
1358
|
+
{ x: n.x - y, y: n.y },
|
|
1359
1359
|
d,
|
|
1360
|
-
|
|
1360
|
+
n
|
|
1361
1361
|
), m = vt(w, f, u);
|
|
1362
1362
|
this.midpoint = {
|
|
1363
1363
|
x: (w.x + f.x) / 2,
|
|
@@ -1387,8 +1387,8 @@ class At {
|
|
|
1387
1387
|
hasSourceArrow: t,
|
|
1388
1388
|
hasTargetArrow: o,
|
|
1389
1389
|
arrowLength: s,
|
|
1390
|
-
fromDir:
|
|
1391
|
-
toDir:
|
|
1390
|
+
fromDir: a,
|
|
1391
|
+
toDir: n,
|
|
1392
1392
|
from: h,
|
|
1393
1393
|
to: d,
|
|
1394
1394
|
arrowOffset: c,
|
|
@@ -1396,22 +1396,22 @@ class At {
|
|
|
1396
1396
|
roundness: u
|
|
1397
1397
|
} = e, l = t ? x(
|
|
1398
1398
|
{ x: h.x + s, y: h.y },
|
|
1399
|
-
|
|
1399
|
+
a,
|
|
1400
1400
|
h
|
|
1401
1401
|
) : h, p = o ? x(
|
|
1402
1402
|
{
|
|
1403
1403
|
x: d.x - s,
|
|
1404
1404
|
y: d.y
|
|
1405
1405
|
},
|
|
1406
|
-
|
|
1406
|
+
n,
|
|
1407
1407
|
d
|
|
1408
1408
|
) : d, y = s + c, w = x(
|
|
1409
1409
|
{ x: h.x + y, y: h.y },
|
|
1410
|
-
|
|
1410
|
+
a,
|
|
1411
1411
|
h
|
|
1412
1412
|
), f = x(
|
|
1413
1413
|
{ x: d.x - y, y: d.y },
|
|
1414
|
-
|
|
1414
|
+
n,
|
|
1415
1415
|
d
|
|
1416
1416
|
), m = mt(w, f, g);
|
|
1417
1417
|
this.midpoint = {
|
|
@@ -1469,21 +1469,21 @@ class X {
|
|
|
1469
1469
|
this.params = e, [this.afterRenderEmitter, this.onAfterRender] = P(), this.arrowRenderer = this.params.arrowRenderer, this.svg = Me(e.color), this.svg.appendChild(this.group), this.line = De(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = Y(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = Y(), this.group.appendChild(this.targetArrow));
|
|
1470
1470
|
}
|
|
1471
1471
|
render(e) {
|
|
1472
|
-
const { x: t, y: o, width: s, height:
|
|
1472
|
+
const { x: t, y: o, width: s, height: a, from: n, to: h } = Te(
|
|
1473
1473
|
e.from,
|
|
1474
1474
|
e.to,
|
|
1475
1475
|
this.params.padding
|
|
1476
1476
|
);
|
|
1477
|
-
Re(this.svg, { x: t, y: o, width: s, height:
|
|
1477
|
+
Re(this.svg, { x: t, y: o, width: s, height: a });
|
|
1478
1478
|
const d = we(e.from.direction), c = we(e.to.direction);
|
|
1479
1479
|
let g = { x: -c.x, y: -c.y }, u;
|
|
1480
1480
|
e.category === L.PortCycle ? (u = this.params.createCyclePath, g = d) : e.category === L.NodeCycle ? u = this.params.createDetourPath : u = this.params.createLinePath;
|
|
1481
|
-
const l = u(
|
|
1481
|
+
const l = u(n, h, d, c);
|
|
1482
1482
|
this.line.setAttribute("d", l.path);
|
|
1483
1483
|
let p = null;
|
|
1484
1484
|
this.sourceArrow && (p = this.arrowRenderer({
|
|
1485
1485
|
direction: d,
|
|
1486
|
-
shift:
|
|
1486
|
+
shift: n,
|
|
1487
1487
|
arrowLength: this.params.arrowLength
|
|
1488
1488
|
}), this.sourceArrow.setAttribute("d", p));
|
|
1489
1489
|
let y = null;
|
|
@@ -1508,13 +1508,13 @@ const Et = (r) => (e) => {
|
|
|
1508
1508
|
).map((h) => ({
|
|
1509
1509
|
x: h.x + e.shift.x,
|
|
1510
1510
|
y: h.y + e.shift.y
|
|
1511
|
-
})), s = `M ${o[0].x} ${o[0].y}`,
|
|
1512
|
-
return `${s} ${
|
|
1511
|
+
})), s = `M ${o[0].x} ${o[0].y}`, a = `L ${o[1].x} ${o[1].y}`, n = `L ${o[2].x} ${o[2].y}`;
|
|
1512
|
+
return `${s} ${a} ${n} Z`;
|
|
1513
1513
|
}, St = (r) => (e) => {
|
|
1514
|
-
const t = r.radius, o = e.arrowLength, s = (o * o + 2 * o * t) / (2 * t),
|
|
1514
|
+
const t = r.radius, o = e.arrowLength, s = (o * o + 2 * o * t) / (2 * t), a = s + t, n = o + t - t * (o + t) / a, h = t * s / a, c = [
|
|
1515
1515
|
{ x: 0, y: 0 },
|
|
1516
|
-
{ x:
|
|
1517
|
-
{ x:
|
|
1516
|
+
{ x: n, y: -h },
|
|
1517
|
+
{ x: n, y: h }
|
|
1518
1518
|
].map(
|
|
1519
1519
|
(y) => x(y, e.direction, { x: 0, y: 0 })
|
|
1520
1520
|
).map((y) => ({
|
|
@@ -1536,12 +1536,12 @@ const Et = (r) => (e) => {
|
|
|
1536
1536
|
x: e.arrowLength + r.smallRadius,
|
|
1537
1537
|
y: 0
|
|
1538
1538
|
}
|
|
1539
|
-
),
|
|
1539
|
+
), n = [{ x: 0, y: 0 }, { x: s.x, y: -s.y }, s].map(
|
|
1540
1540
|
(u) => x(u, e.direction, { x: 0, y: 0 })
|
|
1541
1541
|
).map((u) => ({
|
|
1542
1542
|
x: u.x + e.shift.x,
|
|
1543
1543
|
y: u.y + e.shift.y
|
|
1544
|
-
})), h = `M ${
|
|
1544
|
+
})), h = `M ${n[0].x} ${n[0].y}`, d = `A ${o} ${o} 0 0 1 ${n[1].x} ${n[1].y}`, c = `A ${t} ${t} 0 0 1 ${n[2].x} ${n[2].y}`, g = `A ${o} ${o} 0 0 1 ${n[0].x} ${n[0].y}`;
|
|
1545
1545
|
return `${h} ${d} ${c} ${g}`;
|
|
1546
1546
|
}, U = (r) => {
|
|
1547
1547
|
if (typeof r == "function")
|
|
@@ -1863,14 +1863,14 @@ class Le {
|
|
|
1863
1863
|
[this.afterRenderEmitter, this.onAfterRender] = P(), this.color = (e == null ? void 0 : e.color) ?? v.color, this.width = (e == null ? void 0 : e.width) ?? v.width, this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? v.arrowLength, this.arrowRenderer = U((e == null ? void 0 : e.arrowRenderer) ?? {}), this.sourceOffset = (e == null ? void 0 : e.sourceOffset) ?? v.preOffset, this.targetOffset = (e == null ? void 0 : e.targetOffset) ?? v.preOffset, this.svg = Me(this.color), this.svg.appendChild(this.group), this.line = De(this.width), this.group.appendChild(this.line), e != null && e.hasSourceArrow && (this.sourceArrow = Y(), this.group.appendChild(this.sourceArrow)), e != null && e.hasTargetArrow && (this.targetArrow = Y(), this.group.appendChild(this.targetArrow));
|
|
1864
1864
|
}
|
|
1865
1865
|
render(e) {
|
|
1866
|
-
const { x: t, y: o, width: s, height:
|
|
1866
|
+
const { x: t, y: o, width: s, height: a, from: n, to: h } = Te(
|
|
1867
1867
|
e.from,
|
|
1868
1868
|
e.to,
|
|
1869
1869
|
O
|
|
1870
1870
|
);
|
|
1871
|
-
Re(this.svg, { x: t, y: o, width: s, height:
|
|
1871
|
+
Re(this.svg, { x: t, y: o, width: s, height: a });
|
|
1872
1872
|
const d = new ft({
|
|
1873
|
-
from:
|
|
1873
|
+
from: n,
|
|
1874
1874
|
to: h,
|
|
1875
1875
|
sourceOffset: this.sourceOffset,
|
|
1876
1876
|
targetOffset: this.targetOffset,
|
|
@@ -1885,8 +1885,8 @@ class Le {
|
|
|
1885
1885
|
this.sourceArrow !== null && (c = "", this.sourceArrow.setAttribute("d", c)), this.targetArrow !== null && (g = "", this.targetArrow.setAttribute("d", g));
|
|
1886
1886
|
else {
|
|
1887
1887
|
const l = {
|
|
1888
|
-
x: (h.x -
|
|
1889
|
-
y: (h.y -
|
|
1888
|
+
x: (h.x - n.x) / u,
|
|
1889
|
+
y: (h.y - n.y) / u
|
|
1890
1890
|
};
|
|
1891
1891
|
if (this.sourceArrow) {
|
|
1892
1892
|
const p = {
|
|
@@ -1971,8 +1971,8 @@ class Mr {
|
|
|
1971
1971
|
i(this, "onAfterRender");
|
|
1972
1972
|
i(this, "svg");
|
|
1973
1973
|
this.baseShape = e, this.midpointElement = t, this.svg = this.baseShape.svg, this.group = this.baseShape.group, this.line = this.baseShape.line, this.sourceArrow = this.baseShape.sourceArrow, this.targetArrow = this.baseShape.targetArrow, this.onAfterRender = this.baseShape.onAfterRender, this.svg.append(this.midpointElement), this.baseShape.onAfterRender.subscribe((o) => {
|
|
1974
|
-
const s = o.edgePath.midpoint,
|
|
1975
|
-
this.midpointElement.style.setProperty("transform",
|
|
1974
|
+
const s = o.edgePath.midpoint, a = `translate(${s.x}px, ${s.y}px)`;
|
|
1975
|
+
this.midpointElement.style.setProperty("transform", a);
|
|
1976
1976
|
});
|
|
1977
1977
|
}
|
|
1978
1978
|
render(e) {
|
|
@@ -2259,12 +2259,12 @@ class $e {
|
|
|
2259
2259
|
const It = (r, e) => Symbol.iterator in r ? {
|
|
2260
2260
|
minContentScale: e.focus.minContentScale,
|
|
2261
2261
|
nodes: r,
|
|
2262
|
-
|
|
2262
|
+
contentPadding: e.focus.contentPadding,
|
|
2263
2263
|
animationDuration: e.focus.animationDuration
|
|
2264
2264
|
} : {
|
|
2265
2265
|
minContentScale: r.minContentScale ?? e.focus.minContentScale,
|
|
2266
2266
|
nodes: r.nodes ?? [],
|
|
2267
|
-
|
|
2267
|
+
contentPadding: r.contentPadding ?? r.contentOffset ?? e.focus.contentPadding,
|
|
2268
2268
|
animationDuration: r.animationDuration ?? e.focus.animationDuration
|
|
2269
2269
|
}, Be = (r, e, t) => ({
|
|
2270
2270
|
scale: r.scale,
|
|
@@ -2286,20 +2286,20 @@ class Oe {
|
|
|
2286
2286
|
this.viewportStore.patchContentMatrix(e);
|
|
2287
2287
|
}
|
|
2288
2288
|
center(e, t) {
|
|
2289
|
-
const { width: o, height: s } = this.viewportStore.getDimensions(),
|
|
2290
|
-
let g = Be(
|
|
2289
|
+
const { width: o, height: s } = this.viewportStore.getDimensions(), a = { x: o / 2, y: s / 2 }, n = this.viewportStore.getViewportMatrix(), h = this.viewportStore.createViewportCoords(e), d = h.x - a.x, c = h.y - a.y;
|
|
2290
|
+
let g = Be(n, d, c);
|
|
2291
2291
|
const u = t == null ? void 0 : t.contentScale;
|
|
2292
2292
|
if (u !== void 0) {
|
|
2293
2293
|
const p = 1 / u;
|
|
2294
2294
|
g = Ue(
|
|
2295
2295
|
g,
|
|
2296
|
-
p /
|
|
2297
|
-
|
|
2298
|
-
|
|
2296
|
+
p / n.scale,
|
|
2297
|
+
a.x,
|
|
2298
|
+
a.y
|
|
2299
2299
|
);
|
|
2300
2300
|
}
|
|
2301
2301
|
const l = (t == null ? void 0 : t.animationDuration) ?? 0;
|
|
2302
|
-
l > 0 ? this.animateNavigation(
|
|
2302
|
+
l > 0 ? this.animateNavigation(n, g, l) : this.viewportStore.patchViewportMatrix(g);
|
|
2303
2303
|
}
|
|
2304
2304
|
focus(e) {
|
|
2305
2305
|
const t = It(e ?? {}, this.params);
|
|
@@ -2311,19 +2311,19 @@ class Oe {
|
|
|
2311
2311
|
this.viewportStore.destroy();
|
|
2312
2312
|
}
|
|
2313
2313
|
navigate(e) {
|
|
2314
|
-
let t = 1 / 0, o = -1 / 0, s = 1 / 0,
|
|
2314
|
+
let t = 1 / 0, o = -1 / 0, s = 1 / 0, a = -1 / 0, n = 0;
|
|
2315
2315
|
const h = /* @__PURE__ */ new Set();
|
|
2316
2316
|
for (const d of e.nodes)
|
|
2317
2317
|
h.add(d);
|
|
2318
2318
|
if (this.graphStore.getAllNodeIds().forEach((d) => {
|
|
2319
2319
|
const { payload: c } = this.graphStore.getNode(d);
|
|
2320
|
-
c.x !== null && c.y !== null && (h.size === 0 || h.has(d)) && (t = Math.min(c.x, t), o = Math.max(c.x, o), s = Math.min(c.y, s),
|
|
2321
|
-
}),
|
|
2322
|
-
t -= e.
|
|
2320
|
+
c.x !== null && c.y !== null && (h.size === 0 || h.has(d)) && (t = Math.min(c.x, t), o = Math.max(c.x, o), s = Math.min(c.y, s), a = Math.max(c.y, a), n++);
|
|
2321
|
+
}), n > 0) {
|
|
2322
|
+
t -= e.contentPadding, s -= e.contentPadding, o += e.contentPadding, a += e.contentPadding;
|
|
2323
2323
|
const d = {
|
|
2324
2324
|
x: (t + o) / 2,
|
|
2325
|
-
y: (s +
|
|
2326
|
-
}, { scale: c } = this.viewportStore.getContentMatrix(), g = (
|
|
2325
|
+
y: (s + a) / 2
|
|
2326
|
+
}, { scale: c } = this.viewportStore.getContentMatrix(), g = (a - s) * c, u = (o - t) * c, { width: l, height: p } = this.viewportStore.getDimensions(), y = Math.max(
|
|
2327
2327
|
u / l,
|
|
2328
2328
|
g / p
|
|
2329
2329
|
), w = y > 1 ? c / y : c, f = Math.max(w, e.minContentScale);
|
|
@@ -2335,24 +2335,24 @@ class Oe {
|
|
|
2335
2335
|
}
|
|
2336
2336
|
animateNavigation(e, t, o) {
|
|
2337
2337
|
let s;
|
|
2338
|
-
const
|
|
2338
|
+
const a = {
|
|
2339
2339
|
scale: t.scale - e.scale,
|
|
2340
2340
|
x: t.x - e.x,
|
|
2341
2341
|
y: t.y - e.y
|
|
2342
|
-
},
|
|
2342
|
+
}, n = (h) => {
|
|
2343
2343
|
s === void 0 && (s = h);
|
|
2344
2344
|
const d = Math.min((h - s) / o, 1);
|
|
2345
2345
|
d <= 1 && this.viewportStore.patchViewportMatrix({
|
|
2346
|
-
scale: e.scale + d *
|
|
2347
|
-
x: e.x + d *
|
|
2348
|
-
y: e.y + d *
|
|
2349
|
-
}), d < 1 && this.win.requestAnimationFrame(
|
|
2346
|
+
scale: e.scale + d * a.scale,
|
|
2347
|
+
x: e.x + d * a.x,
|
|
2348
|
+
y: e.y + d * a.y
|
|
2349
|
+
}), d < 1 && this.win.requestAnimationFrame(n);
|
|
2350
2350
|
};
|
|
2351
|
-
this.win.requestAnimationFrame(
|
|
2351
|
+
this.win.requestAnimationFrame(n);
|
|
2352
2352
|
}
|
|
2353
2353
|
}
|
|
2354
2354
|
const We = (r, e, t) => {
|
|
2355
|
-
const o = new be(), s = new Ie(o),
|
|
2355
|
+
const o = new be(), s = new Ie(o), a = new $e(e), n = new Ee(o, e, r), h = {
|
|
2356
2356
|
nodes: {
|
|
2357
2357
|
centerFn: Ce,
|
|
2358
2358
|
priorityFn: () => 0
|
|
@@ -2366,11 +2366,11 @@ const We = (r, e, t) => {
|
|
|
2366
2366
|
}
|
|
2367
2367
|
}, d = new Ve(
|
|
2368
2368
|
o,
|
|
2369
|
-
|
|
2369
|
+
n,
|
|
2370
2370
|
h
|
|
2371
2371
|
), c = {
|
|
2372
2372
|
focus: {
|
|
2373
|
-
|
|
2373
|
+
contentPadding: 0,
|
|
2374
2374
|
minContentScale: 0,
|
|
2375
2375
|
schedule: re,
|
|
2376
2376
|
animationDuration: 0
|
|
@@ -2381,7 +2381,7 @@ const We = (r, e, t) => {
|
|
|
2381
2381
|
c,
|
|
2382
2382
|
t
|
|
2383
2383
|
);
|
|
2384
|
-
return new Se(s,
|
|
2384
|
+
return new Se(s, a, d, g);
|
|
2385
2385
|
};
|
|
2386
2386
|
class G {
|
|
2387
2387
|
constructor(e, t, o, s) {
|
|
@@ -2426,8 +2426,8 @@ class G {
|
|
|
2426
2426
|
const t = e;
|
|
2427
2427
|
if (t.touches.length !== 1)
|
|
2428
2428
|
return;
|
|
2429
|
-
const o = t.touches[0], s = e.currentTarget,
|
|
2430
|
-
this.params.onPortPointerDown(
|
|
2429
|
+
const o = t.touches[0], s = e.currentTarget, a = this.canvas.graph.findPortIdsByElement(s)[0];
|
|
2430
|
+
this.params.onPortPointerDown(a, {
|
|
2431
2431
|
x: o.clientX,
|
|
2432
2432
|
y: o.clientY
|
|
2433
2433
|
}) && (e.stopPropagation(), this.window.addEventListener("touchmove", this.onWindowTouchMove, {
|
|
@@ -2546,7 +2546,7 @@ class oe {
|
|
|
2546
2546
|
const t = e;
|
|
2547
2547
|
if (!this.params.mouseDownEventVerifier(t))
|
|
2548
2548
|
return;
|
|
2549
|
-
const o = e.currentTarget, s = this.graph.findNodeIdByElement(o),
|
|
2549
|
+
const o = e.currentTarget, s = this.graph.findNodeIdByElement(o), a = this.graph.getNode(s);
|
|
2550
2550
|
if (!this.params.nodeDragVerifier(s))
|
|
2551
2551
|
return;
|
|
2552
2552
|
this.params.onNodeDragStarted(s), e.stopPropagation();
|
|
@@ -2556,8 +2556,8 @@ class oe {
|
|
|
2556
2556
|
});
|
|
2557
2557
|
this.grabbedNode = {
|
|
2558
2558
|
nodeId: s,
|
|
2559
|
-
dx: h.x -
|
|
2560
|
-
dy: h.y -
|
|
2559
|
+
dx: h.x - a.x,
|
|
2560
|
+
dy: h.y - a.y
|
|
2561
2561
|
}, k(this.element, this.params.dragCursor), this.moveNodeOnTop(s), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
|
|
2562
2562
|
passive: !0
|
|
2563
2563
|
}), this.window.addEventListener("mouseup", this.onWindowMouseUp, {
|
|
@@ -2569,12 +2569,12 @@ class oe {
|
|
|
2569
2569
|
if (t.touches.length !== 1)
|
|
2570
2570
|
return;
|
|
2571
2571
|
e.stopPropagation();
|
|
2572
|
-
const o = t.touches[0], s = e.currentTarget,
|
|
2572
|
+
const o = t.touches[0], s = e.currentTarget, a = this.canvas.graph.findNodeIdByElement(s), n = this.graph.getNode(a);
|
|
2573
2573
|
if (!this.params.nodeDragVerifier({
|
|
2574
|
-
nodeId:
|
|
2575
|
-
element:
|
|
2576
|
-
x:
|
|
2577
|
-
y:
|
|
2574
|
+
nodeId: a,
|
|
2575
|
+
element: n.element,
|
|
2576
|
+
x: n.x,
|
|
2577
|
+
y: n.y
|
|
2578
2578
|
}))
|
|
2579
2579
|
return;
|
|
2580
2580
|
const d = this.calculateContentPoint({
|
|
@@ -2582,10 +2582,10 @@ class oe {
|
|
|
2582
2582
|
y: o.clientY
|
|
2583
2583
|
});
|
|
2584
2584
|
this.grabbedNode = {
|
|
2585
|
-
nodeId:
|
|
2586
|
-
dx: d.x -
|
|
2587
|
-
dy: d.y -
|
|
2588
|
-
}, this.moveNodeOnTop(
|
|
2585
|
+
nodeId: a,
|
|
2586
|
+
dx: d.x - n.x,
|
|
2587
|
+
dy: d.y - n.y
|
|
2588
|
+
}, this.moveNodeOnTop(a), this.window.addEventListener("touchmove", this.onWindowTouchMove, {
|
|
2589
2589
|
passive: !0
|
|
2590
2590
|
}), this.window.addEventListener("touchend", this.onWindowTouchFinish, {
|
|
2591
2591
|
passive: !0
|
|
@@ -2652,10 +2652,10 @@ class oe {
|
|
|
2652
2652
|
const o = this.calculateContentPoint(t), s = {
|
|
2653
2653
|
x: o.x - e.dx,
|
|
2654
2654
|
y: o.y - e.dy
|
|
2655
|
-
},
|
|
2655
|
+
}, a = this.adjustNodeCoords(s);
|
|
2656
2656
|
this.canvas.updateNode(e.nodeId, {
|
|
2657
|
-
x:
|
|
2658
|
-
y:
|
|
2657
|
+
x: a.x,
|
|
2658
|
+
y: a.y
|
|
2659
2659
|
}), this.params.onNodeDrag(e.nodeId);
|
|
2660
2660
|
}
|
|
2661
2661
|
moveNodeOnTop(e) {
|
|
@@ -2720,14 +2720,14 @@ const W = (r) => {
|
|
|
2720
2720
|
const o = e.reduce(
|
|
2721
2721
|
(h, d) => [h[0] + d[0], h[1] + d[1]],
|
|
2722
2722
|
[0, 0]
|
|
2723
|
-
), s = [o[0] / t, o[1] / t],
|
|
2723
|
+
), s = [o[0] / t, o[1] / t], n = e.map((h) => [h[0] - s[0], h[1] - s[1]]).reduce(
|
|
2724
2724
|
(h, d) => h + Math.sqrt(d[0] * d[0] + d[1] * d[1]),
|
|
2725
2725
|
0
|
|
2726
2726
|
);
|
|
2727
2727
|
return {
|
|
2728
2728
|
x: s[0],
|
|
2729
2729
|
y: s[1],
|
|
2730
|
-
scale:
|
|
2730
|
+
scale: n / t,
|
|
2731
2731
|
touchesCnt: t,
|
|
2732
2732
|
touches: e
|
|
2733
2733
|
};
|
|
@@ -2768,8 +2768,8 @@ class j {
|
|
|
2768
2768
|
i(this, "onWheelScroll", (e) => {
|
|
2769
2769
|
if (!this.params.mouseWheelEventVerifier(e))
|
|
2770
2770
|
return;
|
|
2771
|
-
const { left: t, top: o } = this.element.getBoundingClientRect(), s = e.clientX - t,
|
|
2772
|
-
this.wheelFinishTimer === null && this.params.onTransformStarted(), this.scaleViewport(h, s,
|
|
2771
|
+
const { left: t, top: o } = this.element.getBoundingClientRect(), s = e.clientX - t, a = e.clientY - o, h = 1 / (e.deltaY < 0 ? this.params.wheelSensitivity : 1 / this.params.wheelSensitivity);
|
|
2772
|
+
this.wheelFinishTimer === null && this.params.onTransformStarted(), this.scaleViewport(h, s, a), this.wheelFinishTimer !== null && clearTimeout(this.wheelFinishTimer), this.wheelFinishTimer = setTimeout(() => {
|
|
2773
2773
|
this.transformInProgress || this.params.onTransformFinished(), this.wheelFinishTimer = null;
|
|
2774
2774
|
}, this.params.scaleWheelFinishTimeout);
|
|
2775
2775
|
});
|
|
@@ -2798,8 +2798,8 @@ class j {
|
|
|
2798
2798
|
-(t.x - this.prevTouches.x),
|
|
2799
2799
|
-(t.y - this.prevTouches.y)
|
|
2800
2800
|
), t.touchesCnt === 2) {
|
|
2801
|
-
const { left: s, top:
|
|
2802
|
-
this.scaleViewport(c,
|
|
2801
|
+
const { left: s, top: a } = this.element.getBoundingClientRect(), n = this.prevTouches.x - s, h = this.prevTouches.y - a, c = 1 / (t.scale / this.prevTouches.scale);
|
|
2802
|
+
this.scaleViewport(c, n, h);
|
|
2803
2803
|
}
|
|
2804
2804
|
this.prevTouches = t;
|
|
2805
2805
|
});
|
|
@@ -2825,19 +2825,19 @@ class j {
|
|
|
2825
2825
|
new j(e, t, o, s);
|
|
2826
2826
|
}
|
|
2827
2827
|
moveViewport(e, t) {
|
|
2828
|
-
const o = this.viewport.getViewportMatrix(), s = Be(o, e, t), { width:
|
|
2828
|
+
const o = this.viewport.getViewportMatrix(), s = Be(o, e, t), { width: a, height: n } = this.viewport.getDimensions(), h = this.params.transformPreprocessor({
|
|
2829
2829
|
prevTransform: o,
|
|
2830
2830
|
nextTransform: s,
|
|
2831
|
-
canvasWidth:
|
|
2832
|
-
canvasHeight:
|
|
2831
|
+
canvasWidth: a,
|
|
2832
|
+
canvasHeight: n
|
|
2833
2833
|
});
|
|
2834
2834
|
this.performTransform(h);
|
|
2835
2835
|
}
|
|
2836
2836
|
scaleViewport(e, t, o) {
|
|
2837
|
-
const s = this.canvas.viewport.getViewportMatrix(),
|
|
2837
|
+
const s = this.canvas.viewport.getViewportMatrix(), a = Ue(s, e, t, o), { width: n, height: h } = this.viewport.getDimensions(), d = this.params.transformPreprocessor({
|
|
2838
2838
|
prevTransform: s,
|
|
2839
|
-
nextTransform:
|
|
2840
|
-
canvasWidth:
|
|
2839
|
+
nextTransform: a,
|
|
2840
|
+
canvasWidth: n,
|
|
2841
2841
|
canvasHeight: h
|
|
2842
2842
|
});
|
|
2843
2843
|
this.performTransform(d);
|
|
@@ -2874,7 +2874,7 @@ class j {
|
|
|
2874
2874
|
}
|
|
2875
2875
|
}
|
|
2876
2876
|
class se {
|
|
2877
|
-
constructor(e, t, o, s,
|
|
2877
|
+
constructor(e, t, o, s, a, n) {
|
|
2878
2878
|
i(this, "nodeHorizontal");
|
|
2879
2879
|
i(this, "nodeVertical");
|
|
2880
2880
|
i(this, "viewport");
|
|
@@ -2897,7 +2897,7 @@ class se {
|
|
|
2897
2897
|
this.userTransformInProgress || this.loadAreaAroundViewport();
|
|
2898
2898
|
});
|
|
2899
2899
|
i(this, "userTransformInProgress", !1);
|
|
2900
|
-
this.canvas = e, this.element = t, this.window = o, this.trigger =
|
|
2900
|
+
this.canvas = e, this.element = t, this.window = o, this.trigger = a, this.params = n, this.nodeHorizontal = this.params.nodeVerticalRadius, this.nodeVertical = this.params.nodeHorizontalRadius, this.viewport = e.viewport, this.currentScale = this.viewport.getViewportMatrix().scale, this.scheduleLoadAreaAroundViewport(), this.viewport.onAfterResize.subscribe(() => {
|
|
2901
2901
|
this.scheduleLoadAreaAroundViewport();
|
|
2902
2902
|
});
|
|
2903
2903
|
const h = {
|
|
@@ -2927,14 +2927,14 @@ class se {
|
|
|
2927
2927
|
h
|
|
2928
2928
|
), this.trigger.subscribe(this.updateLoadedArea), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterViewportUpdated);
|
|
2929
2929
|
}
|
|
2930
|
-
static configure(e, t, o, s,
|
|
2930
|
+
static configure(e, t, o, s, a, n) {
|
|
2931
2931
|
new se(
|
|
2932
2932
|
e,
|
|
2933
2933
|
t,
|
|
2934
2934
|
o,
|
|
2935
2935
|
s,
|
|
2936
|
-
|
|
2937
|
-
|
|
2936
|
+
a,
|
|
2937
|
+
n
|
|
2938
2938
|
);
|
|
2939
2939
|
}
|
|
2940
2940
|
scheduleLoadAreaAroundViewport() {
|
|
@@ -2944,12 +2944,12 @@ class se {
|
|
|
2944
2944
|
}
|
|
2945
2945
|
scheduleEnsureViewportAreaLoaded() {
|
|
2946
2946
|
setTimeout(() => {
|
|
2947
|
-
const { width: e, height: t } = this.viewport.getDimensions(), { scale: o, x: s, y:
|
|
2947
|
+
const { width: e, height: t } = this.viewport.getDimensions(), { scale: o, x: s, y: a } = this.viewport.getViewportMatrix(), n = e * o, h = t * o, d = s - this.nodeHorizontal, c = a - this.nodeVertical, g = s + n + this.nodeHorizontal, u = a + h + this.nodeVertical;
|
|
2948
2948
|
this.loadedArea.xFrom < d && this.loadedArea.xTo > g && this.loadedArea.yFrom < c && this.loadedArea.yTo > u || this.loadAreaAroundViewport();
|
|
2949
2949
|
});
|
|
2950
2950
|
}
|
|
2951
2951
|
loadAreaAroundViewport() {
|
|
2952
|
-
const { width: e, height: t } = this.viewport.getDimensions(), { scale: o, x: s, y:
|
|
2952
|
+
const { width: e, height: t } = this.viewport.getDimensions(), { scale: o, x: s, y: a } = this.viewport.getViewportMatrix(), n = e * o, h = t * o, d = s - n - this.nodeHorizontal, c = a - h - this.nodeVertical, g = 3 * n + 2 * this.nodeHorizontal, u = 3 * h + 2 * this.nodeVertical;
|
|
2953
2953
|
this.trigger.emit({
|
|
2954
2954
|
x: d,
|
|
2955
2955
|
y: c,
|
|
@@ -2990,8 +2990,8 @@ class ie {
|
|
|
2990
2990
|
this.canvas = e, this.backgroundHost = o, this.tileWidth = t.tileWidth, this.tileHeight = t.tileHeight, this.halfTileWidth = this.tileWidth / 2, this.halfTileHeight = this.tileHeight / 2, this.patternContent = t.renderer, this.maxViewportScale = t.maxViewportScale;
|
|
2991
2991
|
const s = `translate(${this.halfTileWidth}, ${this.halfTileHeight})`;
|
|
2992
2992
|
this.patternContent.setAttribute("transform", s), this.pattern.appendChild(this.patternContent);
|
|
2993
|
-
const
|
|
2994
|
-
|
|
2993
|
+
const a = document.createElementNS("http://www.w3.org/2000/svg", "defs");
|
|
2994
|
+
a.appendChild(this.pattern), this.svg.appendChild(a), this.svg.appendChild(this.patternRenderingRectangle), this.updateDimensions(), this.canvas.viewport.onAfterResize.subscribe(() => {
|
|
2995
2995
|
this.updateDimensions();
|
|
2996
2996
|
}), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterTransformUpdated), this.onAfterTransformUpdated();
|
|
2997
2997
|
}
|
|
@@ -3010,14 +3010,14 @@ class ie {
|
|
|
3010
3010
|
}
|
|
3011
3011
|
}
|
|
3012
3012
|
class ne {
|
|
3013
|
-
constructor(e, t, o, s,
|
|
3013
|
+
constructor(e, t, o, s, a) {
|
|
3014
3014
|
i(this, "overlayCanvas");
|
|
3015
3015
|
i(this, "staticPortId", null);
|
|
3016
3016
|
i(this, "isTargetDragging", !0);
|
|
3017
3017
|
i(this, "onEdgeCreated", (e) => {
|
|
3018
3018
|
this.params.onAfterEdgeCreated(e);
|
|
3019
3019
|
});
|
|
3020
|
-
this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.params =
|
|
3020
|
+
this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.params = a, this.overlayCanvas = We(
|
|
3021
3021
|
this.overlayLayer,
|
|
3022
3022
|
this.viewportStore,
|
|
3023
3023
|
this.window
|
|
@@ -3031,33 +3031,33 @@ class ne {
|
|
|
3031
3031
|
onStopDrag: () => {
|
|
3032
3032
|
this.resetDragState();
|
|
3033
3033
|
},
|
|
3034
|
-
onPortPointerDown: (
|
|
3035
|
-
const d = this.params.connectionTypeResolver(
|
|
3036
|
-
return d === null ? !1 : (this.grabPort(
|
|
3034
|
+
onPortPointerDown: (n, h) => {
|
|
3035
|
+
const d = this.params.connectionTypeResolver(n);
|
|
3036
|
+
return d === null ? !1 : (this.grabPort(n, h, d), !0);
|
|
3037
3037
|
},
|
|
3038
|
-
onPointerMove: (
|
|
3039
|
-
this.moveDraggingPort(
|
|
3038
|
+
onPointerMove: (n) => {
|
|
3039
|
+
this.moveDraggingPort(n);
|
|
3040
3040
|
},
|
|
3041
|
-
onPointerUp: (
|
|
3042
|
-
this.tryCreateConnection(
|
|
3041
|
+
onPointerUp: (n) => {
|
|
3042
|
+
this.tryCreateConnection(n);
|
|
3043
3043
|
}
|
|
3044
3044
|
}
|
|
3045
3045
|
);
|
|
3046
3046
|
}
|
|
3047
|
-
static configure(e, t, o, s,
|
|
3047
|
+
static configure(e, t, o, s, a) {
|
|
3048
3048
|
new ne(
|
|
3049
3049
|
e,
|
|
3050
3050
|
t,
|
|
3051
3051
|
o,
|
|
3052
3052
|
s,
|
|
3053
|
-
|
|
3053
|
+
a
|
|
3054
3054
|
);
|
|
3055
3055
|
}
|
|
3056
3056
|
grabPort(e, t, o) {
|
|
3057
3057
|
const s = this.canvas.graph.getPort(e);
|
|
3058
3058
|
this.staticPortId = e;
|
|
3059
|
-
const
|
|
3060
|
-
x:
|
|
3059
|
+
const a = s.element.getBoundingClientRect(), n = a.x + a.width / 2, h = a.y + a.height / 2, d = this.overlayLayer.getBoundingClientRect(), c = this.canvas.viewport.createContentCoords({
|
|
3060
|
+
x: n - d.x,
|
|
3061
3061
|
y: h - d.y
|
|
3062
3062
|
}), g = this.canvas.viewport.createContentCoords({
|
|
3063
3063
|
x: t.x - d.x,
|
|
@@ -3091,8 +3091,8 @@ class ne {
|
|
|
3091
3091
|
});
|
|
3092
3092
|
return;
|
|
3093
3093
|
}
|
|
3094
|
-
const s = this.isTargetDragging ? o : t,
|
|
3095
|
-
h !== null ? (this.canvas.graph.onAfterEdgeAdded.subscribe(this.onEdgeCreated), this.canvas.addEdge(h), this.canvas.graph.onAfterEdgeAdded.unsubscribe(this.onEdgeCreated)) : this.params.onEdgeCreationPrevented(
|
|
3094
|
+
const s = this.isTargetDragging ? o : t, a = this.isTargetDragging ? t : o, n = { from: s, to: a }, h = this.params.connectionPreprocessor(n);
|
|
3095
|
+
h !== null ? (this.canvas.graph.onAfterEdgeAdded.subscribe(this.onEdgeCreated), this.canvas.addEdge(h), this.canvas.graph.onAfterEdgeAdded.unsubscribe(this.onEdgeCreated)) : this.params.onEdgeCreationPrevented(n);
|
|
3096
3096
|
}
|
|
3097
3097
|
moveDraggingPort(e) {
|
|
3098
3098
|
const t = this.overlayLayer.getBoundingClientRect(), o = this.canvas.viewport.createContentCoords({
|
|
@@ -3106,7 +3106,7 @@ class ne {
|
|
|
3106
3106
|
}
|
|
3107
3107
|
}
|
|
3108
3108
|
class ae {
|
|
3109
|
-
constructor(e, t, o, s,
|
|
3109
|
+
constructor(e, t, o, s, a) {
|
|
3110
3110
|
i(this, "overlayCanvas");
|
|
3111
3111
|
i(this, "staticPortId", null);
|
|
3112
3112
|
i(this, "isTargetDragging", !0);
|
|
@@ -3114,7 +3114,7 @@ class ae {
|
|
|
3114
3114
|
i(this, "onEdgeReattached", (e) => {
|
|
3115
3115
|
this.params.onAfterEdgeReattached(e);
|
|
3116
3116
|
});
|
|
3117
|
-
this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.params =
|
|
3117
|
+
this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.params = a, this.overlayCanvas = We(
|
|
3118
3118
|
this.overlayLayer,
|
|
3119
3119
|
this.viewportStore,
|
|
3120
3120
|
this.window
|
|
@@ -3128,31 +3128,31 @@ class ae {
|
|
|
3128
3128
|
onStopDrag: () => {
|
|
3129
3129
|
this.resetDragState();
|
|
3130
3130
|
},
|
|
3131
|
-
onPortPointerDown: (
|
|
3132
|
-
onPointerMove: (
|
|
3133
|
-
this.moveDraggingPort(
|
|
3131
|
+
onPortPointerDown: (n, h) => this.tryStartEdgeDragging(n, h),
|
|
3132
|
+
onPointerMove: (n) => {
|
|
3133
|
+
this.moveDraggingPort(n);
|
|
3134
3134
|
},
|
|
3135
|
-
onPointerUp: (
|
|
3136
|
-
this.tryCreateConnection(
|
|
3135
|
+
onPointerUp: (n) => {
|
|
3136
|
+
this.tryCreateConnection(n);
|
|
3137
3137
|
}
|
|
3138
3138
|
}
|
|
3139
3139
|
);
|
|
3140
3140
|
}
|
|
3141
|
-
static configure(e, t, o, s,
|
|
3141
|
+
static configure(e, t, o, s, a) {
|
|
3142
3142
|
new ae(
|
|
3143
3143
|
e,
|
|
3144
3144
|
t,
|
|
3145
3145
|
o,
|
|
3146
3146
|
s,
|
|
3147
|
-
|
|
3147
|
+
a
|
|
3148
3148
|
);
|
|
3149
3149
|
}
|
|
3150
3150
|
tryStartEdgeDragging(e, t) {
|
|
3151
3151
|
const o = this.params.draggingEdgeResolver(e);
|
|
3152
3152
|
if (o === null || !this.canvas.graph.hasEdge(o))
|
|
3153
3153
|
return !1;
|
|
3154
|
-
const s = this.canvas.graph.getEdge(o),
|
|
3155
|
-
this.staticPortId = h, this.isTargetDragging =
|
|
3154
|
+
const s = this.canvas.graph.getEdge(o), a = e === s.from, n = e === s.to, h = a ? s.to : s.from;
|
|
3155
|
+
this.staticPortId = h, this.isTargetDragging = n;
|
|
3156
3156
|
const d = this.canvas.graph.getPort(e), c = this.canvas.graph.getPort(h), g = c.element.getBoundingClientRect(), u = {
|
|
3157
3157
|
x: g.x + g.width / 2,
|
|
3158
3158
|
y: g.y + g.height / 2
|
|
@@ -3214,13 +3214,13 @@ class ae {
|
|
|
3214
3214
|
});
|
|
3215
3215
|
return;
|
|
3216
3216
|
}
|
|
3217
|
-
const [o, s] = this.isTargetDragging ? [this.staticPortId, t] : [t, this.staticPortId],
|
|
3218
|
-
id:
|
|
3217
|
+
const [o, s] = this.isTargetDragging ? [this.staticPortId, t] : [t, this.staticPortId], a = this.draggingEdgePayload, n = {
|
|
3218
|
+
id: a.id,
|
|
3219
3219
|
from: o,
|
|
3220
3220
|
to: s,
|
|
3221
|
-
shape:
|
|
3222
|
-
priority:
|
|
3223
|
-
}, h = this.params.connectionPreprocessor(
|
|
3221
|
+
shape: a.shape,
|
|
3222
|
+
priority: a.priority
|
|
3223
|
+
}, h = this.params.connectionPreprocessor(n);
|
|
3224
3224
|
if (h !== null)
|
|
3225
3225
|
this.canvas.graph.onAfterEdgeAdded.subscribe(this.onEdgeReattached), this.canvas.addEdge(h), this.canvas.graph.onAfterEdgeAdded.unsubscribe(this.onEdgeReattached);
|
|
3226
3226
|
else {
|
|
@@ -3357,10 +3357,10 @@ const Yt = (r) => {
|
|
|
3357
3357
|
const e = ((p = r.events) == null ? void 0 : p.onNodeDragStarted) ?? (() => {
|
|
3358
3358
|
}), t = ((y = r.events) == null ? void 0 : y.onNodeDrag) ?? (() => {
|
|
3359
3359
|
}), o = r.nodeDragVerifier ?? (() => !0), s = ((w = r.events) == null ? void 0 : w.onNodeDragFinished) ?? (() => {
|
|
3360
|
-
}),
|
|
3360
|
+
}), a = r.moveOnTop !== !1, n = r.moveEdgesOnTop !== !1 && a, h = (f = r.mouse) == null ? void 0 : f.dragCursor, d = h !== void 0 ? h : "grab", c = (m = r.mouse) == null ? void 0 : m.mouseDownEventVerifier, g = c !== void 0 ? c : (N) => N.button === 0, u = (A = r.mouse) == null ? void 0 : A.mouseUpEventVerifier, l = u !== void 0 ? u : (N) => N.button === 0;
|
|
3361
3361
|
return {
|
|
3362
|
-
moveOnTop:
|
|
3363
|
-
moveEdgesOnTop:
|
|
3362
|
+
moveOnTop: a,
|
|
3363
|
+
moveEdgesOnTop: n,
|
|
3364
3364
|
dragCursor: d,
|
|
3365
3365
|
gridSize: r.gridSize ?? null,
|
|
3366
3366
|
mouseDownEventVerifier: g,
|
|
@@ -3372,28 +3372,28 @@ const Yt = (r) => {
|
|
|
3372
3372
|
};
|
|
3373
3373
|
}, Xt = (r) => {
|
|
3374
3374
|
const e = r.minX !== null ? r.minX : -1 / 0, t = r.maxX !== null ? r.maxX : 1 / 0, o = r.minY !== null ? r.minY : -1 / 0, s = r.maxY !== null ? r.maxY : 1 / 0;
|
|
3375
|
-
return (
|
|
3376
|
-
let
|
|
3377
|
-
|
|
3378
|
-
const d =
|
|
3379
|
-
|
|
3380
|
-
const g =
|
|
3381
|
-
return h > u && h >
|
|
3375
|
+
return (a) => {
|
|
3376
|
+
let n = a.nextTransform.x, h = a.nextTransform.y;
|
|
3377
|
+
n < e && n < a.prevTransform.x && (n = Math.min(a.prevTransform.x, e));
|
|
3378
|
+
const d = a.canvasWidth * a.prevTransform.scale, c = t - d;
|
|
3379
|
+
n > c && n > a.prevTransform.x && (n = Math.max(a.prevTransform.x, c)), h < o && h < a.prevTransform.y && (h = Math.min(a.prevTransform.y, o));
|
|
3380
|
+
const g = a.canvasHeight * a.prevTransform.scale, u = s - g;
|
|
3381
|
+
return h > u && h > a.prevTransform.y && (h = Math.max(a.prevTransform.y, u)), { scale: a.nextTransform.scale, x: n, y: h };
|
|
3382
3382
|
};
|
|
3383
3383
|
}, Gt = (r) => {
|
|
3384
3384
|
const e = r.maxContentScale, t = r.minContentScale, o = e !== null ? 1 / e : 0, s = t !== null ? 1 / t : 1 / 0;
|
|
3385
|
-
return (
|
|
3386
|
-
const
|
|
3385
|
+
return (a) => {
|
|
3386
|
+
const n = a.prevTransform, h = a.nextTransform;
|
|
3387
3387
|
let d = h.scale, c = h.x, g = h.y;
|
|
3388
|
-
if (h.scale > s && h.scale >
|
|
3389
|
-
d = Math.max(
|
|
3390
|
-
const u = (d -
|
|
3391
|
-
c =
|
|
3388
|
+
if (h.scale > s && h.scale > n.scale) {
|
|
3389
|
+
d = Math.max(n.scale, s), c = n.x, g = n.y;
|
|
3390
|
+
const u = (d - n.scale) / (h.scale - n.scale);
|
|
3391
|
+
c = n.x + (h.x - n.x) * u, g = n.y + (h.y - n.y) * u;
|
|
3392
3392
|
}
|
|
3393
|
-
if (h.scale < o && h.scale <
|
|
3394
|
-
d = Math.min(
|
|
3395
|
-
const u = (d -
|
|
3396
|
-
c =
|
|
3393
|
+
if (h.scale < o && h.scale < n.scale) {
|
|
3394
|
+
d = Math.min(n.scale, o), c = n.x, g = n.y;
|
|
3395
|
+
const u = (d - n.scale) / (h.scale - n.scale);
|
|
3396
|
+
c = n.x + (h.x - n.x) * u, g = n.y + (h.y - n.y) * u;
|
|
3397
3397
|
}
|
|
3398
3398
|
return {
|
|
3399
3399
|
scale: d,
|
|
@@ -3435,7 +3435,7 @@ const Yt = (r) => {
|
|
|
3435
3435
|
(D) => xe(D)
|
|
3436
3436
|
)
|
|
3437
3437
|
) : s = xe(o) : s = (D) => D.nextTransform;
|
|
3438
|
-
const
|
|
3438
|
+
const a = ((w = r == null ? void 0 : r.shift) == null ? void 0 : w.cursor) !== void 0 ? r.shift.cursor : "grab", n = ((f = r == null ? void 0 : r.events) == null ? void 0 : f.onBeforeTransformChange) ?? (() => {
|
|
3439
3439
|
}), h = ((m = r == null ? void 0 : r.events) == null ? void 0 : m.onTransformChange) ?? (() => {
|
|
3440
3440
|
}), d = (A = r == null ? void 0 : r.shift) == null ? void 0 : A.mouseDownEventVerifier, c = d !== void 0 ? d : (D) => D.button === 0, g = (N = r == null ? void 0 : r.shift) == null ? void 0 : N.mouseUpEventVerifier, u = g !== void 0 ? g : (D) => D.button === 0, l = (C = r == null ? void 0 : r.scale) == null ? void 0 : C.mouseWheelEventVerifier, p = l !== void 0 ? l : () => !0;
|
|
3441
3441
|
return {
|
|
@@ -3444,10 +3444,10 @@ const Yt = (r) => {
|
|
|
3444
3444
|
}),
|
|
3445
3445
|
onTransformFinished: ((I = r == null ? void 0 : r.events) == null ? void 0 : I.onTransformFinished) ?? (() => {
|
|
3446
3446
|
}),
|
|
3447
|
-
onBeforeTransformChange:
|
|
3447
|
+
onBeforeTransformChange: n,
|
|
3448
3448
|
onTransformChange: h,
|
|
3449
3449
|
transformPreprocessor: s,
|
|
3450
|
-
shiftCursor:
|
|
3450
|
+
shiftCursor: a,
|
|
3451
3451
|
mouseDownEventVerifier: c,
|
|
3452
3452
|
mouseUpEventVerifier: u,
|
|
3453
3453
|
mouseWheelEventVerifier: p,
|
|
@@ -3546,16 +3546,16 @@ const Yt = (r) => {
|
|
|
3546
3546
|
}
|
|
3547
3547
|
}, Zt = (r, e, t) => {
|
|
3548
3548
|
var c, g, u;
|
|
3549
|
-
const o = () => "direct", s = (l) => l,
|
|
3549
|
+
const o = () => "direct", s = (l) => l, a = (l) => l.button === 0, n = () => {
|
|
3550
3550
|
}, h = () => {
|
|
3551
3551
|
}, d = () => {
|
|
3552
3552
|
};
|
|
3553
3553
|
return {
|
|
3554
3554
|
connectionTypeResolver: r.connectionTypeResolver ?? o,
|
|
3555
3555
|
connectionPreprocessor: r.connectionPreprocessor ?? s,
|
|
3556
|
-
mouseDownEventVerifier: r.mouseDownEventVerifier ??
|
|
3557
|
-
mouseUpEventVerifier: r.mouseUpEventVerifier ??
|
|
3558
|
-
onAfterEdgeCreated: ((c = r.events) == null ? void 0 : c.onAfterEdgeCreated) ??
|
|
3556
|
+
mouseDownEventVerifier: r.mouseDownEventVerifier ?? a,
|
|
3557
|
+
mouseUpEventVerifier: r.mouseUpEventVerifier ?? a,
|
|
3558
|
+
onAfterEdgeCreated: ((c = r.events) == null ? void 0 : c.onAfterEdgeCreated) ?? n,
|
|
3559
3559
|
onEdgeCreationInterrupted: ((g = r.events) == null ? void 0 : g.onEdgeCreationInterrupted) ?? d,
|
|
3560
3560
|
onEdgeCreationPrevented: ((u = r.events) == null ? void 0 : u.onEdgeCreationPrevented) ?? h,
|
|
3561
3561
|
dragPortDirection: r.dragPortDirection ?? t,
|
|
@@ -3563,10 +3563,10 @@ const Yt = (r) => {
|
|
|
3563
3563
|
};
|
|
3564
3564
|
}, _t = (r, e) => {
|
|
3565
3565
|
var c, g, u;
|
|
3566
|
-
const t = (l) => l, o = (l) => l.button === 0 && l.ctrlKey, s = (l) => l.button === 0,
|
|
3566
|
+
const t = (l) => l, o = (l) => l.button === 0 && l.ctrlKey, s = (l) => l.button === 0, a = (l) => {
|
|
3567
3567
|
const p = e.getPortAdjacentEdgeIds(l);
|
|
3568
3568
|
return p.length > 0 ? p[p.length - 1] : null;
|
|
3569
|
-
},
|
|
3569
|
+
}, n = () => {
|
|
3570
3570
|
}, h = () => {
|
|
3571
3571
|
}, d = () => {
|
|
3572
3572
|
};
|
|
@@ -3574,9 +3574,9 @@ const Yt = (r) => {
|
|
|
3574
3574
|
connectionPreprocessor: r.connectionPreprocessor ?? t,
|
|
3575
3575
|
mouseDownEventVerifier: r.mouseDownEventVerifier ?? o,
|
|
3576
3576
|
mouseUpEventVerifier: r.mouseUpEventVerifier ?? s,
|
|
3577
|
-
draggingEdgeResolver: r.draggingEdgeResolver ??
|
|
3577
|
+
draggingEdgeResolver: r.draggingEdgeResolver ?? a,
|
|
3578
3578
|
draggingEdgeShapeFactory: r.draggingEdgeShape !== void 0 ? le(r.draggingEdgeShape) : null,
|
|
3579
|
-
onAfterEdgeReattached: ((c = r.events) == null ? void 0 : c.onAfterEdgeReattached) ??
|
|
3579
|
+
onAfterEdgeReattached: ((c = r.events) == null ? void 0 : c.onAfterEdgeReattached) ?? n,
|
|
3580
3580
|
onEdgeReattachInterrupted: ((g = r.events) == null ? void 0 : g.onEdgeReattachInterrupted) ?? d,
|
|
3581
3581
|
onEdgeReattachPrevented: ((u = r.events) == null ? void 0 : u.onEdgeReattachPrevented) ?? h
|
|
3582
3582
|
};
|
|
@@ -3613,10 +3613,10 @@ class ze {
|
|
|
3613
3613
|
const t = /* @__PURE__ */ new Map();
|
|
3614
3614
|
return this.graph.getAllNodeIds().forEach((s) => {
|
|
3615
3615
|
t.set(s, { x: 0, y: 0 });
|
|
3616
|
-
}), this.nodeForcesApplicationStrategy.apply(this.currentCoords, t), this.applyEdgeForces(t), this.currentCoords.forEach((s,
|
|
3617
|
-
const
|
|
3618
|
-
x:
|
|
3619
|
-
y:
|
|
3616
|
+
}), this.nodeForcesApplicationStrategy.apply(this.currentCoords, t), this.applyEdgeForces(t), this.currentCoords.forEach((s, a) => {
|
|
3617
|
+
const n = t.get(a), h = {
|
|
3618
|
+
x: n.x / this.nodeMass * this.dt,
|
|
3619
|
+
y: n.y / this.nodeMass * this.dt
|
|
3620
3620
|
};
|
|
3621
3621
|
e = Math.max(
|
|
3622
3622
|
e,
|
|
@@ -3628,10 +3628,10 @@ class ze {
|
|
|
3628
3628
|
}
|
|
3629
3629
|
applyEdgeForces(e) {
|
|
3630
3630
|
this.graph.getAllEdgeIds().forEach((t) => {
|
|
3631
|
-
const o = this.graph.getEdge(t), s = this.graph.getPort(o.from),
|
|
3632
|
-
|
|
3631
|
+
const o = this.graph.getEdge(t), s = this.graph.getPort(o.from), a = this.graph.getPort(o.to), n = this.currentCoords.get(s.nodeId), h = this.currentCoords.get(a.nodeId), d = this.distanceVectorGenerator.create(
|
|
3632
|
+
n,
|
|
3633
3633
|
h
|
|
3634
|
-
), g = (d.d - this.edgeEquilibriumLength) * this.edgeStiffness, u = d.ex * g, l = d.ey * g, p = e.get(s.nodeId), y = e.get(
|
|
3634
|
+
), g = (d.d - this.edgeEquilibriumLength) * this.edgeStiffness, u = d.ex * g, l = d.ey * g, p = e.get(s.nodeId), y = e.get(a.nodeId);
|
|
3635
3635
|
p.x += u, p.y += l, y.x -= u, y.y -= l;
|
|
3636
3636
|
});
|
|
3637
3637
|
}
|
|
@@ -3642,8 +3642,8 @@ class ke {
|
|
|
3642
3642
|
this.rand = e;
|
|
3643
3643
|
}
|
|
3644
3644
|
create(e, t) {
|
|
3645
|
-
const o = t.x - e.x, s = t.y - e.y,
|
|
3646
|
-
if (
|
|
3645
|
+
const o = t.x - e.x, s = t.y - e.y, a = o * o + s * s;
|
|
3646
|
+
if (a === 0) {
|
|
3647
3647
|
const c = this.PI2 * this.rand();
|
|
3648
3648
|
return {
|
|
3649
3649
|
ex: Math.cos(c),
|
|
@@ -3651,8 +3651,8 @@ class ke {
|
|
|
3651
3651
|
d: 0
|
|
3652
3652
|
};
|
|
3653
3653
|
}
|
|
3654
|
-
const
|
|
3655
|
-
return { ex: h, ey: d, d:
|
|
3654
|
+
const n = Math.sqrt(a), h = o / n, d = s / n;
|
|
3655
|
+
return { ex: h, ey: d, d: n };
|
|
3656
3656
|
}
|
|
3657
3657
|
}
|
|
3658
3658
|
const He = (r) => {
|
|
@@ -3670,10 +3670,10 @@ class rr {
|
|
|
3670
3670
|
}
|
|
3671
3671
|
apply(e, t) {
|
|
3672
3672
|
const o = Array.from(t.keys()), s = o.length;
|
|
3673
|
-
for (let
|
|
3674
|
-
const
|
|
3675
|
-
for (let h =
|
|
3676
|
-
const d = o[h], c = e.get(
|
|
3673
|
+
for (let a = 0; a < s; a++) {
|
|
3674
|
+
const n = o[a];
|
|
3675
|
+
for (let h = a + 1; h < s; h++) {
|
|
3676
|
+
const d = o[h], c = e.get(n), g = e.get(d), u = this.distanceVectorGenerator.create(
|
|
3677
3677
|
c,
|
|
3678
3678
|
g
|
|
3679
3679
|
), l = He({
|
|
@@ -3682,7 +3682,7 @@ class rr {
|
|
|
3682
3682
|
targetCharge: this.nodeCharge,
|
|
3683
3683
|
distance: u.d,
|
|
3684
3684
|
maxForce: this.maxForce
|
|
3685
|
-
}), p = l * u.ex, y = l * u.ey, w = t.get(
|
|
3685
|
+
}), p = l * u.ex, y = l * u.ey, w = t.get(n), f = t.get(d);
|
|
3686
3686
|
w.x -= p, w.y -= y, f.x += p, f.y += y;
|
|
3687
3687
|
}
|
|
3688
3688
|
}
|
|
@@ -3699,7 +3699,7 @@ const or = (r) => {
|
|
|
3699
3699
|
r.forEach((d) => {
|
|
3700
3700
|
e = Math.min(e, d.x), t = Math.max(t, d.x), o = Math.min(o, d.y), s = Math.max(s, d.y);
|
|
3701
3701
|
});
|
|
3702
|
-
const
|
|
3702
|
+
const a = t - e, n = s - o, h = Math.max(a, n);
|
|
3703
3703
|
return {
|
|
3704
3704
|
centerX: (e + t) / 2,
|
|
3705
3705
|
centerY: (o + s) / 2,
|
|
@@ -3735,15 +3735,15 @@ class sr {
|
|
|
3735
3735
|
const o = [];
|
|
3736
3736
|
for (; t.length > 0; ) {
|
|
3737
3737
|
const s = t.pop();
|
|
3738
|
-
this.processNode(s).forEach((
|
|
3739
|
-
o.push(
|
|
3738
|
+
this.processNode(s).forEach((n) => {
|
|
3739
|
+
o.push(n);
|
|
3740
3740
|
});
|
|
3741
3741
|
}
|
|
3742
3742
|
t = o;
|
|
3743
3743
|
}
|
|
3744
3744
|
this.sortedParentNodes.reverse().forEach((o) => {
|
|
3745
|
-
let s = 0,
|
|
3746
|
-
o.lb !== null && (
|
|
3745
|
+
let s = 0, a = 0, n = 0, h = 0;
|
|
3746
|
+
o.lb !== null && (n += o.lb.totalMass, h += o.lb.totalCharge, s += o.lb.chargeCenter.x * o.lb.totalCharge, a += o.lb.chargeCenter.y * o.lb.totalCharge), o.lt !== null && (n += o.lt.totalMass, h += o.lt.totalCharge, s += o.lt.chargeCenter.x * o.lt.totalCharge, a += o.lt.chargeCenter.y * o.lt.totalCharge), o.rb !== null && (n += o.rb.totalMass, h += o.rb.totalCharge, s += o.rb.chargeCenter.x * o.rb.totalCharge, a += o.rb.chargeCenter.y * o.rb.totalCharge), o.rt !== null && (n += o.rt.totalMass, h += o.rt.totalCharge, s += o.rt.chargeCenter.x * o.rt.totalCharge, a += o.rt.chargeCenter.y * o.rt.totalCharge), o.totalMass = n, o.totalCharge = h, o.chargeCenter.x = s / h, o.chargeCenter.y = a / h;
|
|
3747
3747
|
});
|
|
3748
3748
|
}
|
|
3749
3749
|
getRoot() {
|
|
@@ -3759,10 +3759,10 @@ class sr {
|
|
|
3759
3759
|
if (s < this.areaRadiusThreshold)
|
|
3760
3760
|
return this.setLeaf(e), [];
|
|
3761
3761
|
this.sortedParentNodes.push(e);
|
|
3762
|
-
const
|
|
3762
|
+
const a = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), c = s / 2;
|
|
3763
3763
|
e.nodeIds.forEach((l) => {
|
|
3764
3764
|
const { x: p, y } = this.coords.get(l);
|
|
3765
|
-
p < t ? y < o ? d.add(l) : h.add(l) : y < o ?
|
|
3765
|
+
p < t ? y < o ? d.add(l) : h.add(l) : y < o ? n.add(l) : a.add(l), e.nodeIds.delete(l);
|
|
3766
3766
|
});
|
|
3767
3767
|
const g = {
|
|
3768
3768
|
parent: e,
|
|
@@ -3771,9 +3771,9 @@ class sr {
|
|
|
3771
3771
|
rb: null,
|
|
3772
3772
|
rt: null
|
|
3773
3773
|
}, u = [];
|
|
3774
|
-
if (
|
|
3774
|
+
if (a.size > 0) {
|
|
3775
3775
|
const l = {
|
|
3776
|
-
nodeIds:
|
|
3776
|
+
nodeIds: a,
|
|
3777
3777
|
totalMass: 0,
|
|
3778
3778
|
totalCharge: 0,
|
|
3779
3779
|
chargeCenter: {
|
|
@@ -3789,9 +3789,9 @@ class sr {
|
|
|
3789
3789
|
};
|
|
3790
3790
|
e.rt = l, u.push(l);
|
|
3791
3791
|
}
|
|
3792
|
-
if (
|
|
3792
|
+
if (n.size > 0) {
|
|
3793
3793
|
const l = {
|
|
3794
|
-
nodeIds:
|
|
3794
|
+
nodeIds: n,
|
|
3795
3795
|
totalMass: 0,
|
|
3796
3796
|
totalCharge: 0,
|
|
3797
3797
|
chargeCenter: {
|
|
@@ -3858,8 +3858,8 @@ class sr {
|
|
|
3858
3858
|
};
|
|
3859
3859
|
let t = 0, o = 0;
|
|
3860
3860
|
return e.forEach((s) => {
|
|
3861
|
-
const
|
|
3862
|
-
t +=
|
|
3861
|
+
const a = this.coords.get(s);
|
|
3862
|
+
t += a.x, o += a.y;
|
|
3863
3863
|
}), { x: t / e.size, y: o / e.size };
|
|
3864
3864
|
}
|
|
3865
3865
|
}
|
|
@@ -3882,17 +3882,17 @@ class ir {
|
|
|
3882
3882
|
nodeMass: this.nodeMass,
|
|
3883
3883
|
nodeCharge: this.nodeCharge
|
|
3884
3884
|
});
|
|
3885
|
-
e.forEach((
|
|
3885
|
+
e.forEach((a, n) => {
|
|
3886
3886
|
const h = this.calculateForceForNode(
|
|
3887
|
-
s.getLeaf(
|
|
3888
|
-
|
|
3887
|
+
s.getLeaf(n),
|
|
3888
|
+
n,
|
|
3889
3889
|
e
|
|
3890
|
-
), d = t.get(
|
|
3890
|
+
), d = t.get(n);
|
|
3891
3891
|
this.applyForce(d, h);
|
|
3892
3892
|
});
|
|
3893
3893
|
}
|
|
3894
3894
|
calculateForceForNode(e, t, o) {
|
|
3895
|
-
const s = o.get(t),
|
|
3895
|
+
const s = o.get(t), a = { x: 0, y: 0 };
|
|
3896
3896
|
e.nodeIds.forEach((h) => {
|
|
3897
3897
|
if (h !== t) {
|
|
3898
3898
|
const d = o.get(h), c = this.calculateNodeRepulsiveForce({
|
|
@@ -3901,72 +3901,72 @@ class ir {
|
|
|
3901
3901
|
sourceCoords: d,
|
|
3902
3902
|
targetCoords: s
|
|
3903
3903
|
});
|
|
3904
|
-
this.applyForce(
|
|
3904
|
+
this.applyForce(a, c);
|
|
3905
3905
|
}
|
|
3906
3906
|
});
|
|
3907
|
-
let
|
|
3908
|
-
for (;
|
|
3909
|
-
const h =
|
|
3907
|
+
let n = e;
|
|
3908
|
+
for (; n !== null; ) {
|
|
3909
|
+
const h = n.parent;
|
|
3910
3910
|
if (h !== null) {
|
|
3911
3911
|
const d = this.distanceVectorGenerator.create(
|
|
3912
3912
|
h.chargeCenter,
|
|
3913
3913
|
s
|
|
3914
3914
|
);
|
|
3915
3915
|
h.box.radius * 2 < d.d * this.theta ? (this.tryApplyFarForce({
|
|
3916
|
-
totalForce:
|
|
3916
|
+
totalForce: a,
|
|
3917
3917
|
targetCoords: s,
|
|
3918
3918
|
target: h.lb,
|
|
3919
|
-
current:
|
|
3919
|
+
current: n
|
|
3920
3920
|
}), this.tryApplyFarForce({
|
|
3921
|
-
totalForce:
|
|
3921
|
+
totalForce: a,
|
|
3922
3922
|
targetCoords: s,
|
|
3923
3923
|
target: h.rb,
|
|
3924
|
-
current:
|
|
3924
|
+
current: n
|
|
3925
3925
|
}), this.tryApplyFarForce({
|
|
3926
|
-
totalForce:
|
|
3926
|
+
totalForce: a,
|
|
3927
3927
|
targetCoords: s,
|
|
3928
3928
|
target: h.rt,
|
|
3929
|
-
current:
|
|
3929
|
+
current: n
|
|
3930
3930
|
}), this.tryApplyFarForce({
|
|
3931
|
-
totalForce:
|
|
3931
|
+
totalForce: a,
|
|
3932
3932
|
targetCoords: s,
|
|
3933
3933
|
target: h.lt,
|
|
3934
|
-
current:
|
|
3934
|
+
current: n
|
|
3935
3935
|
})) : (this.tryApplyNearForce({
|
|
3936
|
-
totalForce:
|
|
3936
|
+
totalForce: a,
|
|
3937
3937
|
targetCoords: s,
|
|
3938
3938
|
target: h.lb,
|
|
3939
|
-
current:
|
|
3939
|
+
current: n,
|
|
3940
3940
|
nodesCoords: o
|
|
3941
3941
|
}), this.tryApplyNearForce({
|
|
3942
|
-
totalForce:
|
|
3942
|
+
totalForce: a,
|
|
3943
3943
|
targetCoords: s,
|
|
3944
3944
|
target: h.rb,
|
|
3945
|
-
current:
|
|
3945
|
+
current: n,
|
|
3946
3946
|
nodesCoords: o
|
|
3947
3947
|
}), this.tryApplyNearForce({
|
|
3948
|
-
totalForce:
|
|
3948
|
+
totalForce: a,
|
|
3949
3949
|
targetCoords: s,
|
|
3950
3950
|
target: h.rt,
|
|
3951
|
-
current:
|
|
3951
|
+
current: n,
|
|
3952
3952
|
nodesCoords: o
|
|
3953
3953
|
}), this.tryApplyNearForce({
|
|
3954
|
-
totalForce:
|
|
3954
|
+
totalForce: a,
|
|
3955
3955
|
targetCoords: s,
|
|
3956
3956
|
target: h.lt,
|
|
3957
|
-
current:
|
|
3957
|
+
current: n,
|
|
3958
3958
|
nodesCoords: o
|
|
3959
3959
|
}));
|
|
3960
3960
|
}
|
|
3961
|
-
|
|
3961
|
+
n = n.parent;
|
|
3962
3962
|
}
|
|
3963
|
-
return
|
|
3963
|
+
return a;
|
|
3964
3964
|
}
|
|
3965
3965
|
calculateExactForce(e, t, o) {
|
|
3966
|
-
const s = { x: 0, y: 0 },
|
|
3967
|
-
for (;
|
|
3968
|
-
const
|
|
3969
|
-
|
|
3966
|
+
const s = { x: 0, y: 0 }, a = [e];
|
|
3967
|
+
for (; a.length > 0; ) {
|
|
3968
|
+
const n = a.pop();
|
|
3969
|
+
n.nodeIds.forEach((h) => {
|
|
3970
3970
|
const d = o.get(h), c = this.calculateNodeRepulsiveForce({
|
|
3971
3971
|
sourceCharge: this.nodeCharge,
|
|
3972
3972
|
targetCharge: this.nodeCharge,
|
|
@@ -3974,7 +3974,7 @@ class ir {
|
|
|
3974
3974
|
targetCoords: t
|
|
3975
3975
|
});
|
|
3976
3976
|
this.applyForce(s, c);
|
|
3977
|
-
}),
|
|
3977
|
+
}), n.lb !== null && a.push(n.lb), n.rb !== null && a.push(n.rb), n.lt !== null && a.push(n.lt), n.rt !== null && a.push(n.rt);
|
|
3978
3978
|
}
|
|
3979
3979
|
return s;
|
|
3980
3980
|
}
|
|
@@ -4046,18 +4046,18 @@ class Xe {
|
|
|
4046
4046
|
this.rand = e.rand, this.sparsity = e.sparsity;
|
|
4047
4047
|
}
|
|
4048
4048
|
calculateCoordinates(e) {
|
|
4049
|
-
const { graph: t, viewport: o } = e, s = /* @__PURE__ */ new Map(),
|
|
4049
|
+
const { graph: t, viewport: o } = e, s = /* @__PURE__ */ new Map(), a = t.getAllNodeIds().filter((y) => {
|
|
4050
4050
|
const w = t.getNode(y);
|
|
4051
4051
|
return w.x === null || w.y === null;
|
|
4052
|
-
}),
|
|
4052
|
+
}), n = Math.sqrt(a.length) * this.sparsity, { width: h, height: d } = o.getDimensions(), c = { x: h / 2, y: d / 2 }, g = o.createContentCoords(c), u = n / 2, l = {
|
|
4053
4053
|
x: g.x - u,
|
|
4054
4054
|
y: g.y - u
|
|
4055
4055
|
};
|
|
4056
4056
|
return t.getAllNodeIds().forEach((y) => {
|
|
4057
4057
|
const w = t.getNode(y);
|
|
4058
4058
|
s.set(y, {
|
|
4059
|
-
x: w.x ?? l.x +
|
|
4060
|
-
y: w.y ?? l.y +
|
|
4059
|
+
x: w.x ?? l.x + n * this.rand(),
|
|
4060
|
+
y: w.y ?? l.y + n * this.rand()
|
|
4061
4061
|
});
|
|
4062
4062
|
}), s;
|
|
4063
4063
|
}
|
|
@@ -4091,7 +4091,7 @@ class nr {
|
|
|
4091
4091
|
graph: t,
|
|
4092
4092
|
viewport: o
|
|
4093
4093
|
});
|
|
4094
|
-
for (let
|
|
4094
|
+
for (let a = 0; a < this.maxIterations && !(new ze(
|
|
4095
4095
|
t,
|
|
4096
4096
|
s,
|
|
4097
4097
|
{
|
|
@@ -4102,7 +4102,7 @@ class nr {
|
|
|
4102
4102
|
edgeEquilibriumLength: this.edgeEquilibriumLength,
|
|
4103
4103
|
edgeStiffness: this.edgeStiffness
|
|
4104
4104
|
}
|
|
4105
|
-
).apply() < this.convergenceVelocity);
|
|
4105
|
+
).apply() < this.convergenceVelocity); a++)
|
|
4106
4106
|
;
|
|
4107
4107
|
return s;
|
|
4108
4108
|
}
|
|
@@ -4127,13 +4127,13 @@ class ar {
|
|
|
4127
4127
|
this.forest.add({ root: t, sequence: o });
|
|
4128
4128
|
let s = [t];
|
|
4129
4129
|
for (this.remainingNodeIds.delete(t.nodeId); s.length > 0; ) {
|
|
4130
|
-
const
|
|
4131
|
-
s.forEach((
|
|
4132
|
-
o.push(
|
|
4133
|
-
const h = this.graph.getNodeOutgoingEdgeIds(
|
|
4130
|
+
const a = [];
|
|
4131
|
+
s.forEach((n) => {
|
|
4132
|
+
o.push(n);
|
|
4133
|
+
const h = this.graph.getNodeOutgoingEdgeIds(n.nodeId).map((g) => {
|
|
4134
4134
|
const u = this.graph.getEdge(g);
|
|
4135
4135
|
return this.graph.getPort(u.to).nodeId;
|
|
4136
|
-
}), d = this.graph.getNodeIncomingEdgeIds(
|
|
4136
|
+
}), d = this.graph.getNodeIncomingEdgeIds(n.nodeId).map((g) => {
|
|
4137
4137
|
const u = this.graph.getEdge(g);
|
|
4138
4138
|
return this.graph.getPort(u.from).nodeId;
|
|
4139
4139
|
});
|
|
@@ -4148,9 +4148,9 @@ class ar {
|
|
|
4148
4148
|
nodeId: g,
|
|
4149
4149
|
children: /* @__PURE__ */ new Set()
|
|
4150
4150
|
};
|
|
4151
|
-
|
|
4151
|
+
n.children.add(u), a.push(u);
|
|
4152
4152
|
});
|
|
4153
|
-
}), s =
|
|
4153
|
+
}), s = a;
|
|
4154
4154
|
}
|
|
4155
4155
|
}
|
|
4156
4156
|
}
|
|
@@ -4160,15 +4160,15 @@ class hr {
|
|
|
4160
4160
|
}
|
|
4161
4161
|
generate(e) {
|
|
4162
4162
|
let t = 0;
|
|
4163
|
-
const o = [], s = e.length - 1,
|
|
4163
|
+
const o = [], s = e.length - 1, a = [];
|
|
4164
4164
|
e.forEach((h, d) => {
|
|
4165
4165
|
if (t += this.params.spaceAroundRadius, h.forEach((c, g) => {
|
|
4166
|
-
|
|
4166
|
+
a[g] === void 0 ? a[g] = {
|
|
4167
4167
|
start: t + c.start,
|
|
4168
4168
|
end: t + c.end
|
|
4169
|
-
} :
|
|
4169
|
+
} : a[g].end = t + c.end;
|
|
4170
4170
|
}), o.push(t), d !== s) {
|
|
4171
|
-
const c = e[d + 1], g =
|
|
4171
|
+
const c = e[d + 1], g = a.map((u) => ({
|
|
4172
4172
|
start: u.start - t,
|
|
4173
4173
|
end: u.end - t
|
|
4174
4174
|
}));
|
|
@@ -4176,21 +4176,21 @@ class hr {
|
|
|
4176
4176
|
}
|
|
4177
4177
|
t += this.params.spaceAroundRadius;
|
|
4178
4178
|
});
|
|
4179
|
-
const
|
|
4179
|
+
const n = t / 2;
|
|
4180
4180
|
return {
|
|
4181
|
-
childOffsets: o.map((h) => h -
|
|
4182
|
-
subtreeSpans:
|
|
4183
|
-
start: h.start -
|
|
4184
|
-
end: h.end -
|
|
4181
|
+
childOffsets: o.map((h) => h - n),
|
|
4182
|
+
subtreeSpans: a.map((h) => ({
|
|
4183
|
+
start: h.start - n,
|
|
4184
|
+
end: h.end - n
|
|
4185
4185
|
}))
|
|
4186
4186
|
};
|
|
4187
4187
|
}
|
|
4188
4188
|
calculateMaxDiff(e, t) {
|
|
4189
4189
|
let o = 0;
|
|
4190
4190
|
const s = Math.min(e.length, t.length);
|
|
4191
|
-
for (let
|
|
4192
|
-
const
|
|
4193
|
-
o = Math.max(o,
|
|
4191
|
+
for (let a = 0; a < s; a++) {
|
|
4192
|
+
const n = e[a].end - t[a].start;
|
|
4193
|
+
o = Math.max(o, n);
|
|
4194
4194
|
}
|
|
4195
4195
|
return o - 2 * this.params.spaceAroundRadius;
|
|
4196
4196
|
}
|
|
@@ -4203,17 +4203,17 @@ class dr {
|
|
|
4203
4203
|
const o = t.spaceAroundRadius, s = new hr({
|
|
4204
4204
|
spaceAroundRadius: o
|
|
4205
4205
|
});
|
|
4206
|
-
[...this.tree.sequence].reverse().forEach((
|
|
4207
|
-
const
|
|
4206
|
+
[...this.tree.sequence].reverse().forEach((a) => {
|
|
4207
|
+
const n = Array.from(a.children).map(
|
|
4208
4208
|
(c) => this.treeSpans.get(c.nodeId)
|
|
4209
|
-
), h = s.generate(
|
|
4209
|
+
), h = s.generate(n);
|
|
4210
4210
|
let d = 0;
|
|
4211
|
-
|
|
4211
|
+
a.children.forEach((c) => {
|
|
4212
4212
|
this.offsets.set(c.nodeId, h.childOffsets[d]), d++;
|
|
4213
|
-
}), this.treeSpans.set(
|
|
4213
|
+
}), this.treeSpans.set(a.nodeId, [
|
|
4214
4214
|
{ start: -o, end: o },
|
|
4215
4215
|
...h.subtreeSpans
|
|
4216
|
-
]),
|
|
4216
|
+
]), a.children.forEach((c) => {
|
|
4217
4217
|
this.treeSpans.delete(c.nodeId);
|
|
4218
4218
|
});
|
|
4219
4219
|
}), this.offsets.set(this.tree.root.nodeId, 0);
|
|
@@ -4228,27 +4228,27 @@ class cr {
|
|
|
4228
4228
|
}
|
|
4229
4229
|
calculateCoordinates(e) {
|
|
4230
4230
|
const t = /* @__PURE__ */ new Map(), s = new ar(e.graph).generate();
|
|
4231
|
-
let
|
|
4232
|
-
return s.forEach((
|
|
4233
|
-
t.set(
|
|
4234
|
-
const d = new dr(
|
|
4231
|
+
let a = 0;
|
|
4232
|
+
return s.forEach((n) => {
|
|
4233
|
+
t.set(n.root.nodeId, { x: a, y: 0 });
|
|
4234
|
+
const d = new dr(n, {
|
|
4235
4235
|
spaceAroundRadius: this.params.layerSpace / 2
|
|
4236
4236
|
}).generate();
|
|
4237
|
-
let c = [
|
|
4237
|
+
let c = [n.root];
|
|
4238
4238
|
for (; c.length > 0; ) {
|
|
4239
4239
|
const g = [];
|
|
4240
|
-
|
|
4240
|
+
a += this.params.layerWidth, c.forEach((u) => {
|
|
4241
4241
|
u.children.forEach((l) => {
|
|
4242
4242
|
const p = t.get(u.nodeId).y;
|
|
4243
4243
|
t.set(l.nodeId, {
|
|
4244
4244
|
y: p + d.get(l.nodeId),
|
|
4245
|
-
x:
|
|
4245
|
+
x: a
|
|
4246
4246
|
}), g.push(l);
|
|
4247
4247
|
});
|
|
4248
4248
|
}), c = g;
|
|
4249
4249
|
}
|
|
4250
|
-
}), t.forEach((
|
|
4251
|
-
t.set(h, this.params.transform(
|
|
4250
|
+
}), t.forEach((n, h) => {
|
|
4251
|
+
t.set(h, this.params.transform(n));
|
|
4252
4252
|
}), t;
|
|
4253
4253
|
}
|
|
4254
4254
|
}
|
|
@@ -4276,13 +4276,13 @@ class lr {
|
|
|
4276
4276
|
});
|
|
4277
4277
|
}
|
|
4278
4278
|
calculateNextCoordinates(e) {
|
|
4279
|
-
const { graph: t, viewport: o, dt: s } = e,
|
|
4279
|
+
const { graph: t, viewport: o, dt: s } = e, a = this.fillerLayoutAlgorithm.calculateCoordinates({
|
|
4280
4280
|
graph: t,
|
|
4281
4281
|
viewport: o
|
|
4282
4282
|
});
|
|
4283
4283
|
return new ze(
|
|
4284
4284
|
t,
|
|
4285
|
-
|
|
4285
|
+
a,
|
|
4286
4286
|
{
|
|
4287
4287
|
distanceVectorGenerator: this.distanceVectorGenerator,
|
|
4288
4288
|
nodeForcesApplicationStrategy: this.nodeForcesApplicationStrategy,
|
|
@@ -4294,13 +4294,13 @@ class lr {
|
|
|
4294
4294
|
).apply() < this.convergenceVelocity && !t.getAllNodeIds().some((c) => {
|
|
4295
4295
|
const g = t.getNode(c);
|
|
4296
4296
|
return g.x === null || g.y === null;
|
|
4297
|
-
}) ? /* @__PURE__ */ new Map() :
|
|
4297
|
+
}) ? /* @__PURE__ */ new Map() : a;
|
|
4298
4298
|
}
|
|
4299
4299
|
}
|
|
4300
4300
|
const Ge = (r) => {
|
|
4301
4301
|
let e = 1779033703, t = 3144134277, o = 1013904242, s = 2773480762;
|
|
4302
|
-
for (let
|
|
4303
|
-
|
|
4302
|
+
for (let a = 0, n; a < r.length; a++)
|
|
4303
|
+
n = r.charCodeAt(a), e = t ^ Math.imul(e ^ n, 597399067), t = o ^ Math.imul(t ^ n, 2869860233), o = s ^ Math.imul(o ^ n, 951274213), s = e ^ Math.imul(s ^ n, 2716044179);
|
|
4304
4304
|
return e = Math.imul(o ^ e >>> 18, 597399067), t = Math.imul(s ^ t >>> 22, 2869860233), o = Math.imul(e ^ o >>> 17, 951274213), s = Math.imul(t ^ s >>> 19, 2716044179), e ^= t ^ o ^ s, t ^= e, o ^= e, s ^= e, [e >>> 0, t >>> 0, o >>> 0, s >>> 0];
|
|
4305
4305
|
}, je = (r, e, t, o) => function() {
|
|
4306
4306
|
r |= 0, e |= 0, t |= 0, o |= 0;
|
|
@@ -4383,14 +4383,14 @@ const Ge = (r) => {
|
|
|
4383
4383
|
e: r.d * e.b + r.e * e.e,
|
|
4384
4384
|
f: r.d * e.c + r.e * e.f + r.f
|
|
4385
4385
|
}), yr = (r) => {
|
|
4386
|
-
const { a: e, b: t, c: o, d: s, e:
|
|
4386
|
+
const { a: e, b: t, c: o, d: s, e: a, f: n } = r, h = e * a - t * s;
|
|
4387
4387
|
return {
|
|
4388
|
-
a:
|
|
4388
|
+
a: a / h,
|
|
4389
4389
|
b: -t / h,
|
|
4390
|
-
c: (t *
|
|
4390
|
+
c: (t * n - o * a) / h,
|
|
4391
4391
|
d: -s / h,
|
|
4392
4392
|
e: e / h,
|
|
4393
|
-
f: (o * s - e *
|
|
4393
|
+
f: (o * s - e * n) / h
|
|
4394
4394
|
};
|
|
4395
4395
|
};
|
|
4396
4396
|
class wr {
|
|
@@ -4498,13 +4498,13 @@ const fr = (r) => {
|
|
|
4498
4498
|
};
|
|
4499
4499
|
const o = new wr();
|
|
4500
4500
|
return e.forEach((s) => {
|
|
4501
|
-
const
|
|
4502
|
-
t = z(t,
|
|
4501
|
+
const a = o.resolve(s);
|
|
4502
|
+
t = z(t, a);
|
|
4503
4503
|
}), (s) => {
|
|
4504
|
-
const { x:
|
|
4504
|
+
const { x: a, y: n } = s;
|
|
4505
4505
|
return {
|
|
4506
|
-
x: t.a *
|
|
4507
|
-
y: t.d *
|
|
4506
|
+
x: t.a * a + t.b * n + t.c,
|
|
4507
|
+
y: t.d * a + t.e * n + t.f
|
|
4508
4508
|
};
|
|
4509
4509
|
};
|
|
4510
4510
|
}, vr = (r) => {
|
|
@@ -4575,7 +4575,7 @@ const fr = (r) => {
|
|
|
4575
4575
|
edgesPriorityFn: o
|
|
4576
4576
|
};
|
|
4577
4577
|
}, Nr = (r) => {
|
|
4578
|
-
var t, o, s,
|
|
4578
|
+
var t, o, s, a, n;
|
|
4579
4579
|
const e = br(
|
|
4580
4580
|
(t = r.nodes) == null ? void 0 : t.priority,
|
|
4581
4581
|
(o = r.edges) == null ? void 0 : o.priority
|
|
@@ -4586,20 +4586,20 @@ const fr = (r) => {
|
|
|
4586
4586
|
priorityFn: e.nodesPriorityFn
|
|
4587
4587
|
},
|
|
4588
4588
|
ports: {
|
|
4589
|
-
direction: ((
|
|
4589
|
+
direction: ((a = r.ports) == null ? void 0 : a.direction) ?? 0
|
|
4590
4590
|
},
|
|
4591
4591
|
edges: {
|
|
4592
|
-
shapeFactory: le(((
|
|
4592
|
+
shapeFactory: le(((n = r.edges) == null ? void 0 : n.shape) ?? {}),
|
|
4593
4593
|
priorityFn: e.edgesPriorityFn
|
|
4594
4594
|
}
|
|
4595
4595
|
};
|
|
4596
4596
|
}, Pr = (r) => r.applyOn.type === "topologyChangeSchedule" ? r.applyOn.schedule : re, Cr = (r) => {
|
|
4597
|
-
var o, s, n;
|
|
4597
|
+
var o, s, a, n;
|
|
4598
4598
|
const { canvasDefaults: e } = r, t = r.hasLayout ? Pr(r.layoutParams) : re;
|
|
4599
4599
|
return {
|
|
4600
4600
|
focus: {
|
|
4601
|
-
|
|
4602
|
-
minContentScale: ((
|
|
4601
|
+
contentPadding: ((o = e.focus) == null ? void 0 : o.contentPadding) ?? ((s = e.focus) == null ? void 0 : s.contentOffset) ?? 100,
|
|
4602
|
+
minContentScale: ((a = e.focus) == null ? void 0 : a.minContentScale) ?? 0,
|
|
4603
4603
|
schedule: t,
|
|
4604
4604
|
animationDuration: ((n = e.focus) == null ? void 0 : n.animationDuration) ?? 0
|
|
4605
4605
|
}
|
|
@@ -4670,12 +4670,12 @@ class Dr {
|
|
|
4670
4670
|
o.main,
|
|
4671
4671
|
t,
|
|
4672
4672
|
e
|
|
4673
|
-
),
|
|
4673
|
+
), a = Nr(
|
|
4674
4674
|
this.canvasDefaults
|
|
4675
|
-
),
|
|
4675
|
+
), n = new Ve(
|
|
4676
4676
|
t,
|
|
4677
4677
|
s,
|
|
4678
|
-
|
|
4678
|
+
a
|
|
4679
4679
|
), h = xr(this.layoutConfig), d = Cr({
|
|
4680
4680
|
canvasDefaults: this.canvasDefaults,
|
|
4681
4681
|
hasLayout: this.hasLayout,
|
|
@@ -4688,7 +4688,7 @@ class Dr {
|
|
|
4688
4688
|
), g = new $e(e), u = new Ie(t), l = new Se(
|
|
4689
4689
|
u,
|
|
4690
4690
|
g,
|
|
4691
|
-
|
|
4691
|
+
n,
|
|
4692
4692
|
c
|
|
4693
4693
|
);
|
|
4694
4694
|
if (this.hasBackground && ie.configure(
|
|
@@ -4710,8 +4710,8 @@ class Dr {
|
|
|
4710
4710
|
if (this.hasUserConnectablePorts) {
|
|
4711
4711
|
const y = Zt(
|
|
4712
4712
|
this.connectablePortsConfig,
|
|
4713
|
-
|
|
4714
|
-
|
|
4713
|
+
a.edges.shapeFactory,
|
|
4714
|
+
a.ports.direction
|
|
4715
4715
|
);
|
|
4716
4716
|
ne.configure(
|
|
4717
4717
|
l,
|