@floegence/floe-webapp-core 0.86.12 → 0.86.13
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/components/graph/routing.js +217 -218
- package/package.json +1 -1
|
@@ -1,277 +1,276 @@
|
|
|
1
|
-
import { AvoidLib as
|
|
2
|
-
import
|
|
3
|
-
let
|
|
4
|
-
const
|
|
5
|
-
async function
|
|
6
|
-
const
|
|
7
|
-
if (!Number.isFinite(
|
|
1
|
+
import { AvoidLib as Y } from "../../node_modules/.pnpm/libavoid-js@0.5.0-beta.5/node_modules/libavoid-js/dist/index.js";
|
|
2
|
+
import tt from "../../node_modules/.pnpm/libavoid-js@0.5.0-beta.5/node_modules/libavoid-js/dist/libavoid.wasm.js";
|
|
3
|
+
let _;
|
|
4
|
+
const L = { NORTH: 1, SOUTH: 2, WEST: 4, EAST: 8 }, A = ["NORTH", "EAST", "SOUTH", "WEST"], S = (n) => n.delete();
|
|
5
|
+
async function et(n, o = {}) {
|
|
6
|
+
const a = o.edgeClearance ?? 4;
|
|
7
|
+
if (!Number.isFinite(a) || a < 0)
|
|
8
8
|
throw new Error("Graph edge clearance must be finite and nonnegative");
|
|
9
|
-
if (!
|
|
10
|
-
if (!
|
|
11
|
-
await (
|
|
12
|
-
throw
|
|
9
|
+
if (!n.nodes.length) return n;
|
|
10
|
+
if (!n.edges.length) return $(n);
|
|
11
|
+
await (_ ??= Y.load(tt).catch((r) => {
|
|
12
|
+
throw _ = void 0, r;
|
|
13
13
|
}));
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
for (let
|
|
17
|
-
|
|
18
|
-
return
|
|
19
|
-
},
|
|
20
|
-
for (const
|
|
21
|
-
const
|
|
22
|
-
|
|
14
|
+
const i = Y.getInstance(), h = new Map(n.nodes.map((r) => [r.id, r])), l = (r) => {
|
|
15
|
+
const c = [];
|
|
16
|
+
for (let s = h.get(r).parentId; s; s = h.get(s).parentId)
|
|
17
|
+
c.push(s);
|
|
18
|
+
return c;
|
|
19
|
+
}, f = /* @__PURE__ */ new Map();
|
|
20
|
+
for (const r of n.edges) {
|
|
21
|
+
const c = /* @__PURE__ */ new Set([...l(r.source), ...l(r.target)]), s = JSON.stringify([...c].sort()), M = f.get(s) ?? { open: c, edges: [] };
|
|
22
|
+
M.edges.push(r), f.set(s, M);
|
|
23
23
|
}
|
|
24
|
-
const
|
|
25
|
-
for (const { open:
|
|
26
|
-
const
|
|
24
|
+
const T = /* @__PURE__ */ new Map();
|
|
25
|
+
for (const { open: r, edges: c } of f.values()) {
|
|
26
|
+
const s = new i.Router(2);
|
|
27
27
|
try {
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
return
|
|
28
|
+
s.setRoutingParameter(i.RoutingParameter.shapeBufferDistance, a), s.setRoutingParameter(i.RoutingParameter.idealNudgingDistance, 8), s.setRoutingParameter(i.RoutingParameter.crossingPenalty, 80), s.setRoutingParameter(i.RoutingParameter.fixedSharedPathPenalty, 120), s.setRoutingParameter(i.RoutingParameter.portDirectionPenalty, 0), s.setRoutingOption(i.RoutingOption.nudgeOrthogonalSegmentsConnectedToShapes, !1), s.setRoutingOption(i.RoutingOption.nudgeSharedPathsWithCommonEndPoint, !0);
|
|
29
|
+
const M = new Map(
|
|
30
|
+
n.nodes.filter((t) => !r.has(t.id) && l(t.id).every((e) => r.has(e))).map((t) => {
|
|
31
|
+
const e = new i.Point(t.x, t.y), g = new i.Point(t.x + t.width, t.y + t.height), p = new i.Rectangle(e, g), x = new i.ShapeRef(s, p);
|
|
32
|
+
return S(e), S(g), S(p), [t.id, x];
|
|
33
33
|
})
|
|
34
|
-
),
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
offset: M
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
let U = b.length + 2;
|
|
54
|
-
const O = /* @__PURE__ */ new Map(), P = (n, x) => Math.max(0, Math.min(1, n / x));
|
|
55
|
-
for (const n of t.nodes) {
|
|
56
|
-
const x = u.get(n.id);
|
|
57
|
-
if (!x) continue;
|
|
58
|
-
const y = (a, h, g, f, w) => {
|
|
59
|
-
const M = new s.ShapeConnectionPin(
|
|
60
|
-
x,
|
|
61
|
-
a,
|
|
62
|
-
P(h, n.width),
|
|
63
|
-
P(g, n.height),
|
|
34
|
+
), O = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
|
|
35
|
+
for (const t of c) {
|
|
36
|
+
const e = [t.source, t.target].sort().join("\0"), g = O.get(e) ?? 0;
|
|
37
|
+
O.set(e, g + 1), E.set(t.id, g % 2 === 0 ? -6 : 6);
|
|
38
|
+
}
|
|
39
|
+
let Q = A.length + 2;
|
|
40
|
+
const B = /* @__PURE__ */ new Map(), b = (t, e) => Math.max(0, Math.min(1, t / e));
|
|
41
|
+
for (const t of n.nodes) {
|
|
42
|
+
const e = M.get(t.id);
|
|
43
|
+
if (!e) continue;
|
|
44
|
+
const g = (p, x, w, y, m) => {
|
|
45
|
+
const N = new i.ShapeConnectionPin(
|
|
46
|
+
e,
|
|
47
|
+
p,
|
|
48
|
+
b(x, t.width),
|
|
49
|
+
b(w, t.height),
|
|
64
50
|
!0,
|
|
65
51
|
0,
|
|
66
|
-
|
|
52
|
+
y
|
|
67
53
|
);
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
N.setExclusive(m), N.setConnectionCost(
|
|
55
|
+
t.width / 2 + t.height / 2 - Math.abs(x - t.width / 2) - Math.abs(w - t.height / 2)
|
|
70
56
|
);
|
|
71
57
|
};
|
|
72
|
-
for (const
|
|
73
|
-
const { x
|
|
74
|
-
y
|
|
58
|
+
for (const p of new Set(t.ports?.map((x) => x.side))) {
|
|
59
|
+
const { x, y: w } = q(t, p), y = A.indexOf(p) + 2;
|
|
60
|
+
g(y, x - t.x, w - t.y, L[p], !1), B.set(
|
|
75
61
|
JSON.stringify([
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
62
|
+
t.id,
|
|
63
|
+
b(x - t.x, t.width),
|
|
64
|
+
b(w - t.y, t.height),
|
|
65
|
+
p
|
|
80
66
|
]),
|
|
81
|
-
|
|
67
|
+
y
|
|
82
68
|
);
|
|
83
69
|
}
|
|
84
70
|
}
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
88
|
-
return new
|
|
89
|
-
|
|
90
|
-
|
|
71
|
+
const F = /* @__PURE__ */ new Map(), Z = n.nodes.filter((t) => M.has(t.id)), J = (t, e, g, p, x, w = !1) => {
|
|
72
|
+
const y = M.get(t.id);
|
|
73
|
+
if (y && g)
|
|
74
|
+
return new i.ConnEnd(
|
|
75
|
+
y,
|
|
76
|
+
A.indexOf(t.ports.find((d) => d.id === g).side) + 2
|
|
91
77
|
);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
78
|
+
const m = g ? [
|
|
79
|
+
{
|
|
80
|
+
side: t.ports.find((d) => d.id === g).side,
|
|
81
|
+
position: q(t, t.ports.find((d) => d.id === g).side)
|
|
82
|
+
}
|
|
83
|
+
] : x ? [{ side: "EAST", position: x }] : (w ? [K(t, e).source] : A).flatMap((d) => {
|
|
84
|
+
const P = nt(t, d, e, p);
|
|
85
|
+
if (w) return [{ side: d, position: P }];
|
|
86
|
+
const R = d === "NORTH" || d === "SOUTH", H = R ? t.x : t.y, v = R ? t.width : t.height, C = H + Math.min(8, v / 4), j = H + v - Math.min(8, v / 4);
|
|
87
|
+
return [
|
|
88
|
+
R ? P.x : P.y,
|
|
89
|
+
C,
|
|
90
|
+
j,
|
|
91
|
+
...Z.flatMap((u) => {
|
|
92
|
+
const k = R ? u.x : u.y, X = k + (R ? u.width : u.height);
|
|
93
|
+
return [k - a, X + a, k - a - 8, X + a + 8];
|
|
94
|
+
}).filter((u) => u >= C && u <= j)
|
|
95
|
+
].map((u) => ({
|
|
96
|
+
side: d,
|
|
97
|
+
position: R ? { x: u, y: P.y } : { x: P.x, y: u }
|
|
98
|
+
}));
|
|
99
|
+
});
|
|
100
|
+
if (y) {
|
|
101
|
+
const d = (v, C) => JSON.stringify([
|
|
102
|
+
t.id,
|
|
103
|
+
b(C.x - t.x, t.width),
|
|
104
|
+
b(C.y - t.y, t.height),
|
|
105
|
+
v
|
|
106
|
+
]), P = !!(g || x || w), R = P ? B.get(d(m[0].side, m[0].position)) : F.get(t.id);
|
|
107
|
+
if (P && R !== void 0) return new i.ConnEnd(y, R);
|
|
108
|
+
const H = R ?? Q++;
|
|
109
|
+
P || F.set(t.id, H);
|
|
110
|
+
for (const { side: v, position: C } of m) {
|
|
111
|
+
const j = d(v, C);
|
|
112
|
+
if (B.has(j)) continue;
|
|
113
|
+
B.set(j, H);
|
|
114
|
+
const D = C.x - t.x, u = C.y - t.y, k = new i.ShapeConnectionPin(
|
|
115
|
+
y,
|
|
116
|
+
H,
|
|
117
|
+
b(D, t.width),
|
|
118
|
+
b(u, t.height),
|
|
119
|
+
!0,
|
|
120
|
+
0,
|
|
121
|
+
L[v]
|
|
122
|
+
);
|
|
123
|
+
k.setExclusive(!1), k.setConnectionCost(
|
|
124
|
+
t.width / 2 + t.height / 2 - Math.abs(D - t.width / 2) - Math.abs(u - t.height / 2)
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
return new i.ConnEnd(y, H);
|
|
105
128
|
}
|
|
106
|
-
const
|
|
107
|
-
return
|
|
108
|
-
},
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
const N = K(t, e).source, G = m.find((d) => d.side === N)?.position ?? m[0].position, W = new i.Point(G.x, G.y), z = new i.ConnEnd(W);
|
|
130
|
+
return S(W), z;
|
|
131
|
+
}, V = (t) => +!!(t.sourcePort || t.targetPort || t.source === t.target || O.get([t.source, t.target].sort().join("\0")) > 1), I = [...c].sort((t, e) => V(e) - V(t)).map((t) => {
|
|
132
|
+
const e = h.get(t.source), g = h.get(t.target), p = t.source === t.target, x = O.get([t.source, t.target].sort().join("\0")) > 1, w = J(
|
|
133
|
+
e,
|
|
134
|
+
g,
|
|
135
|
+
t.sourcePort,
|
|
136
|
+
E.get(t.id),
|
|
137
|
+
p ? { x: e.x + e.width, y: e.y + e.height / 3 } : void 0,
|
|
138
|
+
x
|
|
139
|
+
), y = J(
|
|
140
|
+
g,
|
|
141
|
+
e,
|
|
142
|
+
t.targetPort,
|
|
143
|
+
E.get(t.id),
|
|
144
|
+
p ? {
|
|
145
|
+
x: g.x + g.width,
|
|
146
|
+
y: g.y + g.height * 2 / 3
|
|
147
|
+
} : void 0,
|
|
148
|
+
x
|
|
149
|
+
), m = new i.ConnRef(s, w, y);
|
|
150
|
+
if (S(w), S(y), p) {
|
|
151
|
+
const N = new i.CheckpointVector();
|
|
152
|
+
for (const G of [
|
|
153
|
+
e.y + e.height / 3,
|
|
154
|
+
e.y + e.height * 2 / 3
|
|
155
|
+
]) {
|
|
156
|
+
const W = new i.Point(
|
|
157
|
+
e.x + e.width + Math.max(24, a + 4),
|
|
158
|
+
G
|
|
159
|
+
), z = new i.Checkpoint(W);
|
|
160
|
+
N.push_back(z), S(W), S(z);
|
|
128
161
|
}
|
|
129
|
-
|
|
162
|
+
m.setRoutingCheckpoints(N), S(N);
|
|
130
163
|
}
|
|
131
|
-
return { edge:
|
|
164
|
+
return { edge: t, connection: m };
|
|
132
165
|
});
|
|
133
|
-
|
|
134
|
-
for (const { edge:
|
|
135
|
-
const
|
|
136
|
-
const
|
|
137
|
-
return
|
|
166
|
+
s.processTransaction();
|
|
167
|
+
for (const { edge: t, connection: e } of I) {
|
|
168
|
+
const g = e.displayRoute(), p = Array.from({ length: g.size() }, (x, w) => {
|
|
169
|
+
const y = g.at(w), m = { x: y.x, y: y.y };
|
|
170
|
+
return S(y), m;
|
|
138
171
|
});
|
|
139
|
-
if (
|
|
140
|
-
throw new Error(`Graph edge cannot be routed: ${
|
|
141
|
-
|
|
172
|
+
if (S(g), !e.hasValidRoute() || p.length < 2 || p.some((x) => !Number.isFinite(x.x) || !Number.isFinite(x.y)) || p.some((x, w) => w > 0 && x.x !== p[w - 1].x && x.y !== p[w - 1].y))
|
|
173
|
+
throw new Error(`Graph edge cannot be routed: ${t.id}`);
|
|
174
|
+
T.set(t.id, p);
|
|
142
175
|
}
|
|
143
176
|
} finally {
|
|
144
|
-
|
|
177
|
+
s.delete();
|
|
145
178
|
}
|
|
146
179
|
}
|
|
147
|
-
const
|
|
148
|
-
return
|
|
149
|
-
nodes:
|
|
150
|
-
edges:
|
|
151
|
-
bounds:
|
|
180
|
+
const U = n.edges.map((r) => ({ ...r, sections: [T.get(r.id)] }));
|
|
181
|
+
return $({
|
|
182
|
+
nodes: n.nodes,
|
|
183
|
+
edges: U,
|
|
184
|
+
bounds: n.bounds
|
|
152
185
|
});
|
|
153
186
|
}
|
|
154
|
-
function
|
|
155
|
-
const
|
|
156
|
-
...
|
|
157
|
-
{ x:
|
|
158
|
-
{ x:
|
|
187
|
+
function $(n) {
|
|
188
|
+
const o = [
|
|
189
|
+
...n.nodes.flatMap((h) => [
|
|
190
|
+
{ x: h.x, y: h.y },
|
|
191
|
+
{ x: h.x + h.width, y: h.y + h.height }
|
|
159
192
|
]),
|
|
160
|
-
...
|
|
161
|
-
],
|
|
193
|
+
...n.edges.flatMap((h) => h.sections.flat())
|
|
194
|
+
], a = Math.min(...o.map((h) => h.x)), i = Math.min(...o.map((h) => h.y));
|
|
162
195
|
return {
|
|
163
|
-
nodes:
|
|
164
|
-
edges:
|
|
196
|
+
nodes: n.nodes,
|
|
197
|
+
edges: n.edges,
|
|
165
198
|
bounds: {
|
|
166
|
-
x:
|
|
167
|
-
y:
|
|
168
|
-
width: Math.max(...
|
|
169
|
-
height: Math.max(...
|
|
199
|
+
x: a,
|
|
200
|
+
y: i,
|
|
201
|
+
width: Math.max(...o.map((h) => h.x)) - a,
|
|
202
|
+
height: Math.max(...o.map((h) => h.y)) - i
|
|
170
203
|
}
|
|
171
204
|
};
|
|
172
205
|
}
|
|
173
|
-
function
|
|
206
|
+
function q(n, o) {
|
|
174
207
|
return {
|
|
175
|
-
x:
|
|
176
|
-
y:
|
|
208
|
+
x: o === "WEST" ? n.x : o === "EAST" ? n.x + n.width : n.x + n.width / 2,
|
|
209
|
+
y: o === "NORTH" ? n.y : o === "SOUTH" ? n.y + n.height : n.y + n.height / 2
|
|
177
210
|
};
|
|
178
211
|
}
|
|
179
|
-
function
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
const H = (o, e, i) => i === "NORTH" ? e.x === o.x && e.y < o.y : i === "SOUTH" ? e.x === o.x && e.y > o.y : i === "WEST" ? e.y === o.y && e.x < o.x : e.y === o.y && e.x > o.x;
|
|
190
|
-
for (const o of m ? [m] : b)
|
|
191
|
-
for (const e of d ? [d] : b) {
|
|
192
|
-
const i = m ? W(t, o) : k(t, o, c, r), u = d ? W(c, e) : k(c, e, t, r), v = i.x === u.x || i.y === u.y ? [[i, u]] : [
|
|
193
|
-
[i, { x: u.x, y: i.y }, u],
|
|
194
|
-
[i, { x: i.x, y: u.y }, u]
|
|
195
|
-
];
|
|
196
|
-
for (const l of v) {
|
|
197
|
-
if (p.includes(t) && !H(i, l[1], o) || p.includes(c) && !H(u, l.at(-2), e) || l.slice(1).some((O, P) => {
|
|
198
|
-
const C = l[P];
|
|
199
|
-
return p.some(
|
|
200
|
-
(N) => Math.max(C.x, O.x) > N.x && Math.min(C.x, O.x) < N.x + N.width && Math.max(C.y, O.y) > N.y && Math.min(C.y, O.y) < N.y + N.height
|
|
201
|
-
);
|
|
202
|
-
}))
|
|
203
|
-
continue;
|
|
204
|
-
const U = l.slice(1).reduce(
|
|
205
|
-
(O, P, C) => O + Math.abs(P.x - l[C].x) + Math.abs(P.y - l[C].y),
|
|
206
|
-
0
|
|
207
|
-
) + (l.length - 2) * 32 + (o === s.source ? 0 : 16) + (e === s.target ? 0 : 16);
|
|
208
|
-
(!S || U < S.score) && (S = { source: o, target: e, score: U });
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return S;
|
|
212
|
-
}
|
|
213
|
-
function z(t, c) {
|
|
214
|
-
const p = (e, i) => i.x >= e.x && i.y >= e.y && i.x + i.width <= e.x + e.width && i.y + i.height <= e.y + e.height, s = p(t, c) ? t : p(c, t) ? c : void 0;
|
|
215
|
-
if (s) {
|
|
216
|
-
const e = s === t ? c : t, i = {
|
|
217
|
-
NORTH: e.y - s.y,
|
|
218
|
-
EAST: s.x + s.width - e.x - e.width,
|
|
219
|
-
SOUTH: s.y + s.height - e.y - e.height,
|
|
220
|
-
WEST: e.x - s.x
|
|
221
|
-
}, u = [...b].sort((v, l) => i[v] - i[l])[0];
|
|
222
|
-
return { source: u, target: u };
|
|
212
|
+
function K(n, o) {
|
|
213
|
+
const a = (c, s) => s.x >= c.x && s.y >= c.y && s.x + s.width <= c.x + c.width && s.y + s.height <= c.y + c.height, i = a(n, o) ? n : a(o, n) ? o : void 0;
|
|
214
|
+
if (i) {
|
|
215
|
+
const c = i === n ? o : n, s = {
|
|
216
|
+
NORTH: c.y - i.y,
|
|
217
|
+
EAST: i.x + i.width - c.x - c.width,
|
|
218
|
+
SOUTH: i.y + i.height - c.y - c.height,
|
|
219
|
+
WEST: c.x - i.x
|
|
220
|
+
}, M = [...A].sort((O, E) => s[O] - s[E])[0];
|
|
221
|
+
return { source: M, target: M };
|
|
223
222
|
}
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
const h = o.x + o.width / 2 - (n.x + n.width / 2), l = o.y + o.height / 2 - (n.y + n.height / 2), f = Math.max(n.x - (o.x + o.width), o.x - (n.x + n.width), 0), T = Math.max(
|
|
224
|
+
n.y - (o.y + o.height),
|
|
225
|
+
o.y - (n.y + n.height),
|
|
227
226
|
0
|
|
228
|
-
),
|
|
229
|
-
return { source:
|
|
227
|
+
), r = (T === 0 && f > 0 ? !0 : f === 0 && T > 0 ? !1 : f === 0 && T === 0 ? Math.abs(h) >= Math.abs(l) : f <= T) ? h >= 0 ? "EAST" : "WEST" : l >= 0 ? "SOUTH" : "NORTH";
|
|
228
|
+
return { source: r, target: A[(A.indexOf(r) + 2) % 4] };
|
|
230
229
|
}
|
|
231
|
-
function
|
|
232
|
-
const
|
|
233
|
-
const
|
|
234
|
-
return
|
|
235
|
-
},
|
|
236
|
-
switch (
|
|
230
|
+
function nt(n, o, a, i = 0) {
|
|
231
|
+
const h = (r) => Math.min(8, r / 4), l = (r, c, s) => Math.max(c + h(s), Math.min(c + s - h(s), r)), f = (r, c, s, M) => {
|
|
232
|
+
const O = Math.max(r, s), E = Math.min(r + c, s + M);
|
|
233
|
+
return O < E ? (O + E) / 2 + i : void 0;
|
|
234
|
+
}, T = a.x + a.width / 2, U = a.y + a.height / 2;
|
|
235
|
+
switch (o) {
|
|
237
236
|
case "NORTH":
|
|
238
237
|
return {
|
|
239
|
-
x:
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
238
|
+
x: l(
|
|
239
|
+
f(n.x, n.width, a.x, a.width) ?? T + i,
|
|
240
|
+
n.x,
|
|
241
|
+
n.width
|
|
243
242
|
),
|
|
244
|
-
y:
|
|
243
|
+
y: n.y
|
|
245
244
|
};
|
|
246
245
|
case "EAST":
|
|
247
246
|
return {
|
|
248
|
-
x:
|
|
249
|
-
y:
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
247
|
+
x: n.x + n.width,
|
|
248
|
+
y: l(
|
|
249
|
+
f(n.y, n.height, a.y, a.height) ?? U + i,
|
|
250
|
+
n.y,
|
|
251
|
+
n.height
|
|
253
252
|
)
|
|
254
253
|
};
|
|
255
254
|
case "SOUTH":
|
|
256
255
|
return {
|
|
257
|
-
x:
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
256
|
+
x: l(
|
|
257
|
+
f(n.x, n.width, a.x, a.width) ?? T + i,
|
|
258
|
+
n.x,
|
|
259
|
+
n.width
|
|
261
260
|
),
|
|
262
|
-
y:
|
|
261
|
+
y: n.y + n.height
|
|
263
262
|
};
|
|
264
263
|
case "WEST":
|
|
265
264
|
return {
|
|
266
|
-
x:
|
|
267
|
-
y:
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
265
|
+
x: n.x,
|
|
266
|
+
y: l(
|
|
267
|
+
f(n.y, n.height, a.y, a.height) ?? U + i,
|
|
268
|
+
n.y,
|
|
269
|
+
n.height
|
|
271
270
|
)
|
|
272
271
|
};
|
|
273
272
|
}
|
|
274
273
|
}
|
|
275
274
|
export {
|
|
276
|
-
|
|
275
|
+
et as routeGraphGeometry
|
|
277
276
|
};
|