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