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