@html-graph/html-graph 8.12.1 → 8.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/html-graph.d.ts +11 -0
- package/dist/html-graph.js +458 -409
- package/dist/html-graph.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/html-graph.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var i = (r, e, t) =>
|
|
4
|
-
var
|
|
5
|
-
const
|
|
1
|
+
var Qe = Object.defineProperty;
|
|
2
|
+
var Ze = (r, e, t) => e in r ? Qe(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var i = (r, e, t) => Ze(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
var R = /* @__PURE__ */ ((r) => (r.Line = "line", r.NodeCycle = "node-cycle", r.PortCycle = "port-cycle", r))(R || {});
|
|
5
|
+
const _e = () => {
|
|
6
6
|
const r = document.createElement("div");
|
|
7
7
|
return r.style.width = "100%", r.style.height = "100%", r.style.position = "relative", r.style.overflow = "hidden", r;
|
|
8
|
-
},
|
|
8
|
+
}, qe = () => {
|
|
9
9
|
const r = document.createElement("div");
|
|
10
10
|
return r.style.position = "absolute", r.style.top = "0", r.style.left = "0", r.style.width = "0", r.style.height = "0", r;
|
|
11
|
-
},
|
|
11
|
+
}, et = (r) => {
|
|
12
12
|
r.style.position = "absolute", r.style.top = "0", r.style.left = "0", r.style.visibility = "hidden";
|
|
13
|
-
},
|
|
13
|
+
}, tt = (r) => {
|
|
14
14
|
r.style.removeProperty("position"), r.style.removeProperty("top"), r.style.removeProperty("left"), r.style.removeProperty("visibility"), r.style.removeProperty("transform");
|
|
15
15
|
};
|
|
16
|
-
class
|
|
16
|
+
class Ne {
|
|
17
17
|
constructor(e, t, o) {
|
|
18
|
-
i(this, "host",
|
|
19
|
-
i(this, "container",
|
|
18
|
+
i(this, "host", _e());
|
|
19
|
+
i(this, "container", qe());
|
|
20
20
|
i(this, "edgeIdToElementMap", /* @__PURE__ */ new Map());
|
|
21
21
|
i(this, "attachedNodeIds", /* @__PURE__ */ new Set());
|
|
22
22
|
i(this, "applyTransform", () => {
|
|
@@ -27,11 +27,11 @@ class be {
|
|
|
27
27
|
}
|
|
28
28
|
attachNode(e) {
|
|
29
29
|
const t = this.graphStore.getNode(e);
|
|
30
|
-
|
|
30
|
+
et(t.element), this.attachedNodeIds.add(e), this.container.appendChild(t.element), this.updateNodePosition(e), this.updateNodePriority(e), t.element.style.visibility = "visible";
|
|
31
31
|
}
|
|
32
32
|
detachNode(e) {
|
|
33
33
|
const t = this.graphStore.getNode(e);
|
|
34
|
-
|
|
34
|
+
tt(t.element), this.container.removeChild(t.element), this.attachedNodeIds.delete(e);
|
|
35
35
|
}
|
|
36
36
|
attachEdge(e) {
|
|
37
37
|
const t = this.graphStore.getEdge(e).payload.shape.svg;
|
|
@@ -72,8 +72,8 @@ class be {
|
|
|
72
72
|
h,
|
|
73
73
|
d
|
|
74
74
|
), u = this.createEdgeRenderPort(s, a, h, d);
|
|
75
|
-
let g =
|
|
76
|
-
o.element === s.element ? g =
|
|
75
|
+
let g = R.Line;
|
|
76
|
+
o.element === s.element ? g = R.PortCycle : o.nodeId === s.nodeId && (g = R.NodeCycle), t.payload.shape.render({ from: c, to: u, category: g });
|
|
77
77
|
}
|
|
78
78
|
updateEdgePriority(e) {
|
|
79
79
|
const t = this.graphStore.getEdge(e);
|
|
@@ -93,7 +93,7 @@ class be {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
class
|
|
96
|
+
class rt {
|
|
97
97
|
constructor(e) {
|
|
98
98
|
i(this, "xFrom", 1 / 0);
|
|
99
99
|
i(this, "yFrom", 1 / 0);
|
|
@@ -113,7 +113,7 @@ class ot {
|
|
|
113
113
|
return h <= this.xTo && d >= this.xFrom && c <= this.yTo && u >= this.yFrom;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
class
|
|
116
|
+
class ot {
|
|
117
117
|
constructor(e, t, o, s) {
|
|
118
118
|
i(this, "attachedNodes", /* @__PURE__ */ new Set());
|
|
119
119
|
i(this, "attachedEdges", /* @__PURE__ */ new Set());
|
|
@@ -137,7 +137,7 @@ class st {
|
|
|
137
137
|
this.handleAttachEdge(a);
|
|
138
138
|
});
|
|
139
139
|
});
|
|
140
|
-
this.htmlView = e, this.graphStore = t, this.trigger = o, this.params = s, this.renderingBox = new
|
|
140
|
+
this.htmlView = e, this.graphStore = t, this.trigger = o, this.params = s, this.renderingBox = new rt(this.graphStore), this.trigger.subscribe(this.updateViewport);
|
|
141
141
|
}
|
|
142
142
|
attachNode(e) {
|
|
143
143
|
this.renderingBox.hasNode(e) && this.handleAttachNode(e);
|
|
@@ -191,7 +191,7 @@ class st {
|
|
|
191
191
|
this.htmlView.detachEdge(e), this.attachedEdges.delete(e);
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
class
|
|
194
|
+
class st {
|
|
195
195
|
constructor(e, t) {
|
|
196
196
|
i(this, "deferredNodes", /* @__PURE__ */ new Set());
|
|
197
197
|
i(this, "deferredEdges", /* @__PURE__ */ new Set());
|
|
@@ -245,7 +245,7 @@ class it {
|
|
|
245
245
|
this.isEdgeValid(e) && (this.deferredEdges.delete(e), this.htmlView.attachEdge(e));
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
class
|
|
248
|
+
class _ {
|
|
249
249
|
constructor() {
|
|
250
250
|
i(this, "callbacks", /* @__PURE__ */ new Set());
|
|
251
251
|
}
|
|
@@ -262,10 +262,10 @@ class q {
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
const P = () => {
|
|
265
|
-
const r = new
|
|
265
|
+
const r = new _();
|
|
266
266
|
return [r, r];
|
|
267
267
|
};
|
|
268
|
-
class
|
|
268
|
+
class be {
|
|
269
269
|
constructor(e, t, o, s) {
|
|
270
270
|
i(this, "beforeDestroyEmitter");
|
|
271
271
|
i(this, "destroyed", !1);
|
|
@@ -318,7 +318,7 @@ class Pe {
|
|
|
318
318
|
this.destroyed || (this.destroyed = !0, this.beforeDestroyEmitter.emit(), this.graphController.destroy(), this.viewportController.destroy());
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
-
class
|
|
321
|
+
class it {
|
|
322
322
|
constructor() {
|
|
323
323
|
i(this, "singleToMultiMap", /* @__PURE__ */ new Map());
|
|
324
324
|
i(this, "multiToSingleMap", /* @__PURE__ */ new Map());
|
|
@@ -386,7 +386,7 @@ const N = Object.freeze({
|
|
|
386
386
|
removeNonexistentEdge: (r) => `Failed to remove edge with ID ${JSON.stringify(r)} because it does not exist`,
|
|
387
387
|
accessEdgesForNonexistentPort: (r) => `Failed to access edges for port with ID ${JSON.stringify(r)} because the port does not exist`
|
|
388
388
|
});
|
|
389
|
-
class
|
|
389
|
+
class Pe {
|
|
390
390
|
constructor() {
|
|
391
391
|
i(this, "nodes", /* @__PURE__ */ new Map());
|
|
392
392
|
i(this, "ports", /* @__PURE__ */ new Map());
|
|
@@ -395,7 +395,7 @@ class Te {
|
|
|
395
395
|
i(this, "portIncomingEdges", /* @__PURE__ */ new Map());
|
|
396
396
|
i(this, "portOutgoingEdges", /* @__PURE__ */ new Map());
|
|
397
397
|
i(this, "portCycleEdges", /* @__PURE__ */ new Map());
|
|
398
|
-
i(this, "elementPorts", new
|
|
398
|
+
i(this, "elementPorts", new it());
|
|
399
399
|
i(this, "afterNodeAddedEmitter");
|
|
400
400
|
i(this, "onAfterNodeAdded");
|
|
401
401
|
i(this, "afterNodeUpdatedEmitter");
|
|
@@ -672,22 +672,22 @@ class Te {
|
|
|
672
672
|
this.portCycleEdges.get(t).delete(e), this.portCycleEdges.get(o).delete(e), this.portIncomingEdges.get(t).delete(e), this.portIncomingEdges.get(o).delete(e), this.portOutgoingEdges.get(t).delete(e), this.portOutgoingEdges.get(o).delete(e), this.edges.delete(e);
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
|
-
const
|
|
675
|
+
const we = (r) => ({
|
|
676
676
|
scale: 1 / r.scale,
|
|
677
677
|
x: -r.x / r.scale,
|
|
678
678
|
y: -r.y / r.scale
|
|
679
|
-
}),
|
|
679
|
+
}), ye = {
|
|
680
680
|
scale: 1,
|
|
681
681
|
x: 0,
|
|
682
682
|
y: 0
|
|
683
|
-
},
|
|
683
|
+
}, fe = (r, e) => ({
|
|
684
684
|
x: r.scale * e.x + r.x,
|
|
685
685
|
y: r.scale * e.y + r.y
|
|
686
686
|
});
|
|
687
|
-
class
|
|
687
|
+
class nt {
|
|
688
688
|
constructor(e) {
|
|
689
|
-
i(this, "viewportMatrix",
|
|
690
|
-
i(this, "contentMatrix",
|
|
689
|
+
i(this, "viewportMatrix", ye);
|
|
690
|
+
i(this, "contentMatrix", ye);
|
|
691
691
|
i(this, "beforeUpdateEmitter");
|
|
692
692
|
i(this, "onBeforeUpdated");
|
|
693
693
|
i(this, "afterUpdateEmitter");
|
|
@@ -710,30 +710,30 @@ class at {
|
|
|
710
710
|
scale: e.scale ?? this.viewportMatrix.scale,
|
|
711
711
|
x: e.x ?? this.viewportMatrix.x,
|
|
712
712
|
y: e.y ?? this.viewportMatrix.y
|
|
713
|
-
}, this.beforeUpdateEmitter.emit(), this.contentMatrix =
|
|
713
|
+
}, this.beforeUpdateEmitter.emit(), this.contentMatrix = we(this.viewportMatrix), this.afterUpdateEmitter.emit();
|
|
714
714
|
}
|
|
715
715
|
patchContentMatrix(e) {
|
|
716
716
|
this.contentMatrix = {
|
|
717
717
|
scale: e.scale ?? this.contentMatrix.scale,
|
|
718
718
|
x: e.x ?? this.contentMatrix.x,
|
|
719
719
|
y: e.y ?? this.contentMatrix.y
|
|
720
|
-
}, this.beforeUpdateEmitter.emit(), this.viewportMatrix =
|
|
720
|
+
}, this.beforeUpdateEmitter.emit(), this.viewportMatrix = we(this.contentMatrix), this.afterUpdateEmitter.emit();
|
|
721
721
|
}
|
|
722
722
|
getDimensions() {
|
|
723
723
|
const { width: e, height: t } = this.host.getBoundingClientRect();
|
|
724
724
|
return { width: e, height: t };
|
|
725
725
|
}
|
|
726
726
|
createContentCoords(e) {
|
|
727
|
-
return
|
|
727
|
+
return fe(this.viewportMatrix, e);
|
|
728
728
|
}
|
|
729
729
|
createViewportCoords(e) {
|
|
730
|
-
return
|
|
730
|
+
return fe(this.contentMatrix, e);
|
|
731
731
|
}
|
|
732
732
|
destroy() {
|
|
733
733
|
this.observer.disconnect();
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
|
-
class
|
|
736
|
+
class q {
|
|
737
737
|
constructor(e) {
|
|
738
738
|
i(this, "elementToNodeId", /* @__PURE__ */ new Map());
|
|
739
739
|
i(this, "nodesResizeObserver");
|
|
@@ -759,19 +759,28 @@ class ee {
|
|
|
759
759
|
}), this.canvas.graph.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.canvas.graph.onBeforeNodeRemoved.subscribe(this.onBeforeNodeRemoved), this.canvas.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.revert);
|
|
760
760
|
}
|
|
761
761
|
static configure(e) {
|
|
762
|
-
new
|
|
762
|
+
new q(e);
|
|
763
763
|
}
|
|
764
764
|
handleNodeResize(e) {
|
|
765
765
|
const t = this.elementToNodeId.get(e);
|
|
766
766
|
this.canvas.updateNode(t);
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
|
-
const
|
|
769
|
+
const at = (r, e, t) => {
|
|
770
770
|
const { x: o, y: s, width: n, height: a } = r.getBoundingClientRect();
|
|
771
771
|
return e >= o && e <= o + n && t >= s && t <= s + a;
|
|
772
|
-
},
|
|
772
|
+
}, ht = (r, e, t) => e >= 0 && e <= r.innerWidth && t >= 0 && t <= r.innerHeight;
|
|
773
|
+
class dt {
|
|
774
|
+
constructor(e, t) {
|
|
775
|
+
this.element = e, this.win = t;
|
|
776
|
+
}
|
|
777
|
+
verify(e, t) {
|
|
778
|
+
return at(this.element, e, t) && ht(this.win, e, t);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
const k = (r, e) => {
|
|
773
782
|
e !== null ? r.style.cursor = e : r.style.removeProperty("cursor");
|
|
774
|
-
},
|
|
783
|
+
}, Y = (r) => {
|
|
775
784
|
const e = document.createElement("div");
|
|
776
785
|
return {
|
|
777
786
|
id: r.overlayNodeId,
|
|
@@ -805,19 +814,19 @@ const ht = (r, e, t) => {
|
|
|
805
814
|
status: "notFound"
|
|
806
815
|
};
|
|
807
816
|
};
|
|
808
|
-
function*
|
|
817
|
+
function* Te(r, e) {
|
|
809
818
|
const t = r.elementsFromPoint(e.x, e.y);
|
|
810
819
|
for (const o of t) {
|
|
811
820
|
if (o.shadowRoot !== null) {
|
|
812
|
-
const s =
|
|
821
|
+
const s = Te(o.shadowRoot, e);
|
|
813
822
|
for (const n of s)
|
|
814
823
|
yield n;
|
|
815
824
|
}
|
|
816
825
|
yield o;
|
|
817
826
|
}
|
|
818
827
|
}
|
|
819
|
-
const
|
|
820
|
-
const t =
|
|
828
|
+
const Ce = (r, e) => {
|
|
829
|
+
const t = Te(document, e);
|
|
821
830
|
for (const o of t) {
|
|
822
831
|
const s = ct(r, o);
|
|
823
832
|
if (s.status === "portFound")
|
|
@@ -828,13 +837,13 @@ const Me = (r, e) => {
|
|
|
828
837
|
return null;
|
|
829
838
|
};
|
|
830
839
|
var M = /* @__PURE__ */ ((r) => (r.StaticNodeId = "static", r.DraggingNodeId = "dragging", r.EdgeId = "edge", r))(M || {});
|
|
831
|
-
const
|
|
840
|
+
const Me = (r, e) => ({
|
|
832
841
|
x: r / 2,
|
|
833
842
|
y: e / 2
|
|
834
843
|
}), m = (r, e, t) => ({
|
|
835
844
|
x: e.x * r.x - e.y * r.y + ((1 - e.x) * t.x + e.y * t.y),
|
|
836
845
|
y: e.y * r.x + e.x * r.y + ((1 - e.x) * t.y - e.y * t.x)
|
|
837
|
-
}),
|
|
846
|
+
}), De = (r, e, t) => {
|
|
838
847
|
const o = {
|
|
839
848
|
x: r.x + r.width / 2,
|
|
840
849
|
y: r.y + r.height / 2
|
|
@@ -933,36 +942,36 @@ class ut {
|
|
|
933
942
|
}, I = {
|
|
934
943
|
x: E.x - s * a.x,
|
|
935
944
|
y: E.y - s * a.y
|
|
936
|
-
},
|
|
945
|
+
}, F = {
|
|
937
946
|
x: f.x + p,
|
|
938
947
|
y: f.y + y
|
|
939
|
-
},
|
|
948
|
+
}, U = {
|
|
940
949
|
x: E.x + p,
|
|
941
950
|
y: E.y + y
|
|
942
951
|
};
|
|
943
952
|
this.path = [
|
|
944
953
|
`M ${l.x} ${l.y}`,
|
|
945
954
|
`L ${f.x} ${f.y}`,
|
|
946
|
-
`C ${C.x} ${C.y} ${
|
|
947
|
-
`C ${
|
|
955
|
+
`C ${C.x} ${C.y} ${F.x} ${F.y} ${T.x} ${T.y}`,
|
|
956
|
+
`C ${U.x} ${U.y} ${I.x} ${I.y} ${E.x} ${E.y}`,
|
|
948
957
|
`L ${w.x} ${w.y}`
|
|
949
958
|
].join(" "), this.midpoint = T;
|
|
950
959
|
}
|
|
951
960
|
}
|
|
952
|
-
const
|
|
961
|
+
const ee = Object.freeze({
|
|
953
962
|
edgeColor: "--edge-color"
|
|
954
|
-
}),
|
|
963
|
+
}), Le = (r) => {
|
|
955
964
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
956
|
-
return e.style.pointerEvents = "none", e.style.position = "absolute", e.style.top = "0", e.style.left = "0", e.style.overflow = "visible", e.style.setProperty(
|
|
957
|
-
},
|
|
965
|
+
return e.style.pointerEvents = "none", e.style.position = "absolute", e.style.top = "0", e.style.left = "0", e.style.overflow = "visible", e.style.setProperty(ee.edgeColor, r), e;
|
|
966
|
+
}, Re = (r) => {
|
|
958
967
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
959
|
-
return e.setAttribute("stroke", `var(${
|
|
960
|
-
},
|
|
968
|
+
return e.setAttribute("stroke", `var(${ee.edgeColor})`), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e;
|
|
969
|
+
}, X = () => {
|
|
961
970
|
const r = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
962
|
-
return r.setAttribute("fill", `var(${
|
|
963
|
-
},
|
|
971
|
+
return r.setAttribute("fill", `var(${ee.edgeColor})`), r;
|
|
972
|
+
}, Ve = (r, e) => {
|
|
964
973
|
r.style.transform = `translate(${e.x}px, ${e.y}px)`, r.style.width = `${e.width}px`, r.style.height = `${e.height}px`;
|
|
965
|
-
},
|
|
974
|
+
}, L = (r, e) => {
|
|
966
975
|
const t = [];
|
|
967
976
|
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
977
|
const o = r.length - 1;
|
|
@@ -1058,7 +1067,7 @@ class pt {
|
|
|
1058
1067
|
dirX: n.x
|
|
1059
1068
|
}
|
|
1060
1069
|
);
|
|
1061
|
-
this.path =
|
|
1070
|
+
this.path = L(
|
|
1062
1071
|
[g, ...f.points, l],
|
|
1063
1072
|
d
|
|
1064
1073
|
), this.midpoint = f.midpoint;
|
|
@@ -1109,7 +1118,7 @@ class wt {
|
|
|
1109
1118
|
this.midpoint = {
|
|
1110
1119
|
x: (b.x + C.x) / 2,
|
|
1111
1120
|
y: (b.y + C.y) / 2
|
|
1112
|
-
}, this.path =
|
|
1121
|
+
}, this.path = L(
|
|
1113
1122
|
[w, E, b, C, T, p],
|
|
1114
1123
|
l
|
|
1115
1124
|
);
|
|
@@ -1140,7 +1149,7 @@ class yt {
|
|
|
1140
1149
|
o,
|
|
1141
1150
|
-a
|
|
1142
1151
|
), w = a + c, p = { x: t.x + w, y: t.y }, y = m(p, h, t), f = { x: o.x - w, y: o.y }, x = m(f, d, o);
|
|
1143
|
-
this.path =
|
|
1152
|
+
this.path = L(
|
|
1144
1153
|
[g, y, x, l],
|
|
1145
1154
|
u
|
|
1146
1155
|
);
|
|
@@ -1234,13 +1243,13 @@ class vt {
|
|
|
1234
1243
|
dirY: c.y
|
|
1235
1244
|
}
|
|
1236
1245
|
);
|
|
1237
|
-
this.path =
|
|
1246
|
+
this.path = L(
|
|
1238
1247
|
[g, ...f.points, l],
|
|
1239
1248
|
u
|
|
1240
1249
|
), this.midpoint = f.midpoint;
|
|
1241
1250
|
}
|
|
1242
1251
|
}
|
|
1243
|
-
class
|
|
1252
|
+
class te {
|
|
1244
1253
|
constructor(e) {
|
|
1245
1254
|
i(this, "path");
|
|
1246
1255
|
i(this, "midpoint");
|
|
@@ -1254,7 +1263,7 @@ class re {
|
|
|
1254
1263
|
{ x: d, y: 0 },
|
|
1255
1264
|
{ x: o, y: 0 }
|
|
1256
1265
|
].map((w) => m(w, n, { x: 0, y: 0 })).map((w) => ({ x: w.x + a.x, y: w.y + a.y })), l = `M ${a.x} ${a.y} L ${g[0].x} ${g[0].y} `;
|
|
1257
|
-
this.path = `${h ? "" : l}${
|
|
1266
|
+
this.path = `${h ? "" : l}${L(g, e.roundness)}`, this.midpoint = { x: (g[3].x + g[4].x) / 2, y: (g[3].y + g[4].y) / 2 };
|
|
1258
1267
|
}
|
|
1259
1268
|
}
|
|
1260
1269
|
class mt {
|
|
@@ -1362,7 +1371,7 @@ class At {
|
|
|
1362
1371
|
this.midpoint = {
|
|
1363
1372
|
x: (y.x + f.x) / 2,
|
|
1364
1373
|
y: x
|
|
1365
|
-
}, this.path =
|
|
1374
|
+
}, this.path = L(
|
|
1366
1375
|
[
|
|
1367
1376
|
l,
|
|
1368
1377
|
y,
|
|
@@ -1417,7 +1426,7 @@ class Nt {
|
|
|
1417
1426
|
this.midpoint = {
|
|
1418
1427
|
x,
|
|
1419
1428
|
y: (y.y + f.y) / 2
|
|
1420
|
-
}, this.path =
|
|
1429
|
+
}, this.path = L(
|
|
1421
1430
|
[
|
|
1422
1431
|
l,
|
|
1423
1432
|
y,
|
|
@@ -1452,8 +1461,8 @@ const v = Object.freeze({
|
|
|
1452
1461
|
curvature: 90,
|
|
1453
1462
|
interactiveWidth: 10,
|
|
1454
1463
|
preOffset: 0
|
|
1455
|
-
}),
|
|
1456
|
-
class
|
|
1464
|
+
}), ve = (r) => ({ x: Math.cos(r), y: Math.sin(r) });
|
|
1465
|
+
class H {
|
|
1457
1466
|
constructor(e) {
|
|
1458
1467
|
i(this, "svg");
|
|
1459
1468
|
i(this, "group", document.createElementNS(
|
|
@@ -1466,18 +1475,18 @@ class G {
|
|
|
1466
1475
|
i(this, "onAfterRender");
|
|
1467
1476
|
i(this, "afterRenderEmitter");
|
|
1468
1477
|
i(this, "arrowRenderer");
|
|
1469
|
-
this.params = e, [this.afterRenderEmitter, this.onAfterRender] = P(), this.arrowRenderer = this.params.arrowRenderer, this.svg =
|
|
1478
|
+
this.params = e, [this.afterRenderEmitter, this.onAfterRender] = P(), this.arrowRenderer = this.params.arrowRenderer, this.svg = Le(e.color), this.svg.appendChild(this.group), this.line = Re(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = X(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = X(), this.group.appendChild(this.targetArrow));
|
|
1470
1479
|
}
|
|
1471
1480
|
render(e) {
|
|
1472
|
-
const { x: t, y: o, width: s, height: n, from: a, to: h } =
|
|
1481
|
+
const { x: t, y: o, width: s, height: n, from: a, to: h } = De(
|
|
1473
1482
|
e.from,
|
|
1474
1483
|
e.to,
|
|
1475
1484
|
this.params.padding
|
|
1476
1485
|
);
|
|
1477
|
-
|
|
1478
|
-
const d =
|
|
1486
|
+
Ve(this.svg, { x: t, y: o, width: s, height: n });
|
|
1487
|
+
const d = ve(e.from.direction), c = ve(e.to.direction);
|
|
1479
1488
|
let u = { x: -c.x, y: -c.y }, g;
|
|
1480
|
-
e.category ===
|
|
1489
|
+
e.category === R.PortCycle ? (g = this.params.createCyclePath, u = d) : e.category === R.NodeCycle ? g = this.params.createDetourPath : g = this.params.createLinePath;
|
|
1481
1490
|
const l = g(a, h, d, c);
|
|
1482
1491
|
this.line.setAttribute("d", l.path);
|
|
1483
1492
|
let w = null;
|
|
@@ -1543,7 +1552,7 @@ const bt = (r) => (e) => {
|
|
|
1543
1552
|
y: g.y + e.shift.y
|
|
1544
1553
|
})), 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}`, u = `A ${o} ${o} 0 0 1 ${a[0].x} ${a[0].y}`;
|
|
1545
1554
|
return `${h} ${d} ${c} ${u}`;
|
|
1546
|
-
},
|
|
1555
|
+
}, B = (r) => {
|
|
1547
1556
|
if (typeof r == "function")
|
|
1548
1557
|
return r;
|
|
1549
1558
|
switch (r.type) {
|
|
@@ -1562,7 +1571,7 @@ const bt = (r) => (e) => {
|
|
|
1562
1571
|
radius: r.radius ?? v.wedgeArrowRadius
|
|
1563
1572
|
});
|
|
1564
1573
|
}
|
|
1565
|
-
},
|
|
1574
|
+
}, W = 50;
|
|
1566
1575
|
class Ct {
|
|
1567
1576
|
constructor(e) {
|
|
1568
1577
|
i(this, "svg");
|
|
@@ -1610,17 +1619,17 @@ class Ct {
|
|
|
1610
1619
|
hasSourceArrow: this.hasSourceArrow,
|
|
1611
1620
|
hasTargetArrow: this.hasTargetArrow
|
|
1612
1621
|
}));
|
|
1613
|
-
this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? v.arrowLength, this.curvature = (e == null ? void 0 : e.curvature) ?? v.curvature, this.portCycleRadius = (e == null ? void 0 : e.cycleRadius) ?? v.cycleRadius, this.portCycleSmallRadius = (e == null ? void 0 : e.smallCycleRadius) ?? v.smallCycleRadius, this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? v.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new
|
|
1622
|
+
this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? v.arrowLength, this.curvature = (e == null ? void 0 : e.curvature) ?? v.curvature, this.portCycleRadius = (e == null ? void 0 : e.cycleRadius) ?? v.cycleRadius, this.portCycleSmallRadius = (e == null ? void 0 : e.smallCycleRadius) ?? v.smallCycleRadius, this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? v.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new H({
|
|
1614
1623
|
color: (e == null ? void 0 : e.color) ?? v.color,
|
|
1615
1624
|
width: (e == null ? void 0 : e.width) ?? v.width,
|
|
1616
|
-
arrowRenderer:
|
|
1625
|
+
arrowRenderer: B((e == null ? void 0 : e.arrowRenderer) ?? {}),
|
|
1617
1626
|
arrowLength: this.arrowLength,
|
|
1618
1627
|
hasSourceArrow: this.hasSourceArrow,
|
|
1619
1628
|
hasTargetArrow: this.hasTargetArrow,
|
|
1620
1629
|
createCyclePath: this.createCyclePath,
|
|
1621
1630
|
createDetourPath: this.createDetourPath,
|
|
1622
1631
|
createLinePath: this.createLinePath,
|
|
1623
|
-
padding:
|
|
1632
|
+
padding: W
|
|
1624
1633
|
}), this.svg = this.pathShape.svg, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
|
|
1625
1634
|
}
|
|
1626
1635
|
render(e) {
|
|
@@ -1643,7 +1652,7 @@ class Mt {
|
|
|
1643
1652
|
i(this, "hasSourceArrow");
|
|
1644
1653
|
i(this, "hasTargetArrow");
|
|
1645
1654
|
i(this, "pathShape");
|
|
1646
|
-
i(this, "createCyclePath", (e, t, o) => new
|
|
1655
|
+
i(this, "createCyclePath", (e, t, o) => new te({
|
|
1647
1656
|
origin: e,
|
|
1648
1657
|
dir: o,
|
|
1649
1658
|
arrowLength: this.arrowLength,
|
|
@@ -1681,17 +1690,17 @@ class Mt {
|
|
|
1681
1690
|
t,
|
|
1682
1691
|
this.arrowOffset,
|
|
1683
1692
|
this.cycleSquareSide / 2
|
|
1684
|
-
), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new
|
|
1693
|
+
), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new H({
|
|
1685
1694
|
color: (e == null ? void 0 : e.color) ?? v.color,
|
|
1686
1695
|
width: (e == null ? void 0 : e.width) ?? v.width,
|
|
1687
|
-
arrowRenderer:
|
|
1696
|
+
arrowRenderer: B((e == null ? void 0 : e.arrowRenderer) ?? {}),
|
|
1688
1697
|
arrowLength: this.arrowLength,
|
|
1689
1698
|
hasSourceArrow: this.hasSourceArrow,
|
|
1690
1699
|
hasTargetArrow: this.hasTargetArrow,
|
|
1691
1700
|
createCyclePath: this.createCyclePath,
|
|
1692
1701
|
createDetourPath: this.createDetourPath,
|
|
1693
1702
|
createLinePath: this.createLinePath,
|
|
1694
|
-
padding:
|
|
1703
|
+
padding: W
|
|
1695
1704
|
}), this.svg = this.pathShape.svg, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
|
|
1696
1705
|
}
|
|
1697
1706
|
render(e) {
|
|
@@ -1715,7 +1724,7 @@ class Dt {
|
|
|
1715
1724
|
i(this, "hasSourceArrow");
|
|
1716
1725
|
i(this, "hasTargetArrow");
|
|
1717
1726
|
i(this, "pathShape");
|
|
1718
|
-
i(this, "createCyclePath", (e, t, o) => new
|
|
1727
|
+
i(this, "createCyclePath", (e, t, o) => new te({
|
|
1719
1728
|
origin: e,
|
|
1720
1729
|
dir: o,
|
|
1721
1730
|
arrowLength: this.arrowLength,
|
|
@@ -1754,17 +1763,17 @@ class Dt {
|
|
|
1754
1763
|
t,
|
|
1755
1764
|
this.arrowOffset,
|
|
1756
1765
|
this.cycleSquareSide / 2
|
|
1757
|
-
), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? v.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new
|
|
1766
|
+
), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? v.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new H({
|
|
1758
1767
|
color: (e == null ? void 0 : e.color) ?? v.color,
|
|
1759
1768
|
width: (e == null ? void 0 : e.width) ?? v.width,
|
|
1760
|
-
arrowRenderer:
|
|
1769
|
+
arrowRenderer: B((e == null ? void 0 : e.arrowRenderer) ?? {}),
|
|
1761
1770
|
arrowLength: this.arrowLength,
|
|
1762
1771
|
hasSourceArrow: this.hasSourceArrow,
|
|
1763
1772
|
hasTargetArrow: this.hasTargetArrow,
|
|
1764
1773
|
createCyclePath: this.createCyclePath,
|
|
1765
1774
|
createDetourPath: this.createDetourPath,
|
|
1766
1775
|
createLinePath: this.createLinePath,
|
|
1767
|
-
padding:
|
|
1776
|
+
padding: W
|
|
1768
1777
|
}), this.svg = this.pathShape.svg, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
|
|
1769
1778
|
}
|
|
1770
1779
|
render(e) {
|
|
@@ -1787,7 +1796,7 @@ class Lt {
|
|
|
1787
1796
|
i(this, "hasSourceArrow");
|
|
1788
1797
|
i(this, "hasTargetArrow");
|
|
1789
1798
|
i(this, "pathShape");
|
|
1790
|
-
i(this, "createCyclePath", (e, t, o) => new
|
|
1799
|
+
i(this, "createCyclePath", (e, t, o) => new te({
|
|
1791
1800
|
origin: e,
|
|
1792
1801
|
dir: o,
|
|
1793
1802
|
arrowLength: this.arrowLength,
|
|
@@ -1825,17 +1834,17 @@ class Lt {
|
|
|
1825
1834
|
t,
|
|
1826
1835
|
this.arrowOffset,
|
|
1827
1836
|
this.cycleSquareSide / 2
|
|
1828
|
-
), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new
|
|
1837
|
+
), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new H({
|
|
1829
1838
|
color: (e == null ? void 0 : e.color) ?? v.color,
|
|
1830
1839
|
width: (e == null ? void 0 : e.width) ?? v.width,
|
|
1831
|
-
arrowRenderer:
|
|
1840
|
+
arrowRenderer: B((e == null ? void 0 : e.arrowRenderer) ?? {}),
|
|
1832
1841
|
arrowLength: this.arrowLength,
|
|
1833
1842
|
hasSourceArrow: this.hasSourceArrow,
|
|
1834
1843
|
hasTargetArrow: this.hasTargetArrow,
|
|
1835
1844
|
createCyclePath: this.createCyclePath,
|
|
1836
1845
|
createDetourPath: this.createDetourPath,
|
|
1837
1846
|
createLinePath: this.createLinePath,
|
|
1838
|
-
padding:
|
|
1847
|
+
padding: W
|
|
1839
1848
|
}), this.svg = this.pathShape.svg, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
|
|
1840
1849
|
}
|
|
1841
1850
|
render(e) {
|
|
@@ -1860,15 +1869,15 @@ class Ie {
|
|
|
1860
1869
|
i(this, "onAfterRender");
|
|
1861
1870
|
i(this, "afterRenderEmitter");
|
|
1862
1871
|
i(this, "arrowRenderer");
|
|
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 =
|
|
1872
|
+
[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 = B((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 = Le(this.color), this.svg.appendChild(this.group), this.line = Re(this.width), this.group.appendChild(this.line), e != null && e.hasSourceArrow && (this.sourceArrow = X(), this.group.appendChild(this.sourceArrow)), e != null && e.hasTargetArrow && (this.targetArrow = X(), this.group.appendChild(this.targetArrow));
|
|
1864
1873
|
}
|
|
1865
1874
|
render(e) {
|
|
1866
|
-
const { x: t, y: o, width: s, height: n, from: a, to: h } =
|
|
1875
|
+
const { x: t, y: o, width: s, height: n, from: a, to: h } = De(
|
|
1867
1876
|
e.from,
|
|
1868
1877
|
e.to,
|
|
1869
|
-
|
|
1878
|
+
W
|
|
1870
1879
|
);
|
|
1871
|
-
|
|
1880
|
+
Ve(this.svg, { x: t, y: o, width: s, height: n });
|
|
1872
1881
|
const d = new xt({
|
|
1873
1882
|
from: a,
|
|
1874
1883
|
to: h,
|
|
@@ -1927,16 +1936,16 @@ const Rt = () => {
|
|
|
1927
1936
|
}, Vt = (r) => {
|
|
1928
1937
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1929
1938
|
return e.setAttribute("stroke", "transparent"), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e.setAttribute("stroke-linecap", "round"), e;
|
|
1930
|
-
},
|
|
1939
|
+
}, me = (r) => {
|
|
1931
1940
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1932
1941
|
return e.setAttribute("stroke-linejoin", "round"), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "transparent"), e.setAttribute("stroke", "transparent"), e;
|
|
1933
1942
|
};
|
|
1934
|
-
class
|
|
1943
|
+
class It extends Error {
|
|
1935
1944
|
constructor(e) {
|
|
1936
1945
|
super(e), this.name = "InteractiveEdgeError";
|
|
1937
1946
|
}
|
|
1938
1947
|
}
|
|
1939
|
-
class
|
|
1948
|
+
class Fe {
|
|
1940
1949
|
constructor(e, t) {
|
|
1941
1950
|
i(this, "svg");
|
|
1942
1951
|
i(this, "group");
|
|
@@ -1948,13 +1957,13 @@ class Ue {
|
|
|
1948
1957
|
i(this, "interactiveLine");
|
|
1949
1958
|
i(this, "interactiveSourceArrow", null);
|
|
1950
1959
|
i(this, "interactiveTargetArrow", null);
|
|
1951
|
-
if (this.baseEdge = e, e instanceof
|
|
1952
|
-
throw new
|
|
1960
|
+
if (this.baseEdge = e, e instanceof Fe)
|
|
1961
|
+
throw new It(
|
|
1953
1962
|
"interactive edge can be configured only once"
|
|
1954
1963
|
);
|
|
1955
1964
|
this.svg = this.baseEdge.svg, this.group = this.baseEdge.group, this.line = this.baseEdge.line, this.sourceArrow = this.baseEdge.sourceArrow, this.targetArrow = this.baseEdge.targetArrow, this.onAfterRender = this.baseEdge.onAfterRender;
|
|
1956
1965
|
const o = (t == null ? void 0 : t.distance) ?? v.interactiveWidth;
|
|
1957
|
-
this.interactiveLine = Vt(o), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow =
|
|
1966
|
+
this.interactiveLine = Vt(o), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = me(o), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = me(o), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((s) => {
|
|
1958
1967
|
this.interactiveLine.setAttribute("d", s.edgePath.path), this.interactiveSourceArrow && this.interactiveSourceArrow.setAttribute("d", s.sourceArrowPath), this.interactiveTargetArrow && this.interactiveTargetArrow.setAttribute("d", s.targetArrowPath);
|
|
1959
1968
|
});
|
|
1960
1969
|
}
|
|
@@ -1962,7 +1971,7 @@ class Ue {
|
|
|
1962
1971
|
this.baseEdge.render(e);
|
|
1963
1972
|
}
|
|
1964
1973
|
}
|
|
1965
|
-
class
|
|
1974
|
+
class Br {
|
|
1966
1975
|
constructor(e, t) {
|
|
1967
1976
|
i(this, "group");
|
|
1968
1977
|
i(this, "line");
|
|
@@ -1979,7 +1988,7 @@ class Fr {
|
|
|
1979
1988
|
this.baseShape.render(e);
|
|
1980
1989
|
}
|
|
1981
1990
|
}
|
|
1982
|
-
class
|
|
1991
|
+
class Ue {
|
|
1983
1992
|
constructor(e) {
|
|
1984
1993
|
i(this, "onAfterNodeAdded");
|
|
1985
1994
|
i(this, "onAfterNodeUpdated");
|
|
@@ -2075,7 +2084,7 @@ class $e {
|
|
|
2075
2084
|
return this.graphStore.getNodeAdjacentEdgeIds(e);
|
|
2076
2085
|
}
|
|
2077
2086
|
}
|
|
2078
|
-
class
|
|
2087
|
+
class J {
|
|
2079
2088
|
constructor(e) {
|
|
2080
2089
|
i(this, "counter", 0);
|
|
2081
2090
|
this.checkExists = e;
|
|
@@ -2091,15 +2100,15 @@ class K {
|
|
|
2091
2100
|
this.counter = 0;
|
|
2092
2101
|
}
|
|
2093
2102
|
}
|
|
2094
|
-
class
|
|
2103
|
+
class $e {
|
|
2095
2104
|
constructor(e, t, o) {
|
|
2096
|
-
i(this, "nodeIdGenerator", new
|
|
2105
|
+
i(this, "nodeIdGenerator", new J(
|
|
2097
2106
|
(e) => this.graphStore.hasNode(e)
|
|
2098
2107
|
));
|
|
2099
|
-
i(this, "portIdGenerator", new
|
|
2108
|
+
i(this, "portIdGenerator", new J(
|
|
2100
2109
|
(e) => this.graphStore.hasPort(e)
|
|
2101
2110
|
));
|
|
2102
|
-
i(this, "edgeIdGenerator", new
|
|
2111
|
+
i(this, "edgeIdGenerator", new J(
|
|
2103
2112
|
(e) => this.graphStore.hasEdge(e)
|
|
2104
2113
|
));
|
|
2105
2114
|
i(this, "onAfterNodeAdded", (e) => {
|
|
@@ -2222,7 +2231,7 @@ class Be {
|
|
|
2222
2231
|
), this.graphStore.onBeforeEdgeRemoved.unsubscribe(this.onBeforeEdgeRemoved), this.graphStore.onBeforeClear.unsubscribe(this.onBeforeClear), this.htmlView.destroy();
|
|
2223
2232
|
}
|
|
2224
2233
|
}
|
|
2225
|
-
const
|
|
2234
|
+
const Ft = (r) => {
|
|
2226
2235
|
setTimeout(() => {
|
|
2227
2236
|
r();
|
|
2228
2237
|
});
|
|
@@ -2230,10 +2239,10 @@ const It = (r) => {
|
|
|
2230
2239
|
queueMicrotask(() => {
|
|
2231
2240
|
r();
|
|
2232
2241
|
});
|
|
2233
|
-
},
|
|
2242
|
+
}, re = (r) => {
|
|
2234
2243
|
r();
|
|
2235
2244
|
};
|
|
2236
|
-
class
|
|
2245
|
+
class Be {
|
|
2237
2246
|
constructor(e) {
|
|
2238
2247
|
i(this, "onBeforeUpdated");
|
|
2239
2248
|
i(this, "onAfterUpdated");
|
|
@@ -2266,16 +2275,16 @@ const $t = (r, e) => Symbol.iterator in r ? {
|
|
|
2266
2275
|
nodes: r.nodes ?? [],
|
|
2267
2276
|
contentPadding: r.contentPadding ?? r.contentOffset ?? e.focus.contentPadding,
|
|
2268
2277
|
animationDuration: r.animationDuration ?? e.focus.animationDuration
|
|
2269
|
-
},
|
|
2278
|
+
}, We = (r, e, t) => ({
|
|
2270
2279
|
scale: r.scale,
|
|
2271
2280
|
x: r.x + r.scale * e,
|
|
2272
2281
|
y: r.y + r.scale * t
|
|
2273
|
-
}),
|
|
2282
|
+
}), Oe = (r, e, t, o) => ({
|
|
2274
2283
|
scale: r.scale * e,
|
|
2275
2284
|
x: r.scale * (1 - e) * t + r.x,
|
|
2276
2285
|
y: r.scale * (1 - e) * o + r.y
|
|
2277
2286
|
});
|
|
2278
|
-
class
|
|
2287
|
+
class ze {
|
|
2279
2288
|
constructor(e, t, o, s) {
|
|
2280
2289
|
this.graphStore = e, this.viewportStore = t, this.params = o, this.win = s;
|
|
2281
2290
|
}
|
|
@@ -2287,11 +2296,11 @@ class ke {
|
|
|
2287
2296
|
}
|
|
2288
2297
|
center(e, t) {
|
|
2289
2298
|
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 u =
|
|
2299
|
+
let u = We(a, d, c);
|
|
2291
2300
|
const g = t == null ? void 0 : t.contentScale;
|
|
2292
2301
|
if (g !== void 0) {
|
|
2293
2302
|
const w = 1 / g;
|
|
2294
|
-
u =
|
|
2303
|
+
u = Oe(
|
|
2295
2304
|
u,
|
|
2296
2305
|
w / a.scale,
|
|
2297
2306
|
n.x,
|
|
@@ -2351,10 +2360,10 @@ class ke {
|
|
|
2351
2360
|
this.win.requestAnimationFrame(a);
|
|
2352
2361
|
}
|
|
2353
2362
|
}
|
|
2354
|
-
const
|
|
2355
|
-
const o = new
|
|
2363
|
+
const ke = (r, e, t) => {
|
|
2364
|
+
const o = new Pe(), s = new Ue(o), n = new Be(e), a = new Ne(o, e, r), h = {
|
|
2356
2365
|
nodes: {
|
|
2357
|
-
centerFn:
|
|
2366
|
+
centerFn: Me,
|
|
2358
2367
|
priorityFn: () => 0
|
|
2359
2368
|
},
|
|
2360
2369
|
edges: {
|
|
@@ -2364,7 +2373,7 @@ const Ye = (r, e, t) => {
|
|
|
2364
2373
|
ports: {
|
|
2365
2374
|
direction: 0
|
|
2366
2375
|
}
|
|
2367
|
-
}, d = new
|
|
2376
|
+
}, d = new $e(
|
|
2368
2377
|
o,
|
|
2369
2378
|
a,
|
|
2370
2379
|
h
|
|
@@ -2372,18 +2381,18 @@ const Ye = (r, e, t) => {
|
|
|
2372
2381
|
focus: {
|
|
2373
2382
|
contentPadding: 0,
|
|
2374
2383
|
minContentScale: 0,
|
|
2375
|
-
schedule:
|
|
2384
|
+
schedule: re,
|
|
2376
2385
|
animationDuration: 0
|
|
2377
2386
|
}
|
|
2378
|
-
}, u = new
|
|
2387
|
+
}, u = new ze(
|
|
2379
2388
|
o,
|
|
2380
2389
|
e,
|
|
2381
2390
|
c,
|
|
2382
2391
|
t
|
|
2383
2392
|
);
|
|
2384
|
-
return new
|
|
2393
|
+
return new be(s, n, d, u);
|
|
2385
2394
|
};
|
|
2386
|
-
class
|
|
2395
|
+
class G {
|
|
2387
2396
|
constructor(e, t, o, s) {
|
|
2388
2397
|
i(this, "onAfterPortMarked", (e) => {
|
|
2389
2398
|
const t = this.canvas.graph.getPort(e);
|
|
@@ -2408,9 +2417,7 @@ class j {
|
|
|
2408
2417
|
}));
|
|
2409
2418
|
});
|
|
2410
2419
|
i(this, "onWindowMouseMove", (e) => {
|
|
2411
|
-
if (!
|
|
2412
|
-
this.window,
|
|
2413
|
-
this.element,
|
|
2420
|
+
if (!this.pointInsideVerifier.verify(
|
|
2414
2421
|
e.clientX,
|
|
2415
2422
|
e.clientY
|
|
2416
2423
|
)) {
|
|
@@ -2440,9 +2447,7 @@ class j {
|
|
|
2440
2447
|
});
|
|
2441
2448
|
i(this, "onWindowTouchMove", (e) => {
|
|
2442
2449
|
const t = e.touches[0];
|
|
2443
|
-
if (!
|
|
2444
|
-
this.window,
|
|
2445
|
-
this.element,
|
|
2450
|
+
if (!this.pointInsideVerifier.verify(
|
|
2446
2451
|
t.clientX,
|
|
2447
2452
|
t.clientY
|
|
2448
2453
|
)) {
|
|
@@ -2464,10 +2469,10 @@ class j {
|
|
|
2464
2469
|
i(this, "revert", () => {
|
|
2465
2470
|
this.params.onStopDrag(), this.reset(), this.removeWindowMouseListeners(), this.removeWindowTouchListeners();
|
|
2466
2471
|
});
|
|
2467
|
-
this.canvas = e, this.
|
|
2472
|
+
this.canvas = e, this.window = t, this.pointInsideVerifier = o, this.params = s, this.canvas.graph.onAfterPortMarked.subscribe(this.onAfterPortMarked), this.canvas.graph.onBeforePortUnmarked.subscribe(this.onBeforePortUnmarked), this.canvas.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.revert);
|
|
2468
2473
|
}
|
|
2469
2474
|
static configure(e, t, o, s) {
|
|
2470
|
-
new
|
|
2475
|
+
new G(e, t, o, s);
|
|
2471
2476
|
}
|
|
2472
2477
|
hookPortEvents(e) {
|
|
2473
2478
|
e.addEventListener("mousedown", this.onPortMouseDown, {
|
|
@@ -2521,8 +2526,8 @@ class Wt {
|
|
|
2521
2526
|
}), this.params.onAfterApplied();
|
|
2522
2527
|
}
|
|
2523
2528
|
}
|
|
2524
|
-
class
|
|
2525
|
-
constructor(e, t, o, s) {
|
|
2529
|
+
class oe {
|
|
2530
|
+
constructor(e, t, o, s, n) {
|
|
2526
2531
|
i(this, "grabbedNode", null);
|
|
2527
2532
|
i(this, "maxNodePriority", 0);
|
|
2528
2533
|
i(this, "graph");
|
|
@@ -2558,7 +2563,7 @@ class se {
|
|
|
2558
2563
|
nodeId: s,
|
|
2559
2564
|
dx: h.x - n.x,
|
|
2560
2565
|
dy: h.y - n.y
|
|
2561
|
-
},
|
|
2566
|
+
}, k(this.element, this.params.dragCursor), this.moveNodeOnTop(s), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
|
|
2562
2567
|
passive: !0
|
|
2563
2568
|
}), this.window.addEventListener("mouseup", this.onWindowMouseUp, {
|
|
2564
2569
|
passive: !0
|
|
@@ -2594,9 +2599,7 @@ class se {
|
|
|
2594
2599
|
});
|
|
2595
2600
|
});
|
|
2596
2601
|
i(this, "onWindowMouseMove", (e) => {
|
|
2597
|
-
if (!
|
|
2598
|
-
this.window,
|
|
2599
|
-
this.element,
|
|
2602
|
+
if (!this.pointInsideVerifier.verify(
|
|
2600
2603
|
e.clientX,
|
|
2601
2604
|
e.clientY
|
|
2602
2605
|
)) {
|
|
@@ -2615,9 +2618,7 @@ class se {
|
|
|
2615
2618
|
if (e.touches.length !== 1)
|
|
2616
2619
|
return;
|
|
2617
2620
|
const t = e.touches[0];
|
|
2618
|
-
if (!
|
|
2619
|
-
this.window,
|
|
2620
|
-
this.element,
|
|
2621
|
+
if (!this.pointInsideVerifier.verify(
|
|
2621
2622
|
t.clientX,
|
|
2622
2623
|
t.clientY
|
|
2623
2624
|
)) {
|
|
@@ -2641,10 +2642,16 @@ class se {
|
|
|
2641
2642
|
i(this, "revert", () => {
|
|
2642
2643
|
this.reset(), this.removeMouseDragListeners(), this.removeTouchDragListeners();
|
|
2643
2644
|
});
|
|
2644
|
-
this.canvas = e, this.element = t, this.window = o, this.
|
|
2645
|
+
this.canvas = e, this.element = t, this.window = o, this.pointInsideVerifier = s, this.params = n, this.graph = e.graph, this.graph.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.graph.onAfterNodeUpdated.subscribe(this.onAfterNodeUpdated), this.graph.onBeforeNodeRemoved.subscribe(this.onBeforeNodeRemoved), this.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.revert);
|
|
2645
2646
|
}
|
|
2646
|
-
static configure(e, t, o, s) {
|
|
2647
|
-
new
|
|
2647
|
+
static configure(e, t, o, s, n) {
|
|
2648
|
+
new oe(
|
|
2649
|
+
e,
|
|
2650
|
+
t,
|
|
2651
|
+
o,
|
|
2652
|
+
s,
|
|
2653
|
+
n
|
|
2654
|
+
);
|
|
2648
2655
|
}
|
|
2649
2656
|
moveNode(e, t) {
|
|
2650
2657
|
if (!this.graph.hasNode(e.nodeId))
|
|
@@ -2670,7 +2677,7 @@ class se {
|
|
|
2670
2677
|
}
|
|
2671
2678
|
}
|
|
2672
2679
|
stopMouseDrag() {
|
|
2673
|
-
this.grabbedNode !== null && this.graph.hasNode(this.grabbedNode.nodeId) && this.params.onNodeDragFinished(this.grabbedNode.nodeId), this.grabbedNode = null,
|
|
2680
|
+
this.grabbedNode !== null && this.graph.hasNode(this.grabbedNode.nodeId) && this.params.onNodeDragFinished(this.grabbedNode.nodeId), this.grabbedNode = null, k(this.element, null), this.removeMouseDragListeners();
|
|
2674
2681
|
}
|
|
2675
2682
|
removeMouseDragListeners() {
|
|
2676
2683
|
this.window.removeEventListener("mouseup", this.onWindowMouseUp), this.window.removeEventListener("mousemove", this.onWindowMouseMove);
|
|
@@ -2713,7 +2720,7 @@ class se {
|
|
|
2713
2720
|
return e;
|
|
2714
2721
|
}
|
|
2715
2722
|
}
|
|
2716
|
-
const
|
|
2723
|
+
const O = (r) => {
|
|
2717
2724
|
const e = [], t = r.touches.length;
|
|
2718
2725
|
for (let h = 0; h < t; h++)
|
|
2719
2726
|
e.push([r.touches[h].clientX, r.touches[h].clientY]);
|
|
@@ -2732,8 +2739,8 @@ const z = (r) => {
|
|
|
2732
2739
|
touches: e
|
|
2733
2740
|
};
|
|
2734
2741
|
};
|
|
2735
|
-
class
|
|
2736
|
-
constructor(e, t, o, s) {
|
|
2742
|
+
class j {
|
|
2743
|
+
constructor(e, t, o, s, n) {
|
|
2737
2744
|
i(this, "viewport");
|
|
2738
2745
|
i(this, "prevTouches", null);
|
|
2739
2746
|
i(this, "wheelFinishTimer", null);
|
|
@@ -2742,16 +2749,14 @@ class J {
|
|
|
2742
2749
|
this.removeMouseDragListeners(), this.removeTouchDragListeners();
|
|
2743
2750
|
});
|
|
2744
2751
|
i(this, "onMouseDown", (e) => {
|
|
2745
|
-
this.params.mouseDownEventVerifier(e) && (
|
|
2752
|
+
this.params.mouseDownEventVerifier(e) && (k(this.element, this.params.shiftCursor), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
|
|
2746
2753
|
passive: !0
|
|
2747
2754
|
}), this.window.addEventListener("mouseup", this.onWindowMouseUp, {
|
|
2748
2755
|
passive: !0
|
|
2749
2756
|
}), this.startRegisteredTransform());
|
|
2750
2757
|
});
|
|
2751
2758
|
i(this, "onWindowMouseMove", (e) => {
|
|
2752
|
-
const t =
|
|
2753
|
-
this.window,
|
|
2754
|
-
this.element,
|
|
2759
|
+
const t = this.pointInsideVerifier.verify(
|
|
2755
2760
|
e.clientX,
|
|
2756
2761
|
e.clientY
|
|
2757
2762
|
);
|
|
@@ -2775,10 +2780,10 @@ class J {
|
|
|
2775
2780
|
});
|
|
2776
2781
|
i(this, "onTouchStart", (e) => {
|
|
2777
2782
|
if (this.prevTouches !== null) {
|
|
2778
|
-
this.prevTouches =
|
|
2783
|
+
this.prevTouches = O(e);
|
|
2779
2784
|
return;
|
|
2780
2785
|
}
|
|
2781
|
-
this.prevTouches =
|
|
2786
|
+
this.prevTouches = O(e), this.window.addEventListener("touchmove", this.onWindowTouchMove, {
|
|
2782
2787
|
passive: !0
|
|
2783
2788
|
}), this.window.addEventListener("touchend", this.onWindowTouchFinish, {
|
|
2784
2789
|
passive: !0
|
|
@@ -2787,9 +2792,9 @@ class J {
|
|
|
2787
2792
|
}), this.startRegisteredTransform();
|
|
2788
2793
|
});
|
|
2789
2794
|
i(this, "onWindowTouchMove", (e) => {
|
|
2790
|
-
const t =
|
|
2795
|
+
const t = O(e);
|
|
2791
2796
|
if (!t.touches.every(
|
|
2792
|
-
(s) =>
|
|
2797
|
+
(s) => this.pointInsideVerifier.verify(s[0], s[1])
|
|
2793
2798
|
)) {
|
|
2794
2799
|
this.stopTouchDrag();
|
|
2795
2800
|
return;
|
|
@@ -2804,12 +2809,12 @@ class J {
|
|
|
2804
2809
|
this.prevTouches = t;
|
|
2805
2810
|
});
|
|
2806
2811
|
i(this, "onWindowTouchFinish", (e) => {
|
|
2807
|
-
e.touches.length > 0 ? this.prevTouches =
|
|
2812
|
+
e.touches.length > 0 ? this.prevTouches = O(e) : this.stopTouchDrag();
|
|
2808
2813
|
});
|
|
2809
2814
|
i(this, "preventWheelScaleListener", (e) => {
|
|
2810
2815
|
e.preventDefault();
|
|
2811
2816
|
});
|
|
2812
|
-
this.canvas = e, this.element = t, this.window = o, this.
|
|
2817
|
+
this.canvas = e, this.element = t, this.window = o, this.pointInsideVerifier = s, this.params = n, this.element.addEventListener("wheel", this.preventWheelScaleListener, {
|
|
2813
2818
|
passive: !1
|
|
2814
2819
|
}), this.viewport = e.viewport, this.handleResize(), this.viewport.onAfterResize.subscribe(() => {
|
|
2815
2820
|
this.handleResize();
|
|
@@ -2821,11 +2826,17 @@ class J {
|
|
|
2821
2826
|
passive: !0
|
|
2822
2827
|
}), e.onBeforeDestroy.subscribe(this.revert);
|
|
2823
2828
|
}
|
|
2824
|
-
static configure(e, t, o, s) {
|
|
2825
|
-
new
|
|
2829
|
+
static configure(e, t, o, s, n) {
|
|
2830
|
+
new j(
|
|
2831
|
+
e,
|
|
2832
|
+
t,
|
|
2833
|
+
o,
|
|
2834
|
+
s,
|
|
2835
|
+
n
|
|
2836
|
+
);
|
|
2826
2837
|
}
|
|
2827
2838
|
moveViewport(e, t) {
|
|
2828
|
-
const o = this.viewport.getViewportMatrix(), s =
|
|
2839
|
+
const o = this.viewport.getViewportMatrix(), s = We(o, e, t), { width: n, height: a } = this.viewport.getDimensions(), h = this.params.transformPreprocessor({
|
|
2829
2840
|
prevTransform: o,
|
|
2830
2841
|
nextTransform: s,
|
|
2831
2842
|
canvasWidth: n,
|
|
@@ -2834,7 +2845,7 @@ class J {
|
|
|
2834
2845
|
this.performTransform(h);
|
|
2835
2846
|
}
|
|
2836
2847
|
scaleViewport(e, t, o) {
|
|
2837
|
-
const s = this.canvas.viewport.getViewportMatrix(), n =
|
|
2848
|
+
const s = this.canvas.viewport.getViewportMatrix(), n = Oe(s, e, t, o), { width: a, height: h } = this.viewport.getDimensions(), d = this.params.transformPreprocessor({
|
|
2838
2849
|
prevTransform: s,
|
|
2839
2850
|
nextTransform: n,
|
|
2840
2851
|
canvasWidth: a,
|
|
@@ -2843,7 +2854,7 @@ class J {
|
|
|
2843
2854
|
this.performTransform(d);
|
|
2844
2855
|
}
|
|
2845
2856
|
stopMouseDrag() {
|
|
2846
|
-
|
|
2857
|
+
k(this.element, null), this.removeMouseDragListeners(), this.finishRegisteredTransform();
|
|
2847
2858
|
}
|
|
2848
2859
|
removeMouseDragListeners() {
|
|
2849
2860
|
this.window.removeEventListener("mousemove", this.onWindowMouseMove), this.window.removeEventListener("mouseup", this.onWindowMouseUp);
|
|
@@ -2873,8 +2884,8 @@ class J {
|
|
|
2873
2884
|
this.params.onResizeTransformStarted(), this.canvas.patchViewportMatrix(s), this.params.onResizeTransformFinished();
|
|
2874
2885
|
}
|
|
2875
2886
|
}
|
|
2876
|
-
class
|
|
2877
|
-
constructor(e, t, o, s, n, a) {
|
|
2887
|
+
class se {
|
|
2888
|
+
constructor(e, t, o, s, n, a, h) {
|
|
2878
2889
|
i(this, "nodeHorizontal");
|
|
2879
2890
|
i(this, "nodeVertical");
|
|
2880
2891
|
i(this, "viewport");
|
|
@@ -2897,10 +2908,10 @@ class ie {
|
|
|
2897
2908
|
this.userTransformInProgress || this.loadAreaAroundViewport();
|
|
2898
2909
|
});
|
|
2899
2910
|
i(this, "userTransformInProgress", !1);
|
|
2900
|
-
this.canvas = e, this.element = t, this.window = o, this.trigger = n, this.
|
|
2911
|
+
this.canvas = e, this.element = t, this.window = o, this.trigger = n, this.pointInsideVerifier = a, this.params = h, this.nodeHorizontal = this.params.nodeVerticalRadius, this.nodeVertical = this.params.nodeHorizontalRadius, this.viewport = e.viewport, this.currentScale = this.viewport.getViewportMatrix().scale, this.scheduleLoadAreaAroundViewport(), this.viewport.onAfterResize.subscribe(() => {
|
|
2901
2912
|
this.scheduleLoadAreaAroundViewport();
|
|
2902
2913
|
});
|
|
2903
|
-
const
|
|
2914
|
+
const d = {
|
|
2904
2915
|
...s,
|
|
2905
2916
|
onResizeTransformStarted: () => {
|
|
2906
2917
|
this.userTransformInProgress = !0, s.onResizeTransformStarted();
|
|
@@ -2913,28 +2924,30 @@ class ie {
|
|
|
2913
2924
|
},
|
|
2914
2925
|
onTransformChange: () => {
|
|
2915
2926
|
this.userTransformInProgress = !1;
|
|
2916
|
-
const
|
|
2917
|
-
this.currentScale = this.viewport.getViewportMatrix().scale,
|
|
2927
|
+
const c = this.currentScale;
|
|
2928
|
+
this.currentScale = this.viewport.getViewportMatrix().scale, c !== this.currentScale && this.scheduleEnsureViewportAreaLoaded(), s.onTransformChange();
|
|
2918
2929
|
},
|
|
2919
2930
|
onTransformFinished: () => {
|
|
2920
2931
|
this.scheduleLoadAreaAroundViewport(), s.onTransformFinished();
|
|
2921
2932
|
}
|
|
2922
2933
|
};
|
|
2923
|
-
|
|
2934
|
+
j.configure(
|
|
2924
2935
|
e,
|
|
2925
2936
|
this.element,
|
|
2926
2937
|
this.window,
|
|
2927
|
-
|
|
2938
|
+
this.pointInsideVerifier,
|
|
2939
|
+
d
|
|
2928
2940
|
), this.trigger.subscribe(this.updateLoadedArea), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterViewportUpdated);
|
|
2929
2941
|
}
|
|
2930
|
-
static configure(e, t, o, s, n, a) {
|
|
2931
|
-
new
|
|
2942
|
+
static configure(e, t, o, s, n, a, h) {
|
|
2943
|
+
new se(
|
|
2932
2944
|
e,
|
|
2933
2945
|
t,
|
|
2934
2946
|
o,
|
|
2935
2947
|
s,
|
|
2936
2948
|
n,
|
|
2937
|
-
a
|
|
2949
|
+
a,
|
|
2950
|
+
h
|
|
2938
2951
|
);
|
|
2939
2952
|
}
|
|
2940
2953
|
scheduleLoadAreaAroundViewport() {
|
|
@@ -2971,7 +2984,7 @@ const Ot = () => {
|
|
|
2971
2984
|
);
|
|
2972
2985
|
return r.setAttribute("id", "pattern"), r;
|
|
2973
2986
|
};
|
|
2974
|
-
class
|
|
2987
|
+
class ie {
|
|
2975
2988
|
constructor(e, t, o) {
|
|
2976
2989
|
i(this, "svg", Ot());
|
|
2977
2990
|
i(this, "patternRenderingRectangle", zt());
|
|
@@ -2996,7 +3009,7 @@ class ne {
|
|
|
2996
3009
|
}), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterTransformUpdated), this.onAfterTransformUpdated();
|
|
2997
3010
|
}
|
|
2998
3011
|
static configure(e, t, o) {
|
|
2999
|
-
new
|
|
3012
|
+
new ie(e, t, o);
|
|
3000
3013
|
}
|
|
3001
3014
|
updateVisibility() {
|
|
3002
3015
|
const { scale: e } = this.canvas.viewport.getViewportMatrix(), t = e > this.maxViewportScale;
|
|
@@ -3004,53 +3017,55 @@ class ne {
|
|
|
3004
3017
|
}
|
|
3005
3018
|
updateDimensions() {
|
|
3006
3019
|
const { width: e, height: t } = this.canvas.viewport.getDimensions();
|
|
3007
|
-
this.svg.setAttribute("width", `${e}`), this.svg.setAttribute("height", `${t}`), this.patternRenderingRectangle.setAttribute("width", `${e}`), this.patternRenderingRectangle.setAttribute("height", `${t}`)
|
|
3008
|
-
|
|
3009
|
-
|
|
3020
|
+
if (this.svg.setAttribute("width", `${e}`), this.svg.setAttribute("height", `${t}`), this.patternRenderingRectangle.setAttribute("width", `${e}`), this.patternRenderingRectangle.setAttribute("height", `${t}`), e > 0 && t > 0) {
|
|
3021
|
+
const o = this.tileWidth / e, s = this.tileHeight / t;
|
|
3022
|
+
this.pattern.setAttribute("width", `${o}`), this.pattern.setAttribute("height", `${s}`);
|
|
3023
|
+
}
|
|
3010
3024
|
}
|
|
3011
3025
|
}
|
|
3012
|
-
class
|
|
3013
|
-
constructor(e, t, o, s, n) {
|
|
3026
|
+
class ne {
|
|
3027
|
+
constructor(e, t, o, s, n, a) {
|
|
3014
3028
|
i(this, "overlayCanvas");
|
|
3015
3029
|
i(this, "staticPortId", null);
|
|
3016
3030
|
i(this, "isTargetDragging", !0);
|
|
3017
3031
|
i(this, "onEdgeCreated", (e) => {
|
|
3018
3032
|
this.params.onAfterEdgeCreated(e);
|
|
3019
3033
|
});
|
|
3020
|
-
this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.
|
|
3034
|
+
this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.pointInsideVerifier = n, this.params = a, this.overlayCanvas = ke(
|
|
3021
3035
|
this.overlayLayer,
|
|
3022
3036
|
this.viewportStore,
|
|
3023
3037
|
this.window
|
|
3024
|
-
),
|
|
3038
|
+
), G.configure(
|
|
3025
3039
|
this.canvas,
|
|
3026
|
-
this.overlayLayer,
|
|
3027
3040
|
this.window,
|
|
3041
|
+
this.pointInsideVerifier,
|
|
3028
3042
|
{
|
|
3029
3043
|
mouseDownEventVerifier: this.params.mouseDownEventVerifier,
|
|
3030
3044
|
mouseUpEventVerifier: this.params.mouseUpEventVerifier,
|
|
3031
3045
|
onStopDrag: () => {
|
|
3032
3046
|
this.resetDragState();
|
|
3033
3047
|
},
|
|
3034
|
-
onPortPointerDown: (
|
|
3035
|
-
const
|
|
3036
|
-
return
|
|
3048
|
+
onPortPointerDown: (h, d) => {
|
|
3049
|
+
const c = this.params.connectionTypeResolver(h);
|
|
3050
|
+
return c === null ? !1 : (this.grabPort(h, d, c), !0);
|
|
3037
3051
|
},
|
|
3038
|
-
onPointerMove: (
|
|
3039
|
-
this.moveDraggingPort(
|
|
3052
|
+
onPointerMove: (h) => {
|
|
3053
|
+
this.moveDraggingPort(h);
|
|
3040
3054
|
},
|
|
3041
|
-
onPointerUp: (
|
|
3042
|
-
this.tryCreateConnection(
|
|
3055
|
+
onPointerUp: (h) => {
|
|
3056
|
+
this.tryCreateConnection(h);
|
|
3043
3057
|
}
|
|
3044
3058
|
}
|
|
3045
3059
|
);
|
|
3046
3060
|
}
|
|
3047
|
-
static configure(e, t, o, s, n) {
|
|
3048
|
-
new
|
|
3061
|
+
static configure(e, t, o, s, n, a) {
|
|
3062
|
+
new ne(
|
|
3049
3063
|
e,
|
|
3050
3064
|
t,
|
|
3051
3065
|
o,
|
|
3052
3066
|
s,
|
|
3053
|
-
n
|
|
3067
|
+
n,
|
|
3068
|
+
a
|
|
3054
3069
|
);
|
|
3055
3070
|
}
|
|
3056
3071
|
grabPort(e, t, o) {
|
|
@@ -3073,7 +3088,7 @@ class ae {
|
|
|
3073
3088
|
};
|
|
3074
3089
|
this.isTargetDragging = o === "direct";
|
|
3075
3090
|
const [w, p] = this.isTargetDragging ? [g, l] : [l, g];
|
|
3076
|
-
this.overlayCanvas.addNode(
|
|
3091
|
+
this.overlayCanvas.addNode(Y(w)), this.overlayCanvas.addNode(Y(p)), this.overlayCanvas.addEdge({
|
|
3077
3092
|
from: w.overlayNodeId,
|
|
3078
3093
|
to: p.overlayNodeId,
|
|
3079
3094
|
shape: this.params.edgeShapeFactory(M.EdgeId)
|
|
@@ -3083,7 +3098,7 @@ class ae {
|
|
|
3083
3098
|
this.staticPortId = null, this.isTargetDragging = !0, this.overlayCanvas.clear();
|
|
3084
3099
|
}
|
|
3085
3100
|
tryCreateConnection(e) {
|
|
3086
|
-
const t =
|
|
3101
|
+
const t = Ce(this.canvas.graph, e), o = this.staticPortId;
|
|
3087
3102
|
if (t === null) {
|
|
3088
3103
|
this.params.onEdgeCreationInterrupted({
|
|
3089
3104
|
staticPortId: o,
|
|
@@ -3105,8 +3120,8 @@ class ae {
|
|
|
3105
3120
|
});
|
|
3106
3121
|
}
|
|
3107
3122
|
}
|
|
3108
|
-
class
|
|
3109
|
-
constructor(e, t, o, s, n) {
|
|
3123
|
+
class ae {
|
|
3124
|
+
constructor(e, t, o, s, n, a) {
|
|
3110
3125
|
i(this, "overlayCanvas");
|
|
3111
3126
|
i(this, "staticPortId", null);
|
|
3112
3127
|
i(this, "isTargetDragging", !0);
|
|
@@ -3114,37 +3129,38 @@ class he {
|
|
|
3114
3129
|
i(this, "onEdgeReattached", (e) => {
|
|
3115
3130
|
this.params.onAfterEdgeReattached(e);
|
|
3116
3131
|
});
|
|
3117
|
-
this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.
|
|
3132
|
+
this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.pointInsideVerifier = n, this.params = a, this.overlayCanvas = ke(
|
|
3118
3133
|
this.overlayLayer,
|
|
3119
3134
|
this.viewportStore,
|
|
3120
3135
|
this.window
|
|
3121
|
-
),
|
|
3136
|
+
), G.configure(
|
|
3122
3137
|
this.canvas,
|
|
3123
|
-
this.overlayLayer,
|
|
3124
3138
|
this.window,
|
|
3139
|
+
this.pointInsideVerifier,
|
|
3125
3140
|
{
|
|
3126
3141
|
mouseDownEventVerifier: this.params.mouseDownEventVerifier,
|
|
3127
3142
|
mouseUpEventVerifier: this.params.mouseUpEventVerifier,
|
|
3128
3143
|
onStopDrag: () => {
|
|
3129
3144
|
this.resetDragState();
|
|
3130
3145
|
},
|
|
3131
|
-
onPortPointerDown: (
|
|
3132
|
-
onPointerMove: (
|
|
3133
|
-
this.moveDraggingPort(
|
|
3146
|
+
onPortPointerDown: (h, d) => this.tryStartEdgeDragging(h, d),
|
|
3147
|
+
onPointerMove: (h) => {
|
|
3148
|
+
this.moveDraggingPort(h);
|
|
3134
3149
|
},
|
|
3135
|
-
onPointerUp: (
|
|
3136
|
-
this.tryCreateConnection(
|
|
3150
|
+
onPointerUp: (h) => {
|
|
3151
|
+
this.tryCreateConnection(h);
|
|
3137
3152
|
}
|
|
3138
3153
|
}
|
|
3139
3154
|
);
|
|
3140
3155
|
}
|
|
3141
|
-
static configure(e, t, o, s, n) {
|
|
3142
|
-
new
|
|
3156
|
+
static configure(e, t, o, s, n, a) {
|
|
3157
|
+
new ae(
|
|
3143
3158
|
e,
|
|
3144
3159
|
t,
|
|
3145
3160
|
o,
|
|
3146
3161
|
s,
|
|
3147
|
-
n
|
|
3162
|
+
n,
|
|
3163
|
+
a
|
|
3148
3164
|
);
|
|
3149
3165
|
}
|
|
3150
3166
|
tryStartEdgeDragging(e, t) {
|
|
@@ -3179,7 +3195,7 @@ class he {
|
|
|
3179
3195
|
portCoords: p,
|
|
3180
3196
|
portDirection: d.direction
|
|
3181
3197
|
}, [x, E] = this.isTargetDragging ? [y, f] : [f, y];
|
|
3182
|
-
this.overlayCanvas.addNode(
|
|
3198
|
+
this.overlayCanvas.addNode(Y(x)), this.overlayCanvas.addNode(Y(E));
|
|
3183
3199
|
const b = this.params.draggingEdgeShapeFactory !== null ? this.params.draggingEdgeShapeFactory(M.EdgeId) : s.shape;
|
|
3184
3200
|
return this.overlayCanvas.addEdge({
|
|
3185
3201
|
id: M.EdgeId,
|
|
@@ -3202,7 +3218,7 @@ class he {
|
|
|
3202
3218
|
});
|
|
3203
3219
|
}
|
|
3204
3220
|
tryCreateConnection(e) {
|
|
3205
|
-
const t =
|
|
3221
|
+
const t = Ce(this.canvas.graph, e);
|
|
3206
3222
|
if (this.overlayCanvas.removeEdge(M.EdgeId), t === null) {
|
|
3207
3223
|
const d = this.draggingEdgePayload;
|
|
3208
3224
|
this.params.onEdgeReattachInterrupted({
|
|
@@ -3235,17 +3251,17 @@ class he {
|
|
|
3235
3251
|
}
|
|
3236
3252
|
}
|
|
3237
3253
|
}
|
|
3238
|
-
class
|
|
3254
|
+
class he {
|
|
3239
3255
|
constructor(e, t) {
|
|
3240
3256
|
this.applier = e, this.trigger = t, this.trigger.subscribe(() => {
|
|
3241
3257
|
this.applier.apply();
|
|
3242
3258
|
});
|
|
3243
3259
|
}
|
|
3244
3260
|
static configure(e, t) {
|
|
3245
|
-
new
|
|
3261
|
+
new he(e, t);
|
|
3246
3262
|
}
|
|
3247
3263
|
}
|
|
3248
|
-
class
|
|
3264
|
+
class de {
|
|
3249
3265
|
constructor(e, t, o) {
|
|
3250
3266
|
i(this, "applyScheduled", !1);
|
|
3251
3267
|
i(this, "apply", () => {
|
|
@@ -3262,7 +3278,7 @@ class ce {
|
|
|
3262
3278
|
});
|
|
3263
3279
|
}
|
|
3264
3280
|
static configure(e, t, o) {
|
|
3265
|
-
new
|
|
3281
|
+
new de(
|
|
3266
3282
|
e,
|
|
3267
3283
|
t,
|
|
3268
3284
|
o
|
|
@@ -3281,14 +3297,14 @@ class Yt {
|
|
|
3281
3297
|
});
|
|
3282
3298
|
switch (o.type) {
|
|
3283
3299
|
case "trigger": {
|
|
3284
|
-
|
|
3300
|
+
he.configure(
|
|
3285
3301
|
s,
|
|
3286
3302
|
o.trigger
|
|
3287
3303
|
);
|
|
3288
3304
|
break;
|
|
3289
3305
|
}
|
|
3290
3306
|
case "topologyChangeSchedule": {
|
|
3291
|
-
|
|
3307
|
+
de.configure(
|
|
3292
3308
|
e.graph,
|
|
3293
3309
|
s,
|
|
3294
3310
|
o.schedule
|
|
@@ -3313,7 +3329,7 @@ class Xt {
|
|
|
3313
3329
|
this.win = e, this.callback = t, this.win.requestAnimationFrame(this.step);
|
|
3314
3330
|
}
|
|
3315
3331
|
}
|
|
3316
|
-
class
|
|
3332
|
+
class ce {
|
|
3317
3333
|
constructor(e, t, o) {
|
|
3318
3334
|
i(this, "applier");
|
|
3319
3335
|
i(this, "step", (e) => {
|
|
@@ -3326,14 +3342,11 @@ class le {
|
|
|
3326
3342
|
}), new Xt(this.win, this.step);
|
|
3327
3343
|
}
|
|
3328
3344
|
static configure(e, t, o) {
|
|
3329
|
-
new
|
|
3345
|
+
new ce(e, t, o);
|
|
3330
3346
|
}
|
|
3331
3347
|
}
|
|
3332
|
-
class
|
|
3333
|
-
constructor(e) {
|
|
3334
|
-
i(this, "element");
|
|
3335
|
-
i(this, "canvas");
|
|
3336
|
-
i(this, "window");
|
|
3348
|
+
class le {
|
|
3349
|
+
constructor(e, t, o, s) {
|
|
3337
3350
|
i(this, "onNodeSelected");
|
|
3338
3351
|
i(this, "mouseDownEventVerifier");
|
|
3339
3352
|
i(this, "mouseUpEventVerifier");
|
|
@@ -3393,12 +3406,7 @@ class ue {
|
|
|
3393
3406
|
});
|
|
3394
3407
|
i(this, "onWindowMouseMove", (e) => {
|
|
3395
3408
|
const t = e, o = this.previousMouse, s = t.clientX - o.x, n = t.clientY - o.y;
|
|
3396
|
-
if (!
|
|
3397
|
-
this.window,
|
|
3398
|
-
this.element,
|
|
3399
|
-
t.clientX,
|
|
3400
|
-
t.clientY
|
|
3401
|
-
)) {
|
|
3409
|
+
if (!this.pointInsideVerifier.verify(t.clientX, t.clientY)) {
|
|
3402
3410
|
this.removeWindowMouseListeners();
|
|
3403
3411
|
return;
|
|
3404
3412
|
}
|
|
@@ -3413,7 +3421,7 @@ class ue {
|
|
|
3413
3421
|
return;
|
|
3414
3422
|
}
|
|
3415
3423
|
const o = t.touches[0];
|
|
3416
|
-
if (!
|
|
3424
|
+
if (!this.pointInsideVerifier.verify(o.clientX, o.clientY)) {
|
|
3417
3425
|
this.removeWindowTouchListeners();
|
|
3418
3426
|
return;
|
|
3419
3427
|
}
|
|
@@ -3432,10 +3440,15 @@ class ue {
|
|
|
3432
3440
|
i(this, "onWindowTouchCancel", () => {
|
|
3433
3441
|
this.removeWindowTouchListeners();
|
|
3434
3442
|
});
|
|
3435
|
-
this.
|
|
3443
|
+
this.canvas = e, this.window = t, this.pointInsideVerifier = o, this.mouseDownEventVerifier = s.mouseDownEventVerifier, this.mouseUpEventVerifier = s.mouseUpEventVerifier, this.onNodeSelected = s.onNodeSelected, this.movementThreshold = s.movementThreshold, this.canvas.graph.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.canvas.graph.onBeforeNodeRemoved.subscribe(this.onBeforeNodeRemoved), this.canvas.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.revert);
|
|
3436
3444
|
}
|
|
3437
|
-
static configure(e) {
|
|
3438
|
-
new
|
|
3445
|
+
static configure(e, t, o, s) {
|
|
3446
|
+
new le(
|
|
3447
|
+
e,
|
|
3448
|
+
t,
|
|
3449
|
+
o,
|
|
3450
|
+
s
|
|
3451
|
+
);
|
|
3439
3452
|
}
|
|
3440
3453
|
removeWindowMouseListeners() {
|
|
3441
3454
|
this.window.removeEventListener("mouseup", this.onWindowMouseUp), this.window.removeEventListener("mousemove", this.onWindowMouseMove);
|
|
@@ -3452,11 +3465,8 @@ class ue {
|
|
|
3452
3465
|
this.movedDistance += s, this.movedDistance > this.movementThreshold && o();
|
|
3453
3466
|
}
|
|
3454
3467
|
}
|
|
3455
|
-
class
|
|
3456
|
-
constructor(e) {
|
|
3457
|
-
i(this, "element");
|
|
3458
|
-
i(this, "canvas");
|
|
3459
|
-
i(this, "window");
|
|
3468
|
+
class ue {
|
|
3469
|
+
constructor(e, t, o, s, n) {
|
|
3460
3470
|
i(this, "onCanvasSelected");
|
|
3461
3471
|
i(this, "movementThreshold");
|
|
3462
3472
|
i(this, "mouseDownEventVerifier");
|
|
@@ -3487,12 +3497,7 @@ class ge {
|
|
|
3487
3497
|
});
|
|
3488
3498
|
i(this, "onWindowMouseMove", (e) => {
|
|
3489
3499
|
const t = e;
|
|
3490
|
-
if (!
|
|
3491
|
-
this.window,
|
|
3492
|
-
this.element,
|
|
3493
|
-
t.clientX,
|
|
3494
|
-
t.clientY
|
|
3495
|
-
)) {
|
|
3500
|
+
if (!this.pointInsideVerifier.verify(t.clientX, t.clientY)) {
|
|
3496
3501
|
this.removeWindowMouseListeners();
|
|
3497
3502
|
return;
|
|
3498
3503
|
}
|
|
@@ -3508,7 +3513,7 @@ class ge {
|
|
|
3508
3513
|
return;
|
|
3509
3514
|
}
|
|
3510
3515
|
const o = t.touches[0];
|
|
3511
|
-
if (!
|
|
3516
|
+
if (!this.pointInsideVerifier.verify(o.clientX, o.clientY)) {
|
|
3512
3517
|
this.removeWindowTouchListeners();
|
|
3513
3518
|
return;
|
|
3514
3519
|
}
|
|
@@ -3532,14 +3537,20 @@ class ge {
|
|
|
3532
3537
|
i(this, "restore", () => {
|
|
3533
3538
|
this.element.removeEventListener("mousedown", this.onMouseDown), this.element.removeEventListener("touchstart", this.onTouchStart), this.removeWindowMouseListeners(), this.removeWindowTouchListeners();
|
|
3534
3539
|
});
|
|
3535
|
-
this.
|
|
3540
|
+
this.canvas = e, this.element = t, this.window = o, this.pointInsideVerifier = s, this.onCanvasSelected = n.onCanvasSelected, this.movementThreshold = n.movementThreshold, this.mouseDownEventVerifier = n.mouseDownEventVerifier, this.mouseUpEventVerifier = n.mouseUpEventVerifier, this.canvas.onBeforeDestroy.subscribe(this.restore), this.element.addEventListener("mousedown", this.onMouseDown, {
|
|
3536
3541
|
passive: !0
|
|
3537
3542
|
}), this.element.addEventListener("touchstart", this.onTouchStart, {
|
|
3538
3543
|
passive: !0
|
|
3539
3544
|
});
|
|
3540
3545
|
}
|
|
3541
|
-
static configure(e) {
|
|
3542
|
-
new
|
|
3546
|
+
static configure(e, t, o, s, n) {
|
|
3547
|
+
new ue(
|
|
3548
|
+
e,
|
|
3549
|
+
t,
|
|
3550
|
+
o,
|
|
3551
|
+
s,
|
|
3552
|
+
n
|
|
3553
|
+
);
|
|
3543
3554
|
}
|
|
3544
3555
|
removeWindowMouseListeners() {
|
|
3545
3556
|
this.window.removeEventListener("mousemove", this.onWindowMouseMove), this.window.removeEventListener("mouseup", this.onWindowMouseUp);
|
|
@@ -3555,19 +3566,19 @@ class ge {
|
|
|
3555
3566
|
const Ht = () => {
|
|
3556
3567
|
const r = document.createElement("div");
|
|
3557
3568
|
return r.style.width = "100%", r.style.height = "100%", r.style.position = "relative", r;
|
|
3558
|
-
},
|
|
3569
|
+
}, Q = () => {
|
|
3559
3570
|
const r = document.createElement("div");
|
|
3560
3571
|
return r.style.position = "absolute", r.style.inset = "0", r;
|
|
3561
|
-
},
|
|
3562
|
-
const r =
|
|
3572
|
+
}, xe = () => {
|
|
3573
|
+
const r = Q();
|
|
3563
3574
|
return r.style.pointerEvents = "none", r;
|
|
3564
3575
|
};
|
|
3565
3576
|
class Gt {
|
|
3566
3577
|
constructor(e) {
|
|
3567
|
-
i(this, "background",
|
|
3568
|
-
i(this, "main",
|
|
3569
|
-
i(this, "overlayConnectablePorts",
|
|
3570
|
-
i(this, "overlayDraggableEdges",
|
|
3578
|
+
i(this, "background", Q());
|
|
3579
|
+
i(this, "main", Q());
|
|
3580
|
+
i(this, "overlayConnectablePorts", xe());
|
|
3581
|
+
i(this, "overlayDraggableEdges", xe());
|
|
3571
3582
|
i(this, "host", Ht());
|
|
3572
3583
|
this.element = e, this.element.appendChild(this.host), this.host.appendChild(this.background), this.host.appendChild(this.main), this.host.appendChild(this.overlayConnectablePorts), this.host.appendChild(this.overlayDraggableEdges);
|
|
3573
3584
|
}
|
|
@@ -3632,7 +3643,7 @@ const jt = (r) => {
|
|
|
3632
3643
|
canvasHeight: e.canvasHeight
|
|
3633
3644
|
}),
|
|
3634
3645
|
e.nextTransform
|
|
3635
|
-
),
|
|
3646
|
+
), Ee = (r) => {
|
|
3636
3647
|
if (typeof r == "function")
|
|
3637
3648
|
return r;
|
|
3638
3649
|
switch (r.type) {
|
|
@@ -3649,18 +3660,18 @@ const jt = (r) => {
|
|
|
3649
3660
|
maxY: r.maxY ?? 1 / 0
|
|
3650
3661
|
});
|
|
3651
3662
|
}
|
|
3652
|
-
},
|
|
3653
|
-
var p, y, f, x, E, b, T, C, I, U,
|
|
3663
|
+
}, Ae = (r) => {
|
|
3664
|
+
var p, y, f, x, E, b, T, C, I, F, U, pe;
|
|
3654
3665
|
const e = (p = r == null ? void 0 : r.scale) == null ? void 0 : p.mouseWheelSensitivity, t = e !== void 0 ? e : 1.2, o = r == null ? void 0 : r.transformPreprocessor;
|
|
3655
3666
|
let s;
|
|
3656
3667
|
o !== void 0 ? Array.isArray(o) ? s = Qt(
|
|
3657
3668
|
o.map(
|
|
3658
|
-
(
|
|
3669
|
+
(D) => Ee(D)
|
|
3659
3670
|
)
|
|
3660
|
-
) : s =
|
|
3671
|
+
) : s = Ee(o) : s = (D) => D.nextTransform;
|
|
3661
3672
|
const n = ((y = r == null ? void 0 : r.shift) == null ? void 0 : y.cursor) !== void 0 ? r.shift.cursor : "grab", a = ((f = r == null ? void 0 : r.events) == null ? void 0 : f.onBeforeTransformChange) ?? (() => {
|
|
3662
3673
|
}), h = ((x = r == null ? void 0 : r.events) == null ? void 0 : x.onTransformChange) ?? (() => {
|
|
3663
|
-
}), d = (E = r == null ? void 0 : r.shift) == null ? void 0 : E.mouseDownEventVerifier, c = d !== void 0 ? d : (
|
|
3674
|
+
}), d = (E = r == null ? void 0 : r.shift) == null ? void 0 : E.mouseDownEventVerifier, c = d !== void 0 ? d : (D) => D.button === 0, u = (b = r == null ? void 0 : r.shift) == null ? void 0 : b.mouseUpEventVerifier, g = u !== void 0 ? u : (D) => D.button === 0, l = (T = r == null ? void 0 : r.scale) == null ? void 0 : T.mouseWheelEventVerifier, w = l !== void 0 ? l : () => !0;
|
|
3664
3675
|
return {
|
|
3665
3676
|
wheelSensitivity: t,
|
|
3666
3677
|
onTransformStarted: ((C = r == null ? void 0 : r.events) == null ? void 0 : C.onTransformStarted) ?? (() => {
|
|
@@ -3674,10 +3685,10 @@ const jt = (r) => {
|
|
|
3674
3685
|
mouseDownEventVerifier: c,
|
|
3675
3686
|
mouseUpEventVerifier: g,
|
|
3676
3687
|
mouseWheelEventVerifier: w,
|
|
3677
|
-
scaleWheelFinishTimeout: ((
|
|
3678
|
-
onResizeTransformStarted: ((
|
|
3688
|
+
scaleWheelFinishTimeout: ((F = r == null ? void 0 : r.scale) == null ? void 0 : F.wheelFinishTimeout) ?? 500,
|
|
3689
|
+
onResizeTransformStarted: ((U = r == null ? void 0 : r.events) == null ? void 0 : U.onResizeTransformStarted) ?? (() => {
|
|
3679
3690
|
}),
|
|
3680
|
-
onResizeTransformFinished: ((
|
|
3691
|
+
onResizeTransformFinished: ((pe = r == null ? void 0 : r.events) == null ? void 0 : pe.onResizeTransformFinished) ?? (() => {
|
|
3681
3692
|
})
|
|
3682
3693
|
};
|
|
3683
3694
|
}, Zt = (r, e) => {
|
|
@@ -3697,7 +3708,7 @@ const jt = (r) => {
|
|
|
3697
3708
|
renderer: s,
|
|
3698
3709
|
maxViewportScale: r.maxViewportScale ?? 10
|
|
3699
3710
|
};
|
|
3700
|
-
},
|
|
3711
|
+
}, ge = (r) => {
|
|
3701
3712
|
if (typeof r == "function")
|
|
3702
3713
|
return r;
|
|
3703
3714
|
switch (r.type) {
|
|
@@ -3782,7 +3793,7 @@ const jt = (r) => {
|
|
|
3782
3793
|
onEdgeCreationInterrupted: ((u = r.events) == null ? void 0 : u.onEdgeCreationInterrupted) ?? d,
|
|
3783
3794
|
onEdgeCreationPrevented: ((g = r.events) == null ? void 0 : g.onEdgeCreationPrevented) ?? h,
|
|
3784
3795
|
dragPortDirection: r.dragPortDirection ?? t,
|
|
3785
|
-
edgeShapeFactory: r.edgeShape !== void 0 ?
|
|
3796
|
+
edgeShapeFactory: r.edgeShape !== void 0 ? ge(r.edgeShape) : e
|
|
3786
3797
|
};
|
|
3787
3798
|
}, tr = (r, e) => {
|
|
3788
3799
|
var c, u, g;
|
|
@@ -3798,7 +3809,7 @@ const jt = (r) => {
|
|
|
3798
3809
|
mouseDownEventVerifier: r.mouseDownEventVerifier ?? o,
|
|
3799
3810
|
mouseUpEventVerifier: r.mouseUpEventVerifier ?? s,
|
|
3800
3811
|
draggingEdgeResolver: r.draggingEdgeResolver ?? n,
|
|
3801
|
-
draggingEdgeShapeFactory: r.draggingEdgeShape !== void 0 ?
|
|
3812
|
+
draggingEdgeShapeFactory: r.draggingEdgeShape !== void 0 ? ge(r.draggingEdgeShape) : null,
|
|
3802
3813
|
onAfterEdgeReattached: ((c = r.events) == null ? void 0 : c.onAfterEdgeReattached) ?? a,
|
|
3803
3814
|
onEdgeReattachInterrupted: ((u = r.events) == null ? void 0 : u.onEdgeReattachInterrupted) ?? d,
|
|
3804
3815
|
onEdgeReattachPrevented: ((g = r.events) == null ? void 0 : g.onEdgeReattachPrevented) ?? h
|
|
@@ -3821,7 +3832,7 @@ class sr extends Error {
|
|
|
3821
3832
|
i(this, "name", "CanvasBuilderError");
|
|
3822
3833
|
}
|
|
3823
3834
|
}
|
|
3824
|
-
class
|
|
3835
|
+
class Ye {
|
|
3825
3836
|
constructor(e, t, o) {
|
|
3826
3837
|
i(this, "dt");
|
|
3827
3838
|
i(this, "nodeMass");
|
|
@@ -3859,7 +3870,7 @@ class Xe {
|
|
|
3859
3870
|
});
|
|
3860
3871
|
}
|
|
3861
3872
|
}
|
|
3862
|
-
class
|
|
3873
|
+
class Xe {
|
|
3863
3874
|
constructor(e) {
|
|
3864
3875
|
i(this, "PI2", 2 * Math.PI);
|
|
3865
3876
|
this.rand = e;
|
|
@@ -3878,7 +3889,7 @@ class He {
|
|
|
3878
3889
|
return { ex: h, ey: d, d: a };
|
|
3879
3890
|
}
|
|
3880
3891
|
}
|
|
3881
|
-
const
|
|
3892
|
+
const He = (r) => {
|
|
3882
3893
|
if (r.distance === 0)
|
|
3883
3894
|
return r.maxForce;
|
|
3884
3895
|
const e = r.coefficient * (r.sourceCharge * r.targetCharge / (r.distance * r.distance));
|
|
@@ -3899,7 +3910,7 @@ class ir {
|
|
|
3899
3910
|
const d = o[h], c = e.get(a), u = e.get(d), g = this.distanceVectorGenerator.create(
|
|
3900
3911
|
c,
|
|
3901
3912
|
u
|
|
3902
|
-
), l =
|
|
3913
|
+
), l = He({
|
|
3903
3914
|
coefficient: 1,
|
|
3904
3915
|
sourceCharge: this.nodeCharge,
|
|
3905
3916
|
targetCharge: this.nodeCharge,
|
|
@@ -4213,7 +4224,7 @@ class hr {
|
|
|
4213
4224
|
const t = this.distanceVectorGenerator.create(
|
|
4214
4225
|
e.sourceCoords,
|
|
4215
4226
|
e.targetCoords
|
|
4216
|
-
), o =
|
|
4227
|
+
), o = He({
|
|
4217
4228
|
coefficient: this.nodeForceCoefficient,
|
|
4218
4229
|
sourceCharge: e.sourceCharge,
|
|
4219
4230
|
targetCharge: e.targetCharge,
|
|
@@ -4248,7 +4259,7 @@ class hr {
|
|
|
4248
4259
|
}
|
|
4249
4260
|
}
|
|
4250
4261
|
}
|
|
4251
|
-
const
|
|
4262
|
+
const Ge = (r) => r.theta !== 0 ? new hr({
|
|
4252
4263
|
nodeCharge: r.nodeCharge,
|
|
4253
4264
|
nodeForceCoefficient: r.nodeForceCoefficient,
|
|
4254
4265
|
distanceVectorGenerator: r.distanceVectorGenerator,
|
|
@@ -4262,7 +4273,7 @@ const je = (r) => r.theta !== 0 ? new hr({
|
|
|
4262
4273
|
distanceVectorGenerator: r.distanceVectorGenerator,
|
|
4263
4274
|
maxForce: r.maxForce
|
|
4264
4275
|
});
|
|
4265
|
-
class
|
|
4276
|
+
class je {
|
|
4266
4277
|
constructor(e) {
|
|
4267
4278
|
i(this, "rand");
|
|
4268
4279
|
i(this, "sparsity");
|
|
@@ -4296,7 +4307,7 @@ class dr {
|
|
|
4296
4307
|
i(this, "edgeEquilibriumLength");
|
|
4297
4308
|
i(this, "edgeStiffness");
|
|
4298
4309
|
i(this, "convergenceVelocity");
|
|
4299
|
-
this.maxIterations = e.maxIterations, this.dtSec = e.dtSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.convergenceVelocity = e.convergenceVelocity, this.distanceVectorGenerator = new
|
|
4310
|
+
this.maxIterations = e.maxIterations, this.dtSec = e.dtSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.convergenceVelocity = e.convergenceVelocity, this.distanceVectorGenerator = new Xe(e.rand), this.nodeForcesApplicationStrategy = Ge({
|
|
4300
4311
|
distanceVectorGenerator: this.distanceVectorGenerator,
|
|
4301
4312
|
nodeCharge: e.nodeCharge,
|
|
4302
4313
|
maxForce: e.maxForce,
|
|
@@ -4304,7 +4315,7 @@ class dr {
|
|
|
4304
4315
|
theta: e.barnesHutTheta,
|
|
4305
4316
|
areaRadiusThreshold: e.barnesHutAreaRadiusThreshold,
|
|
4306
4317
|
nodeMass: e.nodeMass
|
|
4307
|
-
}), this.fillerLayoutAlgorithm = new
|
|
4318
|
+
}), this.fillerLayoutAlgorithm = new je({
|
|
4308
4319
|
rand: e.rand,
|
|
4309
4320
|
sparsity: e.edgeEquilibriumLength
|
|
4310
4321
|
});
|
|
@@ -4314,7 +4325,7 @@ class dr {
|
|
|
4314
4325
|
graph: t,
|
|
4315
4326
|
viewport: o
|
|
4316
4327
|
});
|
|
4317
|
-
for (let n = 0; n < this.maxIterations && !(new
|
|
4328
|
+
for (let n = 0; n < this.maxIterations && !(new Ye(
|
|
4318
4329
|
t,
|
|
4319
4330
|
s,
|
|
4320
4331
|
{
|
|
@@ -4331,12 +4342,12 @@ class dr {
|
|
|
4331
4342
|
}
|
|
4332
4343
|
}
|
|
4333
4344
|
class cr {
|
|
4334
|
-
constructor(e) {
|
|
4345
|
+
constructor(e, t) {
|
|
4335
4346
|
i(this, "forest", /* @__PURE__ */ new Set());
|
|
4336
4347
|
i(this, "remainingNodeIds");
|
|
4337
|
-
for (this.graph = e, this.remainingNodeIds = new Set(this.graph.getAllNodeIds()); this.remainingNodeIds.size > 0; ) {
|
|
4338
|
-
const [
|
|
4339
|
-
this.traverse(
|
|
4348
|
+
for (this.graph = e, this.nextLayerNodesResolver = t, this.remainingNodeIds = new Set(this.graph.getAllNodeIds()); this.remainingNodeIds.size > 0; ) {
|
|
4349
|
+
const [o] = this.remainingNodeIds;
|
|
4350
|
+
this.traverse(o);
|
|
4340
4351
|
}
|
|
4341
4352
|
}
|
|
4342
4353
|
generate() {
|
|
@@ -4353,26 +4364,20 @@ class cr {
|
|
|
4353
4364
|
const n = [];
|
|
4354
4365
|
s.forEach((a) => {
|
|
4355
4366
|
o.push(a);
|
|
4356
|
-
const h = this.
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
}), d = this.graph.getNodeIncomingEdgeIds(a.nodeId).map((u) => {
|
|
4360
|
-
const g = this.graph.getEdge(u);
|
|
4361
|
-
return this.graph.getPort(g.from).nodeId;
|
|
4367
|
+
const h = this.nextLayerNodesResolver({
|
|
4368
|
+
graph: this.graph,
|
|
4369
|
+
currentNodeId: a.nodeId
|
|
4362
4370
|
});
|
|
4363
|
-
(
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
this.remainingNodeIds.delete(u);
|
|
4370
|
-
const g = {
|
|
4371
|
-
nodeId: u,
|
|
4371
|
+
for (const d of h) {
|
|
4372
|
+
if (!this.remainingNodeIds.has(d))
|
|
4373
|
+
continue;
|
|
4374
|
+
this.remainingNodeIds.delete(d);
|
|
4375
|
+
const c = {
|
|
4376
|
+
nodeId: d,
|
|
4372
4377
|
children: /* @__PURE__ */ new Set()
|
|
4373
4378
|
};
|
|
4374
|
-
a.children.add(
|
|
4375
|
-
}
|
|
4379
|
+
a.children.add(c), n.push(c);
|
|
4380
|
+
}
|
|
4376
4381
|
}), s = n;
|
|
4377
4382
|
}
|
|
4378
4383
|
}
|
|
@@ -4450,7 +4455,10 @@ class gr {
|
|
|
4450
4455
|
this.params = e;
|
|
4451
4456
|
}
|
|
4452
4457
|
calculateCoordinates(e) {
|
|
4453
|
-
const t = /* @__PURE__ */ new Map(), s = new cr(
|
|
4458
|
+
const t = /* @__PURE__ */ new Map(), s = new cr(
|
|
4459
|
+
e.graph,
|
|
4460
|
+
this.params.nextLayerNodesResolver
|
|
4461
|
+
).generate();
|
|
4454
4462
|
let n = 0;
|
|
4455
4463
|
return s.forEach((a) => {
|
|
4456
4464
|
t.set(a.root.nodeId, { x: n, y: 0 });
|
|
@@ -4475,7 +4483,29 @@ class gr {
|
|
|
4475
4483
|
}), t;
|
|
4476
4484
|
}
|
|
4477
4485
|
}
|
|
4478
|
-
|
|
4486
|
+
const pr = (r) => {
|
|
4487
|
+
const { graph: e, currentNodeId: t } = r, o = e.getNodeOutgoingEdgeIds(t).map((n) => {
|
|
4488
|
+
const a = e.getEdge(n);
|
|
4489
|
+
return e.getPort(a.to).nodeId;
|
|
4490
|
+
}), s = e.getNodeIncomingEdgeIds(t).map((n) => {
|
|
4491
|
+
const a = e.getEdge(n);
|
|
4492
|
+
return e.getPort(a.from).nodeId;
|
|
4493
|
+
});
|
|
4494
|
+
return /* @__PURE__ */ new Set([...o, ...s]);
|
|
4495
|
+
}, wr = (r) => {
|
|
4496
|
+
const { graph: e, currentNodeId: t } = r, o = e.getNodeOutgoingEdgeIds(t).map((s) => {
|
|
4497
|
+
const n = e.getEdge(s);
|
|
4498
|
+
return e.getPort(n.to).nodeId;
|
|
4499
|
+
});
|
|
4500
|
+
return new Set(o);
|
|
4501
|
+
}, yr = (r) => {
|
|
4502
|
+
const { graph: e, currentNodeId: t } = r, o = e.getNodeIncomingEdgeIds(t).map((s) => {
|
|
4503
|
+
const n = e.getEdge(s);
|
|
4504
|
+
return e.getPort(n.from).nodeId;
|
|
4505
|
+
});
|
|
4506
|
+
return new Set(o);
|
|
4507
|
+
};
|
|
4508
|
+
class fr {
|
|
4479
4509
|
constructor(e) {
|
|
4480
4510
|
i(this, "distanceVectorGenerator");
|
|
4481
4511
|
i(this, "nodeForcesApplicationStrategy");
|
|
@@ -4485,7 +4515,7 @@ class pr {
|
|
|
4485
4515
|
i(this, "edgeEquilibriumLength");
|
|
4486
4516
|
i(this, "edgeStiffness");
|
|
4487
4517
|
i(this, "fillerLayoutAlgorithm");
|
|
4488
|
-
this.convergenceVelocity = e.convergenceVelocity, this.maxTimeDeltaSec = e.maxTimeDeltaSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.distanceVectorGenerator = new
|
|
4518
|
+
this.convergenceVelocity = e.convergenceVelocity, this.maxTimeDeltaSec = e.maxTimeDeltaSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.distanceVectorGenerator = new Xe(e.rand), this.nodeForcesApplicationStrategy = Ge({
|
|
4489
4519
|
distanceVectorGenerator: this.distanceVectorGenerator,
|
|
4490
4520
|
nodeCharge: e.nodeCharge,
|
|
4491
4521
|
maxForce: e.maxForce,
|
|
@@ -4493,7 +4523,7 @@ class pr {
|
|
|
4493
4523
|
theta: e.barnesHutTheta,
|
|
4494
4524
|
areaRadiusThreshold: e.barnesHutAreaRadiusThreshold,
|
|
4495
4525
|
nodeMass: e.nodeMass
|
|
4496
|
-
}), this.fillerLayoutAlgorithm = new
|
|
4526
|
+
}), this.fillerLayoutAlgorithm = new je({
|
|
4497
4527
|
rand: e.rand,
|
|
4498
4528
|
sparsity: e.edgeEquilibriumLength
|
|
4499
4529
|
});
|
|
@@ -4503,7 +4533,7 @@ class pr {
|
|
|
4503
4533
|
graph: t,
|
|
4504
4534
|
viewport: o
|
|
4505
4535
|
});
|
|
4506
|
-
return new
|
|
4536
|
+
return new Ye(
|
|
4507
4537
|
t,
|
|
4508
4538
|
n,
|
|
4509
4539
|
{
|
|
@@ -4520,12 +4550,12 @@ class pr {
|
|
|
4520
4550
|
}) ? /* @__PURE__ */ new Map() : n;
|
|
4521
4551
|
}
|
|
4522
4552
|
}
|
|
4523
|
-
const
|
|
4553
|
+
const Je = (r) => {
|
|
4524
4554
|
let e = 1779033703, t = 3144134277, o = 1013904242, s = 2773480762;
|
|
4525
4555
|
for (let n = 0, a; n < r.length; n++)
|
|
4526
4556
|
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);
|
|
4527
4557
|
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];
|
|
4528
|
-
},
|
|
4558
|
+
}, Ke = (r, e, t, o) => function() {
|
|
4529
4559
|
r |= 0, e |= 0, t |= 0, o |= 0;
|
|
4530
4560
|
const s = (r + e | 0) + o | 0;
|
|
4531
4561
|
return o = o + 1 | 0, r = e ^ e >>> 9, e = t + (t << 3) | 0, t = t << 21 | t >>> 11, t = t + s | 0, (s >>> 0) / 4294967296;
|
|
@@ -4543,18 +4573,18 @@ const Ke = (r) => {
|
|
|
4543
4573
|
nodeForceCoefficient: 1,
|
|
4544
4574
|
barnesHutAreaRadiusThreshold: 0.01,
|
|
4545
4575
|
barnesHutTheta: 1
|
|
4546
|
-
}),
|
|
4576
|
+
}), V = Object.freeze({
|
|
4547
4577
|
mouseDownEventVerifier: (r) => r.button === 0,
|
|
4548
4578
|
mouseUpEventVerifier: (r) => r.button === 0,
|
|
4549
4579
|
movementThreshold: 10
|
|
4550
|
-
}),
|
|
4580
|
+
}), vr = (r) => {
|
|
4551
4581
|
var e, t;
|
|
4552
4582
|
switch (r == null ? void 0 : r.type) {
|
|
4553
4583
|
case "custom":
|
|
4554
4584
|
return r.instance;
|
|
4555
4585
|
default: {
|
|
4556
|
-
const o =
|
|
4557
|
-
return new
|
|
4586
|
+
const o = Je((r == null ? void 0 : r.seed) ?? A.seed), s = Ke(o[0], o[1], o[2], o[3]);
|
|
4587
|
+
return new fr({
|
|
4558
4588
|
rand: s,
|
|
4559
4589
|
maxTimeDeltaSec: (r == null ? void 0 : r.maxTimeDeltaSec) ?? A.maxTimeDeltaSec,
|
|
4560
4590
|
nodeCharge: (r == null ? void 0 : r.nodeCharge) ?? A.nodeCharge,
|
|
@@ -4569,30 +4599,30 @@ const Ke = (r) => {
|
|
|
4569
4599
|
});
|
|
4570
4600
|
}
|
|
4571
4601
|
}
|
|
4572
|
-
},
|
|
4602
|
+
}, K = {
|
|
4573
4603
|
staticNodeResolver: () => !1,
|
|
4574
4604
|
onBeforeApplied: () => {
|
|
4575
4605
|
},
|
|
4576
4606
|
onAfterApplied: () => {
|
|
4577
4607
|
}
|
|
4578
|
-
},
|
|
4608
|
+
}, mr = (r) => {
|
|
4579
4609
|
var t, o;
|
|
4580
4610
|
return {
|
|
4581
|
-
algorithm:
|
|
4582
|
-
staticNodeResolver: (r == null ? void 0 : r.staticNodeResolver) ??
|
|
4583
|
-
onBeforeApplied: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeApplied) ??
|
|
4584
|
-
onAfterApplied: ((o = r == null ? void 0 : r.events) == null ? void 0 : o.onAfterApplied) ??
|
|
4611
|
+
algorithm: vr((r == null ? void 0 : r.algorithm) ?? {}),
|
|
4612
|
+
staticNodeResolver: (r == null ? void 0 : r.staticNodeResolver) ?? K.staticNodeResolver,
|
|
4613
|
+
onBeforeApplied: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeApplied) ?? K.onBeforeApplied,
|
|
4614
|
+
onAfterApplied: ((o = r == null ? void 0 : r.events) == null ? void 0 : o.onAfterApplied) ?? K.onAfterApplied
|
|
4585
4615
|
};
|
|
4586
|
-
},
|
|
4616
|
+
}, xr = (r) => r instanceof _ ? {
|
|
4587
4617
|
type: "trigger",
|
|
4588
4618
|
trigger: r
|
|
4589
4619
|
} : (r == null ? void 0 : r.type) === "topologyChangeMacrotask" ? {
|
|
4590
4620
|
type: "topologyChangeSchedule",
|
|
4591
|
-
schedule:
|
|
4621
|
+
schedule: Ft
|
|
4592
4622
|
} : {
|
|
4593
4623
|
type: "topologyChangeSchedule",
|
|
4594
4624
|
schedule: Ut
|
|
4595
|
-
},
|
|
4625
|
+
}, $ = Object.freeze({
|
|
4596
4626
|
staticNodeResolver: () => !1,
|
|
4597
4627
|
onBeforeApplied: () => {
|
|
4598
4628
|
},
|
|
@@ -4602,14 +4632,14 @@ const Ke = (r) => {
|
|
|
4602
4632
|
layerWidth: 300,
|
|
4603
4633
|
layerSpace: 300
|
|
4604
4634
|
}
|
|
4605
|
-
}),
|
|
4635
|
+
}), z = (r, e) => ({
|
|
4606
4636
|
a: r.a * e.a + r.b * e.d,
|
|
4607
4637
|
b: r.a * e.b + r.b * e.e,
|
|
4608
4638
|
c: r.a * e.c + r.b * e.f + r.c,
|
|
4609
4639
|
d: r.d * e.a + r.e * e.d,
|
|
4610
4640
|
e: r.d * e.b + r.e * e.e,
|
|
4611
4641
|
f: r.d * e.c + r.e * e.f + r.f
|
|
4612
|
-
}),
|
|
4642
|
+
}), Er = (r) => {
|
|
4613
4643
|
const { a: e, b: t, c: o, d: s, e: n, f: a } = r, h = e * n - t * s;
|
|
4614
4644
|
return {
|
|
4615
4645
|
a: n / h,
|
|
@@ -4620,7 +4650,7 @@ const Ke = (r) => {
|
|
|
4620
4650
|
f: (o * s - e * a) / h
|
|
4621
4651
|
};
|
|
4622
4652
|
};
|
|
4623
|
-
class
|
|
4653
|
+
class Ar {
|
|
4624
4654
|
resolve(e) {
|
|
4625
4655
|
if ("shift" in e)
|
|
4626
4656
|
return this.createShiftBaseMatrix(e.shift);
|
|
@@ -4654,18 +4684,18 @@ class mr {
|
|
|
4654
4684
|
return this.createRelativeTransform(o, s);
|
|
4655
4685
|
}
|
|
4656
4686
|
createMirrorRelativeMatrix(e, t) {
|
|
4657
|
-
const o = this.createMirrorYBaseMatrix(), s =
|
|
4687
|
+
const o = this.createMirrorYBaseMatrix(), s = z(
|
|
4658
4688
|
this.createShiftBaseMatrix(t),
|
|
4659
4689
|
this.createRotateBaseMatrix(e)
|
|
4660
4690
|
);
|
|
4661
4691
|
return this.createRelativeTransform(o, s);
|
|
4662
4692
|
}
|
|
4663
4693
|
createRelativeTransform(e, t) {
|
|
4664
|
-
const o =
|
|
4694
|
+
const o = z(
|
|
4665
4695
|
t,
|
|
4666
4696
|
e
|
|
4667
|
-
), s =
|
|
4668
|
-
return
|
|
4697
|
+
), s = Er(t);
|
|
4698
|
+
return z(o, s);
|
|
4669
4699
|
}
|
|
4670
4700
|
createShiftBaseMatrix(e) {
|
|
4671
4701
|
return {
|
|
@@ -4709,7 +4739,7 @@ class mr {
|
|
|
4709
4739
|
};
|
|
4710
4740
|
}
|
|
4711
4741
|
}
|
|
4712
|
-
const
|
|
4742
|
+
const Sr = (r) => {
|
|
4713
4743
|
if (r === void 0)
|
|
4714
4744
|
return (s) => s;
|
|
4715
4745
|
if (typeof r == "function")
|
|
@@ -4723,10 +4753,10 @@ const xr = (r) => {
|
|
|
4723
4753
|
e: 1,
|
|
4724
4754
|
f: 0
|
|
4725
4755
|
};
|
|
4726
|
-
const o = new
|
|
4756
|
+
const o = new Ar();
|
|
4727
4757
|
return e.forEach((s) => {
|
|
4728
4758
|
const n = o.resolve(s);
|
|
4729
|
-
t =
|
|
4759
|
+
t = z(t, n);
|
|
4730
4760
|
}), (s) => {
|
|
4731
4761
|
const { x: n, y: a } = s;
|
|
4732
4762
|
return {
|
|
@@ -4734,19 +4764,33 @@ const xr = (r) => {
|
|
|
4734
4764
|
y: t.d * n + t.e * a + t.f
|
|
4735
4765
|
};
|
|
4736
4766
|
};
|
|
4737
|
-
},
|
|
4767
|
+
}, Nr = (r) => {
|
|
4768
|
+
if (typeof r == "function")
|
|
4769
|
+
return r;
|
|
4770
|
+
switch (r) {
|
|
4771
|
+
case "outgoing":
|
|
4772
|
+
return wr;
|
|
4773
|
+
case "incoming":
|
|
4774
|
+
return yr;
|
|
4775
|
+
default:
|
|
4776
|
+
return pr;
|
|
4777
|
+
}
|
|
4778
|
+
}, br = (r) => {
|
|
4738
4779
|
var e, t;
|
|
4739
4780
|
switch (r == null ? void 0 : r.type) {
|
|
4740
4781
|
case "custom":
|
|
4741
4782
|
return r.instance;
|
|
4742
4783
|
case "hierarchical":
|
|
4743
4784
|
return new gr({
|
|
4744
|
-
layerWidth: r.layerWidth ??
|
|
4745
|
-
layerSpace: r.layerSpace ??
|
|
4746
|
-
transform:
|
|
4785
|
+
layerWidth: r.layerWidth ?? $.hierarchicalLayout.layerWidth,
|
|
4786
|
+
layerSpace: r.layerSpace ?? $.hierarchicalLayout.layerSpace,
|
|
4787
|
+
transform: Sr(r.transform),
|
|
4788
|
+
nextLayerNodesResolver: Nr(
|
|
4789
|
+
r.nextLayerNodesResolver
|
|
4790
|
+
)
|
|
4747
4791
|
});
|
|
4748
4792
|
default: {
|
|
4749
|
-
const o =
|
|
4793
|
+
const o = Je((r == null ? void 0 : r.seed) ?? A.seed), s = Ke(o[0], o[1], o[2], o[3]);
|
|
4750
4794
|
return new dr({
|
|
4751
4795
|
dtSec: (r == null ? void 0 : r.dtSec) ?? A.dtSec,
|
|
4752
4796
|
maxIterations: (r == null ? void 0 : r.maxIterations) ?? A.maxIterations,
|
|
@@ -4763,16 +4807,16 @@ const xr = (r) => {
|
|
|
4763
4807
|
});
|
|
4764
4808
|
}
|
|
4765
4809
|
}
|
|
4766
|
-
},
|
|
4810
|
+
}, Pr = (r) => {
|
|
4767
4811
|
var e, t;
|
|
4768
4812
|
return {
|
|
4769
|
-
algorithm:
|
|
4770
|
-
applyOn:
|
|
4771
|
-
staticNodeResolver: r.staticNodeResolver ??
|
|
4772
|
-
onBeforeApplied: ((e = r.events) == null ? void 0 : e.onBeforeApplied) ??
|
|
4773
|
-
onAfterApplied: ((t = r.events) == null ? void 0 : t.onAfterApplied) ??
|
|
4813
|
+
algorithm: br(r.algorithm),
|
|
4814
|
+
applyOn: xr(r.applyOn),
|
|
4815
|
+
staticNodeResolver: r.staticNodeResolver ?? $.staticNodeResolver,
|
|
4816
|
+
onBeforeApplied: ((e = r.events) == null ? void 0 : e.onBeforeApplied) ?? $.onBeforeApplied,
|
|
4817
|
+
onAfterApplied: ((t = r.events) == null ? void 0 : t.onAfterApplied) ?? $.onAfterApplied
|
|
4774
4818
|
};
|
|
4775
|
-
},
|
|
4819
|
+
}, Tr = (r, e) => ({
|
|
4776
4820
|
...r,
|
|
4777
4821
|
onNodeDragStarted: (t) => {
|
|
4778
4822
|
e.add(t), r.onNodeDragStarted(t);
|
|
@@ -4780,7 +4824,7 @@ const xr = (r) => {
|
|
|
4780
4824
|
onNodeDragFinished: (t) => {
|
|
4781
4825
|
e.delete(t), r.onNodeDragFinished(t);
|
|
4782
4826
|
}
|
|
4783
|
-
}),
|
|
4827
|
+
}), Cr = (r, e) => {
|
|
4784
4828
|
r.graph.onBeforeNodeRemoved.subscribe((t) => {
|
|
4785
4829
|
e.delete(t);
|
|
4786
4830
|
}), r.graph.onBeforeClear.subscribe(() => {
|
|
@@ -4788,41 +4832,41 @@ const xr = (r) => {
|
|
|
4788
4832
|
}), r.onBeforeDestroy.subscribe(() => {
|
|
4789
4833
|
e.clear();
|
|
4790
4834
|
});
|
|
4791
|
-
},
|
|
4835
|
+
}, Mr = (r, e) => ({
|
|
4792
4836
|
...r,
|
|
4793
4837
|
staticNodeResolver: (t) => r.staticNodeResolver(t) || e.has(t)
|
|
4794
|
-
}),
|
|
4838
|
+
}), Z = (r) => () => r, Se = Z(0), Dr = () => {
|
|
4795
4839
|
let r = 0;
|
|
4796
4840
|
return () => r++;
|
|
4797
|
-
},
|
|
4798
|
-
let t =
|
|
4799
|
-
const s =
|
|
4800
|
-
return r === "incremental" && (t = s), e === "incremental" && (o = s), typeof r == "number" && (t =
|
|
4841
|
+
}, Lr = (r, e) => {
|
|
4842
|
+
let t = Se, o = Se;
|
|
4843
|
+
const s = Dr();
|
|
4844
|
+
return r === "incremental" && (t = s), e === "incremental" && (o = s), typeof r == "number" && (t = Z(r)), typeof e == "number" && (o = Z(e)), typeof r == "function" && (t = r), typeof e == "function" && (o = e), {
|
|
4801
4845
|
nodesPriorityFn: t,
|
|
4802
4846
|
edgesPriorityFn: o
|
|
4803
4847
|
};
|
|
4804
|
-
},
|
|
4848
|
+
}, Rr = (r) => {
|
|
4805
4849
|
var t, o, s, n, a;
|
|
4806
|
-
const e =
|
|
4850
|
+
const e = Lr(
|
|
4807
4851
|
(t = r.nodes) == null ? void 0 : t.priority,
|
|
4808
4852
|
(o = r.edges) == null ? void 0 : o.priority
|
|
4809
4853
|
);
|
|
4810
4854
|
return {
|
|
4811
4855
|
nodes: {
|
|
4812
|
-
centerFn: ((s = r.nodes) == null ? void 0 : s.centerFn) ??
|
|
4856
|
+
centerFn: ((s = r.nodes) == null ? void 0 : s.centerFn) ?? Me,
|
|
4813
4857
|
priorityFn: e.nodesPriorityFn
|
|
4814
4858
|
},
|
|
4815
4859
|
ports: {
|
|
4816
4860
|
direction: ((n = r.ports) == null ? void 0 : n.direction) ?? 0
|
|
4817
4861
|
},
|
|
4818
4862
|
edges: {
|
|
4819
|
-
shapeFactory:
|
|
4863
|
+
shapeFactory: ge(((a = r.edges) == null ? void 0 : a.shape) ?? {}),
|
|
4820
4864
|
priorityFn: e.edgesPriorityFn
|
|
4821
4865
|
}
|
|
4822
4866
|
};
|
|
4823
|
-
},
|
|
4867
|
+
}, Vr = (r) => r.applyOn.type === "topologyChangeSchedule" ? r.applyOn.schedule : re, Ir = (r) => {
|
|
4824
4868
|
var o, s, n, a;
|
|
4825
|
-
const { canvasDefaults: e } = r, t = r.hasLayout ?
|
|
4869
|
+
const { canvasDefaults: e } = r, t = r.hasLayout ? Vr(r.layoutParams) : re;
|
|
4826
4870
|
return {
|
|
4827
4871
|
focus: {
|
|
4828
4872
|
contentPadding: ((o = e.focus) == null ? void 0 : o.contentPadding) ?? ((s = e.focus) == null ? void 0 : s.contentOffset) ?? 100,
|
|
@@ -4831,24 +4875,18 @@ const xr = (r) => {
|
|
|
4831
4875
|
animationDuration: ((a = e.focus) == null ? void 0 : a.animationDuration) ?? 0
|
|
4832
4876
|
}
|
|
4833
4877
|
};
|
|
4834
|
-
},
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
element: e,
|
|
4845
|
-
window: t,
|
|
4846
|
-
onCanvasSelected: o.onCanvasSelected,
|
|
4847
|
-
mouseDownEventVerifier: o.mouseDownEventVerifier ?? F.mouseDownEventVerifier,
|
|
4848
|
-
mouseUpEventVerifier: o.mouseUpEventVerifier ?? F.mouseUpEventVerifier,
|
|
4849
|
-
movementThreshold: o.movementThreshold ?? F.movementThreshold
|
|
4878
|
+
}, Fr = (r) => ({
|
|
4879
|
+
onNodeSelected: r.onNodeSelected,
|
|
4880
|
+
mouseDownEventVerifier: r.mouseDownEventVerifier ?? V.mouseDownEventVerifier,
|
|
4881
|
+
mouseUpEventVerifier: r.mouseUpEventVerifier ?? V.mouseUpEventVerifier,
|
|
4882
|
+
movementThreshold: r.movementThreshold ?? V.movementThreshold
|
|
4883
|
+
}), Ur = (r) => ({
|
|
4884
|
+
onCanvasSelected: r.onCanvasSelected,
|
|
4885
|
+
mouseDownEventVerifier: r.mouseDownEventVerifier ?? V.mouseDownEventVerifier,
|
|
4886
|
+
mouseUpEventVerifier: r.mouseUpEventVerifier ?? V.mouseUpEventVerifier,
|
|
4887
|
+
movementThreshold: r.movementThreshold ?? V.movementThreshold
|
|
4850
4888
|
});
|
|
4851
|
-
class
|
|
4889
|
+
class Wr {
|
|
4852
4890
|
constructor(e) {
|
|
4853
4891
|
i(this, "used", !1);
|
|
4854
4892
|
i(this, "canvasDefaults", {});
|
|
@@ -4870,10 +4908,11 @@ class Ir {
|
|
|
4870
4908
|
i(this, "hasUserDraggableEdges", !1);
|
|
4871
4909
|
i(this, "hasAnimatedLayout", !1);
|
|
4872
4910
|
i(this, "hasLayout", !1);
|
|
4873
|
-
i(this, "boxRenderingTrigger", new
|
|
4911
|
+
i(this, "boxRenderingTrigger", new _());
|
|
4874
4912
|
i(this, "window", window);
|
|
4875
4913
|
i(this, "animationStaticNodes", /* @__PURE__ */ new Set());
|
|
4876
|
-
this
|
|
4914
|
+
i(this, "pointInsideVerifier");
|
|
4915
|
+
this.element = e, this.pointInsideVerifier = new dt(e, this.window);
|
|
4877
4916
|
}
|
|
4878
4917
|
setDefaults(e) {
|
|
4879
4918
|
return this.canvasDefaults = e, this;
|
|
@@ -4917,62 +4956,68 @@ class Ir {
|
|
|
4917
4956
|
"Failed to build Canvas because CanvasBuilder is a single-use object"
|
|
4918
4957
|
);
|
|
4919
4958
|
this.used = !0;
|
|
4920
|
-
const e = new
|
|
4959
|
+
const e = new nt(this.element), t = new Pe(), o = new Gt(this.element), s = this.createHtmlView(
|
|
4921
4960
|
o.main,
|
|
4922
4961
|
t,
|
|
4923
4962
|
e
|
|
4924
|
-
), n =
|
|
4963
|
+
), n = Rr(
|
|
4925
4964
|
this.canvasDefaults
|
|
4926
|
-
), a = new
|
|
4965
|
+
), a = new $e(
|
|
4927
4966
|
t,
|
|
4928
4967
|
s,
|
|
4929
4968
|
n
|
|
4930
|
-
), h =
|
|
4969
|
+
), h = Pr(this.layoutConfig), d = Ir({
|
|
4931
4970
|
canvasDefaults: this.canvasDefaults,
|
|
4932
4971
|
hasLayout: this.hasLayout,
|
|
4933
4972
|
layoutParams: h
|
|
4934
|
-
}), c = new
|
|
4973
|
+
}), c = new ze(
|
|
4935
4974
|
t,
|
|
4936
4975
|
e,
|
|
4937
4976
|
d,
|
|
4938
4977
|
this.window
|
|
4939
|
-
), u = new
|
|
4978
|
+
), u = new Be(e), g = new Ue(t), l = new be(
|
|
4940
4979
|
g,
|
|
4941
4980
|
u,
|
|
4942
4981
|
a,
|
|
4943
4982
|
c
|
|
4944
4983
|
);
|
|
4945
|
-
if (this.hasBackground &&
|
|
4984
|
+
if (this.hasBackground && ie.configure(
|
|
4946
4985
|
l,
|
|
4947
4986
|
qt(this.backgroundConfig),
|
|
4948
4987
|
o.background
|
|
4949
|
-
), this.hasNodeResizeReactiveEdges &&
|
|
4950
|
-
const p =
|
|
4988
|
+
), this.hasNodeResizeReactiveEdges && q.configure(l), this.userSelectableNodesConfig !== void 0) {
|
|
4989
|
+
const p = Fr(
|
|
4990
|
+
this.userSelectableNodesConfig
|
|
4991
|
+
);
|
|
4992
|
+
le.configure(
|
|
4951
4993
|
l,
|
|
4952
|
-
o.main,
|
|
4953
4994
|
this.window,
|
|
4954
|
-
this.
|
|
4995
|
+
this.pointInsideVerifier,
|
|
4996
|
+
p
|
|
4955
4997
|
);
|
|
4956
|
-
ue.configure(p);
|
|
4957
4998
|
}
|
|
4958
4999
|
if (this.userSelectableCanvasConfig !== void 0) {
|
|
4959
|
-
const p =
|
|
5000
|
+
const p = Ur(
|
|
5001
|
+
this.userSelectableCanvasConfig
|
|
5002
|
+
);
|
|
5003
|
+
ue.configure(
|
|
4960
5004
|
l,
|
|
4961
5005
|
o.main,
|
|
4962
5006
|
this.window,
|
|
4963
|
-
this.
|
|
5007
|
+
this.pointInsideVerifier,
|
|
5008
|
+
p
|
|
4964
5009
|
);
|
|
4965
|
-
ge.configure(p);
|
|
4966
5010
|
}
|
|
4967
5011
|
if (this.hasDraggableNodes) {
|
|
4968
5012
|
let p = jt(this.dragConfig);
|
|
4969
|
-
this.hasAnimatedLayout && (p =
|
|
5013
|
+
this.hasAnimatedLayout && (p = Tr(
|
|
4970
5014
|
p,
|
|
4971
5015
|
this.animationStaticNodes
|
|
4972
|
-
)),
|
|
5016
|
+
)), oe.configure(
|
|
4973
5017
|
l,
|
|
4974
5018
|
o.main,
|
|
4975
5019
|
this.window,
|
|
5020
|
+
this.pointInsideVerifier,
|
|
4976
5021
|
p
|
|
4977
5022
|
);
|
|
4978
5023
|
}
|
|
@@ -4982,11 +5027,12 @@ class Ir {
|
|
|
4982
5027
|
n.edges.shapeFactory,
|
|
4983
5028
|
n.ports.direction
|
|
4984
5029
|
);
|
|
4985
|
-
|
|
5030
|
+
ne.configure(
|
|
4986
5031
|
l,
|
|
4987
5032
|
o.overlayConnectablePorts,
|
|
4988
5033
|
e,
|
|
4989
5034
|
this.window,
|
|
5035
|
+
this.pointInsideVerifier,
|
|
4990
5036
|
p
|
|
4991
5037
|
);
|
|
4992
5038
|
}
|
|
@@ -4995,37 +5041,40 @@ class Ir {
|
|
|
4995
5041
|
this.draggableEdgesConfig,
|
|
4996
5042
|
l.graph
|
|
4997
5043
|
);
|
|
4998
|
-
|
|
5044
|
+
ae.configure(
|
|
4999
5045
|
l,
|
|
5000
5046
|
o.overlayDraggableEdges,
|
|
5001
5047
|
e,
|
|
5002
5048
|
this.window,
|
|
5049
|
+
this.pointInsideVerifier,
|
|
5003
5050
|
p
|
|
5004
5051
|
);
|
|
5005
5052
|
}
|
|
5006
|
-
if (this.virtualScrollConfig !== void 0 ?
|
|
5053
|
+
if (this.virtualScrollConfig !== void 0 ? se.configure(
|
|
5007
5054
|
l,
|
|
5008
5055
|
o.main,
|
|
5009
5056
|
this.window,
|
|
5010
|
-
|
|
5057
|
+
Ae(this.transformConfig),
|
|
5011
5058
|
this.boxRenderingTrigger,
|
|
5059
|
+
this.pointInsideVerifier,
|
|
5012
5060
|
rr(this.virtualScrollConfig)
|
|
5013
|
-
) : this.hasTransformableViewport &&
|
|
5061
|
+
) : this.hasTransformableViewport && j.configure(
|
|
5014
5062
|
l,
|
|
5015
5063
|
o.main,
|
|
5016
5064
|
this.window,
|
|
5017
|
-
|
|
5065
|
+
this.pointInsideVerifier,
|
|
5066
|
+
Ae(this.transformConfig)
|
|
5018
5067
|
), this.hasLayout && Yt.configure(l, h), this.hasAnimatedLayout) {
|
|
5019
|
-
let p =
|
|
5068
|
+
let p = mr(
|
|
5020
5069
|
this.animatedLayoutConfig
|
|
5021
5070
|
);
|
|
5022
|
-
this.hasDraggableNodes && (
|
|
5071
|
+
this.hasDraggableNodes && (Cr(
|
|
5023
5072
|
l,
|
|
5024
5073
|
this.animationStaticNodes
|
|
5025
|
-
), p =
|
|
5074
|
+
), p = Mr(
|
|
5026
5075
|
p,
|
|
5027
5076
|
this.animationStaticNodes
|
|
5028
|
-
)),
|
|
5077
|
+
)), ce.configure(l, p, this.window);
|
|
5029
5078
|
}
|
|
5030
5079
|
const w = () => {
|
|
5031
5080
|
o.destroy(), l.onBeforeDestroy.unsubscribe(w);
|
|
@@ -5033,27 +5082,27 @@ class Ir {
|
|
|
5033
5082
|
return l.onBeforeDestroy.subscribe(w), l;
|
|
5034
5083
|
}
|
|
5035
5084
|
createHtmlView(e, t, o) {
|
|
5036
|
-
let s = new
|
|
5037
|
-
return this.virtualScrollConfig !== void 0 && (s = new
|
|
5085
|
+
let s = new Ne(t, o, e);
|
|
5086
|
+
return this.virtualScrollConfig !== void 0 && (s = new ot(
|
|
5038
5087
|
s,
|
|
5039
5088
|
t,
|
|
5040
5089
|
this.boxRenderingTrigger,
|
|
5041
5090
|
or(this.virtualScrollConfig)
|
|
5042
|
-
)), s = new
|
|
5091
|
+
)), s = new st(s, t), s;
|
|
5043
5092
|
}
|
|
5044
5093
|
}
|
|
5045
5094
|
export {
|
|
5046
5095
|
Ct as BezierEdgeShape,
|
|
5047
|
-
|
|
5096
|
+
Wr as CanvasBuilder,
|
|
5048
5097
|
sr as CanvasBuilderError,
|
|
5049
5098
|
S as CanvasError,
|
|
5050
|
-
|
|
5099
|
+
R as ConnectionCategory,
|
|
5051
5100
|
Ie as DirectEdgeShape,
|
|
5052
|
-
|
|
5101
|
+
_ as EventSubject,
|
|
5053
5102
|
Mt as HorizontalEdgeShape,
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5103
|
+
It as InteractiveEdgeError,
|
|
5104
|
+
Fe as InteractiveEdgeShape,
|
|
5105
|
+
Br as MidpointEdgeShape,
|
|
5057
5106
|
Dt as StraightEdgeShape,
|
|
5058
5107
|
Lt as VerticalEdgeShape
|
|
5059
5108
|
};
|