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