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