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