@html-graph/html-graph 8.9.0 → 8.10.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 +7 -1
- package/dist/html-graph.js +590 -561
- 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(), n = this.viewportStore.getViewportMatrix().scale, { payload: a } = t, h = a.centerFn(o, s), d = a.x - n * h.x, c = a.y - n * h.y;
|
|
56
56
|
t.element.style.transform = `translate(${d}px, ${c}px)`;
|
|
57
57
|
}
|
|
58
58
|
updateNodePriority(e) {
|
|
@@ -66,27 +66,27 @@ 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), n = o.element.getBoundingClientRect(), a = s.element.getBoundingClientRect(), h = this.host.getBoundingClientRect(), d = this.viewportStore.getViewportMatrix().scale, c = this.createEdgeRenderPort(
|
|
70
70
|
o,
|
|
71
|
-
|
|
71
|
+
n,
|
|
72
72
|
h,
|
|
73
73
|
d
|
|
74
|
-
),
|
|
75
|
-
let
|
|
76
|
-
o.element === s.element ?
|
|
74
|
+
), g = this.createEdgeRenderPort(s, a, h, d);
|
|
75
|
+
let u = L.Line;
|
|
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
|
}
|
|
78
78
|
updateEdgePriority(e) {
|
|
79
79
|
const t = this.graphStore.getEdge(e);
|
|
80
80
|
t.payload.shape.svg.style.zIndex = `${t.payload.priority}`;
|
|
81
81
|
}
|
|
82
82
|
createEdgeRenderPort(e, t, o, s) {
|
|
83
|
-
const
|
|
83
|
+
const n = 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: n.x,
|
|
89
|
+
y: n.y,
|
|
90
90
|
width: t.width * s,
|
|
91
91
|
height: t.height * s,
|
|
92
92
|
direction: e.payload.direction
|
|
@@ -109,8 +109,8 @@ 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,
|
|
113
|
-
return h <= this.xTo && d >= this.xFrom && c <= this.yTo &&
|
|
112
|
+
const t = this.graphStore.getEdge(e), o = this.graphStore.getPort(t.from).nodeId, s = this.graphStore.getPort(t.to).nodeId, n = this.graphStore.getNode(o).payload, a = this.graphStore.getNode(s).payload, h = Math.min(n.x, a.x), d = Math.max(n.x, a.x), c = Math.min(n.y, a.y), g = Math.max(n.y, a.y);
|
|
113
|
+
return h <= this.xTo && d >= this.xFrom && c <= this.yTo && g >= this.yFrom;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
class tt {
|
|
@@ -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(
|
|
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(), n = /* @__PURE__ */ new Set();
|
|
124
|
+
this.graphStore.getAllNodeIds().forEach((a) => {
|
|
125
|
+
const h = this.renderingBox.hasNode(a), d = this.attachedNodes.has(a);
|
|
126
|
+
h && !d ? t.add(a) : !h && d && o.add(a);
|
|
127
|
+
}), this.graphStore.getAllEdgeIds().forEach((a) => {
|
|
128
|
+
const h = this.renderingBox.hasEdge(a), d = this.attachedEdges.has(a), c = this.graphStore.getEdge(a), 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(a) : !h && d && n.add(a);
|
|
130
|
+
}), n.forEach((a) => {
|
|
131
|
+
this.handleDetachEdge(a);
|
|
132
|
+
}), o.forEach((a) => {
|
|
133
|
+
this.handleDetachNode(a);
|
|
134
|
+
}), t.forEach((a) => {
|
|
135
|
+
this.attachedNodes.has(a) || this.handleAttachNode(a);
|
|
136
|
+
}), s.forEach((a) => {
|
|
137
|
+
this.handleAttachEdge(a);
|
|
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), n = 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: n.shape,
|
|
565
|
+
priority: n.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((n) => {
|
|
617
|
+
const a = this.getEdge(n);
|
|
618
|
+
return this.getPort(a.from).nodeId !== e;
|
|
619
|
+
}).forEach((n) => {
|
|
620
|
+
o.push(n);
|
|
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((n) => {
|
|
628
|
+
const a = this.getEdge(n);
|
|
629
|
+
return this.getPort(a.to).nodeId !== e;
|
|
630
|
+
}).forEach((n) => {
|
|
631
|
+
o.push(n);
|
|
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((n) => {
|
|
639
|
+
o.push(n);
|
|
640
|
+
}), this.getPortIncomingEdgeIds(s).filter((n) => {
|
|
641
|
+
const a = this.getEdge(n);
|
|
642
|
+
return this.getPort(a.to).nodeId === e;
|
|
643
|
+
}).forEach((n) => {
|
|
644
|
+
o.push(n);
|
|
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((n) => {
|
|
652
|
+
o.push(n);
|
|
653
|
+
}), this.getPortOutgoingEdgeIds(s).forEach((n) => {
|
|
654
|
+
o.push(n);
|
|
655
|
+
}), this.getPortCycleEdgeIds(s).forEach((n) => {
|
|
656
|
+
o.push(n);
|
|
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: n, height: a } = r.getBoundingClientRect();
|
|
771
|
+
return e >= o && e <= o + n && t >= s && t <= s + a;
|
|
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 n of s)
|
|
814
|
+
yield n;
|
|
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
|
+
}, n = Math.min(o.x, s.x) - t, a = 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: n,
|
|
847
|
+
y: a,
|
|
848
848
|
width: d,
|
|
849
849
|
height: c,
|
|
850
|
-
from: { x: o.x -
|
|
851
|
-
to: { x: s.x -
|
|
850
|
+
from: { x: o.x - n, y: o.y - a },
|
|
851
|
+
to: { x: s.x - n, y: s.y - a }
|
|
852
852
|
};
|
|
853
853
|
};
|
|
854
854
|
class ht {
|
|
@@ -859,27 +859,27 @@ class ht {
|
|
|
859
859
|
from: t,
|
|
860
860
|
to: o,
|
|
861
861
|
arrowLength: s,
|
|
862
|
-
fromDir:
|
|
863
|
-
toDir:
|
|
862
|
+
fromDir: n,
|
|
863
|
+
toDir: a,
|
|
864
864
|
curvature: h,
|
|
865
865
|
hasSourceArrow: d,
|
|
866
866
|
hasTargetArrow: c
|
|
867
|
-
} = e,
|
|
868
|
-
this.midpoint = { x:
|
|
867
|
+
} = e, g = (t.x + o.x) / 2, u = (t.y + o.y) / 2;
|
|
868
|
+
this.midpoint = { x: g, y: u };
|
|
869
869
|
const l = x(
|
|
870
870
|
{ x: t.x + s, y: t.y },
|
|
871
|
-
|
|
871
|
+
n,
|
|
872
872
|
t
|
|
873
873
|
), p = x(
|
|
874
874
|
{ x: o.x - s, y: o.y },
|
|
875
|
-
|
|
875
|
+
a,
|
|
876
876
|
o
|
|
877
877
|
), y = {
|
|
878
|
-
x: l.x +
|
|
879
|
-
y: l.y +
|
|
878
|
+
x: l.x + n.x * h,
|
|
879
|
+
y: l.y + n.y * h
|
|
880
880
|
}, w = {
|
|
881
|
-
x: p.x -
|
|
882
|
-
y: p.y -
|
|
881
|
+
x: p.x - a.x * h,
|
|
882
|
+
y: p.y - a.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,34 +892,34 @@ class dt {
|
|
|
892
892
|
hasSourceArrow: t,
|
|
893
893
|
hasTargetArrow: o,
|
|
894
894
|
curvature: s,
|
|
895
|
-
fromDir:
|
|
896
|
-
toDir:
|
|
895
|
+
fromDir: n,
|
|
896
|
+
toDir: a,
|
|
897
897
|
detourDir: h,
|
|
898
898
|
from: d,
|
|
899
899
|
to: c,
|
|
900
|
-
arrowLength:
|
|
901
|
-
detourDistance:
|
|
900
|
+
arrowLength: g,
|
|
901
|
+
detourDistance: u
|
|
902
902
|
} = e, l = t ? x(
|
|
903
|
-
{ x: d.x +
|
|
904
|
-
|
|
903
|
+
{ x: d.x + g, y: d.y },
|
|
904
|
+
n,
|
|
905
905
|
d
|
|
906
906
|
) : d, p = o ? x(
|
|
907
907
|
{
|
|
908
|
-
x: c.x -
|
|
908
|
+
x: c.x - g,
|
|
909
909
|
y: c.y
|
|
910
910
|
},
|
|
911
|
-
n,
|
|
912
|
-
c
|
|
913
|
-
) : c, y = Math.cos(h) * g, w = Math.sin(h) * g, f = x(
|
|
914
|
-
{ x: d.x + u, y: d.y },
|
|
915
911
|
a,
|
|
912
|
+
c
|
|
913
|
+
) : c, y = Math.cos(h) * u, w = Math.sin(h) * u, f = x(
|
|
914
|
+
{ x: d.x + g, y: d.y },
|
|
915
|
+
n,
|
|
916
916
|
d
|
|
917
917
|
), m = {
|
|
918
918
|
x: f.x + y,
|
|
919
919
|
y: f.y + w
|
|
920
920
|
}, A = x(
|
|
921
|
-
{ x: c.x -
|
|
922
|
-
|
|
921
|
+
{ x: c.x - g, y: c.y },
|
|
922
|
+
a,
|
|
923
923
|
c
|
|
924
924
|
), N = {
|
|
925
925
|
x: A.x + y,
|
|
@@ -928,12 +928,12 @@ 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 *
|
|
933
|
-
}, V = {
|
|
934
|
-
x: A.x - s * n.x,
|
|
935
|
-
y: A.y - s * n.y
|
|
931
|
+
x: f.x + s * n.x,
|
|
932
|
+
y: f.y + s * n.y
|
|
936
933
|
}, I = {
|
|
934
|
+
x: A.x - s * a.x,
|
|
935
|
+
y: A.y - s * a.y
|
|
936
|
+
}, V = {
|
|
937
937
|
x: f.x + y,
|
|
938
938
|
y: f.y + w
|
|
939
939
|
}, $ = {
|
|
@@ -943,8 +943,8 @@ class dt {
|
|
|
943
943
|
this.path = [
|
|
944
944
|
`M ${l.x} ${l.y}`,
|
|
945
945
|
`L ${f.x} ${f.y}`,
|
|
946
|
-
`C ${T.x} ${T.y} ${
|
|
947
|
-
`C ${$.x} ${$.y} ${
|
|
946
|
+
`C ${T.x} ${T.y} ${V.x} ${V.y} ${C.x} ${C.y}`,
|
|
947
|
+
`C ${$.x} ${$.y} ${I.x} ${I.y} ${A.x} ${A.y}`,
|
|
948
948
|
`L ${p.x} ${p.y}`
|
|
949
949
|
].join(" "), this.midpoint = C;
|
|
950
950
|
}
|
|
@@ -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, n = 0, a = 0;
|
|
970
970
|
r.forEach((h, d) => {
|
|
971
|
-
let c = 0,
|
|
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,
|
|
973
|
+
if (l && (c = -s, g = -n, u = a), p) {
|
|
974
974
|
const T = r[d + 1];
|
|
975
|
-
s = T.x - h.x,
|
|
975
|
+
s = T.x - h.x, n = T.y - h.y, a = Math.sqrt(s * s + n * n);
|
|
976
976
|
}
|
|
977
|
-
const f =
|
|
977
|
+
const f = a !== 0 ? Math.min((y ? e : 0) / a, d < o - 1 ? 0.5 : 1) : 0, m = y ? { x: h.x + s * f, y: h.y + n * 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
|
);
|
|
@@ -984,7 +984,7 @@ const ee = Object.freeze({
|
|
|
984
984
|
}, ct = (r, e) => {
|
|
985
985
|
const t = e.x - r.x >= 0, o = r.dirX >= 0, s = e.dirX >= 0;
|
|
986
986
|
if (o === s) {
|
|
987
|
-
const c = o === t,
|
|
987
|
+
const c = o === t, g = (r.x + e.x) / 2, u = (r.y + e.y) / 2, l = { x: g, y: u };
|
|
988
988
|
return c ? {
|
|
989
989
|
points: [
|
|
990
990
|
{ x: r.x, y: r.y },
|
|
@@ -1003,8 +1003,8 @@ const ee = Object.freeze({
|
|
|
1003
1003
|
midpoint: l
|
|
1004
1004
|
};
|
|
1005
1005
|
}
|
|
1006
|
-
const
|
|
1007
|
-
if (
|
|
1006
|
+
const a = o === t, h = (r.y + e.y) / 2;
|
|
1007
|
+
if (a) {
|
|
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: n,
|
|
1029
|
+
arrowLength: a,
|
|
1030
1030
|
arrowOffset: h,
|
|
1031
1031
|
roundness: d,
|
|
1032
1032
|
hasSourceArrow: c,
|
|
1033
|
-
hasTargetArrow:
|
|
1034
|
-
} = e,
|
|
1035
|
-
{ x: t.x +
|
|
1033
|
+
hasTargetArrow: g
|
|
1034
|
+
} = e, u = c ? x(
|
|
1035
|
+
{ x: t.x + a, y: t.y },
|
|
1036
1036
|
s,
|
|
1037
1037
|
t
|
|
1038
|
-
) : t, l =
|
|
1038
|
+
) : t, l = g ? x(
|
|
1039
1039
|
{
|
|
1040
|
-
x: o.x -
|
|
1040
|
+
x: o.x - a,
|
|
1041
1041
|
y: o.y
|
|
1042
1042
|
},
|
|
1043
|
-
|
|
1043
|
+
n,
|
|
1044
1044
|
o
|
|
1045
|
-
) : o, p =
|
|
1045
|
+
) : o, p = a + 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 }, n, o), f = ct(
|
|
1050
1050
|
{
|
|
1051
1051
|
x: y.x,
|
|
1052
1052
|
y: y.y,
|
|
@@ -1055,11 +1055,11 @@ class lt {
|
|
|
1055
1055
|
{
|
|
1056
1056
|
x: w.x,
|
|
1057
1057
|
y: w.y,
|
|
1058
|
-
dirX:
|
|
1058
|
+
dirX: n.x
|
|
1059
1059
|
}
|
|
1060
1060
|
);
|
|
1061
1061
|
this.path = R(
|
|
1062
|
-
[
|
|
1062
|
+
[u, ...f.points, l],
|
|
1063
1063
|
d
|
|
1064
1064
|
), this.midpoint = f.midpoint;
|
|
1065
1065
|
}
|
|
@@ -1072,26 +1072,26 @@ class gt {
|
|
|
1072
1072
|
hasSourceArrow: t,
|
|
1073
1073
|
hasTargetArrow: o,
|
|
1074
1074
|
from: s,
|
|
1075
|
-
to:
|
|
1076
|
-
arrowLength:
|
|
1075
|
+
to: n,
|
|
1076
|
+
arrowLength: a,
|
|
1077
1077
|
fromDir: h,
|
|
1078
1078
|
toDir: d,
|
|
1079
1079
|
arrowOffset: c,
|
|
1080
|
-
detourDir:
|
|
1081
|
-
detourDistance:
|
|
1080
|
+
detourDir: g,
|
|
1081
|
+
detourDistance: u,
|
|
1082
1082
|
roundness: l
|
|
1083
1083
|
} = e, p = t ? x(
|
|
1084
|
-
{ x: s.x +
|
|
1084
|
+
{ x: s.x + a, y: s.y },
|
|
1085
1085
|
h,
|
|
1086
1086
|
s
|
|
1087
1087
|
) : s, y = o ? x(
|
|
1088
1088
|
{
|
|
1089
|
-
x:
|
|
1090
|
-
y:
|
|
1089
|
+
x: n.x - a,
|
|
1090
|
+
y: n.y
|
|
1091
1091
|
},
|
|
1092
1092
|
d,
|
|
1093
|
-
|
|
1094
|
-
) :
|
|
1093
|
+
n
|
|
1094
|
+
) : n, w = a + 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: n.x - w, y: n.y },
|
|
1103
1103
|
d,
|
|
1104
|
-
|
|
1104
|
+
n
|
|
1105
1105
|
), T = {
|
|
1106
1106
|
x: C.x + f,
|
|
1107
1107
|
y: C.y + m
|
|
@@ -1123,26 +1123,26 @@ class ut {
|
|
|
1123
1123
|
from: t,
|
|
1124
1124
|
to: o,
|
|
1125
1125
|
hasSourceArrow: s,
|
|
1126
|
-
hasTargetArrow:
|
|
1127
|
-
arrowLength:
|
|
1126
|
+
hasTargetArrow: n,
|
|
1127
|
+
arrowLength: a,
|
|
1128
1128
|
fromDir: h,
|
|
1129
1129
|
toDir: d,
|
|
1130
1130
|
arrowOffset: c,
|
|
1131
|
-
roundness:
|
|
1132
|
-
} = e,
|
|
1131
|
+
roundness: g
|
|
1132
|
+
} = e, u = this.createArrowPoint(
|
|
1133
1133
|
s,
|
|
1134
1134
|
h,
|
|
1135
1135
|
t,
|
|
1136
|
-
|
|
1136
|
+
a
|
|
1137
1137
|
), l = this.createArrowPoint(
|
|
1138
|
-
|
|
1138
|
+
n,
|
|
1139
1139
|
d,
|
|
1140
1140
|
o,
|
|
1141
|
-
-
|
|
1142
|
-
), p =
|
|
1141
|
+
-a
|
|
1142
|
+
), p = a + 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
|
-
[
|
|
1145
|
-
|
|
1144
|
+
[u, w, m, l],
|
|
1145
|
+
g
|
|
1146
1146
|
);
|
|
1147
1147
|
const A = (w.x + m.x) / 2, N = (w.y + m.y) / 2;
|
|
1148
1148
|
this.midpoint = { x: A, y: N };
|
|
@@ -1150,17 +1150,17 @@ class ut {
|
|
|
1150
1150
|
createArrowPoint(e, t, o, s) {
|
|
1151
1151
|
if (!e)
|
|
1152
1152
|
return o;
|
|
1153
|
-
const
|
|
1153
|
+
const n = {
|
|
1154
1154
|
x: o.x + s,
|
|
1155
1155
|
y: o.y
|
|
1156
1156
|
};
|
|
1157
|
-
return x(
|
|
1157
|
+
return x(n, t, o);
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
1160
1160
|
const pt = (r, e) => {
|
|
1161
1161
|
const t = e.y - r.y >= 0, o = r.dirY >= 0, s = e.dirY >= 0;
|
|
1162
1162
|
if (o === s) {
|
|
1163
|
-
const c = o === t,
|
|
1163
|
+
const c = o === t, g = (r.x + e.x) / 2, u = (r.y + e.y) / 2, l = { x: g, y: u };
|
|
1164
1164
|
return c ? {
|
|
1165
1165
|
points: [
|
|
1166
1166
|
{ x: r.x, y: r.y },
|
|
@@ -1179,8 +1179,8 @@ const pt = (r, e) => {
|
|
|
1179
1179
|
midpoint: l
|
|
1180
1180
|
};
|
|
1181
1181
|
}
|
|
1182
|
-
const
|
|
1183
|
-
if (
|
|
1182
|
+
const a = o === t, h = (r.x + e.x) / 2;
|
|
1183
|
+
if (a) {
|
|
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: n,
|
|
1205
|
+
arrowLength: a,
|
|
1206
1206
|
arrowOffset: h,
|
|
1207
1207
|
fromDir: d,
|
|
1208
1208
|
toDir: c,
|
|
1209
|
-
roundness:
|
|
1210
|
-
} = e,
|
|
1211
|
-
{ x: t.x +
|
|
1209
|
+
roundness: g
|
|
1210
|
+
} = e, u = s ? x(
|
|
1211
|
+
{ x: t.x + a, y: t.y },
|
|
1212
1212
|
d,
|
|
1213
1213
|
t
|
|
1214
|
-
) : t, l =
|
|
1214
|
+
) : t, l = n ? x(
|
|
1215
1215
|
{
|
|
1216
|
-
x: o.x -
|
|
1216
|
+
x: o.x - a,
|
|
1217
1217
|
y: o.y
|
|
1218
1218
|
},
|
|
1219
1219
|
c,
|
|
1220
1220
|
o
|
|
1221
|
-
) : o, p =
|
|
1221
|
+
) : o, p = a + h, y = x(
|
|
1222
1222
|
{ x: t.x + p, y: t.y },
|
|
1223
1223
|
d,
|
|
1224
1224
|
t
|
|
@@ -1235,8 +1235,8 @@ class yt {
|
|
|
1235
1235
|
}
|
|
1236
1236
|
);
|
|
1237
1237
|
this.path = R(
|
|
1238
|
-
[
|
|
1239
|
-
|
|
1238
|
+
[u, ...f.points, l],
|
|
1239
|
+
g
|
|
1240
1240
|
), this.midpoint = f.midpoint;
|
|
1241
1241
|
}
|
|
1242
1242
|
}
|
|
@@ -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: n, origin: a, 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,25 +1253,25 @@ 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,
|
|
1257
|
-
this.path = `${h ? "" : l}${R(
|
|
1256
|
+
].map((p) => x(p, n, { x: 0, y: 0 })).map((p) => ({ x: p.x + a.x, y: p.y + a.y })), l = `M ${a.x} ${a.y} L ${u[0].x} ${u[0].y} `;
|
|
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
|
}
|
|
1260
1260
|
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: n, origin: a, 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, n, { x: 0, y: 0 })).map((A) => ({ x: A.x + a.x, y: A.y + a.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 ${a.x} ${a.y} L ${w[0].x} ${w[0].y} `;
|
|
1275
1275
|
this.path = `${h ? "" : m}${f}`, this.midpoint = w[3];
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
@@ -1284,39 +1284,39 @@ class ft {
|
|
|
1284
1284
|
from: t,
|
|
1285
1285
|
to: o,
|
|
1286
1286
|
sourceOffset: s,
|
|
1287
|
-
targetOffset:
|
|
1288
|
-
hasSourceArrow:
|
|
1287
|
+
targetOffset: n,
|
|
1288
|
+
hasSourceArrow: a,
|
|
1289
1289
|
hasTargetArrow: h,
|
|
1290
1290
|
arrowLength: d
|
|
1291
1291
|
} = e;
|
|
1292
1292
|
this.midpoint = { x: (t.x + o.x) / 2, y: (t.y + o.y) / 2 };
|
|
1293
|
-
const c = o.x - t.x,
|
|
1294
|
-
if (this.diagonalDistance = Math.sqrt(c * c +
|
|
1293
|
+
const c = o.x - t.x, g = o.y - t.y;
|
|
1294
|
+
if (this.diagonalDistance = Math.sqrt(c * c + g * g), this.diagonalDistance === 0) {
|
|
1295
1295
|
this.path = "";
|
|
1296
1296
|
return;
|
|
1297
1297
|
}
|
|
1298
|
-
const
|
|
1298
|
+
const u = { x: c, y: g }, l = this.createDirectLinePoint({
|
|
1299
1299
|
offset: s,
|
|
1300
|
-
hasArrow:
|
|
1300
|
+
hasArrow: a,
|
|
1301
1301
|
flip: 1,
|
|
1302
1302
|
shift: t,
|
|
1303
1303
|
arrowLength: d,
|
|
1304
|
-
dir:
|
|
1304
|
+
dir: u
|
|
1305
1305
|
}), p = this.createDirectLinePoint({
|
|
1306
|
-
offset:
|
|
1306
|
+
offset: n,
|
|
1307
1307
|
hasArrow: h,
|
|
1308
1308
|
flip: -1,
|
|
1309
1309
|
shift: o,
|
|
1310
1310
|
arrowLength: d,
|
|
1311
|
-
dir:
|
|
1311
|
+
dir: u
|
|
1312
1312
|
});
|
|
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: n, shift: a } = e;
|
|
1317
1317
|
return {
|
|
1318
|
-
x:
|
|
1319
|
-
y:
|
|
1318
|
+
x: n.x * s + a.x,
|
|
1319
|
+
y: n.y * s + a.y
|
|
1320
1320
|
};
|
|
1321
1321
|
}
|
|
1322
1322
|
}
|
|
@@ -1332,33 +1332,33 @@ class xt {
|
|
|
1332
1332
|
hasSourceArrow: t,
|
|
1333
1333
|
hasTargetArrow: o,
|
|
1334
1334
|
arrowLength: s,
|
|
1335
|
-
from:
|
|
1336
|
-
to:
|
|
1335
|
+
from: n,
|
|
1336
|
+
to: a,
|
|
1337
1337
|
fromDir: h,
|
|
1338
1338
|
toDir: d,
|
|
1339
1339
|
arrowOffset: c,
|
|
1340
|
-
roundness:
|
|
1341
|
-
detourDistance:
|
|
1340
|
+
roundness: g,
|
|
1341
|
+
detourDistance: u
|
|
1342
1342
|
} = e, l = t ? x(
|
|
1343
|
-
{ x:
|
|
1343
|
+
{ x: n.x + s, y: n.y },
|
|
1344
1344
|
h,
|
|
1345
|
-
|
|
1346
|
-
) :
|
|
1345
|
+
n
|
|
1346
|
+
) : n, p = o ? x(
|
|
1347
1347
|
{
|
|
1348
|
-
x:
|
|
1349
|
-
y:
|
|
1348
|
+
x: a.x - s,
|
|
1349
|
+
y: a.y
|
|
1350
1350
|
},
|
|
1351
1351
|
d,
|
|
1352
|
-
n
|
|
1353
|
-
) : n, y = s + c, w = x(
|
|
1354
|
-
{ x: a.x + y, y: a.y },
|
|
1355
|
-
h,
|
|
1356
1352
|
a
|
|
1353
|
+
) : a, y = s + c, w = x(
|
|
1354
|
+
{ x: n.x + y, y: n.y },
|
|
1355
|
+
h,
|
|
1356
|
+
n
|
|
1357
1357
|
), f = x(
|
|
1358
|
-
{ x:
|
|
1358
|
+
{ x: a.x - y, y: a.y },
|
|
1359
1359
|
d,
|
|
1360
|
-
|
|
1361
|
-
), m = vt(w, f,
|
|
1360
|
+
a
|
|
1361
|
+
), m = vt(w, f, u);
|
|
1362
1362
|
this.midpoint = {
|
|
1363
1363
|
x: (w.x + f.x) / 2,
|
|
1364
1364
|
y: m
|
|
@@ -1371,7 +1371,7 @@ class xt {
|
|
|
1371
1371
|
f,
|
|
1372
1372
|
p
|
|
1373
1373
|
],
|
|
1374
|
-
|
|
1374
|
+
g
|
|
1375
1375
|
);
|
|
1376
1376
|
}
|
|
1377
1377
|
}
|
|
@@ -1387,33 +1387,33 @@ class At {
|
|
|
1387
1387
|
hasSourceArrow: t,
|
|
1388
1388
|
hasTargetArrow: o,
|
|
1389
1389
|
arrowLength: s,
|
|
1390
|
-
fromDir:
|
|
1391
|
-
toDir:
|
|
1390
|
+
fromDir: n,
|
|
1391
|
+
toDir: a,
|
|
1392
1392
|
from: h,
|
|
1393
1393
|
to: d,
|
|
1394
1394
|
arrowOffset: c,
|
|
1395
|
-
detourDistance:
|
|
1396
|
-
roundness:
|
|
1395
|
+
detourDistance: g,
|
|
1396
|
+
roundness: u
|
|
1397
1397
|
} = e, l = t ? x(
|
|
1398
1398
|
{ x: h.x + s, y: h.y },
|
|
1399
|
-
|
|
1399
|
+
n,
|
|
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
|
+
a,
|
|
1407
1407
|
d
|
|
1408
1408
|
) : d, y = s + c, w = x(
|
|
1409
1409
|
{ x: h.x + y, y: h.y },
|
|
1410
|
-
|
|
1410
|
+
n,
|
|
1411
1411
|
h
|
|
1412
1412
|
), f = x(
|
|
1413
1413
|
{ x: d.x - y, y: d.y },
|
|
1414
|
-
|
|
1414
|
+
a,
|
|
1415
1415
|
d
|
|
1416
|
-
), m = mt(w, f,
|
|
1416
|
+
), m = mt(w, f, g);
|
|
1417
1417
|
this.midpoint = {
|
|
1418
1418
|
x: m,
|
|
1419
1419
|
y: (w.y + f.y) / 2
|
|
@@ -1426,7 +1426,7 @@ class At {
|
|
|
1426
1426
|
f,
|
|
1427
1427
|
p
|
|
1428
1428
|
],
|
|
1429
|
-
|
|
1429
|
+
u
|
|
1430
1430
|
);
|
|
1431
1431
|
}
|
|
1432
1432
|
}
|
|
@@ -1469,26 +1469,26 @@ 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: n, from: a, 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: n });
|
|
1478
1478
|
const d = we(e.from.direction), c = we(e.to.direction);
|
|
1479
|
-
let
|
|
1480
|
-
e.category === L.PortCycle ? (
|
|
1481
|
-
const l =
|
|
1479
|
+
let g = { x: -c.x, y: -c.y }, u;
|
|
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(a, 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: a,
|
|
1487
1487
|
arrowLength: this.params.arrowLength
|
|
1488
1488
|
}), this.sourceArrow.setAttribute("d", p));
|
|
1489
1489
|
let y = null;
|
|
1490
1490
|
this.targetArrow && (y = this.arrowRenderer({
|
|
1491
|
-
direction:
|
|
1491
|
+
direction: g,
|
|
1492
1492
|
shift: h,
|
|
1493
1493
|
arrowLength: this.params.arrowLength
|
|
1494
1494
|
}), this.targetArrow.setAttribute("d", y)), this.afterRenderEmitter.emit({
|
|
@@ -1508,20 +1508,20 @@ 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}`, n = `L ${o[1].x} ${o[1].y}`, a = `L ${o[2].x} ${o[2].y}`;
|
|
1512
|
+
return `${s} ${n} ${a} 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), n = s + t, a = o + t - t * (o + t) / n, h = t * s / n, c = [
|
|
1515
1515
|
{ x: 0, y: 0 },
|
|
1516
|
-
{ x:
|
|
1517
|
-
{ x:
|
|
1516
|
+
{ x: a, y: -h },
|
|
1517
|
+
{ x: a, y: h }
|
|
1518
1518
|
].map(
|
|
1519
1519
|
(y) => x(y, e.direction, { x: 0, y: 0 })
|
|
1520
1520
|
).map((y) => ({
|
|
1521
1521
|
x: y.x + e.shift.x,
|
|
1522
1522
|
y: y.y + e.shift.y
|
|
1523
|
-
})),
|
|
1524
|
-
return `${
|
|
1523
|
+
})), g = `M ${c[0].x} ${c[0].y}`, u = `A ${s} ${s} 0 0 0 ${c[1].x} ${c[1].y}`, l = `A ${t} ${t} 0 0 0 ${c[2].x} ${c[2].y}`, p = `A ${s} ${s} 0 0 0 ${c[0].x} ${c[0].y}`;
|
|
1524
|
+
return `${g} ${u} ${l} ${p}`;
|
|
1525
1525
|
}, bt = (r) => (e) => {
|
|
1526
1526
|
const t = r.smallRadius, o = r.radius, s = x(
|
|
1527
1527
|
{
|
|
@@ -1536,13 +1536,13 @@ const Et = (r) => (e) => {
|
|
|
1536
1536
|
x: e.arrowLength + r.smallRadius,
|
|
1537
1537
|
y: 0
|
|
1538
1538
|
}
|
|
1539
|
-
),
|
|
1540
|
-
(
|
|
1541
|
-
).map((
|
|
1542
|
-
x:
|
|
1543
|
-
y:
|
|
1544
|
-
})), h = `M ${
|
|
1545
|
-
return `${h} ${d} ${c} ${
|
|
1539
|
+
), a = [{ x: 0, y: 0 }, { x: s.x, y: -s.y }, s].map(
|
|
1540
|
+
(u) => x(u, e.direction, { x: 0, y: 0 })
|
|
1541
|
+
).map((u) => ({
|
|
1542
|
+
x: u.x + e.shift.x,
|
|
1543
|
+
y: u.y + e.shift.y
|
|
1544
|
+
})), h = `M ${a[0].x} ${a[0].y}`, d = `A ${o} ${o} 0 0 1 ${a[1].x} ${a[1].y}`, c = `A ${t} ${t} 0 0 1 ${a[2].x} ${a[2].y}`, g = `A ${o} ${o} 0 0 1 ${a[0].x} ${a[0].y}`;
|
|
1545
|
+
return `${h} ${d} ${c} ${g}`;
|
|
1546
1546
|
}, U = (r) => {
|
|
1547
1547
|
if (typeof r == "function")
|
|
1548
1548
|
return r;
|
|
@@ -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: n, from: a, 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: n });
|
|
1872
1872
|
const d = new ft({
|
|
1873
|
-
from:
|
|
1873
|
+
from: a,
|
|
1874
1874
|
to: h,
|
|
1875
1875
|
sourceOffset: this.sourceOffset,
|
|
1876
1876
|
targetOffset: this.targetOffset,
|
|
@@ -1879,14 +1879,14 @@ class Le {
|
|
|
1879
1879
|
arrowLength: this.arrowLength
|
|
1880
1880
|
});
|
|
1881
1881
|
this.line.setAttribute("d", d.path);
|
|
1882
|
-
let c = null,
|
|
1883
|
-
const
|
|
1884
|
-
if (
|
|
1885
|
-
this.sourceArrow !== null && (c = "", this.sourceArrow.setAttribute("d", c)), this.targetArrow !== null && (
|
|
1882
|
+
let c = null, g = null;
|
|
1883
|
+
const u = d.diagonalDistance;
|
|
1884
|
+
if (u === 0)
|
|
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 - a.x) / u,
|
|
1889
|
+
y: (h.y - a.y) / u
|
|
1890
1890
|
};
|
|
1891
1891
|
if (this.sourceArrow) {
|
|
1892
1892
|
const p = {
|
|
@@ -1904,20 +1904,20 @@ class Le {
|
|
|
1904
1904
|
x: l.x * this.targetOffset,
|
|
1905
1905
|
y: l.y * this.targetOffset
|
|
1906
1906
|
};
|
|
1907
|
-
|
|
1907
|
+
g = this.arrowRenderer({
|
|
1908
1908
|
direction: { x: -l.x, y: -l.y },
|
|
1909
1909
|
shift: {
|
|
1910
1910
|
x: h.x - p.x,
|
|
1911
1911
|
y: h.y - p.y
|
|
1912
1912
|
},
|
|
1913
1913
|
arrowLength: this.arrowLength
|
|
1914
|
-
}), this.targetArrow.setAttribute("d",
|
|
1914
|
+
}), this.targetArrow.setAttribute("d", g);
|
|
1915
1915
|
}
|
|
1916
1916
|
}
|
|
1917
1917
|
this.afterRenderEmitter.emit({
|
|
1918
1918
|
edgePath: d,
|
|
1919
1919
|
sourceArrowPath: c,
|
|
1920
|
-
targetArrowPath:
|
|
1920
|
+
targetArrowPath: g
|
|
1921
1921
|
});
|
|
1922
1922
|
}
|
|
1923
1923
|
}
|
|
@@ -1971,15 +1971,15 @@ 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, n = `translate(${s.x}px, ${s.y}px)`;
|
|
1975
|
+
this.midpointElement.style.setProperty("transform", n);
|
|
1976
1976
|
});
|
|
1977
1977
|
}
|
|
1978
1978
|
render(e) {
|
|
1979
1979
|
this.baseShape.render(e);
|
|
1980
1980
|
}
|
|
1981
1981
|
}
|
|
1982
|
-
class
|
|
1982
|
+
class Ie {
|
|
1983
1983
|
constructor(e) {
|
|
1984
1984
|
i(this, "onAfterNodeAdded");
|
|
1985
1985
|
i(this, "onAfterNodeUpdated");
|
|
@@ -2091,7 +2091,7 @@ class J {
|
|
|
2091
2091
|
this.counter = 0;
|
|
2092
2092
|
}
|
|
2093
2093
|
}
|
|
2094
|
-
class
|
|
2094
|
+
class Ve {
|
|
2095
2095
|
constructor(e, t, o) {
|
|
2096
2096
|
i(this, "nodeIdGenerator", new J(
|
|
2097
2097
|
(e) => this.graphStore.hasNode(e)
|
|
@@ -2256,14 +2256,16 @@ class $e {
|
|
|
2256
2256
|
return this.viewportStore.createViewportCoords(e);
|
|
2257
2257
|
}
|
|
2258
2258
|
}
|
|
2259
|
-
const
|
|
2259
|
+
const It = (r, e) => Symbol.iterator in r ? {
|
|
2260
2260
|
minContentScale: e.focus.minContentScale,
|
|
2261
2261
|
nodes: r,
|
|
2262
|
-
contentOffset: e.focus.contentOffset
|
|
2262
|
+
contentOffset: e.focus.contentOffset,
|
|
2263
|
+
animationDuration: e.focus.animationDuration
|
|
2263
2264
|
} : {
|
|
2264
2265
|
minContentScale: r.minContentScale ?? e.focus.minContentScale,
|
|
2265
2266
|
nodes: r.nodes ?? [],
|
|
2266
|
-
contentOffset: r.contentOffset ?? e.focus.contentOffset
|
|
2267
|
+
contentOffset: r.contentOffset ?? e.focus.contentOffset,
|
|
2268
|
+
animationDuration: r.animationDuration ?? e.focus.animationDuration
|
|
2267
2269
|
}, Be = (r, e, t) => ({
|
|
2268
2270
|
scale: r.scale,
|
|
2269
2271
|
x: r.x + r.scale * e,
|
|
@@ -2274,8 +2276,8 @@ const Vt = (r, e) => Symbol.iterator in r ? {
|
|
|
2274
2276
|
y: r.scale * (1 - e) * o + r.y
|
|
2275
2277
|
});
|
|
2276
2278
|
class Oe {
|
|
2277
|
-
constructor(e, t, o) {
|
|
2278
|
-
this.graphStore = e, this.viewportStore = t, this.params = o;
|
|
2279
|
+
constructor(e, t, o, s) {
|
|
2280
|
+
this.graphStore = e, this.viewportStore = t, this.params = o, this.win = s;
|
|
2279
2281
|
}
|
|
2280
2282
|
patchViewportMatrix(e) {
|
|
2281
2283
|
this.viewportStore.patchViewportMatrix(e);
|
|
@@ -2284,22 +2286,23 @@ class Oe {
|
|
|
2284
2286
|
this.viewportStore.patchContentMatrix(e);
|
|
2285
2287
|
}
|
|
2286
2288
|
center(e, t) {
|
|
2287
|
-
const { width: o, height: s } = this.viewportStore.getDimensions(),
|
|
2288
|
-
let
|
|
2289
|
-
const
|
|
2290
|
-
if (
|
|
2291
|
-
const
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2289
|
+
const { width: o, height: s } = this.viewportStore.getDimensions(), n = { x: o / 2, y: s / 2 }, a = this.viewportStore.getViewportMatrix(), h = this.viewportStore.createViewportCoords(e), d = h.x - n.x, c = h.y - n.y;
|
|
2290
|
+
let g = Be(a, d, c);
|
|
2291
|
+
const u = t == null ? void 0 : t.contentScale;
|
|
2292
|
+
if (u !== void 0) {
|
|
2293
|
+
const p = 1 / u;
|
|
2294
|
+
g = Ue(
|
|
2295
|
+
g,
|
|
2296
|
+
p / a.scale,
|
|
2297
|
+
n.x,
|
|
2298
|
+
n.y
|
|
2297
2299
|
);
|
|
2298
2300
|
}
|
|
2299
|
-
|
|
2301
|
+
const l = (t == null ? void 0 : t.animationDuration) ?? 0;
|
|
2302
|
+
l > 0 ? this.animateNavigation(a, g, l) : this.viewportStore.patchViewportMatrix(g);
|
|
2300
2303
|
}
|
|
2301
2304
|
focus(e) {
|
|
2302
|
-
const t =
|
|
2305
|
+
const t = It(e ?? {}, this.params);
|
|
2303
2306
|
this.params.focus.schedule(() => {
|
|
2304
2307
|
this.navigate(t);
|
|
2305
2308
|
});
|
|
@@ -2308,28 +2311,48 @@ class Oe {
|
|
|
2308
2311
|
this.viewportStore.destroy();
|
|
2309
2312
|
}
|
|
2310
2313
|
navigate(e) {
|
|
2311
|
-
let t = 1 / 0, o = -1 / 0, s = 1 / 0,
|
|
2314
|
+
let t = 1 / 0, o = -1 / 0, s = 1 / 0, n = -1 / 0, a = 0;
|
|
2312
2315
|
const h = /* @__PURE__ */ new Set();
|
|
2313
2316
|
for (const d of e.nodes)
|
|
2314
2317
|
h.add(d);
|
|
2315
2318
|
if (this.graphStore.getAllNodeIds().forEach((d) => {
|
|
2316
2319
|
const { payload: c } = this.graphStore.getNode(d);
|
|
2317
|
-
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),
|
|
2318
|
-
}),
|
|
2319
|
-
t -= e.contentOffset, s -= e.contentOffset, o += e.contentOffset,
|
|
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), n = Math.max(c.y, n), a++);
|
|
2321
|
+
}), a > 0) {
|
|
2322
|
+
t -= e.contentOffset, s -= e.contentOffset, o += e.contentOffset, n += e.contentOffset;
|
|
2320
2323
|
const d = {
|
|
2321
2324
|
x: (t + o) / 2,
|
|
2322
|
-
y: (s +
|
|
2323
|
-
}, { scale: c } = this.viewportStore.getContentMatrix(),
|
|
2324
|
-
|
|
2325
|
-
|
|
2325
|
+
y: (s + n) / 2
|
|
2326
|
+
}, { scale: c } = this.viewportStore.getContentMatrix(), g = (n - s) * c, u = (o - t) * c, { width: l, height: p } = this.viewportStore.getDimensions(), y = Math.max(
|
|
2327
|
+
u / l,
|
|
2328
|
+
g / p
|
|
2326
2329
|
), w = y > 1 ? c / y : c, f = Math.max(w, e.minContentScale);
|
|
2327
|
-
this.center(d, {
|
|
2330
|
+
this.center(d, {
|
|
2331
|
+
contentScale: f,
|
|
2332
|
+
animationDuration: e.animationDuration
|
|
2333
|
+
});
|
|
2328
2334
|
}
|
|
2329
2335
|
}
|
|
2336
|
+
animateNavigation(e, t, o) {
|
|
2337
|
+
let s;
|
|
2338
|
+
const n = {
|
|
2339
|
+
scale: t.scale - e.scale,
|
|
2340
|
+
x: t.x - e.x,
|
|
2341
|
+
y: t.y - e.y
|
|
2342
|
+
}, a = (h) => {
|
|
2343
|
+
s === void 0 && (s = h);
|
|
2344
|
+
const d = Math.min((h - s) / o, 1);
|
|
2345
|
+
d <= 1 && this.viewportStore.patchViewportMatrix({
|
|
2346
|
+
scale: e.scale + d * n.scale,
|
|
2347
|
+
x: e.x + d * n.x,
|
|
2348
|
+
y: e.y + d * n.y
|
|
2349
|
+
}), d < 1 && this.win.requestAnimationFrame(a);
|
|
2350
|
+
};
|
|
2351
|
+
this.win.requestAnimationFrame(a);
|
|
2352
|
+
}
|
|
2330
2353
|
}
|
|
2331
|
-
const We = (r, e) => {
|
|
2332
|
-
const
|
|
2354
|
+
const We = (r, e, t) => {
|
|
2355
|
+
const o = new be(), s = new Ie(o), n = new $e(e), a = new Ee(o, e, r), h = {
|
|
2333
2356
|
nodes: {
|
|
2334
2357
|
centerFn: Ce,
|
|
2335
2358
|
priorityFn: () => 0
|
|
@@ -2341,22 +2364,24 @@ const We = (r, e) => {
|
|
|
2341
2364
|
ports: {
|
|
2342
2365
|
direction: 0
|
|
2343
2366
|
}
|
|
2344
|
-
},
|
|
2345
|
-
|
|
2367
|
+
}, d = new Ve(
|
|
2368
|
+
o,
|
|
2346
2369
|
a,
|
|
2347
|
-
|
|
2348
|
-
),
|
|
2370
|
+
h
|
|
2371
|
+
), c = {
|
|
2349
2372
|
focus: {
|
|
2350
2373
|
contentOffset: 0,
|
|
2351
2374
|
minContentScale: 0,
|
|
2352
|
-
schedule: re
|
|
2375
|
+
schedule: re,
|
|
2376
|
+
animationDuration: 0
|
|
2353
2377
|
}
|
|
2354
|
-
},
|
|
2355
|
-
|
|
2378
|
+
}, g = new Oe(
|
|
2379
|
+
o,
|
|
2356
2380
|
e,
|
|
2357
|
-
|
|
2381
|
+
c,
|
|
2382
|
+
t
|
|
2358
2383
|
);
|
|
2359
|
-
return new Se(
|
|
2384
|
+
return new Se(s, n, d, g);
|
|
2360
2385
|
};
|
|
2361
2386
|
class G {
|
|
2362
2387
|
constructor(e, t, o, s) {
|
|
@@ -2401,8 +2426,8 @@ class G {
|
|
|
2401
2426
|
const t = e;
|
|
2402
2427
|
if (t.touches.length !== 1)
|
|
2403
2428
|
return;
|
|
2404
|
-
const o = t.touches[0], s = e.currentTarget,
|
|
2405
|
-
this.params.onPortPointerDown(
|
|
2429
|
+
const o = t.touches[0], s = e.currentTarget, n = this.canvas.graph.findPortIdsByElement(s)[0];
|
|
2430
|
+
this.params.onPortPointerDown(n, {
|
|
2406
2431
|
x: o.clientX,
|
|
2407
2432
|
y: o.clientY
|
|
2408
2433
|
}) && (e.stopPropagation(), this.window.addEventListener("touchmove", this.onWindowTouchMove, {
|
|
@@ -2467,7 +2492,7 @@ class G {
|
|
|
2467
2492
|
this.window.removeEventListener("touchmove", this.onWindowTouchMove), this.window.removeEventListener("touchend", this.onWindowTouchFinish), this.window.removeEventListener("touchcancel", this.onWindowTouchFinish);
|
|
2468
2493
|
}
|
|
2469
2494
|
}
|
|
2470
|
-
class
|
|
2495
|
+
class Vt {
|
|
2471
2496
|
constructor(e, t, o) {
|
|
2472
2497
|
this.canvas = e, this.layoutAlgorithm = t, this.params = o;
|
|
2473
2498
|
}
|
|
@@ -2521,7 +2546,7 @@ class oe {
|
|
|
2521
2546
|
const t = e;
|
|
2522
2547
|
if (!this.params.mouseDownEventVerifier(t))
|
|
2523
2548
|
return;
|
|
2524
|
-
const o = e.currentTarget, s = this.graph.findNodeIdByElement(o),
|
|
2549
|
+
const o = e.currentTarget, s = this.graph.findNodeIdByElement(o), n = this.graph.getNode(s);
|
|
2525
2550
|
if (!this.params.nodeDragVerifier(s))
|
|
2526
2551
|
return;
|
|
2527
2552
|
this.params.onNodeDragStarted(s), e.stopPropagation();
|
|
@@ -2531,8 +2556,8 @@ class oe {
|
|
|
2531
2556
|
});
|
|
2532
2557
|
this.grabbedNode = {
|
|
2533
2558
|
nodeId: s,
|
|
2534
|
-
dx: h.x -
|
|
2535
|
-
dy: h.y -
|
|
2559
|
+
dx: h.x - n.x,
|
|
2560
|
+
dy: h.y - n.y
|
|
2536
2561
|
}, k(this.element, this.params.dragCursor), this.moveNodeOnTop(s), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
|
|
2537
2562
|
passive: !0
|
|
2538
2563
|
}), this.window.addEventListener("mouseup", this.onWindowMouseUp, {
|
|
@@ -2544,12 +2569,12 @@ class oe {
|
|
|
2544
2569
|
if (t.touches.length !== 1)
|
|
2545
2570
|
return;
|
|
2546
2571
|
e.stopPropagation();
|
|
2547
|
-
const o = t.touches[0], s = e.currentTarget,
|
|
2572
|
+
const o = t.touches[0], s = e.currentTarget, n = this.canvas.graph.findNodeIdByElement(s), a = this.graph.getNode(n);
|
|
2548
2573
|
if (!this.params.nodeDragVerifier({
|
|
2549
|
-
nodeId:
|
|
2550
|
-
element:
|
|
2551
|
-
x:
|
|
2552
|
-
y:
|
|
2574
|
+
nodeId: n,
|
|
2575
|
+
element: a.element,
|
|
2576
|
+
x: a.x,
|
|
2577
|
+
y: a.y
|
|
2553
2578
|
}))
|
|
2554
2579
|
return;
|
|
2555
2580
|
const d = this.calculateContentPoint({
|
|
@@ -2557,10 +2582,10 @@ class oe {
|
|
|
2557
2582
|
y: o.clientY
|
|
2558
2583
|
});
|
|
2559
2584
|
this.grabbedNode = {
|
|
2560
|
-
nodeId:
|
|
2561
|
-
dx: d.x -
|
|
2562
|
-
dy: d.y -
|
|
2563
|
-
}, this.moveNodeOnTop(
|
|
2585
|
+
nodeId: n,
|
|
2586
|
+
dx: d.x - a.x,
|
|
2587
|
+
dy: d.y - a.y
|
|
2588
|
+
}, this.moveNodeOnTop(n), this.window.addEventListener("touchmove", this.onWindowTouchMove, {
|
|
2564
2589
|
passive: !0
|
|
2565
2590
|
}), this.window.addEventListener("touchend", this.onWindowTouchFinish, {
|
|
2566
2591
|
passive: !0
|
|
@@ -2627,10 +2652,10 @@ class oe {
|
|
|
2627
2652
|
const o = this.calculateContentPoint(t), s = {
|
|
2628
2653
|
x: o.x - e.dx,
|
|
2629
2654
|
y: o.y - e.dy
|
|
2630
|
-
},
|
|
2655
|
+
}, n = this.adjustNodeCoords(s);
|
|
2631
2656
|
this.canvas.updateNode(e.nodeId, {
|
|
2632
|
-
x:
|
|
2633
|
-
y:
|
|
2657
|
+
x: n.x,
|
|
2658
|
+
y: n.y
|
|
2634
2659
|
}), this.params.onNodeDrag(e.nodeId);
|
|
2635
2660
|
}
|
|
2636
2661
|
moveNodeOnTop(e) {
|
|
@@ -2695,14 +2720,14 @@ const W = (r) => {
|
|
|
2695
2720
|
const o = e.reduce(
|
|
2696
2721
|
(h, d) => [h[0] + d[0], h[1] + d[1]],
|
|
2697
2722
|
[0, 0]
|
|
2698
|
-
), s = [o[0] / t, o[1] / t],
|
|
2723
|
+
), s = [o[0] / t, o[1] / t], a = e.map((h) => [h[0] - s[0], h[1] - s[1]]).reduce(
|
|
2699
2724
|
(h, d) => h + Math.sqrt(d[0] * d[0] + d[1] * d[1]),
|
|
2700
2725
|
0
|
|
2701
2726
|
);
|
|
2702
2727
|
return {
|
|
2703
2728
|
x: s[0],
|
|
2704
2729
|
y: s[1],
|
|
2705
|
-
scale:
|
|
2730
|
+
scale: a / t,
|
|
2706
2731
|
touchesCnt: t,
|
|
2707
2732
|
touches: e
|
|
2708
2733
|
};
|
|
@@ -2743,8 +2768,8 @@ class j {
|
|
|
2743
2768
|
i(this, "onWheelScroll", (e) => {
|
|
2744
2769
|
if (!this.params.mouseWheelEventVerifier(e))
|
|
2745
2770
|
return;
|
|
2746
|
-
const { left: t, top: o } = this.element.getBoundingClientRect(), s = e.clientX - t,
|
|
2747
|
-
this.wheelFinishTimer === null && this.params.onTransformStarted(), this.scaleViewport(h, s,
|
|
2771
|
+
const { left: t, top: o } = this.element.getBoundingClientRect(), s = e.clientX - t, n = 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, n), this.wheelFinishTimer !== null && clearTimeout(this.wheelFinishTimer), this.wheelFinishTimer = setTimeout(() => {
|
|
2748
2773
|
this.transformInProgress || this.params.onTransformFinished(), this.wheelFinishTimer = null;
|
|
2749
2774
|
}, this.params.scaleWheelFinishTimeout);
|
|
2750
2775
|
});
|
|
@@ -2773,8 +2798,8 @@ class j {
|
|
|
2773
2798
|
-(t.x - this.prevTouches.x),
|
|
2774
2799
|
-(t.y - this.prevTouches.y)
|
|
2775
2800
|
), t.touchesCnt === 2) {
|
|
2776
|
-
const { left: s, top:
|
|
2777
|
-
this.scaleViewport(c,
|
|
2801
|
+
const { left: s, top: n } = this.element.getBoundingClientRect(), a = this.prevTouches.x - s, h = this.prevTouches.y - n, c = 1 / (t.scale / this.prevTouches.scale);
|
|
2802
|
+
this.scaleViewport(c, a, h);
|
|
2778
2803
|
}
|
|
2779
2804
|
this.prevTouches = t;
|
|
2780
2805
|
});
|
|
@@ -2800,19 +2825,19 @@ class j {
|
|
|
2800
2825
|
new j(e, t, o, s);
|
|
2801
2826
|
}
|
|
2802
2827
|
moveViewport(e, t) {
|
|
2803
|
-
const o = this.viewport.getViewportMatrix(), s = Be(o, e, t), { width:
|
|
2828
|
+
const o = this.viewport.getViewportMatrix(), s = Be(o, e, t), { width: n, height: a } = this.viewport.getDimensions(), h = this.params.transformPreprocessor({
|
|
2804
2829
|
prevTransform: o,
|
|
2805
2830
|
nextTransform: s,
|
|
2806
|
-
canvasWidth:
|
|
2807
|
-
canvasHeight:
|
|
2831
|
+
canvasWidth: n,
|
|
2832
|
+
canvasHeight: a
|
|
2808
2833
|
});
|
|
2809
2834
|
this.performTransform(h);
|
|
2810
2835
|
}
|
|
2811
2836
|
scaleViewport(e, t, o) {
|
|
2812
|
-
const s = this.canvas.viewport.getViewportMatrix(),
|
|
2837
|
+
const s = this.canvas.viewport.getViewportMatrix(), n = Ue(s, e, t, o), { width: a, height: h } = this.viewport.getDimensions(), d = this.params.transformPreprocessor({
|
|
2813
2838
|
prevTransform: s,
|
|
2814
|
-
nextTransform:
|
|
2815
|
-
canvasWidth:
|
|
2839
|
+
nextTransform: n,
|
|
2840
|
+
canvasWidth: a,
|
|
2816
2841
|
canvasHeight: h
|
|
2817
2842
|
});
|
|
2818
2843
|
this.performTransform(d);
|
|
@@ -2849,7 +2874,7 @@ class j {
|
|
|
2849
2874
|
}
|
|
2850
2875
|
}
|
|
2851
2876
|
class se {
|
|
2852
|
-
constructor(e, t, o, s,
|
|
2877
|
+
constructor(e, t, o, s, n, a) {
|
|
2853
2878
|
i(this, "nodeHorizontal");
|
|
2854
2879
|
i(this, "nodeVertical");
|
|
2855
2880
|
i(this, "viewport");
|
|
@@ -2872,7 +2897,7 @@ class se {
|
|
|
2872
2897
|
this.userTransformInProgress || this.loadAreaAroundViewport();
|
|
2873
2898
|
});
|
|
2874
2899
|
i(this, "userTransformInProgress", !1);
|
|
2875
|
-
this.canvas = e, this.element = t, this.window = o, this.trigger =
|
|
2900
|
+
this.canvas = e, this.element = t, this.window = o, this.trigger = n, this.params = a, 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(() => {
|
|
2876
2901
|
this.scheduleLoadAreaAroundViewport();
|
|
2877
2902
|
});
|
|
2878
2903
|
const h = {
|
|
@@ -2902,14 +2927,14 @@ class se {
|
|
|
2902
2927
|
h
|
|
2903
2928
|
), this.trigger.subscribe(this.updateLoadedArea), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterViewportUpdated);
|
|
2904
2929
|
}
|
|
2905
|
-
static configure(e, t, o, s,
|
|
2930
|
+
static configure(e, t, o, s, n, a) {
|
|
2906
2931
|
new se(
|
|
2907
2932
|
e,
|
|
2908
2933
|
t,
|
|
2909
2934
|
o,
|
|
2910
2935
|
s,
|
|
2911
|
-
|
|
2912
|
-
|
|
2936
|
+
n,
|
|
2937
|
+
a
|
|
2913
2938
|
);
|
|
2914
2939
|
}
|
|
2915
2940
|
scheduleLoadAreaAroundViewport() {
|
|
@@ -2919,17 +2944,17 @@ class se {
|
|
|
2919
2944
|
}
|
|
2920
2945
|
scheduleEnsureViewportAreaLoaded() {
|
|
2921
2946
|
setTimeout(() => {
|
|
2922
|
-
const { width: e, height: t } = this.viewport.getDimensions(), { scale: o, x: s, y:
|
|
2923
|
-
this.loadedArea.xFrom < d && this.loadedArea.xTo >
|
|
2947
|
+
const { width: e, height: t } = this.viewport.getDimensions(), { scale: o, x: s, y: n } = this.viewport.getViewportMatrix(), a = e * o, h = t * o, d = s - this.nodeHorizontal, c = n - this.nodeVertical, g = s + a + this.nodeHorizontal, u = n + h + this.nodeVertical;
|
|
2948
|
+
this.loadedArea.xFrom < d && this.loadedArea.xTo > g && this.loadedArea.yFrom < c && this.loadedArea.yTo > u || this.loadAreaAroundViewport();
|
|
2924
2949
|
});
|
|
2925
2950
|
}
|
|
2926
2951
|
loadAreaAroundViewport() {
|
|
2927
|
-
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: n } = this.viewport.getViewportMatrix(), a = e * o, h = t * o, d = s - a - this.nodeHorizontal, c = n - h - this.nodeVertical, g = 3 * a + 2 * this.nodeHorizontal, u = 3 * h + 2 * this.nodeVertical;
|
|
2928
2953
|
this.trigger.emit({
|
|
2929
2954
|
x: d,
|
|
2930
2955
|
y: c,
|
|
2931
|
-
width:
|
|
2932
|
-
height:
|
|
2956
|
+
width: g,
|
|
2957
|
+
height: u
|
|
2933
2958
|
});
|
|
2934
2959
|
}
|
|
2935
2960
|
}
|
|
@@ -2965,8 +2990,8 @@ class ie {
|
|
|
2965
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;
|
|
2966
2991
|
const s = `translate(${this.halfTileWidth}, ${this.halfTileHeight})`;
|
|
2967
2992
|
this.patternContent.setAttribute("transform", s), this.pattern.appendChild(this.patternContent);
|
|
2968
|
-
const
|
|
2969
|
-
|
|
2993
|
+
const n = document.createElementNS("http://www.w3.org/2000/svg", "defs");
|
|
2994
|
+
n.appendChild(this.pattern), this.svg.appendChild(n), this.svg.appendChild(this.patternRenderingRectangle), this.updateDimensions(), this.canvas.viewport.onAfterResize.subscribe(() => {
|
|
2970
2995
|
this.updateDimensions();
|
|
2971
2996
|
}), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterTransformUpdated), this.onAfterTransformUpdated();
|
|
2972
2997
|
}
|
|
@@ -2985,16 +3010,17 @@ class ie {
|
|
|
2985
3010
|
}
|
|
2986
3011
|
}
|
|
2987
3012
|
class ne {
|
|
2988
|
-
constructor(e, t, o, s,
|
|
3013
|
+
constructor(e, t, o, s, n) {
|
|
2989
3014
|
i(this, "overlayCanvas");
|
|
2990
3015
|
i(this, "staticPortId", null);
|
|
2991
3016
|
i(this, "isTargetDragging", !0);
|
|
2992
3017
|
i(this, "onEdgeCreated", (e) => {
|
|
2993
3018
|
this.params.onAfterEdgeCreated(e);
|
|
2994
3019
|
});
|
|
2995
|
-
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 = n, this.overlayCanvas = We(
|
|
2996
3021
|
this.overlayLayer,
|
|
2997
|
-
this.viewportStore
|
|
3022
|
+
this.viewportStore,
|
|
3023
|
+
this.window
|
|
2998
3024
|
), G.configure(
|
|
2999
3025
|
this.canvas,
|
|
3000
3026
|
this.overlayLayer,
|
|
@@ -3005,48 +3031,48 @@ class ne {
|
|
|
3005
3031
|
onStopDrag: () => {
|
|
3006
3032
|
this.resetDragState();
|
|
3007
3033
|
},
|
|
3008
|
-
onPortPointerDown: (
|
|
3009
|
-
const d = this.params.connectionTypeResolver(
|
|
3010
|
-
return d === null ? !1 : (this.grabPort(
|
|
3034
|
+
onPortPointerDown: (a, h) => {
|
|
3035
|
+
const d = this.params.connectionTypeResolver(a);
|
|
3036
|
+
return d === null ? !1 : (this.grabPort(a, h, d), !0);
|
|
3011
3037
|
},
|
|
3012
|
-
onPointerMove: (
|
|
3013
|
-
this.moveDraggingPort(
|
|
3038
|
+
onPointerMove: (a) => {
|
|
3039
|
+
this.moveDraggingPort(a);
|
|
3014
3040
|
},
|
|
3015
|
-
onPointerUp: (
|
|
3016
|
-
this.tryCreateConnection(
|
|
3041
|
+
onPointerUp: (a) => {
|
|
3042
|
+
this.tryCreateConnection(a);
|
|
3017
3043
|
}
|
|
3018
3044
|
}
|
|
3019
3045
|
);
|
|
3020
3046
|
}
|
|
3021
|
-
static configure(e, t, o, s,
|
|
3047
|
+
static configure(e, t, o, s, n) {
|
|
3022
3048
|
new ne(
|
|
3023
3049
|
e,
|
|
3024
3050
|
t,
|
|
3025
3051
|
o,
|
|
3026
3052
|
s,
|
|
3027
|
-
|
|
3053
|
+
n
|
|
3028
3054
|
);
|
|
3029
3055
|
}
|
|
3030
3056
|
grabPort(e, t, o) {
|
|
3031
3057
|
const s = this.canvas.graph.getPort(e);
|
|
3032
3058
|
this.staticPortId = e;
|
|
3033
|
-
const
|
|
3034
|
-
x:
|
|
3059
|
+
const n = s.element.getBoundingClientRect(), a = n.x + n.width / 2, h = n.y + n.height / 2, d = this.overlayLayer.getBoundingClientRect(), c = this.canvas.viewport.createContentCoords({
|
|
3060
|
+
x: a - d.x,
|
|
3035
3061
|
y: h - d.y
|
|
3036
|
-
}),
|
|
3062
|
+
}), g = this.canvas.viewport.createContentCoords({
|
|
3037
3063
|
x: t.x - d.x,
|
|
3038
3064
|
y: t.y - d.y
|
|
3039
|
-
}),
|
|
3065
|
+
}), u = {
|
|
3040
3066
|
overlayNodeId: M.StaticNodeId,
|
|
3041
3067
|
portCoords: c,
|
|
3042
3068
|
portDirection: s.direction
|
|
3043
3069
|
}, l = {
|
|
3044
3070
|
overlayNodeId: M.DraggingNodeId,
|
|
3045
|
-
portCoords:
|
|
3071
|
+
portCoords: g,
|
|
3046
3072
|
portDirection: this.params.dragPortDirection
|
|
3047
3073
|
};
|
|
3048
3074
|
this.isTargetDragging = o === "direct";
|
|
3049
|
-
const [p, y] = this.isTargetDragging ? [
|
|
3075
|
+
const [p, y] = this.isTargetDragging ? [u, l] : [l, u];
|
|
3050
3076
|
this.overlayCanvas.addNode(H(p)), this.overlayCanvas.addNode(H(y)), this.overlayCanvas.addEdge({
|
|
3051
3077
|
from: p.overlayNodeId,
|
|
3052
3078
|
to: y.overlayNodeId,
|
|
@@ -3065,8 +3091,8 @@ class ne {
|
|
|
3065
3091
|
});
|
|
3066
3092
|
return;
|
|
3067
3093
|
}
|
|
3068
|
-
const s = this.isTargetDragging ? o : t,
|
|
3069
|
-
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, n = this.isTargetDragging ? t : o, a = { from: s, to: n }, h = this.params.connectionPreprocessor(a);
|
|
3095
|
+
h !== null ? (this.canvas.graph.onAfterEdgeAdded.subscribe(this.onEdgeCreated), this.canvas.addEdge(h), this.canvas.graph.onAfterEdgeAdded.unsubscribe(this.onEdgeCreated)) : this.params.onEdgeCreationPrevented(a);
|
|
3070
3096
|
}
|
|
3071
3097
|
moveDraggingPort(e) {
|
|
3072
3098
|
const t = this.overlayLayer.getBoundingClientRect(), o = this.canvas.viewport.createContentCoords({
|
|
@@ -3080,7 +3106,7 @@ class ne {
|
|
|
3080
3106
|
}
|
|
3081
3107
|
}
|
|
3082
3108
|
class ae {
|
|
3083
|
-
constructor(e, t, o, s,
|
|
3109
|
+
constructor(e, t, o, s, n) {
|
|
3084
3110
|
i(this, "overlayCanvas");
|
|
3085
3111
|
i(this, "staticPortId", null);
|
|
3086
3112
|
i(this, "isTargetDragging", !0);
|
|
@@ -3088,9 +3114,10 @@ class ae {
|
|
|
3088
3114
|
i(this, "onEdgeReattached", (e) => {
|
|
3089
3115
|
this.params.onAfterEdgeReattached(e);
|
|
3090
3116
|
});
|
|
3091
|
-
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 = n, this.overlayCanvas = We(
|
|
3092
3118
|
this.overlayLayer,
|
|
3093
|
-
this.viewportStore
|
|
3119
|
+
this.viewportStore,
|
|
3120
|
+
this.window
|
|
3094
3121
|
), G.configure(
|
|
3095
3122
|
this.canvas,
|
|
3096
3123
|
this.overlayLayer,
|
|
@@ -3101,37 +3128,37 @@ class ae {
|
|
|
3101
3128
|
onStopDrag: () => {
|
|
3102
3129
|
this.resetDragState();
|
|
3103
3130
|
},
|
|
3104
|
-
onPortPointerDown: (
|
|
3105
|
-
onPointerMove: (
|
|
3106
|
-
this.moveDraggingPort(
|
|
3131
|
+
onPortPointerDown: (a, h) => this.tryStartEdgeDragging(a, h),
|
|
3132
|
+
onPointerMove: (a) => {
|
|
3133
|
+
this.moveDraggingPort(a);
|
|
3107
3134
|
},
|
|
3108
|
-
onPointerUp: (
|
|
3109
|
-
this.tryCreateConnection(
|
|
3135
|
+
onPointerUp: (a) => {
|
|
3136
|
+
this.tryCreateConnection(a);
|
|
3110
3137
|
}
|
|
3111
3138
|
}
|
|
3112
3139
|
);
|
|
3113
3140
|
}
|
|
3114
|
-
static configure(e, t, o, s,
|
|
3141
|
+
static configure(e, t, o, s, n) {
|
|
3115
3142
|
new ae(
|
|
3116
3143
|
e,
|
|
3117
3144
|
t,
|
|
3118
3145
|
o,
|
|
3119
3146
|
s,
|
|
3120
|
-
|
|
3147
|
+
n
|
|
3121
3148
|
);
|
|
3122
3149
|
}
|
|
3123
3150
|
tryStartEdgeDragging(e, t) {
|
|
3124
3151
|
const o = this.params.draggingEdgeResolver(e);
|
|
3125
3152
|
if (o === null || !this.canvas.graph.hasEdge(o))
|
|
3126
3153
|
return !1;
|
|
3127
|
-
const s = this.canvas.graph.getEdge(o),
|
|
3128
|
-
this.staticPortId = h, this.isTargetDragging =
|
|
3129
|
-
const d = this.canvas.graph.getPort(e), c = this.canvas.graph.getPort(h),
|
|
3130
|
-
x:
|
|
3131
|
-
y:
|
|
3154
|
+
const s = this.canvas.graph.getEdge(o), n = e === s.from, a = e === s.to, h = n ? s.to : s.from;
|
|
3155
|
+
this.staticPortId = h, this.isTargetDragging = a;
|
|
3156
|
+
const d = this.canvas.graph.getPort(e), c = this.canvas.graph.getPort(h), g = c.element.getBoundingClientRect(), u = {
|
|
3157
|
+
x: g.x + g.width / 2,
|
|
3158
|
+
y: g.y + g.height / 2
|
|
3132
3159
|
}, l = this.overlayLayer.getBoundingClientRect(), p = this.canvas.viewport.createContentCoords({
|
|
3133
|
-
x:
|
|
3134
|
-
y:
|
|
3160
|
+
x: u.x - l.x,
|
|
3161
|
+
y: u.y - l.y
|
|
3135
3162
|
}), y = this.canvas.viewport.createContentCoords({
|
|
3136
3163
|
x: t.x - l.x,
|
|
3137
3164
|
y: t.y - l.y
|
|
@@ -3187,13 +3214,13 @@ class ae {
|
|
|
3187
3214
|
});
|
|
3188
3215
|
return;
|
|
3189
3216
|
}
|
|
3190
|
-
const [o, s] = this.isTargetDragging ? [this.staticPortId, t] : [t, this.staticPortId],
|
|
3191
|
-
id:
|
|
3217
|
+
const [o, s] = this.isTargetDragging ? [this.staticPortId, t] : [t, this.staticPortId], n = this.draggingEdgePayload, a = {
|
|
3218
|
+
id: n.id,
|
|
3192
3219
|
from: o,
|
|
3193
3220
|
to: s,
|
|
3194
|
-
shape:
|
|
3195
|
-
priority:
|
|
3196
|
-
}, h = this.params.connectionPreprocessor(
|
|
3221
|
+
shape: n.shape,
|
|
3222
|
+
priority: n.priority
|
|
3223
|
+
}, h = this.params.connectionPreprocessor(a);
|
|
3197
3224
|
if (h !== null)
|
|
3198
3225
|
this.canvas.graph.onAfterEdgeAdded.subscribe(this.onEdgeReattached), this.canvas.addEdge(h), this.canvas.graph.onAfterEdgeAdded.unsubscribe(this.onEdgeReattached);
|
|
3199
3226
|
else {
|
|
@@ -3247,7 +3274,7 @@ class de {
|
|
|
3247
3274
|
}
|
|
3248
3275
|
class Wt {
|
|
3249
3276
|
static configure(e, t) {
|
|
3250
|
-
const o = t.applyOn, s = new
|
|
3277
|
+
const o = t.applyOn, s = new Vt(e, t.algorithm, {
|
|
3251
3278
|
staticNodeResolver: t.staticNodeResolver,
|
|
3252
3279
|
onBeforeApplied: t.onBeforeApplied,
|
|
3253
3280
|
onAfterApplied: t.onAfterApplied
|
|
@@ -3330,13 +3357,13 @@ const Yt = (r) => {
|
|
|
3330
3357
|
const e = ((p = r.events) == null ? void 0 : p.onNodeDragStarted) ?? (() => {
|
|
3331
3358
|
}), t = ((y = r.events) == null ? void 0 : y.onNodeDrag) ?? (() => {
|
|
3332
3359
|
}), o = r.nodeDragVerifier ?? (() => !0), s = ((w = r.events) == null ? void 0 : w.onNodeDragFinished) ?? (() => {
|
|
3333
|
-
}),
|
|
3360
|
+
}), n = r.moveOnTop !== !1, a = r.moveEdgesOnTop !== !1 && n, 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;
|
|
3334
3361
|
return {
|
|
3335
|
-
moveOnTop:
|
|
3336
|
-
moveEdgesOnTop:
|
|
3362
|
+
moveOnTop: n,
|
|
3363
|
+
moveEdgesOnTop: a,
|
|
3337
3364
|
dragCursor: d,
|
|
3338
3365
|
gridSize: r.gridSize ?? null,
|
|
3339
|
-
mouseDownEventVerifier:
|
|
3366
|
+
mouseDownEventVerifier: g,
|
|
3340
3367
|
mouseUpEventVerifier: l,
|
|
3341
3368
|
onNodeDragStarted: e,
|
|
3342
3369
|
onNodeDrag: t,
|
|
@@ -3345,33 +3372,33 @@ const Yt = (r) => {
|
|
|
3345
3372
|
};
|
|
3346
3373
|
}, Xt = (r) => {
|
|
3347
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;
|
|
3348
|
-
return (
|
|
3349
|
-
let
|
|
3350
|
-
|
|
3351
|
-
const d =
|
|
3352
|
-
|
|
3353
|
-
const
|
|
3354
|
-
return h >
|
|
3375
|
+
return (n) => {
|
|
3376
|
+
let a = n.nextTransform.x, h = n.nextTransform.y;
|
|
3377
|
+
a < e && a < n.prevTransform.x && (a = Math.min(n.prevTransform.x, e));
|
|
3378
|
+
const d = n.canvasWidth * n.prevTransform.scale, c = t - d;
|
|
3379
|
+
a > c && a > n.prevTransform.x && (a = Math.max(n.prevTransform.x, c)), h < o && h < n.prevTransform.y && (h = Math.min(n.prevTransform.y, o));
|
|
3380
|
+
const g = n.canvasHeight * n.prevTransform.scale, u = s - g;
|
|
3381
|
+
return h > u && h > n.prevTransform.y && (h = Math.max(n.prevTransform.y, u)), { scale: n.nextTransform.scale, x: a, y: h };
|
|
3355
3382
|
};
|
|
3356
3383
|
}, Gt = (r) => {
|
|
3357
3384
|
const e = r.maxContentScale, t = r.minContentScale, o = e !== null ? 1 / e : 0, s = t !== null ? 1 / t : 1 / 0;
|
|
3358
|
-
return (
|
|
3359
|
-
const
|
|
3360
|
-
let d = h.scale, c = h.x,
|
|
3361
|
-
if (h.scale > s && h.scale >
|
|
3362
|
-
d = Math.max(
|
|
3363
|
-
const
|
|
3364
|
-
c =
|
|
3385
|
+
return (n) => {
|
|
3386
|
+
const a = n.prevTransform, h = n.nextTransform;
|
|
3387
|
+
let d = h.scale, c = h.x, g = h.y;
|
|
3388
|
+
if (h.scale > s && h.scale > a.scale) {
|
|
3389
|
+
d = Math.max(a.scale, s), c = a.x, g = a.y;
|
|
3390
|
+
const u = (d - a.scale) / (h.scale - a.scale);
|
|
3391
|
+
c = a.x + (h.x - a.x) * u, g = a.y + (h.y - a.y) * u;
|
|
3365
3392
|
}
|
|
3366
|
-
if (h.scale < o && h.scale <
|
|
3367
|
-
d = Math.min(
|
|
3368
|
-
const
|
|
3369
|
-
c =
|
|
3393
|
+
if (h.scale < o && h.scale < a.scale) {
|
|
3394
|
+
d = Math.min(a.scale, o), c = a.x, g = a.y;
|
|
3395
|
+
const u = (d - a.scale) / (h.scale - a.scale);
|
|
3396
|
+
c = a.x + (h.x - a.x) * u, g = a.y + (h.y - a.y) * u;
|
|
3370
3397
|
}
|
|
3371
3398
|
return {
|
|
3372
3399
|
scale: d,
|
|
3373
3400
|
x: c,
|
|
3374
|
-
y:
|
|
3401
|
+
y: g
|
|
3375
3402
|
};
|
|
3376
3403
|
};
|
|
3377
3404
|
}, jt = (r) => (e) => r.reduce(
|
|
@@ -3400,7 +3427,7 @@ const Yt = (r) => {
|
|
|
3400
3427
|
});
|
|
3401
3428
|
}
|
|
3402
3429
|
}, me = (r) => {
|
|
3403
|
-
var y, w, f, m, A, N, C, T,
|
|
3430
|
+
var y, w, f, m, A, N, C, T, I, V, $, ge;
|
|
3404
3431
|
const e = (y = r == null ? void 0 : r.scale) == null ? void 0 : y.mouseWheelSensitivity, t = e !== void 0 ? e : 1.2, o = r == null ? void 0 : r.transformPreprocessor;
|
|
3405
3432
|
let s;
|
|
3406
3433
|
o !== void 0 ? Array.isArray(o) ? s = jt(
|
|
@@ -3408,23 +3435,23 @@ const Yt = (r) => {
|
|
|
3408
3435
|
(D) => xe(D)
|
|
3409
3436
|
)
|
|
3410
3437
|
) : s = xe(o) : s = (D) => D.nextTransform;
|
|
3411
|
-
const
|
|
3438
|
+
const n = ((w = r == null ? void 0 : r.shift) == null ? void 0 : w.cursor) !== void 0 ? r.shift.cursor : "grab", a = ((f = r == null ? void 0 : r.events) == null ? void 0 : f.onBeforeTransformChange) ?? (() => {
|
|
3412
3439
|
}), h = ((m = r == null ? void 0 : r.events) == null ? void 0 : m.onTransformChange) ?? (() => {
|
|
3413
|
-
}), d = (A = r == null ? void 0 : r.shift) == null ? void 0 : A.mouseDownEventVerifier, c = d !== void 0 ? d : (D) => D.button === 0,
|
|
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;
|
|
3414
3441
|
return {
|
|
3415
3442
|
wheelSensitivity: t,
|
|
3416
3443
|
onTransformStarted: ((T = r == null ? void 0 : r.events) == null ? void 0 : T.onTransformStarted) ?? (() => {
|
|
3417
3444
|
}),
|
|
3418
|
-
onTransformFinished: ((
|
|
3445
|
+
onTransformFinished: ((I = r == null ? void 0 : r.events) == null ? void 0 : I.onTransformFinished) ?? (() => {
|
|
3419
3446
|
}),
|
|
3420
|
-
onBeforeTransformChange:
|
|
3447
|
+
onBeforeTransformChange: a,
|
|
3421
3448
|
onTransformChange: h,
|
|
3422
3449
|
transformPreprocessor: s,
|
|
3423
|
-
shiftCursor:
|
|
3450
|
+
shiftCursor: n,
|
|
3424
3451
|
mouseDownEventVerifier: c,
|
|
3425
|
-
mouseUpEventVerifier:
|
|
3452
|
+
mouseUpEventVerifier: u,
|
|
3426
3453
|
mouseWheelEventVerifier: p,
|
|
3427
|
-
scaleWheelFinishTimeout: ((
|
|
3454
|
+
scaleWheelFinishTimeout: ((V = r == null ? void 0 : r.scale) == null ? void 0 : V.wheelFinishTimeout) ?? 500,
|
|
3428
3455
|
onResizeTransformStarted: (($ = r == null ? void 0 : r.events) == null ? void 0 : $.onResizeTransformStarted) ?? (() => {
|
|
3429
3456
|
}),
|
|
3430
3457
|
onResizeTransformFinished: ((ge = r == null ? void 0 : r.events) == null ? void 0 : ge.onResizeTransformFinished) ?? (() => {
|
|
@@ -3518,28 +3545,28 @@ const Yt = (r) => {
|
|
|
3518
3545
|
});
|
|
3519
3546
|
}
|
|
3520
3547
|
}, Zt = (r, e, t) => {
|
|
3521
|
-
var c,
|
|
3522
|
-
const o = () => "direct", s = (l) => l,
|
|
3548
|
+
var c, g, u;
|
|
3549
|
+
const o = () => "direct", s = (l) => l, n = (l) => l.button === 0, a = () => {
|
|
3523
3550
|
}, h = () => {
|
|
3524
3551
|
}, d = () => {
|
|
3525
3552
|
};
|
|
3526
3553
|
return {
|
|
3527
3554
|
connectionTypeResolver: r.connectionTypeResolver ?? o,
|
|
3528
3555
|
connectionPreprocessor: r.connectionPreprocessor ?? s,
|
|
3529
|
-
mouseDownEventVerifier: r.mouseDownEventVerifier ??
|
|
3530
|
-
mouseUpEventVerifier: r.mouseUpEventVerifier ??
|
|
3531
|
-
onAfterEdgeCreated: ((c = r.events) == null ? void 0 : c.onAfterEdgeCreated) ??
|
|
3532
|
-
onEdgeCreationInterrupted: ((
|
|
3533
|
-
onEdgeCreationPrevented: ((
|
|
3556
|
+
mouseDownEventVerifier: r.mouseDownEventVerifier ?? n,
|
|
3557
|
+
mouseUpEventVerifier: r.mouseUpEventVerifier ?? n,
|
|
3558
|
+
onAfterEdgeCreated: ((c = r.events) == null ? void 0 : c.onAfterEdgeCreated) ?? a,
|
|
3559
|
+
onEdgeCreationInterrupted: ((g = r.events) == null ? void 0 : g.onEdgeCreationInterrupted) ?? d,
|
|
3560
|
+
onEdgeCreationPrevented: ((u = r.events) == null ? void 0 : u.onEdgeCreationPrevented) ?? h,
|
|
3534
3561
|
dragPortDirection: r.dragPortDirection ?? t,
|
|
3535
3562
|
edgeShapeFactory: r.edgeShape !== void 0 ? le(r.edgeShape) : e
|
|
3536
3563
|
};
|
|
3537
3564
|
}, _t = (r, e) => {
|
|
3538
|
-
var c,
|
|
3539
|
-
const t = (l) => l, o = (l) => l.button === 0 && l.ctrlKey, s = (l) => l.button === 0,
|
|
3565
|
+
var c, g, u;
|
|
3566
|
+
const t = (l) => l, o = (l) => l.button === 0 && l.ctrlKey, s = (l) => l.button === 0, n = (l) => {
|
|
3540
3567
|
const p = e.getPortAdjacentEdgeIds(l);
|
|
3541
3568
|
return p.length > 0 ? p[p.length - 1] : null;
|
|
3542
|
-
},
|
|
3569
|
+
}, a = () => {
|
|
3543
3570
|
}, h = () => {
|
|
3544
3571
|
}, d = () => {
|
|
3545
3572
|
};
|
|
@@ -3547,11 +3574,11 @@ const Yt = (r) => {
|
|
|
3547
3574
|
connectionPreprocessor: r.connectionPreprocessor ?? t,
|
|
3548
3575
|
mouseDownEventVerifier: r.mouseDownEventVerifier ?? o,
|
|
3549
3576
|
mouseUpEventVerifier: r.mouseUpEventVerifier ?? s,
|
|
3550
|
-
draggingEdgeResolver: r.draggingEdgeResolver ??
|
|
3577
|
+
draggingEdgeResolver: r.draggingEdgeResolver ?? n,
|
|
3551
3578
|
draggingEdgeShapeFactory: r.draggingEdgeShape !== void 0 ? le(r.draggingEdgeShape) : null,
|
|
3552
|
-
onAfterEdgeReattached: ((c = r.events) == null ? void 0 : c.onAfterEdgeReattached) ??
|
|
3553
|
-
onEdgeReattachInterrupted: ((
|
|
3554
|
-
onEdgeReattachPrevented: ((
|
|
3579
|
+
onAfterEdgeReattached: ((c = r.events) == null ? void 0 : c.onAfterEdgeReattached) ?? a,
|
|
3580
|
+
onEdgeReattachInterrupted: ((g = r.events) == null ? void 0 : g.onEdgeReattachInterrupted) ?? d,
|
|
3581
|
+
onEdgeReattachPrevented: ((u = r.events) == null ? void 0 : u.onEdgeReattachPrevented) ?? h
|
|
3555
3582
|
};
|
|
3556
3583
|
}, qt = (r) => ({
|
|
3557
3584
|
nodeVerticalRadius: r.nodeContainingRadius.vertical,
|
|
@@ -3586,10 +3613,10 @@ class ze {
|
|
|
3586
3613
|
const t = /* @__PURE__ */ new Map();
|
|
3587
3614
|
return this.graph.getAllNodeIds().forEach((s) => {
|
|
3588
3615
|
t.set(s, { x: 0, y: 0 });
|
|
3589
|
-
}), this.nodeForcesApplicationStrategy.apply(this.currentCoords, t), this.applyEdgeForces(t), this.currentCoords.forEach((s,
|
|
3590
|
-
const
|
|
3591
|
-
x:
|
|
3592
|
-
y:
|
|
3616
|
+
}), this.nodeForcesApplicationStrategy.apply(this.currentCoords, t), this.applyEdgeForces(t), this.currentCoords.forEach((s, n) => {
|
|
3617
|
+
const a = t.get(n), h = {
|
|
3618
|
+
x: a.x / this.nodeMass * this.dt,
|
|
3619
|
+
y: a.y / this.nodeMass * this.dt
|
|
3593
3620
|
};
|
|
3594
3621
|
e = Math.max(
|
|
3595
3622
|
e,
|
|
@@ -3601,11 +3628,11 @@ class ze {
|
|
|
3601
3628
|
}
|
|
3602
3629
|
applyEdgeForces(e) {
|
|
3603
3630
|
this.graph.getAllEdgeIds().forEach((t) => {
|
|
3604
|
-
const o = this.graph.getEdge(t), s = this.graph.getPort(o.from),
|
|
3605
|
-
|
|
3631
|
+
const o = this.graph.getEdge(t), s = this.graph.getPort(o.from), n = this.graph.getPort(o.to), a = this.currentCoords.get(s.nodeId), h = this.currentCoords.get(n.nodeId), d = this.distanceVectorGenerator.create(
|
|
3632
|
+
a,
|
|
3606
3633
|
h
|
|
3607
|
-
),
|
|
3608
|
-
p.x +=
|
|
3634
|
+
), g = (d.d - this.edgeEquilibriumLength) * this.edgeStiffness, u = d.ex * g, l = d.ey * g, p = e.get(s.nodeId), y = e.get(n.nodeId);
|
|
3635
|
+
p.x += u, p.y += l, y.x -= u, y.y -= l;
|
|
3609
3636
|
});
|
|
3610
3637
|
}
|
|
3611
3638
|
}
|
|
@@ -3615,8 +3642,8 @@ class ke {
|
|
|
3615
3642
|
this.rand = e;
|
|
3616
3643
|
}
|
|
3617
3644
|
create(e, t) {
|
|
3618
|
-
const o = t.x - e.x, s = t.y - e.y,
|
|
3619
|
-
if (
|
|
3645
|
+
const o = t.x - e.x, s = t.y - e.y, n = o * o + s * s;
|
|
3646
|
+
if (n === 0) {
|
|
3620
3647
|
const c = this.PI2 * this.rand();
|
|
3621
3648
|
return {
|
|
3622
3649
|
ex: Math.cos(c),
|
|
@@ -3624,8 +3651,8 @@ class ke {
|
|
|
3624
3651
|
d: 0
|
|
3625
3652
|
};
|
|
3626
3653
|
}
|
|
3627
|
-
const
|
|
3628
|
-
return { ex: h, ey: d, d:
|
|
3654
|
+
const a = Math.sqrt(n), h = o / a, d = s / a;
|
|
3655
|
+
return { ex: h, ey: d, d: a };
|
|
3629
3656
|
}
|
|
3630
3657
|
}
|
|
3631
3658
|
const He = (r) => {
|
|
@@ -3643,19 +3670,19 @@ class rr {
|
|
|
3643
3670
|
}
|
|
3644
3671
|
apply(e, t) {
|
|
3645
3672
|
const o = Array.from(t.keys()), s = o.length;
|
|
3646
|
-
for (let
|
|
3647
|
-
const
|
|
3648
|
-
for (let h =
|
|
3649
|
-
const d = o[h], c = e.get(
|
|
3673
|
+
for (let n = 0; n < s; n++) {
|
|
3674
|
+
const a = o[n];
|
|
3675
|
+
for (let h = n + 1; h < s; h++) {
|
|
3676
|
+
const d = o[h], c = e.get(a), g = e.get(d), u = this.distanceVectorGenerator.create(
|
|
3650
3677
|
c,
|
|
3651
|
-
|
|
3678
|
+
g
|
|
3652
3679
|
), l = He({
|
|
3653
3680
|
coefficient: 1,
|
|
3654
3681
|
sourceCharge: this.nodeCharge,
|
|
3655
3682
|
targetCharge: this.nodeCharge,
|
|
3656
|
-
distance:
|
|
3683
|
+
distance: u.d,
|
|
3657
3684
|
maxForce: this.maxForce
|
|
3658
|
-
}), p = l *
|
|
3685
|
+
}), p = l * u.ex, y = l * u.ey, w = t.get(a), f = t.get(d);
|
|
3659
3686
|
w.x -= p, w.y -= y, f.x += p, f.y += y;
|
|
3660
3687
|
}
|
|
3661
3688
|
}
|
|
@@ -3672,7 +3699,7 @@ const or = (r) => {
|
|
|
3672
3699
|
r.forEach((d) => {
|
|
3673
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);
|
|
3674
3701
|
});
|
|
3675
|
-
const
|
|
3702
|
+
const n = t - e, a = s - o, h = Math.max(n, a);
|
|
3676
3703
|
return {
|
|
3677
3704
|
centerX: (e + t) / 2,
|
|
3678
3705
|
centerY: (o + s) / 2,
|
|
@@ -3708,15 +3735,15 @@ class sr {
|
|
|
3708
3735
|
const o = [];
|
|
3709
3736
|
for (; t.length > 0; ) {
|
|
3710
3737
|
const s = t.pop();
|
|
3711
|
-
this.processNode(s).forEach((
|
|
3712
|
-
o.push(
|
|
3738
|
+
this.processNode(s).forEach((a) => {
|
|
3739
|
+
o.push(a);
|
|
3713
3740
|
});
|
|
3714
3741
|
}
|
|
3715
3742
|
t = o;
|
|
3716
3743
|
}
|
|
3717
3744
|
this.sortedParentNodes.reverse().forEach((o) => {
|
|
3718
|
-
let s = 0,
|
|
3719
|
-
o.lb !== null && (
|
|
3745
|
+
let s = 0, n = 0, a = 0, h = 0;
|
|
3746
|
+
o.lb !== null && (a += o.lb.totalMass, h += o.lb.totalCharge, s += o.lb.chargeCenter.x * o.lb.totalCharge, n += o.lb.chargeCenter.y * o.lb.totalCharge), o.lt !== null && (a += o.lt.totalMass, h += o.lt.totalCharge, s += o.lt.chargeCenter.x * o.lt.totalCharge, n += o.lt.chargeCenter.y * o.lt.totalCharge), o.rb !== null && (a += o.rb.totalMass, h += o.rb.totalCharge, s += o.rb.chargeCenter.x * o.rb.totalCharge, n += o.rb.chargeCenter.y * o.rb.totalCharge), o.rt !== null && (a += o.rt.totalMass, h += o.rt.totalCharge, s += o.rt.chargeCenter.x * o.rt.totalCharge, n += o.rt.chargeCenter.y * o.rt.totalCharge), o.totalMass = a, o.totalCharge = h, o.chargeCenter.x = s / h, o.chargeCenter.y = n / h;
|
|
3720
3747
|
});
|
|
3721
3748
|
}
|
|
3722
3749
|
getRoot() {
|
|
@@ -3732,21 +3759,21 @@ class sr {
|
|
|
3732
3759
|
if (s < this.areaRadiusThreshold)
|
|
3733
3760
|
return this.setLeaf(e), [];
|
|
3734
3761
|
this.sortedParentNodes.push(e);
|
|
3735
|
-
const
|
|
3762
|
+
const n = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), c = s / 2;
|
|
3736
3763
|
e.nodeIds.forEach((l) => {
|
|
3737
3764
|
const { x: p, y } = this.coords.get(l);
|
|
3738
|
-
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 ? a.add(l) : n.add(l), e.nodeIds.delete(l);
|
|
3739
3766
|
});
|
|
3740
|
-
const
|
|
3767
|
+
const g = {
|
|
3741
3768
|
parent: e,
|
|
3742
3769
|
lb: null,
|
|
3743
3770
|
lt: null,
|
|
3744
3771
|
rb: null,
|
|
3745
3772
|
rt: null
|
|
3746
|
-
},
|
|
3747
|
-
if (
|
|
3773
|
+
}, u = [];
|
|
3774
|
+
if (n.size > 0) {
|
|
3748
3775
|
const l = {
|
|
3749
|
-
nodeIds:
|
|
3776
|
+
nodeIds: n,
|
|
3750
3777
|
totalMass: 0,
|
|
3751
3778
|
totalCharge: 0,
|
|
3752
3779
|
chargeCenter: {
|
|
@@ -3758,13 +3785,13 @@ class sr {
|
|
|
3758
3785
|
centerY: o + c,
|
|
3759
3786
|
radius: c
|
|
3760
3787
|
},
|
|
3761
|
-
...
|
|
3788
|
+
...g
|
|
3762
3789
|
};
|
|
3763
|
-
e.rt = l,
|
|
3790
|
+
e.rt = l, u.push(l);
|
|
3764
3791
|
}
|
|
3765
|
-
if (
|
|
3792
|
+
if (a.size > 0) {
|
|
3766
3793
|
const l = {
|
|
3767
|
-
nodeIds:
|
|
3794
|
+
nodeIds: a,
|
|
3768
3795
|
totalMass: 0,
|
|
3769
3796
|
totalCharge: 0,
|
|
3770
3797
|
chargeCenter: {
|
|
@@ -3776,9 +3803,9 @@ class sr {
|
|
|
3776
3803
|
centerY: o - c,
|
|
3777
3804
|
radius: c
|
|
3778
3805
|
},
|
|
3779
|
-
...
|
|
3806
|
+
...g
|
|
3780
3807
|
};
|
|
3781
|
-
e.rb = l,
|
|
3808
|
+
e.rb = l, u.push(l);
|
|
3782
3809
|
}
|
|
3783
3810
|
if (h.size > 0) {
|
|
3784
3811
|
const l = {
|
|
@@ -3794,9 +3821,9 @@ class sr {
|
|
|
3794
3821
|
centerY: o + c,
|
|
3795
3822
|
radius: c
|
|
3796
3823
|
},
|
|
3797
|
-
...
|
|
3824
|
+
...g
|
|
3798
3825
|
};
|
|
3799
|
-
e.lt = l,
|
|
3826
|
+
e.lt = l, u.push(l);
|
|
3800
3827
|
}
|
|
3801
3828
|
if (d.size > 0) {
|
|
3802
3829
|
const l = {
|
|
@@ -3812,11 +3839,11 @@ class sr {
|
|
|
3812
3839
|
centerY: o - c,
|
|
3813
3840
|
radius: c
|
|
3814
3841
|
},
|
|
3815
|
-
...
|
|
3842
|
+
...g
|
|
3816
3843
|
};
|
|
3817
|
-
e.lb = l,
|
|
3844
|
+
e.lb = l, u.push(l);
|
|
3818
3845
|
}
|
|
3819
|
-
return
|
|
3846
|
+
return u;
|
|
3820
3847
|
}
|
|
3821
3848
|
setLeaf(e) {
|
|
3822
3849
|
e.totalMass = this.nodeMass * e.nodeIds.size, e.totalCharge = this.nodeCharge * e.nodeIds.size, e.chargeCenter = this.calculateLeafChargeCenter(e.nodeIds), e.nodeIds.forEach((t) => {
|
|
@@ -3831,8 +3858,8 @@ class sr {
|
|
|
3831
3858
|
};
|
|
3832
3859
|
let t = 0, o = 0;
|
|
3833
3860
|
return e.forEach((s) => {
|
|
3834
|
-
const
|
|
3835
|
-
t +=
|
|
3861
|
+
const n = this.coords.get(s);
|
|
3862
|
+
t += n.x, o += n.y;
|
|
3836
3863
|
}), { x: t / e.size, y: o / e.size };
|
|
3837
3864
|
}
|
|
3838
3865
|
}
|
|
@@ -3855,17 +3882,17 @@ class ir {
|
|
|
3855
3882
|
nodeMass: this.nodeMass,
|
|
3856
3883
|
nodeCharge: this.nodeCharge
|
|
3857
3884
|
});
|
|
3858
|
-
e.forEach((
|
|
3885
|
+
e.forEach((n, a) => {
|
|
3859
3886
|
const h = this.calculateForceForNode(
|
|
3860
|
-
s.getLeaf(
|
|
3861
|
-
|
|
3887
|
+
s.getLeaf(a),
|
|
3888
|
+
a,
|
|
3862
3889
|
e
|
|
3863
|
-
), d = t.get(
|
|
3890
|
+
), d = t.get(a);
|
|
3864
3891
|
this.applyForce(d, h);
|
|
3865
3892
|
});
|
|
3866
3893
|
}
|
|
3867
3894
|
calculateForceForNode(e, t, o) {
|
|
3868
|
-
const s = o.get(t),
|
|
3895
|
+
const s = o.get(t), n = { x: 0, y: 0 };
|
|
3869
3896
|
e.nodeIds.forEach((h) => {
|
|
3870
3897
|
if (h !== t) {
|
|
3871
3898
|
const d = o.get(h), c = this.calculateNodeRepulsiveForce({
|
|
@@ -3874,72 +3901,72 @@ class ir {
|
|
|
3874
3901
|
sourceCoords: d,
|
|
3875
3902
|
targetCoords: s
|
|
3876
3903
|
});
|
|
3877
|
-
this.applyForce(
|
|
3904
|
+
this.applyForce(n, c);
|
|
3878
3905
|
}
|
|
3879
3906
|
});
|
|
3880
|
-
let
|
|
3881
|
-
for (;
|
|
3882
|
-
const h =
|
|
3907
|
+
let a = e;
|
|
3908
|
+
for (; a !== null; ) {
|
|
3909
|
+
const h = a.parent;
|
|
3883
3910
|
if (h !== null) {
|
|
3884
3911
|
const d = this.distanceVectorGenerator.create(
|
|
3885
3912
|
h.chargeCenter,
|
|
3886
3913
|
s
|
|
3887
3914
|
);
|
|
3888
3915
|
h.box.radius * 2 < d.d * this.theta ? (this.tryApplyFarForce({
|
|
3889
|
-
totalForce:
|
|
3916
|
+
totalForce: n,
|
|
3890
3917
|
targetCoords: s,
|
|
3891
3918
|
target: h.lb,
|
|
3892
|
-
current:
|
|
3919
|
+
current: a
|
|
3893
3920
|
}), this.tryApplyFarForce({
|
|
3894
|
-
totalForce:
|
|
3921
|
+
totalForce: n,
|
|
3895
3922
|
targetCoords: s,
|
|
3896
3923
|
target: h.rb,
|
|
3897
|
-
current:
|
|
3924
|
+
current: a
|
|
3898
3925
|
}), this.tryApplyFarForce({
|
|
3899
|
-
totalForce:
|
|
3926
|
+
totalForce: n,
|
|
3900
3927
|
targetCoords: s,
|
|
3901
3928
|
target: h.rt,
|
|
3902
|
-
current:
|
|
3929
|
+
current: a
|
|
3903
3930
|
}), this.tryApplyFarForce({
|
|
3904
|
-
totalForce:
|
|
3931
|
+
totalForce: n,
|
|
3905
3932
|
targetCoords: s,
|
|
3906
3933
|
target: h.lt,
|
|
3907
|
-
current:
|
|
3934
|
+
current: a
|
|
3908
3935
|
})) : (this.tryApplyNearForce({
|
|
3909
|
-
totalForce:
|
|
3936
|
+
totalForce: n,
|
|
3910
3937
|
targetCoords: s,
|
|
3911
3938
|
target: h.lb,
|
|
3912
|
-
current:
|
|
3939
|
+
current: a,
|
|
3913
3940
|
nodesCoords: o
|
|
3914
3941
|
}), this.tryApplyNearForce({
|
|
3915
|
-
totalForce:
|
|
3942
|
+
totalForce: n,
|
|
3916
3943
|
targetCoords: s,
|
|
3917
3944
|
target: h.rb,
|
|
3918
|
-
current:
|
|
3945
|
+
current: a,
|
|
3919
3946
|
nodesCoords: o
|
|
3920
3947
|
}), this.tryApplyNearForce({
|
|
3921
|
-
totalForce:
|
|
3948
|
+
totalForce: n,
|
|
3922
3949
|
targetCoords: s,
|
|
3923
3950
|
target: h.rt,
|
|
3924
|
-
current:
|
|
3951
|
+
current: a,
|
|
3925
3952
|
nodesCoords: o
|
|
3926
3953
|
}), this.tryApplyNearForce({
|
|
3927
|
-
totalForce:
|
|
3954
|
+
totalForce: n,
|
|
3928
3955
|
targetCoords: s,
|
|
3929
3956
|
target: h.lt,
|
|
3930
|
-
current:
|
|
3957
|
+
current: a,
|
|
3931
3958
|
nodesCoords: o
|
|
3932
3959
|
}));
|
|
3933
3960
|
}
|
|
3934
|
-
|
|
3961
|
+
a = a.parent;
|
|
3935
3962
|
}
|
|
3936
|
-
return
|
|
3963
|
+
return n;
|
|
3937
3964
|
}
|
|
3938
3965
|
calculateExactForce(e, t, o) {
|
|
3939
|
-
const s = { x: 0, y: 0 },
|
|
3940
|
-
for (;
|
|
3941
|
-
const
|
|
3942
|
-
|
|
3966
|
+
const s = { x: 0, y: 0 }, n = [e];
|
|
3967
|
+
for (; n.length > 0; ) {
|
|
3968
|
+
const a = n.pop();
|
|
3969
|
+
a.nodeIds.forEach((h) => {
|
|
3943
3970
|
const d = o.get(h), c = this.calculateNodeRepulsiveForce({
|
|
3944
3971
|
sourceCharge: this.nodeCharge,
|
|
3945
3972
|
targetCharge: this.nodeCharge,
|
|
@@ -3947,7 +3974,7 @@ class ir {
|
|
|
3947
3974
|
targetCoords: t
|
|
3948
3975
|
});
|
|
3949
3976
|
this.applyForce(s, c);
|
|
3950
|
-
}),
|
|
3977
|
+
}), a.lb !== null && n.push(a.lb), a.rb !== null && n.push(a.rb), a.lt !== null && n.push(a.lt), a.rt !== null && n.push(a.rt);
|
|
3951
3978
|
}
|
|
3952
3979
|
return s;
|
|
3953
3980
|
}
|
|
@@ -4019,18 +4046,18 @@ class Xe {
|
|
|
4019
4046
|
this.rand = e.rand, this.sparsity = e.sparsity;
|
|
4020
4047
|
}
|
|
4021
4048
|
calculateCoordinates(e) {
|
|
4022
|
-
const { graph: t, viewport: o } = e, s = /* @__PURE__ */ new Map(),
|
|
4049
|
+
const { graph: t, viewport: o } = e, s = /* @__PURE__ */ new Map(), n = t.getAllNodeIds().filter((y) => {
|
|
4023
4050
|
const w = t.getNode(y);
|
|
4024
4051
|
return w.x === null || w.y === null;
|
|
4025
|
-
}),
|
|
4026
|
-
x:
|
|
4027
|
-
y:
|
|
4052
|
+
}), a = Math.sqrt(n.length) * this.sparsity, { width: h, height: d } = o.getDimensions(), c = { x: h / 2, y: d / 2 }, g = o.createContentCoords(c), u = a / 2, l = {
|
|
4053
|
+
x: g.x - u,
|
|
4054
|
+
y: g.y - u
|
|
4028
4055
|
};
|
|
4029
4056
|
return t.getAllNodeIds().forEach((y) => {
|
|
4030
4057
|
const w = t.getNode(y);
|
|
4031
4058
|
s.set(y, {
|
|
4032
|
-
x: w.x ?? l.x +
|
|
4033
|
-
y: w.y ?? l.y +
|
|
4059
|
+
x: w.x ?? l.x + a * this.rand(),
|
|
4060
|
+
y: w.y ?? l.y + a * this.rand()
|
|
4034
4061
|
});
|
|
4035
4062
|
}), s;
|
|
4036
4063
|
}
|
|
@@ -4064,7 +4091,7 @@ class nr {
|
|
|
4064
4091
|
graph: t,
|
|
4065
4092
|
viewport: o
|
|
4066
4093
|
});
|
|
4067
|
-
for (let
|
|
4094
|
+
for (let n = 0; n < this.maxIterations && !(new ze(
|
|
4068
4095
|
t,
|
|
4069
4096
|
s,
|
|
4070
4097
|
{
|
|
@@ -4075,7 +4102,7 @@ class nr {
|
|
|
4075
4102
|
edgeEquilibriumLength: this.edgeEquilibriumLength,
|
|
4076
4103
|
edgeStiffness: this.edgeStiffness
|
|
4077
4104
|
}
|
|
4078
|
-
).apply() < this.convergenceVelocity);
|
|
4105
|
+
).apply() < this.convergenceVelocity); n++)
|
|
4079
4106
|
;
|
|
4080
4107
|
return s;
|
|
4081
4108
|
}
|
|
@@ -4100,30 +4127,30 @@ class ar {
|
|
|
4100
4127
|
this.forest.add({ root: t, sequence: o });
|
|
4101
4128
|
let s = [t];
|
|
4102
4129
|
for (this.remainingNodeIds.delete(t.nodeId); s.length > 0; ) {
|
|
4103
|
-
const
|
|
4104
|
-
s.forEach((
|
|
4105
|
-
o.push(
|
|
4106
|
-
const h = this.graph.getNodeOutgoingEdgeIds(
|
|
4107
|
-
const
|
|
4108
|
-
return this.graph.getPort(
|
|
4109
|
-
}), d = this.graph.getNodeIncomingEdgeIds(
|
|
4110
|
-
const
|
|
4111
|
-
return this.graph.getPort(
|
|
4130
|
+
const n = [];
|
|
4131
|
+
s.forEach((a) => {
|
|
4132
|
+
o.push(a);
|
|
4133
|
+
const h = this.graph.getNodeOutgoingEdgeIds(a.nodeId).map((g) => {
|
|
4134
|
+
const u = this.graph.getEdge(g);
|
|
4135
|
+
return this.graph.getPort(u.to).nodeId;
|
|
4136
|
+
}), d = this.graph.getNodeIncomingEdgeIds(a.nodeId).map((g) => {
|
|
4137
|
+
const u = this.graph.getEdge(g);
|
|
4138
|
+
return this.graph.getPort(u.from).nodeId;
|
|
4112
4139
|
});
|
|
4113
4140
|
(/* @__PURE__ */ new Set([
|
|
4114
4141
|
...h,
|
|
4115
4142
|
...d
|
|
4116
|
-
])).forEach((
|
|
4117
|
-
if (!this.remainingNodeIds.has(
|
|
4143
|
+
])).forEach((g) => {
|
|
4144
|
+
if (!this.remainingNodeIds.has(g))
|
|
4118
4145
|
return;
|
|
4119
|
-
this.remainingNodeIds.delete(
|
|
4120
|
-
const
|
|
4121
|
-
nodeId:
|
|
4146
|
+
this.remainingNodeIds.delete(g);
|
|
4147
|
+
const u = {
|
|
4148
|
+
nodeId: g,
|
|
4122
4149
|
children: /* @__PURE__ */ new Set()
|
|
4123
4150
|
};
|
|
4124
|
-
|
|
4151
|
+
a.children.add(u), n.push(u);
|
|
4125
4152
|
});
|
|
4126
|
-
}), s =
|
|
4153
|
+
}), s = n;
|
|
4127
4154
|
}
|
|
4128
4155
|
}
|
|
4129
4156
|
}
|
|
@@ -4133,37 +4160,37 @@ class hr {
|
|
|
4133
4160
|
}
|
|
4134
4161
|
generate(e) {
|
|
4135
4162
|
let t = 0;
|
|
4136
|
-
const o = [], s = e.length - 1,
|
|
4163
|
+
const o = [], s = e.length - 1, n = [];
|
|
4137
4164
|
e.forEach((h, d) => {
|
|
4138
|
-
if (t += this.params.spaceAroundRadius, h.forEach((c,
|
|
4139
|
-
|
|
4165
|
+
if (t += this.params.spaceAroundRadius, h.forEach((c, g) => {
|
|
4166
|
+
n[g] === void 0 ? n[g] = {
|
|
4140
4167
|
start: t + c.start,
|
|
4141
4168
|
end: t + c.end
|
|
4142
|
-
} :
|
|
4169
|
+
} : n[g].end = t + c.end;
|
|
4143
4170
|
}), o.push(t), d !== s) {
|
|
4144
|
-
const c = e[d + 1],
|
|
4145
|
-
start:
|
|
4146
|
-
end:
|
|
4171
|
+
const c = e[d + 1], g = n.map((u) => ({
|
|
4172
|
+
start: u.start - t,
|
|
4173
|
+
end: u.end - t
|
|
4147
4174
|
}));
|
|
4148
|
-
t += this.calculateMaxDiff(
|
|
4175
|
+
t += this.calculateMaxDiff(g, c);
|
|
4149
4176
|
}
|
|
4150
4177
|
t += this.params.spaceAroundRadius;
|
|
4151
4178
|
});
|
|
4152
|
-
const
|
|
4179
|
+
const a = t / 2;
|
|
4153
4180
|
return {
|
|
4154
|
-
childOffsets: o.map((h) => h -
|
|
4155
|
-
subtreeSpans:
|
|
4156
|
-
start: h.start -
|
|
4157
|
-
end: h.end -
|
|
4181
|
+
childOffsets: o.map((h) => h - a),
|
|
4182
|
+
subtreeSpans: n.map((h) => ({
|
|
4183
|
+
start: h.start - a,
|
|
4184
|
+
end: h.end - a
|
|
4158
4185
|
}))
|
|
4159
4186
|
};
|
|
4160
4187
|
}
|
|
4161
4188
|
calculateMaxDiff(e, t) {
|
|
4162
4189
|
let o = 0;
|
|
4163
4190
|
const s = Math.min(e.length, t.length);
|
|
4164
|
-
for (let
|
|
4165
|
-
const
|
|
4166
|
-
o = Math.max(o,
|
|
4191
|
+
for (let n = 0; n < s; n++) {
|
|
4192
|
+
const a = e[n].end - t[n].start;
|
|
4193
|
+
o = Math.max(o, a);
|
|
4167
4194
|
}
|
|
4168
4195
|
return o - 2 * this.params.spaceAroundRadius;
|
|
4169
4196
|
}
|
|
@@ -4176,17 +4203,17 @@ class dr {
|
|
|
4176
4203
|
const o = t.spaceAroundRadius, s = new hr({
|
|
4177
4204
|
spaceAroundRadius: o
|
|
4178
4205
|
});
|
|
4179
|
-
[...this.tree.sequence].reverse().forEach((
|
|
4180
|
-
const
|
|
4206
|
+
[...this.tree.sequence].reverse().forEach((n) => {
|
|
4207
|
+
const a = Array.from(n.children).map(
|
|
4181
4208
|
(c) => this.treeSpans.get(c.nodeId)
|
|
4182
|
-
), h = s.generate(
|
|
4209
|
+
), h = s.generate(a);
|
|
4183
4210
|
let d = 0;
|
|
4184
|
-
|
|
4211
|
+
n.children.forEach((c) => {
|
|
4185
4212
|
this.offsets.set(c.nodeId, h.childOffsets[d]), d++;
|
|
4186
|
-
}), this.treeSpans.set(
|
|
4213
|
+
}), this.treeSpans.set(n.nodeId, [
|
|
4187
4214
|
{ start: -o, end: o },
|
|
4188
4215
|
...h.subtreeSpans
|
|
4189
|
-
]),
|
|
4216
|
+
]), n.children.forEach((c) => {
|
|
4190
4217
|
this.treeSpans.delete(c.nodeId);
|
|
4191
4218
|
});
|
|
4192
4219
|
}), this.offsets.set(this.tree.root.nodeId, 0);
|
|
@@ -4201,27 +4228,27 @@ class cr {
|
|
|
4201
4228
|
}
|
|
4202
4229
|
calculateCoordinates(e) {
|
|
4203
4230
|
const t = /* @__PURE__ */ new Map(), s = new ar(e.graph).generate();
|
|
4204
|
-
let
|
|
4205
|
-
return s.forEach((
|
|
4206
|
-
t.set(
|
|
4207
|
-
const d = new dr(
|
|
4231
|
+
let n = 0;
|
|
4232
|
+
return s.forEach((a) => {
|
|
4233
|
+
t.set(a.root.nodeId, { x: n, y: 0 });
|
|
4234
|
+
const d = new dr(a, {
|
|
4208
4235
|
spaceAroundRadius: this.params.layerSpace / 2
|
|
4209
4236
|
}).generate();
|
|
4210
|
-
let c = [
|
|
4237
|
+
let c = [a.root];
|
|
4211
4238
|
for (; c.length > 0; ) {
|
|
4212
|
-
const
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
const p = t.get(
|
|
4239
|
+
const g = [];
|
|
4240
|
+
n += this.params.layerWidth, c.forEach((u) => {
|
|
4241
|
+
u.children.forEach((l) => {
|
|
4242
|
+
const p = t.get(u.nodeId).y;
|
|
4216
4243
|
t.set(l.nodeId, {
|
|
4217
4244
|
y: p + d.get(l.nodeId),
|
|
4218
|
-
x:
|
|
4219
|
-
}),
|
|
4245
|
+
x: n
|
|
4246
|
+
}), g.push(l);
|
|
4220
4247
|
});
|
|
4221
|
-
}), c =
|
|
4248
|
+
}), c = g;
|
|
4222
4249
|
}
|
|
4223
|
-
}), t.forEach((
|
|
4224
|
-
t.set(h, this.params.transform(
|
|
4250
|
+
}), t.forEach((a, h) => {
|
|
4251
|
+
t.set(h, this.params.transform(a));
|
|
4225
4252
|
}), t;
|
|
4226
4253
|
}
|
|
4227
4254
|
}
|
|
@@ -4249,13 +4276,13 @@ class lr {
|
|
|
4249
4276
|
});
|
|
4250
4277
|
}
|
|
4251
4278
|
calculateNextCoordinates(e) {
|
|
4252
|
-
const { graph: t, viewport: o, dt: s } = e,
|
|
4279
|
+
const { graph: t, viewport: o, dt: s } = e, n = this.fillerLayoutAlgorithm.calculateCoordinates({
|
|
4253
4280
|
graph: t,
|
|
4254
4281
|
viewport: o
|
|
4255
4282
|
});
|
|
4256
4283
|
return new ze(
|
|
4257
4284
|
t,
|
|
4258
|
-
|
|
4285
|
+
n,
|
|
4259
4286
|
{
|
|
4260
4287
|
distanceVectorGenerator: this.distanceVectorGenerator,
|
|
4261
4288
|
nodeForcesApplicationStrategy: this.nodeForcesApplicationStrategy,
|
|
@@ -4265,15 +4292,15 @@ class lr {
|
|
|
4265
4292
|
edgeStiffness: this.edgeStiffness
|
|
4266
4293
|
}
|
|
4267
4294
|
).apply() < this.convergenceVelocity && !t.getAllNodeIds().some((c) => {
|
|
4268
|
-
const
|
|
4269
|
-
return
|
|
4270
|
-
}) ? /* @__PURE__ */ new Map() :
|
|
4295
|
+
const g = t.getNode(c);
|
|
4296
|
+
return g.x === null || g.y === null;
|
|
4297
|
+
}) ? /* @__PURE__ */ new Map() : n;
|
|
4271
4298
|
}
|
|
4272
4299
|
}
|
|
4273
4300
|
const Ge = (r) => {
|
|
4274
4301
|
let e = 1779033703, t = 3144134277, o = 1013904242, s = 2773480762;
|
|
4275
|
-
for (let
|
|
4276
|
-
|
|
4302
|
+
for (let n = 0, a; n < r.length; n++)
|
|
4303
|
+
a = r.charCodeAt(n), e = t ^ Math.imul(e ^ a, 597399067), t = o ^ Math.imul(t ^ a, 2869860233), o = s ^ Math.imul(o ^ a, 951274213), s = e ^ Math.imul(s ^ a, 2716044179);
|
|
4277
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];
|
|
4278
4305
|
}, je = (r, e, t, o) => function() {
|
|
4279
4306
|
r |= 0, e |= 0, t |= 0, o |= 0;
|
|
@@ -4356,14 +4383,14 @@ const Ge = (r) => {
|
|
|
4356
4383
|
e: r.d * e.b + r.e * e.e,
|
|
4357
4384
|
f: r.d * e.c + r.e * e.f + r.f
|
|
4358
4385
|
}), yr = (r) => {
|
|
4359
|
-
const { a: e, b: t, c: o, d: s, e:
|
|
4386
|
+
const { a: e, b: t, c: o, d: s, e: n, f: a } = r, h = e * n - t * s;
|
|
4360
4387
|
return {
|
|
4361
|
-
a:
|
|
4388
|
+
a: n / h,
|
|
4362
4389
|
b: -t / h,
|
|
4363
|
-
c: (t *
|
|
4390
|
+
c: (t * a - o * n) / h,
|
|
4364
4391
|
d: -s / h,
|
|
4365
4392
|
e: e / h,
|
|
4366
|
-
f: (o * s - e *
|
|
4393
|
+
f: (o * s - e * a) / h
|
|
4367
4394
|
};
|
|
4368
4395
|
};
|
|
4369
4396
|
class wr {
|
|
@@ -4471,13 +4498,13 @@ const fr = (r) => {
|
|
|
4471
4498
|
};
|
|
4472
4499
|
const o = new wr();
|
|
4473
4500
|
return e.forEach((s) => {
|
|
4474
|
-
const
|
|
4475
|
-
t = z(t,
|
|
4501
|
+
const n = o.resolve(s);
|
|
4502
|
+
t = z(t, n);
|
|
4476
4503
|
}), (s) => {
|
|
4477
|
-
const { x:
|
|
4504
|
+
const { x: n, y: a } = s;
|
|
4478
4505
|
return {
|
|
4479
|
-
x: t.a *
|
|
4480
|
-
y: t.d *
|
|
4506
|
+
x: t.a * n + t.b * a + t.c,
|
|
4507
|
+
y: t.d * n + t.e * a + t.f
|
|
4481
4508
|
};
|
|
4482
4509
|
};
|
|
4483
4510
|
}, vr = (r) => {
|
|
@@ -4548,7 +4575,7 @@ const fr = (r) => {
|
|
|
4548
4575
|
edgesPriorityFn: o
|
|
4549
4576
|
};
|
|
4550
4577
|
}, Nr = (r) => {
|
|
4551
|
-
var t, o, s,
|
|
4578
|
+
var t, o, s, n, a;
|
|
4552
4579
|
const e = br(
|
|
4553
4580
|
(t = r.nodes) == null ? void 0 : t.priority,
|
|
4554
4581
|
(o = r.edges) == null ? void 0 : o.priority
|
|
@@ -4559,21 +4586,22 @@ const fr = (r) => {
|
|
|
4559
4586
|
priorityFn: e.nodesPriorityFn
|
|
4560
4587
|
},
|
|
4561
4588
|
ports: {
|
|
4562
|
-
direction: ((
|
|
4589
|
+
direction: ((n = r.ports) == null ? void 0 : n.direction) ?? 0
|
|
4563
4590
|
},
|
|
4564
4591
|
edges: {
|
|
4565
|
-
shapeFactory: le(((
|
|
4592
|
+
shapeFactory: le(((a = r.edges) == null ? void 0 : a.shape) ?? {}),
|
|
4566
4593
|
priorityFn: e.edgesPriorityFn
|
|
4567
4594
|
}
|
|
4568
4595
|
};
|
|
4569
4596
|
}, Pr = (r) => r.applyOn.type === "topologyChangeSchedule" ? r.applyOn.schedule : re, Cr = (r) => {
|
|
4570
|
-
var o, s;
|
|
4597
|
+
var o, s, n;
|
|
4571
4598
|
const { canvasDefaults: e } = r, t = r.hasLayout ? Pr(r.layoutParams) : re;
|
|
4572
4599
|
return {
|
|
4573
4600
|
focus: {
|
|
4574
4601
|
contentOffset: ((o = e.focus) == null ? void 0 : o.contentOffset) ?? 100,
|
|
4575
4602
|
minContentScale: ((s = e.focus) == null ? void 0 : s.minContentScale) ?? 0,
|
|
4576
|
-
schedule: t
|
|
4603
|
+
schedule: t,
|
|
4604
|
+
animationDuration: ((n = e.focus) == null ? void 0 : n.animationDuration) ?? 0
|
|
4577
4605
|
}
|
|
4578
4606
|
};
|
|
4579
4607
|
};
|
|
@@ -4642,12 +4670,12 @@ class Dr {
|
|
|
4642
4670
|
o.main,
|
|
4643
4671
|
t,
|
|
4644
4672
|
e
|
|
4645
|
-
),
|
|
4673
|
+
), n = Nr(
|
|
4646
4674
|
this.canvasDefaults
|
|
4647
|
-
),
|
|
4675
|
+
), a = new Ve(
|
|
4648
4676
|
t,
|
|
4649
4677
|
s,
|
|
4650
|
-
|
|
4678
|
+
n
|
|
4651
4679
|
), h = xr(this.layoutConfig), d = Cr({
|
|
4652
4680
|
canvasDefaults: this.canvasDefaults,
|
|
4653
4681
|
hasLayout: this.hasLayout,
|
|
@@ -4655,11 +4683,12 @@ class Dr {
|
|
|
4655
4683
|
}), c = new Oe(
|
|
4656
4684
|
t,
|
|
4657
4685
|
e,
|
|
4658
|
-
d
|
|
4659
|
-
|
|
4660
|
-
|
|
4686
|
+
d,
|
|
4687
|
+
this.window
|
|
4688
|
+
), g = new $e(e), u = new Ie(t), l = new Se(
|
|
4661
4689
|
u,
|
|
4662
|
-
|
|
4690
|
+
g,
|
|
4691
|
+
a,
|
|
4663
4692
|
c
|
|
4664
4693
|
);
|
|
4665
4694
|
if (this.hasBackground && ie.configure(
|
|
@@ -4681,8 +4710,8 @@ class Dr {
|
|
|
4681
4710
|
if (this.hasUserConnectablePorts) {
|
|
4682
4711
|
const y = Zt(
|
|
4683
4712
|
this.connectablePortsConfig,
|
|
4684
|
-
|
|
4685
|
-
|
|
4713
|
+
n.edges.shapeFactory,
|
|
4714
|
+
n.ports.direction
|
|
4686
4715
|
);
|
|
4687
4716
|
ne.configure(
|
|
4688
4717
|
l,
|