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