vue3-network-graph 0.1.9 → 0.2.2
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/README.en.md +2 -2
- package/README.md +2 -2
- package/dist/index.d.ts +59 -3
- package/dist/index.mjs +787 -706
- package/dist/index.umd.cjs +5 -5
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createStaticVNode as a, getCurrentInstance as o, normalizeClass as s, normalizeStyle as c, onBeforeUnmount as l, onMounted as u, openBlock as d, ref as f, renderList as p, renderSlot as m, toDisplayString as h, unref as ee, watch as
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createStaticVNode as a, getCurrentInstance as o, normalizeClass as s, normalizeStyle as c, onBeforeUnmount as l, onMounted as u, openBlock as d, ref as f, renderList as p, renderSlot as m, toDisplayString as h, unref as ee, watch as te, watchEffect as ne, withModifiers as g } from "vue";
|
|
2
2
|
//#region node_modules/uuid/dist/stringify.js
|
|
3
|
-
var
|
|
4
|
-
for (let e = 0; e < 256; ++e)
|
|
5
|
-
function
|
|
6
|
-
return (
|
|
3
|
+
var _ = [];
|
|
4
|
+
for (let e = 0; e < 256; ++e) _.push((e + 256).toString(16).slice(1));
|
|
5
|
+
function re(e, t = 0) {
|
|
6
|
+
return (_[e[t + 0]] + _[e[t + 1]] + _[e[t + 2]] + _[e[t + 3]] + "-" + _[e[t + 4]] + _[e[t + 5]] + "-" + _[e[t + 6]] + _[e[t + 7]] + "-" + _[e[t + 8]] + _[e[t + 9]] + "-" + _[e[t + 10]] + _[e[t + 11]] + _[e[t + 12]] + _[e[t + 13]] + _[e[t + 14]] + _[e[t + 15]]).toLowerCase();
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region node_modules/uuid/dist/rng.js
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
return crypto.getRandomValues(
|
|
10
|
+
var ie = /* @__PURE__ */ new Uint8Array(16);
|
|
11
|
+
function v() {
|
|
12
|
+
return crypto.getRandomValues(ie);
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region node_modules/uuid/dist/v4.js
|
|
16
|
-
function
|
|
17
|
-
return !t && !e && crypto.randomUUID ? crypto.randomUUID() :
|
|
16
|
+
function ae(e, t, n) {
|
|
17
|
+
return !t && !e && crypto.randomUUID ? crypto.randomUUID() : y(e, t, n);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function y(e, t, n) {
|
|
20
20
|
e ||= {};
|
|
21
|
-
let r = e.random ?? e.rng?.() ??
|
|
21
|
+
let r = e.random ?? e.rng?.() ?? v();
|
|
22
22
|
if (r.length < 16) throw Error("Random bytes length must be >= 16");
|
|
23
23
|
if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, t) {
|
|
24
24
|
if (n ||= 0, n < 0 || n + 16 > t.length) throw RangeError(`UUID byte range ${n}:${n + 15} is out of buffer bounds`);
|
|
25
25
|
for (let e = 0; e < 16; ++e) t[n + e] = r[e];
|
|
26
26
|
return t;
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return re(r);
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/components/topology-data.js
|
|
32
|
-
var
|
|
32
|
+
var b = {
|
|
33
33
|
normal: {
|
|
34
34
|
color: "#4ade80",
|
|
35
35
|
label: "Running"
|
|
@@ -70,7 +70,7 @@ var x = {
|
|
|
70
70
|
color: "#64748b",
|
|
71
71
|
label: "Idle"
|
|
72
72
|
}
|
|
73
|
-
},
|
|
73
|
+
}, oe = {
|
|
74
74
|
core: "#00f0ff",
|
|
75
75
|
firewall: "#ff6b35",
|
|
76
76
|
loadbalancer: "#a855f7",
|
|
@@ -80,44 +80,40 @@ var x = {
|
|
|
80
80
|
cache: "#f43f5e",
|
|
81
81
|
queue: "#fb923c",
|
|
82
82
|
text: "#94a3b8"
|
|
83
|
-
},
|
|
83
|
+
}, se = ["viewBox"], ce = [
|
|
84
84
|
"cx",
|
|
85
85
|
"cy",
|
|
86
86
|
"r"
|
|
87
|
-
],
|
|
87
|
+
], le = [
|
|
88
88
|
"offset",
|
|
89
89
|
"stop-color",
|
|
90
90
|
"stop-opacity"
|
|
91
|
-
],
|
|
91
|
+
], ue = ["id"], de = ["stop-color"], fe = ["stop-color"], pe = ["stop-color"], me = ["id"], he = ["fill"], ge = ["id"], _e = ["fill"], ve = [
|
|
92
92
|
"width",
|
|
93
93
|
"height",
|
|
94
94
|
"x",
|
|
95
95
|
"y"
|
|
96
|
-
],
|
|
96
|
+
], ye = ["width", "height"], be = ["d", "stroke"], xe = [
|
|
97
97
|
"width",
|
|
98
98
|
"height",
|
|
99
99
|
"x",
|
|
100
100
|
"y",
|
|
101
101
|
"opacity"
|
|
102
|
-
],
|
|
102
|
+
], Se = {
|
|
103
103
|
key: 1,
|
|
104
104
|
class: "center-crosshair"
|
|
105
|
-
},
|
|
105
|
+
}, Ce = [
|
|
106
106
|
"x",
|
|
107
107
|
"y",
|
|
108
108
|
"width",
|
|
109
109
|
"height",
|
|
110
110
|
"fill"
|
|
111
|
-
],
|
|
111
|
+
], we = [
|
|
112
112
|
"x",
|
|
113
113
|
"y",
|
|
114
114
|
"width",
|
|
115
115
|
"height",
|
|
116
116
|
"stroke"
|
|
117
|
-
], we = [
|
|
118
|
-
"cx",
|
|
119
|
-
"cy",
|
|
120
|
-
"fill"
|
|
121
117
|
], Te = [
|
|
122
118
|
"cx",
|
|
123
119
|
"cy",
|
|
@@ -131,22 +127,26 @@ var x = {
|
|
|
131
127
|
"cy",
|
|
132
128
|
"fill"
|
|
133
129
|
], Oe = [
|
|
130
|
+
"cx",
|
|
131
|
+
"cy",
|
|
132
|
+
"fill"
|
|
133
|
+
], ke = [
|
|
134
134
|
"x",
|
|
135
135
|
"y",
|
|
136
136
|
"transform",
|
|
137
137
|
"fill"
|
|
138
|
-
],
|
|
138
|
+
], Ae = {
|
|
139
139
|
key: 2,
|
|
140
140
|
class: "node-base-layer",
|
|
141
141
|
"pointer-events": "none"
|
|
142
|
-
},
|
|
142
|
+
}, je = ["transform"], Me = [
|
|
143
143
|
"x",
|
|
144
144
|
"y",
|
|
145
145
|
"width",
|
|
146
146
|
"height",
|
|
147
147
|
"rx",
|
|
148
148
|
"fill"
|
|
149
|
-
],
|
|
149
|
+
], Ne = [
|
|
150
150
|
"x",
|
|
151
151
|
"y",
|
|
152
152
|
"width",
|
|
@@ -155,71 +155,91 @@ var x = {
|
|
|
155
155
|
"stroke",
|
|
156
156
|
"stroke-width",
|
|
157
157
|
"stroke-dasharray"
|
|
158
|
-
],
|
|
158
|
+
], Pe = [
|
|
159
|
+
"d",
|
|
160
|
+
"stroke",
|
|
161
|
+
"opacity",
|
|
162
|
+
"marker-end"
|
|
163
|
+
], Fe = ["d", "stroke"], Ie = ["d", "stroke"], Le = { key: 0 }, Re = ["d", "stroke"], ze = ["dur"], Be = ["d", "stroke"], Ve = ["dur"], He = ["d", "stroke"], Ue = ["dur"], We = [
|
|
164
|
+
"d",
|
|
165
|
+
"stroke",
|
|
166
|
+
"stroke-width",
|
|
167
|
+
"stroke-dasharray",
|
|
168
|
+
"marker-end"
|
|
169
|
+
], Ge = ["to", "dur"], Ke = { key: 0 }, qe = ["fill"], Je = ["path", "dur"], Ye = ["fill"], Xe = ["path", "dur"], Ze = ["transform"], Qe = [
|
|
159
170
|
"y",
|
|
160
171
|
"height",
|
|
161
172
|
"stroke"
|
|
162
|
-
],
|
|
173
|
+
], $e = ["font-size", "fill"], et = { key: 1 }, tt = ["transform"], nt = [
|
|
163
174
|
"x",
|
|
164
175
|
"y",
|
|
165
176
|
"width",
|
|
166
177
|
"height",
|
|
167
178
|
"fill",
|
|
168
|
-
"
|
|
169
|
-
|
|
179
|
+
"opacity",
|
|
180
|
+
"stroke",
|
|
181
|
+
"stroke-opacity",
|
|
182
|
+
"stroke-dasharray"
|
|
183
|
+
], rt = ["font-size", "fill"], it = ["transform"], at = [
|
|
170
184
|
"x",
|
|
171
185
|
"y",
|
|
172
186
|
"width",
|
|
173
187
|
"height",
|
|
174
188
|
"fill",
|
|
175
|
-
"
|
|
176
|
-
|
|
189
|
+
"opacity",
|
|
190
|
+
"stroke",
|
|
191
|
+
"stroke-opacity",
|
|
192
|
+
"stroke-dasharray"
|
|
193
|
+
], ot = ["font-size", "fill"], st = ["transform"], ct = [
|
|
177
194
|
"x",
|
|
178
195
|
"y",
|
|
179
196
|
"width",
|
|
180
197
|
"height",
|
|
181
198
|
"fill",
|
|
182
|
-
"
|
|
183
|
-
|
|
199
|
+
"opacity",
|
|
200
|
+
"stroke",
|
|
201
|
+
"stroke-opacity",
|
|
202
|
+
"stroke-dasharray"
|
|
203
|
+
], lt = ["font-size", "fill"], ut = { key: 3 }, dt = [
|
|
184
204
|
"x1",
|
|
185
205
|
"y1",
|
|
186
206
|
"x2",
|
|
187
207
|
"y2",
|
|
188
208
|
"stroke"
|
|
189
|
-
],
|
|
209
|
+
], ft = [
|
|
190
210
|
"cx",
|
|
191
211
|
"cy",
|
|
192
212
|
"fill"
|
|
193
|
-
],
|
|
213
|
+
], pt = [
|
|
194
214
|
"x",
|
|
195
215
|
"y",
|
|
196
216
|
"width",
|
|
197
217
|
"height",
|
|
198
218
|
"stroke"
|
|
199
|
-
],
|
|
219
|
+
], mt = ["d", "onClick"], ht = [
|
|
200
220
|
"transform",
|
|
201
221
|
"onMousedown",
|
|
202
222
|
"onClick"
|
|
203
|
-
],
|
|
223
|
+
], gt = [
|
|
204
224
|
"x",
|
|
205
225
|
"y",
|
|
206
226
|
"width",
|
|
207
227
|
"height",
|
|
208
228
|
"rx",
|
|
209
229
|
"stroke-width"
|
|
210
|
-
],
|
|
230
|
+
], _t = [
|
|
211
231
|
"x",
|
|
212
232
|
"y",
|
|
213
233
|
"width",
|
|
214
234
|
"height"
|
|
215
|
-
],
|
|
235
|
+
], vt = [
|
|
216
236
|
"x",
|
|
217
237
|
"y",
|
|
218
238
|
"width",
|
|
219
239
|
"height",
|
|
220
240
|
"rx",
|
|
221
241
|
"fill"
|
|
222
|
-
],
|
|
242
|
+
], yt = [
|
|
223
243
|
"x",
|
|
224
244
|
"y",
|
|
225
245
|
"width",
|
|
@@ -228,63 +248,63 @@ var x = {
|
|
|
228
248
|
"stroke",
|
|
229
249
|
"stroke-width",
|
|
230
250
|
"stroke-dasharray"
|
|
231
|
-
],
|
|
251
|
+
], bt = [
|
|
232
252
|
"x",
|
|
233
253
|
"y",
|
|
234
254
|
"width",
|
|
235
255
|
"height",
|
|
236
256
|
"rx",
|
|
237
257
|
"stroke"
|
|
238
|
-
],
|
|
258
|
+
], xt = [
|
|
239
259
|
"transform",
|
|
240
260
|
"fill",
|
|
241
261
|
"font-size"
|
|
242
|
-
],
|
|
262
|
+
], St = ["dy"], Ct = ["r", "stroke"], wt = ["values"], Tt = [
|
|
243
263
|
"x",
|
|
244
264
|
"y",
|
|
245
265
|
"width",
|
|
246
266
|
"height",
|
|
247
267
|
"preserveAspectRatio"
|
|
248
|
-
],
|
|
268
|
+
], Et = [
|
|
249
269
|
"href",
|
|
250
270
|
"x",
|
|
251
271
|
"y",
|
|
252
272
|
"width",
|
|
253
273
|
"height"
|
|
254
|
-
],
|
|
274
|
+
], Dt = ["transform"], Ot = ["fill"], kt = ["transform"], At = ["fill"], jt = [
|
|
255
275
|
"y",
|
|
256
276
|
"transform",
|
|
257
277
|
"fill",
|
|
258
278
|
"font-size",
|
|
259
279
|
"font-weight"
|
|
260
|
-
],
|
|
280
|
+
], Mt = ["dy"], Nt = {
|
|
261
281
|
key: 8,
|
|
262
282
|
class: "node-handles"
|
|
263
|
-
},
|
|
283
|
+
}, Pt = [
|
|
264
284
|
"cx",
|
|
265
285
|
"cy",
|
|
266
286
|
"stroke",
|
|
267
287
|
"onPointerdown"
|
|
268
|
-
],
|
|
288
|
+
], Ft = {
|
|
269
289
|
key: 4,
|
|
270
290
|
class: "node-resize-layer"
|
|
271
|
-
},
|
|
291
|
+
}, It = [
|
|
272
292
|
"x",
|
|
273
293
|
"y",
|
|
274
294
|
"onMousedown"
|
|
275
|
-
],
|
|
295
|
+
], Lt = {
|
|
276
296
|
key: 0,
|
|
277
297
|
"pointer-events": "none"
|
|
278
|
-
},
|
|
298
|
+
}, Rt = [
|
|
279
299
|
"d",
|
|
280
300
|
"stroke",
|
|
281
301
|
"marker-end"
|
|
282
|
-
],
|
|
302
|
+
], zt = [
|
|
283
303
|
"x",
|
|
284
304
|
"y",
|
|
285
305
|
"width",
|
|
286
306
|
"height"
|
|
287
|
-
],
|
|
307
|
+
], Bt = 6, Vt = 14, Ht = 3, x = 60, Ut = .2, Wt = 5, Gt = 160, Kt = 140, qt = 12, Jt = 4e3, Yt = 12, Xt = 4e3, Zt = 45, Qt = {
|
|
288
308
|
__name: "Topology",
|
|
289
309
|
props: {
|
|
290
310
|
nodes: {
|
|
@@ -342,10 +362,10 @@ var x = {
|
|
|
342
362
|
"node-resize-end",
|
|
343
363
|
"delete-request"
|
|
344
364
|
],
|
|
345
|
-
setup(
|
|
346
|
-
let
|
|
347
|
-
|
|
348
|
-
},
|
|
365
|
+
setup(_, { expose: re, emit: ie }) {
|
|
366
|
+
let v = _, y = ie, Qt = 0, $t = () => {
|
|
367
|
+
Qt++;
|
|
368
|
+
}, en = (e) => e && typeof e == "object" ? {
|
|
349
369
|
text: e.text,
|
|
350
370
|
rotation: e.rotation || 0,
|
|
351
371
|
fontSize: e.fontSize,
|
|
@@ -355,147 +375,147 @@ var x = {
|
|
|
355
375
|
rotation: 0,
|
|
356
376
|
fontSize: void 0,
|
|
357
377
|
color: void 0
|
|
358
|
-
},
|
|
359
|
-
|
|
378
|
+
}, tn = (e, t = 11) => e.fontSize || t, nn = (e) => e.fontColor || "#000000", rn = (e, t = 500) => e.fontWeight || t, an = (e, t) => e.fontSize || en(t).fontSize || 8, on = (e, t) => e.fontColor || en(t).color || t != null && t === e.centerText && gi.value || "#000000", S = f(v.nodes.map((e) => ({ ...e }))), sn = null, C = () => {
|
|
379
|
+
sn = S.value, y("update:nodes", S.value);
|
|
360
380
|
};
|
|
361
|
-
|
|
381
|
+
te(() => v.nodes, (e) => {
|
|
362
382
|
let t = Array.isArray(e) ? e : [];
|
|
363
|
-
if (t ===
|
|
383
|
+
if (t === sn) return;
|
|
364
384
|
let n = null, r = null;
|
|
365
385
|
try {
|
|
366
|
-
n = JSON.stringify(t), r = JSON.stringify(
|
|
386
|
+
n = JSON.stringify(t), r = JSON.stringify(S.value);
|
|
367
387
|
} catch {
|
|
368
388
|
n = null;
|
|
369
389
|
}
|
|
370
|
-
(n === null || n !== r) && (
|
|
390
|
+
(n === null || n !== r) && ($t(), S.value = t.map((e) => ({ ...e })));
|
|
371
391
|
}, { deep: !0 });
|
|
372
|
-
let
|
|
373
|
-
|
|
374
|
-
|
|
392
|
+
let cn = f(v.lineMode);
|
|
393
|
+
te(() => v.lineMode, (e) => {
|
|
394
|
+
cn.value = e;
|
|
375
395
|
});
|
|
376
|
-
let
|
|
377
|
-
get: () =>
|
|
396
|
+
let w = t({
|
|
397
|
+
get: () => cn.value,
|
|
378
398
|
set: (e) => {
|
|
379
|
-
|
|
399
|
+
cn.value = e, y("update:lineMode", e);
|
|
380
400
|
}
|
|
381
|
-
}),
|
|
401
|
+
}), T = f(null), E = f(null), ln = f({
|
|
382
402
|
x: 0,
|
|
383
403
|
y: 0
|
|
384
|
-
}),
|
|
385
|
-
let e =
|
|
386
|
-
if (
|
|
404
|
+
}), un = f(null), dn = null, fn = !1, pn = !1, D = f([]), O = f(/* @__PURE__ */ new Map()), k = f(/* @__PURE__ */ new Set()), A = t(() => {
|
|
405
|
+
let e = v.edges, t = [];
|
|
406
|
+
if (D.value.length) {
|
|
387
407
|
let n = new Set(e.map((e) => e.id));
|
|
388
|
-
t =
|
|
408
|
+
t = D.value.filter((e) => !n.has(e.id));
|
|
389
409
|
}
|
|
390
|
-
let n = t.length ? [...e, ...t] : e, r =
|
|
410
|
+
let n = t.length ? [...e, ...t] : e, r = O.value;
|
|
391
411
|
r.size && (n = n.map((e) => r.has(e.id) ? {
|
|
392
412
|
...e,
|
|
393
413
|
...r.get(e.id)
|
|
394
414
|
} : e));
|
|
395
|
-
let i = new Set(
|
|
415
|
+
let i = new Set(S.value.map((e) => e.id)), a = k.value;
|
|
396
416
|
return n.filter((e) => !a.has(e.id) && i.has(e.from) && i.has(e.to));
|
|
397
|
-
}),
|
|
417
|
+
}), mn = t(() => v.config.watchDataChanges === !0), hn = f({
|
|
398
418
|
nodes: [],
|
|
399
419
|
edges: []
|
|
400
|
-
}),
|
|
401
|
-
nodes:
|
|
402
|
-
edges:
|
|
403
|
-
})),
|
|
420
|
+
}), gn = "", j = null, _n = () => JSON.parse(JSON.stringify({
|
|
421
|
+
nodes: S.value,
|
|
422
|
+
edges: A.value
|
|
423
|
+
})), vn = (e, t) => {
|
|
404
424
|
let n = new Map(e.map((e) => [e.id, e])), r = new Map(t.map((e) => [e.id, e]));
|
|
405
425
|
return {
|
|
406
426
|
added: t.filter((e) => !n.has(e.id)).map((e) => e.id),
|
|
407
427
|
removed: e.filter((e) => !r.has(e.id)).map((e) => e.id),
|
|
408
428
|
updated: t.filter((e) => n.has(e.id) && JSON.stringify(n.get(e.id)) !== JSON.stringify(e)).map((e) => e.id)
|
|
409
429
|
};
|
|
410
|
-
},
|
|
411
|
-
nodes:
|
|
412
|
-
edges:
|
|
413
|
-
}),
|
|
414
|
-
if (
|
|
415
|
-
let e =
|
|
416
|
-
if (t ===
|
|
417
|
-
let n =
|
|
418
|
-
|
|
430
|
+
}, yn = (e) => ({
|
|
431
|
+
nodes: vn(hn.value.nodes, e.nodes),
|
|
432
|
+
edges: vn(hn.value.edges, e.edges)
|
|
433
|
+
}), bn = () => {
|
|
434
|
+
if (j = null, !mn.value) return;
|
|
435
|
+
let e = _n(), t = JSON.stringify(e);
|
|
436
|
+
if (t === gn) return;
|
|
437
|
+
let n = yn(e), r = n.nodes.added.length + n.nodes.removed.length + n.nodes.updated.length + n.edges.added.length + n.edges.removed.length + n.edges.updated.length;
|
|
438
|
+
gn = t, r && y("data-change", {
|
|
419
439
|
nodes: e.nodes,
|
|
420
440
|
edges: e.edges,
|
|
421
441
|
summary: n
|
|
422
442
|
});
|
|
423
|
-
},
|
|
424
|
-
|
|
425
|
-
},
|
|
426
|
-
|
|
443
|
+
}, xn = () => {
|
|
444
|
+
mn.value && (j && clearTimeout(j), j = setTimeout(bn, 300));
|
|
445
|
+
}, Sn = () => {
|
|
446
|
+
j &&= (clearTimeout(j), null), hn.value = _n(), gn = "";
|
|
427
447
|
};
|
|
428
|
-
|
|
429
|
-
|
|
448
|
+
te([
|
|
449
|
+
S,
|
|
450
|
+
D,
|
|
430
451
|
k,
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
e ? vn() : N &&= (clearTimeout(N), null);
|
|
452
|
+
O
|
|
453
|
+
], () => xn(), { deep: !0 }), te(mn, (e) => {
|
|
454
|
+
e ? Sn() : j &&= (clearTimeout(j), null);
|
|
435
455
|
}), u(() => {
|
|
436
|
-
|
|
456
|
+
mn.value && Sn();
|
|
437
457
|
});
|
|
438
|
-
let
|
|
458
|
+
let Cn = () => _n(), wn = () => {
|
|
439
459
|
let e = new Set(z.value), t = new Set(B.value);
|
|
440
460
|
return {
|
|
441
461
|
nodeIds: e,
|
|
442
|
-
nodes:
|
|
443
|
-
edges:
|
|
462
|
+
nodes: S.value.filter((t) => e.has(t.id)),
|
|
463
|
+
edges: A.value.filter((n) => t.has(n.id) || e.has(n.from) || e.has(n.to))
|
|
444
464
|
};
|
|
445
|
-
},
|
|
446
|
-
let { nodeIds: e, nodes: t, edges: n } =
|
|
465
|
+
}, Tn = () => {
|
|
466
|
+
let { nodeIds: e, nodes: t, edges: n } = wn();
|
|
447
467
|
return !t.length && !n.length ? {
|
|
448
468
|
nodes: [],
|
|
449
469
|
edges: []
|
|
450
|
-
} : (t.length && (
|
|
470
|
+
} : (t.length && (S.value = S.value.filter((t) => !e.has(t.id)), C()), n.length && (k.value = /* @__PURE__ */ new Set([...k.value, ...n.map((e) => e.id)]), D.value = D.value.filter((e) => !k.value.has(e.id)), y("edge-remove", n.map((e) => JSON.parse(JSON.stringify(e))))), z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V(), JSON.parse(JSON.stringify({
|
|
451
471
|
nodes: t,
|
|
452
472
|
edges: n
|
|
453
473
|
})));
|
|
454
|
-
},
|
|
474
|
+
}, En = (e) => {
|
|
455
475
|
let t = e.target;
|
|
456
476
|
if (!t || t === document.body) return !1;
|
|
457
477
|
let n = String(t.tagName || "").toLowerCase();
|
|
458
478
|
return n === "input" || n === "textarea" || n === "select" || t.isContentEditable;
|
|
459
|
-
},
|
|
460
|
-
let e =
|
|
479
|
+
}, Dn = o(), On = () => {
|
|
480
|
+
let e = Dn?.vnode?.props;
|
|
461
481
|
return !!e && "onDeleteRequest" in e;
|
|
462
|
-
},
|
|
463
|
-
let { nodes: e, edges: t } =
|
|
464
|
-
|
|
482
|
+
}, kn = () => {
|
|
483
|
+
let { nodes: e, edges: t } = wn();
|
|
484
|
+
y("delete-request", JSON.parse(JSON.stringify({
|
|
465
485
|
nodes: e,
|
|
466
486
|
edges: t
|
|
467
487
|
})));
|
|
468
|
-
},
|
|
469
|
-
(e.key === "Delete" || e.key === "Backspace") && (e.isComposing || e.ctrlKey || e.metaKey || e.altKey ||
|
|
488
|
+
}, An = (e) => {
|
|
489
|
+
(e.key === "Delete" || e.key === "Backspace") && (e.isComposing || e.ctrlKey || e.metaKey || e.altKey || v.config?.enableDeleteKey !== !1 && v.editable && (En(e) || (z.value.length || B.value.length) && (T.value || J.value || Y.value || (e.preventDefault(), On() ? kn() : Tn()))));
|
|
470
490
|
};
|
|
471
|
-
u(() => window.addEventListener("keydown",
|
|
472
|
-
let
|
|
473
|
-
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(
|
|
491
|
+
u(() => window.addEventListener("keydown", An)), l(() => window.removeEventListener("keydown", An));
|
|
492
|
+
let jn = (e) => {
|
|
493
|
+
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(S.value.map((e) => e.id)), r = [];
|
|
474
494
|
for (let e of t) {
|
|
475
495
|
let t = JSON.parse(JSON.stringify(e));
|
|
476
|
-
if (t.id == null) t.id =
|
|
496
|
+
if (t.id == null) t.id = ae();
|
|
477
497
|
else if (n.has(t.id)) continue;
|
|
478
498
|
n.add(t.id), r.push(t);
|
|
479
499
|
}
|
|
480
|
-
return r.length ? (
|
|
481
|
-
},
|
|
482
|
-
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(
|
|
500
|
+
return r.length ? (S.value = [...S.value, ...r], C(), JSON.parse(JSON.stringify(r))) : [];
|
|
501
|
+
}, Mn = (e) => {
|
|
502
|
+
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(A.value.map((e) => e.id)), r = [];
|
|
483
503
|
for (let e of t) {
|
|
484
504
|
let t = JSON.parse(JSON.stringify(e));
|
|
485
505
|
if (t.from != null && t.to != null) {
|
|
486
|
-
if (t.id == null) t.id =
|
|
506
|
+
if (t.id == null) t.id = ae();
|
|
487
507
|
else if (n.has(t.id)) continue;
|
|
488
508
|
n.add(t.id), r.push(t);
|
|
489
509
|
}
|
|
490
510
|
}
|
|
491
511
|
if (!r.length) return [];
|
|
492
|
-
let i = r.filter((e) =>
|
|
512
|
+
let i = r.filter((e) => k.value.has(e.id));
|
|
493
513
|
if (i.length) {
|
|
494
514
|
let e = new Set(i.map((e) => e.id));
|
|
495
|
-
|
|
515
|
+
k.value = new Set([...k.value].filter((t) => !e.has(t)));
|
|
496
516
|
}
|
|
497
|
-
return
|
|
498
|
-
},
|
|
517
|
+
return D.value = [...D.value, ...r], r.forEach((e) => y("edge-create", JSON.parse(JSON.stringify(e)))), JSON.parse(JSON.stringify(r));
|
|
518
|
+
}, Nn = (e) => {
|
|
499
519
|
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && e.id != null);
|
|
500
520
|
if (!t.length) return [];
|
|
501
521
|
let n = /* @__PURE__ */ new Map();
|
|
@@ -508,7 +528,7 @@ var x = {
|
|
|
508
528
|
});
|
|
509
529
|
}
|
|
510
530
|
let r = [];
|
|
511
|
-
return
|
|
531
|
+
return S.value = S.value.map((e) => {
|
|
512
532
|
let t = n.get(e.id);
|
|
513
533
|
if (!t) return e;
|
|
514
534
|
let i = {
|
|
@@ -516,11 +536,11 @@ var x = {
|
|
|
516
536
|
...t
|
|
517
537
|
};
|
|
518
538
|
return r.push(i), i;
|
|
519
|
-
}), r.length ? (
|
|
520
|
-
},
|
|
539
|
+
}), r.length ? (C(), JSON.parse(JSON.stringify(r))) : [];
|
|
540
|
+
}, Pn = (e) => {
|
|
521
541
|
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && e.id != null);
|
|
522
542
|
if (!t.length) return [];
|
|
523
|
-
let n = new Set(
|
|
543
|
+
let n = new Set(A.value.map((e) => e.id)), r = new Map(O.value), i = [];
|
|
524
544
|
for (let e of t) {
|
|
525
545
|
let { id: t, ...a } = e;
|
|
526
546
|
if (!n.has(t)) continue;
|
|
@@ -531,43 +551,43 @@ var x = {
|
|
|
531
551
|
...o
|
|
532
552
|
};
|
|
533
553
|
r.set(t, s);
|
|
534
|
-
let c =
|
|
554
|
+
let c = A.value.find((e) => e.id === t);
|
|
535
555
|
i.push({
|
|
536
556
|
...c,
|
|
537
557
|
...s
|
|
538
558
|
});
|
|
539
559
|
}
|
|
540
|
-
return i.length ? (
|
|
541
|
-
},
|
|
560
|
+
return i.length ? (O.value = r, y("edge-update", JSON.parse(JSON.stringify(i))), JSON.parse(JSON.stringify(i))) : [];
|
|
561
|
+
}, Fn = (e) => {
|
|
542
562
|
let t = e && typeof e == "object" ? e : null;
|
|
543
|
-
return
|
|
563
|
+
return D.value = [], k.value = /* @__PURE__ */ new Set(), O.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (S.value = JSON.parse(JSON.stringify(t.nodes)), C()) : (S.value = (Array.isArray(v.nodes) ? v.nodes : []).map((e) => ({ ...e })), sn = S.value), z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V(), Sn(), _n();
|
|
544
564
|
};
|
|
545
|
-
|
|
546
|
-
|
|
565
|
+
te(() => v.edges, (e) => {
|
|
566
|
+
$t();
|
|
547
567
|
let t = Array.isArray(e) ? e : [], n = new Set(t.map((e) => e.id));
|
|
548
|
-
if (
|
|
549
|
-
let e =
|
|
550
|
-
e.length !==
|
|
568
|
+
if (D.value.length) {
|
|
569
|
+
let e = D.value.filter((e) => !n.has(e.id));
|
|
570
|
+
e.length !== D.value.length && (D.value = e);
|
|
551
571
|
}
|
|
552
|
-
if (
|
|
553
|
-
let e = new Map(
|
|
572
|
+
if (O.value.size) {
|
|
573
|
+
let e = new Map(O.value), n = new Set(D.value.map((e) => e.id)), r = !1;
|
|
554
574
|
for (let [i, a] of e) {
|
|
555
575
|
let o = t.find((e) => e.id === i);
|
|
556
576
|
o ? Object.entries(a).every(([e, t]) => JSON.stringify(o[e] ?? null) === JSON.stringify(t ?? null)) && (e.delete(i), r = !0) : n.has(i) || (e.delete(i), r = !0);
|
|
557
577
|
}
|
|
558
|
-
r && (
|
|
578
|
+
r && (O.value = e);
|
|
559
579
|
}
|
|
560
580
|
}, { deep: !0 });
|
|
561
|
-
let
|
|
581
|
+
let In = t(() => {
|
|
562
582
|
let e = {};
|
|
563
|
-
|
|
583
|
+
A.value.forEach((t) => {
|
|
564
584
|
let n = [t.from, t.to].sort().join("__");
|
|
565
585
|
e[n] || (e[n] = []), e[n].push(t);
|
|
566
586
|
});
|
|
567
587
|
let t = {};
|
|
568
588
|
return Object.entries(e).forEach(([e, n]) => {
|
|
569
589
|
let r = n.length;
|
|
570
|
-
r >
|
|
590
|
+
r > Bt ? n.forEach((n, i) => {
|
|
571
591
|
t[n.id] = i === 0 ? {
|
|
572
592
|
key: e,
|
|
573
593
|
index: 0,
|
|
@@ -596,44 +616,44 @@ var x = {
|
|
|
596
616
|
};
|
|
597
617
|
});
|
|
598
618
|
}), t;
|
|
599
|
-
}),
|
|
619
|
+
}), Ln = t(() => {
|
|
600
620
|
let e = /* @__PURE__ */ new Map();
|
|
601
|
-
for (let t of
|
|
621
|
+
for (let t of S.value) e.set(t.id, t);
|
|
602
622
|
return e;
|
|
603
|
-
}),
|
|
623
|
+
}), M = (e) => Ln.value.get(e), N = (e) => e.state != "none" && b[e.state] && b[e.state].color || "#00f0ff", Rn = (e) => b[e.state] || b.normal, zn = (e) => e.nodeType === "text", Bn = (e) => e.nodeType === "border-only", Vn = [
|
|
604
624
|
"image",
|
|
605
625
|
"img",
|
|
606
626
|
"picture"
|
|
607
|
-
],
|
|
627
|
+
], P = (e) => {
|
|
608
628
|
if (!e) return "";
|
|
609
629
|
let t = e.image ?? e.src ?? e.img ?? e.imageUrl;
|
|
610
630
|
return typeof t == "string" && t.trim() ? t.trim() : "";
|
|
611
|
-
},
|
|
612
|
-
if (!e ||
|
|
613
|
-
|
|
631
|
+
}, Hn = (e) => e ? Vn.includes(String(e.nodeType ?? "").toLowerCase()) ? !0 : (v.config?.imageNodeBySource || !e.nodeType) && !!P(e) : !1, Un = t(() => v.config?.imageFit === "cover" ? "cover" : "contain"), Wn = t(() => Un.value === "contain" ? "xMidYMid meet" : "xMidYMid slice"), Gn = `-30 -30 ${x} ${x}`, Kn = /* @__PURE__ */ new Map(), qn = f(0), Jn = (e) => {
|
|
632
|
+
if (!e || Kn.has(e) || typeof Image > "u") return;
|
|
633
|
+
Kn.set(e, null);
|
|
614
634
|
let t = new Image();
|
|
615
635
|
t.onload = () => {
|
|
616
|
-
|
|
636
|
+
Kn.set(e, {
|
|
617
637
|
w: t.naturalWidth || 1,
|
|
618
638
|
h: t.naturalHeight || 1
|
|
619
|
-
}),
|
|
639
|
+
}), qn.value++;
|
|
620
640
|
}, t.onerror = () => {
|
|
621
|
-
|
|
641
|
+
Kn.set(e, {
|
|
622
642
|
w: 1,
|
|
623
643
|
h: 1
|
|
624
|
-
}),
|
|
644
|
+
}), qn.value++;
|
|
625
645
|
}, t.src = e;
|
|
626
|
-
},
|
|
627
|
-
|
|
628
|
-
let t =
|
|
646
|
+
}, F = (e) => {
|
|
647
|
+
qn.value;
|
|
648
|
+
let t = P(e), n = t ? Kn.get(t) : null, { w: r, h: i } = I(e);
|
|
629
649
|
if (!n) return {
|
|
630
650
|
w: r,
|
|
631
651
|
h: i
|
|
632
652
|
};
|
|
633
653
|
let a = n.w, o = n.h, s;
|
|
634
|
-
if (
|
|
654
|
+
if (Un.value === "contain") s = Math.min(x / a, x / o);
|
|
635
655
|
else {
|
|
636
|
-
let e = Math.max(r, i) /
|
|
656
|
+
let e = Math.max(r, i) / x;
|
|
637
657
|
s = Math.max(r / e / a, i / e / o);
|
|
638
658
|
}
|
|
639
659
|
return {
|
|
@@ -641,38 +661,38 @@ var x = {
|
|
|
641
661
|
h: o * s
|
|
642
662
|
};
|
|
643
663
|
};
|
|
644
|
-
|
|
645
|
-
for (let e of
|
|
664
|
+
ne(() => {
|
|
665
|
+
for (let e of S.value) Hn(e) && Jn(P(e));
|
|
646
666
|
});
|
|
647
|
-
let
|
|
667
|
+
let Yn = (e, t) => {
|
|
648
668
|
let n = Number(e);
|
|
649
669
|
return Number.isFinite(n) && n > 0 ? n : t;
|
|
650
|
-
},
|
|
651
|
-
let t =
|
|
670
|
+
}, Xn = (e) => {
|
|
671
|
+
let t = Yn(e.width, x), n = Yn(e.height, x);
|
|
652
672
|
return {
|
|
653
|
-
sx: t /
|
|
654
|
-
sy: n /
|
|
673
|
+
sx: t / x,
|
|
674
|
+
sy: n / x
|
|
655
675
|
};
|
|
656
|
-
},
|
|
676
|
+
}, Zn = (e) => {
|
|
657
677
|
let t = Math.max(e.width, e.height);
|
|
658
678
|
return isNaN(t) ? 30 : t / 2;
|
|
659
|
-
},
|
|
660
|
-
let { sx: t, sy: n } =
|
|
679
|
+
}, Qn = (e) => {
|
|
680
|
+
let { sx: t, sy: n } = Xn(e);
|
|
661
681
|
return t === 1 && n === 1 ? "" : `scale(${t}, ${n})`;
|
|
662
|
-
},
|
|
682
|
+
}, $n = (e) => {
|
|
663
683
|
let { w: t, h: n } = I(e), r = Math.min(10, t * .3), i = Math.min(10, n * .3);
|
|
664
684
|
return `translate(${t / 2 - r}, ${-(n / 2 - i)})`;
|
|
665
|
-
},
|
|
666
|
-
let e = Number(
|
|
685
|
+
}, er = t(() => {
|
|
686
|
+
let e = Number(v.config.labelGap);
|
|
667
687
|
return Number.isFinite(e) && e >= 0 ? e : 18;
|
|
668
|
-
}),
|
|
669
|
-
if (
|
|
688
|
+
}), tr = (e) => {
|
|
689
|
+
if (zn(e)) return 4;
|
|
670
690
|
let { h: t } = I(e);
|
|
671
|
-
return e.labelPosition === "top" ? -(t / 2 +
|
|
672
|
-
},
|
|
691
|
+
return e.labelPosition === "top" ? -(t / 2 + er.value) : e.labelPosition === "center" ? 0 : t / 2 + er.value;
|
|
692
|
+
}, nr = (e) => {
|
|
673
693
|
let t = L(e);
|
|
674
|
-
if (
|
|
675
|
-
let n =
|
|
694
|
+
if (zn(e) || !e.label) return t;
|
|
695
|
+
let n = tn(e), r = tr(e);
|
|
676
696
|
if (e.labelPosition === "top") {
|
|
677
697
|
let e = r - n - 4;
|
|
678
698
|
e < t.y && (t.height += t.y - e, t.y = e);
|
|
@@ -681,11 +701,11 @@ var x = {
|
|
|
681
701
|
i > t.y + t.height && (t.height = i - t.y);
|
|
682
702
|
}
|
|
683
703
|
return t;
|
|
684
|
-
},
|
|
685
|
-
let t =
|
|
704
|
+
}, rr = (e) => e.borderStyle !== "none" && (e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0), I = (e) => {
|
|
705
|
+
let t = zn(e), n = Bn(e);
|
|
686
706
|
return {
|
|
687
|
-
w:
|
|
688
|
-
h:
|
|
707
|
+
w: Yn(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : n ? Math.max(80, String(e.label).length * 8 + 24) : x),
|
|
708
|
+
h: Yn(e.height, t ? 26 : n ? 40 : x)
|
|
689
709
|
};
|
|
690
710
|
}, L = (e) => {
|
|
691
711
|
let { w: t, h: n } = I(e);
|
|
@@ -695,78 +715,78 @@ var x = {
|
|
|
695
715
|
width: t,
|
|
696
716
|
height: n
|
|
697
717
|
};
|
|
698
|
-
}, R = (e) =>
|
|
718
|
+
}, R = (e) => rr(e) ? L(e) : null, ir = (e) => e.background && e.background !== "none" ? e.background : null, z = f([]), B = f([]);
|
|
699
719
|
t(() => z.value.length === 1 ? z.value[0] : null), t(() => B.value.length === 1 ? B.value[0] : null);
|
|
700
|
-
let
|
|
701
|
-
|
|
702
|
-
nodes:
|
|
703
|
-
edges:
|
|
720
|
+
let ar = (e) => z.value.includes(e.id), or = (e) => B.value.includes(e.id), V = () => {
|
|
721
|
+
y("selection-change", {
|
|
722
|
+
nodes: S.value.filter((e) => z.value.includes(e.id)),
|
|
723
|
+
edges: A.value.filter((e) => B.value.includes(e.id))
|
|
704
724
|
});
|
|
705
|
-
},
|
|
725
|
+
}, sr = (e) => typeof e == "number" ? Number.isFinite(e) && e >= 0 ? Math.floor(e) : Infinity : typeof e == "string" && /^\d+$/.test(e.trim()) ? parseInt(e.trim(), 10) : Infinity, cr = t(() => sr(v.config.maxSelectNodes)), lr = t(() => sr(v.config.maxSelectEdges)), H = (e, t, n) => {
|
|
706
726
|
let r = new Set(e), i = [];
|
|
707
727
|
for (let e of t) r.has(e) || (r.add(e), i.push(e));
|
|
708
728
|
if (n === Infinity) return [...e, ...i];
|
|
709
729
|
let a = Math.max(0, n - e.length);
|
|
710
730
|
return [...e, ...i.slice(0, a)];
|
|
711
731
|
};
|
|
712
|
-
|
|
732
|
+
te([cr, lr], ([e, t]) => {
|
|
713
733
|
let n = !1;
|
|
714
734
|
z.value.length > e && (z.value = z.value.slice(0, e), n = !0), B.value.length > t && (B.value = B.value.slice(0, t), n = !0), n && V();
|
|
715
735
|
});
|
|
716
|
-
let
|
|
736
|
+
let ur = t(() => v.config.selectedBorderColor || "#fbbf24"), dr = t(() => v.config?.edgeLayer !== "below"), fr = t(() => v.config?.highlightEdgeOnTop !== !1), pr = (e, t) => {
|
|
717
737
|
if (!Cr()) {
|
|
718
738
|
if (t && (t.ctrlKey || t.metaKey)) {
|
|
719
739
|
let t = z.value.indexOf(e.id);
|
|
720
|
-
t >= 0 ? z.value.splice(t, 1) : z.value =
|
|
740
|
+
t >= 0 ? z.value.splice(t, 1) : z.value = H(z.value, [e.id], cr.value);
|
|
721
741
|
} else {
|
|
722
742
|
let t = z.value.length === 1 && z.value[0] === e.id;
|
|
723
|
-
z.value = t ? [] :
|
|
743
|
+
z.value = t ? [] : H([], [e.id], cr.value), B.value = [];
|
|
724
744
|
}
|
|
725
|
-
|
|
745
|
+
y("node-click", e), y("node-select", ar(e) ? e : null), V();
|
|
726
746
|
}
|
|
727
747
|
}, mr = (e) => {
|
|
728
|
-
let t =
|
|
729
|
-
if (!t ||
|
|
730
|
-
let n = t.zIndex ?? 0, r =
|
|
748
|
+
let t = S.value.find((t) => t.id === e);
|
|
749
|
+
if (!t || v.config.enableZOrder === !1) return !1;
|
|
750
|
+
let n = t.zIndex ?? 0, r = S.value.filter((e) => (e.zIndex ?? 0) > n);
|
|
731
751
|
return r.length !== 0 && (t.zIndex = Math.min(...r.map((e) => e.zIndex ?? 0)), !0);
|
|
732
752
|
}, hr = (e) => {
|
|
733
|
-
let t =
|
|
734
|
-
if (!t ||
|
|
735
|
-
let n = t.zIndex ?? 0, r =
|
|
753
|
+
let t = S.value.find((t) => t.id === e);
|
|
754
|
+
if (!t || v.config.enableZOrder === !1) return !1;
|
|
755
|
+
let n = t.zIndex ?? 0, r = S.value.filter((e) => (e.zIndex ?? 0) < n);
|
|
736
756
|
return r.length !== 0 && (t.zIndex = Math.max(...r.map((e) => e.zIndex ?? 0)), !0);
|
|
737
757
|
}, gr = (e) => {
|
|
738
|
-
let t =
|
|
739
|
-
return !t ||
|
|
758
|
+
let t = S.value.find((t) => t.id === e);
|
|
759
|
+
return !t || v.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.max(...S.value.map((e) => e.zIndex ?? 0), 0) + 1, !0);
|
|
740
760
|
}, _r = (e) => {
|
|
741
|
-
let t =
|
|
742
|
-
return !t ||
|
|
761
|
+
let t = S.value.find((t) => t.id === e);
|
|
762
|
+
return !t || v.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.min(...S.value.map((e) => e.zIndex ?? 0), 0) - 1, !0);
|
|
743
763
|
}, vr = () => {
|
|
744
|
-
if (!
|
|
745
|
-
let e =
|
|
746
|
-
e.querySelectorAll("animate, animateMotion, animateTransform, set").forEach((e) => e.remove()), e.querySelectorAll(".center-crosshair").forEach((e) => e.remove()), e.setAttribute("width",
|
|
764
|
+
if (!E.value) return;
|
|
765
|
+
let e = E.value.cloneNode(!0);
|
|
766
|
+
e.querySelectorAll("animate, animateMotion, animateTransform, set").forEach((e) => e.remove()), e.querySelectorAll(".center-crosshair").forEach((e) => e.remove()), e.setAttribute("width", U.value || "800"), e.setAttribute("height", W.value || "600");
|
|
747
767
|
let t = new XMLSerializer().serializeToString(e);
|
|
748
768
|
t = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + t;
|
|
749
769
|
let n = new Blob([t], { type: "image/svg+xml;charset=utf-8" }), r = URL.createObjectURL(n), i = document.createElement("a");
|
|
750
770
|
i.href = r, i.download = `topology-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.svg`, document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(r);
|
|
751
|
-
}, yr = t(() =>
|
|
771
|
+
}, yr = t(() => v.config.selectedLineColor || "#fbbf24"), br = (e, t) => {
|
|
752
772
|
if (Cr()) return;
|
|
753
|
-
let n =
|
|
754
|
-
let t =
|
|
773
|
+
let n = In.value[e.id], r = !!(n && n.merged && n.representative), i = r ? A.value.filter((e) => {
|
|
774
|
+
let t = In.value[e.id];
|
|
755
775
|
return t && t.key === n.key;
|
|
756
776
|
}) : null, a = r ? i.map((e) => e.id) : [e.id], o = r ? {
|
|
757
777
|
...e,
|
|
758
778
|
bundleEdges: i
|
|
759
779
|
} : e;
|
|
760
|
-
if (t && (t.ctrlKey || t.metaKey)) a.every((e) => B.value.includes(e)) ? B.value = B.value.filter((e) => !a.includes(e)) : B.value =
|
|
780
|
+
if (t && (t.ctrlKey || t.metaKey)) a.every((e) => B.value.includes(e)) ? B.value = B.value.filter((e) => !a.includes(e)) : B.value = H(B.value, a, lr.value);
|
|
761
781
|
else {
|
|
762
782
|
let e = a.length === B.value.length && a.every((e) => B.value.includes(e));
|
|
763
|
-
B.value = e ? [] :
|
|
783
|
+
B.value = e ? [] : H([], a, lr.value), z.value = [];
|
|
764
784
|
}
|
|
765
|
-
|
|
785
|
+
y("edge-select", or(e) ? o : null), V();
|
|
766
786
|
}, xr = 0, Sr = (e = 200) => {
|
|
767
787
|
xr = performance.now() + e;
|
|
768
788
|
}, Cr = () => performance.now() < xr, wr = () => {
|
|
769
|
-
z.value = [], B.value = [],
|
|
789
|
+
z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V();
|
|
770
790
|
}, Tr = (e) => {
|
|
771
791
|
if (Cr()) return;
|
|
772
792
|
let t = e.target;
|
|
@@ -774,9 +794,9 @@ var x = {
|
|
|
774
794
|
}, Er = f({
|
|
775
795
|
width: 1e3,
|
|
776
796
|
height: 650
|
|
777
|
-
}), Dr = f(1), Or = f(0), kr = f(0), Ar = t(() => -Mr.value / 2 + Or.value), jr = t(() => -Nr.value / 2 + kr.value), Mr = t(() =>
|
|
797
|
+
}), Dr = f(1), Or = f(0), kr = f(0), Ar = t(() => -Mr.value / 2 + Or.value), jr = t(() => -Nr.value / 2 + kr.value), Mr = t(() => v.width ?? Er.value.width), Nr = t(() => v.height ?? Er.value.height), Pr = null;
|
|
778
798
|
u(() => {
|
|
779
|
-
let e =
|
|
799
|
+
let e = E.value;
|
|
780
800
|
if (e) {
|
|
781
801
|
let t = e.getBoundingClientRect();
|
|
782
802
|
t.width > 0 && t.height > 0 && (Er.value = {
|
|
@@ -792,36 +812,36 @@ var x = {
|
|
|
792
812
|
});
|
|
793
813
|
}), Pr.observe(e));
|
|
794
814
|
}), l(() => {
|
|
795
|
-
Pr &&= (Pr.disconnect(), null),
|
|
815
|
+
Pr &&= (Pr.disconnect(), null), ki &&= (cancelAnimationFrame(ki), 0), Jr &&= (cancelAnimationFrame(Jr), 0), Z &&= (cancelAnimationFrame(Z), 0), $i(), ei();
|
|
796
816
|
});
|
|
797
|
-
let
|
|
798
|
-
x0: Ar.value -
|
|
799
|
-
y0: jr.value -
|
|
800
|
-
x1: Ar.value +
|
|
801
|
-
y1: jr.value +
|
|
817
|
+
let U = t(() => Mr.value / Dr.value), W = t(() => Nr.value / Dr.value), Fr = t(() => ({
|
|
818
|
+
x0: Ar.value - Gt,
|
|
819
|
+
y0: jr.value - Gt,
|
|
820
|
+
x1: Ar.value + U.value + Gt,
|
|
821
|
+
y1: jr.value + W.value + Gt
|
|
802
822
|
})), Ir = t(() => {
|
|
803
|
-
let e = Fr.value, t =
|
|
823
|
+
let e = Fr.value, t = S.value.filter((t) => {
|
|
804
824
|
let { w: n, h: r } = I(t);
|
|
805
825
|
return t.x + n / 2 >= e.x0 && t.x - n / 2 <= e.x1 && t.y + r / 2 >= e.y0 && t.y - r / 2 <= e.y1;
|
|
806
826
|
});
|
|
807
|
-
return
|
|
808
|
-
}),
|
|
827
|
+
return v.config.enableZOrder !== !1 && t.sort((e, t) => (e.zIndex ?? 0) - (t.zIndex ?? 0)), t;
|
|
828
|
+
}), G = t(() => {
|
|
809
829
|
let e = Fr.value;
|
|
810
|
-
return
|
|
811
|
-
if (!
|
|
812
|
-
let n =
|
|
830
|
+
return A.value.filter((t) => {
|
|
831
|
+
if (!ha(t)) return !1;
|
|
832
|
+
let n = M(t.from), r = M(t.to);
|
|
813
833
|
if (!n || !r) return !1;
|
|
814
834
|
let i = I(n).w / 2, a = I(n).h / 2, o = I(r).w / 2, s = I(r).h / 2;
|
|
815
|
-
return Math.min(n.x - i, r.x - o) -
|
|
835
|
+
return Math.min(n.x - i, r.x - o) - Kt <= e.x1 && Math.max(n.x + i, r.x + o) + Kt >= e.x0 && Math.min(n.y - a, r.y - s) - Kt <= e.y1 && Math.max(n.y + a, r.y + s) + Kt >= e.y0;
|
|
816
836
|
});
|
|
817
837
|
}), Lr = (e) => {
|
|
818
|
-
if (
|
|
838
|
+
if (v.config.enableZoom === !1) return;
|
|
819
839
|
e.preventDefault();
|
|
820
|
-
let t =
|
|
840
|
+
let t = E.value.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, i = n / t.width, a = r / t.height, o = U.value, s = W.value, c = e.deltaY > 0 ? .9 : 1.1, l = Math.min(Wt, Math.max(Ut, Dr.value * c)), u = Mr.value / l, d = Nr.value / l;
|
|
821
841
|
Or.value += (o - u) * i, kr.value += (s - d) * a, Dr.value = l;
|
|
822
|
-
},
|
|
823
|
-
let t =
|
|
824
|
-
|
|
842
|
+
}, K = f(null), q = f(null), Rr = (e) => {
|
|
843
|
+
let t = E.value, n = t ? t.getBoundingClientRect() : null;
|
|
844
|
+
K.value = {
|
|
825
845
|
startX: e.clientX,
|
|
826
846
|
startY: e.clientY,
|
|
827
847
|
lastX: e.clientX,
|
|
@@ -829,9 +849,9 @@ var x = {
|
|
|
829
849
|
moved: !1,
|
|
830
850
|
rectWidth: n && n.width ? n.width : 0,
|
|
831
851
|
rectHeight: n && n.height ? n.height : 0
|
|
832
|
-
},
|
|
852
|
+
}, $r();
|
|
833
853
|
}, zr = (e) => {
|
|
834
|
-
let t =
|
|
854
|
+
let t = K.value, n = E.value;
|
|
835
855
|
if (!t || !n) return;
|
|
836
856
|
let r = t.rectWidth, i = t.rectHeight;
|
|
837
857
|
if (!r || !i) return;
|
|
@@ -841,13 +861,13 @@ var x = {
|
|
|
841
861
|
return;
|
|
842
862
|
}
|
|
843
863
|
let a = e.clientX - t.lastX, o = e.clientY - t.lastY;
|
|
844
|
-
t.lastX = e.clientX, t.lastY = e.clientY, Or.value -= a * (
|
|
864
|
+
t.lastX = e.clientX, t.lastY = e.clientY, Or.value -= a * (U.value / r), kr.value -= o * (W.value / i);
|
|
845
865
|
}, Br = () => {
|
|
846
|
-
let e =
|
|
847
|
-
|
|
866
|
+
let e = K.value;
|
|
867
|
+
K.value = null, e && e.moved && Sr(), ti();
|
|
848
868
|
}, Vr = (e) => {
|
|
849
|
-
let t =
|
|
850
|
-
|
|
869
|
+
let t = X(e);
|
|
870
|
+
q.value = {
|
|
851
871
|
start: {
|
|
852
872
|
x: t.x,
|
|
853
873
|
y: t.y
|
|
@@ -859,17 +879,17 @@ var x = {
|
|
|
859
879
|
startClientX: e.clientX,
|
|
860
880
|
startClientY: e.clientY,
|
|
861
881
|
moved: !1
|
|
862
|
-
},
|
|
882
|
+
}, $r();
|
|
863
883
|
}, Hr = (e) => {
|
|
864
|
-
let t =
|
|
884
|
+
let t = q.value;
|
|
865
885
|
if (!t) return;
|
|
866
|
-
let n =
|
|
886
|
+
let n = X(e);
|
|
867
887
|
t.current = {
|
|
868
888
|
x: n.x,
|
|
869
889
|
y: n.y
|
|
870
890
|
}, !t.moved && Math.hypot(e.clientX - t.startClientX, e.clientY - t.startClientY) > 3 && (t.moved = !0);
|
|
871
891
|
}, Ur = t(() => {
|
|
872
|
-
let e =
|
|
892
|
+
let e = q.value;
|
|
873
893
|
return e ? {
|
|
874
894
|
x: Math.min(e.start.x, e.current.x),
|
|
875
895
|
y: Math.min(e.start.y, e.current.y),
|
|
@@ -882,62 +902,62 @@ var x = {
|
|
|
882
902
|
height: 0
|
|
883
903
|
};
|
|
884
904
|
}), Wr = () => {
|
|
885
|
-
let e =
|
|
886
|
-
if (
|
|
905
|
+
let e = q.value;
|
|
906
|
+
if (q.value = null, e && e.moved) {
|
|
887
907
|
let t = {
|
|
888
908
|
x: Math.min(e.start.x, e.current.x),
|
|
889
909
|
y: Math.min(e.start.y, e.current.y),
|
|
890
910
|
w: Math.abs(e.current.x - e.start.x),
|
|
891
911
|
h: Math.abs(e.current.y - e.start.y)
|
|
892
|
-
}, n =
|
|
912
|
+
}, n = S.value.filter((e) => {
|
|
893
913
|
let n = L(e), r = e.x + n.x, i = e.y + n.y;
|
|
894
914
|
return !(r + n.width < t.x || r > t.x + t.w || i + n.height < t.y || i > t.y + t.h);
|
|
895
915
|
});
|
|
896
|
-
n.length && (z.value =
|
|
916
|
+
n.length && (z.value = H(z.value, n.map((e) => e.id), cr.value), V()), Sr();
|
|
897
917
|
}
|
|
898
|
-
|
|
918
|
+
ti();
|
|
899
919
|
}, Gr = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), Kr = (e) => {
|
|
900
|
-
if (
|
|
920
|
+
if (E.value) {
|
|
901
921
|
if (e.button === 1) {
|
|
902
|
-
if (
|
|
922
|
+
if (v.config.enablePan === !1) return;
|
|
903
923
|
e.preventDefault(), Rr(e);
|
|
904
924
|
return;
|
|
905
925
|
}
|
|
906
926
|
if (e.button === 0 && !Gr(e.target)) {
|
|
907
927
|
if (e.ctrlKey || e.metaKey) {
|
|
908
|
-
if (
|
|
928
|
+
if (v.config.enableMarquee === !1) return;
|
|
909
929
|
e.preventDefault(), Vr(e);
|
|
910
930
|
return;
|
|
911
931
|
}
|
|
912
|
-
|
|
932
|
+
v.config.enablePan !== !1 && (e.preventDefault(), Rr(e));
|
|
913
933
|
}
|
|
914
934
|
}
|
|
915
|
-
}, qr = !1,
|
|
916
|
-
|
|
917
|
-
let e =
|
|
918
|
-
|
|
919
|
-
},
|
|
920
|
-
|
|
921
|
-
}, Zr = () => {
|
|
922
|
-
q && (cancelAnimationFrame(q), Yr()), G.value && Br(), K.value && Wr();
|
|
935
|
+
}, qr = !1, Jr = 0, Yr = null, Xr = () => {
|
|
936
|
+
Jr = 0;
|
|
937
|
+
let e = Yr;
|
|
938
|
+
Yr = null, e && (K.value ? zr(e) : q.value && Hr(e));
|
|
939
|
+
}, Zr = (e) => {
|
|
940
|
+
Yr = e, Jr ||= requestAnimationFrame(Xr);
|
|
923
941
|
}, Qr = () => {
|
|
924
|
-
|
|
942
|
+
Jr && (cancelAnimationFrame(Jr), Xr()), K.value && Br(), q.value && Wr();
|
|
925
943
|
}, $r = () => {
|
|
926
|
-
qr
|
|
944
|
+
qr || (qr = !0, window.addEventListener("mousemove", Zr, !0), window.addEventListener("mouseup", Qr, !0));
|
|
927
945
|
}, ei = () => {
|
|
928
|
-
!
|
|
929
|
-
}, ti =
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
if (
|
|
933
|
-
|
|
934
|
-
|
|
946
|
+
qr && (qr = !1, window.removeEventListener("mousemove", Zr, !0), window.removeEventListener("mouseup", Qr, !0));
|
|
947
|
+
}, ti = () => {
|
|
948
|
+
!K.value && !q.value && ei();
|
|
949
|
+
}, ni = t(() => {
|
|
950
|
+
if (J.value && J.value.side) return { cursor: Li(J.value.side) };
|
|
951
|
+
if (q.value) return { cursor: "crosshair" };
|
|
952
|
+
if (K.value && K.value.moved) return { cursor: "grabbing" };
|
|
953
|
+
}), ri = t(() => v.config.showGrid !== !1), ii = t(() => v.config.gridColor || "#1a2240"), ai = t(() => {
|
|
954
|
+
let e = Number(v.config.gridStep);
|
|
935
955
|
return (Number.isFinite(e) && e > 0 ? e : 40) / Dr.value;
|
|
936
|
-
}), ai = t(() => {
|
|
937
|
-
let e = Number(y.config.gridOpacity);
|
|
938
|
-
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .5;
|
|
939
956
|
}), oi = t(() => {
|
|
940
|
-
let e =
|
|
957
|
+
let e = Number(v.config.gridOpacity);
|
|
958
|
+
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .5;
|
|
959
|
+
}), si = t(() => {
|
|
960
|
+
let e = v.config.radialGradient && typeof v.config.radialGradient == "object" ? v.config.radialGradient : {}, t = Array.isArray(e.stops) && e.stops.length ? e.stops.filter((e) => e && e.color).map((e, t) => ({
|
|
941
961
|
offset: e.offset == null ? t === 0 ? "0%" : "100%" : e.offset,
|
|
942
962
|
color: e.color,
|
|
943
963
|
opacity: e.opacity
|
|
@@ -956,99 +976,109 @@ var x = {
|
|
|
956
976
|
r: e.r || "60%",
|
|
957
977
|
stops: n
|
|
958
978
|
};
|
|
959
|
-
}),
|
|
979
|
+
}), ci = t(() => v.config.showCenterPoint === !0), li = t(() => v.config.showEdgeTextBg === !0), ui = t(() => v.config.edgeTextBgColor || "#0a0e1a"), di = t(() => {
|
|
980
|
+
let e = Number(v.config.edgeTextBgOpacity);
|
|
981
|
+
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .92;
|
|
982
|
+
}), fi = t(() => v.config.edgeColor || v.config.defaultEdgeColor || null), pi = t(() => v.config.edgeBaseColor || null), mi = (e) => e.baseColor ? e.baseColor : pi.value ? pi.value : e.color || fi.value ? Q(e) : "#1a2744", hi = (e) => {
|
|
983
|
+
let t = e.baseDimOpacity ?? v.config.edgeBaseDimOpacity;
|
|
984
|
+
if (t != null) {
|
|
985
|
+
let e = Number(t);
|
|
986
|
+
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : 1;
|
|
987
|
+
}
|
|
988
|
+
return bi.value === "none" || Ci(e) === "none" ? 1 : .45;
|
|
989
|
+
}, gi = t(() => v.config.edgeCenterTextColor || null), _i = t(() => v.config.showNodeHandles === !0), vi = t(() => v.config.showStatusDot !== !1), yi = (e, t) => {
|
|
960
990
|
let n = Number(e);
|
|
961
991
|
return Number.isFinite(n) && n >= 0 ? n : t;
|
|
962
|
-
},
|
|
963
|
-
let e =
|
|
992
|
+
}, bi = t(() => {
|
|
993
|
+
let e = v.config.motionFx ?? v.config.fx;
|
|
964
994
|
return typeof e == "boolean" ? e ? "all" : "none" : [
|
|
965
995
|
"none",
|
|
966
996
|
"flow",
|
|
967
997
|
"particle",
|
|
968
998
|
"all"
|
|
969
|
-
].includes(e) ? e :
|
|
970
|
-
}),
|
|
971
|
-
let e =
|
|
972
|
-
return typeof e == "boolean" ? e :
|
|
973
|
-
}),
|
|
974
|
-
let e =
|
|
975
|
-
return typeof e == "boolean" ? e :
|
|
976
|
-
}),
|
|
999
|
+
].includes(e) ? e : A.value.length <= yi(v.config.fxMotionMaxEdges, 200) ? "all" : "none";
|
|
1000
|
+
}), xi = t(() => {
|
|
1001
|
+
let e = v.config.glowFx ?? v.config.fx;
|
|
1002
|
+
return typeof e == "boolean" ? e : A.value.length <= yi(v.config.fxGlowMaxEdges, 500);
|
|
1003
|
+
}), Si = t(() => {
|
|
1004
|
+
let e = v.config.breatheFx ?? v.config.fx;
|
|
1005
|
+
return typeof e == "boolean" ? e : S.value.length <= yi(v.config.fxBreatheMaxNodes, 300);
|
|
1006
|
+
}), Ci = (e) => {
|
|
977
1007
|
if (e.animatedMode !== void 0) {
|
|
978
1008
|
let t = e.animatedMode;
|
|
979
|
-
return !t || t === "all" ?
|
|
1009
|
+
return !t || t === "all" ? bi.value : t === "none" ? "none" : t;
|
|
980
1010
|
}
|
|
981
|
-
return e.animated === void 0 || e.animated ?
|
|
982
|
-
},
|
|
1011
|
+
return e.animated === void 0 || e.animated ? bi.value : "none";
|
|
1012
|
+
}, wi = (e) => e.borderColor || N(e) || "#94a3b8", Ti = (e) => e.borderWidth || 0, Ei = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, Di = (e) => {
|
|
983
1013
|
let t = e.borderRadius;
|
|
984
1014
|
if (t == null || t === "") return 6;
|
|
985
1015
|
let n = Number(t);
|
|
986
1016
|
return Number.isFinite(n) && n >= 0 ? n : 6;
|
|
987
|
-
},
|
|
988
|
-
if (e.button !== 0 || !
|
|
1017
|
+
}, Oi = (e, t) => {
|
|
1018
|
+
if (e.button !== 0 || !v.editable || v.config.nodeDraggable === !1) return;
|
|
989
1019
|
e.stopPropagation();
|
|
990
|
-
let n =
|
|
991
|
-
if (
|
|
1020
|
+
let n = M(t), r = X(e);
|
|
1021
|
+
if (ln.value = {
|
|
992
1022
|
x: r.x - n.x,
|
|
993
1023
|
y: r.y - n.y
|
|
994
|
-
},
|
|
1024
|
+
}, dn = {
|
|
995
1025
|
x: e.clientX,
|
|
996
1026
|
y: e.clientY
|
|
997
|
-
},
|
|
1027
|
+
}, fn = !1, pn = !!(e.ctrlKey || e.metaKey), z.value.length > 1 && z.value.includes(t)) {
|
|
998
1028
|
let e = {};
|
|
999
1029
|
z.value.forEach((t) => {
|
|
1000
|
-
let n =
|
|
1030
|
+
let n = M(t);
|
|
1001
1031
|
n && (e[t] = {
|
|
1002
1032
|
x: n.x,
|
|
1003
1033
|
y: n.y
|
|
1004
1034
|
});
|
|
1005
|
-
}),
|
|
1035
|
+
}), un.value = {
|
|
1006
1036
|
origins: e,
|
|
1007
1037
|
start: {
|
|
1008
1038
|
x: r.x,
|
|
1009
1039
|
y: r.y
|
|
1010
1040
|
}
|
|
1011
1041
|
};
|
|
1012
|
-
} else
|
|
1013
|
-
|
|
1014
|
-
},
|
|
1015
|
-
|
|
1016
|
-
let e =
|
|
1017
|
-
|
|
1018
|
-
},
|
|
1019
|
-
(
|
|
1042
|
+
} else un.value = null;
|
|
1043
|
+
T.value = t, y("node-drag-start", n);
|
|
1044
|
+
}, ki = 0, Ai = null, ji = () => {
|
|
1045
|
+
ki = 0;
|
|
1046
|
+
let e = Ai;
|
|
1047
|
+
Ai = null, e && Ni(e);
|
|
1048
|
+
}, Mi = (e) => {
|
|
1049
|
+
(J.value || T.value) && (Ai = {
|
|
1020
1050
|
clientX: e.clientX,
|
|
1021
1051
|
clientY: e.clientY
|
|
1022
|
-
},
|
|
1023
|
-
},
|
|
1024
|
-
if (
|
|
1025
|
-
|
|
1052
|
+
}, ki ||= requestAnimationFrame(ji));
|
|
1053
|
+
}, Ni = (e) => {
|
|
1054
|
+
if (J.value) {
|
|
1055
|
+
zi(e);
|
|
1026
1056
|
return;
|
|
1027
1057
|
}
|
|
1028
|
-
if (!
|
|
1029
|
-
let t =
|
|
1030
|
-
!
|
|
1031
|
-
let n =
|
|
1058
|
+
if (!T.value) return;
|
|
1059
|
+
let t = X(e);
|
|
1060
|
+
!fn && dn && Math.hypot(e.clientX - dn.x, e.clientY - dn.y) > Ht && (fn = !0, !pn && !z.value.includes(T.value) && (z.value = H([], [T.value], cr.value), B.value = [], y("node-select", z.value.includes(T.value) ? M(T.value) : null), V()));
|
|
1061
|
+
let n = un.value;
|
|
1032
1062
|
if (n) {
|
|
1033
1063
|
let e = t.x - n.start.x, r = t.y - n.start.y;
|
|
1034
|
-
|
|
1064
|
+
S.value = S.value.map((t) => n.origins[t.id] ? {
|
|
1035
1065
|
...t,
|
|
1036
1066
|
x: n.origins[t.id].x + e,
|
|
1037
1067
|
y: n.origins[t.id].y + r
|
|
1038
1068
|
} : t);
|
|
1039
|
-
} else
|
|
1069
|
+
} else S.value = S.value.map((e) => e.id === T.value ? {
|
|
1040
1070
|
...e,
|
|
1041
|
-
x: t.x -
|
|
1042
|
-
y: t.y -
|
|
1071
|
+
x: t.x - ln.value.x,
|
|
1072
|
+
y: t.y - ln.value.y
|
|
1043
1073
|
} : e);
|
|
1044
|
-
|
|
1045
|
-
},
|
|
1046
|
-
if (
|
|
1047
|
-
|
|
1074
|
+
C();
|
|
1075
|
+
}, Pi = () => {
|
|
1076
|
+
if (ki && (cancelAnimationFrame(ki), ji()), J.value) {
|
|
1077
|
+
Bi();
|
|
1048
1078
|
return;
|
|
1049
1079
|
}
|
|
1050
|
-
|
|
1051
|
-
},
|
|
1080
|
+
T.value && (fn && Sr(), T.value = null, un.value = null, dn = null, fn = !1, y("node-drag-end"));
|
|
1081
|
+
}, J = f(null), Fi = (e, t, n) => Math.min(n, Math.max(t, e)), Ii = (e) => {
|
|
1052
1082
|
let t = L(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
|
|
1053
1083
|
return [
|
|
1054
1084
|
{
|
|
@@ -1092,46 +1122,46 @@ var x = {
|
|
|
1092
1122
|
y: 0
|
|
1093
1123
|
}
|
|
1094
1124
|
];
|
|
1095
|
-
},
|
|
1096
|
-
if (!
|
|
1125
|
+
}, Li = (e) => e === "nw" || e === "se" ? "nwse-resize" : e === "ne" || e === "sw" ? "nesw-resize" : e === "n" || e === "s" ? "ns-resize" : "ew-resize", Ri = (e, t, n) => {
|
|
1126
|
+
if (!v.editable || v.config.nodeResizable === !1 || !t) return;
|
|
1097
1127
|
let { w: r, h: i } = I(t);
|
|
1098
|
-
|
|
1128
|
+
J.value = {
|
|
1099
1129
|
id: t.id,
|
|
1100
1130
|
side: n,
|
|
1101
1131
|
anchorX: n.includes("e") ? t.x - r / 2 : n.includes("w") ? t.x + r / 2 : null,
|
|
1102
1132
|
anchorY: n.includes("s") ? t.y - i / 2 : n.includes("n") ? t.y + i / 2 : null,
|
|
1103
1133
|
startW: r,
|
|
1104
1134
|
startH: i
|
|
1105
|
-
},
|
|
1106
|
-
},
|
|
1107
|
-
let t =
|
|
1135
|
+
}, y("node-resize-start", t);
|
|
1136
|
+
}, zi = (e) => {
|
|
1137
|
+
let t = J.value;
|
|
1108
1138
|
if (!t) return;
|
|
1109
|
-
let n =
|
|
1139
|
+
let n = M(t.id);
|
|
1110
1140
|
if (!n) return;
|
|
1111
|
-
let r =
|
|
1141
|
+
let r = X(e), i = t.startW, a = t.startH, o = n.x, s = n.y;
|
|
1112
1142
|
if (t.anchorX !== null) {
|
|
1113
1143
|
let e = t.side.includes("e");
|
|
1114
|
-
i =
|
|
1144
|
+
i = Fi(e ? r.x - t.anchorX : t.anchorX - r.x, qt, Jt), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
|
|
1115
1145
|
}
|
|
1116
1146
|
if (t.anchorY !== null) {
|
|
1117
1147
|
let e = t.side.includes("s");
|
|
1118
|
-
a =
|
|
1148
|
+
a = Fi(e ? r.y - t.anchorY : t.anchorY - r.y, Yt, Xt), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
|
|
1119
1149
|
}
|
|
1120
|
-
|
|
1150
|
+
S.value = S.value.map((e) => e.id === t.id ? {
|
|
1121
1151
|
...e,
|
|
1122
1152
|
x: o,
|
|
1123
1153
|
y: s,
|
|
1124
1154
|
width: i,
|
|
1125
1155
|
height: a
|
|
1126
|
-
} : e),
|
|
1127
|
-
},
|
|
1128
|
-
let e =
|
|
1129
|
-
|
|
1130
|
-
},
|
|
1131
|
-
if (!
|
|
1156
|
+
} : e), C();
|
|
1157
|
+
}, Bi = () => {
|
|
1158
|
+
let e = J.value;
|
|
1159
|
+
J.value = null, e && (Sr(), y("node-resize-end", M(e.id) || null));
|
|
1160
|
+
}, Vi = t(() => v.editable && v.config.nodeResizable !== !1), Hi = t(() => {
|
|
1161
|
+
if (!Vi.value) return null;
|
|
1132
1162
|
let e = z.value;
|
|
1133
|
-
return e.length === 1 &&
|
|
1134
|
-
}),
|
|
1163
|
+
return e.length === 1 && M(e[0]) || null;
|
|
1164
|
+
}), Y = f(null), Ui = (e) => {
|
|
1135
1165
|
let t = L(e);
|
|
1136
1166
|
return [
|
|
1137
1167
|
{
|
|
@@ -1155,8 +1185,8 @@ var x = {
|
|
|
1155
1185
|
y: 0
|
|
1156
1186
|
}
|
|
1157
1187
|
];
|
|
1158
|
-
},
|
|
1159
|
-
let n =
|
|
1188
|
+
}, Wi = (e, t) => {
|
|
1189
|
+
let n = E.value;
|
|
1160
1190
|
if (!n) return null;
|
|
1161
1191
|
let r = e, i = t;
|
|
1162
1192
|
if (e && typeof e == "object" && (r = e.clientX, i = e.clientY), r == null || i == null) return null;
|
|
@@ -1169,8 +1199,8 @@ var x = {
|
|
|
1169
1199
|
x: s.x,
|
|
1170
1200
|
y: s.y
|
|
1171
1201
|
};
|
|
1172
|
-
},
|
|
1173
|
-
let n =
|
|
1202
|
+
}, Gi = (e, t) => {
|
|
1203
|
+
let n = E.value;
|
|
1174
1204
|
if (!n) return null;
|
|
1175
1205
|
let r = n.createSVGPoint();
|
|
1176
1206
|
r.x = Number(e) || 0, r.y = Number(t) || 0;
|
|
@@ -1181,14 +1211,14 @@ var x = {
|
|
|
1181
1211
|
x: a.x,
|
|
1182
1212
|
y: a.y
|
|
1183
1213
|
};
|
|
1184
|
-
},
|
|
1214
|
+
}, X = (e) => Wi(e) ?? {
|
|
1185
1215
|
x: 0,
|
|
1186
1216
|
y: 0
|
|
1187
|
-
},
|
|
1188
|
-
let r =
|
|
1189
|
-
if (!r || !
|
|
1190
|
-
let i =
|
|
1191
|
-
|
|
1217
|
+
}, Ki = (e, t, n) => {
|
|
1218
|
+
let r = M(t);
|
|
1219
|
+
if (!r || !E.value) return;
|
|
1220
|
+
let i = X(e);
|
|
1221
|
+
Y.value = {
|
|
1192
1222
|
fromId: t,
|
|
1193
1223
|
side: n.side,
|
|
1194
1224
|
ax: r.x + n.x,
|
|
@@ -1200,24 +1230,24 @@ var x = {
|
|
|
1200
1230
|
try {
|
|
1201
1231
|
e.target.setPointerCapture?.(e.pointerId);
|
|
1202
1232
|
} catch {}
|
|
1203
|
-
|
|
1204
|
-
},
|
|
1205
|
-
|
|
1206
|
-
let e =
|
|
1207
|
-
|
|
1208
|
-
},
|
|
1209
|
-
|
|
1233
|
+
Qi();
|
|
1234
|
+
}, Z = 0, qi = null, Ji = () => {
|
|
1235
|
+
Z = 0;
|
|
1236
|
+
let e = qi;
|
|
1237
|
+
qi = null, e && Y.value && ta(e);
|
|
1238
|
+
}, Yi = (e) => {
|
|
1239
|
+
Y.value && (qi = {
|
|
1210
1240
|
clientX: e.clientX,
|
|
1211
1241
|
clientY: e.clientY
|
|
1212
|
-
},
|
|
1213
|
-
},
|
|
1214
|
-
|
|
1215
|
-
},
|
|
1216
|
-
|
|
1217
|
-
},
|
|
1218
|
-
|
|
1219
|
-
},
|
|
1220
|
-
let r =
|
|
1242
|
+
}, Z ||= requestAnimationFrame(Ji));
|
|
1243
|
+
}, Xi = () => {
|
|
1244
|
+
Z && (cancelAnimationFrame(Z), Ji()), Y.value && na();
|
|
1245
|
+
}, Zi = !1, Qi = () => {
|
|
1246
|
+
Zi || (Zi = !0, window.addEventListener("mousemove", Yi, !0), window.addEventListener("mouseup", Xi, !0));
|
|
1247
|
+
}, $i = () => {
|
|
1248
|
+
Zi && (Zi = !1, window.removeEventListener("mousemove", Yi, !0), window.removeEventListener("mouseup", Xi, !0));
|
|
1249
|
+
}, ea = (e, t, n) => {
|
|
1250
|
+
let r = S.value;
|
|
1221
1251
|
for (let i = r.length - 1; i >= 0; i--) {
|
|
1222
1252
|
let a = r[i];
|
|
1223
1253
|
if (a.id === n) continue;
|
|
@@ -1225,27 +1255,27 @@ var x = {
|
|
|
1225
1255
|
if (e >= a.x + o.x - 2 && e <= a.x + o.x + o.width + 2 && t >= a.y + o.y - 2 && t <= a.y + o.y + o.height + 2) return a;
|
|
1226
1256
|
}
|
|
1227
1257
|
return null;
|
|
1228
|
-
},
|
|
1229
|
-
let t =
|
|
1258
|
+
}, ta = (e) => {
|
|
1259
|
+
let t = Y.value;
|
|
1230
1260
|
if (!t) return;
|
|
1231
|
-
let n =
|
|
1261
|
+
let n = X(e);
|
|
1232
1262
|
t.px = n.x, t.py = n.y;
|
|
1233
|
-
let r =
|
|
1263
|
+
let r = ea(n.x, n.y, t.fromId);
|
|
1234
1264
|
t.overId = r ? r.id : null;
|
|
1235
|
-
},
|
|
1236
|
-
|
|
1237
|
-
let e =
|
|
1238
|
-
if (
|
|
1265
|
+
}, na = () => {
|
|
1266
|
+
$i();
|
|
1267
|
+
let e = Y.value;
|
|
1268
|
+
if (Y.value = null, !e || !e.overId || e.overId === e.fromId) return;
|
|
1239
1269
|
let t = {
|
|
1240
|
-
id: `${
|
|
1270
|
+
id: `${ae()}`,
|
|
1241
1271
|
from: e.fromId,
|
|
1242
1272
|
to: e.overId,
|
|
1243
1273
|
speed: 1,
|
|
1244
1274
|
fromAnchor: "edge",
|
|
1245
1275
|
toAnchor: "edge"
|
|
1246
1276
|
};
|
|
1247
|
-
|
|
1248
|
-
},
|
|
1277
|
+
D.value.push(t), y("edge-create", t);
|
|
1278
|
+
}, ra = (e, t, n) => {
|
|
1249
1279
|
let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = I(e);
|
|
1250
1280
|
if (!n || n === "center" || a === 0 && o === 0) return {
|
|
1251
1281
|
x: r,
|
|
@@ -1256,23 +1286,23 @@ var x = {
|
|
|
1256
1286
|
x: r + a * p,
|
|
1257
1287
|
y: i + o * p
|
|
1258
1288
|
};
|
|
1259
|
-
},
|
|
1289
|
+
}, ia = t(() => {
|
|
1260
1290
|
let e = /* @__PURE__ */ new Map();
|
|
1261
|
-
|
|
1262
|
-
let n =
|
|
1291
|
+
A.value.forEach((t) => {
|
|
1292
|
+
let n = In.value[t.id];
|
|
1263
1293
|
n && !n.hidden && (e.has(n.key) || e.set(n.key, []), e.get(n.key).push(t));
|
|
1264
1294
|
});
|
|
1265
1295
|
let t = {};
|
|
1266
1296
|
return e.forEach((e, n) => {
|
|
1267
|
-
let [r, i] = n.split("__"), a =
|
|
1297
|
+
let [r, i] = n.split("__"), a = M(r), o = M(i);
|
|
1268
1298
|
if (!a || !o) return;
|
|
1269
|
-
let s = o.x - a.x, c = o.y - a.y, l = Math.sqrt(s * s + c * c) || 1, u = s / l, d = c / l, f = -d, p = u, m = e.length, h =
|
|
1299
|
+
let s = o.x - a.x, c = o.y - a.y, l = Math.sqrt(s * s + c * c) || 1, u = s / l, d = c / l, f = -d, p = u, m = e.length, h = Vt;
|
|
1270
1300
|
if (m > 1) {
|
|
1271
|
-
let e = (m - 1) / 2 *
|
|
1301
|
+
let e = (m - 1) / 2 * Vt, t = (e) => {
|
|
1272
1302
|
let { w: t, h: n } = I(e);
|
|
1273
1303
|
return Math.max(4, (Math.abs(f) * t + Math.abs(p) * n) / 2 - 6);
|
|
1274
1304
|
}, n = Math.min(1, t(a) / e, t(o) / e);
|
|
1275
|
-
h =
|
|
1305
|
+
h = Vt * Math.max(.35, n);
|
|
1276
1306
|
}
|
|
1277
1307
|
let ee = {};
|
|
1278
1308
|
e.forEach((e, t) => {
|
|
@@ -1288,12 +1318,12 @@ var x = {
|
|
|
1288
1318
|
bulge: Math.min(l * .15, 50)
|
|
1289
1319
|
};
|
|
1290
1320
|
}), t;
|
|
1291
|
-
}),
|
|
1292
|
-
let t =
|
|
1321
|
+
}), aa = (e) => {
|
|
1322
|
+
let t = In.value[e.id], n = t && ia.value[t.key];
|
|
1293
1323
|
if (!n) return null;
|
|
1294
|
-
let r =
|
|
1324
|
+
let r = M(e.from), i = M(e.to);
|
|
1295
1325
|
if (!r || !i) return null;
|
|
1296
|
-
let a = n.slots[e.id] || 0, o = a * n.gap, s =
|
|
1326
|
+
let a = n.slots[e.id] || 0, o = a * n.gap, s = ra(r, i, e.fromAnchor), c = ra(i, r, e.toAnchor);
|
|
1297
1327
|
return {
|
|
1298
1328
|
frame: n,
|
|
1299
1329
|
slot: a,
|
|
@@ -1306,12 +1336,12 @@ var x = {
|
|
|
1306
1336
|
y: c.y + n.ny * o
|
|
1307
1337
|
}
|
|
1308
1338
|
};
|
|
1309
|
-
},
|
|
1310
|
-
let t =
|
|
1339
|
+
}, oa = (e) => {
|
|
1340
|
+
let t = aa(e);
|
|
1311
1341
|
if (!t) return "";
|
|
1312
1342
|
let { from: n, to: r, frame: i, slot: a } = t, o = a * i.gap;
|
|
1313
|
-
if (
|
|
1314
|
-
if (
|
|
1343
|
+
if (w.value === "straight") return `M ${n.x} ${n.y} L ${r.x} ${r.y}`;
|
|
1344
|
+
if (w.value === "polyline") {
|
|
1315
1345
|
if (i.dominant === "v") {
|
|
1316
1346
|
let e = (n.y + r.y) / 2 + o;
|
|
1317
1347
|
return `M ${n.x} ${n.y} L ${n.x} ${e} L ${r.x} ${e} L ${r.x} ${r.y}`;
|
|
@@ -1321,18 +1351,18 @@ var x = {
|
|
|
1321
1351
|
}
|
|
1322
1352
|
let s = (n.x + r.x) / 2 + i.nx * i.bulge, c = (n.y + r.y) / 2 + i.ny * i.bulge;
|
|
1323
1353
|
return `M ${n.x} ${n.y} Q ${s} ${c} ${r.x} ${r.y}`;
|
|
1324
|
-
},
|
|
1325
|
-
let n =
|
|
1354
|
+
}, sa = (e, t) => {
|
|
1355
|
+
let n = aa(e);
|
|
1326
1356
|
if (!n) return {
|
|
1327
1357
|
x: 0,
|
|
1328
1358
|
y: 0
|
|
1329
1359
|
};
|
|
1330
1360
|
let { from: r, to: i, frame: a, slot: o } = n, s = o * a.gap;
|
|
1331
|
-
if (
|
|
1361
|
+
if (w.value === "straight") return {
|
|
1332
1362
|
x: r.x + (i.x - r.x) * t,
|
|
1333
1363
|
y: r.y + (i.y - r.y) * t
|
|
1334
1364
|
};
|
|
1335
|
-
if (
|
|
1365
|
+
if (w.value === "polyline") {
|
|
1336
1366
|
if (a.dominant === "v") {
|
|
1337
1367
|
let e = (r.y + i.y) / 2 + s, n = Math.abs(e - r.y), a = Math.abs(i.x - r.x), o = Math.abs(i.y - e), c = t * (n + a + o || 1);
|
|
1338
1368
|
return c <= n ? {
|
|
@@ -1363,19 +1393,19 @@ var x = {
|
|
|
1363
1393
|
x: (1 - t) * (1 - t) * r.x + 2 * (1 - t) * t * c + t * t * i.x,
|
|
1364
1394
|
y: (1 - t) * (1 - t) * r.y + 2 * (1 - t) * t * l + t * t * i.y
|
|
1365
1395
|
};
|
|
1366
|
-
},
|
|
1367
|
-
let e =
|
|
1396
|
+
}, ca = t(() => Y.value ? M(Y.value.fromId) : null), la = t(() => Y.value && Y.value.overId ? M(Y.value.overId) : null), ua = t(() => ca.value ? N(ca.value) : "#00f0ff"), da = t(() => {
|
|
1397
|
+
let e = Y.value;
|
|
1368
1398
|
if (!e) return {
|
|
1369
1399
|
x: 0,
|
|
1370
1400
|
y: 0
|
|
1371
1401
|
};
|
|
1372
|
-
let t =
|
|
1373
|
-
return t &&
|
|
1402
|
+
let t = la.value;
|
|
1403
|
+
return t && ca.value ? ra(t, ca.value, "edge") : {
|
|
1374
1404
|
x: e.px,
|
|
1375
1405
|
y: e.py
|
|
1376
1406
|
};
|
|
1377
|
-
}),
|
|
1378
|
-
let e =
|
|
1407
|
+
}), fa = t(() => {
|
|
1408
|
+
let e = la.value;
|
|
1379
1409
|
if (!e) return null;
|
|
1380
1410
|
let t = L(e);
|
|
1381
1411
|
return {
|
|
@@ -1384,8 +1414,8 @@ var x = {
|
|
|
1384
1414
|
w: t.width + 8,
|
|
1385
1415
|
h: t.height + 8
|
|
1386
1416
|
};
|
|
1387
|
-
}),
|
|
1388
|
-
let t = e.nodeIds.map((e) =>
|
|
1417
|
+
}), pa = (e) => {
|
|
1418
|
+
let t = e.nodeIds.map((e) => M(e)).filter(Boolean);
|
|
1389
1419
|
if (t.length === 0) return null;
|
|
1390
1420
|
let n = e.padding, r = Math.min(...t.map((e) => e.x)) - n, i = Math.min(...t.map((e) => e.y)) - n, a = Math.max(...t.map((e) => e.x)) + n, o = Math.max(...t.map((e) => e.y)) + n;
|
|
1391
1421
|
return {
|
|
@@ -1394,94 +1424,131 @@ var x = {
|
|
|
1394
1424
|
width: a - r,
|
|
1395
1425
|
height: o - i
|
|
1396
1426
|
};
|
|
1397
|
-
},
|
|
1427
|
+
}, ma = t(() => v.groups.map((e) => ({
|
|
1398
1428
|
...e,
|
|
1399
|
-
rect:
|
|
1400
|
-
})).filter((e) => e.rect)), Q = (e) =>
|
|
1401
|
-
let t =
|
|
1429
|
+
rect: pa(e)
|
|
1430
|
+
})).filter((e) => e.rect)), Q = (e) => or(e) ? yr.value : e.color ? e.color : fi.value ? fi.value : e.centerText && e.centerText.color || "#00f0ff", ha = (e) => {
|
|
1431
|
+
let t = In.value[e.id];
|
|
1402
1432
|
return !!t && !t.hidden;
|
|
1403
|
-
},
|
|
1433
|
+
}, ga = t(() => [...new Set(A.value.map(Q))].map((e) => ({
|
|
1404
1434
|
key: String(e).replace("#", ""),
|
|
1405
1435
|
color: e
|
|
1406
|
-
}))),
|
|
1436
|
+
}))), _a = (e) => {
|
|
1407
1437
|
let t = e.endMarker;
|
|
1408
1438
|
if (!t || t === "none") return "";
|
|
1409
1439
|
let n = Q(e) || "#00f0ff", r = String(n).replace("#", "");
|
|
1410
1440
|
return `url(#${t === "dot" ? "edge-dot" : "edge-arrow"}-${r})`;
|
|
1411
|
-
},
|
|
1441
|
+
}, va = /* @__PURE__ */ new Map(), ya = {
|
|
1412
1442
|
nodes: null,
|
|
1413
1443
|
edges: null,
|
|
1414
1444
|
mode: null,
|
|
1415
1445
|
epoch: -1
|
|
1416
|
-
},
|
|
1417
|
-
let e =
|
|
1418
|
-
(e.nodes !==
|
|
1419
|
-
nodes:
|
|
1420
|
-
edges:
|
|
1421
|
-
mode:
|
|
1422
|
-
epoch:
|
|
1423
|
-
},
|
|
1446
|
+
}, ba = () => {
|
|
1447
|
+
let e = ya;
|
|
1448
|
+
(e.nodes !== S.value || e.edges !== A.value || e.mode !== w.value || e.epoch !== Qt) && (ya = {
|
|
1449
|
+
nodes: S.value,
|
|
1450
|
+
edges: A.value,
|
|
1451
|
+
mode: w.value,
|
|
1452
|
+
epoch: Qt
|
|
1453
|
+
}, va = /* @__PURE__ */ new Map());
|
|
1424
1454
|
}, $ = (e) => {
|
|
1425
|
-
|
|
1426
|
-
let t =
|
|
1427
|
-
return t === void 0 && (t =
|
|
1428
|
-
},
|
|
1429
|
-
let t =
|
|
1455
|
+
ba();
|
|
1456
|
+
let t = va.get(e.id);
|
|
1457
|
+
return t === void 0 && (t = oa(e), va.set(e.id, t)), t;
|
|
1458
|
+
}, xa = (e, t = 1) => `${2 / e.speed * t}s`, Sa = (e) => `${3 / e.speed}s`, Ca = t(() => v.config.edgeDashFlow === !0), wa = t(() => {
|
|
1459
|
+
let e = v.config.edgeDashPattern, t = null;
|
|
1460
|
+
return typeof e == "string" && e.trim() ? t = e.trim().split(/\s+/).map(Number).filter((e) => Number.isFinite(e) && e > 0) : Array.isArray(e) && (t = e.map(Number).filter((e) => Number.isFinite(e) && e > 0)), t && t.length ? t : [10, 8];
|
|
1461
|
+
}), Ta = t(() => wa.value.join(" ")), Ea = t(() => wa.value.reduce((e, t) => e + t, 0)), Da = (e) => {
|
|
1462
|
+
let t = Number(e.dashFlowWidth ?? v.config.edgeDashFlowWidth);
|
|
1463
|
+
return Number.isFinite(t) && t > 0 ? t : 2;
|
|
1464
|
+
}, Oa = (e) => {
|
|
1465
|
+
let t = Number(e.speed);
|
|
1466
|
+
return `${1.2 / (Number.isFinite(t) && t > 0 ? t : 1)}s`;
|
|
1467
|
+
}, ka = (e) => e.animated === !1 ? !1 : e.dashFlow === !0 || e.dashFlow !== !1 && Ca.value, Aa = (e) => {
|
|
1468
|
+
let t = Ci(e);
|
|
1430
1469
|
return t === "flow" || t === "all";
|
|
1431
|
-
},
|
|
1432
|
-
let t =
|
|
1470
|
+
}, ja = (e) => {
|
|
1471
|
+
let t = Ci(e);
|
|
1433
1472
|
return t === "particle" || t === "all";
|
|
1434
|
-
},
|
|
1473
|
+
}, Ma = (e) => en(e).text, Na = (e) => !!e && String(en(e).text ?? "").trim() !== "", Pa = (e, t) => {
|
|
1435
1474
|
if (!e) return null;
|
|
1436
|
-
let n =
|
|
1475
|
+
let n = en(e), r = Number(t.fontSize) || Number(n.fontSize) || 8, i = String(n.text ?? ""), a = 0;
|
|
1437
1476
|
for (let e of i) a += e.charCodeAt(0) > 11904 ? 1 : .62;
|
|
1438
1477
|
return {
|
|
1439
1478
|
w: Math.max(14, a * r + 8),
|
|
1440
1479
|
h: Math.max(12, r + 6)
|
|
1441
1480
|
};
|
|
1442
|
-
},
|
|
1443
|
-
let n =
|
|
1481
|
+
}, Fa = (e, t) => {
|
|
1482
|
+
let n = t && typeof t == "object" ? t : {}, r = n.showBg === void 0 ? li.value : !!n.showBg, i = n.bgColor || ui.value, a = di.value;
|
|
1483
|
+
if (n.bgOpacity !== void 0 && n.bgOpacity !== null) {
|
|
1484
|
+
let e = Number(n.bgOpacity);
|
|
1485
|
+
Number.isFinite(e) && (a = Math.min(1, Math.max(0, e)));
|
|
1486
|
+
}
|
|
1487
|
+
let o = [
|
|
1488
|
+
"solid",
|
|
1489
|
+
"dashed",
|
|
1490
|
+
"none"
|
|
1491
|
+
].includes(n.borderStyle) ? n.borderStyle : "solid", s = n.borderColor || on(e, t), c = n.borderColor ? 1 : .35;
|
|
1492
|
+
return {
|
|
1493
|
+
show: r,
|
|
1494
|
+
fill: i,
|
|
1495
|
+
opacity: a,
|
|
1496
|
+
borderStyle: o,
|
|
1497
|
+
borderColor: s,
|
|
1498
|
+
borderOpacity: c
|
|
1499
|
+
};
|
|
1500
|
+
}, Ia = (e, t) => {
|
|
1501
|
+
let n = sa(e, Math.max(0, t - .005)), r = sa(e, Math.min(1, t + .005));
|
|
1444
1502
|
return Math.atan2(r.y - n.y, r.x - n.x) * 180 / Math.PI;
|
|
1445
|
-
},
|
|
1503
|
+
}, La = (e) => {
|
|
1446
1504
|
let t = e % 180;
|
|
1447
1505
|
return t > 90 && (t -= 180), t < -90 && (t += 180), t;
|
|
1448
|
-
},
|
|
1506
|
+
}, Ra = (e, t, n) => `translate(${t.x}, ${t.y}) rotate(${(en(e).rotation || 0) + (n || 0)})`, za = t(() => v.config?.edgeCenterTextFollowLine !== !1), Ba = (e, t) => za.value ? Math.abs(e) <= Zt || v.config?.edgeCenterTextFollowLine ? e : t > 0 ? Math.abs(e) : -Math.abs(e) : 0, Va = () => ({
|
|
1507
|
+
fromT: .28,
|
|
1508
|
+
toT: .72
|
|
1509
|
+
}), Ha = t(() => {
|
|
1449
1510
|
let e = [];
|
|
1450
|
-
for (let t of
|
|
1451
|
-
let n =
|
|
1511
|
+
for (let t of G.value) {
|
|
1512
|
+
let n = In.value[t.id];
|
|
1452
1513
|
if (!n) continue;
|
|
1453
1514
|
let r = n.merged && n.representative, i = !n.merged && (t.fromText || t.centerText || t.toText);
|
|
1454
1515
|
if (!r && !i) continue;
|
|
1455
|
-
let a =
|
|
1456
|
-
a
|
|
1516
|
+
let a = M(t.from), o = M(t.to);
|
|
1517
|
+
if (!a || !o) continue;
|
|
1518
|
+
let { fromT: s, toT: c } = Va();
|
|
1519
|
+
e.push({
|
|
1457
1520
|
id: t.id,
|
|
1458
1521
|
edge: t,
|
|
1459
1522
|
info: n,
|
|
1460
|
-
color: a &&
|
|
1461
|
-
start:
|
|
1462
|
-
center:
|
|
1463
|
-
end:
|
|
1464
|
-
startAngle:
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1523
|
+
color: a && oe[a.nodeType] || "#00f0ff",
|
|
1524
|
+
start: sa(t, s),
|
|
1525
|
+
center: sa(t, .5),
|
|
1526
|
+
end: sa(t, c),
|
|
1527
|
+
startAngle: La(Ia(t, s)),
|
|
1528
|
+
centerRaw: Ia(t, .5),
|
|
1529
|
+
centerAngle: La(Ia(t, .5)),
|
|
1530
|
+
endAngle: La(Ia(t, c)),
|
|
1531
|
+
fromBox: Pa(t.fromText, t),
|
|
1532
|
+
centerBox: Pa(t.centerText, t),
|
|
1533
|
+
toBox: Pa(t.toText, t),
|
|
1534
|
+
fromPlate: Fa(t, t.fromText),
|
|
1535
|
+
centerPlate: Fa(t, t.centerText),
|
|
1536
|
+
toPlate: Fa(t, t.toText)
|
|
1470
1537
|
});
|
|
1471
1538
|
}
|
|
1472
1539
|
return e;
|
|
1473
1540
|
});
|
|
1474
|
-
return
|
|
1475
|
-
resetDataBaseline:
|
|
1476
|
-
getData:
|
|
1477
|
-
setData:
|
|
1478
|
-
removeSelected:
|
|
1479
|
-
addNodes:
|
|
1480
|
-
addEdges:
|
|
1481
|
-
updateNodes:
|
|
1482
|
-
updateEdges:
|
|
1483
|
-
clientToSvg:
|
|
1484
|
-
svgToClient:
|
|
1541
|
+
return re({
|
|
1542
|
+
resetDataBaseline: Sn,
|
|
1543
|
+
getData: Cn,
|
|
1544
|
+
setData: Fn,
|
|
1545
|
+
removeSelected: Tn,
|
|
1546
|
+
addNodes: jn,
|
|
1547
|
+
addEdges: Mn,
|
|
1548
|
+
updateNodes: Nn,
|
|
1549
|
+
updateEdges: Pn,
|
|
1550
|
+
clientToSvg: Wi,
|
|
1551
|
+
svgToClient: Gi,
|
|
1485
1552
|
moveLayerUp: mr,
|
|
1486
1553
|
moveLayerDown: hr,
|
|
1487
1554
|
moveToFront: gr,
|
|
@@ -1489,31 +1556,31 @@ var x = {
|
|
|
1489
1556
|
downloadSVG: vr
|
|
1490
1557
|
}), (t, o) => (d(), r("svg", {
|
|
1491
1558
|
ref_key: "svgRef",
|
|
1492
|
-
ref:
|
|
1559
|
+
ref: E,
|
|
1493
1560
|
class: "topology-svg",
|
|
1494
|
-
style: c(
|
|
1495
|
-
viewBox: `${Ar.value} ${jr.value} ${
|
|
1561
|
+
style: c(ni.value),
|
|
1562
|
+
viewBox: `${Ar.value} ${jr.value} ${U.value} ${W.value}`,
|
|
1496
1563
|
onMousedown: Kr,
|
|
1497
|
-
onMousemove:
|
|
1498
|
-
onMouseup:
|
|
1499
|
-
onMouseleave:
|
|
1564
|
+
onMousemove: Mi,
|
|
1565
|
+
onMouseup: Pi,
|
|
1566
|
+
onMouseleave: Pi,
|
|
1500
1567
|
onClick: Tr,
|
|
1501
|
-
onWheel:
|
|
1568
|
+
onWheel: g(Lr, ["prevent"])
|
|
1502
1569
|
}, [
|
|
1503
1570
|
i("defs", null, [
|
|
1504
1571
|
o[3] ||= a("<linearGradient id=\"glassHighlight\" x1=\"0%\" y1=\"0%\" x2=\"60%\" y2=\"100%\"><stop offset=\"0%\" stop-color=\"rgba(255,255,255,0.9)\"></stop><stop offset=\"30%\" stop-color=\"rgba(255,255,255,0.25)\"></stop><stop offset=\"100%\" stop-color=\"rgba(255,255,255,0)\"></stop></linearGradient><filter id=\"glow-core\" x=\"-50%\" y=\"-50%\" width=\"200%\" height=\"200%\"><feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"3\" result=\"blur\"></feGaussianBlur><feMerge><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"SourceGraphic\"></feMergeNode></feMerge></filter><filter id=\"glow-strong\" x=\"-50%\" y=\"-50%\" width=\"200%\" height=\"200%\"><feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"6\" result=\"blur\"></feGaussianBlur><feMerge><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"SourceGraphic\"></feMergeNode></feMerge></filter>", 3),
|
|
1505
1572
|
i("radialGradient", {
|
|
1506
1573
|
id: "bg-grid",
|
|
1507
|
-
cx:
|
|
1508
|
-
cy:
|
|
1509
|
-
r:
|
|
1510
|
-
}, [(d(!0), r(e, null, p(
|
|
1574
|
+
cx: si.value.cx,
|
|
1575
|
+
cy: si.value.cy,
|
|
1576
|
+
r: si.value.r
|
|
1577
|
+
}, [(d(!0), r(e, null, p(si.value.stops, (e, t) => (d(), r("stop", {
|
|
1511
1578
|
key: `bg-stop-${t}`,
|
|
1512
1579
|
offset: e.offset,
|
|
1513
1580
|
"stop-color": e.color,
|
|
1514
1581
|
"stop-opacity": e.opacity
|
|
1515
|
-
}, null, 8,
|
|
1516
|
-
(d(!0), r(e, null, p(ee(
|
|
1582
|
+
}, null, 8, le))), 128))], 8, ce),
|
|
1583
|
+
(d(!0), r(e, null, p(ee(b), (e, t) => (d(), r("radialGradient", {
|
|
1517
1584
|
key: `breath-${t}`,
|
|
1518
1585
|
id: `breath-grad-${t}`
|
|
1519
1586
|
}, [
|
|
@@ -1521,20 +1588,20 @@ var x = {
|
|
|
1521
1588
|
offset: "0%",
|
|
1522
1589
|
"stop-color": e.color,
|
|
1523
1590
|
"stop-opacity": "1"
|
|
1524
|
-
}, null, 8,
|
|
1591
|
+
}, null, 8, de),
|
|
1525
1592
|
i("stop", {
|
|
1526
1593
|
offset: "40%",
|
|
1527
1594
|
"stop-color": e.color,
|
|
1528
1595
|
"stop-opacity": "0.5"
|
|
1529
|
-
}, null, 8,
|
|
1596
|
+
}, null, 8, fe),
|
|
1530
1597
|
i("stop", {
|
|
1531
1598
|
offset: "100%",
|
|
1532
1599
|
"stop-color": e.color,
|
|
1533
1600
|
"stop-opacity": "0"
|
|
1534
|
-
}, null, 8,
|
|
1535
|
-
], 8,
|
|
1601
|
+
}, null, 8, pe)
|
|
1602
|
+
], 8, ue))), 128)),
|
|
1536
1603
|
o[4] ||= a("<linearGradient id=\"flow-grad-1\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0%\" stop-color=\"#00f0ff\" stop-opacity=\"0\"></stop><stop offset=\"40%\" stop-color=\"#00f0ff\" stop-opacity=\"1\"></stop><stop offset=\"60%\" stop-color=\"#00f0ff\" stop-opacity=\"1\"></stop><stop offset=\"100%\" stop-color=\"#00f0ff\" stop-opacity=\"0\"></stop></linearGradient>", 1),
|
|
1537
|
-
(d(!0), r(e, null, p(
|
|
1604
|
+
(d(!0), r(e, null, p(ga.value, (e) => (d(), r("marker", {
|
|
1538
1605
|
key: `m-arrow-${e.key}`,
|
|
1539
1606
|
id: `edge-arrow-${e.key}`,
|
|
1540
1607
|
viewBox: "0 0 10 10",
|
|
@@ -1547,8 +1614,8 @@ var x = {
|
|
|
1547
1614
|
}, [i("path", {
|
|
1548
1615
|
d: "M1,2.5 L9,5 L1,7.5 Z",
|
|
1549
1616
|
fill: e.color
|
|
1550
|
-
}, null, 8,
|
|
1551
|
-
(d(!0), r(e, null, p(
|
|
1617
|
+
}, null, 8, he)], 8, me))), 128)),
|
|
1618
|
+
(d(!0), r(e, null, p(ga.value, (e) => (d(), r("marker", {
|
|
1552
1619
|
key: `m-dot-${e.key}`,
|
|
1553
1620
|
id: `edge-dot-${e.key}`,
|
|
1554
1621
|
viewBox: "0 0 10 10",
|
|
@@ -1563,34 +1630,34 @@ var x = {
|
|
|
1563
1630
|
cy: "5",
|
|
1564
1631
|
r: "4",
|
|
1565
1632
|
fill: e.color
|
|
1566
|
-
}, null, 8,
|
|
1633
|
+
}, null, 8, _e)], 8, ge))), 128))
|
|
1567
1634
|
]),
|
|
1568
1635
|
i("rect", {
|
|
1569
|
-
width:
|
|
1570
|
-
height:
|
|
1636
|
+
width: U.value,
|
|
1637
|
+
height: W.value,
|
|
1571
1638
|
x: Ar.value,
|
|
1572
1639
|
y: jr.value,
|
|
1573
1640
|
fill: "url(#bg-grid)"
|
|
1574
|
-
}, null, 8,
|
|
1575
|
-
|
|
1641
|
+
}, null, 8, ve),
|
|
1642
|
+
ri.value ? (d(), r(e, { key: 0 }, [i("pattern", {
|
|
1576
1643
|
id: "grid",
|
|
1577
|
-
width:
|
|
1578
|
-
height:
|
|
1644
|
+
width: ai.value,
|
|
1645
|
+
height: ai.value,
|
|
1579
1646
|
patternUnits: "userSpaceOnUse"
|
|
1580
1647
|
}, [i("path", {
|
|
1581
|
-
d: `M ${
|
|
1648
|
+
d: `M ${ai.value} 0 L 0 0 0 ${ai.value}`,
|
|
1582
1649
|
fill: "none",
|
|
1583
|
-
stroke:
|
|
1650
|
+
stroke: ii.value,
|
|
1584
1651
|
"stroke-width": "0.5"
|
|
1585
|
-
}, null, 8,
|
|
1586
|
-
width:
|
|
1587
|
-
height:
|
|
1652
|
+
}, null, 8, be)], 8, ye), i("rect", {
|
|
1653
|
+
width: U.value,
|
|
1654
|
+
height: W.value,
|
|
1588
1655
|
x: Ar.value,
|
|
1589
1656
|
y: jr.value,
|
|
1590
1657
|
fill: "url(#grid)",
|
|
1591
|
-
opacity:
|
|
1592
|
-
}, null, 8,
|
|
1593
|
-
|
|
1658
|
+
opacity: oi.value
|
|
1659
|
+
}, null, 8, xe)], 64)) : n("", !0),
|
|
1660
|
+
ci.value ? (d(), r("g", Se, [...o[5] ||= [
|
|
1594
1661
|
i("line", {
|
|
1595
1662
|
x1: "-22",
|
|
1596
1663
|
y1: "0",
|
|
@@ -1622,7 +1689,7 @@ var x = {
|
|
|
1622
1689
|
opacity: "0.8"
|
|
1623
1690
|
}, null, -1)
|
|
1624
1691
|
]])) : n("", !0),
|
|
1625
|
-
(d(!0), r(e, null, p(
|
|
1692
|
+
(d(!0), r(e, null, p(ma.value, (e) => (d(), r("g", { key: e.id }, [
|
|
1626
1693
|
i("rect", {
|
|
1627
1694
|
x: e.rect.x,
|
|
1628
1695
|
y: e.rect.y,
|
|
@@ -1631,7 +1698,7 @@ var x = {
|
|
|
1631
1698
|
rx: "16",
|
|
1632
1699
|
fill: e.color,
|
|
1633
1700
|
opacity: "0.03"
|
|
1634
|
-
}, null, 8,
|
|
1701
|
+
}, null, 8, Ce),
|
|
1635
1702
|
i("rect", {
|
|
1636
1703
|
x: e.rect.x,
|
|
1637
1704
|
y: e.rect.y,
|
|
@@ -1643,35 +1710,35 @@ var x = {
|
|
|
1643
1710
|
"stroke-width": "1.5",
|
|
1644
1711
|
"stroke-dasharray": "8 5",
|
|
1645
1712
|
opacity: "0.35"
|
|
1646
|
-
}, null, 8,
|
|
1713
|
+
}, null, 8, we),
|
|
1647
1714
|
i("circle", {
|
|
1648
1715
|
cx: e.rect.x + 4,
|
|
1649
1716
|
cy: e.rect.y + 4,
|
|
1650
1717
|
r: "3",
|
|
1651
1718
|
fill: e.color,
|
|
1652
1719
|
opacity: "0.5"
|
|
1653
|
-
}, null, 8,
|
|
1720
|
+
}, null, 8, Te),
|
|
1654
1721
|
i("circle", {
|
|
1655
1722
|
cx: e.rect.x + e.rect.width - 4,
|
|
1656
1723
|
cy: e.rect.y + 4,
|
|
1657
1724
|
r: "3",
|
|
1658
1725
|
fill: e.color,
|
|
1659
1726
|
opacity: "0.5"
|
|
1660
|
-
}, null, 8,
|
|
1727
|
+
}, null, 8, Ee),
|
|
1661
1728
|
i("circle", {
|
|
1662
1729
|
cx: e.rect.x + 4,
|
|
1663
1730
|
cy: e.rect.y + e.rect.height - 4,
|
|
1664
1731
|
r: "3",
|
|
1665
1732
|
fill: e.color,
|
|
1666
1733
|
opacity: "0.5"
|
|
1667
|
-
}, null, 8,
|
|
1734
|
+
}, null, 8, De),
|
|
1668
1735
|
i("circle", {
|
|
1669
1736
|
cx: e.rect.x + e.rect.width - 4,
|
|
1670
1737
|
cy: e.rect.y + e.rect.height - 4,
|
|
1671
1738
|
r: "3",
|
|
1672
1739
|
fill: e.color,
|
|
1673
1740
|
opacity: "0.5"
|
|
1674
|
-
}, null, 8,
|
|
1741
|
+
}, null, 8, Oe),
|
|
1675
1742
|
i("text", {
|
|
1676
1743
|
x: e.rect.x + 14,
|
|
1677
1744
|
y: e.rect.y + 20,
|
|
@@ -1682,43 +1749,44 @@ var x = {
|
|
|
1682
1749
|
"font-weight": "600",
|
|
1683
1750
|
opacity: "0.7",
|
|
1684
1751
|
"letter-spacing": "0.5"
|
|
1685
|
-
}, h(e.label), 9,
|
|
1752
|
+
}, h(e.label), 9, ke)
|
|
1686
1753
|
]))), 128)),
|
|
1687
|
-
|
|
1754
|
+
dr.value ? (d(), r("g", Ae, [(d(!0), r(e, null, p(Ir.value, (e) => (d(), r("g", {
|
|
1688
1755
|
key: `node-base-${e.id}`,
|
|
1689
1756
|
transform: `translate(${e.x}, ${e.y})`
|
|
1690
|
-
}, [
|
|
1757
|
+
}, [ir(e) && _.viewMode !== "3d" ? (d(), r("rect", {
|
|
1691
1758
|
key: 0,
|
|
1692
1759
|
x: L(e).x,
|
|
1693
1760
|
y: L(e).y,
|
|
1694
1761
|
width: L(e).width,
|
|
1695
1762
|
height: L(e).height,
|
|
1696
|
-
rx:
|
|
1697
|
-
fill:
|
|
1763
|
+
rx: Di(e),
|
|
1764
|
+
fill: ir(e),
|
|
1698
1765
|
opacity: "0.15"
|
|
1699
|
-
}, null, 8,
|
|
1766
|
+
}, null, 8, Me)) : n("", !0), R(e) && _.viewMode !== "3d" ? (d(), r("rect", {
|
|
1700
1767
|
key: 1,
|
|
1701
1768
|
x: R(e).x,
|
|
1702
1769
|
y: R(e).y,
|
|
1703
1770
|
width: R(e).width,
|
|
1704
1771
|
height: R(e).height,
|
|
1705
|
-
rx:
|
|
1772
|
+
rx: Di(e),
|
|
1706
1773
|
fill: "none",
|
|
1707
|
-
stroke:
|
|
1708
|
-
"stroke-width":
|
|
1709
|
-
"stroke-dasharray":
|
|
1774
|
+
stroke: wi(e),
|
|
1775
|
+
"stroke-width": Ti(e),
|
|
1776
|
+
"stroke-dasharray": Ei(e),
|
|
1710
1777
|
opacity: "0.8"
|
|
1711
|
-
}, null, 8,
|
|
1712
|
-
(d(!0), r(e, null, p(
|
|
1713
|
-
key:
|
|
1714
|
-
d: $(
|
|
1778
|
+
}, null, 8, Ne)) : n("", !0)], 8, je))), 128))])) : n("", !0),
|
|
1779
|
+
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `base-${t.id}` }, [ka(t) ? n("", !0) : (d(), r("path", {
|
|
1780
|
+
key: 0,
|
|
1781
|
+
d: $(t),
|
|
1715
1782
|
fill: "none",
|
|
1716
|
-
stroke:
|
|
1783
|
+
stroke: mi(t),
|
|
1784
|
+
opacity: hi(t),
|
|
1717
1785
|
"stroke-width": "2",
|
|
1718
1786
|
"stroke-linecap": "round",
|
|
1719
|
-
"marker-end":
|
|
1720
|
-
}, null, 8,
|
|
1721
|
-
(d(!0), r(e, null, p(
|
|
1787
|
+
"marker-end": _a(t)
|
|
1788
|
+
}, null, 8, Pe))], 64))), 128)),
|
|
1789
|
+
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `glow-${t.id}` }, [xi.value ? (d(), r("path", {
|
|
1722
1790
|
key: 0,
|
|
1723
1791
|
d: $(t),
|
|
1724
1792
|
fill: "none",
|
|
@@ -1727,8 +1795,8 @@ var x = {
|
|
|
1727
1795
|
"stroke-linecap": "round",
|
|
1728
1796
|
opacity: "0.15",
|
|
1729
1797
|
filter: "url(#glow-strong)"
|
|
1730
|
-
}, null, 8,
|
|
1731
|
-
(d(!0), r(e, null, p(
|
|
1798
|
+
}, null, 8, Fe)) : n("", !0)], 64))), 128)),
|
|
1799
|
+
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `sel-${t.id}` }, [or(t) ? (d(), r("path", {
|
|
1732
1800
|
key: 0,
|
|
1733
1801
|
d: $(t),
|
|
1734
1802
|
fill: "none",
|
|
@@ -1736,8 +1804,8 @@ var x = {
|
|
|
1736
1804
|
"stroke-width": "4",
|
|
1737
1805
|
opacity: "0.35",
|
|
1738
1806
|
filter: "url(#glow-strong)"
|
|
1739
|
-
}, null, 8,
|
|
1740
|
-
(d(!0), r(e, null, p(
|
|
1807
|
+
}, null, 8, Ie)) : n("", !0)], 64))), 128)),
|
|
1808
|
+
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `flow-${t.id}` }, [Aa(t) ? (d(), r("g", Le, [
|
|
1741
1809
|
i("path", {
|
|
1742
1810
|
d: $(t),
|
|
1743
1811
|
fill: "none",
|
|
@@ -1750,9 +1818,9 @@ var x = {
|
|
|
1750
1818
|
attributeName: "stroke-dashoffset",
|
|
1751
1819
|
from: "0",
|
|
1752
1820
|
to: "-52",
|
|
1753
|
-
dur:
|
|
1821
|
+
dur: xa(t),
|
|
1754
1822
|
repeatCount: "indefinite"
|
|
1755
|
-
}, null, 8,
|
|
1823
|
+
}, null, 8, ze)], 8, Re),
|
|
1756
1824
|
i("path", {
|
|
1757
1825
|
d: $(t),
|
|
1758
1826
|
fill: "none",
|
|
@@ -1765,9 +1833,9 @@ var x = {
|
|
|
1765
1833
|
attributeName: "stroke-dashoffset",
|
|
1766
1834
|
from: "-30",
|
|
1767
1835
|
to: "-82",
|
|
1768
|
-
dur:
|
|
1836
|
+
dur: xa(t, 1.3),
|
|
1769
1837
|
repeatCount: "indefinite"
|
|
1770
|
-
}, null, 8,
|
|
1838
|
+
}, null, 8, Ve)], 8, Be),
|
|
1771
1839
|
i("path", {
|
|
1772
1840
|
d: $(t),
|
|
1773
1841
|
fill: "none",
|
|
@@ -1781,161 +1849,181 @@ var x = {
|
|
|
1781
1849
|
attributeName: "stroke-dashoffset",
|
|
1782
1850
|
from: "0",
|
|
1783
1851
|
to: "-84",
|
|
1784
|
-
dur:
|
|
1852
|
+
dur: xa(t, .8),
|
|
1785
1853
|
repeatCount: "indefinite"
|
|
1786
|
-
}, null, 8,
|
|
1854
|
+
}, null, 8, Ue)], 8, He)
|
|
1787
1855
|
])) : n("", !0)], 64))), 128)),
|
|
1788
|
-
(d(!0), r(e, null, p(
|
|
1856
|
+
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `dash-${t.id}` }, [ka(t) ? (d(), r("path", {
|
|
1857
|
+
key: 0,
|
|
1858
|
+
d: $(t),
|
|
1859
|
+
fill: "none",
|
|
1860
|
+
stroke: Q(t),
|
|
1861
|
+
"stroke-width": Da(t),
|
|
1862
|
+
"stroke-linecap": "round",
|
|
1863
|
+
"stroke-dasharray": Ta.value,
|
|
1864
|
+
"marker-end": _a(t),
|
|
1865
|
+
opacity: "0.9"
|
|
1866
|
+
}, [i("animate", {
|
|
1867
|
+
attributeName: "stroke-dashoffset",
|
|
1868
|
+
from: "0",
|
|
1869
|
+
to: `${-Ea.value}`,
|
|
1870
|
+
dur: Oa(t),
|
|
1871
|
+
repeatCount: "indefinite"
|
|
1872
|
+
}, null, 8, Ge)], 8, We)) : n("", !0)], 64))), 128)),
|
|
1873
|
+
(d(!0), r(e, null, p(G.value, (t) => (d(), r(e, { key: `particle-${t.id}` }, [ja(t) ? (d(), r("g", Ke, [i("circle", {
|
|
1789
1874
|
r: "3",
|
|
1790
1875
|
fill: Q(t),
|
|
1791
1876
|
opacity: "0.9",
|
|
1792
1877
|
filter: "url(#glow-core)"
|
|
1793
1878
|
}, [i("animateMotion", {
|
|
1794
1879
|
path: $(t),
|
|
1795
|
-
dur:
|
|
1880
|
+
dur: Sa(t),
|
|
1796
1881
|
repeatCount: "indefinite"
|
|
1797
|
-
}, null, 8,
|
|
1882
|
+
}, null, 8, Je)], 8, qe), i("circle", {
|
|
1798
1883
|
r: "8",
|
|
1799
1884
|
fill: Q(t),
|
|
1800
1885
|
opacity: "0.2",
|
|
1801
1886
|
filter: "url(#glow-strong)"
|
|
1802
1887
|
}, [i("animateMotion", {
|
|
1803
1888
|
path: $(t),
|
|
1804
|
-
dur:
|
|
1889
|
+
dur: Sa(t),
|
|
1805
1890
|
repeatCount: "indefinite"
|
|
1806
|
-
}, null, 8,
|
|
1807
|
-
(d(!0), r(e, null, p(
|
|
1891
|
+
}, null, 8, Xe)], 8, Ye)])) : n("", !0)], 64))), 128)),
|
|
1892
|
+
(d(!0), r(e, null, p(Ha.value, (t) => (d(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (d(), r("g", {
|
|
1808
1893
|
key: 0,
|
|
1809
1894
|
transform: `translate(${t.center.x}, ${t.center.y}) rotate(${t.centerAngle})`
|
|
1810
1895
|
}, [i("rect", {
|
|
1811
1896
|
x: "-7",
|
|
1812
|
-
y: -
|
|
1897
|
+
y: -an(t.edge, null) / 2,
|
|
1813
1898
|
width: 14,
|
|
1814
|
-
height:
|
|
1899
|
+
height: an(t.edge, null),
|
|
1815
1900
|
rx: "2",
|
|
1816
1901
|
fill: "#FFFFFF",
|
|
1817
1902
|
opacity: "0.9",
|
|
1818
1903
|
stroke: t.color,
|
|
1819
1904
|
"stroke-width": "0.6"
|
|
1820
|
-
}, null, 8,
|
|
1905
|
+
}, null, 8, Qe), i("text", {
|
|
1821
1906
|
y: "0",
|
|
1822
1907
|
"dominant-baseline": "central",
|
|
1823
1908
|
"text-anchor": "middle",
|
|
1824
|
-
"font-size":
|
|
1825
|
-
fill:
|
|
1909
|
+
"font-size": an(t.edge, null),
|
|
1910
|
+
fill: on(t.edge, null),
|
|
1826
1911
|
"font-family": "'SF Mono', monospace",
|
|
1827
1912
|
opacity: "1"
|
|
1828
|
-
}, h(t.info.count), 9,
|
|
1829
|
-
|
|
1913
|
+
}, h(t.info.count), 9, $e)], 8, Ze)) : t.info.merged ? n("", !0) : (d(), r("g", et, [
|
|
1914
|
+
Na(t.edge.fromText) ? (d(), r("g", {
|
|
1830
1915
|
key: 0,
|
|
1831
|
-
transform:
|
|
1832
|
-
}, [
|
|
1916
|
+
transform: Ra(t.edge.fromText, t.start, t.startAngle)
|
|
1917
|
+
}, [t.fromPlate.show ? (d(), r("rect", {
|
|
1833
1918
|
key: 0,
|
|
1834
1919
|
x: -t.fromBox.w / 2,
|
|
1835
1920
|
y: -t.fromBox.h / 2,
|
|
1836
1921
|
width: t.fromBox.w,
|
|
1837
1922
|
height: t.fromBox.h,
|
|
1838
1923
|
rx: "3",
|
|
1839
|
-
fill:
|
|
1840
|
-
opacity:
|
|
1841
|
-
stroke:
|
|
1842
|
-
"stroke-
|
|
1843
|
-
"stroke-
|
|
1844
|
-
|
|
1924
|
+
fill: t.fromPlate.fill,
|
|
1925
|
+
opacity: t.fromPlate.opacity,
|
|
1926
|
+
stroke: t.fromPlate.borderStyle === "none" ? "none" : t.fromPlate.borderColor,
|
|
1927
|
+
"stroke-width": "0.6",
|
|
1928
|
+
"stroke-opacity": t.fromPlate.borderOpacity,
|
|
1929
|
+
"stroke-dasharray": t.fromPlate.borderStyle === "dashed" ? "3 2" : void 0
|
|
1930
|
+
}, null, 8, nt)) : n("", !0), i("text", {
|
|
1845
1931
|
y: "0",
|
|
1846
1932
|
"dominant-baseline": "central",
|
|
1847
1933
|
"text-anchor": "middle",
|
|
1848
|
-
"font-size":
|
|
1849
|
-
fill:
|
|
1934
|
+
"font-size": an(t.edge, t.edge.fromText),
|
|
1935
|
+
fill: on(t.edge, t.edge.fromText),
|
|
1850
1936
|
"font-family": "'SF Mono', monospace",
|
|
1851
1937
|
"font-weight": "500",
|
|
1852
1938
|
opacity: "0.9"
|
|
1853
|
-
}, h(
|
|
1854
|
-
|
|
1939
|
+
}, h(Ma(t.edge.fromText)), 9, rt)], 8, tt)) : n("", !0),
|
|
1940
|
+
Na(t.edge.centerText) ? (d(), r("g", {
|
|
1855
1941
|
key: 1,
|
|
1856
|
-
transform:
|
|
1857
|
-
}, [
|
|
1942
|
+
transform: Ra(t.edge.centerText, t.center, Ba(t.centerAngle, t.centerRaw))
|
|
1943
|
+
}, [t.centerPlate.show ? (d(), r("rect", {
|
|
1858
1944
|
key: 0,
|
|
1859
1945
|
x: -t.centerBox.w / 2,
|
|
1860
1946
|
y: -t.centerBox.h / 2,
|
|
1861
1947
|
width: t.centerBox.w,
|
|
1862
1948
|
height: t.centerBox.h,
|
|
1863
1949
|
rx: "3",
|
|
1864
|
-
fill:
|
|
1865
|
-
opacity:
|
|
1866
|
-
stroke:
|
|
1867
|
-
"stroke-
|
|
1868
|
-
"stroke-
|
|
1869
|
-
|
|
1950
|
+
fill: t.centerPlate.fill,
|
|
1951
|
+
opacity: t.centerPlate.opacity,
|
|
1952
|
+
stroke: t.centerPlate.borderStyle === "none" ? "none" : t.centerPlate.borderColor,
|
|
1953
|
+
"stroke-width": "0.6",
|
|
1954
|
+
"stroke-opacity": t.centerPlate.borderOpacity,
|
|
1955
|
+
"stroke-dasharray": t.centerPlate.borderStyle === "dashed" ? "3 2" : void 0
|
|
1956
|
+
}, null, 8, at)) : n("", !0), i("text", {
|
|
1870
1957
|
y: "0",
|
|
1871
1958
|
"dominant-baseline": "central",
|
|
1872
1959
|
"text-anchor": "middle",
|
|
1873
|
-
"font-size":
|
|
1874
|
-
fill:
|
|
1960
|
+
"font-size": an(t.edge, t.edge.centerText),
|
|
1961
|
+
fill: on(t.edge, t.edge.centerText),
|
|
1875
1962
|
"font-family": "'SF Mono', monospace",
|
|
1876
1963
|
"font-weight": "600",
|
|
1877
1964
|
opacity: "1"
|
|
1878
|
-
}, h(
|
|
1879
|
-
|
|
1965
|
+
}, h(Ma(t.edge.centerText)), 9, ot)], 8, it)) : n("", !0),
|
|
1966
|
+
Na(t.edge.toText) ? (d(), r("g", {
|
|
1880
1967
|
key: 2,
|
|
1881
|
-
transform:
|
|
1882
|
-
}, [
|
|
1968
|
+
transform: Ra(t.edge.toText, t.end, t.endAngle)
|
|
1969
|
+
}, [t.toPlate.show ? (d(), r("rect", {
|
|
1883
1970
|
key: 0,
|
|
1884
1971
|
x: -t.toBox.w / 2,
|
|
1885
1972
|
y: -t.toBox.h / 2,
|
|
1886
1973
|
width: t.toBox.w,
|
|
1887
1974
|
height: t.toBox.h,
|
|
1888
1975
|
rx: "3",
|
|
1889
|
-
fill:
|
|
1890
|
-
opacity:
|
|
1891
|
-
stroke:
|
|
1892
|
-
"stroke-
|
|
1893
|
-
"stroke-
|
|
1894
|
-
|
|
1976
|
+
fill: t.toPlate.fill,
|
|
1977
|
+
opacity: t.toPlate.opacity,
|
|
1978
|
+
stroke: t.toPlate.borderStyle === "none" ? "none" : t.toPlate.borderColor,
|
|
1979
|
+
"stroke-width": "0.6",
|
|
1980
|
+
"stroke-opacity": t.toPlate.borderOpacity,
|
|
1981
|
+
"stroke-dasharray": t.toPlate.borderStyle === "dashed" ? "3 2" : void 0
|
|
1982
|
+
}, null, 8, ct)) : n("", !0), i("text", {
|
|
1895
1983
|
y: "0",
|
|
1896
1984
|
"dominant-baseline": "central",
|
|
1897
1985
|
"text-anchor": "middle",
|
|
1898
|
-
"font-size":
|
|
1899
|
-
fill:
|
|
1986
|
+
"font-size": an(t.edge, t.edge.toText),
|
|
1987
|
+
fill: on(t.edge, t.edge.toText),
|
|
1900
1988
|
"font-family": "'SF Mono', monospace",
|
|
1901
1989
|
"font-weight": "500",
|
|
1902
1990
|
opacity: "0.9"
|
|
1903
|
-
}, h(
|
|
1991
|
+
}, h(Ma(t.edge.toText)), 9, lt)], 8, st)) : n("", !0)
|
|
1904
1992
|
]))], 64))), 128)),
|
|
1905
|
-
|
|
1993
|
+
Y.value ? (d(), r("g", ut, [
|
|
1906
1994
|
i("line", {
|
|
1907
|
-
x1:
|
|
1908
|
-
y1:
|
|
1909
|
-
x2:
|
|
1910
|
-
y2:
|
|
1911
|
-
stroke:
|
|
1995
|
+
x1: Y.value.ax,
|
|
1996
|
+
y1: Y.value.ay,
|
|
1997
|
+
x2: da.value.x,
|
|
1998
|
+
y2: da.value.y,
|
|
1999
|
+
stroke: ua.value,
|
|
1912
2000
|
"stroke-width": "2",
|
|
1913
2001
|
"stroke-dasharray": "6 6",
|
|
1914
2002
|
"stroke-linecap": "round",
|
|
1915
2003
|
opacity: "0.9"
|
|
1916
|
-
}, null, 8,
|
|
2004
|
+
}, null, 8, dt),
|
|
1917
2005
|
i("circle", {
|
|
1918
|
-
cx:
|
|
1919
|
-
cy:
|
|
2006
|
+
cx: Y.value.px,
|
|
2007
|
+
cy: Y.value.py,
|
|
1920
2008
|
r: "3.5",
|
|
1921
|
-
fill:
|
|
2009
|
+
fill: ua.value,
|
|
1922
2010
|
opacity: "0.9"
|
|
1923
|
-
}, null, 8,
|
|
1924
|
-
|
|
2011
|
+
}, null, 8, ft),
|
|
2012
|
+
Y.value.overId && fa.value ? (d(), r("rect", {
|
|
1925
2013
|
key: 0,
|
|
1926
|
-
x:
|
|
1927
|
-
y:
|
|
1928
|
-
width:
|
|
1929
|
-
height:
|
|
2014
|
+
x: fa.value.x,
|
|
2015
|
+
y: fa.value.y,
|
|
2016
|
+
width: fa.value.w,
|
|
2017
|
+
height: fa.value.h,
|
|
1930
2018
|
rx: "6",
|
|
1931
2019
|
fill: "none",
|
|
1932
|
-
stroke:
|
|
2020
|
+
stroke: ua.value,
|
|
1933
2021
|
"stroke-width": "1.5",
|
|
1934
2022
|
"stroke-dasharray": "6 4",
|
|
1935
2023
|
opacity: "0.9"
|
|
1936
|
-
}, null, 8,
|
|
2024
|
+
}, null, 8, pt)) : n("", !0)
|
|
1937
2025
|
])) : n("", !0),
|
|
1938
|
-
(d(!0), r(e, null, p(
|
|
2026
|
+
(d(!0), r(e, null, p(G.value, (e) => (d(), r("path", {
|
|
1939
2027
|
key: `hit-${e.id}`,
|
|
1940
2028
|
d: $(e),
|
|
1941
2029
|
fill: "none",
|
|
@@ -1945,146 +2033,146 @@ var x = {
|
|
|
1945
2033
|
"pointer-events": "stroke",
|
|
1946
2034
|
cursor: "pointer"
|
|
1947
2035
|
},
|
|
1948
|
-
onClick:
|
|
1949
|
-
}, null, 8,
|
|
2036
|
+
onClick: g((t) => br(e, t), ["stop"])
|
|
2037
|
+
}, null, 8, mt))), 128)),
|
|
1950
2038
|
(d(!0), r(e, null, p(Ir.value, (a) => (d(), r("g", {
|
|
1951
2039
|
key: a.id,
|
|
1952
2040
|
transform: `translate(${a.x}, ${a.y})`,
|
|
1953
|
-
class: s(["topology-node",
|
|
1954
|
-
onMousedown: (e) =>
|
|
2041
|
+
class: s(["topology-node", T.value === a.id ? "dragging" : ""]),
|
|
2042
|
+
onMousedown: (e) => Oi(e, a.id),
|
|
1955
2043
|
onClick: (e) => pr(a, e),
|
|
1956
2044
|
style: c({
|
|
1957
|
-
cursor:
|
|
1958
|
-
color:
|
|
2045
|
+
cursor: v.editable && v.config.nodeDraggable !== !1 ? "grab" : "default",
|
|
2046
|
+
color: N(a)
|
|
1959
2047
|
})
|
|
1960
2048
|
}, [
|
|
1961
|
-
|
|
2049
|
+
Bn(a) ? (d(), r("rect", {
|
|
1962
2050
|
key: 0,
|
|
1963
2051
|
class: "node-hit-area node-hit-frame",
|
|
1964
2052
|
x: L(a).x,
|
|
1965
2053
|
y: L(a).y,
|
|
1966
2054
|
width: L(a).width,
|
|
1967
2055
|
height: L(a).height,
|
|
1968
|
-
rx:
|
|
2056
|
+
rx: Di(a),
|
|
1969
2057
|
fill: "none",
|
|
1970
2058
|
stroke: "transparent",
|
|
1971
|
-
"stroke-width": Math.max(
|
|
2059
|
+
"stroke-width": Math.max(Ti(a), 12),
|
|
1972
2060
|
"pointer-events": "stroke"
|
|
1973
|
-
}, null, 8,
|
|
2061
|
+
}, null, 8, gt)) : (d(), r("rect", {
|
|
1974
2062
|
key: 1,
|
|
1975
2063
|
class: "node-hit-area",
|
|
1976
|
-
x:
|
|
1977
|
-
y:
|
|
1978
|
-
width:
|
|
1979
|
-
height:
|
|
2064
|
+
x: nr(a).x,
|
|
2065
|
+
y: nr(a).y,
|
|
2066
|
+
width: nr(a).width,
|
|
2067
|
+
height: nr(a).height,
|
|
1980
2068
|
fill: "transparent",
|
|
1981
2069
|
"pointer-events": "all"
|
|
1982
|
-
}, null, 8,
|
|
1983
|
-
!
|
|
2070
|
+
}, null, 8, _t)),
|
|
2071
|
+
!dr.value && ir(a) && _.viewMode !== "3d" ? (d(), r("rect", {
|
|
1984
2072
|
key: 2,
|
|
1985
2073
|
x: L(a).x,
|
|
1986
2074
|
y: L(a).y,
|
|
1987
2075
|
width: L(a).width,
|
|
1988
2076
|
height: L(a).height,
|
|
1989
|
-
rx:
|
|
1990
|
-
fill:
|
|
2077
|
+
rx: Di(a),
|
|
2078
|
+
fill: ir(a),
|
|
1991
2079
|
opacity: "0.15"
|
|
1992
|
-
}, null, 8,
|
|
1993
|
-
!
|
|
2080
|
+
}, null, 8, vt)) : n("", !0),
|
|
2081
|
+
!dr.value && R(a) && _.viewMode !== "3d" ? (d(), r("rect", {
|
|
1994
2082
|
key: 3,
|
|
1995
2083
|
x: R(a).x,
|
|
1996
2084
|
y: R(a).y,
|
|
1997
2085
|
width: R(a).width,
|
|
1998
2086
|
height: R(a).height,
|
|
1999
|
-
rx:
|
|
2087
|
+
rx: Di(a),
|
|
2000
2088
|
fill: "none",
|
|
2001
|
-
stroke:
|
|
2002
|
-
"stroke-width":
|
|
2003
|
-
"stroke-dasharray":
|
|
2089
|
+
stroke: wi(a),
|
|
2090
|
+
"stroke-width": Ti(a),
|
|
2091
|
+
"stroke-dasharray": Ei(a),
|
|
2004
2092
|
opacity: "0.8"
|
|
2005
|
-
}, null, 8,
|
|
2006
|
-
|
|
2093
|
+
}, null, 8, yt)) : n("", !0),
|
|
2094
|
+
ar(a) && _.viewMode !== "3d" ? (d(), r("rect", {
|
|
2007
2095
|
key: 4,
|
|
2008
2096
|
x: L(a).x,
|
|
2009
2097
|
y: L(a).y,
|
|
2010
2098
|
width: L(a).width,
|
|
2011
2099
|
height: L(a).height,
|
|
2012
|
-
rx:
|
|
2100
|
+
rx: Di(a),
|
|
2013
2101
|
fill: "none",
|
|
2014
|
-
stroke:
|
|
2102
|
+
stroke: ur.value,
|
|
2015
2103
|
"stroke-width": "2.5",
|
|
2016
2104
|
transform: "scale(1.1)",
|
|
2017
2105
|
style: { "pointer-events": "none" }
|
|
2018
|
-
}, null, 8,
|
|
2019
|
-
|
|
2106
|
+
}, null, 8, bt)) : n("", !0),
|
|
2107
|
+
zn(a) ? (d(), r("text", {
|
|
2020
2108
|
key: 5,
|
|
2021
2109
|
y: "4",
|
|
2022
2110
|
transform: `rotate(${a.rotation || 0} 0 4)`,
|
|
2023
2111
|
"text-anchor": "middle",
|
|
2024
|
-
fill:
|
|
2025
|
-
"font-size":
|
|
2112
|
+
fill: nn(a) || N(a) || Rn(a).color,
|
|
2113
|
+
"font-size": tn(a, 12),
|
|
2026
2114
|
"font-family": "'SF Mono', monospace",
|
|
2027
2115
|
"font-weight": "600"
|
|
2028
2116
|
}, [(d(!0), r(e, null, p(String(a.label ?? "").split("\n"), (e, t) => (d(), r("tspan", {
|
|
2029
2117
|
key: t,
|
|
2030
2118
|
x: "0",
|
|
2031
2119
|
dy: t === 0 ? 0 : "1.2em"
|
|
2032
|
-
}, h(e), 9,
|
|
2033
|
-
a.state !== "none" &&
|
|
2120
|
+
}, h(e), 9, St))), 128))], 8, xt)) : Bn(a) ? (d(), r(e, { key: 6 }, [], 64)) : (d(), r(e, { key: 7 }, [
|
|
2121
|
+
a.state !== "none" && Si.value ? (d(), r("circle", {
|
|
2034
2122
|
key: 0,
|
|
2035
|
-
r:
|
|
2123
|
+
r: Zn(a),
|
|
2036
2124
|
fill: "none",
|
|
2037
|
-
stroke:
|
|
2125
|
+
stroke: Rn(a).color,
|
|
2038
2126
|
"stroke-width": "2.5",
|
|
2039
2127
|
opacity: "0"
|
|
2040
2128
|
}, [i("animate", {
|
|
2041
2129
|
attributeName: "r",
|
|
2042
|
-
values: `${
|
|
2130
|
+
values: `${Zn(a)};${Zn(a) * 1.6};${Zn(a)}`,
|
|
2043
2131
|
dur: "2s",
|
|
2044
2132
|
repeatCount: "indefinite"
|
|
2045
|
-
}, null, 8,
|
|
2133
|
+
}, null, 8, wt), o[6] ||= i("animate", {
|
|
2046
2134
|
attributeName: "opacity",
|
|
2047
2135
|
values: "0.4;0.05;0.4",
|
|
2048
2136
|
dur: "2s",
|
|
2049
2137
|
repeatCount: "indefinite"
|
|
2050
|
-
}, null, -1)], 8,
|
|
2051
|
-
|
|
2138
|
+
}, null, -1)], 8, Ct)) : n("", !0),
|
|
2139
|
+
Hn(a) ? (d(), r("svg", {
|
|
2052
2140
|
key: 1,
|
|
2053
2141
|
class: "node-icon",
|
|
2054
2142
|
x: L(a).x,
|
|
2055
2143
|
y: L(a).y,
|
|
2056
2144
|
width: L(a).width,
|
|
2057
2145
|
height: L(a).height,
|
|
2058
|
-
viewBox:
|
|
2059
|
-
preserveAspectRatio:
|
|
2146
|
+
viewBox: Gn,
|
|
2147
|
+
preserveAspectRatio: Wn.value
|
|
2060
2148
|
}, [m(t.$slots, "node-icon", {
|
|
2061
2149
|
node: a,
|
|
2062
|
-
color:
|
|
2063
|
-
viewMode:
|
|
2150
|
+
color: N(a),
|
|
2151
|
+
viewMode: _.viewMode,
|
|
2064
2152
|
isImage: !0,
|
|
2065
|
-
image:
|
|
2066
|
-
fit:
|
|
2067
|
-
imageWidth:
|
|
2068
|
-
imageHeight:
|
|
2153
|
+
image: P(a),
|
|
2154
|
+
fit: Un.value,
|
|
2155
|
+
imageWidth: F(a).w,
|
|
2156
|
+
imageHeight: F(a).h,
|
|
2069
2157
|
width: L(a).width,
|
|
2070
2158
|
height: L(a).height
|
|
2071
2159
|
}, () => [i("image", {
|
|
2072
|
-
href:
|
|
2073
|
-
x: -
|
|
2074
|
-
y: -
|
|
2075
|
-
width:
|
|
2076
|
-
height:
|
|
2077
|
-
}, null, 8,
|
|
2160
|
+
href: P(a),
|
|
2161
|
+
x: -F(a).w / 2,
|
|
2162
|
+
y: -F(a).h / 2,
|
|
2163
|
+
width: F(a).w,
|
|
2164
|
+
height: F(a).h
|
|
2165
|
+
}, null, 8, Et)])], 8, Tt)) : (d(), r("g", {
|
|
2078
2166
|
key: 2,
|
|
2079
2167
|
class: "node-icon",
|
|
2080
|
-
transform:
|
|
2168
|
+
transform: Qn(a)
|
|
2081
2169
|
}, [m(t.$slots, "node-icon", {
|
|
2082
2170
|
node: a,
|
|
2083
|
-
color:
|
|
2084
|
-
viewMode:
|
|
2171
|
+
color: N(a),
|
|
2172
|
+
viewMode: _.viewMode,
|
|
2085
2173
|
isImage: !1,
|
|
2086
|
-
image:
|
|
2087
|
-
fit:
|
|
2174
|
+
image: P(a),
|
|
2175
|
+
fit: Un.value,
|
|
2088
2176
|
width: L(a).width,
|
|
2089
2177
|
height: L(a).height
|
|
2090
2178
|
}, () => [i("rect", {
|
|
@@ -2093,78 +2181,71 @@ var x = {
|
|
|
2093
2181
|
width: "36",
|
|
2094
2182
|
height: "36",
|
|
2095
2183
|
rx: "6",
|
|
2096
|
-
fill:
|
|
2184
|
+
fill: N(a),
|
|
2097
2185
|
opacity: "0.9"
|
|
2098
|
-
}, null, 8,
|
|
2099
|
-
|
|
2186
|
+
}, null, 8, Ot)])], 8, Dt)),
|
|
2187
|
+
vi.value ? (d(), r("g", {
|
|
2100
2188
|
key: 3,
|
|
2101
|
-
transform:
|
|
2189
|
+
transform: $n(a)
|
|
2102
2190
|
}, [i("circle", {
|
|
2103
2191
|
r: "4",
|
|
2104
|
-
fill:
|
|
2192
|
+
fill: Rn(a).color,
|
|
2105
2193
|
stroke: "#0a0e1a",
|
|
2106
2194
|
"stroke-width": "2"
|
|
2107
|
-
}, null, 8,
|
|
2195
|
+
}, null, 8, At)], 8, kt)) : n("", !0),
|
|
2108
2196
|
i("text", {
|
|
2109
|
-
y:
|
|
2110
|
-
transform: `rotate(${a.rotation || 0} 0 ${
|
|
2197
|
+
y: tr(a),
|
|
2198
|
+
transform: `rotate(${a.rotation || 0} 0 ${tr(a)})`,
|
|
2111
2199
|
"text-anchor": "middle",
|
|
2112
|
-
fill:
|
|
2113
|
-
"font-size":
|
|
2114
|
-
"font-weight":
|
|
2200
|
+
fill: nn(a),
|
|
2201
|
+
"font-size": tn(a),
|
|
2202
|
+
"font-weight": rn(a),
|
|
2115
2203
|
"font-family": "'Segoe UI', system-ui, sans-serif",
|
|
2116
2204
|
opacity: "0.9"
|
|
2117
2205
|
}, [(d(!0), r(e, null, p(String(a.label ?? "").split("\n"), (e, t) => (d(), r("tspan", {
|
|
2118
2206
|
key: t,
|
|
2119
2207
|
x: "0",
|
|
2120
2208
|
dy: t === 0 ? 0 : "1.2em"
|
|
2121
|
-
}, h(e), 9,
|
|
2209
|
+
}, h(e), 9, Mt))), 128))], 8, jt)
|
|
2122
2210
|
], 64)),
|
|
2123
|
-
|
|
2211
|
+
_i.value ? (d(), r("g", Nt, [(d(!0), r(e, null, p(Ui(a), (e) => (d(), r("circle", {
|
|
2124
2212
|
key: e.side,
|
|
2125
2213
|
cx: e.x,
|
|
2126
2214
|
cy: e.y,
|
|
2127
2215
|
r: "4.5",
|
|
2128
2216
|
class: "node-handle",
|
|
2129
2217
|
fill: "#0a0e1a",
|
|
2130
|
-
stroke:
|
|
2218
|
+
stroke: N(a),
|
|
2131
2219
|
"stroke-width": "1.5",
|
|
2132
|
-
onPointerdown:
|
|
2133
|
-
onPointermove:
|
|
2134
|
-
onPointerup:
|
|
2135
|
-
onPointercancel:
|
|
2136
|
-
onLostpointercapture:
|
|
2137
|
-
onMousedown: o[0] ||=
|
|
2138
|
-
onClick: o[1] ||=
|
|
2139
|
-
}, null, 40,
|
|
2140
|
-
], 46,
|
|
2141
|
-
|
|
2220
|
+
onPointerdown: g((t) => Ki(t, a.id, e), ["stop", "prevent"]),
|
|
2221
|
+
onPointermove: g(ta, ["stop"]),
|
|
2222
|
+
onPointerup: g(na, ["stop"]),
|
|
2223
|
+
onPointercancel: g(na, ["stop"]),
|
|
2224
|
+
onLostpointercapture: na,
|
|
2225
|
+
onMousedown: o[0] ||= g(() => {}, ["stop", "prevent"]),
|
|
2226
|
+
onClick: o[1] ||= g(() => {}, ["stop"])
|
|
2227
|
+
}, null, 40, Pt))), 128))])) : n("", !0)
|
|
2228
|
+
], 46, ht))), 128)),
|
|
2229
|
+
Hi.value ? (d(), r("g", Ft, [(d(!0), r(e, null, p(Ii(Hi.value), (e) => (d(), r("rect", {
|
|
2142
2230
|
key: e.side,
|
|
2143
|
-
x:
|
|
2144
|
-
y:
|
|
2231
|
+
x: Hi.value.x + e.x - 4.5,
|
|
2232
|
+
y: Hi.value.y + e.y - 4.5,
|
|
2145
2233
|
width: "9",
|
|
2146
2234
|
height: "9",
|
|
2147
2235
|
rx: "2",
|
|
2148
2236
|
class: s(["node-resize-handle", `rt-${e.side}`]),
|
|
2149
|
-
onMousedown:
|
|
2150
|
-
onClick: o[2] ||=
|
|
2151
|
-
}, null, 42,
|
|
2152
|
-
|
|
2153
|
-
d: $(t),
|
|
2154
|
-
fill: "none",
|
|
2155
|
-
stroke: fr.value,
|
|
2156
|
-
"stroke-width": "7",
|
|
2157
|
-
"stroke-linecap": "round",
|
|
2158
|
-
opacity: "0.9"
|
|
2159
|
-
}, null, 8, Ft), i("path", {
|
|
2237
|
+
onMousedown: g((t) => Ri(t, Hi.value, e.side), ["stop", "prevent"]),
|
|
2238
|
+
onClick: o[2] ||= g(() => {}, ["stop"])
|
|
2239
|
+
}, null, 42, It))), 128))])) : n("", !0),
|
|
2240
|
+
fr.value ? (d(!0), r(e, { key: 5 }, p(G.value, (t) => (d(), r(e, { key: `front-${t.id}` }, [or(t) ? (d(), r("g", Lt, [i("path", {
|
|
2160
2241
|
d: $(t),
|
|
2161
2242
|
fill: "none",
|
|
2162
2243
|
stroke: Q(t),
|
|
2163
2244
|
"stroke-width": "2.5",
|
|
2164
2245
|
"stroke-linecap": "round",
|
|
2165
|
-
"marker-end":
|
|
2166
|
-
}, null, 8,
|
|
2167
|
-
|
|
2246
|
+
"marker-end": _a(t)
|
|
2247
|
+
}, null, 8, Rt)])) : n("", !0)], 64))), 128)) : n("", !0),
|
|
2248
|
+
q.value ? (d(), r("rect", {
|
|
2168
2249
|
key: 6,
|
|
2169
2250
|
class: "marquee-box",
|
|
2170
2251
|
x: Ur.value.x,
|
|
@@ -2173,11 +2254,11 @@ var x = {
|
|
|
2173
2254
|
height: Ur.value.height,
|
|
2174
2255
|
rx: "2",
|
|
2175
2256
|
"vector-effect": "non-scaling-stroke"
|
|
2176
|
-
}, null, 8,
|
|
2177
|
-
], 44,
|
|
2257
|
+
}, null, 8, zt)) : n("", !0)
|
|
2258
|
+
], 44, se));
|
|
2178
2259
|
}
|
|
2179
|
-
},
|
|
2180
|
-
e.component("Topology",
|
|
2260
|
+
}, $t = { install(e) {
|
|
2261
|
+
e.component("Topology", Qt);
|
|
2181
2262
|
} };
|
|
2182
2263
|
//#endregion
|
|
2183
|
-
export {
|
|
2264
|
+
export { Qt as Topology, $t as default, oe as nodeColors, b as nodeStates };
|