@html-graph/html-graph 2.2.2 → 2.4.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 +100 -11
- package/dist/html-graph.js +1157 -1108
- package/dist/html-graph.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/html-graph.js
CHANGED
|
@@ -1,12 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var i = (
|
|
4
|
-
class
|
|
5
|
-
constructor(
|
|
6
|
-
this
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
var oe = Object.defineProperty;
|
|
2
|
+
var re = (t, e, o) => e in t ? oe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
|
3
|
+
var i = (t, e, o) => re(t, typeof e != "symbol" ? e + "" : e, o);
|
|
4
|
+
class ie {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
i(this, "onAfterNodeAdded");
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated
|
|
9
|
+
* use onAfterNodeUpdated instead
|
|
10
|
+
*/
|
|
11
|
+
i(this, "onAfterNodeCoordinatesUpdated");
|
|
12
|
+
i(this, "onAfterNodeUpdated");
|
|
13
|
+
i(this, "onAfterNodePriorityUpdated");
|
|
14
|
+
i(this, "onBeforeNodeRemoved");
|
|
15
|
+
i(this, "onAfterPortMarked");
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated
|
|
18
|
+
* use onAfterPortMarked instead
|
|
19
|
+
*/
|
|
20
|
+
i(this, "onAfterPortAdded");
|
|
21
|
+
i(this, "onAfterPortUpdated");
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated
|
|
24
|
+
* use onAfterPortUpdated instead
|
|
25
|
+
*/
|
|
26
|
+
i(this, "onAfterPortDirectionUpdated");
|
|
27
|
+
i(this, "onBeforePortUnmarked");
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated
|
|
30
|
+
* use onBeforePortUnmarked instead
|
|
31
|
+
*/
|
|
32
|
+
i(this, "onBeforePortRemoved");
|
|
33
|
+
i(this, "onAfterEdgeAdded");
|
|
34
|
+
i(this, "onAfterEdgeShapeUpdated");
|
|
35
|
+
i(this, "onAfterEdgeUpdated");
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated
|
|
38
|
+
* use onAfterEdgeUpdated instead
|
|
39
|
+
*/
|
|
40
|
+
i(this, "onAfterEdgeAdjacentPortsUpdated");
|
|
41
|
+
i(this, "onAfterEdgePriorityUpdated");
|
|
42
|
+
i(this, "onBeforeEdgeRemoved");
|
|
43
|
+
i(this, "onBeforeClear");
|
|
44
|
+
this.graphStore = e, this.onAfterNodeAdded = this.graphStore.onAfterNodeAdded, this.onAfterNodeUpdated = this.graphStore.onAfterNodeUpdated, this.onAfterNodeCoordinatesUpdated = this.onAfterNodeUpdated, this.onAfterNodePriorityUpdated = this.graphStore.onAfterNodePriorityUpdated, this.onBeforeNodeRemoved = this.graphStore.onBeforeNodeRemoved, this.onAfterPortMarked = this.graphStore.onAfterPortAdded, this.onAfterPortAdded = this.onAfterPortMarked, this.onAfterPortUpdated = this.graphStore.onAfterPortUpdated, this.onAfterPortDirectionUpdated = this.onAfterPortUpdated, this.onBeforePortUnmarked = this.graphStore.onBeforePortRemoved, this.onBeforePortRemoved = this.onBeforePortUnmarked, this.onAfterEdgeAdded = this.graphStore.onAfterEdgeAdded, this.onAfterEdgeShapeUpdated = this.graphStore.onAfterEdgeShapeUpdated, this.onAfterEdgeUpdated = this.graphStore.onAfterEdgeUpdated, this.onAfterEdgeAdjacentPortsUpdated = this.onAfterEdgeUpdated, this.onAfterEdgePriorityUpdated = this.graphStore.onAfterEdgePriorityUpdated, this.onBeforeEdgeRemoved = this.graphStore.onBeforeEdgeRemoved, this.onBeforeClear = this.graphStore.onBeforeClear;
|
|
45
|
+
}
|
|
46
|
+
getNode(e) {
|
|
47
|
+
const o = this.graphStore.getNode(e);
|
|
10
48
|
return o === void 0 ? null : {
|
|
11
49
|
element: o.element,
|
|
12
50
|
x: o.x,
|
|
@@ -18,8 +56,8 @@ class ot {
|
|
|
18
56
|
getAllNodeIds() {
|
|
19
57
|
return this.graphStore.getAllNodeIds();
|
|
20
58
|
}
|
|
21
|
-
getPort(
|
|
22
|
-
const o = this.graphStore.getPort(
|
|
59
|
+
getPort(e) {
|
|
60
|
+
const o = this.graphStore.getPort(e);
|
|
23
61
|
return o === void 0 ? null : {
|
|
24
62
|
element: o.element,
|
|
25
63
|
direction: o.direction,
|
|
@@ -29,52 +67,54 @@ class ot {
|
|
|
29
67
|
getAllPortIds() {
|
|
30
68
|
return this.graphStore.getAllPortIds();
|
|
31
69
|
}
|
|
32
|
-
getNodePortIds(
|
|
33
|
-
return this.graphStore.getNodePortIds(
|
|
70
|
+
getNodePortIds(e) {
|
|
71
|
+
return this.graphStore.getNodePortIds(e) ?? null;
|
|
34
72
|
}
|
|
35
73
|
/**
|
|
36
74
|
* @deprecated
|
|
37
75
|
* use graph.getPort()?.nodeId ?? null instead
|
|
38
76
|
*/
|
|
39
|
-
getPortNodeId(
|
|
77
|
+
getPortNodeId(e) {
|
|
40
78
|
var o;
|
|
41
|
-
return ((o = this.graphStore.getPort(
|
|
79
|
+
return ((o = this.graphStore.getPort(e)) == null ? void 0 : o.nodeId) ?? null;
|
|
42
80
|
}
|
|
43
81
|
getAllEdgeIds() {
|
|
44
82
|
return this.graphStore.getAllEdgeIds();
|
|
45
83
|
}
|
|
46
|
-
getEdge(
|
|
47
|
-
const o = this.graphStore.getEdge(
|
|
84
|
+
getEdge(e) {
|
|
85
|
+
const o = this.graphStore.getEdge(e);
|
|
48
86
|
return o === void 0 ? null : { from: o.from, to: o.to, priority: o.priority };
|
|
49
87
|
}
|
|
50
|
-
getPortIncomingEdgeIds(
|
|
51
|
-
return this.graphStore.getPort(
|
|
88
|
+
getPortIncomingEdgeIds(e) {
|
|
89
|
+
return this.graphStore.getPort(e) === void 0 ? null : this.graphStore.getPortIncomingEdgeIds(e);
|
|
52
90
|
}
|
|
53
|
-
getPortOutcomingEdgeIds(
|
|
54
|
-
return this.graphStore.getPort(
|
|
91
|
+
getPortOutcomingEdgeIds(e) {
|
|
92
|
+
return this.graphStore.getPort(e) === void 0 ? null : this.graphStore.getPortOutcomingEdgeIds(e);
|
|
55
93
|
}
|
|
56
|
-
getPortCycleEdgeIds(
|
|
57
|
-
return this.graphStore.getPort(
|
|
94
|
+
getPortCycleEdgeIds(e) {
|
|
95
|
+
return this.graphStore.getPort(e) === void 0 ? null : this.graphStore.getPortCycleEdgeIds(e);
|
|
58
96
|
}
|
|
59
|
-
getPortAdjacentEdgeIds(
|
|
60
|
-
return this.graphStore.getPort(
|
|
97
|
+
getPortAdjacentEdgeIds(e) {
|
|
98
|
+
return this.graphStore.getPort(e) === void 0 ? null : this.graphStore.getPortAdjacentEdgeIds(e);
|
|
61
99
|
}
|
|
62
|
-
getNodeIncomingEdgeIds(
|
|
63
|
-
return this.graphStore.getNode(
|
|
100
|
+
getNodeIncomingEdgeIds(e) {
|
|
101
|
+
return this.graphStore.getNode(e) === void 0 ? null : this.graphStore.getNodeIncomingEdgeIds(e);
|
|
64
102
|
}
|
|
65
|
-
getNodeOutcomingEdgeIds(
|
|
66
|
-
return this.graphStore.getNode(
|
|
103
|
+
getNodeOutcomingEdgeIds(e) {
|
|
104
|
+
return this.graphStore.getNode(e) === void 0 ? null : this.graphStore.getNodeOutcomingEdgeIds(e);
|
|
67
105
|
}
|
|
68
|
-
getNodeCycleEdgeIds(
|
|
69
|
-
return this.graphStore.getNode(
|
|
106
|
+
getNodeCycleEdgeIds(e) {
|
|
107
|
+
return this.graphStore.getNode(e) === void 0 ? null : this.graphStore.getNodeCycleEdgeIds(e);
|
|
70
108
|
}
|
|
71
|
-
getNodeAdjacentEdgeIds(
|
|
72
|
-
return this.graphStore.getNode(
|
|
109
|
+
getNodeAdjacentEdgeIds(e) {
|
|
110
|
+
return this.graphStore.getNode(e) === void 0 ? null : this.graphStore.getNodeAdjacentEdgeIds(e);
|
|
73
111
|
}
|
|
74
112
|
}
|
|
75
|
-
class
|
|
76
|
-
constructor(
|
|
77
|
-
this
|
|
113
|
+
class se {
|
|
114
|
+
constructor(e) {
|
|
115
|
+
i(this, "onBeforeUpdated");
|
|
116
|
+
i(this, "onAfterUpdated");
|
|
117
|
+
this.transformer = e, this.onBeforeUpdated = this.transformer.onBeforeUpdated, this.onAfterUpdated = this.transformer.onAfterUpdated;
|
|
78
118
|
}
|
|
79
119
|
getViewportMatrix() {
|
|
80
120
|
return { ...this.transformer.getViewportMatrix() };
|
|
@@ -83,120 +123,165 @@ class rt {
|
|
|
83
123
|
return { ...this.transformer.getContentMatrix() };
|
|
84
124
|
}
|
|
85
125
|
}
|
|
86
|
-
class
|
|
87
|
-
constructor(
|
|
126
|
+
class ne {
|
|
127
|
+
constructor(e, o, r) {
|
|
88
128
|
i(this, "viewport");
|
|
89
129
|
i(this, "graph");
|
|
90
|
-
this
|
|
130
|
+
i(this, "onAfterNodeAdded", (e) => {
|
|
131
|
+
this.htmlView.attachNode(e);
|
|
132
|
+
});
|
|
133
|
+
i(this, "onAfterNodeUpdated", (e) => {
|
|
134
|
+
this.htmlView.updateNodePosition(e), this.graphStore.getNodeAdjacentEdgeIds(e).forEach((r) => {
|
|
135
|
+
this.htmlView.renderEdge(r);
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
i(this, "onAfterNodePriorityUpdated", (e) => {
|
|
139
|
+
this.htmlView.updateNodePriority(e);
|
|
140
|
+
});
|
|
141
|
+
i(this, "onBeforeNodeRemoved", (e) => {
|
|
142
|
+
this.graphStore.getNodePortIds(e).forEach((o) => {
|
|
143
|
+
this.unmarkPort(o);
|
|
144
|
+
}), this.htmlView.detachNode(e);
|
|
145
|
+
});
|
|
146
|
+
i(this, "onAfterPortUpdated", (e) => {
|
|
147
|
+
this.graphStore.getPortAdjacentEdgeIds(e).forEach((r) => {
|
|
148
|
+
this.htmlView.renderEdge(r);
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
i(this, "onBeforePortUnmarked", (e) => {
|
|
152
|
+
this.graphStore.getPortAdjacentEdgeIds(e).forEach((o) => {
|
|
153
|
+
this.removeEdge(o);
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
i(this, "onAfterEdgeAdded", (e) => {
|
|
157
|
+
this.htmlView.attachEdge(e);
|
|
158
|
+
});
|
|
159
|
+
i(this, "onAfterEdgeShapeUpdated", (e) => {
|
|
160
|
+
this.htmlView.updateEdgeShape(e);
|
|
161
|
+
});
|
|
162
|
+
i(this, "onAfterEdgeUpdated", (e) => {
|
|
163
|
+
this.htmlView.renderEdge(e);
|
|
164
|
+
});
|
|
165
|
+
i(this, "onAfterEdgePriorityUpdated", (e) => {
|
|
166
|
+
this.htmlView.updateEdgePriority(e);
|
|
167
|
+
});
|
|
168
|
+
i(this, "onBeforeEdgeRemoved", (e) => {
|
|
169
|
+
this.htmlView.detachEdge(e);
|
|
170
|
+
});
|
|
171
|
+
i(this, "onBeforeClear", () => {
|
|
172
|
+
this.htmlView.clear();
|
|
173
|
+
});
|
|
174
|
+
this.graphStore = e, this.viewportStore = o, this.htmlView = r, this.graphStore.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.graphStore.onAfterNodeUpdated.subscribe(this.onAfterNodeUpdated), this.graphStore.onAfterNodePriorityUpdated.subscribe(
|
|
175
|
+
this.onAfterNodePriorityUpdated
|
|
176
|
+
), this.graphStore.onBeforeNodeRemoved.subscribe(this.onBeforeNodeRemoved), this.graphStore.onAfterPortUpdated.subscribe(this.onAfterPortUpdated), this.graphStore.onBeforePortRemoved.subscribe(this.onBeforePortUnmarked), this.graphStore.onAfterEdgeAdded.subscribe(this.onAfterEdgeAdded), this.graphStore.onAfterEdgeShapeUpdated.subscribe(
|
|
177
|
+
this.onAfterEdgeShapeUpdated
|
|
178
|
+
), this.graphStore.onAfterEdgeUpdated.subscribe(this.onAfterEdgeUpdated), this.graphStore.onAfterEdgePriorityUpdated.subscribe(
|
|
179
|
+
this.onAfterEdgePriorityUpdated
|
|
180
|
+
), this.graphStore.onBeforeEdgeRemoved.subscribe(this.onBeforeEdgeRemoved), this.graphStore.onBeforeClear.subscribe(this.onBeforeClear), this.graph = new ie(this.graphStore), this.viewport = new se(this.viewportStore);
|
|
91
181
|
}
|
|
92
|
-
attach(
|
|
93
|
-
this.htmlView.attach(
|
|
182
|
+
attach(e) {
|
|
183
|
+
this.htmlView.attach(e);
|
|
94
184
|
}
|
|
95
185
|
detach() {
|
|
96
186
|
this.htmlView.detach();
|
|
97
187
|
}
|
|
98
|
-
addNode(
|
|
99
|
-
this.graphStore.addNode(
|
|
188
|
+
addNode(e) {
|
|
189
|
+
this.graphStore.addNode(e);
|
|
100
190
|
}
|
|
101
|
-
updateNode(
|
|
102
|
-
|
|
103
|
-
r.x = (o == null ? void 0 : o.x) ?? r.x, r.y = (o == null ? void 0 : o.y) ?? r.y, r.centerFn = o.centerFn ?? r.centerFn, this.htmlView.updateNodeCoordinates(t), this.graphStore.getNodeAdjacentEdgeIds(t).forEach((h) => {
|
|
104
|
-
this.htmlView.renderEdge(h);
|
|
105
|
-
}), o.priority !== void 0 && (r.priority = o.priority, this.htmlView.updateNodePriority(t));
|
|
191
|
+
updateNode(e, o) {
|
|
192
|
+
this.graphStore.updateNode(e, o);
|
|
106
193
|
}
|
|
107
|
-
removeNode(
|
|
108
|
-
this.graphStore.
|
|
109
|
-
this.unmarkPort(o);
|
|
110
|
-
}), this.graphStore.removeNode(t), this.htmlView.detachNode(t);
|
|
194
|
+
removeNode(e) {
|
|
195
|
+
this.graphStore.removeNode(e);
|
|
111
196
|
}
|
|
112
|
-
markPort(
|
|
113
|
-
this.graphStore.addPort(
|
|
197
|
+
markPort(e) {
|
|
198
|
+
this.graphStore.addPort(e);
|
|
114
199
|
}
|
|
115
|
-
updatePort(
|
|
116
|
-
|
|
117
|
-
r.direction = o.direction ?? r.direction, this.graphStore.getPortAdjacentEdgeIds(t).forEach((h) => {
|
|
118
|
-
this.htmlView.renderEdge(h);
|
|
119
|
-
});
|
|
200
|
+
updatePort(e, o) {
|
|
201
|
+
this.graphStore.updatePort(e, o);
|
|
120
202
|
}
|
|
121
|
-
unmarkPort(
|
|
122
|
-
this.graphStore.
|
|
123
|
-
this.removeEdge(o);
|
|
124
|
-
}), this.graphStore.removePort(t);
|
|
203
|
+
unmarkPort(e) {
|
|
204
|
+
this.graphStore.removePort(e);
|
|
125
205
|
}
|
|
126
|
-
addEdge(
|
|
127
|
-
this.graphStore.addEdge(
|
|
206
|
+
addEdge(e) {
|
|
207
|
+
this.graphStore.addEdge(e);
|
|
128
208
|
}
|
|
129
|
-
updateEdge(
|
|
130
|
-
|
|
131
|
-
o.shape !== void 0 && (r.shape = o.shape, this.htmlView.updateEdgeShape(t)), o.from !== void 0 && this.graphStore.updateEdgeFrom(t, o.from), o.to !== void 0 && this.graphStore.updateEdgeTo(t, o.to), this.htmlView.renderEdge(t), o.priority !== void 0 && (r.priority = o.priority, this.htmlView.updateEdgePriority(t));
|
|
209
|
+
updateEdge(e, o) {
|
|
210
|
+
this.graphStore.updateEdge(e, o);
|
|
132
211
|
}
|
|
133
|
-
removeEdge(
|
|
134
|
-
this.graphStore.removeEdge(
|
|
212
|
+
removeEdge(e) {
|
|
213
|
+
this.graphStore.removeEdge(e);
|
|
135
214
|
}
|
|
136
|
-
patchViewportMatrix(
|
|
137
|
-
this.viewportStore.patchViewportMatrix(
|
|
215
|
+
patchViewportMatrix(e) {
|
|
216
|
+
this.viewportStore.patchViewportMatrix(e);
|
|
138
217
|
}
|
|
139
|
-
patchContentMatrix(
|
|
140
|
-
this.viewportStore.patchContentMatrix(
|
|
218
|
+
patchContentMatrix(e) {
|
|
219
|
+
this.viewportStore.patchContentMatrix(e);
|
|
141
220
|
}
|
|
142
221
|
clear() {
|
|
143
|
-
this.
|
|
222
|
+
this.graphStore.clear();
|
|
144
223
|
}
|
|
145
224
|
destroy() {
|
|
146
|
-
this.
|
|
225
|
+
this.graphStore.onAfterNodeAdded.unsubscribe(this.onAfterNodeAdded), this.graphStore.onAfterNodeUpdated.unsubscribe(this.onAfterNodeUpdated), this.graphStore.onAfterNodePriorityUpdated.unsubscribe(
|
|
226
|
+
this.onAfterNodePriorityUpdated
|
|
227
|
+
), this.graphStore.onBeforeNodeRemoved.unsubscribe(this.onBeforeNodeRemoved), this.graphStore.onAfterPortUpdated.unsubscribe(this.onAfterPortUpdated), this.graphStore.onBeforePortRemoved.unsubscribe(this.onBeforePortUnmarked), this.graphStore.onAfterEdgeAdded.unsubscribe(this.onAfterEdgeAdded), this.graphStore.onAfterEdgeShapeUpdated.unsubscribe(
|
|
228
|
+
this.onAfterEdgeShapeUpdated
|
|
229
|
+
), this.graphStore.onAfterEdgeUpdated.unsubscribe(this.onAfterEdgeUpdated), this.graphStore.onAfterEdgePriorityUpdated.unsubscribe(
|
|
230
|
+
this.onAfterEdgePriorityUpdated
|
|
231
|
+
), this.graphStore.onBeforeEdgeRemoved.unsubscribe(this.onBeforeEdgeRemoved), this.graphStore.onBeforeClear.unsubscribe(this.onBeforeClear), this.clear(), this.htmlView.destroy();
|
|
147
232
|
}
|
|
148
233
|
}
|
|
149
|
-
const
|
|
150
|
-
const { x: r, y: n, width: h, height: s } =
|
|
151
|
-
return
|
|
152
|
-
}, $ = (
|
|
153
|
-
|
|
154
|
-
},
|
|
155
|
-
var g,
|
|
156
|
-
const
|
|
157
|
-
}), o = ((
|
|
158
|
-
}), n = (
|
|
234
|
+
const U = (t, e, o) => {
|
|
235
|
+
const { x: r, y: n, width: h, height: s } = t.getBoundingClientRect();
|
|
236
|
+
return e >= r && e <= r + h && o >= n && o <= n + s;
|
|
237
|
+
}, $ = (t, e, o) => e >= 0 && e <= t.innerWidth && o >= 0 && o <= t.innerHeight, R = (t, e) => {
|
|
238
|
+
e !== null ? t.style.cursor = e : t.style.removeProperty("cursor");
|
|
239
|
+
}, he = (t) => {
|
|
240
|
+
var g, f, x, v, S, p;
|
|
241
|
+
const e = ((g = t == null ? void 0 : t.events) == null ? void 0 : g.onNodeDrag) ?? (() => {
|
|
242
|
+
}), o = ((f = t == null ? void 0 : t.events) == null ? void 0 : f.onBeforeNodeDrag) ?? (() => !0), r = ((x = t == null ? void 0 : t.events) == null ? void 0 : x.onNodeDragFinished) ?? (() => {
|
|
243
|
+
}), n = (t == null ? void 0 : t.moveOnTop) === !1, h = (v = t == null ? void 0 : t.mouse) == null ? void 0 : v.dragCursor, s = h !== void 0 ? h : "grab", d = (S = t == null ? void 0 : t.mouse) == null ? void 0 : S.mouseDownEventVerifier, c = d !== void 0 ? d : (N) => N.button === 0, a = (p = t == null ? void 0 : t.mouse) == null ? void 0 : p.mouseUpEventVerifier;
|
|
159
244
|
return {
|
|
160
245
|
freezePriority: n,
|
|
161
246
|
dragCursor: s,
|
|
162
|
-
mouseDownEventVerifier:
|
|
163
|
-
mouseUpEventVerifier: a !== void 0 ? a : (
|
|
164
|
-
onNodeDrag:
|
|
247
|
+
mouseDownEventVerifier: c,
|
|
248
|
+
mouseUpEventVerifier: a !== void 0 ? a : (N) => N.button === 0,
|
|
249
|
+
onNodeDrag: e,
|
|
165
250
|
onBeforeNodeDrag: o,
|
|
166
251
|
onNodeDragFinished: r
|
|
167
252
|
};
|
|
168
253
|
};
|
|
169
|
-
class
|
|
170
|
-
constructor(
|
|
254
|
+
class de {
|
|
255
|
+
constructor(e, o) {
|
|
171
256
|
i(this, "graph");
|
|
172
257
|
i(this, "viewport");
|
|
173
258
|
i(this, "maxNodePriority", 0);
|
|
174
259
|
i(this, "nodes", /* @__PURE__ */ new Map());
|
|
175
260
|
i(this, "grabbedNodeId", null);
|
|
176
261
|
i(this, "element", null);
|
|
177
|
-
i(this, "onWindowMouseMove", (
|
|
178
|
-
if (this.element !== null && (!
|
|
262
|
+
i(this, "onWindowMouseMove", (e) => {
|
|
263
|
+
if (this.element !== null && (!U(this.element, e.clientX, e.clientY) || !$(this.window, e.clientX, e.clientY))) {
|
|
179
264
|
this.cancelMouseDrag();
|
|
180
265
|
return;
|
|
181
266
|
}
|
|
182
|
-
this.grabbedNodeId !== null && this.dragNode(this.grabbedNodeId,
|
|
267
|
+
this.grabbedNodeId !== null && this.dragNode(this.grabbedNodeId, e.movementX, e.movementY);
|
|
183
268
|
});
|
|
184
|
-
i(this, "onWindowMouseUp", (
|
|
185
|
-
this.options.mouseUpEventVerifier(
|
|
269
|
+
i(this, "onWindowMouseUp", (e) => {
|
|
270
|
+
this.options.mouseUpEventVerifier(e) && this.cancelMouseDrag();
|
|
186
271
|
});
|
|
187
|
-
i(this, "onWindowTouchMove", (
|
|
188
|
-
if (
|
|
272
|
+
i(this, "onWindowTouchMove", (e) => {
|
|
273
|
+
if (e.touches.length !== 1)
|
|
189
274
|
return;
|
|
190
|
-
const o =
|
|
191
|
-
if (this.element !== null && (!
|
|
275
|
+
const o = e.touches[0];
|
|
276
|
+
if (this.element !== null && (!U(this.element, o.clientX, o.clientY) || !$(this.window, o.clientX, o.clientY))) {
|
|
192
277
|
this.cancelTouchDrag();
|
|
193
278
|
return;
|
|
194
279
|
}
|
|
195
280
|
if (this.grabbedNodeId !== null && this.previousTouchCoords !== null) {
|
|
196
281
|
const r = o.clientX - this.previousTouchCoords.x, n = o.clientY - this.previousTouchCoords.y;
|
|
197
282
|
this.dragNode(this.grabbedNodeId, r, n), this.previousTouchCoords = {
|
|
198
|
-
x:
|
|
199
|
-
y:
|
|
283
|
+
x: e.touches[0].clientX,
|
|
284
|
+
y: e.touches[0].clientY
|
|
200
285
|
};
|
|
201
286
|
}
|
|
202
287
|
});
|
|
@@ -206,26 +291,26 @@ class nt {
|
|
|
206
291
|
i(this, "previousTouchCoords", null);
|
|
207
292
|
i(this, "window", window);
|
|
208
293
|
i(this, "options");
|
|
209
|
-
this.canvas =
|
|
294
|
+
this.canvas = e, this.viewport = this.canvas.viewport, this.graph = this.canvas.graph, this.options = he(o ?? {});
|
|
210
295
|
}
|
|
211
|
-
attach(
|
|
212
|
-
this.detach(), this.element =
|
|
296
|
+
attach(e) {
|
|
297
|
+
this.detach(), this.element = e, this.canvas.attach(this.element);
|
|
213
298
|
}
|
|
214
299
|
detach() {
|
|
215
300
|
this.canvas.detach(), this.element !== null && (this.element = null);
|
|
216
301
|
}
|
|
217
|
-
addNode(
|
|
218
|
-
this.canvas.addNode(
|
|
302
|
+
addNode(e) {
|
|
303
|
+
this.canvas.addNode(e), this.updateMaxNodePriority(e.id);
|
|
219
304
|
const o = (n) => {
|
|
220
305
|
if (this.element === null || !this.options.mouseDownEventVerifier(n))
|
|
221
306
|
return;
|
|
222
|
-
const h = this.graph.getNode(
|
|
307
|
+
const h = this.graph.getNode(e.id);
|
|
223
308
|
this.options.onBeforeNodeDrag({
|
|
224
|
-
nodeId:
|
|
225
|
-
element:
|
|
309
|
+
nodeId: e.id,
|
|
310
|
+
element: e.element,
|
|
226
311
|
x: h.x,
|
|
227
312
|
y: h.y
|
|
228
|
-
}) && (n.stopImmediatePropagation(), this.grabbedNodeId =
|
|
313
|
+
}) && (n.stopImmediatePropagation(), this.grabbedNodeId = e.id, R(this.element, this.options.dragCursor), this.moveNodeOnTop(e.id), this.window.addEventListener("mouseup", this.onWindowMouseUp), this.window.addEventListener("mousemove", this.onWindowMouseMove));
|
|
229
314
|
}, r = (n) => {
|
|
230
315
|
if (n.touches.length !== 1)
|
|
231
316
|
return;
|
|
@@ -233,206 +318,206 @@ class nt {
|
|
|
233
318
|
x: n.touches[0].clientX,
|
|
234
319
|
y: n.touches[0].clientY
|
|
235
320
|
};
|
|
236
|
-
const h = this.graph.getNode(
|
|
321
|
+
const h = this.graph.getNode(e.id);
|
|
237
322
|
this.options.onBeforeNodeDrag({
|
|
238
|
-
nodeId:
|
|
239
|
-
element:
|
|
323
|
+
nodeId: e.id,
|
|
324
|
+
element: e.element,
|
|
240
325
|
x: h.x,
|
|
241
326
|
y: h.y
|
|
242
|
-
}) && (this.grabbedNodeId =
|
|
327
|
+
}) && (this.grabbedNodeId = e.id, this.moveNodeOnTop(e.id), this.window.addEventListener("touchmove", this.onWindowTouchMove), this.window.addEventListener("touchend", this.onWindowTouchFinish), this.window.addEventListener("touchcancel", this.onWindowTouchFinish));
|
|
243
328
|
};
|
|
244
|
-
this.nodes.set(
|
|
245
|
-
element:
|
|
329
|
+
this.nodes.set(e.id, {
|
|
330
|
+
element: e.element,
|
|
246
331
|
onMouseDown: o,
|
|
247
332
|
onTouchStart: r
|
|
248
|
-
}),
|
|
333
|
+
}), e.element.addEventListener("mousedown", o), e.element.addEventListener("touchstart", r);
|
|
249
334
|
}
|
|
250
|
-
updateNode(
|
|
251
|
-
this.canvas.updateNode(
|
|
335
|
+
updateNode(e, o) {
|
|
336
|
+
this.canvas.updateNode(e, o), this.updateMaxNodePriority(e);
|
|
252
337
|
}
|
|
253
|
-
removeNode(
|
|
254
|
-
const o = this.nodes.get(
|
|
255
|
-
o !== void 0 && (o.element.removeEventListener("mousedown", o.onMouseDown), o.element.removeEventListener("touchstart", o.onTouchStart)), this.nodes.delete(
|
|
338
|
+
removeNode(e) {
|
|
339
|
+
const o = this.nodes.get(e);
|
|
340
|
+
o !== void 0 && (o.element.removeEventListener("mousedown", o.onMouseDown), o.element.removeEventListener("touchstart", o.onTouchStart)), this.nodes.delete(e), this.canvas.removeNode(e);
|
|
256
341
|
}
|
|
257
|
-
markPort(
|
|
258
|
-
this.canvas.markPort(
|
|
342
|
+
markPort(e) {
|
|
343
|
+
this.canvas.markPort(e);
|
|
259
344
|
}
|
|
260
|
-
updatePort(
|
|
261
|
-
this.canvas.updatePort(
|
|
345
|
+
updatePort(e, o) {
|
|
346
|
+
this.canvas.updatePort(e, o);
|
|
262
347
|
}
|
|
263
|
-
unmarkPort(
|
|
264
|
-
this.canvas.unmarkPort(
|
|
348
|
+
unmarkPort(e) {
|
|
349
|
+
this.canvas.unmarkPort(e);
|
|
265
350
|
}
|
|
266
|
-
addEdge(
|
|
267
|
-
this.canvas.addEdge(
|
|
351
|
+
addEdge(e) {
|
|
352
|
+
this.canvas.addEdge(e);
|
|
268
353
|
}
|
|
269
|
-
updateEdge(
|
|
270
|
-
this.canvas.updateEdge(
|
|
354
|
+
updateEdge(e, o) {
|
|
355
|
+
this.canvas.updateEdge(e, o);
|
|
271
356
|
}
|
|
272
|
-
removeEdge(
|
|
273
|
-
this.canvas.removeEdge(
|
|
357
|
+
removeEdge(e) {
|
|
358
|
+
this.canvas.removeEdge(e);
|
|
274
359
|
}
|
|
275
|
-
patchViewportMatrix(
|
|
276
|
-
this.canvas.patchViewportMatrix(
|
|
360
|
+
patchViewportMatrix(e) {
|
|
361
|
+
this.canvas.patchViewportMatrix(e);
|
|
277
362
|
}
|
|
278
|
-
patchContentMatrix(
|
|
279
|
-
this.canvas.patchContentMatrix(
|
|
363
|
+
patchContentMatrix(e) {
|
|
364
|
+
this.canvas.patchContentMatrix(e);
|
|
280
365
|
}
|
|
281
366
|
clear() {
|
|
282
|
-
this.canvas.clear(), this.nodes.forEach((
|
|
283
|
-
|
|
367
|
+
this.canvas.clear(), this.nodes.forEach((e) => {
|
|
368
|
+
e.element.removeEventListener("mousedown", e.onMouseDown), e.element.removeEventListener("touchstart", e.onTouchStart);
|
|
284
369
|
}), this.nodes.clear(), this.maxNodePriority = 0;
|
|
285
370
|
}
|
|
286
371
|
destroy() {
|
|
287
372
|
this.detach(), this.clear(), this.removeMouseDragListeners(), this.removeTouchDragListeners(), this.canvas.destroy();
|
|
288
373
|
}
|
|
289
|
-
dragNode(
|
|
290
|
-
const n = this.graph.getNode(
|
|
374
|
+
dragNode(e, o, r) {
|
|
375
|
+
const n = this.graph.getNode(e);
|
|
291
376
|
if (n === null)
|
|
292
377
|
return;
|
|
293
|
-
const h = this.canvas.viewport.getContentMatrix(), s = h.scale * n.x + h.x,
|
|
294
|
-
this.canvas.updateNode(
|
|
295
|
-
nodeId:
|
|
378
|
+
const h = this.canvas.viewport.getContentMatrix(), s = h.scale * n.x + h.x, d = h.scale * n.y + h.y, c = s + o, a = d + r, l = this.canvas.viewport.getViewportMatrix(), g = l.scale * c + l.x, f = l.scale * a + l.y;
|
|
379
|
+
this.canvas.updateNode(e, { x: g, y: f }), this.options.onNodeDrag({
|
|
380
|
+
nodeId: e,
|
|
296
381
|
element: n.element,
|
|
297
382
|
x: g,
|
|
298
|
-
y
|
|
383
|
+
y: f
|
|
299
384
|
});
|
|
300
385
|
}
|
|
301
|
-
updateMaxNodePriority(
|
|
302
|
-
const o = this.graph.getNode(
|
|
386
|
+
updateMaxNodePriority(e) {
|
|
387
|
+
const o = this.graph.getNode(e).priority;
|
|
303
388
|
this.maxNodePriority = Math.max(this.maxNodePriority, o);
|
|
304
389
|
}
|
|
305
|
-
moveNodeOnTop(
|
|
390
|
+
moveNodeOnTop(e) {
|
|
306
391
|
if (this.options.freezePriority)
|
|
307
392
|
return;
|
|
308
|
-
this.maxNodePriority += 2, this.updateNode(
|
|
393
|
+
this.maxNodePriority += 2, this.updateNode(e, { priority: this.maxNodePriority });
|
|
309
394
|
const o = this.maxNodePriority - 1;
|
|
310
|
-
this.graph.getNodeAdjacentEdgeIds(
|
|
395
|
+
this.graph.getNodeAdjacentEdgeIds(e).forEach((n) => {
|
|
311
396
|
this.updateEdge(n, { priority: o });
|
|
312
397
|
});
|
|
313
398
|
}
|
|
314
399
|
cancelMouseDrag() {
|
|
315
|
-
const
|
|
316
|
-
|
|
400
|
+
const e = this.graph.getNode(this.grabbedNodeId);
|
|
401
|
+
e !== null && this.options.onNodeDragFinished({
|
|
317
402
|
nodeId: this.grabbedNodeId,
|
|
318
|
-
element:
|
|
319
|
-
x:
|
|
320
|
-
y:
|
|
321
|
-
}), this.grabbedNodeId = null, this.element !== null &&
|
|
403
|
+
element: e.element,
|
|
404
|
+
x: e.x,
|
|
405
|
+
y: e.y
|
|
406
|
+
}), this.grabbedNodeId = null, this.element !== null && R(this.element, null), this.removeMouseDragListeners();
|
|
322
407
|
}
|
|
323
408
|
removeMouseDragListeners() {
|
|
324
409
|
this.window.removeEventListener("mouseup", this.onWindowMouseUp), this.window.removeEventListener("mousemove", this.onWindowMouseMove);
|
|
325
410
|
}
|
|
326
411
|
cancelTouchDrag() {
|
|
327
412
|
this.previousTouchCoords = null;
|
|
328
|
-
const
|
|
329
|
-
|
|
413
|
+
const e = this.graph.getNode(this.grabbedNodeId);
|
|
414
|
+
e !== null && this.options.onNodeDragFinished({
|
|
330
415
|
nodeId: this.grabbedNodeId,
|
|
331
|
-
element:
|
|
332
|
-
x:
|
|
333
|
-
y:
|
|
416
|
+
element: e.element,
|
|
417
|
+
x: e.x,
|
|
418
|
+
y: e.y
|
|
334
419
|
}), this.grabbedNodeId = null, this.removeTouchDragListeners();
|
|
335
420
|
}
|
|
336
421
|
removeTouchDragListeners() {
|
|
337
422
|
this.window.removeEventListener("touchmove", this.onWindowTouchMove), this.window.removeEventListener("touchend", this.onWindowTouchFinish), this.window.removeEventListener("touchcancel", this.onWindowTouchFinish);
|
|
338
423
|
}
|
|
339
424
|
}
|
|
340
|
-
const
|
|
341
|
-
const
|
|
425
|
+
const ce = (t) => {
|
|
426
|
+
const e = t.minX !== null ? t.minX : -1 / 0, o = t.maxX !== null ? t.maxX : 1 / 0, r = t.minY !== null ? t.minY : -1 / 0, n = t.maxY !== null ? t.maxY : 1 / 0;
|
|
342
427
|
return (h) => {
|
|
343
|
-
let s = h.nextTransform.x,
|
|
344
|
-
s <
|
|
345
|
-
const
|
|
346
|
-
s > a && s > h.prevTransform.x && (s = Math.max(h.prevTransform.x, a)),
|
|
428
|
+
let s = h.nextTransform.x, d = h.nextTransform.y;
|
|
429
|
+
s < e && s < h.prevTransform.x && (s = Math.min(h.prevTransform.x, e));
|
|
430
|
+
const c = h.canvasWidth * h.prevTransform.scale, a = o - c;
|
|
431
|
+
s > a && s > h.prevTransform.x && (s = Math.max(h.prevTransform.x, a)), d < r && d < h.prevTransform.y && (d = Math.min(h.prevTransform.y, r));
|
|
347
432
|
const l = h.canvasHeight * h.prevTransform.scale, g = n - l;
|
|
348
|
-
return
|
|
433
|
+
return d > g && d > h.prevTransform.y && (d = Math.max(h.prevTransform.y, g)), { scale: h.nextTransform.scale, x: s, y: d };
|
|
349
434
|
};
|
|
350
|
-
},
|
|
351
|
-
const
|
|
435
|
+
}, ae = (t) => {
|
|
436
|
+
const e = t.maxContentScale, o = t.minContentScale, r = e !== null ? 1 / e : 0, n = o !== null ? 1 / o : 1 / 0;
|
|
352
437
|
return (h) => {
|
|
353
|
-
const s = h.prevTransform,
|
|
354
|
-
let
|
|
355
|
-
if (
|
|
356
|
-
|
|
357
|
-
const g = (
|
|
358
|
-
a = s.x + (
|
|
438
|
+
const s = h.prevTransform, d = h.nextTransform;
|
|
439
|
+
let c = d.scale, a = d.x, l = d.y;
|
|
440
|
+
if (d.scale > n && d.scale > s.scale) {
|
|
441
|
+
c = Math.max(s.scale, n), a = s.x, l = s.y;
|
|
442
|
+
const g = (c - s.scale) / (d.scale - s.scale);
|
|
443
|
+
a = s.x + (d.x - s.x) * g, l = s.y + (d.y - s.y) * g;
|
|
359
444
|
}
|
|
360
|
-
if (
|
|
361
|
-
|
|
362
|
-
const g = (
|
|
363
|
-
a = s.x + (
|
|
445
|
+
if (d.scale < r && d.scale < s.scale) {
|
|
446
|
+
c = Math.min(s.scale, r), a = s.x, l = s.y;
|
|
447
|
+
const g = (c - s.scale) / (d.scale - s.scale);
|
|
448
|
+
a = s.x + (d.x - s.x) * g, l = s.y + (d.y - s.y) * g;
|
|
364
449
|
}
|
|
365
450
|
return {
|
|
366
|
-
scale:
|
|
451
|
+
scale: c,
|
|
367
452
|
x: a,
|
|
368
453
|
y: l
|
|
369
454
|
};
|
|
370
455
|
};
|
|
371
|
-
},
|
|
456
|
+
}, le = (t) => (e) => t.reduce(
|
|
372
457
|
(o, r) => r({
|
|
373
|
-
prevTransform:
|
|
458
|
+
prevTransform: e.prevTransform,
|
|
374
459
|
nextTransform: o,
|
|
375
|
-
canvasWidth:
|
|
376
|
-
canvasHeight:
|
|
460
|
+
canvasWidth: e.canvasWidth,
|
|
461
|
+
canvasHeight: e.canvasHeight
|
|
377
462
|
}),
|
|
378
|
-
|
|
379
|
-
),
|
|
380
|
-
if (typeof
|
|
381
|
-
return
|
|
382
|
-
switch (
|
|
463
|
+
e.nextTransform
|
|
464
|
+
), Q = (t) => {
|
|
465
|
+
if (typeof t == "function")
|
|
466
|
+
return t;
|
|
467
|
+
switch (t.type) {
|
|
383
468
|
case "scale-limit":
|
|
384
|
-
return
|
|
385
|
-
minContentScale:
|
|
386
|
-
maxContentScale:
|
|
469
|
+
return ae({
|
|
470
|
+
minContentScale: t.minContentScale ?? 0,
|
|
471
|
+
maxContentScale: t.maxContentScale ?? 1 / 0
|
|
387
472
|
});
|
|
388
473
|
case "shift-limit":
|
|
389
|
-
return
|
|
390
|
-
minX:
|
|
391
|
-
maxX:
|
|
392
|
-
minY:
|
|
393
|
-
maxY:
|
|
474
|
+
return ce({
|
|
475
|
+
minX: t.minX ?? -1 / 0,
|
|
476
|
+
maxX: t.maxX ?? 1 / 0,
|
|
477
|
+
minY: t.minY ?? -1 / 0,
|
|
478
|
+
maxY: t.maxY ?? 1 / 0
|
|
394
479
|
});
|
|
395
480
|
}
|
|
396
|
-
},
|
|
397
|
-
var v,
|
|
398
|
-
const
|
|
481
|
+
}, ge = (t) => {
|
|
482
|
+
var v, S, p, N, k, M, V, L, G, _, J, K;
|
|
483
|
+
const e = (v = t == null ? void 0 : t.scale) == null ? void 0 : v.mouseWheelSensitivity, o = e !== void 0 ? e : 1.2, r = t == null ? void 0 : t.transformPreprocessor;
|
|
399
484
|
let n;
|
|
400
|
-
r !== void 0 ? Array.isArray(r) ? n =
|
|
485
|
+
r !== void 0 ? Array.isArray(r) ? n = le(
|
|
401
486
|
r.map(
|
|
402
|
-
(
|
|
487
|
+
(b) => Q(b)
|
|
403
488
|
)
|
|
404
|
-
) : n =
|
|
405
|
-
const h = ((
|
|
406
|
-
}),
|
|
407
|
-
}),
|
|
489
|
+
) : n = Q(r) : n = (b) => b.nextTransform;
|
|
490
|
+
const h = ((S = t == null ? void 0 : t.shift) == null ? void 0 : S.cursor) !== void 0 ? t.shift.cursor : "grab", s = ((p = t == null ? void 0 : t.events) == null ? void 0 : p.onBeforeTransformChange) ?? (() => {
|
|
491
|
+
}), d = ((N = t == null ? void 0 : t.events) == null ? void 0 : N.onTransformChange) ?? (() => {
|
|
492
|
+
}), c = (k = t == null ? void 0 : t.shift) == null ? void 0 : k.mouseDownEventVerifier, a = c !== void 0 ? c : (b) => b.button === 0, l = (M = t == null ? void 0 : t.shift) == null ? void 0 : M.mouseUpEventVerifier, g = l !== void 0 ? l : (b) => b.button === 0, f = (V = t == null ? void 0 : t.scale) == null ? void 0 : V.mouseWheelEventVerifier, x = f !== void 0 ? f : () => !0;
|
|
408
493
|
return {
|
|
409
494
|
wheelSensitivity: o,
|
|
410
|
-
onTransformStarted: ((
|
|
495
|
+
onTransformStarted: ((L = t == null ? void 0 : t.events) == null ? void 0 : L.onTransformStarted) ?? (() => {
|
|
411
496
|
}),
|
|
412
|
-
onTransformFinished: ((
|
|
497
|
+
onTransformFinished: ((G = t == null ? void 0 : t.events) == null ? void 0 : G.onTransformFinished) ?? (() => {
|
|
413
498
|
}),
|
|
414
499
|
onBeforeTransformChange: s,
|
|
415
|
-
onTransformChange:
|
|
500
|
+
onTransformChange: d,
|
|
416
501
|
transformPreprocessor: n,
|
|
417
502
|
shiftCursor: h,
|
|
418
503
|
mouseDownEventVerifier: a,
|
|
419
504
|
mouseUpEventVerifier: g,
|
|
420
505
|
mouseWheelEventVerifier: x,
|
|
421
|
-
scaleWheelFinishTimeout: ((
|
|
422
|
-
onResizeTransformStarted: ((
|
|
506
|
+
scaleWheelFinishTimeout: ((_ = t == null ? void 0 : t.scale) == null ? void 0 : _.wheelFinishTimeout) ?? 500,
|
|
507
|
+
onResizeTransformStarted: ((J = t == null ? void 0 : t.events) == null ? void 0 : J.onResizeTransformStarted) ?? (() => {
|
|
423
508
|
}),
|
|
424
|
-
onResizeTransformFinished: ((K =
|
|
509
|
+
onResizeTransformFinished: ((K = t == null ? void 0 : t.events) == null ? void 0 : K.onResizeTransformFinished) ?? (() => {
|
|
425
510
|
})
|
|
426
511
|
};
|
|
427
|
-
},
|
|
428
|
-
const
|
|
429
|
-
for (let
|
|
430
|
-
|
|
431
|
-
const r =
|
|
432
|
-
(
|
|
512
|
+
}, C = (t) => {
|
|
513
|
+
const e = [], o = t.touches.length;
|
|
514
|
+
for (let d = 0; d < o; d++)
|
|
515
|
+
e.push([t.touches[d].clientX, t.touches[d].clientY]);
|
|
516
|
+
const r = e.reduce(
|
|
517
|
+
(d, c) => [d[0] + c[0], d[1] + c[1]],
|
|
433
518
|
[0, 0]
|
|
434
|
-
), n = [r[0] / o, r[1] / o], s =
|
|
435
|
-
(
|
|
519
|
+
), n = [r[0] / o, r[1] / o], s = e.map((d) => [d[0] - n[0], d[1] - n[1]]).reduce(
|
|
520
|
+
(d, c) => d + Math.sqrt(c[0] * c[0] + c[1] * c[1]),
|
|
436
521
|
0
|
|
437
522
|
);
|
|
438
523
|
return {
|
|
@@ -440,62 +525,62 @@ const ht = (e) => {
|
|
|
440
525
|
y: n[1],
|
|
441
526
|
scale: s / o,
|
|
442
527
|
touchesCnt: o,
|
|
443
|
-
touches:
|
|
528
|
+
touches: e
|
|
444
529
|
};
|
|
445
|
-
},
|
|
446
|
-
scale:
|
|
447
|
-
x:
|
|
448
|
-
y:
|
|
449
|
-
}),
|
|
450
|
-
scale:
|
|
451
|
-
x:
|
|
452
|
-
y:
|
|
530
|
+
}, ue = (t, e, o) => ({
|
|
531
|
+
scale: t.scale,
|
|
532
|
+
x: t.x + t.scale * e,
|
|
533
|
+
y: t.y + t.scale * o
|
|
534
|
+
}), we = (t, e, o, r) => ({
|
|
535
|
+
scale: t.scale * e,
|
|
536
|
+
x: t.scale * (1 - e) * o + t.x,
|
|
537
|
+
y: t.scale * (1 - e) * r + t.y
|
|
453
538
|
});
|
|
454
|
-
class
|
|
455
|
-
constructor(
|
|
539
|
+
class ee {
|
|
540
|
+
constructor(e, o) {
|
|
456
541
|
i(this, "graph");
|
|
457
542
|
i(this, "viewport");
|
|
458
543
|
i(this, "element", null);
|
|
459
544
|
i(this, "prevTouches", null);
|
|
460
545
|
i(this, "window", window);
|
|
461
546
|
i(this, "wheelFinishTimer", null);
|
|
462
|
-
i(this, "onMouseDown", (
|
|
463
|
-
this.element === null || !this.options.mouseDownEventVerifier(
|
|
547
|
+
i(this, "onMouseDown", (e) => {
|
|
548
|
+
this.element === null || !this.options.mouseDownEventVerifier(e) || (R(this.element, this.options.shiftCursor), this.window.addEventListener("mousemove", this.onWindowMouseMove), this.window.addEventListener("mouseup", this.onWindowMouseUp), this.options.onTransformStarted());
|
|
464
549
|
});
|
|
465
|
-
i(this, "onWindowMouseMove", (
|
|
466
|
-
if (this.element === null || !
|
|
550
|
+
i(this, "onWindowMouseMove", (e) => {
|
|
551
|
+
if (this.element === null || !U(this.element, e.clientX, e.clientY) || !$(this.window, e.clientX, e.clientY)) {
|
|
467
552
|
this.stopMouseDrag();
|
|
468
553
|
return;
|
|
469
554
|
}
|
|
470
|
-
const o = -
|
|
555
|
+
const o = -e.movementX, r = -e.movementY;
|
|
471
556
|
this.moveViewport(this.element, o, r);
|
|
472
557
|
});
|
|
473
|
-
i(this, "onWindowMouseUp", (
|
|
474
|
-
this.element === null || !this.options.mouseUpEventVerifier(
|
|
558
|
+
i(this, "onWindowMouseUp", (e) => {
|
|
559
|
+
this.element === null || !this.options.mouseUpEventVerifier(e) || this.stopMouseDrag();
|
|
475
560
|
});
|
|
476
|
-
i(this, "onWheelScroll", (
|
|
477
|
-
if (!this.options.mouseWheelEventVerifier(
|
|
561
|
+
i(this, "onWheelScroll", (e) => {
|
|
562
|
+
if (!this.options.mouseWheelEventVerifier(e))
|
|
478
563
|
return;
|
|
479
|
-
|
|
480
|
-
const { left: o, top: r } = this.element.getBoundingClientRect(), n =
|
|
481
|
-
this.wheelFinishTimer === null && this.options.onTransformStarted(), this.scaleViewport(this.element,
|
|
564
|
+
e.preventDefault();
|
|
565
|
+
const { left: o, top: r } = this.element.getBoundingClientRect(), n = e.clientX - o, h = e.clientY - r, d = 1 / (e.deltaY < 0 ? this.options.wheelSensitivity : 1 / this.options.wheelSensitivity);
|
|
566
|
+
this.wheelFinishTimer === null && this.options.onTransformStarted(), this.scaleViewport(this.element, d, n, h), this.wheelFinishTimer !== null && clearTimeout(this.wheelFinishTimer), this.wheelFinishTimer = setTimeout(() => {
|
|
482
567
|
this.options.onTransformFinished(), this.wheelFinishTimer = null;
|
|
483
568
|
}, this.options.scaleWheelFinishTimeout);
|
|
484
569
|
});
|
|
485
|
-
i(this, "onTouchStart", (
|
|
570
|
+
i(this, "onTouchStart", (e) => {
|
|
486
571
|
if (this.prevTouches !== null) {
|
|
487
|
-
this.prevTouches =
|
|
572
|
+
this.prevTouches = C(e);
|
|
488
573
|
return;
|
|
489
574
|
}
|
|
490
|
-
this.prevTouches =
|
|
575
|
+
this.prevTouches = C(e), this.window.addEventListener("touchmove", this.onWindowTouchMove), this.window.addEventListener("touchend", this.onWindowTouchFinish), this.window.addEventListener("touchcancel", this.onWindowTouchFinish), this.options.onTransformStarted();
|
|
491
576
|
});
|
|
492
|
-
i(this, "onWindowTouchMove", (
|
|
577
|
+
i(this, "onWindowTouchMove", (e) => {
|
|
493
578
|
const o = this.element;
|
|
494
579
|
if (o === null)
|
|
495
580
|
return;
|
|
496
|
-
const r =
|
|
581
|
+
const r = C(e);
|
|
497
582
|
if (!r.touches.every(
|
|
498
|
-
(h) =>
|
|
583
|
+
(h) => U(o, h[0], h[1]) && $(this.window, h[0], h[1])
|
|
499
584
|
)) {
|
|
500
585
|
this.stopTouchDrag();
|
|
501
586
|
return;
|
|
@@ -505,64 +590,64 @@ class O {
|
|
|
505
590
|
-(r.x - this.prevTouches.x),
|
|
506
591
|
-(r.y - this.prevTouches.y)
|
|
507
592
|
), r.touchesCnt === 2) {
|
|
508
|
-
const { left: h, top: s } = o.getBoundingClientRect(),
|
|
509
|
-
this.scaleViewport(o, l,
|
|
593
|
+
const { left: h, top: s } = o.getBoundingClientRect(), d = this.prevTouches.x - h, c = this.prevTouches.y - s, l = 1 / (r.scale / this.prevTouches.scale);
|
|
594
|
+
this.scaleViewport(o, l, d, c);
|
|
510
595
|
}
|
|
511
596
|
this.prevTouches = r;
|
|
512
597
|
});
|
|
513
|
-
i(this, "onWindowTouchFinish", (
|
|
514
|
-
|
|
598
|
+
i(this, "onWindowTouchFinish", (e) => {
|
|
599
|
+
e.touches.length > 0 ? this.prevTouches = C(e) : this.stopTouchDrag();
|
|
515
600
|
});
|
|
516
601
|
i(this, "observer", new ResizeObserver(() => {
|
|
517
|
-
const
|
|
518
|
-
prevTransform:
|
|
519
|
-
nextTransform:
|
|
602
|
+
const e = this.canvas.viewport.getViewportMatrix(), { width: o, height: r } = this.element.getBoundingClientRect(), n = this.options.transformPreprocessor({
|
|
603
|
+
prevTransform: e,
|
|
604
|
+
nextTransform: e,
|
|
520
605
|
canvasWidth: o,
|
|
521
606
|
canvasHeight: r
|
|
522
607
|
});
|
|
523
608
|
this.options.onResizeTransformStarted(), this.canvas.patchViewportMatrix(n), this.options.onResizeTransformFinished();
|
|
524
609
|
}));
|
|
525
610
|
i(this, "options");
|
|
526
|
-
this.canvas =
|
|
611
|
+
this.canvas = e, this.options = ge(o), this.viewport = this.canvas.viewport, this.graph = this.canvas.graph;
|
|
527
612
|
}
|
|
528
|
-
attach(
|
|
529
|
-
this.detach(), this.element =
|
|
613
|
+
attach(e) {
|
|
614
|
+
this.detach(), this.element = e, this.observer.observe(this.element), this.element.addEventListener("mousedown", this.onMouseDown), this.element.addEventListener("wheel", this.onWheelScroll), this.element.addEventListener("touchstart", this.onTouchStart), this.canvas.attach(this.element);
|
|
530
615
|
}
|
|
531
616
|
detach() {
|
|
532
617
|
this.canvas.detach(), this.element !== null && (this.observer.unobserve(this.element), this.element.removeEventListener("mousedown", this.onMouseDown), this.element.removeEventListener("wheel", this.onWheelScroll), this.element.removeEventListener("touchstart", this.onTouchStart), this.element = null);
|
|
533
618
|
}
|
|
534
|
-
addNode(
|
|
535
|
-
this.canvas.addNode(
|
|
619
|
+
addNode(e) {
|
|
620
|
+
this.canvas.addNode(e);
|
|
536
621
|
}
|
|
537
|
-
updateNode(
|
|
538
|
-
this.canvas.updateNode(
|
|
622
|
+
updateNode(e, o) {
|
|
623
|
+
this.canvas.updateNode(e, o);
|
|
539
624
|
}
|
|
540
|
-
removeNode(
|
|
541
|
-
this.canvas.removeNode(
|
|
625
|
+
removeNode(e) {
|
|
626
|
+
this.canvas.removeNode(e);
|
|
542
627
|
}
|
|
543
|
-
markPort(
|
|
544
|
-
this.canvas.markPort(
|
|
628
|
+
markPort(e) {
|
|
629
|
+
this.canvas.markPort(e);
|
|
545
630
|
}
|
|
546
|
-
updatePort(
|
|
547
|
-
this.canvas.updatePort(
|
|
631
|
+
updatePort(e, o) {
|
|
632
|
+
this.canvas.updatePort(e, o);
|
|
548
633
|
}
|
|
549
|
-
unmarkPort(
|
|
550
|
-
this.canvas.unmarkPort(
|
|
634
|
+
unmarkPort(e) {
|
|
635
|
+
this.canvas.unmarkPort(e);
|
|
551
636
|
}
|
|
552
|
-
addEdge(
|
|
553
|
-
this.canvas.addEdge(
|
|
637
|
+
addEdge(e) {
|
|
638
|
+
this.canvas.addEdge(e);
|
|
554
639
|
}
|
|
555
|
-
updateEdge(
|
|
556
|
-
this.canvas.updateEdge(
|
|
640
|
+
updateEdge(e, o) {
|
|
641
|
+
this.canvas.updateEdge(e, o);
|
|
557
642
|
}
|
|
558
|
-
removeEdge(
|
|
559
|
-
this.canvas.removeEdge(
|
|
643
|
+
removeEdge(e) {
|
|
644
|
+
this.canvas.removeEdge(e);
|
|
560
645
|
}
|
|
561
|
-
patchViewportMatrix(
|
|
562
|
-
this.canvas.patchViewportMatrix(
|
|
646
|
+
patchViewportMatrix(e) {
|
|
647
|
+
this.canvas.patchViewportMatrix(e);
|
|
563
648
|
}
|
|
564
|
-
patchContentMatrix(
|
|
565
|
-
this.canvas.patchContentMatrix(
|
|
649
|
+
patchContentMatrix(e) {
|
|
650
|
+
this.canvas.patchContentMatrix(e);
|
|
566
651
|
}
|
|
567
652
|
clear() {
|
|
568
653
|
this.canvas.clear();
|
|
@@ -570,26 +655,26 @@ class O {
|
|
|
570
655
|
destroy() {
|
|
571
656
|
this.detach(), this.removeMouseDragListeners(), this.removeTouchDragListeners(), this.canvas.destroy();
|
|
572
657
|
}
|
|
573
|
-
moveViewport(
|
|
574
|
-
const n = this.viewport.getViewportMatrix(), h =
|
|
658
|
+
moveViewport(e, o, r) {
|
|
659
|
+
const n = this.viewport.getViewportMatrix(), h = ue(n, o, r), { width: s, height: d } = e.getBoundingClientRect(), c = this.options.transformPreprocessor({
|
|
575
660
|
prevTransform: n,
|
|
576
661
|
nextTransform: h,
|
|
577
662
|
canvasWidth: s,
|
|
578
|
-
canvasHeight:
|
|
663
|
+
canvasHeight: d
|
|
579
664
|
});
|
|
580
|
-
this.performTransform(
|
|
665
|
+
this.performTransform(c);
|
|
581
666
|
}
|
|
582
|
-
scaleViewport(
|
|
583
|
-
const h = this.canvas.viewport.getViewportMatrix(), s =
|
|
667
|
+
scaleViewport(e, o, r, n) {
|
|
668
|
+
const h = this.canvas.viewport.getViewportMatrix(), s = we(h, o, r, n), { width: d, height: c } = e.getBoundingClientRect(), a = this.options.transformPreprocessor({
|
|
584
669
|
prevTransform: h,
|
|
585
670
|
nextTransform: s,
|
|
586
|
-
canvasWidth:
|
|
587
|
-
canvasHeight:
|
|
671
|
+
canvasWidth: d,
|
|
672
|
+
canvasHeight: c
|
|
588
673
|
});
|
|
589
674
|
this.performTransform(a);
|
|
590
675
|
}
|
|
591
676
|
stopMouseDrag() {
|
|
592
|
-
this.element !== null &&
|
|
677
|
+
this.element !== null && R(this.element, null), this.removeMouseDragListeners(), this.options.onTransformFinished();
|
|
593
678
|
}
|
|
594
679
|
removeMouseDragListeners() {
|
|
595
680
|
this.window.removeEventListener("mousemove", this.onWindowMouseMove), this.window.removeEventListener("mouseup", this.onWindowMouseUp);
|
|
@@ -600,117 +685,12 @@ class O {
|
|
|
600
685
|
removeTouchDragListeners() {
|
|
601
686
|
this.window.removeEventListener("touchmove", this.onWindowTouchMove), this.window.removeEventListener("touchend", this.onWindowTouchFinish), this.window.removeEventListener("touchcancel", this.onWindowTouchFinish);
|
|
602
687
|
}
|
|
603
|
-
performTransform(
|
|
604
|
-
this.options.onBeforeTransformChange(), this.canvas.patchViewportMatrix(
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
class ut {
|
|
608
|
-
constructor() {
|
|
609
|
-
i(this, "keyMap", /* @__PURE__ */ new Map());
|
|
610
|
-
i(this, "valueMap", /* @__PURE__ */ new Map());
|
|
611
|
-
}
|
|
612
|
-
set(t, o) {
|
|
613
|
-
this.keyMap.set(t, o), this.valueMap.set(o, t);
|
|
614
|
-
}
|
|
615
|
-
hasKey(t) {
|
|
616
|
-
return this.keyMap.has(t);
|
|
617
|
-
}
|
|
618
|
-
hasValue(t) {
|
|
619
|
-
return this.valueMap.has(t);
|
|
620
|
-
}
|
|
621
|
-
getByKey(t) {
|
|
622
|
-
return this.keyMap.get(t);
|
|
623
|
-
}
|
|
624
|
-
getByValue(t) {
|
|
625
|
-
return this.valueMap.get(t);
|
|
626
|
-
}
|
|
627
|
-
deleteByKey(t) {
|
|
628
|
-
const o = this.keyMap.get(t);
|
|
629
|
-
o !== void 0 && this.valueMap.delete(o), this.keyMap.delete(t);
|
|
630
|
-
}
|
|
631
|
-
deleteByValue(t) {
|
|
632
|
-
const o = this.valueMap.get(t);
|
|
633
|
-
o !== void 0 && this.keyMap.delete(o), this.valueMap.delete(t);
|
|
634
|
-
}
|
|
635
|
-
forEach(t) {
|
|
636
|
-
this.keyMap.forEach((o, r) => {
|
|
637
|
-
t(o, r);
|
|
638
|
-
});
|
|
639
|
-
}
|
|
640
|
-
clear() {
|
|
641
|
-
this.keyMap.clear(), this.valueMap.clear();
|
|
688
|
+
performTransform(e) {
|
|
689
|
+
this.options.onBeforeTransformChange(), this.canvas.patchViewportMatrix(e), this.options.onTransformChange();
|
|
642
690
|
}
|
|
643
691
|
}
|
|
644
|
-
class
|
|
645
|
-
constructor(
|
|
646
|
-
i(this, "viewport");
|
|
647
|
-
i(this, "graph");
|
|
648
|
-
i(this, "nodes", new ut());
|
|
649
|
-
i(this, "nodesResizeObserver");
|
|
650
|
-
i(this, "window", window);
|
|
651
|
-
this.canvas = t, this.nodesResizeObserver = new this.window.ResizeObserver((o) => {
|
|
652
|
-
o.forEach((r) => {
|
|
653
|
-
const n = r.target;
|
|
654
|
-
this.handleNodeResize(n);
|
|
655
|
-
});
|
|
656
|
-
}), this.viewport = this.canvas.viewport, this.graph = this.canvas.graph;
|
|
657
|
-
}
|
|
658
|
-
attach(t) {
|
|
659
|
-
this.canvas.attach(t);
|
|
660
|
-
}
|
|
661
|
-
detach() {
|
|
662
|
-
this.canvas.detach();
|
|
663
|
-
}
|
|
664
|
-
addNode(t) {
|
|
665
|
-
this.canvas.addNode(t), this.nodes.set(t.id, t.element), this.nodesResizeObserver.observe(t.element);
|
|
666
|
-
}
|
|
667
|
-
updateNode(t, o) {
|
|
668
|
-
this.canvas.updateNode(t, o);
|
|
669
|
-
}
|
|
670
|
-
removeNode(t) {
|
|
671
|
-
this.canvas.removeNode(t);
|
|
672
|
-
const o = this.nodes.getByKey(t);
|
|
673
|
-
this.nodes.deleteByKey(t), this.nodesResizeObserver.unobserve(o);
|
|
674
|
-
}
|
|
675
|
-
markPort(t) {
|
|
676
|
-
this.canvas.markPort(t);
|
|
677
|
-
}
|
|
678
|
-
updatePort(t, o) {
|
|
679
|
-
this.canvas.updatePort(t, o);
|
|
680
|
-
}
|
|
681
|
-
unmarkPort(t) {
|
|
682
|
-
this.canvas.unmarkPort(t);
|
|
683
|
-
}
|
|
684
|
-
addEdge(t) {
|
|
685
|
-
this.canvas.addEdge(t);
|
|
686
|
-
}
|
|
687
|
-
updateEdge(t, o) {
|
|
688
|
-
this.canvas.updateEdge(t, o);
|
|
689
|
-
}
|
|
690
|
-
removeEdge(t) {
|
|
691
|
-
this.canvas.removeEdge(t);
|
|
692
|
-
}
|
|
693
|
-
patchViewportMatrix(t) {
|
|
694
|
-
this.canvas.patchViewportMatrix(t);
|
|
695
|
-
}
|
|
696
|
-
patchContentMatrix(t) {
|
|
697
|
-
this.canvas.patchContentMatrix(t);
|
|
698
|
-
}
|
|
699
|
-
clear() {
|
|
700
|
-
this.canvas.clear(), this.nodesResizeObserver.disconnect(), this.nodes.clear();
|
|
701
|
-
}
|
|
702
|
-
destroy() {
|
|
703
|
-
this.clear(), this.canvas.destroy();
|
|
704
|
-
}
|
|
705
|
-
handleNodeResize(t) {
|
|
706
|
-
const o = this.nodes.getByValue(t);
|
|
707
|
-
this.canvas.updateNode(o, {}), this.graph.getNodeAdjacentEdgeIds(o).forEach((n) => {
|
|
708
|
-
this.canvas.updateEdge(n, {});
|
|
709
|
-
});
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
class yt {
|
|
713
|
-
constructor(t, o, r, n) {
|
|
692
|
+
class fe {
|
|
693
|
+
constructor(e, o, r, n) {
|
|
714
694
|
i(this, "graph");
|
|
715
695
|
i(this, "viewport");
|
|
716
696
|
i(this, "canvas");
|
|
@@ -728,22 +708,22 @@ class yt {
|
|
|
728
708
|
yFrom: 1 / 0,
|
|
729
709
|
yTo: 1 / 0
|
|
730
710
|
});
|
|
731
|
-
i(this, "updateLoadedArea", (
|
|
711
|
+
i(this, "updateLoadedArea", (e) => {
|
|
732
712
|
this.loadedArea = {
|
|
733
|
-
xFrom:
|
|
734
|
-
xTo:
|
|
735
|
-
yFrom:
|
|
736
|
-
yTo:
|
|
713
|
+
xFrom: e.x,
|
|
714
|
+
xTo: e.x + e.width,
|
|
715
|
+
yFrom: e.y,
|
|
716
|
+
yTo: e.y + e.height
|
|
737
717
|
};
|
|
738
718
|
});
|
|
739
|
-
var
|
|
719
|
+
var c, a;
|
|
740
720
|
this.trigger = o, this.virtualScrollOptions = n, this.nodeHorizontal = this.virtualScrollOptions.nodeContainingRadius.horizontal, this.nodeVertical = this.virtualScrollOptions.nodeContainingRadius.vertical, this.canvasResizeObserver = new this.window.ResizeObserver((l) => {
|
|
741
721
|
const g = l[0];
|
|
742
722
|
this.viewportWidth = g.contentRect.width, this.viewportHeight = g.contentRect.height, this.scheduleLoadAreaAroundViewport();
|
|
743
723
|
});
|
|
744
|
-
const h = ((
|
|
724
|
+
const h = ((c = r == null ? void 0 : r.events) == null ? void 0 : c.onTransformFinished) ?? (() => {
|
|
745
725
|
}), s = ((a = r == null ? void 0 : r.events) == null ? void 0 : a.onTransformChange) ?? (() => {
|
|
746
|
-
}),
|
|
726
|
+
}), d = {
|
|
747
727
|
...r,
|
|
748
728
|
events: {
|
|
749
729
|
...r == null ? void 0 : r.events,
|
|
@@ -756,49 +736,49 @@ class yt {
|
|
|
756
736
|
}
|
|
757
737
|
}
|
|
758
738
|
};
|
|
759
|
-
this.canvas = new
|
|
760
|
-
|
|
761
|
-
|
|
739
|
+
this.canvas = new ee(
|
|
740
|
+
e,
|
|
741
|
+
d
|
|
762
742
|
), this.viewportMatrix = this.canvas.viewport.getViewportMatrix(), this.viewport = this.canvas.viewport, this.graph = this.canvas.graph, this.trigger.subscribe(this.updateLoadedArea);
|
|
763
743
|
}
|
|
764
|
-
attach(
|
|
765
|
-
this.detach(), this.element =
|
|
744
|
+
attach(e) {
|
|
745
|
+
this.detach(), this.element = e, this.canvasResizeObserver.observe(this.element), this.canvas.attach(e);
|
|
766
746
|
}
|
|
767
747
|
detach() {
|
|
768
748
|
this.element !== null && (this.canvasResizeObserver.unobserve(this.element), this.element = null, this.viewportWidth = 0, this.viewportHeight = 0), this.canvas.detach();
|
|
769
749
|
}
|
|
770
|
-
addNode(
|
|
771
|
-
this.canvas.addNode(
|
|
750
|
+
addNode(e) {
|
|
751
|
+
this.canvas.addNode(e);
|
|
772
752
|
}
|
|
773
|
-
updateNode(
|
|
774
|
-
this.canvas.updateNode(
|
|
753
|
+
updateNode(e, o) {
|
|
754
|
+
this.canvas.updateNode(e, o);
|
|
775
755
|
}
|
|
776
|
-
removeNode(
|
|
777
|
-
this.canvas.removeNode(
|
|
756
|
+
removeNode(e) {
|
|
757
|
+
this.canvas.removeNode(e);
|
|
778
758
|
}
|
|
779
|
-
markPort(
|
|
780
|
-
this.canvas.markPort(
|
|
759
|
+
markPort(e) {
|
|
760
|
+
this.canvas.markPort(e);
|
|
781
761
|
}
|
|
782
|
-
updatePort(
|
|
783
|
-
this.canvas.updatePort(
|
|
762
|
+
updatePort(e, o) {
|
|
763
|
+
this.canvas.updatePort(e, o);
|
|
784
764
|
}
|
|
785
|
-
unmarkPort(
|
|
786
|
-
this.canvas.unmarkPort(
|
|
765
|
+
unmarkPort(e) {
|
|
766
|
+
this.canvas.unmarkPort(e);
|
|
787
767
|
}
|
|
788
|
-
addEdge(
|
|
789
|
-
this.canvas.addEdge(
|
|
768
|
+
addEdge(e) {
|
|
769
|
+
this.canvas.addEdge(e);
|
|
790
770
|
}
|
|
791
|
-
updateEdge(
|
|
792
|
-
this.canvas.updateEdge(
|
|
771
|
+
updateEdge(e, o) {
|
|
772
|
+
this.canvas.updateEdge(e, o);
|
|
793
773
|
}
|
|
794
|
-
removeEdge(
|
|
795
|
-
this.canvas.removeEdge(
|
|
774
|
+
removeEdge(e) {
|
|
775
|
+
this.canvas.removeEdge(e);
|
|
796
776
|
}
|
|
797
|
-
patchViewportMatrix(
|
|
798
|
-
this.canvas.patchViewportMatrix(
|
|
777
|
+
patchViewportMatrix(e) {
|
|
778
|
+
this.canvas.patchViewportMatrix(e), this.viewportMatrix = this.canvas.viewport.getViewportMatrix(), this.loadAreaAroundViewport();
|
|
799
779
|
}
|
|
800
|
-
patchContentMatrix(
|
|
801
|
-
this.canvas.patchContentMatrix(
|
|
780
|
+
patchContentMatrix(e) {
|
|
781
|
+
this.canvas.patchContentMatrix(e), this.viewportMatrix = this.canvas.viewport.getViewportMatrix(), this.loadAreaAroundViewport();
|
|
802
782
|
}
|
|
803
783
|
clear() {
|
|
804
784
|
this.canvas.clear();
|
|
@@ -812,153 +792,153 @@ class yt {
|
|
|
812
792
|
});
|
|
813
793
|
}
|
|
814
794
|
scheduleEnsureViewportAreaLoaded() {
|
|
815
|
-
const
|
|
795
|
+
const e = this.viewportWidth * this.viewportMatrix.scale, o = this.viewportHeight * this.viewportMatrix.scale, r = this.viewportMatrix.x - this.nodeHorizontal, n = this.viewportMatrix.y - this.nodeVertical, h = this.viewportMatrix.x + e + this.nodeHorizontal, s = this.viewportMatrix.y + o + this.nodeVertical;
|
|
816
796
|
this.loadedArea.xFrom < r && this.loadedArea.xTo > h && this.loadedArea.yFrom < n && this.loadedArea.yTo > s || this.scheduleLoadAreaAroundViewport();
|
|
817
797
|
}
|
|
818
798
|
loadAreaAroundViewport() {
|
|
819
|
-
const
|
|
799
|
+
const e = this.viewportWidth * this.viewportMatrix.scale, o = this.viewportHeight * this.viewportMatrix.scale, r = this.viewportMatrix.x - e - this.nodeHorizontal, n = this.viewportMatrix.y - o - this.nodeVertical, h = 3 * e + 2 * this.nodeHorizontal, s = 3 * o + 2 * this.nodeVertical;
|
|
820
800
|
this.trigger.emit({ x: r, y: n, width: h, height: s });
|
|
821
801
|
}
|
|
822
802
|
}
|
|
823
|
-
const
|
|
824
|
-
const
|
|
825
|
-
return
|
|
826
|
-
},
|
|
827
|
-
const
|
|
828
|
-
return
|
|
829
|
-
},
|
|
830
|
-
const
|
|
831
|
-
return
|
|
803
|
+
const ve = () => {
|
|
804
|
+
const t = document.createElement("div");
|
|
805
|
+
return t.style.width = "100%", t.style.height = "100%", t.style.position = "relative", t.style.overflow = "hidden", t;
|
|
806
|
+
}, ye = () => {
|
|
807
|
+
const t = document.createElement("div");
|
|
808
|
+
return t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.width = "0", t.style.height = "0", t;
|
|
809
|
+
}, xe = () => {
|
|
810
|
+
const t = document.createElement("div");
|
|
811
|
+
return t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.visibility = "hidden", t;
|
|
832
812
|
};
|
|
833
|
-
class
|
|
834
|
-
constructor(
|
|
813
|
+
class Ae {
|
|
814
|
+
constructor(e, o) {
|
|
835
815
|
i(this, "canvasWrapper", null);
|
|
836
|
-
i(this, "host",
|
|
837
|
-
i(this, "container",
|
|
816
|
+
i(this, "host", ve());
|
|
817
|
+
i(this, "container", ye());
|
|
838
818
|
i(this, "nodeIdToWrapperElementMap", /* @__PURE__ */ new Map());
|
|
839
819
|
i(this, "edgeIdToElementMap", /* @__PURE__ */ new Map());
|
|
840
820
|
i(this, "applyTransform", () => {
|
|
841
|
-
const
|
|
842
|
-
this.container.style.transform = `matrix(${
|
|
821
|
+
const e = this.viewportStore.getContentMatrix();
|
|
822
|
+
this.container.style.transform = `matrix(${e.scale}, 0, 0, ${e.scale}, ${e.x}, ${e.y})`;
|
|
843
823
|
});
|
|
844
|
-
this.graphStore =
|
|
824
|
+
this.graphStore = e, this.viewportStore = o, this.host.appendChild(this.container), this.viewportStore.onAfterUpdated.subscribe(this.applyTransform);
|
|
845
825
|
}
|
|
846
|
-
attach(
|
|
847
|
-
this.detach(), this.canvasWrapper =
|
|
826
|
+
attach(e) {
|
|
827
|
+
this.detach(), this.canvasWrapper = e, this.canvasWrapper.appendChild(this.host), this.graphStore.getAllEdgeIds().forEach((o) => {
|
|
848
828
|
this.renderEdge(o);
|
|
849
829
|
});
|
|
850
830
|
}
|
|
851
831
|
detach() {
|
|
852
832
|
this.canvasWrapper !== null && (this.canvasWrapper.removeChild(this.host), this.canvasWrapper = null);
|
|
853
833
|
}
|
|
854
|
-
attachNode(
|
|
855
|
-
const o = this.graphStore.getNode(
|
|
856
|
-
r.appendChild(o.element), this.container.appendChild(r), this.nodeIdToWrapperElementMap.set(
|
|
834
|
+
attachNode(e) {
|
|
835
|
+
const o = this.graphStore.getNode(e), r = xe();
|
|
836
|
+
r.appendChild(o.element), this.container.appendChild(r), this.nodeIdToWrapperElementMap.set(e, r), this.updateNodePosition(e), this.updateNodePriority(e), r.style.visibility = "visible";
|
|
857
837
|
}
|
|
858
|
-
detachNode(
|
|
859
|
-
const o = this.nodeIdToWrapperElementMap.get(
|
|
860
|
-
o.removeChild(o.firstChild), this.container.removeChild(o), this.nodeIdToWrapperElementMap.delete(
|
|
838
|
+
detachNode(e) {
|
|
839
|
+
const o = this.nodeIdToWrapperElementMap.get(e);
|
|
840
|
+
o.removeChild(o.firstChild), this.container.removeChild(o), this.nodeIdToWrapperElementMap.delete(e);
|
|
861
841
|
}
|
|
862
|
-
attachEdge(
|
|
863
|
-
const o = this.graphStore.getEdge(
|
|
864
|
-
this.edgeIdToElementMap.set(
|
|
842
|
+
attachEdge(e) {
|
|
843
|
+
const o = this.graphStore.getEdge(e).shape.svg;
|
|
844
|
+
this.edgeIdToElementMap.set(e, o), this.container.appendChild(o), this.renderEdge(e), this.updateEdgePriority(e);
|
|
865
845
|
}
|
|
866
|
-
detachEdge(
|
|
867
|
-
const o = this.edgeIdToElementMap.get(
|
|
868
|
-
this.container.removeChild(o), this.edgeIdToElementMap.delete(
|
|
846
|
+
detachEdge(e) {
|
|
847
|
+
const o = this.edgeIdToElementMap.get(e);
|
|
848
|
+
this.container.removeChild(o), this.edgeIdToElementMap.delete(e);
|
|
869
849
|
}
|
|
870
850
|
clear() {
|
|
871
|
-
this.edgeIdToElementMap.forEach((
|
|
851
|
+
this.edgeIdToElementMap.forEach((e, o) => {
|
|
872
852
|
this.detachEdge(o);
|
|
873
|
-
}), this.nodeIdToWrapperElementMap.forEach((
|
|
853
|
+
}), this.nodeIdToWrapperElementMap.forEach((e, o) => {
|
|
874
854
|
this.detachNode(o);
|
|
875
855
|
});
|
|
876
856
|
}
|
|
877
857
|
destroy() {
|
|
878
|
-
this.viewportStore.
|
|
858
|
+
this.viewportStore.onAfterUpdated.unsubscribe(this.applyTransform), this.clear(), this.detach(), this.host.removeChild(this.container);
|
|
879
859
|
}
|
|
880
|
-
|
|
881
|
-
const o = this.nodeIdToWrapperElementMap.get(
|
|
882
|
-
o.style.transform = `translate(${
|
|
860
|
+
updateNodePosition(e) {
|
|
861
|
+
const o = this.nodeIdToWrapperElementMap.get(e), r = this.graphStore.getNode(e), { width: n, height: h } = r.element.getBoundingClientRect(), s = this.viewportStore.getViewportMatrix().scale, d = r.centerFn(n, h), c = r.x - s * d.x, a = r.y - s * d.y;
|
|
862
|
+
o.style.transform = `translate(${c}px, ${a}px)`;
|
|
883
863
|
}
|
|
884
|
-
updateNodePriority(
|
|
885
|
-
const o = this.graphStore.getNode(
|
|
864
|
+
updateNodePriority(e) {
|
|
865
|
+
const o = this.graphStore.getNode(e), r = this.nodeIdToWrapperElementMap.get(e);
|
|
886
866
|
r.style.zIndex = `${o.priority}`;
|
|
887
867
|
}
|
|
888
|
-
updateEdgeShape(
|
|
889
|
-
const o = this.edgeIdToElementMap.get(
|
|
868
|
+
updateEdgeShape(e) {
|
|
869
|
+
const o = this.edgeIdToElementMap.get(e);
|
|
890
870
|
this.container.removeChild(o);
|
|
891
|
-
const r = this.graphStore.getEdge(
|
|
892
|
-
this.edgeIdToElementMap.set(
|
|
871
|
+
const r = this.graphStore.getEdge(e);
|
|
872
|
+
this.edgeIdToElementMap.set(e, r.shape.svg), this.container.appendChild(r.shape.svg);
|
|
893
873
|
}
|
|
894
|
-
renderEdge(
|
|
895
|
-
const o = this.graphStore.getEdge(
|
|
896
|
-
x:
|
|
897
|
-
y:
|
|
874
|
+
renderEdge(e) {
|
|
875
|
+
const o = this.graphStore.getEdge(e), r = this.graphStore.getPort(o.from), n = this.graphStore.getPort(o.to), h = r.element.getBoundingClientRect(), s = n.element.getBoundingClientRect(), d = this.host.getBoundingClientRect(), c = this.viewportStore.getViewportMatrix(), a = {
|
|
876
|
+
x: c.scale * (h.left - d.left) + c.x,
|
|
877
|
+
y: c.scale * (h.top - d.top) + c.y
|
|
898
878
|
}, l = {
|
|
899
|
-
x:
|
|
900
|
-
y:
|
|
879
|
+
x: c.scale * (s.left - d.left) + c.x,
|
|
880
|
+
y: c.scale * (s.top - d.top) + c.y
|
|
901
881
|
}, g = {
|
|
902
882
|
x: a.x,
|
|
903
883
|
y: a.y,
|
|
904
|
-
width: h.width *
|
|
905
|
-
height: h.height *
|
|
884
|
+
width: h.width * c.scale,
|
|
885
|
+
height: h.height * c.scale,
|
|
906
886
|
direction: r.direction,
|
|
907
887
|
portId: o.from,
|
|
908
888
|
nodeId: r.nodeId
|
|
909
|
-
},
|
|
889
|
+
}, f = {
|
|
910
890
|
x: l.x,
|
|
911
891
|
y: l.y,
|
|
912
|
-
width: s.width *
|
|
913
|
-
height: s.height *
|
|
892
|
+
width: s.width * c.scale,
|
|
893
|
+
height: s.height * c.scale,
|
|
914
894
|
direction: n.direction,
|
|
915
895
|
portId: o.to,
|
|
916
896
|
nodeId: n.nodeId
|
|
917
897
|
};
|
|
918
898
|
o.shape.render({
|
|
919
899
|
from: g,
|
|
920
|
-
to:
|
|
900
|
+
to: f
|
|
921
901
|
});
|
|
922
902
|
}
|
|
923
|
-
updateEdgePriority(
|
|
924
|
-
const o = this.graphStore.getEdge(
|
|
903
|
+
updateEdgePriority(e) {
|
|
904
|
+
const o = this.graphStore.getEdge(e);
|
|
925
905
|
o.shape.svg.style.zIndex = `${o.priority}`;
|
|
926
906
|
}
|
|
927
907
|
}
|
|
928
|
-
class
|
|
929
|
-
constructor(
|
|
908
|
+
class Ee {
|
|
909
|
+
constructor(e) {
|
|
930
910
|
i(this, "xFrom", 1 / 0);
|
|
931
911
|
i(this, "yFrom", 1 / 0);
|
|
932
912
|
i(this, "xTo", 1 / 0);
|
|
933
913
|
i(this, "yTo", 1 / 0);
|
|
934
|
-
this.graphStore =
|
|
914
|
+
this.graphStore = e;
|
|
935
915
|
}
|
|
936
|
-
setRenderingBox(
|
|
937
|
-
this.xFrom =
|
|
916
|
+
setRenderingBox(e) {
|
|
917
|
+
this.xFrom = e.x, this.xTo = e.x + e.width, this.yFrom = e.y, this.yTo = e.y + e.height;
|
|
938
918
|
}
|
|
939
|
-
hasNode(
|
|
940
|
-
const o = this.graphStore.getNode(
|
|
919
|
+
hasNode(e) {
|
|
920
|
+
const o = this.graphStore.getNode(e);
|
|
941
921
|
return o.x >= this.xFrom && o.x <= this.xTo && o.y >= this.yFrom && o.y <= this.yTo;
|
|
942
922
|
}
|
|
943
|
-
hasEdge(
|
|
944
|
-
const o = this.graphStore.getEdge(
|
|
945
|
-
return
|
|
923
|
+
hasEdge(e) {
|
|
924
|
+
const o = this.graphStore.getEdge(e), r = this.graphStore.getPort(o.from).nodeId, n = this.graphStore.getPort(o.to).nodeId, h = this.graphStore.getNode(r), s = this.graphStore.getNode(n), d = Math.min(h.x, s.x), c = Math.max(h.x, s.x), a = Math.min(h.y, s.y), l = Math.max(h.y, s.y);
|
|
925
|
+
return d <= this.xTo && c >= this.xFrom && a <= this.yTo && l >= this.yFrom;
|
|
946
926
|
}
|
|
947
927
|
}
|
|
948
|
-
class
|
|
949
|
-
constructor(
|
|
928
|
+
class pe {
|
|
929
|
+
constructor(e, o, r) {
|
|
950
930
|
i(this, "attachedNodes", /* @__PURE__ */ new Set());
|
|
951
931
|
i(this, "attachedEdges", /* @__PURE__ */ new Set());
|
|
952
932
|
i(this, "renderingBox");
|
|
953
|
-
i(this, "updateViewport", (
|
|
954
|
-
this.renderingBox.setRenderingBox(
|
|
933
|
+
i(this, "updateViewport", (e) => {
|
|
934
|
+
this.renderingBox.setRenderingBox(e);
|
|
955
935
|
const o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set();
|
|
956
936
|
this.graphStore.getAllNodeIds().forEach((s) => {
|
|
957
|
-
const
|
|
958
|
-
|
|
937
|
+
const d = this.renderingBox.hasNode(s), c = this.attachedNodes.has(s);
|
|
938
|
+
d && !c ? o.add(s) : !d && c && r.add(s);
|
|
959
939
|
}), this.graphStore.getAllEdgeIds().forEach((s) => {
|
|
960
|
-
const
|
|
961
|
-
|
|
940
|
+
const d = this.renderingBox.hasEdge(s), c = this.attachedEdges.has(s), a = this.graphStore.getEdge(s), l = this.graphStore.getPort(a.from).nodeId, g = this.graphStore.getPort(a.to).nodeId;
|
|
941
|
+
d && (this.renderingBox.hasNode(l) || (o.add(l), r.delete(l)), this.renderingBox.hasNode(g) || (o.add(g), r.delete(g))), d && !c ? n.add(s) : !d && c && h.add(s);
|
|
962
942
|
}), h.forEach((s) => {
|
|
963
943
|
this.handleDetachEdge(s);
|
|
964
944
|
}), r.forEach((s) => {
|
|
@@ -969,42 +949,42 @@ class At {
|
|
|
969
949
|
this.handleAttachEdge(s);
|
|
970
950
|
});
|
|
971
951
|
});
|
|
972
|
-
this.htmlView =
|
|
952
|
+
this.htmlView = e, this.graphStore = o, this.trigger = r, this.renderingBox = new Ee(this.graphStore), this.trigger.subscribe(this.updateViewport);
|
|
973
953
|
}
|
|
974
|
-
attach(
|
|
975
|
-
this.htmlView.attach(
|
|
954
|
+
attach(e) {
|
|
955
|
+
this.htmlView.attach(e);
|
|
976
956
|
}
|
|
977
957
|
detach() {
|
|
978
958
|
this.htmlView.detach();
|
|
979
959
|
}
|
|
980
|
-
attachNode(
|
|
981
|
-
this.renderingBox.hasNode(
|
|
960
|
+
attachNode(e) {
|
|
961
|
+
this.renderingBox.hasNode(e) && this.handleAttachNode(e);
|
|
982
962
|
}
|
|
983
|
-
detachNode(
|
|
984
|
-
this.attachedNodes.has(
|
|
963
|
+
detachNode(e) {
|
|
964
|
+
this.attachedNodes.has(e) && this.handleDetachNode(e);
|
|
985
965
|
}
|
|
986
|
-
attachEdge(
|
|
987
|
-
this.renderingBox.hasEdge(
|
|
966
|
+
attachEdge(e) {
|
|
967
|
+
this.renderingBox.hasEdge(e) && this.attachEdgeEntities(e);
|
|
988
968
|
}
|
|
989
|
-
detachEdge(
|
|
990
|
-
this.attachedEdges.has(
|
|
969
|
+
detachEdge(e) {
|
|
970
|
+
this.attachedEdges.has(e) && this.handleDetachEdge(e);
|
|
991
971
|
}
|
|
992
|
-
|
|
993
|
-
this.attachedNodes.has(
|
|
972
|
+
updateNodePosition(e) {
|
|
973
|
+
this.attachedNodes.has(e) ? this.htmlView.updateNodePosition(e) : this.renderingBox.hasNode(e) && (this.handleAttachNode(e), this.graphStore.getNodeAdjacentEdgeIds(e).forEach((o) => {
|
|
994
974
|
this.attachEdgeEntities(o);
|
|
995
975
|
}));
|
|
996
976
|
}
|
|
997
|
-
updateNodePriority(
|
|
998
|
-
this.attachedNodes.has(
|
|
977
|
+
updateNodePriority(e) {
|
|
978
|
+
this.attachedNodes.has(e) && this.htmlView.updateNodePriority(e);
|
|
999
979
|
}
|
|
1000
|
-
updateEdgeShape(
|
|
1001
|
-
this.attachedEdges.has(
|
|
980
|
+
updateEdgeShape(e) {
|
|
981
|
+
this.attachedEdges.has(e) && this.htmlView.updateEdgeShape(e);
|
|
1002
982
|
}
|
|
1003
|
-
renderEdge(
|
|
1004
|
-
this.attachedEdges.has(
|
|
983
|
+
renderEdge(e) {
|
|
984
|
+
this.attachedEdges.has(e) && this.htmlView.renderEdge(e);
|
|
1005
985
|
}
|
|
1006
|
-
updateEdgePriority(
|
|
1007
|
-
this.attachedEdges.has(
|
|
986
|
+
updateEdgePriority(e) {
|
|
987
|
+
this.attachedEdges.has(e) && this.htmlView.updateEdgePriority(e);
|
|
1008
988
|
}
|
|
1009
989
|
clear() {
|
|
1010
990
|
this.htmlView.clear(), this.attachedNodes.clear(), this.attachedEdges.clear();
|
|
@@ -1012,51 +992,51 @@ class At {
|
|
|
1012
992
|
destroy() {
|
|
1013
993
|
this.clear(), this.htmlView.destroy(), this.trigger.unsubscribe(this.updateViewport);
|
|
1014
994
|
}
|
|
1015
|
-
attachEdgeEntities(
|
|
1016
|
-
const o = this.graphStore.getEdge(
|
|
1017
|
-
this.attachedNodes.has(r) || this.handleAttachNode(r), this.attachedNodes.has(n) || this.handleAttachNode(n), this.handleAttachEdge(
|
|
995
|
+
attachEdgeEntities(e) {
|
|
996
|
+
const o = this.graphStore.getEdge(e), r = this.graphStore.getPort(o.from).nodeId, n = this.graphStore.getPort(o.to).nodeId;
|
|
997
|
+
this.attachedNodes.has(r) || this.handleAttachNode(r), this.attachedNodes.has(n) || this.handleAttachNode(n), this.handleAttachEdge(e);
|
|
1018
998
|
}
|
|
1019
|
-
handleAttachNode(
|
|
1020
|
-
this.attachedNodes.add(
|
|
999
|
+
handleAttachNode(e) {
|
|
1000
|
+
this.attachedNodes.add(e), this.htmlView.attachNode(e);
|
|
1021
1001
|
}
|
|
1022
|
-
handleDetachNode(
|
|
1023
|
-
this.htmlView.detachNode(
|
|
1002
|
+
handleDetachNode(e) {
|
|
1003
|
+
this.htmlView.detachNode(e), this.attachedNodes.delete(e);
|
|
1024
1004
|
}
|
|
1025
|
-
handleAttachEdge(
|
|
1026
|
-
this.attachedEdges.add(
|
|
1005
|
+
handleAttachEdge(e) {
|
|
1006
|
+
this.attachedEdges.add(e), this.htmlView.attachEdge(e);
|
|
1027
1007
|
}
|
|
1028
|
-
handleDetachEdge(
|
|
1029
|
-
this.htmlView.detachEdge(
|
|
1008
|
+
handleDetachEdge(e) {
|
|
1009
|
+
this.htmlView.detachEdge(e), this.attachedEdges.delete(e);
|
|
1030
1010
|
}
|
|
1031
1011
|
}
|
|
1032
|
-
class
|
|
1012
|
+
class te {
|
|
1033
1013
|
constructor() {
|
|
1034
1014
|
i(this, "callbacks", /* @__PURE__ */ new Set());
|
|
1035
1015
|
}
|
|
1036
|
-
subscribe(
|
|
1037
|
-
this.callbacks.add(
|
|
1016
|
+
subscribe(e) {
|
|
1017
|
+
this.callbacks.add(e);
|
|
1038
1018
|
}
|
|
1039
|
-
unsubscribe(
|
|
1040
|
-
this.callbacks.delete(
|
|
1019
|
+
unsubscribe(e) {
|
|
1020
|
+
this.callbacks.delete(e);
|
|
1041
1021
|
}
|
|
1042
|
-
emit(
|
|
1022
|
+
emit(e) {
|
|
1043
1023
|
this.callbacks.forEach((o) => {
|
|
1044
|
-
o(
|
|
1024
|
+
o(e);
|
|
1045
1025
|
});
|
|
1046
1026
|
}
|
|
1047
1027
|
}
|
|
1048
|
-
const
|
|
1049
|
-
const
|
|
1050
|
-
return [
|
|
1028
|
+
const A = () => {
|
|
1029
|
+
const t = new te();
|
|
1030
|
+
return [t, t];
|
|
1051
1031
|
};
|
|
1052
|
-
class
|
|
1053
|
-
constructor(
|
|
1032
|
+
class z {
|
|
1033
|
+
constructor(e) {
|
|
1054
1034
|
i(this, "counter", 0);
|
|
1055
|
-
this.checkExists =
|
|
1035
|
+
this.checkExists = e;
|
|
1056
1036
|
}
|
|
1057
|
-
create(
|
|
1058
|
-
if (
|
|
1059
|
-
return
|
|
1037
|
+
create(e) {
|
|
1038
|
+
if (e !== void 0)
|
|
1039
|
+
return e;
|
|
1060
1040
|
for (; this.checkExists(this.counter); )
|
|
1061
1041
|
this.counter++;
|
|
1062
1042
|
return this.counter;
|
|
@@ -1071,244 +1051,244 @@ class E extends Error {
|
|
|
1071
1051
|
i(this, "name", "HtmlGraphError");
|
|
1072
1052
|
}
|
|
1073
1053
|
}
|
|
1074
|
-
const
|
|
1075
|
-
x:
|
|
1076
|
-
y:
|
|
1077
|
-
}),
|
|
1078
|
-
let
|
|
1079
|
-
return () =>
|
|
1080
|
-
},
|
|
1081
|
-
let o =
|
|
1082
|
-
const n =
|
|
1083
|
-
return
|
|
1054
|
+
const Se = (t, e) => ({
|
|
1055
|
+
x: t / 2,
|
|
1056
|
+
y: e / 2
|
|
1057
|
+
}), Y = (t) => () => t, Z = Y(0), Ne = () => {
|
|
1058
|
+
let t = 0;
|
|
1059
|
+
return () => t++;
|
|
1060
|
+
}, Te = (t, e) => {
|
|
1061
|
+
let o = Z, r = Z;
|
|
1062
|
+
const n = Ne();
|
|
1063
|
+
return t === "incremental" && (o = n), e === "incremental" && (r = n), typeof t == "number" && (o = Y(t)), typeof e == "number" && (r = Y(e)), typeof t == "function" && (o = t), typeof e == "function" && (r = e), {
|
|
1084
1064
|
nodesPriorityFn: o,
|
|
1085
1065
|
edgesPriorityFn: r
|
|
1086
1066
|
};
|
|
1087
|
-
},
|
|
1088
|
-
x:
|
|
1089
|
-
y:
|
|
1090
|
-
}),
|
|
1067
|
+
}, y = (t, e, o) => ({
|
|
1068
|
+
x: e.x * t.x - e.y * t.y + ((1 - e.x) * o.x + e.y * o.y),
|
|
1069
|
+
y: e.y * t.x + e.x * t.y + ((1 - e.x) * o.y - e.y * o.x)
|
|
1070
|
+
}), T = (t, e, o) => ({ x: e * Math.cos(t), y: o * Math.sin(t) }), w = {
|
|
1091
1071
|
x: 0,
|
|
1092
1072
|
y: 0
|
|
1093
|
-
},
|
|
1073
|
+
}, m = (t, e, o, r) => {
|
|
1094
1074
|
const h = [
|
|
1095
1075
|
w,
|
|
1096
1076
|
{ x: o, y: r },
|
|
1097
1077
|
{ x: o, y: -r }
|
|
1098
|
-
].map((a) =>
|
|
1099
|
-
return `${s} ${
|
|
1100
|
-
},
|
|
1078
|
+
].map((a) => y(a, t, w)).map((a) => ({ x: a.x + e.x, y: a.y + e.y })), s = `M ${h[0].x} ${h[0].y}`, d = `L ${h[1].x} ${h[1].y}`, c = `L ${h[2].x} ${h[2].y}`;
|
|
1079
|
+
return `${s} ${d} ${c}`;
|
|
1080
|
+
}, D = (t, e) => {
|
|
1101
1081
|
const o = [];
|
|
1102
|
-
if (
|
|
1103
|
-
const r =
|
|
1082
|
+
if (t.length > 0 && o.push(`M ${t[0].x} ${t[0].y}`), t.length === 2 && o.push(`L ${t[1].x} ${t[1].y}`), t.length > 2) {
|
|
1083
|
+
const r = t.length - 1;
|
|
1104
1084
|
let n = 0, h = 0, s = 0;
|
|
1105
|
-
|
|
1085
|
+
t.forEach((d, c) => {
|
|
1106
1086
|
let a = 0, l = 0, g = 0;
|
|
1107
|
-
const
|
|
1108
|
-
if (
|
|
1109
|
-
const
|
|
1110
|
-
n =
|
|
1087
|
+
const f = c > 0, x = c < r, v = f && x;
|
|
1088
|
+
if (f && (a = -n, l = -h, g = s), x) {
|
|
1089
|
+
const L = t[c + 1];
|
|
1090
|
+
n = L.x - d.x, h = L.y - d.y, s = Math.sqrt(n * n + h * h);
|
|
1111
1091
|
}
|
|
1112
|
-
const
|
|
1113
|
-
|
|
1114
|
-
`C ${
|
|
1092
|
+
const p = s !== 0 ? Math.min((v ? e : 0) / s, c < r - 1 ? 0.5 : 1) : 0, N = v ? { x: d.x + n * p, y: d.y + h * p } : d, M = g !== 0 ? Math.min((v ? e : 0) / g, c > 1 ? 0.5 : 1) : 0, V = v ? { x: d.x + a * M, y: d.y + l * M } : d;
|
|
1093
|
+
c > 0 && o.push(`L ${V.x} ${V.y}`), v && o.push(
|
|
1094
|
+
`C ${d.x} ${d.y} ${d.x} ${d.y} ${N.x} ${N.y}`
|
|
1115
1095
|
);
|
|
1116
1096
|
});
|
|
1117
1097
|
}
|
|
1118
1098
|
return o.join(" ");
|
|
1119
1099
|
}, I = () => {
|
|
1120
|
-
const
|
|
1121
|
-
return
|
|
1122
|
-
},
|
|
1123
|
-
const
|
|
1124
|
-
return
|
|
1125
|
-
},
|
|
1100
|
+
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1101
|
+
return t.style.pointerEvents = "none", t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.overflow = "visible", t;
|
|
1102
|
+
}, W = () => {
|
|
1103
|
+
const t = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
1104
|
+
return t.style.transformOrigin = "50% 50%", t;
|
|
1105
|
+
}, F = (t, e) => {
|
|
1126
1106
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1127
|
-
return o.setAttribute("stroke",
|
|
1128
|
-
},
|
|
1129
|
-
const
|
|
1130
|
-
return
|
|
1131
|
-
},
|
|
1107
|
+
return o.setAttribute("stroke", t), o.setAttribute("stroke-width", `${e}`), o.setAttribute("fill", "none"), o;
|
|
1108
|
+
}, P = (t) => {
|
|
1109
|
+
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1110
|
+
return e.setAttribute("fill", t), e;
|
|
1111
|
+
}, B = (t, e) => {
|
|
1132
1112
|
const o = {
|
|
1133
|
-
x: e.x + e.width / 2,
|
|
1134
|
-
y: e.y + e.height / 2
|
|
1135
|
-
}, r = {
|
|
1136
1113
|
x: t.x + t.width / 2,
|
|
1137
1114
|
y: t.y + t.height / 2
|
|
1138
|
-
},
|
|
1115
|
+
}, r = {
|
|
1116
|
+
x: e.x + e.width / 2,
|
|
1117
|
+
y: e.y + e.height / 2
|
|
1118
|
+
}, n = Math.min(o.x, r.x), h = Math.min(o.y, r.y), s = Math.abs(r.x - o.x), d = Math.abs(r.y - o.y), c = o.x <= r.x ? 1 : -1, a = o.y <= r.y ? 1 : -1;
|
|
1139
1119
|
return {
|
|
1140
1120
|
x: n,
|
|
1141
1121
|
y: h,
|
|
1142
1122
|
width: s,
|
|
1143
|
-
height:
|
|
1144
|
-
flipX:
|
|
1123
|
+
height: d,
|
|
1124
|
+
flipX: c,
|
|
1145
1125
|
flipY: a
|
|
1146
1126
|
};
|
|
1147
|
-
},
|
|
1148
|
-
const
|
|
1149
|
-
{ x:
|
|
1150
|
-
|
|
1127
|
+
}, me = (t) => {
|
|
1128
|
+
const e = y(
|
|
1129
|
+
{ x: t.arrowLength, y: w.y },
|
|
1130
|
+
t.fromVect,
|
|
1151
1131
|
w
|
|
1152
|
-
), o =
|
|
1153
|
-
{ x:
|
|
1154
|
-
|
|
1155
|
-
|
|
1132
|
+
), o = y(
|
|
1133
|
+
{ x: t.to.x - t.arrowLength, y: t.to.y },
|
|
1134
|
+
t.toVect,
|
|
1135
|
+
t.to
|
|
1156
1136
|
), r = {
|
|
1157
|
-
x:
|
|
1158
|
-
y:
|
|
1137
|
+
x: e.x + t.fromVect.x * t.curvature,
|
|
1138
|
+
y: e.y + t.fromVect.y * t.curvature
|
|
1159
1139
|
}, n = {
|
|
1160
|
-
x: o.x -
|
|
1161
|
-
y: o.y -
|
|
1162
|
-
}, h = `M ${
|
|
1163
|
-
return `${s}${h}${
|
|
1164
|
-
},
|
|
1165
|
-
const
|
|
1166
|
-
{ x:
|
|
1167
|
-
|
|
1140
|
+
x: o.x - t.toVect.x * t.curvature,
|
|
1141
|
+
y: o.y - t.toVect.y * t.curvature
|
|
1142
|
+
}, h = `M ${e.x} ${e.y} C ${r.x} ${r.y}, ${n.x} ${n.y}, ${o.x} ${o.y}`, s = t.hasSourceArrow ? "" : `M ${w.x} ${w.y} L ${e.x} ${e.y} `, d = t.hasTargetArrow ? "" : ` M ${o.x} ${o.y} L ${t.to.x} ${t.to.y}`;
|
|
1143
|
+
return `${s}${h}${d}`;
|
|
1144
|
+
}, Pe = (t) => {
|
|
1145
|
+
const e = t.hasSourceArrow ? y(
|
|
1146
|
+
{ x: t.arrowLength, y: w.y },
|
|
1147
|
+
t.fromVect,
|
|
1168
1148
|
w
|
|
1169
|
-
) : w, o =
|
|
1170
|
-
{ x:
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
) :
|
|
1149
|
+
) : w, o = t.hasTargetArrow ? y(
|
|
1150
|
+
{ x: t.to.x - t.arrowLength, y: t.to.y },
|
|
1151
|
+
t.toVect,
|
|
1152
|
+
t.to
|
|
1153
|
+
) : t.to, r = t.arrowLength, n = Math.cos(t.detourDirection) * t.detourDistance, h = Math.sin(t.detourDirection) * t.detourDistance, s = n * t.flipX, d = h * t.flipY, c = y(
|
|
1174
1154
|
{ x: r, y: w.y },
|
|
1175
|
-
|
|
1155
|
+
t.fromVect,
|
|
1176
1156
|
w
|
|
1177
1157
|
), a = {
|
|
1178
|
-
x:
|
|
1179
|
-
y:
|
|
1180
|
-
}, l =
|
|
1181
|
-
{ x:
|
|
1182
|
-
|
|
1183
|
-
|
|
1158
|
+
x: c.x + s,
|
|
1159
|
+
y: c.y + d
|
|
1160
|
+
}, l = y(
|
|
1161
|
+
{ x: t.to.x - r, y: t.to.y },
|
|
1162
|
+
t.toVect,
|
|
1163
|
+
t.to
|
|
1184
1164
|
), g = {
|
|
1185
1165
|
x: l.x + s,
|
|
1186
|
-
y: l.y +
|
|
1187
|
-
},
|
|
1188
|
-
x:
|
|
1189
|
-
y:
|
|
1166
|
+
y: l.y + d
|
|
1167
|
+
}, f = { x: (a.x + g.x) / 2, y: (a.y + g.y) / 2 }, x = {
|
|
1168
|
+
x: c.x + t.curvature * t.fromVect.x,
|
|
1169
|
+
y: c.y + t.curvature * t.fromVect.y
|
|
1190
1170
|
}, v = {
|
|
1191
|
-
x: l.x -
|
|
1192
|
-
y: l.y -
|
|
1193
|
-
}, A = {
|
|
1194
|
-
x: d.x + s,
|
|
1195
|
-
y: d.y + c
|
|
1171
|
+
x: l.x - t.curvature * t.toVect.x,
|
|
1172
|
+
y: l.y - t.curvature * t.toVect.y
|
|
1196
1173
|
}, S = {
|
|
1174
|
+
x: c.x + s,
|
|
1175
|
+
y: c.y + d
|
|
1176
|
+
}, p = {
|
|
1197
1177
|
x: l.x + s,
|
|
1198
|
-
y: l.y +
|
|
1178
|
+
y: l.y + d
|
|
1199
1179
|
};
|
|
1200
1180
|
return [
|
|
1201
|
-
`M ${
|
|
1202
|
-
`L ${
|
|
1203
|
-
`C ${x.x} ${x.y} ${
|
|
1204
|
-
`C ${
|
|
1181
|
+
`M ${e.x} ${e.y}`,
|
|
1182
|
+
`L ${c.x} ${c.y}`,
|
|
1183
|
+
`C ${x.x} ${x.y} ${S.x} ${S.y} ${f.x} ${f.y}`,
|
|
1184
|
+
`C ${p.x} ${p.y} ${v.x} ${v.y} ${l.x} ${l.y}`,
|
|
1205
1185
|
`L ${o.x} ${o.y}`
|
|
1206
1186
|
].join(" ");
|
|
1207
|
-
},
|
|
1208
|
-
const
|
|
1209
|
-
{ x:
|
|
1210
|
-
|
|
1187
|
+
}, be = (t) => {
|
|
1188
|
+
const e = t.hasSourceArrow ? y(
|
|
1189
|
+
{ x: t.arrowLength, y: w.y },
|
|
1190
|
+
t.fromVect,
|
|
1211
1191
|
w
|
|
1212
|
-
) : w, o =
|
|
1213
|
-
{ x:
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
) :
|
|
1217
|
-
{ x:
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
),
|
|
1221
|
-
x:
|
|
1192
|
+
) : w, o = t.hasTargetArrow ? y(
|
|
1193
|
+
{ x: t.to.x - t.arrowLength, y: t.to.y },
|
|
1194
|
+
t.toVect,
|
|
1195
|
+
t.to
|
|
1196
|
+
) : t.to, r = t.arrowLength + t.arrowOffset, n = r - t.roundness, h = y({ x: n, y: w.y }, t.fromVect, w), s = y(
|
|
1197
|
+
{ x: t.to.x - n, y: t.to.y },
|
|
1198
|
+
t.toVect,
|
|
1199
|
+
t.to
|
|
1200
|
+
), d = Math.max((h.x + s.x) / 2, r), c = t.to.y / 2, a = { x: t.flipX > 0 ? d : -r, y: h.y }, l = { x: a.x, y: c }, g = {
|
|
1201
|
+
x: t.flipX > 0 ? t.to.x - d : t.to.x + r,
|
|
1222
1202
|
y: s.y
|
|
1223
|
-
},
|
|
1224
|
-
return
|
|
1225
|
-
[
|
|
1226
|
-
|
|
1203
|
+
}, f = { x: g.x, y: c };
|
|
1204
|
+
return D(
|
|
1205
|
+
[e, h, a, l, f, g, s, o],
|
|
1206
|
+
t.roundness
|
|
1227
1207
|
);
|
|
1228
|
-
},
|
|
1229
|
-
const
|
|
1230
|
-
{ x:
|
|
1231
|
-
|
|
1208
|
+
}, X = (t) => {
|
|
1209
|
+
const e = t.hasSourceArrow ? y(
|
|
1210
|
+
{ x: t.arrowLength, y: w.y },
|
|
1211
|
+
t.fromVect,
|
|
1232
1212
|
w
|
|
1233
|
-
) : w, o =
|
|
1234
|
-
{ x:
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
) :
|
|
1213
|
+
) : w, o = t.hasTargetArrow ? y(
|
|
1214
|
+
{ x: t.to.x - t.arrowLength, y: t.to.y },
|
|
1215
|
+
t.toVect,
|
|
1216
|
+
t.to
|
|
1217
|
+
) : t.to, r = t.arrowLength + t.arrowOffset, n = y(
|
|
1238
1218
|
{ x: r, y: w.y },
|
|
1239
|
-
|
|
1219
|
+
t.fromVect,
|
|
1240
1220
|
w
|
|
1241
|
-
), h = Math.cos(
|
|
1242
|
-
{ x:
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
), g = { x: l.x +
|
|
1246
|
-
return
|
|
1247
|
-
[
|
|
1248
|
-
|
|
1221
|
+
), h = Math.cos(t.detourDirection) * t.detourDistance, s = Math.sin(t.detourDirection) * t.detourDistance, d = h * t.flipX, c = s * t.flipY, a = { x: n.x + d, y: n.y + c }, l = y(
|
|
1222
|
+
{ x: t.to.x - r, y: t.to.y },
|
|
1223
|
+
t.toVect,
|
|
1224
|
+
t.to
|
|
1225
|
+
), g = { x: l.x + d, y: l.y + c };
|
|
1226
|
+
return D(
|
|
1227
|
+
[e, n, a, g, l, o],
|
|
1228
|
+
t.roundness
|
|
1249
1229
|
);
|
|
1250
|
-
},
|
|
1251
|
-
const
|
|
1252
|
-
{ x:
|
|
1253
|
-
|
|
1230
|
+
}, Me = (t) => {
|
|
1231
|
+
const e = t.hasSourceArrow ? y(
|
|
1232
|
+
{ x: t.arrowLength, y: w.y },
|
|
1233
|
+
t.fromVect,
|
|
1254
1234
|
w
|
|
1255
|
-
) : w, o =
|
|
1256
|
-
{ x:
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
) :
|
|
1260
|
-
{ x:
|
|
1261
|
-
|
|
1262
|
-
|
|
1235
|
+
) : w, o = t.hasTargetArrow ? y(
|
|
1236
|
+
{ x: t.to.x - t.arrowLength, y: t.to.y },
|
|
1237
|
+
t.toVect,
|
|
1238
|
+
t.to
|
|
1239
|
+
) : t.to, r = t.arrowLength + t.arrowOffset, n = y({ x: r, y: w.y }, t.fromVect, w), h = y(
|
|
1240
|
+
{ x: t.to.x - r, y: t.to.y },
|
|
1241
|
+
t.toVect,
|
|
1242
|
+
t.to
|
|
1263
1243
|
);
|
|
1264
|
-
return
|
|
1265
|
-
},
|
|
1266
|
-
const
|
|
1267
|
-
{ x:
|
|
1268
|
-
|
|
1244
|
+
return D([e, n, h, o], t.roundness);
|
|
1245
|
+
}, Ve = (t) => {
|
|
1246
|
+
const e = t.hasSourceArrow ? y(
|
|
1247
|
+
{ x: t.arrowLength, y: w.y },
|
|
1248
|
+
t.fromVect,
|
|
1269
1249
|
w
|
|
1270
|
-
) : w, o =
|
|
1271
|
-
{ x:
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
) :
|
|
1275
|
-
{ x:
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
),
|
|
1250
|
+
) : w, o = t.hasTargetArrow ? y(
|
|
1251
|
+
{ x: t.to.x - t.arrowLength, y: t.to.y },
|
|
1252
|
+
t.toVect,
|
|
1253
|
+
t.to
|
|
1254
|
+
) : t.to, r = t.arrowLength + t.arrowOffset, n = r - t.roundness, h = y({ x: n, y: w.y }, t.fromVect, w), s = y(
|
|
1255
|
+
{ x: t.to.x - n, y: t.to.y },
|
|
1256
|
+
t.toVect,
|
|
1257
|
+
t.to
|
|
1258
|
+
), d = Math.max((h.y + s.y) / 2, r), c = t.to.x / 2, a = { x: h.x, y: t.flipY > 0 ? d : -r }, l = { x: c, y: a.y }, g = {
|
|
1279
1259
|
x: s.x,
|
|
1280
|
-
y:
|
|
1281
|
-
},
|
|
1282
|
-
return
|
|
1283
|
-
[
|
|
1284
|
-
|
|
1260
|
+
y: t.flipY > 0 ? t.to.y - d : t.to.y + r
|
|
1261
|
+
}, f = { x: c, y: g.y };
|
|
1262
|
+
return D(
|
|
1263
|
+
[e, h, a, l, f, g, s, o],
|
|
1264
|
+
t.roundness
|
|
1285
1265
|
);
|
|
1286
|
-
}, H = (
|
|
1287
|
-
const
|
|
1288
|
-
{ x:
|
|
1266
|
+
}, H = (t) => {
|
|
1267
|
+
const e = t.arrowOffset, o = t.side, r = t.arrowLength + e, n = r + 2 * o, s = [
|
|
1268
|
+
{ x: t.arrowLength, y: w.y },
|
|
1289
1269
|
{ x: r, y: w.y },
|
|
1290
|
-
{ x: r, y:
|
|
1291
|
-
{ x: n, y:
|
|
1292
|
-
{ x: n, y: -
|
|
1293
|
-
{ x: r, y: -
|
|
1270
|
+
{ x: r, y: t.side },
|
|
1271
|
+
{ x: n, y: t.side },
|
|
1272
|
+
{ x: n, y: -t.side },
|
|
1273
|
+
{ x: r, y: -t.side },
|
|
1294
1274
|
{ x: r, y: w.y },
|
|
1295
|
-
{ x:
|
|
1275
|
+
{ x: t.arrowLength, y: w.y }
|
|
1296
1276
|
].map(
|
|
1297
|
-
(
|
|
1298
|
-
),
|
|
1299
|
-
return `${
|
|
1300
|
-
},
|
|
1301
|
-
const
|
|
1302
|
-
{ x:
|
|
1277
|
+
(c) => y(c, t.fromVect, w)
|
|
1278
|
+
), d = `M ${w.x} ${w.y} L ${s[0].x} ${s[0].y} `;
|
|
1279
|
+
return `${t.hasSourceArrow || t.hasTargetArrow ? "" : d}${D(s, t.roundness)}`;
|
|
1280
|
+
}, Le = (t) => {
|
|
1281
|
+
const e = t.smallRadius, o = t.radius, r = Math.sqrt(e * e + o * o), n = e + o, h = t.arrowLength + r * (1 - o / n), s = e * o / n, c = [
|
|
1282
|
+
{ x: t.arrowLength, y: w.y },
|
|
1303
1283
|
{ x: h, y: s },
|
|
1304
1284
|
{ x: h, y: -s }
|
|
1305
|
-
].map((g) =>
|
|
1306
|
-
`M ${
|
|
1307
|
-
`A ${
|
|
1308
|
-
`A ${o} ${o} 0 1 0 ${
|
|
1309
|
-
`A ${
|
|
1310
|
-
].join(" "), l = `M 0 0 L ${
|
|
1311
|
-
return `${
|
|
1285
|
+
].map((g) => y(g, t.fromVect, w)), a = [
|
|
1286
|
+
`M ${c[0].x} ${c[0].y}`,
|
|
1287
|
+
`A ${e} ${e} 0 0 1 ${c[1].x} ${c[1].y}`,
|
|
1288
|
+
`A ${o} ${o} 0 1 0 ${c[2].x} ${c[2].y}`,
|
|
1289
|
+
`A ${e} ${e} 0 0 1 ${c[0].x} ${c[0].y}`
|
|
1290
|
+
].join(" "), l = `M 0 0 L ${c[0].x} ${c[0].y} `;
|
|
1291
|
+
return `${t.hasSourceArrow || t.hasTargetArrow ? "" : l}${a}`;
|
|
1312
1292
|
}, u = Object.freeze({
|
|
1313
1293
|
color: "#777777",
|
|
1314
1294
|
width: 1,
|
|
@@ -1326,10 +1306,10 @@ const pt = (e, t) => ({
|
|
|
1326
1306
|
smallCycleRadius: 15,
|
|
1327
1307
|
curvature: 90
|
|
1328
1308
|
});
|
|
1329
|
-
class
|
|
1330
|
-
constructor(
|
|
1309
|
+
class De {
|
|
1310
|
+
constructor(e) {
|
|
1331
1311
|
i(this, "svg", I());
|
|
1332
|
-
i(this, "group",
|
|
1312
|
+
i(this, "group", W());
|
|
1333
1313
|
i(this, "line");
|
|
1334
1314
|
i(this, "sourceArrow", null);
|
|
1335
1315
|
i(this, "targetArrow", null);
|
|
@@ -1342,55 +1322,55 @@ class Ct {
|
|
|
1342
1322
|
i(this, "detourDistance");
|
|
1343
1323
|
i(this, "hasSourceArrow");
|
|
1344
1324
|
i(this, "hasTargetArrow");
|
|
1345
|
-
this.arrowLength = (
|
|
1346
|
-
const o = (
|
|
1347
|
-
this.svg.appendChild(this.group), this.line =
|
|
1348
|
-
}
|
|
1349
|
-
render(
|
|
1350
|
-
const { x: o, y: r, width: n, height: h, flipX: s, flipY:
|
|
1351
|
-
|
|
1352
|
-
|
|
1325
|
+
this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? u.arrowLength, this.arrowWidth = (e == null ? void 0 : e.arrowWidth) ?? u.arrowWidth, this.curvature = (e == null ? void 0 : e.curvature) ?? u.curvature, this.portCycleRadius = (e == null ? void 0 : e.cycleRadius) ?? u.cycleRadius, this.portCycleSmallRadius = (e == null ? void 0 : e.smallCycleRadius) ?? u.smallCycleRadius, this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? u.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? u.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? u.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? u.hasTargetArrow;
|
|
1326
|
+
const o = (e == null ? void 0 : e.color) ?? u.color, r = (e == null ? void 0 : e.width) ?? u.width;
|
|
1327
|
+
this.svg.appendChild(this.group), this.line = F(o, r), this.group.appendChild(this.line), this.hasSourceArrow && (this.sourceArrow = P(o), this.group.appendChild(this.sourceArrow)), this.hasTargetArrow && (this.targetArrow = P(o), this.group.appendChild(this.targetArrow));
|
|
1328
|
+
}
|
|
1329
|
+
render(e) {
|
|
1330
|
+
const { x: o, y: r, width: n, height: h, flipX: s, flipY: d } = B(
|
|
1331
|
+
e.from,
|
|
1332
|
+
e.to
|
|
1353
1333
|
);
|
|
1354
|
-
this.svg.style.transform = `translate(${o}px, ${r}px)`, this.svg.style.width = `${n}px`, this.svg.style.height = `${h}px`, this.group.style.transform = `scale(${s}, ${
|
|
1355
|
-
const
|
|
1356
|
-
|
|
1334
|
+
this.svg.style.transform = `translate(${o}px, ${r}px)`, this.svg.style.width = `${n}px`, this.svg.style.height = `${h}px`, this.group.style.transform = `scale(${s}, ${d})`;
|
|
1335
|
+
const c = T(
|
|
1336
|
+
e.from.direction,
|
|
1357
1337
|
s,
|
|
1358
|
-
|
|
1359
|
-
), a =
|
|
1338
|
+
d
|
|
1339
|
+
), a = T(e.to.direction, s, d), l = {
|
|
1360
1340
|
x: n,
|
|
1361
1341
|
y: h
|
|
1362
1342
|
};
|
|
1363
|
-
let g,
|
|
1364
|
-
if (
|
|
1365
|
-
fromVect:
|
|
1343
|
+
let g, f = a, x = -this.arrowLength;
|
|
1344
|
+
if (e.from.portId === e.to.portId ? (g = Le({
|
|
1345
|
+
fromVect: c,
|
|
1366
1346
|
radius: this.portCycleRadius,
|
|
1367
1347
|
smallRadius: this.portCycleSmallRadius,
|
|
1368
1348
|
arrowLength: this.arrowLength,
|
|
1369
1349
|
hasSourceArrow: this.hasSourceArrow,
|
|
1370
1350
|
hasTargetArrow: this.hasTargetArrow
|
|
1371
|
-
}),
|
|
1351
|
+
}), f = c, x = this.arrowLength) : e.from.nodeId === e.to.nodeId ? g = Pe({
|
|
1372
1352
|
to: l,
|
|
1373
|
-
fromVect:
|
|
1353
|
+
fromVect: c,
|
|
1374
1354
|
toVect: a,
|
|
1375
1355
|
flipX: s,
|
|
1376
|
-
flipY:
|
|
1356
|
+
flipY: d,
|
|
1377
1357
|
arrowLength: this.arrowLength,
|
|
1378
1358
|
detourDirection: this.detourDirection,
|
|
1379
1359
|
detourDistance: this.detourDistance,
|
|
1380
1360
|
curvature: this.curvature,
|
|
1381
1361
|
hasSourceArrow: this.hasSourceArrow,
|
|
1382
1362
|
hasTargetArrow: this.hasTargetArrow
|
|
1383
|
-
}) : g =
|
|
1363
|
+
}) : g = me({
|
|
1384
1364
|
to: l,
|
|
1385
|
-
fromVect:
|
|
1365
|
+
fromVect: c,
|
|
1386
1366
|
toVect: a,
|
|
1387
1367
|
arrowLength: this.arrowLength,
|
|
1388
1368
|
curvature: this.curvature,
|
|
1389
1369
|
hasSourceArrow: this.hasSourceArrow,
|
|
1390
1370
|
hasTargetArrow: this.hasTargetArrow
|
|
1391
1371
|
}), this.line.setAttribute("d", g), this.sourceArrow) {
|
|
1392
|
-
const v =
|
|
1393
|
-
|
|
1372
|
+
const v = m(
|
|
1373
|
+
c,
|
|
1394
1374
|
w,
|
|
1395
1375
|
this.arrowLength,
|
|
1396
1376
|
this.arrowWidth
|
|
@@ -1398,8 +1378,8 @@ class Ct {
|
|
|
1398
1378
|
this.sourceArrow.setAttribute("d", v);
|
|
1399
1379
|
}
|
|
1400
1380
|
if (this.targetArrow) {
|
|
1401
|
-
const v =
|
|
1402
|
-
|
|
1381
|
+
const v = m(
|
|
1382
|
+
f,
|
|
1403
1383
|
l,
|
|
1404
1384
|
x,
|
|
1405
1385
|
this.arrowWidth
|
|
@@ -1408,10 +1388,10 @@ class Ct {
|
|
|
1408
1388
|
}
|
|
1409
1389
|
}
|
|
1410
1390
|
}
|
|
1411
|
-
class
|
|
1412
|
-
constructor(
|
|
1391
|
+
class Ce {
|
|
1392
|
+
constructor(e) {
|
|
1413
1393
|
i(this, "svg", I());
|
|
1414
|
-
i(this, "group",
|
|
1394
|
+
i(this, "group", W());
|
|
1415
1395
|
i(this, "line");
|
|
1416
1396
|
i(this, "sourceArrow", null);
|
|
1417
1397
|
i(this, "targetArrow", null);
|
|
@@ -1424,45 +1404,45 @@ class $t {
|
|
|
1424
1404
|
i(this, "detourDistance");
|
|
1425
1405
|
i(this, "hasSourceArrow");
|
|
1426
1406
|
i(this, "hasTargetArrow");
|
|
1427
|
-
this.arrowLength = (
|
|
1428
|
-
const o = (
|
|
1407
|
+
this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? u.arrowLength, this.arrowWidth = (e == null ? void 0 : e.arrowWidth) ?? u.arrowWidth, this.arrowOffset = (e == null ? void 0 : e.arrowOffset) ?? u.arrowOffset, this.cycleSquareSide = (e == null ? void 0 : e.cycleSquareSide) ?? u.cycleSquareSide;
|
|
1408
|
+
const o = (e == null ? void 0 : e.roundness) ?? u.roundness;
|
|
1429
1409
|
this.roundness = Math.min(
|
|
1430
1410
|
o,
|
|
1431
1411
|
this.arrowOffset,
|
|
1432
1412
|
this.cycleSquareSide / 2
|
|
1433
|
-
), this.detourDirection = (
|
|
1434
|
-
const r = (
|
|
1435
|
-
this.svg.appendChild(this.group), this.line =
|
|
1436
|
-
}
|
|
1437
|
-
render(
|
|
1438
|
-
const { x: o, y: r, width: n, height: h, flipX: s, flipY:
|
|
1439
|
-
|
|
1440
|
-
|
|
1413
|
+
), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? u.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? u.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? u.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? u.hasTargetArrow;
|
|
1414
|
+
const r = (e == null ? void 0 : e.color) ?? u.color, n = (e == null ? void 0 : e.width) ?? u.width;
|
|
1415
|
+
this.svg.appendChild(this.group), this.line = F(r, n), this.group.appendChild(this.line), this.hasSourceArrow && (this.sourceArrow = P(r), this.group.appendChild(this.sourceArrow)), this.hasTargetArrow && (this.targetArrow = P(r), this.group.appendChild(this.targetArrow));
|
|
1416
|
+
}
|
|
1417
|
+
render(e) {
|
|
1418
|
+
const { x: o, y: r, width: n, height: h, flipX: s, flipY: d } = B(
|
|
1419
|
+
e.from,
|
|
1420
|
+
e.to
|
|
1441
1421
|
);
|
|
1442
|
-
this.svg.style.transform = `translate(${o}px, ${r}px)`, this.svg.style.width = `${n}px`, this.svg.style.height = `${h}px`, this.group.style.transform = `scale(${s}, ${
|
|
1443
|
-
const
|
|
1444
|
-
|
|
1422
|
+
this.svg.style.transform = `translate(${o}px, ${r}px)`, this.svg.style.width = `${n}px`, this.svg.style.height = `${h}px`, this.group.style.transform = `scale(${s}, ${d})`;
|
|
1423
|
+
const c = T(
|
|
1424
|
+
e.from.direction,
|
|
1445
1425
|
s,
|
|
1446
|
-
|
|
1447
|
-
), a =
|
|
1426
|
+
d
|
|
1427
|
+
), a = T(e.to.direction, s, d), l = {
|
|
1448
1428
|
x: n,
|
|
1449
1429
|
y: h
|
|
1450
1430
|
};
|
|
1451
|
-
let g,
|
|
1452
|
-
if (
|
|
1453
|
-
fromVect:
|
|
1431
|
+
let g, f = a, x = -this.arrowLength;
|
|
1432
|
+
if (e.from.portId === e.to.portId ? (g = H({
|
|
1433
|
+
fromVect: c,
|
|
1454
1434
|
arrowLength: this.arrowLength,
|
|
1455
1435
|
side: this.cycleSquareSide,
|
|
1456
1436
|
arrowOffset: this.arrowOffset,
|
|
1457
1437
|
roundness: this.roundness,
|
|
1458
1438
|
hasSourceArrow: this.hasSourceArrow,
|
|
1459
1439
|
hasTargetArrow: this.hasTargetArrow
|
|
1460
|
-
}),
|
|
1440
|
+
}), f = c, x = this.arrowLength) : e.from.nodeId === e.to.nodeId ? g = X({
|
|
1461
1441
|
to: l,
|
|
1462
|
-
fromVect:
|
|
1442
|
+
fromVect: c,
|
|
1463
1443
|
toVect: a,
|
|
1464
1444
|
flipX: s,
|
|
1465
|
-
flipY:
|
|
1445
|
+
flipY: d,
|
|
1466
1446
|
arrowLength: this.arrowLength,
|
|
1467
1447
|
arrowOffset: this.arrowOffset,
|
|
1468
1448
|
roundness: this.roundness,
|
|
@@ -1470,9 +1450,9 @@ class $t {
|
|
|
1470
1450
|
detourDistance: this.detourDistance,
|
|
1471
1451
|
hasSourceArrow: this.hasSourceArrow,
|
|
1472
1452
|
hasTargetArrow: this.hasTargetArrow
|
|
1473
|
-
}) : g =
|
|
1453
|
+
}) : g = be({
|
|
1474
1454
|
to: l,
|
|
1475
|
-
fromVect:
|
|
1455
|
+
fromVect: c,
|
|
1476
1456
|
toVect: a,
|
|
1477
1457
|
flipX: s,
|
|
1478
1458
|
arrowLength: this.arrowLength,
|
|
@@ -1481,8 +1461,8 @@ class $t {
|
|
|
1481
1461
|
hasSourceArrow: this.hasSourceArrow,
|
|
1482
1462
|
hasTargetArrow: this.hasTargetArrow
|
|
1483
1463
|
}), this.line.setAttribute("d", g), this.sourceArrow) {
|
|
1484
|
-
const v =
|
|
1485
|
-
|
|
1464
|
+
const v = m(
|
|
1465
|
+
c,
|
|
1486
1466
|
w,
|
|
1487
1467
|
this.arrowLength,
|
|
1488
1468
|
this.arrowWidth
|
|
@@ -1490,8 +1470,8 @@ class $t {
|
|
|
1490
1470
|
this.sourceArrow.setAttribute("d", v);
|
|
1491
1471
|
}
|
|
1492
1472
|
if (this.targetArrow) {
|
|
1493
|
-
const v =
|
|
1494
|
-
|
|
1473
|
+
const v = m(
|
|
1474
|
+
f,
|
|
1495
1475
|
l,
|
|
1496
1476
|
x,
|
|
1497
1477
|
this.arrowWidth
|
|
@@ -1500,10 +1480,10 @@ class $t {
|
|
|
1500
1480
|
}
|
|
1501
1481
|
}
|
|
1502
1482
|
}
|
|
1503
|
-
class
|
|
1504
|
-
constructor(
|
|
1483
|
+
class Ue {
|
|
1484
|
+
constructor(e) {
|
|
1505
1485
|
i(this, "svg", I());
|
|
1506
|
-
i(this, "group",
|
|
1486
|
+
i(this, "group", W());
|
|
1507
1487
|
i(this, "line");
|
|
1508
1488
|
i(this, "sourceArrow", null);
|
|
1509
1489
|
i(this, "targetArrow", null);
|
|
@@ -1516,45 +1496,45 @@ class Wt {
|
|
|
1516
1496
|
i(this, "detourDistance");
|
|
1517
1497
|
i(this, "hasSourceArrow");
|
|
1518
1498
|
i(this, "hasTargetArrow");
|
|
1519
|
-
this.arrowLength = (
|
|
1520
|
-
const o = (
|
|
1499
|
+
this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? u.arrowLength, this.arrowWidth = (e == null ? void 0 : e.arrowWidth) ?? u.arrowWidth, this.arrowOffset = (e == null ? void 0 : e.arrowOffset) ?? u.arrowOffset, this.cycleSquareSide = (e == null ? void 0 : e.cycleSquareSide) ?? u.cycleSquareSide;
|
|
1500
|
+
const o = (e == null ? void 0 : e.roundness) ?? u.roundness;
|
|
1521
1501
|
this.roundness = Math.min(
|
|
1522
1502
|
o,
|
|
1523
1503
|
this.arrowOffset,
|
|
1524
1504
|
this.cycleSquareSide / 2
|
|
1525
|
-
), this.detourDirection = (
|
|
1526
|
-
const r = (
|
|
1527
|
-
this.svg.appendChild(this.group), this.line =
|
|
1528
|
-
}
|
|
1529
|
-
render(
|
|
1530
|
-
const { x: o, y: r, width: n, height: h, flipX: s, flipY:
|
|
1531
|
-
|
|
1532
|
-
|
|
1505
|
+
), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? u.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? u.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? u.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? u.hasTargetArrow;
|
|
1506
|
+
const r = (e == null ? void 0 : e.color) ?? u.color, n = (e == null ? void 0 : e.width) ?? u.width;
|
|
1507
|
+
this.svg.appendChild(this.group), this.line = F(r, n), this.group.appendChild(this.line), this.hasSourceArrow && (this.sourceArrow = P(r), this.group.appendChild(this.sourceArrow)), this.hasTargetArrow && (this.targetArrow = P(r), this.group.appendChild(this.targetArrow));
|
|
1508
|
+
}
|
|
1509
|
+
render(e) {
|
|
1510
|
+
const { x: o, y: r, width: n, height: h, flipX: s, flipY: d } = B(
|
|
1511
|
+
e.from,
|
|
1512
|
+
e.to
|
|
1533
1513
|
);
|
|
1534
|
-
this.svg.style.transform = `translate(${o}px, ${r}px)`, this.svg.style.width = `${n}px`, this.svg.style.height = `${h}px`, this.group.style.transform = `scale(${s}, ${
|
|
1535
|
-
const
|
|
1536
|
-
|
|
1514
|
+
this.svg.style.transform = `translate(${o}px, ${r}px)`, this.svg.style.width = `${n}px`, this.svg.style.height = `${h}px`, this.group.style.transform = `scale(${s}, ${d})`;
|
|
1515
|
+
const c = T(
|
|
1516
|
+
e.from.direction,
|
|
1537
1517
|
s,
|
|
1538
|
-
|
|
1539
|
-
), a =
|
|
1518
|
+
d
|
|
1519
|
+
), a = T(e.to.direction, s, d), l = {
|
|
1540
1520
|
x: n,
|
|
1541
1521
|
y: h
|
|
1542
1522
|
};
|
|
1543
|
-
let g,
|
|
1544
|
-
if (
|
|
1545
|
-
fromVect:
|
|
1523
|
+
let g, f = a, x = -this.arrowLength;
|
|
1524
|
+
if (e.from.portId === e.to.portId ? (g = H({
|
|
1525
|
+
fromVect: c,
|
|
1546
1526
|
arrowLength: this.arrowLength,
|
|
1547
1527
|
side: this.cycleSquareSide,
|
|
1548
1528
|
arrowOffset: this.arrowOffset,
|
|
1549
1529
|
roundness: this.roundness,
|
|
1550
1530
|
hasSourceArrow: this.hasSourceArrow,
|
|
1551
1531
|
hasTargetArrow: this.hasTargetArrow
|
|
1552
|
-
}),
|
|
1532
|
+
}), f = c, x = this.arrowLength) : e.from.nodeId === e.to.nodeId ? g = X({
|
|
1553
1533
|
to: l,
|
|
1554
|
-
fromVect:
|
|
1534
|
+
fromVect: c,
|
|
1555
1535
|
toVect: a,
|
|
1556
1536
|
flipX: s,
|
|
1557
|
-
flipY:
|
|
1537
|
+
flipY: d,
|
|
1558
1538
|
arrowLength: this.arrowLength,
|
|
1559
1539
|
arrowOffset: this.arrowOffset,
|
|
1560
1540
|
roundness: this.roundness,
|
|
@@ -1562,9 +1542,9 @@ class Wt {
|
|
|
1562
1542
|
detourDistance: this.detourDistance,
|
|
1563
1543
|
hasSourceArrow: this.hasSourceArrow,
|
|
1564
1544
|
hasTargetArrow: this.hasTargetArrow
|
|
1565
|
-
}) : g =
|
|
1545
|
+
}) : g = Me({
|
|
1566
1546
|
to: l,
|
|
1567
|
-
fromVect:
|
|
1547
|
+
fromVect: c,
|
|
1568
1548
|
toVect: a,
|
|
1569
1549
|
arrowLength: this.arrowLength,
|
|
1570
1550
|
arrowOffset: this.arrowOffset,
|
|
@@ -1572,8 +1552,8 @@ class Wt {
|
|
|
1572
1552
|
hasSourceArrow: this.hasSourceArrow,
|
|
1573
1553
|
hasTargetArrow: this.hasTargetArrow
|
|
1574
1554
|
}), this.line.setAttribute("d", g), this.sourceArrow) {
|
|
1575
|
-
const v =
|
|
1576
|
-
|
|
1555
|
+
const v = m(
|
|
1556
|
+
c,
|
|
1577
1557
|
w,
|
|
1578
1558
|
this.arrowLength,
|
|
1579
1559
|
this.arrowWidth
|
|
@@ -1581,8 +1561,8 @@ class Wt {
|
|
|
1581
1561
|
this.sourceArrow.setAttribute("d", v);
|
|
1582
1562
|
}
|
|
1583
1563
|
if (this.targetArrow) {
|
|
1584
|
-
const v =
|
|
1585
|
-
|
|
1564
|
+
const v = m(
|
|
1565
|
+
f,
|
|
1586
1566
|
l,
|
|
1587
1567
|
x,
|
|
1588
1568
|
this.arrowWidth
|
|
@@ -1591,10 +1571,10 @@ class Wt {
|
|
|
1591
1571
|
}
|
|
1592
1572
|
}
|
|
1593
1573
|
}
|
|
1594
|
-
class
|
|
1595
|
-
constructor(
|
|
1574
|
+
class $e {
|
|
1575
|
+
constructor(e) {
|
|
1596
1576
|
i(this, "svg", I());
|
|
1597
|
-
i(this, "group",
|
|
1577
|
+
i(this, "group", W());
|
|
1598
1578
|
i(this, "line");
|
|
1599
1579
|
i(this, "sourceArrow", null);
|
|
1600
1580
|
i(this, "targetArrow", null);
|
|
@@ -1607,45 +1587,45 @@ class It {
|
|
|
1607
1587
|
i(this, "detourDistance");
|
|
1608
1588
|
i(this, "hasSourceArrow");
|
|
1609
1589
|
i(this, "hasTargetArrow");
|
|
1610
|
-
this.arrowLength = (
|
|
1611
|
-
const o = (
|
|
1590
|
+
this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? u.arrowLength, this.arrowWidth = (e == null ? void 0 : e.arrowWidth) ?? u.arrowWidth, this.arrowOffset = (e == null ? void 0 : e.arrowOffset) ?? u.arrowOffset, this.cycleSquareSide = (e == null ? void 0 : e.cycleSquareSide) ?? u.cycleSquareSide;
|
|
1591
|
+
const o = (e == null ? void 0 : e.roundness) ?? u.roundness;
|
|
1612
1592
|
this.roundness = Math.min(
|
|
1613
1593
|
o,
|
|
1614
1594
|
this.arrowOffset,
|
|
1615
1595
|
this.cycleSquareSide / 2
|
|
1616
|
-
), this.detourDirection = (
|
|
1617
|
-
const r = (
|
|
1618
|
-
this.svg.appendChild(this.group), this.line =
|
|
1619
|
-
}
|
|
1620
|
-
render(
|
|
1621
|
-
const { x: o, y: r, width: n, height: h, flipX: s, flipY:
|
|
1622
|
-
|
|
1623
|
-
|
|
1596
|
+
), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? u.detourDirectionVertical, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? u.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? u.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? u.hasTargetArrow;
|
|
1597
|
+
const r = (e == null ? void 0 : e.color) ?? u.color, n = (e == null ? void 0 : e.width) ?? u.width;
|
|
1598
|
+
this.svg.appendChild(this.group), this.line = F(r, n), this.group.appendChild(this.line), this.hasSourceArrow && (this.sourceArrow = P(r), this.group.appendChild(this.sourceArrow)), this.hasTargetArrow && (this.targetArrow = P(r), this.group.appendChild(this.targetArrow));
|
|
1599
|
+
}
|
|
1600
|
+
render(e) {
|
|
1601
|
+
const { x: o, y: r, width: n, height: h, flipX: s, flipY: d } = B(
|
|
1602
|
+
e.from,
|
|
1603
|
+
e.to
|
|
1624
1604
|
);
|
|
1625
|
-
this.svg.style.transform = `translate(${o}px, ${r}px)`, this.svg.style.width = `${n}px`, this.svg.style.height = `${h}px`, this.group.style.transform = `scale(${s}, ${
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1605
|
+
this.svg.style.transform = `translate(${o}px, ${r}px)`, this.svg.style.width = `${n}px`, this.svg.style.height = `${h}px`, this.group.style.transform = `scale(${s}, ${d})`;
|
|
1606
|
+
const c = T(
|
|
1607
|
+
e.from.direction,
|
|
1628
1608
|
s,
|
|
1629
|
-
|
|
1630
|
-
), a =
|
|
1609
|
+
d
|
|
1610
|
+
), a = T(e.to.direction, s, d), l = {
|
|
1631
1611
|
x: n,
|
|
1632
1612
|
y: h
|
|
1633
1613
|
};
|
|
1634
|
-
let g,
|
|
1635
|
-
if (
|
|
1636
|
-
fromVect:
|
|
1614
|
+
let g, f = a, x = -this.arrowLength;
|
|
1615
|
+
if (e.from.portId === e.to.portId ? (g = H({
|
|
1616
|
+
fromVect: c,
|
|
1637
1617
|
arrowLength: this.arrowLength,
|
|
1638
1618
|
side: this.cycleSquareSide,
|
|
1639
1619
|
arrowOffset: this.arrowOffset,
|
|
1640
1620
|
roundness: this.roundness,
|
|
1641
1621
|
hasSourceArrow: this.hasSourceArrow,
|
|
1642
1622
|
hasTargetArrow: this.hasTargetArrow
|
|
1643
|
-
}),
|
|
1623
|
+
}), f = c, x = this.arrowLength) : e.from.nodeId === e.to.nodeId ? g = X({
|
|
1644
1624
|
to: l,
|
|
1645
|
-
fromVect:
|
|
1625
|
+
fromVect: c,
|
|
1646
1626
|
toVect: a,
|
|
1647
1627
|
flipX: s,
|
|
1648
|
-
flipY:
|
|
1628
|
+
flipY: d,
|
|
1649
1629
|
arrowLength: this.arrowLength,
|
|
1650
1630
|
arrowOffset: this.arrowOffset,
|
|
1651
1631
|
roundness: this.roundness,
|
|
@@ -1653,19 +1633,19 @@ class It {
|
|
|
1653
1633
|
detourDistance: this.detourDistance,
|
|
1654
1634
|
hasSourceArrow: this.hasSourceArrow,
|
|
1655
1635
|
hasTargetArrow: this.hasTargetArrow
|
|
1656
|
-
}) : g =
|
|
1636
|
+
}) : g = Ve({
|
|
1657
1637
|
to: l,
|
|
1658
|
-
fromVect:
|
|
1638
|
+
fromVect: c,
|
|
1659
1639
|
toVect: a,
|
|
1660
|
-
flipY:
|
|
1640
|
+
flipY: d,
|
|
1661
1641
|
arrowLength: this.arrowLength,
|
|
1662
1642
|
arrowOffset: this.arrowOffset,
|
|
1663
1643
|
roundness: this.roundness,
|
|
1664
1644
|
hasSourceArrow: this.hasSourceArrow,
|
|
1665
1645
|
hasTargetArrow: this.hasTargetArrow
|
|
1666
1646
|
}), this.line.setAttribute("d", g), this.sourceArrow) {
|
|
1667
|
-
const v =
|
|
1668
|
-
|
|
1647
|
+
const v = m(
|
|
1648
|
+
c,
|
|
1669
1649
|
w,
|
|
1670
1650
|
this.arrowLength,
|
|
1671
1651
|
this.arrowWidth
|
|
@@ -1673,8 +1653,8 @@ class It {
|
|
|
1673
1653
|
this.sourceArrow.setAttribute("d", v);
|
|
1674
1654
|
}
|
|
1675
1655
|
if (this.targetArrow) {
|
|
1676
|
-
const v =
|
|
1677
|
-
|
|
1656
|
+
const v = m(
|
|
1657
|
+
f,
|
|
1678
1658
|
l,
|
|
1679
1659
|
x,
|
|
1680
1660
|
this.arrowWidth
|
|
@@ -1683,97 +1663,97 @@ class It {
|
|
|
1683
1663
|
}
|
|
1684
1664
|
}
|
|
1685
1665
|
}
|
|
1686
|
-
const
|
|
1687
|
-
if (typeof
|
|
1688
|
-
return
|
|
1689
|
-
switch (
|
|
1666
|
+
const Re = (t) => {
|
|
1667
|
+
if (typeof t == "function")
|
|
1668
|
+
return t;
|
|
1669
|
+
switch (t == null ? void 0 : t.type) {
|
|
1690
1670
|
case "straight":
|
|
1691
|
-
return () => new
|
|
1692
|
-
color:
|
|
1693
|
-
width:
|
|
1694
|
-
arrowLength:
|
|
1695
|
-
arrowWidth:
|
|
1696
|
-
arrowOffset:
|
|
1697
|
-
hasSourceArrow:
|
|
1698
|
-
hasTargetArrow:
|
|
1699
|
-
cycleSquareSide:
|
|
1700
|
-
roundness:
|
|
1701
|
-
detourDistance:
|
|
1702
|
-
detourDirection:
|
|
1671
|
+
return () => new Ue({
|
|
1672
|
+
color: t.color,
|
|
1673
|
+
width: t.width,
|
|
1674
|
+
arrowLength: t.arrowLength,
|
|
1675
|
+
arrowWidth: t.arrowWidth,
|
|
1676
|
+
arrowOffset: t.arrowOffset,
|
|
1677
|
+
hasSourceArrow: t.hasSourceArrow,
|
|
1678
|
+
hasTargetArrow: t.hasTargetArrow,
|
|
1679
|
+
cycleSquareSide: t.cycleSquareSide,
|
|
1680
|
+
roundness: t.roundness,
|
|
1681
|
+
detourDistance: t.detourDistance,
|
|
1682
|
+
detourDirection: t.detourDirection
|
|
1703
1683
|
});
|
|
1704
1684
|
case "horizontal":
|
|
1705
|
-
return () => new
|
|
1706
|
-
color:
|
|
1707
|
-
width:
|
|
1708
|
-
arrowLength:
|
|
1709
|
-
arrowWidth:
|
|
1710
|
-
arrowOffset:
|
|
1711
|
-
hasSourceArrow:
|
|
1712
|
-
hasTargetArrow:
|
|
1713
|
-
cycleSquareSide:
|
|
1714
|
-
roundness:
|
|
1715
|
-
detourDistance:
|
|
1716
|
-
detourDirection:
|
|
1685
|
+
return () => new Ce({
|
|
1686
|
+
color: t.color,
|
|
1687
|
+
width: t.width,
|
|
1688
|
+
arrowLength: t.arrowLength,
|
|
1689
|
+
arrowWidth: t.arrowWidth,
|
|
1690
|
+
arrowOffset: t.arrowOffset,
|
|
1691
|
+
hasSourceArrow: t.hasSourceArrow,
|
|
1692
|
+
hasTargetArrow: t.hasTargetArrow,
|
|
1693
|
+
cycleSquareSide: t.cycleSquareSide,
|
|
1694
|
+
roundness: t.roundness,
|
|
1695
|
+
detourDistance: t.detourDistance,
|
|
1696
|
+
detourDirection: t.detourDirection
|
|
1717
1697
|
});
|
|
1718
1698
|
case "vertical":
|
|
1719
|
-
return () => new
|
|
1720
|
-
color:
|
|
1721
|
-
width:
|
|
1722
|
-
arrowLength:
|
|
1723
|
-
arrowWidth:
|
|
1724
|
-
arrowOffset:
|
|
1725
|
-
hasSourceArrow:
|
|
1726
|
-
hasTargetArrow:
|
|
1727
|
-
cycleSquareSide:
|
|
1728
|
-
roundness:
|
|
1729
|
-
detourDistance:
|
|
1730
|
-
detourDirection:
|
|
1699
|
+
return () => new $e({
|
|
1700
|
+
color: t.color,
|
|
1701
|
+
width: t.width,
|
|
1702
|
+
arrowLength: t.arrowLength,
|
|
1703
|
+
arrowWidth: t.arrowWidth,
|
|
1704
|
+
arrowOffset: t.arrowOffset,
|
|
1705
|
+
hasSourceArrow: t.hasSourceArrow,
|
|
1706
|
+
hasTargetArrow: t.hasTargetArrow,
|
|
1707
|
+
cycleSquareSide: t.cycleSquareSide,
|
|
1708
|
+
roundness: t.roundness,
|
|
1709
|
+
detourDistance: t.detourDistance,
|
|
1710
|
+
detourDirection: t.detourDirection
|
|
1731
1711
|
});
|
|
1732
1712
|
default:
|
|
1733
|
-
return () => new
|
|
1734
|
-
color:
|
|
1735
|
-
width:
|
|
1736
|
-
arrowLength:
|
|
1737
|
-
arrowWidth:
|
|
1738
|
-
hasSourceArrow:
|
|
1739
|
-
hasTargetArrow:
|
|
1740
|
-
cycleRadius:
|
|
1741
|
-
smallCycleRadius:
|
|
1742
|
-
curvature:
|
|
1743
|
-
detourDistance:
|
|
1744
|
-
detourDirection:
|
|
1713
|
+
return () => new De({
|
|
1714
|
+
color: t.color,
|
|
1715
|
+
width: t.width,
|
|
1716
|
+
arrowLength: t.arrowLength,
|
|
1717
|
+
arrowWidth: t.arrowWidth,
|
|
1718
|
+
hasSourceArrow: t.hasSourceArrow,
|
|
1719
|
+
hasTargetArrow: t.hasTargetArrow,
|
|
1720
|
+
cycleRadius: t.cycleRadius,
|
|
1721
|
+
smallCycleRadius: t.smallCycleRadius,
|
|
1722
|
+
curvature: t.curvature,
|
|
1723
|
+
detourDistance: t.detourDistance,
|
|
1724
|
+
detourDirection: t.detourDirection
|
|
1745
1725
|
});
|
|
1746
1726
|
}
|
|
1747
|
-
},
|
|
1727
|
+
}, Ie = (t) => {
|
|
1748
1728
|
var o, r, n, h, s;
|
|
1749
|
-
const
|
|
1750
|
-
(o =
|
|
1751
|
-
(r =
|
|
1729
|
+
const e = Te(
|
|
1730
|
+
(o = t == null ? void 0 : t.nodes) == null ? void 0 : o.priority,
|
|
1731
|
+
(r = t == null ? void 0 : t.edges) == null ? void 0 : r.priority
|
|
1752
1732
|
);
|
|
1753
1733
|
return {
|
|
1754
1734
|
nodes: {
|
|
1755
|
-
centerFn: ((n =
|
|
1756
|
-
priorityFn:
|
|
1735
|
+
centerFn: ((n = t == null ? void 0 : t.nodes) == null ? void 0 : n.centerFn) ?? Se,
|
|
1736
|
+
priorityFn: e.nodesPriorityFn
|
|
1757
1737
|
},
|
|
1758
1738
|
ports: {
|
|
1759
|
-
direction: ((h =
|
|
1739
|
+
direction: ((h = t == null ? void 0 : t.ports) == null ? void 0 : h.direction) ?? 0
|
|
1760
1740
|
},
|
|
1761
1741
|
edges: {
|
|
1762
|
-
shapeFactory:
|
|
1763
|
-
priorityFn:
|
|
1742
|
+
shapeFactory: Re(((s = t == null ? void 0 : t.edges) == null ? void 0 : s.shape) ?? {}),
|
|
1743
|
+
priorityFn: e.edgesPriorityFn
|
|
1764
1744
|
}
|
|
1765
1745
|
};
|
|
1766
1746
|
};
|
|
1767
|
-
class
|
|
1768
|
-
constructor(
|
|
1769
|
-
i(this, "nodeIdGenerator", new
|
|
1770
|
-
(
|
|
1747
|
+
class We {
|
|
1748
|
+
constructor(e, o) {
|
|
1749
|
+
i(this, "nodeIdGenerator", new z(
|
|
1750
|
+
(e) => this.graph.getNode(e) !== null
|
|
1771
1751
|
));
|
|
1772
|
-
i(this, "portIdGenerator", new
|
|
1773
|
-
(
|
|
1752
|
+
i(this, "portIdGenerator", new z(
|
|
1753
|
+
(e) => this.graph.getPort(e) !== null
|
|
1774
1754
|
));
|
|
1775
|
-
i(this, "edgeIdGenerator", new
|
|
1776
|
-
(
|
|
1755
|
+
i(this, "edgeIdGenerator", new z(
|
|
1756
|
+
(e) => this.graph.getEdge(e) !== null
|
|
1777
1757
|
));
|
|
1778
1758
|
i(this, "defaults");
|
|
1779
1759
|
/**
|
|
@@ -1784,14 +1764,14 @@ class kt {
|
|
|
1784
1764
|
* provides api for accessing viewport state
|
|
1785
1765
|
*/
|
|
1786
1766
|
i(this, "viewport");
|
|
1787
|
-
this.controller =
|
|
1767
|
+
this.controller = e, this.defaults = Ie(o), this.graph = e.graph, this.viewport = e.viewport;
|
|
1788
1768
|
}
|
|
1789
1769
|
/**
|
|
1790
1770
|
* attaches canvas to given element
|
|
1791
1771
|
* detaches element first when canvas is attached
|
|
1792
1772
|
*/
|
|
1793
|
-
attach(
|
|
1794
|
-
return this.controller.attach(
|
|
1773
|
+
attach(e) {
|
|
1774
|
+
return this.controller.attach(e), this;
|
|
1795
1775
|
}
|
|
1796
1776
|
/**
|
|
1797
1777
|
* detaches canvas from element when attached
|
|
@@ -1802,19 +1782,19 @@ class kt {
|
|
|
1802
1782
|
/**
|
|
1803
1783
|
* adds node to graph
|
|
1804
1784
|
*/
|
|
1805
|
-
addNode(
|
|
1806
|
-
const o = this.nodeIdGenerator.create(
|
|
1785
|
+
addNode(e) {
|
|
1786
|
+
const o = this.nodeIdGenerator.create(e.id);
|
|
1807
1787
|
if (this.graph.getNode(o) !== null)
|
|
1808
1788
|
throw new E("failed to add node with existing id");
|
|
1809
1789
|
if (this.controller.addNode({
|
|
1810
1790
|
id: o,
|
|
1811
|
-
element:
|
|
1812
|
-
x:
|
|
1813
|
-
y:
|
|
1814
|
-
centerFn:
|
|
1815
|
-
priority:
|
|
1816
|
-
}),
|
|
1817
|
-
for (const r of
|
|
1791
|
+
element: e.element,
|
|
1792
|
+
x: e.x,
|
|
1793
|
+
y: e.y,
|
|
1794
|
+
centerFn: e.centerFn ?? this.defaults.nodes.centerFn,
|
|
1795
|
+
priority: e.priority ?? this.defaults.nodes.priorityFn()
|
|
1796
|
+
}), e.ports !== void 0)
|
|
1797
|
+
for (const r of e.ports)
|
|
1818
1798
|
this.markPort({
|
|
1819
1799
|
id: r.id,
|
|
1820
1800
|
element: r.element,
|
|
@@ -1826,100 +1806,100 @@ class kt {
|
|
|
1826
1806
|
/**
|
|
1827
1807
|
* updates node parameters
|
|
1828
1808
|
*/
|
|
1829
|
-
updateNode(
|
|
1830
|
-
if (this.graph.getNode(
|
|
1809
|
+
updateNode(e, o) {
|
|
1810
|
+
if (this.graph.getNode(e) === null)
|
|
1831
1811
|
throw new E("failed to update nonexisting node");
|
|
1832
|
-
return this.controller.updateNode(
|
|
1812
|
+
return this.controller.updateNode(e, o ?? {}), this;
|
|
1833
1813
|
}
|
|
1834
1814
|
/**
|
|
1835
1815
|
* removes node from graph
|
|
1836
1816
|
* all the ports of node get unmarked
|
|
1837
1817
|
* all the edges adjacent to node get removed
|
|
1838
1818
|
*/
|
|
1839
|
-
removeNode(
|
|
1840
|
-
if (this.graph.getNode(
|
|
1819
|
+
removeNode(e) {
|
|
1820
|
+
if (this.graph.getNode(e) === null)
|
|
1841
1821
|
throw new E("failed to remove nonexisting node");
|
|
1842
|
-
return this.controller.removeNode(
|
|
1822
|
+
return this.controller.removeNode(e), this;
|
|
1843
1823
|
}
|
|
1844
1824
|
/**
|
|
1845
1825
|
* marks element as port of node
|
|
1846
1826
|
*/
|
|
1847
|
-
markPort(
|
|
1848
|
-
const o = this.portIdGenerator.create(
|
|
1827
|
+
markPort(e) {
|
|
1828
|
+
const o = this.portIdGenerator.create(e.id);
|
|
1849
1829
|
if (this.graph.getPort(o) !== null)
|
|
1850
1830
|
throw new E("failed to add port with existing id");
|
|
1851
|
-
if (this.graph.getNode(
|
|
1831
|
+
if (this.graph.getNode(e.nodeId) === null)
|
|
1852
1832
|
throw new E("failed to set port on nonexisting node");
|
|
1853
1833
|
return this.controller.markPort({
|
|
1854
1834
|
id: o,
|
|
1855
|
-
element:
|
|
1856
|
-
nodeId:
|
|
1857
|
-
direction:
|
|
1835
|
+
element: e.element,
|
|
1836
|
+
nodeId: e.nodeId,
|
|
1837
|
+
direction: e.direction ?? this.defaults.ports.direction
|
|
1858
1838
|
}), this;
|
|
1859
1839
|
}
|
|
1860
1840
|
/**
|
|
1861
1841
|
* updates port and attached edges
|
|
1862
1842
|
*/
|
|
1863
|
-
updatePort(
|
|
1864
|
-
if (this.graph.getPort(
|
|
1843
|
+
updatePort(e, o) {
|
|
1844
|
+
if (this.graph.getPort(e) === null)
|
|
1865
1845
|
throw new E("failed to unset nonexisting port");
|
|
1866
|
-
return this.controller.updatePort(
|
|
1846
|
+
return this.controller.updatePort(e, o ?? {}), this;
|
|
1867
1847
|
}
|
|
1868
1848
|
/**
|
|
1869
1849
|
* ummarks element as port of node
|
|
1870
1850
|
* all the edges adjacent to port get removed
|
|
1871
1851
|
*/
|
|
1872
|
-
unmarkPort(
|
|
1873
|
-
if (this.graph.getPort(
|
|
1852
|
+
unmarkPort(e) {
|
|
1853
|
+
if (this.graph.getPort(e) === null)
|
|
1874
1854
|
throw new E("failed to unset nonexisting port");
|
|
1875
|
-
return this.controller.unmarkPort(
|
|
1855
|
+
return this.controller.unmarkPort(e), this;
|
|
1876
1856
|
}
|
|
1877
1857
|
/**
|
|
1878
1858
|
* adds edge to graph
|
|
1879
1859
|
*/
|
|
1880
|
-
addEdge(
|
|
1881
|
-
const o = this.edgeIdGenerator.create(
|
|
1860
|
+
addEdge(e) {
|
|
1861
|
+
const o = this.edgeIdGenerator.create(e.id);
|
|
1882
1862
|
if (this.graph.getEdge(o) !== null)
|
|
1883
1863
|
throw new E("failed to add edge with existing id");
|
|
1884
|
-
if (this.graph.getPort(
|
|
1864
|
+
if (this.graph.getPort(e.from) === null)
|
|
1885
1865
|
throw new E("failed to add edge from nonexisting port");
|
|
1886
|
-
if (this.graph.getPort(
|
|
1866
|
+
if (this.graph.getPort(e.to) === null)
|
|
1887
1867
|
throw new E("failed to add edge to nonexisting port");
|
|
1888
1868
|
return this.controller.addEdge({
|
|
1889
1869
|
id: o,
|
|
1890
|
-
from:
|
|
1891
|
-
to:
|
|
1892
|
-
shape:
|
|
1893
|
-
priority:
|
|
1870
|
+
from: e.from,
|
|
1871
|
+
to: e.to,
|
|
1872
|
+
shape: e.shape ?? this.defaults.edges.shapeFactory(),
|
|
1873
|
+
priority: e.priority ?? this.defaults.edges.priorityFn()
|
|
1894
1874
|
}), this;
|
|
1895
1875
|
}
|
|
1896
1876
|
/**
|
|
1897
1877
|
* updates edge
|
|
1898
1878
|
*/
|
|
1899
|
-
updateEdge(
|
|
1900
|
-
if (this.graph.getEdge(
|
|
1879
|
+
updateEdge(e, o) {
|
|
1880
|
+
if (this.graph.getEdge(e) === null)
|
|
1901
1881
|
throw new E("failed to update nonexisting edge");
|
|
1902
|
-
return this.controller.updateEdge(
|
|
1882
|
+
return this.controller.updateEdge(e, o ?? {}), this;
|
|
1903
1883
|
}
|
|
1904
1884
|
/**
|
|
1905
1885
|
* removes edge from graph
|
|
1906
1886
|
*/
|
|
1907
|
-
removeEdge(
|
|
1908
|
-
if (this.graph.getEdge(
|
|
1887
|
+
removeEdge(e) {
|
|
1888
|
+
if (this.graph.getEdge(e) === null)
|
|
1909
1889
|
throw new E("failed to remove nonexisting edge");
|
|
1910
|
-
return this.controller.removeEdge(
|
|
1890
|
+
return this.controller.removeEdge(e), this;
|
|
1911
1891
|
}
|
|
1912
1892
|
/**
|
|
1913
1893
|
* applies transformation for viewport
|
|
1914
1894
|
*/
|
|
1915
|
-
patchViewportMatrix(
|
|
1916
|
-
return this.controller.patchViewportMatrix(
|
|
1895
|
+
patchViewportMatrix(e) {
|
|
1896
|
+
return this.controller.patchViewportMatrix(e), this;
|
|
1917
1897
|
}
|
|
1918
1898
|
/**
|
|
1919
1899
|
* applies transformation for content
|
|
1920
1900
|
*/
|
|
1921
|
-
patchContentMatrix(
|
|
1922
|
-
return this.controller.patchContentMatrix(
|
|
1901
|
+
patchContentMatrix(e) {
|
|
1902
|
+
return this.controller.patchContentMatrix(e), this;
|
|
1923
1903
|
}
|
|
1924
1904
|
/**
|
|
1925
1905
|
* clears canvas from nodes and edges
|
|
@@ -1936,7 +1916,7 @@ class kt {
|
|
|
1936
1916
|
this.controller.destroy();
|
|
1937
1917
|
}
|
|
1938
1918
|
}
|
|
1939
|
-
class
|
|
1919
|
+
class Fe {
|
|
1940
1920
|
constructor() {
|
|
1941
1921
|
i(this, "nodes", /* @__PURE__ */ new Map());
|
|
1942
1922
|
i(this, "ports", /* @__PURE__ */ new Map());
|
|
@@ -1944,151 +1924,188 @@ class zt {
|
|
|
1944
1924
|
i(this, "incommingEdges", /* @__PURE__ */ new Map());
|
|
1945
1925
|
i(this, "outcommingEdges", /* @__PURE__ */ new Map());
|
|
1946
1926
|
i(this, "cycleEdges", /* @__PURE__ */ new Map());
|
|
1947
|
-
|
|
1948
|
-
|
|
1927
|
+
i(this, "afterNodeAddedEmitter");
|
|
1928
|
+
i(this, "onAfterNodeAdded");
|
|
1929
|
+
i(this, "afterNodeUpdatedEmitter");
|
|
1930
|
+
i(this, "onAfterNodeUpdated");
|
|
1931
|
+
i(this, "afterNodePriorityUpdatedEmitter");
|
|
1932
|
+
i(this, "onAfterNodePriorityUpdated");
|
|
1933
|
+
i(this, "beforeNodeRemovedEmitter");
|
|
1934
|
+
i(this, "onBeforeNodeRemoved");
|
|
1935
|
+
i(this, "afterPortAddedEmitter");
|
|
1936
|
+
i(this, "onAfterPortAdded");
|
|
1937
|
+
i(this, "afterPortUpdatedEmitter");
|
|
1938
|
+
i(this, "onAfterPortUpdated");
|
|
1939
|
+
i(this, "beforePortRemovedEmitter");
|
|
1940
|
+
i(this, "onBeforePortRemoved");
|
|
1941
|
+
i(this, "afterEdgeAddedEmitter");
|
|
1942
|
+
i(this, "onAfterEdgeAdded");
|
|
1943
|
+
i(this, "afterEdgeShapeUpdatedEmitter");
|
|
1944
|
+
i(this, "onAfterEdgeShapeUpdated");
|
|
1945
|
+
i(this, "afterEdgeUpdatedEmitter");
|
|
1946
|
+
i(this, "onAfterEdgeUpdated");
|
|
1947
|
+
i(this, "afterEdgePriorityUpdatedEmitter");
|
|
1948
|
+
i(this, "onAfterEdgePriorityUpdated");
|
|
1949
|
+
i(this, "beforeEdgeRemovedEmitter");
|
|
1950
|
+
i(this, "onBeforeEdgeRemoved");
|
|
1951
|
+
i(this, "beforeClearEmitter");
|
|
1952
|
+
i(this, "onBeforeClear");
|
|
1953
|
+
[this.afterNodeAddedEmitter, this.onAfterNodeAdded] = A(), [this.afterNodeUpdatedEmitter, this.onAfterNodeUpdated] = A(), [this.afterNodePriorityUpdatedEmitter, this.onAfterNodePriorityUpdated] = A(), [this.beforeNodeRemovedEmitter, this.onBeforeNodeRemoved] = A(), [this.afterPortAddedEmitter, this.onAfterPortAdded] = A(), [this.afterPortUpdatedEmitter, this.onAfterPortUpdated] = A(), [this.beforePortRemovedEmitter, this.onBeforePortRemoved] = A(), [this.afterEdgeAddedEmitter, this.onAfterEdgeAdded] = A(), [this.afterEdgeShapeUpdatedEmitter, this.onAfterEdgeShapeUpdated] = A(), [this.afterEdgeUpdatedEmitter, this.onAfterEdgeUpdated] = A(), [this.afterEdgePriorityUpdatedEmitter, this.onAfterEdgePriorityUpdated] = A(), [this.beforeEdgeRemovedEmitter, this.onBeforeEdgeRemoved] = A(), [this.beforeClearEmitter, this.onBeforeClear] = A();
|
|
1954
|
+
}
|
|
1955
|
+
addNode(e) {
|
|
1949
1956
|
const o = /* @__PURE__ */ new Map(), r = {
|
|
1950
|
-
element:
|
|
1951
|
-
x:
|
|
1952
|
-
y:
|
|
1953
|
-
centerFn:
|
|
1954
|
-
priority:
|
|
1957
|
+
element: e.element,
|
|
1958
|
+
x: e.x,
|
|
1959
|
+
y: e.y,
|
|
1960
|
+
centerFn: e.centerFn,
|
|
1961
|
+
priority: e.priority,
|
|
1955
1962
|
ports: o
|
|
1956
1963
|
};
|
|
1957
|
-
this.nodes.set(
|
|
1964
|
+
this.nodes.set(e.id, r), this.afterNodeAddedEmitter.emit(e.id);
|
|
1958
1965
|
}
|
|
1959
1966
|
getAllNodeIds() {
|
|
1960
1967
|
return Array.from(this.nodes.keys());
|
|
1961
1968
|
}
|
|
1962
|
-
getNode(
|
|
1963
|
-
return this.nodes.get(
|
|
1969
|
+
getNode(e) {
|
|
1970
|
+
return this.nodes.get(e);
|
|
1971
|
+
}
|
|
1972
|
+
updateNode(e, o) {
|
|
1973
|
+
const r = this.nodes.get(e);
|
|
1974
|
+
r.x = o.x ?? r.x, r.y = o.y ?? r.y, r.centerFn = o.centerFn ?? r.centerFn, o.priority !== void 0 && (r.priority = o.priority, this.afterNodePriorityUpdatedEmitter.emit(e)), this.afterNodeUpdatedEmitter.emit(e);
|
|
1964
1975
|
}
|
|
1965
|
-
removeNode(
|
|
1966
|
-
this.nodes.delete(
|
|
1976
|
+
removeNode(e) {
|
|
1977
|
+
this.beforeNodeRemovedEmitter.emit(e), this.nodes.delete(e);
|
|
1967
1978
|
}
|
|
1968
|
-
addPort(
|
|
1969
|
-
this.ports.set(
|
|
1970
|
-
element:
|
|
1971
|
-
direction:
|
|
1972
|
-
nodeId:
|
|
1973
|
-
}), this.cycleEdges.set(
|
|
1979
|
+
addPort(e) {
|
|
1980
|
+
this.ports.set(e.id, {
|
|
1981
|
+
element: e.element,
|
|
1982
|
+
direction: e.direction,
|
|
1983
|
+
nodeId: e.nodeId
|
|
1984
|
+
}), this.cycleEdges.set(e.id, /* @__PURE__ */ new Set()), this.incommingEdges.set(e.id, /* @__PURE__ */ new Set()), this.outcommingEdges.set(e.id, /* @__PURE__ */ new Set()), this.nodes.get(e.nodeId).ports.set(e.id, e.element), this.afterPortAddedEmitter.emit(e.id);
|
|
1974
1985
|
}
|
|
1975
|
-
getPort(
|
|
1976
|
-
return this.ports.get(
|
|
1986
|
+
getPort(e) {
|
|
1987
|
+
return this.ports.get(e);
|
|
1988
|
+
}
|
|
1989
|
+
updatePort(e, o) {
|
|
1990
|
+
const r = this.ports.get(e);
|
|
1991
|
+
r.direction = o.direction ?? r.direction, this.afterPortUpdatedEmitter.emit(e);
|
|
1977
1992
|
}
|
|
1978
1993
|
getAllPortIds() {
|
|
1979
1994
|
return Array.from(this.ports.keys());
|
|
1980
1995
|
}
|
|
1981
|
-
getNodePortIds(
|
|
1982
|
-
const o = this.nodes.get(
|
|
1996
|
+
getNodePortIds(e) {
|
|
1997
|
+
const o = this.nodes.get(e);
|
|
1983
1998
|
if (o !== void 0)
|
|
1984
1999
|
return Array.from(o.ports.keys());
|
|
1985
2000
|
}
|
|
1986
|
-
removePort(
|
|
1987
|
-
const o = this.ports.get(
|
|
1988
|
-
this.nodes.get(o).ports.delete(
|
|
1989
|
-
}
|
|
1990
|
-
addEdge(
|
|
1991
|
-
this.
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
});
|
|
2007
|
-
}
|
|
2008
|
-
updateEdgeTo(t, o) {
|
|
2009
|
-
const r = this.edges.get(t);
|
|
2010
|
-
this.removeEdge(t), this.addEdge({
|
|
2011
|
-
id: t,
|
|
2012
|
-
from: r.from,
|
|
2013
|
-
to: o,
|
|
2014
|
-
shape: r.shape,
|
|
2015
|
-
priority: r.priority
|
|
2016
|
-
});
|
|
2001
|
+
removePort(e) {
|
|
2002
|
+
const o = this.ports.get(e).nodeId;
|
|
2003
|
+
this.beforePortRemovedEmitter.emit(e), this.nodes.get(o).ports.delete(e), this.ports.delete(e);
|
|
2004
|
+
}
|
|
2005
|
+
addEdge(e) {
|
|
2006
|
+
this.addEdgeInternal(e), this.afterEdgeAddedEmitter.emit(e.id);
|
|
2007
|
+
}
|
|
2008
|
+
updateEdge(e, o) {
|
|
2009
|
+
if (o.from !== void 0 || o.to !== void 0) {
|
|
2010
|
+
const n = this.edges.get(e);
|
|
2011
|
+
this.removeEdgeInternal(e), this.addEdgeInternal({
|
|
2012
|
+
id: e,
|
|
2013
|
+
from: o.from ?? n.from,
|
|
2014
|
+
to: o.to ?? n.to,
|
|
2015
|
+
shape: n.shape,
|
|
2016
|
+
priority: n.priority
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
const r = this.edges.get(e);
|
|
2020
|
+
o.shape !== void 0 && (r.shape = o.shape, this.afterEdgeShapeUpdatedEmitter.emit(e)), o.priority !== void 0 && (r.priority = o.priority, this.afterEdgePriorityUpdatedEmitter.emit(e)), this.afterEdgeUpdatedEmitter.emit(e);
|
|
2017
2021
|
}
|
|
2018
2022
|
getAllEdgeIds() {
|
|
2019
2023
|
return Array.from(this.edges.keys());
|
|
2020
2024
|
}
|
|
2021
|
-
getEdge(
|
|
2022
|
-
return this.edges.get(
|
|
2025
|
+
getEdge(e) {
|
|
2026
|
+
return this.edges.get(e);
|
|
2023
2027
|
}
|
|
2024
|
-
removeEdge(
|
|
2025
|
-
|
|
2026
|
-
this.cycleEdges.get(r).delete(t), this.cycleEdges.get(n).delete(t), this.incommingEdges.get(r).delete(t), this.incommingEdges.get(n).delete(t), this.outcommingEdges.get(r).delete(t), this.outcommingEdges.get(n).delete(t), this.edges.delete(t);
|
|
2028
|
+
removeEdge(e) {
|
|
2029
|
+
this.beforeEdgeRemovedEmitter.emit(e), this.removeEdgeInternal(e);
|
|
2027
2030
|
}
|
|
2028
2031
|
clear() {
|
|
2029
|
-
this.incommingEdges.clear(), this.outcommingEdges.clear(), this.cycleEdges.clear(), this.edges.clear(), this.ports.clear(), this.nodes.clear();
|
|
2032
|
+
this.beforeClearEmitter.emit(), this.incommingEdges.clear(), this.outcommingEdges.clear(), this.cycleEdges.clear(), this.edges.clear(), this.ports.clear(), this.nodes.clear();
|
|
2030
2033
|
}
|
|
2031
|
-
getPortIncomingEdgeIds(
|
|
2032
|
-
return Array.from(this.incommingEdges.get(
|
|
2034
|
+
getPortIncomingEdgeIds(e) {
|
|
2035
|
+
return Array.from(this.incommingEdges.get(e));
|
|
2033
2036
|
}
|
|
2034
|
-
getPortOutcomingEdgeIds(
|
|
2035
|
-
return Array.from(this.outcommingEdges.get(
|
|
2037
|
+
getPortOutcomingEdgeIds(e) {
|
|
2038
|
+
return Array.from(this.outcommingEdges.get(e));
|
|
2036
2039
|
}
|
|
2037
|
-
getPortCycleEdgeIds(
|
|
2038
|
-
return Array.from(this.cycleEdges.get(
|
|
2040
|
+
getPortCycleEdgeIds(e) {
|
|
2041
|
+
return Array.from(this.cycleEdges.get(e));
|
|
2039
2042
|
}
|
|
2040
|
-
getPortAdjacentEdgeIds(
|
|
2043
|
+
getPortAdjacentEdgeIds(e) {
|
|
2041
2044
|
return [
|
|
2042
|
-
...this.getPortIncomingEdgeIds(
|
|
2043
|
-
...this.getPortOutcomingEdgeIds(
|
|
2044
|
-
...this.getPortCycleEdgeIds(
|
|
2045
|
+
...this.getPortIncomingEdgeIds(e),
|
|
2046
|
+
...this.getPortOutcomingEdgeIds(e),
|
|
2047
|
+
...this.getPortCycleEdgeIds(e)
|
|
2045
2048
|
];
|
|
2046
2049
|
}
|
|
2047
|
-
getNodeIncomingEdgeIds(
|
|
2048
|
-
const o = Array.from(this.nodes.get(
|
|
2050
|
+
getNodeIncomingEdgeIds(e) {
|
|
2051
|
+
const o = Array.from(this.nodes.get(e).ports.keys());
|
|
2049
2052
|
let r = [];
|
|
2050
2053
|
return o.forEach((n) => {
|
|
2051
2054
|
r = [...r, ...this.getPortIncomingEdgeIds(n)];
|
|
2052
2055
|
}), r;
|
|
2053
2056
|
}
|
|
2054
|
-
getNodeOutcomingEdgeIds(
|
|
2055
|
-
const o = Array.from(this.nodes.get(
|
|
2057
|
+
getNodeOutcomingEdgeIds(e) {
|
|
2058
|
+
const o = Array.from(this.nodes.get(e).ports.keys());
|
|
2056
2059
|
let r = [];
|
|
2057
2060
|
return o.forEach((n) => {
|
|
2058
2061
|
r = [...r, ...this.getPortOutcomingEdgeIds(n)];
|
|
2059
2062
|
}), r;
|
|
2060
2063
|
}
|
|
2061
|
-
getNodeCycleEdgeIds(
|
|
2062
|
-
const o = Array.from(this.nodes.get(
|
|
2064
|
+
getNodeCycleEdgeIds(e) {
|
|
2065
|
+
const o = Array.from(this.nodes.get(e).ports.keys());
|
|
2063
2066
|
let r = [];
|
|
2064
2067
|
return o.forEach((n) => {
|
|
2065
2068
|
r = [...r, ...this.getPortCycleEdgeIds(n)];
|
|
2066
2069
|
}), r;
|
|
2067
2070
|
}
|
|
2068
|
-
getNodeAdjacentEdgeIds(
|
|
2071
|
+
getNodeAdjacentEdgeIds(e) {
|
|
2069
2072
|
return [
|
|
2070
|
-
...this.getNodeIncomingEdgeIds(
|
|
2071
|
-
...this.getNodeOutcomingEdgeIds(
|
|
2072
|
-
...this.getNodeCycleEdgeIds(
|
|
2073
|
+
...this.getNodeIncomingEdgeIds(e),
|
|
2074
|
+
...this.getNodeOutcomingEdgeIds(e),
|
|
2075
|
+
...this.getNodeCycleEdgeIds(e)
|
|
2073
2076
|
];
|
|
2074
2077
|
}
|
|
2078
|
+
addEdgeInternal(e) {
|
|
2079
|
+
this.edges.set(e.id, {
|
|
2080
|
+
from: e.from,
|
|
2081
|
+
to: e.to,
|
|
2082
|
+
shape: e.shape,
|
|
2083
|
+
priority: e.priority
|
|
2084
|
+
}), e.from !== e.to ? (this.outcommingEdges.get(e.from).add(e.id), this.incommingEdges.get(e.to).add(e.id)) : this.cycleEdges.get(e.from).add(e.id);
|
|
2085
|
+
}
|
|
2086
|
+
removeEdgeInternal(e) {
|
|
2087
|
+
const o = this.edges.get(e), r = o.from, n = o.to;
|
|
2088
|
+
this.cycleEdges.get(r).delete(e), this.cycleEdges.get(n).delete(e), this.incommingEdges.get(r).delete(e), this.incommingEdges.get(n).delete(e), this.outcommingEdges.get(r).delete(e), this.outcommingEdges.get(n).delete(e), this.edges.delete(e);
|
|
2089
|
+
}
|
|
2075
2090
|
}
|
|
2076
|
-
const
|
|
2077
|
-
scale: 1 /
|
|
2078
|
-
x: -
|
|
2079
|
-
y: -
|
|
2080
|
-
}),
|
|
2091
|
+
const O = (t) => ({
|
|
2092
|
+
scale: 1 / t.scale,
|
|
2093
|
+
x: -t.x / t.scale,
|
|
2094
|
+
y: -t.y / t.scale
|
|
2095
|
+
}), q = {
|
|
2081
2096
|
scale: 1,
|
|
2082
2097
|
x: 0,
|
|
2083
2098
|
y: 0
|
|
2084
2099
|
};
|
|
2085
|
-
class
|
|
2100
|
+
class Be {
|
|
2086
2101
|
constructor() {
|
|
2087
|
-
i(this, "viewportMatrix",
|
|
2088
|
-
i(this, "contentMatrix",
|
|
2089
|
-
i(this, "
|
|
2090
|
-
i(this, "
|
|
2091
|
-
|
|
2102
|
+
i(this, "viewportMatrix", q);
|
|
2103
|
+
i(this, "contentMatrix", q);
|
|
2104
|
+
i(this, "afterUpdateEmitter");
|
|
2105
|
+
i(this, "onAfterUpdated");
|
|
2106
|
+
i(this, "beforeUpdateEmitter");
|
|
2107
|
+
i(this, "onBeforeUpdated");
|
|
2108
|
+
[this.afterUpdateEmitter, this.onAfterUpdated] = A(), [this.beforeUpdateEmitter, this.onBeforeUpdated] = A();
|
|
2092
2109
|
}
|
|
2093
2110
|
getViewportMatrix() {
|
|
2094
2111
|
return this.viewportMatrix;
|
|
@@ -2096,22 +2113,54 @@ class Yt {
|
|
|
2096
2113
|
getContentMatrix() {
|
|
2097
2114
|
return this.contentMatrix;
|
|
2098
2115
|
}
|
|
2099
|
-
patchViewportMatrix(
|
|
2100
|
-
this.viewportMatrix = {
|
|
2101
|
-
scale:
|
|
2102
|
-
x:
|
|
2103
|
-
y:
|
|
2104
|
-
}, this.contentMatrix =
|
|
2116
|
+
patchViewportMatrix(e) {
|
|
2117
|
+
this.beforeUpdateEmitter.emit(), this.viewportMatrix = {
|
|
2118
|
+
scale: e.scale ?? this.viewportMatrix.scale,
|
|
2119
|
+
x: e.x ?? this.viewportMatrix.x,
|
|
2120
|
+
y: e.y ?? this.viewportMatrix.y
|
|
2121
|
+
}, this.contentMatrix = O(this.viewportMatrix), this.afterUpdateEmitter.emit();
|
|
2122
|
+
}
|
|
2123
|
+
patchContentMatrix(e) {
|
|
2124
|
+
this.beforeUpdateEmitter.emit(), this.contentMatrix = {
|
|
2125
|
+
scale: e.scale ?? this.contentMatrix.scale,
|
|
2126
|
+
x: e.x ?? this.contentMatrix.x,
|
|
2127
|
+
y: e.y ?? this.contentMatrix.y
|
|
2128
|
+
}, this.viewportMatrix = O(this.contentMatrix), this.afterUpdateEmitter.emit();
|
|
2105
2129
|
}
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2130
|
+
}
|
|
2131
|
+
class j {
|
|
2132
|
+
constructor(e) {
|
|
2133
|
+
i(this, "elementToNodeId", /* @__PURE__ */ new Map());
|
|
2134
|
+
i(this, "nodesResizeObserver");
|
|
2135
|
+
i(this, "onAfterNodeAdded", (e) => {
|
|
2136
|
+
const o = this.canvas.graph.getNode(e);
|
|
2137
|
+
this.elementToNodeId.set(o.element, e), this.nodesResizeObserver.observe(o.element);
|
|
2138
|
+
});
|
|
2139
|
+
i(this, "onBeforeNodeRemoved", (e) => {
|
|
2140
|
+
const o = this.canvas.graph.getNode(e);
|
|
2141
|
+
this.elementToNodeId.delete(o.element), this.nodesResizeObserver.unobserve(o.element);
|
|
2142
|
+
});
|
|
2143
|
+
i(this, "onBeforeClear", () => {
|
|
2144
|
+
this.nodesResizeObserver.disconnect(), this.elementToNodeId.clear();
|
|
2145
|
+
});
|
|
2146
|
+
this.canvas = e, this.nodesResizeObserver = new ResizeObserver((o) => {
|
|
2147
|
+
o.forEach((r) => {
|
|
2148
|
+
const n = r.target;
|
|
2149
|
+
this.handleNodeResize(n);
|
|
2150
|
+
});
|
|
2151
|
+
}), this.canvas.graph.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.canvas.graph.onBeforeNodeRemoved.subscribe(this.onBeforeNodeRemoved), this.canvas.graph.onBeforeClear.subscribe(this.onBeforeClear);
|
|
2152
|
+
}
|
|
2153
|
+
static configure(e) {
|
|
2154
|
+
new j(e);
|
|
2155
|
+
}
|
|
2156
|
+
handleNodeResize(e) {
|
|
2157
|
+
const o = this.elementToNodeId.get(e);
|
|
2158
|
+
this.canvas.updateNode(o), this.canvas.graph.getNodeAdjacentEdgeIds(o).forEach((n) => {
|
|
2159
|
+
this.canvas.updateEdge(n);
|
|
2160
|
+
});
|
|
2112
2161
|
}
|
|
2113
2162
|
}
|
|
2114
|
-
class
|
|
2163
|
+
class ze {
|
|
2115
2164
|
constructor() {
|
|
2116
2165
|
i(this, "canvasDefaults", {});
|
|
2117
2166
|
i(this, "dragOptions");
|
|
@@ -2125,27 +2174,27 @@ class Bt {
|
|
|
2125
2174
|
/**
|
|
2126
2175
|
* specifies default values for graph entities
|
|
2127
2176
|
*/
|
|
2128
|
-
setDefaults(
|
|
2129
|
-
return this.canvasDefaults =
|
|
2177
|
+
setDefaults(e) {
|
|
2178
|
+
return this.canvasDefaults = e, this;
|
|
2130
2179
|
}
|
|
2131
2180
|
/**
|
|
2132
2181
|
* @deprecated
|
|
2133
2182
|
* use setDefaults instead
|
|
2134
2183
|
*/
|
|
2135
|
-
setOptions(
|
|
2136
|
-
return this.setDefaults(
|
|
2184
|
+
setOptions(e) {
|
|
2185
|
+
return this.setDefaults(e), this;
|
|
2137
2186
|
}
|
|
2138
2187
|
/**
|
|
2139
2188
|
* enables nodes draggable by user
|
|
2140
2189
|
*/
|
|
2141
|
-
enableUserDraggableNodes(
|
|
2142
|
-
return this.hasDraggableNode = !0, this.dragOptions =
|
|
2190
|
+
enableUserDraggableNodes(e) {
|
|
2191
|
+
return this.hasDraggableNode = !0, this.dragOptions = e, this;
|
|
2143
2192
|
}
|
|
2144
2193
|
/**
|
|
2145
2194
|
* enables viewport transformable by user
|
|
2146
2195
|
*/
|
|
2147
|
-
enableUserTransformableViewport(
|
|
2148
|
-
return this.hasTransformableViewport = !0, this.transformOptions =
|
|
2196
|
+
enableUserTransformableViewport(e) {
|
|
2197
|
+
return this.hasTransformableViewport = !0, this.transformOptions = e, this;
|
|
2149
2198
|
}
|
|
2150
2199
|
/**
|
|
2151
2200
|
* enables automatic edges update on node resize
|
|
@@ -2156,51 +2205,51 @@ class Bt {
|
|
|
2156
2205
|
/**
|
|
2157
2206
|
* sets emitter for rendering graph inside bounded area
|
|
2158
2207
|
*/
|
|
2159
|
-
enableBoxAreaRendering(
|
|
2160
|
-
return this.boxRenderingTrigger =
|
|
2208
|
+
enableBoxAreaRendering(e) {
|
|
2209
|
+
return this.boxRenderingTrigger = e, this;
|
|
2161
2210
|
}
|
|
2162
|
-
enableVirtualScroll(
|
|
2163
|
-
return this.virtualScrollOptions =
|
|
2211
|
+
enableVirtualScroll(e) {
|
|
2212
|
+
return this.virtualScrollOptions = e, this;
|
|
2164
2213
|
}
|
|
2165
2214
|
/**
|
|
2166
2215
|
* builds final canvas
|
|
2167
2216
|
*/
|
|
2168
2217
|
build() {
|
|
2169
|
-
let
|
|
2170
|
-
this.virtualScrollOptions !== void 0 &&
|
|
2171
|
-
const o = new
|
|
2172
|
-
let n = new
|
|
2173
|
-
|
|
2174
|
-
let h = new
|
|
2218
|
+
let e = this.boxRenderingTrigger;
|
|
2219
|
+
this.virtualScrollOptions !== void 0 && e === void 0 && (e = new te());
|
|
2220
|
+
const o = new Fe(), r = new Be();
|
|
2221
|
+
let n = new Ae(o, r);
|
|
2222
|
+
e !== void 0 && (n = new pe(n, o, e));
|
|
2223
|
+
let h = new ne(
|
|
2175
2224
|
o,
|
|
2176
2225
|
r,
|
|
2177
2226
|
n
|
|
2178
2227
|
);
|
|
2179
|
-
this.
|
|
2228
|
+
this.hasDraggableNode && (h = new de(
|
|
2180
2229
|
h,
|
|
2181
2230
|
this.dragOptions
|
|
2182
|
-
)), this.virtualScrollOptions !== void 0 ? h = new
|
|
2231
|
+
)), this.virtualScrollOptions !== void 0 ? h = new fe(
|
|
2183
2232
|
h,
|
|
2184
|
-
|
|
2233
|
+
e,
|
|
2185
2234
|
this.transformOptions,
|
|
2186
2235
|
this.virtualScrollOptions
|
|
2187
|
-
) : this.hasTransformableViewport && (h = new
|
|
2236
|
+
) : this.hasTransformableViewport && (h = new ee(
|
|
2188
2237
|
h,
|
|
2189
2238
|
this.transformOptions
|
|
2190
2239
|
));
|
|
2191
|
-
const s = new
|
|
2192
|
-
return this.reset(), s;
|
|
2240
|
+
const s = new We(h, this.canvasDefaults);
|
|
2241
|
+
return this.hasResizeReactiveNodes && j.configure(s), this.reset(), s;
|
|
2193
2242
|
}
|
|
2194
2243
|
reset() {
|
|
2195
2244
|
this.canvasDefaults = {}, this.dragOptions = void 0, this.transformOptions = void 0, this.virtualScrollOptions = void 0, this.hasDraggableNode = !1, this.hasTransformableViewport = !1, this.hasResizeReactiveNodes = !1, this.boxRenderingTrigger = void 0;
|
|
2196
2245
|
}
|
|
2197
2246
|
}
|
|
2198
2247
|
export {
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2248
|
+
De as BezierEdgeShape,
|
|
2249
|
+
ze as CanvasBuilder,
|
|
2250
|
+
te as EventSubject,
|
|
2251
|
+
Ce as HorizontalEdgeShape,
|
|
2203
2252
|
E as HtmlGraphError,
|
|
2204
|
-
|
|
2205
|
-
|
|
2253
|
+
Ue as StraightEdgeShape,
|
|
2254
|
+
$e as VerticalEdgeShape
|
|
2206
2255
|
};
|