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