vue3-network-graph 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +600 -211
- package/README.md +607 -213
- package/dist/index.d.ts +14 -1
- package/dist/index.mjs +572 -519
- package/dist/index.umd.cjs +4 -3
- package/package.json +17 -4
package/dist/index.mjs
CHANGED
|
@@ -212,14 +212,14 @@ var b = {
|
|
|
212
212
|
"transform",
|
|
213
213
|
"fill",
|
|
214
214
|
"font-size"
|
|
215
|
-
], mt = ["
|
|
215
|
+
], mt = ["r", "stroke"], ht = ["values"], gt = ["transform"], _t = ["fill"], vt = ["transform"], yt = ["fill"], bt = [
|
|
216
216
|
"y",
|
|
217
217
|
"transform",
|
|
218
218
|
"fill",
|
|
219
219
|
"font-size",
|
|
220
220
|
"font-weight"
|
|
221
221
|
], xt = ["dy"], St = {
|
|
222
|
-
key:
|
|
222
|
+
key: 6,
|
|
223
223
|
class: "node-handles"
|
|
224
224
|
}, Ct = [
|
|
225
225
|
"cx",
|
|
@@ -298,7 +298,7 @@ var b = {
|
|
|
298
298
|
setup(_, { expose: te, emit: ne }) {
|
|
299
299
|
let v = _, y = ne, Rt = 0, zt = () => {
|
|
300
300
|
Rt++;
|
|
301
|
-
},
|
|
301
|
+
}, Bt = (e) => e && typeof e == "object" ? {
|
|
302
302
|
text: e.text,
|
|
303
303
|
rotation: e.rotation || 0,
|
|
304
304
|
fontSize: e.fontSize,
|
|
@@ -308,106 +308,106 @@ var b = {
|
|
|
308
308
|
rotation: 0,
|
|
309
309
|
fontSize: void 0,
|
|
310
310
|
color: void 0
|
|
311
|
-
},
|
|
312
|
-
|
|
311
|
+
}, Vt = (e, t = 11) => e.fontSize || t, Ht = (e) => e.fontColor || "#000000", Ut = (e, t = 500) => e.fontWeight || t, Wt = (e, t) => e.fontSize || Bt(t).fontSize || 8, S = (e, t) => e.fontColor || Bt(t).color || "#000000", C = d(v.nodes.map((e) => ({ ...e }))), Gt = null, w = () => {
|
|
312
|
+
Gt = C.value, y("update:nodes", C.value);
|
|
313
313
|
};
|
|
314
314
|
h(() => v.nodes, (e) => {
|
|
315
315
|
let t = Array.isArray(e) ? e : [];
|
|
316
|
-
if (t ===
|
|
316
|
+
if (t === Gt) return;
|
|
317
317
|
let n = null, r = null;
|
|
318
318
|
try {
|
|
319
|
-
n = JSON.stringify(t), r = JSON.stringify(
|
|
319
|
+
n = JSON.stringify(t), r = JSON.stringify(C.value);
|
|
320
320
|
} catch {
|
|
321
321
|
n = null;
|
|
322
322
|
}
|
|
323
|
-
(n === null || n !== r) && (zt(),
|
|
323
|
+
(n === null || n !== r) && (zt(), C.value = t.map((e) => ({ ...e })));
|
|
324
324
|
}, { deep: !0 });
|
|
325
|
-
let
|
|
325
|
+
let Kt = d(v.lineMode);
|
|
326
326
|
h(() => v.lineMode, (e) => {
|
|
327
|
-
|
|
327
|
+
Kt.value = e;
|
|
328
328
|
});
|
|
329
|
-
let
|
|
330
|
-
get: () =>
|
|
329
|
+
let T = t({
|
|
330
|
+
get: () => Kt.value,
|
|
331
331
|
set: (e) => {
|
|
332
|
-
|
|
332
|
+
Kt.value = e, y("update:lineMode", e);
|
|
333
333
|
}
|
|
334
|
-
}),
|
|
334
|
+
}), E = d(null), D = d(null), qt = d({
|
|
335
335
|
x: 0,
|
|
336
336
|
y: 0
|
|
337
|
-
}),
|
|
337
|
+
}), Jt = d(null), Yt = null, Xt = !1, Zt = !1, O = d([]), k = d(/* @__PURE__ */ new Map()), A = d(/* @__PURE__ */ new Set()), j = t(() => {
|
|
338
338
|
let e = v.edges, t = [];
|
|
339
|
-
if (
|
|
339
|
+
if (O.value.length) {
|
|
340
340
|
let n = new Set(e.map((e) => e.id));
|
|
341
|
-
t =
|
|
341
|
+
t = O.value.filter((e) => !n.has(e.id));
|
|
342
342
|
}
|
|
343
|
-
let n = t.length ? [...e, ...t] : e, r =
|
|
343
|
+
let n = t.length ? [...e, ...t] : e, r = k.value;
|
|
344
344
|
r.size && (n = n.map((e) => r.has(e.id) ? {
|
|
345
345
|
...e,
|
|
346
346
|
...r.get(e.id)
|
|
347
347
|
} : e));
|
|
348
|
-
let i = new Set(
|
|
348
|
+
let i = new Set(C.value.map((e) => e.id)), a = A.value;
|
|
349
349
|
return n.filter((e) => !a.has(e.id) && i.has(e.from) && i.has(e.to));
|
|
350
|
-
}),
|
|
350
|
+
}), Qt = t(() => v.config.watchDataChanges === !0), $t = d({
|
|
351
351
|
nodes: [],
|
|
352
352
|
edges: []
|
|
353
|
-
}),
|
|
354
|
-
nodes:
|
|
355
|
-
edges:
|
|
356
|
-
})),
|
|
353
|
+
}), en = "", M = null, tn = () => JSON.parse(JSON.stringify({
|
|
354
|
+
nodes: C.value,
|
|
355
|
+
edges: j.value
|
|
356
|
+
})), nn = (e, t) => {
|
|
357
357
|
let n = new Map(e.map((e) => [e.id, e])), r = new Map(t.map((e) => [e.id, e]));
|
|
358
358
|
return {
|
|
359
359
|
added: t.filter((e) => !n.has(e.id)).map((e) => e.id),
|
|
360
360
|
removed: e.filter((e) => !r.has(e.id)).map((e) => e.id),
|
|
361
361
|
updated: t.filter((e) => n.has(e.id) && JSON.stringify(n.get(e.id)) !== JSON.stringify(e)).map((e) => e.id)
|
|
362
362
|
};
|
|
363
|
-
},
|
|
364
|
-
nodes:
|
|
365
|
-
edges:
|
|
366
|
-
}),
|
|
367
|
-
if (
|
|
368
|
-
let e =
|
|
369
|
-
if (t ===
|
|
370
|
-
let n =
|
|
371
|
-
|
|
363
|
+
}, rn = (e) => ({
|
|
364
|
+
nodes: nn($t.value.nodes, e.nodes),
|
|
365
|
+
edges: nn($t.value.edges, e.edges)
|
|
366
|
+
}), an = () => {
|
|
367
|
+
if (M = null, !Qt.value) return;
|
|
368
|
+
let e = tn(), t = JSON.stringify(e);
|
|
369
|
+
if (t === en) return;
|
|
370
|
+
let n = rn(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;
|
|
371
|
+
en = t, r && y("data-change", {
|
|
372
372
|
nodes: e.nodes,
|
|
373
373
|
edges: e.edges,
|
|
374
374
|
summary: n
|
|
375
375
|
});
|
|
376
|
-
}, an = () => {
|
|
377
|
-
Zt.value && (N && clearTimeout(N), N = setTimeout(rn, 300));
|
|
378
376
|
}, on = () => {
|
|
379
|
-
|
|
377
|
+
Qt.value && (M && clearTimeout(M), M = setTimeout(an, 300));
|
|
378
|
+
}, sn = () => {
|
|
379
|
+
M &&= (clearTimeout(M), null), $t.value = tn(), en = "";
|
|
380
380
|
};
|
|
381
381
|
h([
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
], () =>
|
|
387
|
-
e ?
|
|
382
|
+
C,
|
|
383
|
+
O,
|
|
384
|
+
A,
|
|
385
|
+
k
|
|
386
|
+
], () => on(), { deep: !0 }), h(Qt, (e) => {
|
|
387
|
+
e ? sn() : M &&= (clearTimeout(M), null);
|
|
388
388
|
}), l(() => {
|
|
389
|
-
|
|
389
|
+
Qt.value && sn();
|
|
390
390
|
});
|
|
391
|
-
let
|
|
392
|
-
let e = new Set(
|
|
391
|
+
let cn = () => tn(), ln = () => {
|
|
392
|
+
let e = new Set(R.value), t = new Set(z.value), n = C.value.filter((t) => e.has(t.id)), r = j.value.filter((n) => t.has(n.id) || e.has(n.from) || e.has(n.to));
|
|
393
393
|
return !n.length && !r.length ? {
|
|
394
394
|
nodes: [],
|
|
395
395
|
edges: []
|
|
396
|
-
} : (n.length && (
|
|
396
|
+
} : (n.length && (C.value = C.value.filter((t) => !e.has(t.id)), w()), r.length && (A.value = /* @__PURE__ */ new Set([...A.value, ...r.map((e) => e.id)]), O.value = O.value.filter((e) => !A.value.has(e.id)), y("edge-remove", r.map((e) => JSON.parse(JSON.stringify(e))))), R.value = [], z.value = [], y("node-select", null), y("edge-select", null), B(), JSON.parse(JSON.stringify({
|
|
397
397
|
nodes: n,
|
|
398
398
|
edges: r
|
|
399
399
|
})));
|
|
400
|
-
},
|
|
401
|
-
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(
|
|
400
|
+
}, un = (e) => {
|
|
401
|
+
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(C.value.map((e) => e.id)), r = [];
|
|
402
402
|
for (let e of t) {
|
|
403
403
|
let t = JSON.parse(JSON.stringify(e));
|
|
404
404
|
if (t.id == null) t.id = re();
|
|
405
405
|
else if (n.has(t.id)) continue;
|
|
406
406
|
n.add(t.id), r.push(t);
|
|
407
407
|
}
|
|
408
|
-
return r.length ? (
|
|
409
|
-
},
|
|
410
|
-
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(
|
|
408
|
+
return r.length ? (C.value = [...C.value, ...r], w(), JSON.parse(JSON.stringify(r))) : [];
|
|
409
|
+
}, dn = (e) => {
|
|
410
|
+
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(j.value.map((e) => e.id)), r = [];
|
|
411
411
|
for (let e of t) {
|
|
412
412
|
let t = JSON.parse(JSON.stringify(e));
|
|
413
413
|
if (t.from != null && t.to != null) {
|
|
@@ -417,13 +417,13 @@ var b = {
|
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
if (!r.length) return [];
|
|
420
|
-
let i = r.filter((e) =>
|
|
420
|
+
let i = r.filter((e) => A.value.has(e.id));
|
|
421
421
|
if (i.length) {
|
|
422
422
|
let e = new Set(i.map((e) => e.id));
|
|
423
|
-
|
|
423
|
+
A.value = new Set([...A.value].filter((t) => !e.has(t)));
|
|
424
424
|
}
|
|
425
|
-
return
|
|
426
|
-
},
|
|
425
|
+
return O.value = [...O.value, ...r], r.forEach((e) => y("edge-create", JSON.parse(JSON.stringify(e)))), JSON.parse(JSON.stringify(r));
|
|
426
|
+
}, fn = (e) => {
|
|
427
427
|
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && e.id != null);
|
|
428
428
|
if (!t.length) return [];
|
|
429
429
|
let n = /* @__PURE__ */ new Map();
|
|
@@ -436,7 +436,7 @@ var b = {
|
|
|
436
436
|
});
|
|
437
437
|
}
|
|
438
438
|
let r = [];
|
|
439
|
-
return
|
|
439
|
+
return C.value = C.value.map((e) => {
|
|
440
440
|
let t = n.get(e.id);
|
|
441
441
|
if (!t) return e;
|
|
442
442
|
let i = {
|
|
@@ -444,11 +444,11 @@ var b = {
|
|
|
444
444
|
...t
|
|
445
445
|
};
|
|
446
446
|
return r.push(i), i;
|
|
447
|
-
}), r.length ? (
|
|
448
|
-
},
|
|
447
|
+
}), r.length ? (w(), JSON.parse(JSON.stringify(r))) : [];
|
|
448
|
+
}, pn = (e) => {
|
|
449
449
|
let t = (Array.isArray(e) ? e : [e]).filter((e) => e && e.id != null);
|
|
450
450
|
if (!t.length) return [];
|
|
451
|
-
let n = new Set(
|
|
451
|
+
let n = new Set(j.value.map((e) => e.id)), r = new Map(k.value), i = [];
|
|
452
452
|
for (let e of t) {
|
|
453
453
|
let { id: t, ...a } = e;
|
|
454
454
|
if (!n.has(t)) continue;
|
|
@@ -459,36 +459,36 @@ var b = {
|
|
|
459
459
|
...o
|
|
460
460
|
};
|
|
461
461
|
r.set(t, s);
|
|
462
|
-
let c =
|
|
462
|
+
let c = j.value.find((e) => e.id === t);
|
|
463
463
|
i.push({
|
|
464
464
|
...c,
|
|
465
465
|
...s
|
|
466
466
|
});
|
|
467
467
|
}
|
|
468
|
-
return i.length ? (
|
|
469
|
-
},
|
|
468
|
+
return i.length ? (k.value = r, y("edge-update", JSON.parse(JSON.stringify(i))), JSON.parse(JSON.stringify(i))) : [];
|
|
469
|
+
}, mn = (e) => {
|
|
470
470
|
let t = e && typeof e == "object" ? e : null;
|
|
471
|
-
return
|
|
471
|
+
return O.value = [], A.value = /* @__PURE__ */ new Set(), k.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (C.value = JSON.parse(JSON.stringify(t.nodes)), w()) : (C.value = (Array.isArray(v.nodes) ? v.nodes : []).map((e) => ({ ...e })), Gt = C.value), R.value = [], z.value = [], y("node-select", null), y("edge-select", null), B(), sn(), tn();
|
|
472
472
|
};
|
|
473
473
|
h(() => v.edges, (e) => {
|
|
474
474
|
zt();
|
|
475
475
|
let t = Array.isArray(e) ? e : [], n = new Set(t.map((e) => e.id));
|
|
476
|
-
if (
|
|
477
|
-
let e =
|
|
478
|
-
e.length !==
|
|
476
|
+
if (O.value.length) {
|
|
477
|
+
let e = O.value.filter((e) => !n.has(e.id));
|
|
478
|
+
e.length !== O.value.length && (O.value = e);
|
|
479
479
|
}
|
|
480
|
-
if (
|
|
481
|
-
let e = new Map(
|
|
480
|
+
if (k.value.size) {
|
|
481
|
+
let e = new Map(k.value), n = new Set(O.value.map((e) => e.id)), r = !1;
|
|
482
482
|
for (let [i, a] of e) {
|
|
483
483
|
let o = t.find((e) => e.id === i);
|
|
484
484
|
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
485
|
}
|
|
486
|
-
r && (
|
|
486
|
+
r && (k.value = e);
|
|
487
487
|
}
|
|
488
488
|
}, { deep: !0 });
|
|
489
|
-
let
|
|
489
|
+
let N = t(() => {
|
|
490
490
|
let e = {};
|
|
491
|
-
|
|
491
|
+
j.value.forEach((t) => {
|
|
492
492
|
let n = [t.from, t.to].sort().join("__");
|
|
493
493
|
e[n] || (e[n] = []), e[n].push(t);
|
|
494
494
|
});
|
|
@@ -524,36 +524,39 @@ var b = {
|
|
|
524
524
|
};
|
|
525
525
|
});
|
|
526
526
|
}), t;
|
|
527
|
-
}),
|
|
527
|
+
}), hn = t(() => {
|
|
528
528
|
let e = /* @__PURE__ */ new Map();
|
|
529
|
-
for (let t of
|
|
529
|
+
for (let t of C.value) e.set(t.id, t);
|
|
530
530
|
return e;
|
|
531
|
-
}),
|
|
531
|
+
}), P = (e) => hn.value.get(e), F = (e) => e.state != "none" && b[e.state] && b[e.state].color || "#00f0ff", gn = (e) => b[e.state] || b.normal, _n = (e) => e.nodeType === "text", vn = (e) => e.nodeType === "border-only", yn = (e, t) => {
|
|
532
532
|
let n = Number(e);
|
|
533
533
|
return Number.isFinite(n) && n > 0 ? n : t;
|
|
534
|
-
},
|
|
535
|
-
let t =
|
|
534
|
+
}, bn = (e) => {
|
|
535
|
+
let t = yn(e.width, x), n = yn(e.height, x);
|
|
536
536
|
return {
|
|
537
537
|
sx: t / x,
|
|
538
538
|
sy: n / x
|
|
539
539
|
};
|
|
540
|
-
},
|
|
541
|
-
let
|
|
540
|
+
}, xn = (e) => {
|
|
541
|
+
let t = Math.max(e.width, e.height);
|
|
542
|
+
return isNaN(t) ? 30 : t / 2;
|
|
543
|
+
}, Sn = (e) => {
|
|
544
|
+
let { sx: t, sy: n } = bn(e);
|
|
542
545
|
return t === 1 && n === 1 ? "" : `scale(${t}, ${n})`;
|
|
543
|
-
},
|
|
544
|
-
let { w: t, h: n } =
|
|
546
|
+
}, Cn = (e) => {
|
|
547
|
+
let { w: t, h: n } = I(e), r = Math.min(10, t * .3), i = Math.min(10, n * .3);
|
|
545
548
|
return `translate(${t / 2 - r}, ${-(n / 2 - i)})`;
|
|
546
|
-
},
|
|
549
|
+
}, wn = t(() => {
|
|
547
550
|
let e = Number(v.config.labelGap);
|
|
548
551
|
return Number.isFinite(e) && e >= 0 ? e : 18;
|
|
549
|
-
}),
|
|
550
|
-
if (
|
|
551
|
-
let { h: t } =
|
|
552
|
-
return e.labelPosition === "top" ? -(t / 2 +
|
|
553
|
-
},
|
|
554
|
-
let t =
|
|
555
|
-
if (
|
|
556
|
-
let n =
|
|
552
|
+
}), Tn = (e) => {
|
|
553
|
+
if (_n(e)) return 4;
|
|
554
|
+
let { h: t } = I(e);
|
|
555
|
+
return e.labelPosition === "top" ? -(t / 2 + wn.value) : e.labelPosition === "center" ? 0 : t / 2 + wn.value;
|
|
556
|
+
}, En = (e) => {
|
|
557
|
+
let t = L(e);
|
|
558
|
+
if (_n(e) || !e.label) return t;
|
|
559
|
+
let n = Vt(e), r = Tn(e);
|
|
557
560
|
if (e.labelPosition === "top") {
|
|
558
561
|
let e = r - n - 4;
|
|
559
562
|
e < t.y && (t.height += t.y - e, t.y = e);
|
|
@@ -562,123 +565,147 @@ var b = {
|
|
|
562
565
|
i > t.y + t.height && (t.height = i - t.y);
|
|
563
566
|
}
|
|
564
567
|
return t;
|
|
565
|
-
},
|
|
566
|
-
let t =
|
|
568
|
+
}, Dn = (e) => e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0, I = (e) => {
|
|
569
|
+
let t = _n(e), n = vn(e);
|
|
567
570
|
return {
|
|
568
|
-
w:
|
|
569
|
-
h:
|
|
571
|
+
w: yn(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : n ? Math.max(80, String(e.label).length * 8 + 24) : x),
|
|
572
|
+
h: yn(e.height, t ? 26 : n ? 40 : x)
|
|
570
573
|
};
|
|
571
|
-
},
|
|
572
|
-
let { w: t, h: n } =
|
|
574
|
+
}, L = (e) => {
|
|
575
|
+
let { w: t, h: n } = I(e);
|
|
573
576
|
return {
|
|
574
577
|
x: -t / 2,
|
|
575
578
|
y: -n / 2,
|
|
576
579
|
width: t,
|
|
577
580
|
height: n
|
|
578
581
|
};
|
|
579
|
-
},
|
|
580
|
-
t(() =>
|
|
581
|
-
let
|
|
582
|
+
}, On = (e) => Dn(e) ? L(e) : null, kn = (e) => e.background && e.background !== "none" ? e.background : null, R = d([]), z = d([]);
|
|
583
|
+
t(() => R.value.length === 1 ? R.value[0] : null), t(() => z.value.length === 1 ? z.value[0] : null);
|
|
584
|
+
let An = (e) => R.value.includes(e.id), jn = (e) => z.value.includes(e.id), B = () => {
|
|
582
585
|
y("selection-change", {
|
|
583
|
-
nodes:
|
|
584
|
-
edges:
|
|
586
|
+
nodes: C.value.filter((e) => R.value.includes(e.id)),
|
|
587
|
+
edges: j.value.filter((e) => z.value.includes(e.id))
|
|
585
588
|
});
|
|
586
|
-
},
|
|
589
|
+
}, Mn = (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, Nn = t(() => Mn(v.config.maxSelectNodes)), Pn = t(() => Mn(v.config.maxSelectEdges)), V = (e, t, n) => {
|
|
587
590
|
let r = new Set(e), i = [];
|
|
588
591
|
for (let e of t) r.has(e) || (r.add(e), i.push(e));
|
|
589
592
|
if (n === Infinity) return [...e, ...i];
|
|
590
593
|
let a = Math.max(0, n - e.length);
|
|
591
594
|
return [...e, ...i.slice(0, a)];
|
|
592
595
|
};
|
|
593
|
-
h([
|
|
596
|
+
h([Nn, Pn], ([e, t]) => {
|
|
594
597
|
let n = !1;
|
|
595
|
-
|
|
598
|
+
R.value.length > e && (R.value = R.value.slice(0, e), n = !0), z.value.length > t && (z.value = z.value.slice(0, t), n = !0), n && B();
|
|
596
599
|
});
|
|
597
|
-
let
|
|
598
|
-
if (!
|
|
600
|
+
let Fn = t(() => v.config.selectedBorderColor || "#fbbf24"), In = (e, t) => {
|
|
601
|
+
if (!Kn()) {
|
|
599
602
|
if (t && (t.ctrlKey || t.metaKey)) {
|
|
600
|
-
let t =
|
|
601
|
-
t >= 0 ?
|
|
603
|
+
let t = R.value.indexOf(e.id);
|
|
604
|
+
t >= 0 ? R.value.splice(t, 1) : R.value = V(R.value, [e.id], Nn.value);
|
|
602
605
|
} else {
|
|
603
|
-
let t =
|
|
604
|
-
|
|
606
|
+
let t = R.value.length === 1 && R.value[0] === e.id;
|
|
607
|
+
R.value = t ? [] : V([], [e.id], Nn.value), z.value = [];
|
|
605
608
|
}
|
|
606
|
-
y("node-click", e), y("node-select",
|
|
609
|
+
y("node-click", e), y("node-select", An(e) ? e : null), B();
|
|
607
610
|
}
|
|
608
|
-
},
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
611
|
+
}, Ln = (e) => {
|
|
612
|
+
let t = C.value.find((t) => t.id === e);
|
|
613
|
+
if (!t || v.config.enableZOrder === !1) return !1;
|
|
614
|
+
let n = t.zIndex ?? 0, r = C.value.filter((e) => (e.zIndex ?? 0) > n);
|
|
615
|
+
return r.length !== 0 && (t.zIndex = Math.min(...r.map((e) => e.zIndex ?? 0)), !0);
|
|
616
|
+
}, Rn = (e) => {
|
|
617
|
+
let t = C.value.find((t) => t.id === e);
|
|
618
|
+
if (!t || v.config.enableZOrder === !1) return !1;
|
|
619
|
+
let n = t.zIndex ?? 0, r = C.value.filter((e) => (e.zIndex ?? 0) < n);
|
|
620
|
+
return r.length !== 0 && (t.zIndex = Math.max(...r.map((e) => e.zIndex ?? 0)), !0);
|
|
621
|
+
}, zn = (e) => {
|
|
622
|
+
let t = C.value.find((t) => t.id === e);
|
|
623
|
+
return !t || v.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.max(...C.value.map((e) => e.zIndex ?? 0), 0) + 1, !0);
|
|
624
|
+
}, Bn = (e) => {
|
|
625
|
+
let t = C.value.find((t) => t.id === e);
|
|
626
|
+
return !t || v.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.min(...C.value.map((e) => e.zIndex ?? 0), 0) - 1, !0);
|
|
627
|
+
}, Vn = () => {
|
|
628
|
+
if (!D.value) return;
|
|
629
|
+
let e = D.value.cloneNode(!0);
|
|
630
|
+
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
|
+
let t = new XMLSerializer().serializeToString(e);
|
|
632
|
+
t = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + t;
|
|
633
|
+
let n = new Blob([t], { type: "image/svg+xml;charset=utf-8" }), r = URL.createObjectURL(n), i = document.createElement("a");
|
|
634
|
+
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
|
+
}, Hn = t(() => v.config.selectedLineColor || "#fbbf24"), Un = (e, t) => {
|
|
636
|
+
if (Kn()) return;
|
|
637
|
+
let n = N.value[e.id], r = !!(n && n.merged && n.representative), i = r ? j.value.filter((e) => {
|
|
638
|
+
let t = N.value[e.id];
|
|
612
639
|
return t && t.key === n.key;
|
|
613
640
|
}) : null, a = r ? i.map((e) => e.id) : [e.id], o = r ? {
|
|
614
641
|
...e,
|
|
615
642
|
bundleEdges: i
|
|
616
643
|
} : e;
|
|
617
|
-
if (t && (t.ctrlKey || t.metaKey)) a.every((e) =>
|
|
644
|
+
if (t && (t.ctrlKey || t.metaKey)) a.every((e) => z.value.includes(e)) ? z.value = z.value.filter((e) => !a.includes(e)) : z.value = V(z.value, a, Pn.value);
|
|
618
645
|
else {
|
|
619
|
-
let e = a.length ===
|
|
620
|
-
|
|
646
|
+
let e = a.length === z.value.length && a.every((e) => z.value.includes(e));
|
|
647
|
+
z.value = e ? [] : V([], a, Pn.value), R.value = [];
|
|
621
648
|
}
|
|
622
|
-
y("edge-select",
|
|
623
|
-
},
|
|
624
|
-
|
|
625
|
-
},
|
|
626
|
-
|
|
627
|
-
},
|
|
628
|
-
if (
|
|
649
|
+
y("edge-select", jn(e) ? o : null), B();
|
|
650
|
+
}, Wn = 0, Gn = (e = 200) => {
|
|
651
|
+
Wn = performance.now() + e;
|
|
652
|
+
}, Kn = () => performance.now() < Wn, qn = () => {
|
|
653
|
+
R.value = [], z.value = [], y("node-select", null), y("edge-select", null), B();
|
|
654
|
+
}, Jn = (e) => {
|
|
655
|
+
if (Kn()) return;
|
|
629
656
|
let t = e.target;
|
|
630
|
-
t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) ||
|
|
631
|
-
},
|
|
657
|
+
t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) || qn();
|
|
658
|
+
}, Yn = d({
|
|
632
659
|
width: 1e3,
|
|
633
660
|
height: 650
|
|
634
|
-
}),
|
|
661
|
+
}), Xn = d(1), Zn = d(0), Qn = d(0), $n = t(() => -tr.value / 2 + Zn.value), er = t(() => -nr.value / 2 + Qn.value), tr = t(() => v.width ?? Yn.value.width), nr = t(() => v.height ?? Yn.value.height), rr = null;
|
|
635
662
|
l(() => {
|
|
636
|
-
let e =
|
|
663
|
+
let e = D.value;
|
|
637
664
|
if (e) {
|
|
638
665
|
let t = e.getBoundingClientRect();
|
|
639
|
-
t.width > 0 && t.height > 0 && (
|
|
666
|
+
t.width > 0 && t.height > 0 && (Yn.value = {
|
|
640
667
|
width: t.width,
|
|
641
668
|
height: t.height
|
|
642
669
|
});
|
|
643
670
|
}
|
|
644
|
-
e && typeof ResizeObserver < "u" && (
|
|
671
|
+
e && typeof ResizeObserver < "u" && (rr = new ResizeObserver(() => {
|
|
645
672
|
let t = e.getBoundingClientRect();
|
|
646
|
-
t.width > 0 && t.height > 0 && (
|
|
673
|
+
t.width > 0 && t.height > 0 && (Yn.value = {
|
|
647
674
|
width: t.width,
|
|
648
675
|
height: t.height
|
|
649
676
|
});
|
|
650
|
-
}),
|
|
677
|
+
}), rr.observe(e));
|
|
651
678
|
}), c(() => {
|
|
652
|
-
|
|
679
|
+
rr &&= (rr.disconnect(), null), J &&= (cancelAnimationFrame(J), 0), q &&= (cancelAnimationFrame(q), 0), ci &&= (cancelAnimationFrame(ci), 0), hi(), Sr();
|
|
653
680
|
});
|
|
654
|
-
let
|
|
655
|
-
x0:
|
|
656
|
-
y0:
|
|
657
|
-
x1:
|
|
658
|
-
y1:
|
|
659
|
-
})),
|
|
660
|
-
let e =
|
|
661
|
-
|
|
662
|
-
let { w: n, h: r } = L(t);
|
|
681
|
+
let H = t(() => tr.value / Xn.value), U = t(() => nr.value / Xn.value), ir = t(() => ({
|
|
682
|
+
x0: $n.value - Mt,
|
|
683
|
+
y0: er.value - Mt,
|
|
684
|
+
x1: $n.value + H.value + Mt,
|
|
685
|
+
y1: er.value + U.value + Mt
|
|
686
|
+
})), ar = t(() => {
|
|
687
|
+
let e = ir.value, t = C.value.filter((t) => {
|
|
688
|
+
let { w: n, h: r } = I(t);
|
|
663
689
|
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;
|
|
664
690
|
});
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
691
|
+
return v.config.enableZOrder !== !1 && t.sort((e, t) => (e.zIndex ?? 0) - (t.zIndex ?? 0)), t;
|
|
692
|
+
}), W = t(() => {
|
|
693
|
+
let e = ir.value;
|
|
694
|
+
return j.value.filter((t) => {
|
|
695
|
+
if (!ji(t)) return !1;
|
|
696
|
+
let n = P(t.from), r = P(t.to);
|
|
670
697
|
if (!n || !r) return !1;
|
|
671
|
-
let i =
|
|
698
|
+
let i = I(n).w / 2, a = I(n).h / 2, o = I(r).w / 2, s = I(r).h / 2;
|
|
672
699
|
return Math.min(n.x - i, r.x - o) - Nt <= e.x1 && Math.max(n.x + i, r.x + o) + Nt >= e.x0 && Math.min(n.y - a, r.y - s) - Nt <= e.y1 && Math.max(n.y + a, r.y + s) + Nt >= e.y0;
|
|
673
700
|
});
|
|
674
|
-
}),
|
|
701
|
+
}), or = (e) => {
|
|
675
702
|
if (v.config.enableZoom === !1) return;
|
|
676
703
|
e.preventDefault();
|
|
677
|
-
let t =
|
|
678
|
-
|
|
679
|
-
},
|
|
680
|
-
let t =
|
|
681
|
-
|
|
704
|
+
let t = D.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(jt, Math.max(At, Xn.value * c)), u = tr.value / l, d = nr.value / l;
|
|
705
|
+
Zn.value += (o - u) * i, Qn.value += (s - d) * a, Xn.value = l;
|
|
706
|
+
}, G = d(null), K = d(null), sr = (e) => {
|
|
707
|
+
let t = D.value, n = t ? t.getBoundingClientRect() : null;
|
|
708
|
+
G.value = {
|
|
682
709
|
startX: e.clientX,
|
|
683
710
|
startY: e.clientY,
|
|
684
711
|
lastX: e.clientX,
|
|
@@ -686,9 +713,9 @@ var b = {
|
|
|
686
713
|
moved: !1,
|
|
687
714
|
rectWidth: n && n.width ? n.width : 0,
|
|
688
715
|
rectHeight: n && n.height ? n.height : 0
|
|
689
|
-
},
|
|
690
|
-
},
|
|
691
|
-
let t =
|
|
716
|
+
}, xr();
|
|
717
|
+
}, cr = (e) => {
|
|
718
|
+
let t = G.value, n = D.value;
|
|
692
719
|
if (!t || !n) return;
|
|
693
720
|
let r = t.rectWidth, i = t.rectHeight;
|
|
694
721
|
if (!r || !i) return;
|
|
@@ -698,13 +725,13 @@ var b = {
|
|
|
698
725
|
return;
|
|
699
726
|
}
|
|
700
727
|
let a = e.clientX - t.lastX, o = e.clientY - t.lastY;
|
|
701
|
-
t.lastX = e.clientX, t.lastY = e.clientY,
|
|
702
|
-
},
|
|
703
|
-
let e =
|
|
704
|
-
|
|
705
|
-
},
|
|
728
|
+
t.lastX = e.clientX, t.lastY = e.clientY, Zn.value -= a * (H.value / r), Qn.value -= o * (U.value / i);
|
|
729
|
+
}, lr = () => {
|
|
730
|
+
let e = G.value;
|
|
731
|
+
G.value = null, e && e.moved && Gn(), Cr();
|
|
732
|
+
}, ur = (e) => {
|
|
706
733
|
let t = Z(e);
|
|
707
|
-
|
|
734
|
+
K.value = {
|
|
708
735
|
start: {
|
|
709
736
|
x: t.x,
|
|
710
737
|
y: t.y
|
|
@@ -716,17 +743,17 @@ var b = {
|
|
|
716
743
|
startClientX: e.clientX,
|
|
717
744
|
startClientY: e.clientY,
|
|
718
745
|
moved: !1
|
|
719
|
-
},
|
|
720
|
-
},
|
|
721
|
-
let t =
|
|
746
|
+
}, xr();
|
|
747
|
+
}, dr = (e) => {
|
|
748
|
+
let t = K.value;
|
|
722
749
|
if (!t) return;
|
|
723
750
|
let n = Z(e);
|
|
724
751
|
t.current = {
|
|
725
752
|
x: n.x,
|
|
726
753
|
y: n.y
|
|
727
754
|
}, !t.moved && Math.hypot(e.clientX - t.startClientX, e.clientY - t.startClientY) > 3 && (t.moved = !0);
|
|
728
|
-
},
|
|
729
|
-
let e =
|
|
755
|
+
}, fr = t(() => {
|
|
756
|
+
let e = K.value;
|
|
730
757
|
return e ? {
|
|
731
758
|
x: Math.min(e.start.x, e.current.x),
|
|
732
759
|
y: Math.min(e.start.y, e.current.y),
|
|
@@ -738,62 +765,62 @@ var b = {
|
|
|
738
765
|
width: 0,
|
|
739
766
|
height: 0
|
|
740
767
|
};
|
|
741
|
-
}),
|
|
742
|
-
let e =
|
|
743
|
-
if (
|
|
768
|
+
}), pr = () => {
|
|
769
|
+
let e = K.value;
|
|
770
|
+
if (K.value = null, e && e.moved) {
|
|
744
771
|
let t = {
|
|
745
772
|
x: Math.min(e.start.x, e.current.x),
|
|
746
773
|
y: Math.min(e.start.y, e.current.y),
|
|
747
774
|
w: Math.abs(e.current.x - e.start.x),
|
|
748
775
|
h: Math.abs(e.current.y - e.start.y)
|
|
749
|
-
}, n =
|
|
750
|
-
let n =
|
|
776
|
+
}, n = C.value.filter((e) => {
|
|
777
|
+
let n = L(e), r = e.x + n.x, i = e.y + n.y;
|
|
751
778
|
return !(r + n.width < t.x || r > t.x + t.w || i + n.height < t.y || i > t.y + t.h);
|
|
752
779
|
});
|
|
753
|
-
n.length && (
|
|
780
|
+
n.length && (R.value = V(R.value, n.map((e) => e.id), Nn.value), B()), Gn();
|
|
754
781
|
}
|
|
755
|
-
|
|
756
|
-
},
|
|
757
|
-
if (
|
|
782
|
+
Cr();
|
|
783
|
+
}, mr = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), hr = (e) => {
|
|
784
|
+
if (D.value) {
|
|
758
785
|
if (e.button === 1) {
|
|
759
786
|
if (v.config.enablePan === !1) return;
|
|
760
|
-
e.preventDefault(),
|
|
787
|
+
e.preventDefault(), sr(e);
|
|
761
788
|
return;
|
|
762
789
|
}
|
|
763
|
-
if (e.button === 0 && !
|
|
790
|
+
if (e.button === 0 && !mr(e.target)) {
|
|
764
791
|
if (e.ctrlKey || e.metaKey) {
|
|
765
792
|
if (v.config.enableMarquee === !1) return;
|
|
766
|
-
e.preventDefault(),
|
|
793
|
+
e.preventDefault(), ur(e);
|
|
767
794
|
return;
|
|
768
795
|
}
|
|
769
|
-
v.config.enablePan !== !1 && (e.preventDefault(),
|
|
796
|
+
v.config.enablePan !== !1 && (e.preventDefault(), sr(e));
|
|
770
797
|
}
|
|
771
798
|
}
|
|
772
|
-
},
|
|
773
|
-
|
|
774
|
-
let e =
|
|
775
|
-
|
|
776
|
-
},
|
|
777
|
-
|
|
778
|
-
},
|
|
779
|
-
|
|
780
|
-
},
|
|
781
|
-
|
|
782
|
-
},
|
|
783
|
-
|
|
784
|
-
},
|
|
785
|
-
!
|
|
786
|
-
},
|
|
787
|
-
if (Y.value && Y.value.side) return { cursor:
|
|
788
|
-
if (
|
|
789
|
-
if (
|
|
790
|
-
}),
|
|
799
|
+
}, gr = !1, q = 0, _r = null, vr = () => {
|
|
800
|
+
q = 0;
|
|
801
|
+
let e = _r;
|
|
802
|
+
_r = null, e && (G.value ? cr(e) : K.value && dr(e));
|
|
803
|
+
}, yr = (e) => {
|
|
804
|
+
_r = e, q ||= requestAnimationFrame(vr);
|
|
805
|
+
}, br = () => {
|
|
806
|
+
q && (cancelAnimationFrame(q), vr()), G.value && lr(), K.value && pr();
|
|
807
|
+
}, xr = () => {
|
|
808
|
+
gr || (gr = !0, window.addEventListener("mousemove", yr, !0), window.addEventListener("mouseup", br, !0));
|
|
809
|
+
}, Sr = () => {
|
|
810
|
+
gr && (gr = !1, window.removeEventListener("mousemove", yr, !0), window.removeEventListener("mouseup", br, !0));
|
|
811
|
+
}, Cr = () => {
|
|
812
|
+
!G.value && !K.value && Sr();
|
|
813
|
+
}, wr = t(() => {
|
|
814
|
+
if (Y.value && Y.value.side) return { cursor: Qr(Y.value.side) };
|
|
815
|
+
if (K.value) return { cursor: "crosshair" };
|
|
816
|
+
if (G.value && G.value.moved) return { cursor: "grabbing" };
|
|
817
|
+
}), Tr = t(() => v.config.showGrid !== !1), Er = t(() => v.config.gridColor || "#1a2240"), Dr = t(() => {
|
|
791
818
|
let e = Number(v.config.gridStep);
|
|
792
|
-
return (Number.isFinite(e) && e > 0 ? e : 40) /
|
|
793
|
-
}),
|
|
819
|
+
return (Number.isFinite(e) && e > 0 ? e : 40) / Xn.value;
|
|
820
|
+
}), Or = t(() => {
|
|
794
821
|
let e = Number(v.config.gridOpacity);
|
|
795
822
|
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .5;
|
|
796
|
-
}),
|
|
823
|
+
}), kr = t(() => {
|
|
797
824
|
let e = v.config.radialGradient && typeof v.config.radialGradient == "object" ? v.config.radialGradient : {}, t = Array.isArray(e.stops) && e.stops.length ? e.stops.filter((e) => e && e.color).map((e, t) => ({
|
|
798
825
|
offset: e.offset == null ? t === 0 ? "0%" : "100%" : e.offset,
|
|
799
826
|
color: e.color,
|
|
@@ -813,89 +840,100 @@ var b = {
|
|
|
813
840
|
r: e.r || "60%",
|
|
814
841
|
stops: n
|
|
815
842
|
};
|
|
816
|
-
}),
|
|
843
|
+
}), Ar = t(() => v.config.showCenterPoint === !0), jr = t(() => v.config.showEdgeTextBg === !0), Mr = t(() => v.config.edgeTextBgColor || "#0a0e1a"), Nr = t(() => v.config.showNodeHandles === !0), Pr = t(() => v.config.showStatusDot !== !1), Fr = (e, t) => {
|
|
817
844
|
let n = Number(e);
|
|
818
845
|
return Number.isFinite(n) && n >= 0 ? n : t;
|
|
819
|
-
},
|
|
846
|
+
}, Ir = t(() => {
|
|
820
847
|
let e = v.config.motionFx ?? v.config.fx;
|
|
821
|
-
return typeof e == "boolean" ? e :
|
|
822
|
-
|
|
848
|
+
return typeof e == "boolean" ? e ? "all" : "none" : [
|
|
849
|
+
"none",
|
|
850
|
+
"flow",
|
|
851
|
+
"particle",
|
|
852
|
+
"all"
|
|
853
|
+
].includes(e) ? e : j.value.length <= Fr(v.config.fxMotionMaxEdges, 200) ? "all" : "none";
|
|
854
|
+
}), Lr = t(() => {
|
|
823
855
|
let e = v.config.glowFx ?? v.config.fx;
|
|
824
|
-
return typeof e == "boolean" ? e :
|
|
825
|
-
}),
|
|
856
|
+
return typeof e == "boolean" ? e : j.value.length <= Fr(v.config.fxGlowMaxEdges, 500);
|
|
857
|
+
}), Rr = t(() => {
|
|
826
858
|
let e = v.config.breatheFx ?? v.config.fx;
|
|
827
|
-
return typeof e == "boolean" ? e :
|
|
828
|
-
}),
|
|
859
|
+
return typeof e == "boolean" ? e : C.value.length <= Fr(v.config.fxBreatheMaxNodes, 300);
|
|
860
|
+
}), zr = (e) => {
|
|
861
|
+
if (e.animatedMode !== void 0) {
|
|
862
|
+
let t = e.animatedMode;
|
|
863
|
+
return !t || t === "all" ? Ir.value : t === "none" ? "none" : t;
|
|
864
|
+
}
|
|
865
|
+
return e.animated === void 0 || e.animated ? Ir.value : "none";
|
|
866
|
+
}, Br = (e) => e.borderColor || F(e) || "#94a3b8", Vr = (e) => e.borderWidth || 0, Hr = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, Ur = (e) => {
|
|
829
867
|
let t = e.borderRadius;
|
|
830
868
|
if (t == null || t === "") return 6;
|
|
831
869
|
let n = Number(t);
|
|
832
870
|
return Number.isFinite(n) && n >= 0 ? n : 6;
|
|
833
|
-
},
|
|
871
|
+
}, Wr = (e, t) => {
|
|
834
872
|
if (e.button !== 0 || !v.editable || v.config.nodeDraggable === !1) return;
|
|
835
873
|
e.stopPropagation();
|
|
836
|
-
let n =
|
|
837
|
-
if (
|
|
874
|
+
let n = P(t), r = Z(e);
|
|
875
|
+
if (qt.value = {
|
|
838
876
|
x: r.x - n.x,
|
|
839
877
|
y: r.y - n.y
|
|
840
|
-
},
|
|
878
|
+
}, Yt = {
|
|
841
879
|
x: e.clientX,
|
|
842
880
|
y: e.clientY
|
|
843
|
-
},
|
|
881
|
+
}, Xt = !1, Zt = !!(e.ctrlKey || e.metaKey), R.value.length > 1 && R.value.includes(t)) {
|
|
844
882
|
let e = {};
|
|
845
|
-
|
|
846
|
-
let n =
|
|
883
|
+
R.value.forEach((t) => {
|
|
884
|
+
let n = P(t);
|
|
847
885
|
n && (e[t] = {
|
|
848
886
|
x: n.x,
|
|
849
887
|
y: n.y
|
|
850
888
|
});
|
|
851
|
-
}),
|
|
889
|
+
}), Jt.value = {
|
|
852
890
|
origins: e,
|
|
853
891
|
start: {
|
|
854
892
|
x: r.x,
|
|
855
893
|
y: r.y
|
|
856
894
|
}
|
|
857
895
|
};
|
|
858
|
-
} else
|
|
859
|
-
|
|
860
|
-
},
|
|
861
|
-
|
|
862
|
-
let e =
|
|
863
|
-
|
|
864
|
-
},
|
|
865
|
-
(Y.value ||
|
|
896
|
+
} else Jt.value = null;
|
|
897
|
+
E.value = t, y("node-drag-start", n);
|
|
898
|
+
}, J = 0, Gr = null, Kr = () => {
|
|
899
|
+
J = 0;
|
|
900
|
+
let e = Gr;
|
|
901
|
+
Gr = null, e && Jr(e);
|
|
902
|
+
}, qr = (e) => {
|
|
903
|
+
(Y.value || E.value) && (Gr = {
|
|
866
904
|
clientX: e.clientX,
|
|
867
905
|
clientY: e.clientY
|
|
868
|
-
},
|
|
869
|
-
},
|
|
906
|
+
}, J ||= requestAnimationFrame(Kr));
|
|
907
|
+
}, Jr = (e) => {
|
|
870
908
|
if (Y.value) {
|
|
871
|
-
|
|
909
|
+
ei(e);
|
|
872
910
|
return;
|
|
873
911
|
}
|
|
874
|
-
if (!
|
|
912
|
+
if (!E.value) return;
|
|
875
913
|
let t = Z(e);
|
|
876
|
-
!
|
|
877
|
-
let n =
|
|
914
|
+
!Xt && Yt && Math.hypot(e.clientX - Yt.x, e.clientY - Yt.y) > kt && (Xt = !0, !Zt && !R.value.includes(E.value) && (R.value = V([], [E.value], Nn.value), z.value = [], y("node-select", R.value.includes(E.value) ? P(E.value) : null), B()));
|
|
915
|
+
let n = Jt.value;
|
|
878
916
|
if (n) {
|
|
879
917
|
let e = t.x - n.start.x, r = t.y - n.start.y;
|
|
880
|
-
|
|
918
|
+
C.value = C.value.map((t) => n.origins[t.id] ? {
|
|
881
919
|
...t,
|
|
882
920
|
x: n.origins[t.id].x + e,
|
|
883
921
|
y: n.origins[t.id].y + r
|
|
884
922
|
} : t);
|
|
885
|
-
} else
|
|
923
|
+
} else C.value = C.value.map((e) => e.id === E.value ? {
|
|
886
924
|
...e,
|
|
887
|
-
x: t.x -
|
|
888
|
-
y: t.y -
|
|
925
|
+
x: t.x - qt.value.x,
|
|
926
|
+
y: t.y - qt.value.y
|
|
889
927
|
} : e);
|
|
890
|
-
|
|
891
|
-
},
|
|
892
|
-
if (
|
|
893
|
-
|
|
928
|
+
w();
|
|
929
|
+
}, Yr = () => {
|
|
930
|
+
if (J && (cancelAnimationFrame(J), Kr()), Y.value) {
|
|
931
|
+
ti();
|
|
894
932
|
return;
|
|
895
933
|
}
|
|
896
|
-
|
|
897
|
-
}, Y = d(null),
|
|
898
|
-
let t =
|
|
934
|
+
E.value && (Xt && Gn(), E.value = null, Jt.value = null, Yt = null, Xt = !1, y("node-drag-end"));
|
|
935
|
+
}, Y = d(null), Xr = (e, t, n) => Math.min(n, Math.max(t, e)), Zr = (e) => {
|
|
936
|
+
let t = L(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
|
|
899
937
|
return [
|
|
900
938
|
{
|
|
901
939
|
side: "nw",
|
|
@@ -938,9 +976,9 @@ var b = {
|
|
|
938
976
|
y: 0
|
|
939
977
|
}
|
|
940
978
|
];
|
|
941
|
-
},
|
|
979
|
+
}, Qr = (e) => e === "nw" || e === "se" ? "nwse-resize" : e === "ne" || e === "sw" ? "nesw-resize" : e === "n" || e === "s" ? "ns-resize" : "ew-resize", $r = (e, t, n) => {
|
|
942
980
|
if (!v.editable || v.config.nodeResizable === !1 || !t) return;
|
|
943
|
-
let { w: r, h: i } =
|
|
981
|
+
let { w: r, h: i } = I(t);
|
|
944
982
|
Y.value = {
|
|
945
983
|
id: t.id,
|
|
946
984
|
side: n,
|
|
@@ -949,36 +987,36 @@ var b = {
|
|
|
949
987
|
startW: r,
|
|
950
988
|
startH: i
|
|
951
989
|
}, y("node-resize-start", t);
|
|
952
|
-
},
|
|
990
|
+
}, ei = (e) => {
|
|
953
991
|
let t = Y.value;
|
|
954
992
|
if (!t) return;
|
|
955
|
-
let n =
|
|
993
|
+
let n = P(t.id);
|
|
956
994
|
if (!n) return;
|
|
957
995
|
let r = Z(e), i = t.startW, a = t.startH, o = n.x, s = n.y;
|
|
958
996
|
if (t.anchorX !== null) {
|
|
959
997
|
let e = t.side.includes("e");
|
|
960
|
-
i =
|
|
998
|
+
i = Xr(e ? r.x - t.anchorX : t.anchorX - r.x, Pt, Ft), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
|
|
961
999
|
}
|
|
962
1000
|
if (t.anchorY !== null) {
|
|
963
1001
|
let e = t.side.includes("s");
|
|
964
|
-
a =
|
|
1002
|
+
a = Xr(e ? r.y - t.anchorY : t.anchorY - r.y, It, Lt), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
|
|
965
1003
|
}
|
|
966
|
-
|
|
1004
|
+
C.value = C.value.map((e) => e.id === t.id ? {
|
|
967
1005
|
...e,
|
|
968
1006
|
x: o,
|
|
969
1007
|
y: s,
|
|
970
1008
|
width: i,
|
|
971
1009
|
height: a
|
|
972
|
-
} : e),
|
|
973
|
-
},
|
|
1010
|
+
} : e), w();
|
|
1011
|
+
}, ti = () => {
|
|
974
1012
|
let e = Y.value;
|
|
975
|
-
Y.value = null, e && (
|
|
976
|
-
},
|
|
977
|
-
if (!
|
|
978
|
-
let e =
|
|
979
|
-
return e.length === 1 &&
|
|
980
|
-
}), X = d(null),
|
|
981
|
-
let t =
|
|
1013
|
+
Y.value = null, e && (Gn(), y("node-resize-end", P(e.id) || null));
|
|
1014
|
+
}, ni = t(() => v.editable && v.config.nodeResizable !== !1), ri = t(() => {
|
|
1015
|
+
if (!ni.value) return null;
|
|
1016
|
+
let e = R.value;
|
|
1017
|
+
return e.length === 1 && P(e[0]) || null;
|
|
1018
|
+
}), X = d(null), ii = (e) => {
|
|
1019
|
+
let t = L(e);
|
|
982
1020
|
return [
|
|
983
1021
|
{
|
|
984
1022
|
side: "top",
|
|
@@ -1001,8 +1039,8 @@ var b = {
|
|
|
1001
1039
|
y: 0
|
|
1002
1040
|
}
|
|
1003
1041
|
];
|
|
1004
|
-
},
|
|
1005
|
-
let n =
|
|
1042
|
+
}, ai = (e, t) => {
|
|
1043
|
+
let n = D.value;
|
|
1006
1044
|
if (!n) return null;
|
|
1007
1045
|
let r = e, i = t;
|
|
1008
1046
|
if (e && typeof e == "object" && (r = e.clientX, i = e.clientY), r == null || i == null) return null;
|
|
@@ -1015,8 +1053,8 @@ var b = {
|
|
|
1015
1053
|
x: s.x,
|
|
1016
1054
|
y: s.y
|
|
1017
1055
|
};
|
|
1018
|
-
},
|
|
1019
|
-
let n =
|
|
1056
|
+
}, oi = (e, t) => {
|
|
1057
|
+
let n = D.value;
|
|
1020
1058
|
if (!n) return null;
|
|
1021
1059
|
let r = n.createSVGPoint();
|
|
1022
1060
|
r.x = Number(e) || 0, r.y = Number(t) || 0;
|
|
@@ -1027,12 +1065,12 @@ var b = {
|
|
|
1027
1065
|
x: a.x,
|
|
1028
1066
|
y: a.y
|
|
1029
1067
|
};
|
|
1030
|
-
}, Z = (e) =>
|
|
1068
|
+
}, Z = (e) => ai(e) ?? {
|
|
1031
1069
|
x: 0,
|
|
1032
1070
|
y: 0
|
|
1033
|
-
},
|
|
1034
|
-
let r =
|
|
1035
|
-
if (!r || !
|
|
1071
|
+
}, si = (e, t, n) => {
|
|
1072
|
+
let r = P(t);
|
|
1073
|
+
if (!r || !D.value) return;
|
|
1036
1074
|
let i = Z(e);
|
|
1037
1075
|
X.value = {
|
|
1038
1076
|
fromId: t,
|
|
@@ -1046,40 +1084,40 @@ var b = {
|
|
|
1046
1084
|
try {
|
|
1047
1085
|
e.target.setPointerCapture?.(e.pointerId);
|
|
1048
1086
|
} catch {}
|
|
1049
|
-
|
|
1050
|
-
},
|
|
1051
|
-
|
|
1052
|
-
let e =
|
|
1053
|
-
|
|
1054
|
-
},
|
|
1055
|
-
X.value && (
|
|
1087
|
+
mi();
|
|
1088
|
+
}, ci = 0, li = null, ui = () => {
|
|
1089
|
+
ci = 0;
|
|
1090
|
+
let e = li;
|
|
1091
|
+
li = null, e && X.value && _i(e);
|
|
1092
|
+
}, di = (e) => {
|
|
1093
|
+
X.value && (li = {
|
|
1056
1094
|
clientX: e.clientX,
|
|
1057
1095
|
clientY: e.clientY
|
|
1058
|
-
},
|
|
1059
|
-
},
|
|
1060
|
-
|
|
1061
|
-
},
|
|
1062
|
-
|
|
1063
|
-
},
|
|
1064
|
-
|
|
1065
|
-
},
|
|
1066
|
-
let r =
|
|
1096
|
+
}, ci ||= requestAnimationFrame(ui));
|
|
1097
|
+
}, fi = () => {
|
|
1098
|
+
ci && (cancelAnimationFrame(ci), ui()), X.value && vi();
|
|
1099
|
+
}, pi = !1, mi = () => {
|
|
1100
|
+
pi || (pi = !0, window.addEventListener("mousemove", di, !0), window.addEventListener("mouseup", fi, !0));
|
|
1101
|
+
}, hi = () => {
|
|
1102
|
+
pi && (pi = !1, window.removeEventListener("mousemove", di, !0), window.removeEventListener("mouseup", fi, !0));
|
|
1103
|
+
}, gi = (e, t, n) => {
|
|
1104
|
+
let r = C.value;
|
|
1067
1105
|
for (let i = r.length - 1; i >= 0; i--) {
|
|
1068
1106
|
let a = r[i];
|
|
1069
1107
|
if (a.id === n) continue;
|
|
1070
|
-
let o =
|
|
1108
|
+
let o = L(a);
|
|
1071
1109
|
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;
|
|
1072
1110
|
}
|
|
1073
1111
|
return null;
|
|
1074
|
-
},
|
|
1112
|
+
}, _i = (e) => {
|
|
1075
1113
|
let t = X.value;
|
|
1076
1114
|
if (!t) return;
|
|
1077
1115
|
let n = Z(e);
|
|
1078
1116
|
t.px = n.x, t.py = n.y;
|
|
1079
|
-
let r =
|
|
1117
|
+
let r = gi(n.x, n.y, t.fromId);
|
|
1080
1118
|
t.overId = r ? r.id : null;
|
|
1081
|
-
},
|
|
1082
|
-
|
|
1119
|
+
}, vi = () => {
|
|
1120
|
+
hi();
|
|
1083
1121
|
let e = X.value;
|
|
1084
1122
|
if (X.value = null, !e || !e.overId || e.overId === e.fromId) return;
|
|
1085
1123
|
let t = {
|
|
@@ -1090,9 +1128,9 @@ var b = {
|
|
|
1090
1128
|
fromAnchor: "edge",
|
|
1091
1129
|
toAnchor: "edge"
|
|
1092
1130
|
};
|
|
1093
|
-
|
|
1094
|
-
},
|
|
1095
|
-
let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } =
|
|
1131
|
+
O.value.push(t), y("edge-create", t);
|
|
1132
|
+
}, yi = (e, t, n) => {
|
|
1133
|
+
let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = I(e);
|
|
1096
1134
|
if (!n || n === "center" || a === 0 && o === 0) return {
|
|
1097
1135
|
x: r,
|
|
1098
1136
|
y: i
|
|
@@ -1102,20 +1140,20 @@ var b = {
|
|
|
1102
1140
|
x: r + a * p,
|
|
1103
1141
|
y: i + o * p
|
|
1104
1142
|
};
|
|
1105
|
-
},
|
|
1143
|
+
}, bi = t(() => {
|
|
1106
1144
|
let e = /* @__PURE__ */ new Map();
|
|
1107
|
-
|
|
1108
|
-
let n =
|
|
1145
|
+
j.value.forEach((t) => {
|
|
1146
|
+
let n = N.value[t.id];
|
|
1109
1147
|
n && !n.hidden && (e.has(n.key) || e.set(n.key, []), e.get(n.key).push(t));
|
|
1110
1148
|
});
|
|
1111
1149
|
let t = {};
|
|
1112
1150
|
return e.forEach((e, n) => {
|
|
1113
|
-
let [r, i] = n.split("__"), a =
|
|
1151
|
+
let [r, i] = n.split("__"), a = P(r), o = P(i);
|
|
1114
1152
|
if (!a || !o) return;
|
|
1115
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, ee = Ot;
|
|
1116
1154
|
if (m > 1) {
|
|
1117
1155
|
let e = (m - 1) / 2 * Ot, t = (e) => {
|
|
1118
|
-
let { w: t, h: n } =
|
|
1156
|
+
let { w: t, h: n } = I(e);
|
|
1119
1157
|
return Math.max(4, (Math.abs(f) * t + Math.abs(p) * n) / 2 - 6);
|
|
1120
1158
|
}, n = Math.min(1, t(a) / e, t(o) / e);
|
|
1121
1159
|
ee = Ot * Math.max(.35, n);
|
|
@@ -1134,12 +1172,12 @@ var b = {
|
|
|
1134
1172
|
bulge: Math.min(l * .15, 50)
|
|
1135
1173
|
};
|
|
1136
1174
|
}), t;
|
|
1137
|
-
}),
|
|
1138
|
-
let t =
|
|
1175
|
+
}), xi = (e) => {
|
|
1176
|
+
let t = N.value[e.id], n = t && bi.value[t.key];
|
|
1139
1177
|
if (!n) return null;
|
|
1140
|
-
let r =
|
|
1178
|
+
let r = P(e.from), i = P(e.to);
|
|
1141
1179
|
if (!r || !i) return null;
|
|
1142
|
-
let a = n.slots[e.id] || 0, o = a * n.gap, s =
|
|
1180
|
+
let a = n.slots[e.id] || 0, o = a * n.gap, s = yi(r, i, e.fromAnchor), c = yi(i, r, e.toAnchor);
|
|
1143
1181
|
return {
|
|
1144
1182
|
frame: n,
|
|
1145
1183
|
slot: a,
|
|
@@ -1152,12 +1190,12 @@ var b = {
|
|
|
1152
1190
|
y: c.y + n.ny * o
|
|
1153
1191
|
}
|
|
1154
1192
|
};
|
|
1155
|
-
},
|
|
1156
|
-
let t =
|
|
1193
|
+
}, Si = (e) => {
|
|
1194
|
+
let t = xi(e);
|
|
1157
1195
|
if (!t) return "";
|
|
1158
1196
|
let { from: n, to: r, frame: i, slot: a } = t, o = a * i.gap;
|
|
1159
|
-
if (
|
|
1160
|
-
if (
|
|
1197
|
+
if (T.value === "straight") return `M ${n.x} ${n.y} L ${r.x} ${r.y}`;
|
|
1198
|
+
if (T.value === "polyline") {
|
|
1161
1199
|
if (i.dominant === "v") {
|
|
1162
1200
|
let e = (n.y + r.y) / 2 + o;
|
|
1163
1201
|
return `M ${n.x} ${n.y} L ${n.x} ${e} L ${r.x} ${e} L ${r.x} ${r.y}`;
|
|
@@ -1167,18 +1205,18 @@ var b = {
|
|
|
1167
1205
|
}
|
|
1168
1206
|
let s = (n.x + r.x) / 2 + i.nx * i.bulge, c = (n.y + r.y) / 2 + i.ny * i.bulge;
|
|
1169
1207
|
return `M ${n.x} ${n.y} Q ${s} ${c} ${r.x} ${r.y}`;
|
|
1170
|
-
},
|
|
1171
|
-
let n =
|
|
1208
|
+
}, Ci = (e, t) => {
|
|
1209
|
+
let n = xi(e);
|
|
1172
1210
|
if (!n) return {
|
|
1173
1211
|
x: 0,
|
|
1174
1212
|
y: 0
|
|
1175
1213
|
};
|
|
1176
1214
|
let { from: r, to: i, frame: a, slot: o } = n, s = o * a.gap;
|
|
1177
|
-
if (
|
|
1215
|
+
if (T.value === "straight") return {
|
|
1178
1216
|
x: r.x + (i.x - r.x) * t,
|
|
1179
1217
|
y: r.y + (i.y - r.y) * t
|
|
1180
1218
|
};
|
|
1181
|
-
if (
|
|
1219
|
+
if (T.value === "polyline") {
|
|
1182
1220
|
if (a.dominant === "v") {
|
|
1183
1221
|
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);
|
|
1184
1222
|
return c <= n ? {
|
|
@@ -1209,29 +1247,29 @@ var b = {
|
|
|
1209
1247
|
x: (1 - t) * (1 - t) * r.x + 2 * (1 - t) * t * c + t * t * i.x,
|
|
1210
1248
|
y: (1 - t) * (1 - t) * r.y + 2 * (1 - t) * t * l + t * t * i.y
|
|
1211
1249
|
};
|
|
1212
|
-
},
|
|
1250
|
+
}, wi = t(() => X.value ? P(X.value.fromId) : null), Ti = t(() => X.value && X.value.overId ? P(X.value.overId) : null), Ei = t(() => wi.value ? F(wi.value) : "#00f0ff"), Di = t(() => {
|
|
1213
1251
|
let e = X.value;
|
|
1214
1252
|
if (!e) return {
|
|
1215
1253
|
x: 0,
|
|
1216
1254
|
y: 0
|
|
1217
1255
|
};
|
|
1218
|
-
let t =
|
|
1219
|
-
return t &&
|
|
1256
|
+
let t = Ti.value;
|
|
1257
|
+
return t && wi.value ? yi(t, wi.value, "edge") : {
|
|
1220
1258
|
x: e.px,
|
|
1221
1259
|
y: e.py
|
|
1222
1260
|
};
|
|
1223
|
-
}),
|
|
1224
|
-
let e =
|
|
1261
|
+
}), Oi = t(() => {
|
|
1262
|
+
let e = Ti.value;
|
|
1225
1263
|
if (!e) return null;
|
|
1226
|
-
let t =
|
|
1264
|
+
let t = L(e);
|
|
1227
1265
|
return {
|
|
1228
1266
|
x: e.x + t.x - 4,
|
|
1229
1267
|
y: e.y + t.y - 4,
|
|
1230
1268
|
w: t.width + 8,
|
|
1231
1269
|
h: t.height + 8
|
|
1232
1270
|
};
|
|
1233
|
-
}),
|
|
1234
|
-
let t = e.nodeIds.map((e) =>
|
|
1271
|
+
}), ki = (e) => {
|
|
1272
|
+
let t = e.nodeIds.map((e) => P(e)).filter(Boolean);
|
|
1235
1273
|
if (t.length === 0) return null;
|
|
1236
1274
|
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;
|
|
1237
1275
|
return {
|
|
@@ -1240,109 +1278,120 @@ var b = {
|
|
|
1240
1278
|
width: a - r,
|
|
1241
1279
|
height: o - i
|
|
1242
1280
|
};
|
|
1243
|
-
},
|
|
1281
|
+
}, Ai = t(() => v.groups.map((e) => ({
|
|
1244
1282
|
...e,
|
|
1245
|
-
rect:
|
|
1246
|
-
})).filter((e) => e.rect)), Q = (e) =>
|
|
1247
|
-
let t =
|
|
1283
|
+
rect: ki(e)
|
|
1284
|
+
})).filter((e) => e.rect)), Q = (e) => jn(e) ? Hn.value : (P(e.from), e.centerText && e.centerText.color || "#00f0ff"), ji = (e) => {
|
|
1285
|
+
let t = N.value[e.id];
|
|
1248
1286
|
return !!t && !t.hidden;
|
|
1249
|
-
},
|
|
1287
|
+
}, Mi = t(() => [...new Set(j.value.map(Q))].map((e) => ({
|
|
1250
1288
|
key: String(e).replace("#", ""),
|
|
1251
1289
|
color: e
|
|
1252
|
-
}))),
|
|
1290
|
+
}))), Ni = (e) => {
|
|
1253
1291
|
let t = e.endMarker;
|
|
1254
1292
|
if (!t || t === "none") return "";
|
|
1255
1293
|
let n = Q(e) || "#00f0ff", r = String(n).replace("#", "");
|
|
1256
1294
|
return `url(#${t === "dot" ? "edge-dot" : "edge-arrow"}-${r})`;
|
|
1257
|
-
},
|
|
1295
|
+
}, Pi = /* @__PURE__ */ new Map(), Fi = {
|
|
1258
1296
|
nodes: null,
|
|
1259
1297
|
edges: null,
|
|
1260
1298
|
mode: null,
|
|
1261
1299
|
epoch: -1
|
|
1262
|
-
},
|
|
1263
|
-
let e =
|
|
1264
|
-
(e.nodes !==
|
|
1265
|
-
nodes:
|
|
1266
|
-
edges:
|
|
1267
|
-
mode:
|
|
1300
|
+
}, Ii = () => {
|
|
1301
|
+
let e = Fi;
|
|
1302
|
+
(e.nodes !== C.value || e.edges !== j.value || e.mode !== T.value || e.epoch !== Rt) && (Fi = {
|
|
1303
|
+
nodes: C.value,
|
|
1304
|
+
edges: j.value,
|
|
1305
|
+
mode: T.value,
|
|
1268
1306
|
epoch: Rt
|
|
1269
|
-
},
|
|
1307
|
+
}, Pi = /* @__PURE__ */ new Map());
|
|
1270
1308
|
}, $ = (e) => {
|
|
1271
|
-
|
|
1272
|
-
let t =
|
|
1273
|
-
return t === void 0 && (t =
|
|
1274
|
-
},
|
|
1309
|
+
Ii();
|
|
1310
|
+
let t = Pi.get(e.id);
|
|
1311
|
+
return t === void 0 && (t = Si(e), Pi.set(e.id, t)), t;
|
|
1312
|
+
}, Li = (e, t = 1) => `${2 / e.speed * t}s`, Ri = (e) => `${3 / e.speed}s`, zi = (e) => {
|
|
1313
|
+
let t = zr(e);
|
|
1314
|
+
return t === "flow" || t === "all";
|
|
1315
|
+
}, Bi = (e) => {
|
|
1316
|
+
let t = zr(e);
|
|
1317
|
+
return t === "particle" || t === "all";
|
|
1318
|
+
}, Vi = (e) => Bt(e).text, Hi = (e) => !!e && String(Bt(e).text ?? "").trim() !== "", Ui = (e, t) => {
|
|
1275
1319
|
if (!e) return null;
|
|
1276
|
-
let n =
|
|
1320
|
+
let n = Bt(e), r = Number(t.fontSize) || Number(n.fontSize) || 8, i = String(n.text ?? ""), a = 0;
|
|
1277
1321
|
for (let e of i) a += e.charCodeAt(0) > 11904 ? 1 : .62;
|
|
1278
1322
|
return {
|
|
1279
1323
|
w: Math.max(14, a * r + 8),
|
|
1280
1324
|
h: Math.max(12, r + 6)
|
|
1281
1325
|
};
|
|
1282
|
-
},
|
|
1283
|
-
let n =
|
|
1326
|
+
}, Wi = (e, t) => {
|
|
1327
|
+
let n = Ci(e, Math.max(0, t - .005)), r = Ci(e, Math.min(1, t + .005));
|
|
1284
1328
|
return Math.atan2(r.y - n.y, r.x - n.x) * 180 / Math.PI;
|
|
1285
|
-
},
|
|
1329
|
+
}, Gi = (e) => {
|
|
1286
1330
|
let t = e % 180;
|
|
1287
1331
|
return t > 90 && (t -= 180), t < -90 && (t += 180), t;
|
|
1288
|
-
},
|
|
1332
|
+
}, Ki = (e, t, n) => `translate(${t.x}, ${t.y}) rotate(${(Bt(e).rotation || 0) + (n || 0)})`, qi = t(() => {
|
|
1289
1333
|
let e = [];
|
|
1290
|
-
for (let t of
|
|
1291
|
-
let n =
|
|
1334
|
+
for (let t of W.value) {
|
|
1335
|
+
let n = N.value[t.id];
|
|
1292
1336
|
if (!n) continue;
|
|
1293
1337
|
let r = n.merged && n.representative, i = !n.merged && (t.fromText || t.centerText || t.toText);
|
|
1294
1338
|
if (!r && !i) continue;
|
|
1295
|
-
let a =
|
|
1339
|
+
let a = P(t.from), o = P(t.to);
|
|
1296
1340
|
a && o && e.push({
|
|
1297
1341
|
id: t.id,
|
|
1298
1342
|
edge: t,
|
|
1299
1343
|
info: n,
|
|
1300
|
-
color: a && ie[a.
|
|
1301
|
-
start:
|
|
1302
|
-
center:
|
|
1303
|
-
end:
|
|
1304
|
-
startAngle:
|
|
1305
|
-
centerAngle:
|
|
1306
|
-
endAngle:
|
|
1307
|
-
fromBox:
|
|
1308
|
-
centerBox:
|
|
1309
|
-
toBox:
|
|
1344
|
+
color: a && ie[a.nodeType] || "#00f0ff",
|
|
1345
|
+
start: Ci(t, .28),
|
|
1346
|
+
center: Ci(t, .5),
|
|
1347
|
+
end: Ci(t, .72),
|
|
1348
|
+
startAngle: Gi(Wi(t, .28)),
|
|
1349
|
+
centerAngle: Gi(Wi(t, .5)),
|
|
1350
|
+
endAngle: Gi(Wi(t, .72)),
|
|
1351
|
+
fromBox: Ui(t.fromText, t),
|
|
1352
|
+
centerBox: Ui(t.centerText, t),
|
|
1353
|
+
toBox: Ui(t.toText, t)
|
|
1310
1354
|
});
|
|
1311
1355
|
}
|
|
1312
1356
|
return e;
|
|
1313
1357
|
});
|
|
1314
1358
|
return te({
|
|
1315
|
-
resetDataBaseline:
|
|
1316
|
-
getData:
|
|
1317
|
-
setData:
|
|
1318
|
-
removeSelected:
|
|
1319
|
-
addNodes:
|
|
1320
|
-
addEdges:
|
|
1321
|
-
updateNodes:
|
|
1322
|
-
updateEdges:
|
|
1323
|
-
clientToSvg:
|
|
1324
|
-
svgToClient:
|
|
1359
|
+
resetDataBaseline: sn,
|
|
1360
|
+
getData: cn,
|
|
1361
|
+
setData: mn,
|
|
1362
|
+
removeSelected: ln,
|
|
1363
|
+
addNodes: un,
|
|
1364
|
+
addEdges: dn,
|
|
1365
|
+
updateNodes: fn,
|
|
1366
|
+
updateEdges: pn,
|
|
1367
|
+
clientToSvg: ai,
|
|
1368
|
+
svgToClient: oi,
|
|
1369
|
+
moveLayerUp: Ln,
|
|
1370
|
+
moveLayerDown: Rn,
|
|
1371
|
+
moveToFront: zn,
|
|
1372
|
+
moveToBack: Bn,
|
|
1373
|
+
downloadSVG: Vn
|
|
1325
1374
|
}), (t, c) => (u(), r("svg", {
|
|
1326
1375
|
ref_key: "svgRef",
|
|
1327
|
-
ref:
|
|
1376
|
+
ref: D,
|
|
1328
1377
|
class: "topology-svg",
|
|
1329
|
-
style: s(
|
|
1330
|
-
viewBox: `${
|
|
1331
|
-
onMousedown:
|
|
1332
|
-
onMousemove:
|
|
1333
|
-
onMouseup:
|
|
1334
|
-
onMouseleave:
|
|
1335
|
-
onClick:
|
|
1336
|
-
onWheel: g(
|
|
1378
|
+
style: s(wr.value),
|
|
1379
|
+
viewBox: `${$n.value} ${er.value} ${H.value} ${U.value}`,
|
|
1380
|
+
onMousedown: hr,
|
|
1381
|
+
onMousemove: qr,
|
|
1382
|
+
onMouseup: Yr,
|
|
1383
|
+
onMouseleave: Yr,
|
|
1384
|
+
onClick: Jn,
|
|
1385
|
+
onWheel: g(or, ["prevent"])
|
|
1337
1386
|
}, [
|
|
1338
1387
|
i("defs", null, [
|
|
1339
1388
|
c[3] ||= a("<filter id=\"glow-core\" x=\"-50%\" y=\"-50%\" width=\"200%\" height=\"200%\"><feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"3\" result=\"blur\"></feGaussianBlur><feMerge><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"SourceGraphic\"></feMergeNode></feMerge></filter><filter id=\"glow-strong\" x=\"-50%\" y=\"-50%\" width=\"200%\" height=\"200%\"><feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"6\" result=\"blur\"></feGaussianBlur><feMerge><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"SourceGraphic\"></feMergeNode></feMerge></filter>", 2),
|
|
1340
1389
|
i("radialGradient", {
|
|
1341
1390
|
id: "bg-grid",
|
|
1342
|
-
cx:
|
|
1343
|
-
cy:
|
|
1344
|
-
r:
|
|
1345
|
-
}, [(u(!0), r(e, null, f(
|
|
1391
|
+
cx: kr.value.cx,
|
|
1392
|
+
cy: kr.value.cy,
|
|
1393
|
+
r: kr.value.r
|
|
1394
|
+
}, [(u(!0), r(e, null, f(kr.value.stops, (e, t) => (u(), r("stop", {
|
|
1346
1395
|
key: `bg-stop-${t}`,
|
|
1347
1396
|
offset: e.offset,
|
|
1348
1397
|
"stop-color": e.color,
|
|
@@ -1369,7 +1418,7 @@ var b = {
|
|
|
1369
1418
|
}, null, 8, de)
|
|
1370
1419
|
], 8, ce))), 128)),
|
|
1371
1420
|
c[4] ||= a("<linearGradient id=\"flow-grad-1\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0%\" stop-color=\"#00f0ff\" stop-opacity=\"0\"></stop><stop offset=\"40%\" stop-color=\"#00f0ff\" stop-opacity=\"1\"></stop><stop offset=\"60%\" stop-color=\"#00f0ff\" stop-opacity=\"1\"></stop><stop offset=\"100%\" stop-color=\"#00f0ff\" stop-opacity=\"0\"></stop></linearGradient>", 1),
|
|
1372
|
-
(u(!0), r(e, null, f(
|
|
1421
|
+
(u(!0), r(e, null, f(Mi.value, (e) => (u(), r("marker", {
|
|
1373
1422
|
key: `m-arrow-${e.key}`,
|
|
1374
1423
|
id: `edge-arrow-${e.key}`,
|
|
1375
1424
|
viewBox: "0 0 10 10",
|
|
@@ -1383,7 +1432,7 @@ var b = {
|
|
|
1383
1432
|
d: "M1,2.5 L9,5 L1,7.5 Z",
|
|
1384
1433
|
fill: e.color
|
|
1385
1434
|
}, null, 8, pe)], 8, fe))), 128)),
|
|
1386
|
-
(u(!0), r(e, null, f(
|
|
1435
|
+
(u(!0), r(e, null, f(Mi.value, (e) => (u(), r("marker", {
|
|
1387
1436
|
key: `m-dot-${e.key}`,
|
|
1388
1437
|
id: `edge-dot-${e.key}`,
|
|
1389
1438
|
viewBox: "0 0 10 10",
|
|
@@ -1401,31 +1450,31 @@ var b = {
|
|
|
1401
1450
|
}, null, 8, he)], 8, me))), 128))
|
|
1402
1451
|
]),
|
|
1403
1452
|
i("rect", {
|
|
1404
|
-
width:
|
|
1405
|
-
height:
|
|
1406
|
-
x:
|
|
1407
|
-
y:
|
|
1453
|
+
width: H.value,
|
|
1454
|
+
height: U.value,
|
|
1455
|
+
x: $n.value,
|
|
1456
|
+
y: er.value,
|
|
1408
1457
|
fill: "url(#bg-grid)"
|
|
1409
1458
|
}, null, 8, ge),
|
|
1410
|
-
|
|
1459
|
+
Tr.value ? (u(), r(e, { key: 0 }, [i("pattern", {
|
|
1411
1460
|
id: "grid",
|
|
1412
|
-
width:
|
|
1413
|
-
height:
|
|
1461
|
+
width: Dr.value,
|
|
1462
|
+
height: Dr.value,
|
|
1414
1463
|
patternUnits: "userSpaceOnUse"
|
|
1415
1464
|
}, [i("path", {
|
|
1416
|
-
d: `M ${
|
|
1465
|
+
d: `M ${Dr.value} 0 L 0 0 0 ${Dr.value}`,
|
|
1417
1466
|
fill: "none",
|
|
1418
|
-
stroke:
|
|
1467
|
+
stroke: Er.value,
|
|
1419
1468
|
"stroke-width": "0.5"
|
|
1420
1469
|
}, null, 8, ve)], 8, _e), i("rect", {
|
|
1421
|
-
width:
|
|
1422
|
-
height:
|
|
1423
|
-
x:
|
|
1424
|
-
y:
|
|
1470
|
+
width: H.value,
|
|
1471
|
+
height: U.value,
|
|
1472
|
+
x: $n.value,
|
|
1473
|
+
y: er.value,
|
|
1425
1474
|
fill: "url(#grid)",
|
|
1426
|
-
opacity:
|
|
1475
|
+
opacity: Or.value
|
|
1427
1476
|
}, null, 8, ye)], 64)) : n("", !0),
|
|
1428
|
-
|
|
1477
|
+
Ar.value ? (u(), r("g", be, [...c[5] ||= [
|
|
1429
1478
|
i("line", {
|
|
1430
1479
|
x1: "-22",
|
|
1431
1480
|
y1: "0",
|
|
@@ -1457,7 +1506,7 @@ var b = {
|
|
|
1457
1506
|
opacity: "0.8"
|
|
1458
1507
|
}, null, -1)
|
|
1459
1508
|
]])) : n("", !0),
|
|
1460
|
-
(u(!0), r(e, null, f(
|
|
1509
|
+
(u(!0), r(e, null, f(Ai.value, (e) => (u(), r("g", { key: e.id }, [
|
|
1461
1510
|
i("rect", {
|
|
1462
1511
|
x: e.rect.x,
|
|
1463
1512
|
y: e.rect.y,
|
|
@@ -1519,16 +1568,16 @@ var b = {
|
|
|
1519
1568
|
"letter-spacing": "0.5"
|
|
1520
1569
|
}, m(e.label), 9, De)
|
|
1521
1570
|
]))), 128)),
|
|
1522
|
-
(u(!0), r(e, null, f(
|
|
1571
|
+
(u(!0), r(e, null, f(W.value, (e) => (u(), r("path", {
|
|
1523
1572
|
key: `base-${e.id}`,
|
|
1524
1573
|
d: $(e),
|
|
1525
1574
|
fill: "none",
|
|
1526
1575
|
stroke: "#1a2744",
|
|
1527
1576
|
"stroke-width": "2",
|
|
1528
1577
|
"stroke-linecap": "round",
|
|
1529
|
-
"marker-end":
|
|
1578
|
+
"marker-end": Ni(e)
|
|
1530
1579
|
}, null, 8, Oe))), 128)),
|
|
1531
|
-
(u(!0), r(e, null, f(
|
|
1580
|
+
(u(!0), r(e, null, f(W.value, (t) => (u(), r(e, { key: `glow-${t.id}` }, [Lr.value ? (u(), r("path", {
|
|
1532
1581
|
key: 0,
|
|
1533
1582
|
d: $(t),
|
|
1534
1583
|
fill: "none",
|
|
@@ -1538,16 +1587,16 @@ var b = {
|
|
|
1538
1587
|
opacity: "0.15",
|
|
1539
1588
|
filter: "url(#glow-strong)"
|
|
1540
1589
|
}, null, 8, ke)) : n("", !0)], 64))), 128)),
|
|
1541
|
-
(u(!0), r(e, null, f(
|
|
1590
|
+
(u(!0), r(e, null, f(W.value, (t) => (u(), r(e, { key: `sel-${t.id}` }, [jn(t) ? (u(), r("path", {
|
|
1542
1591
|
key: 0,
|
|
1543
1592
|
d: $(t),
|
|
1544
1593
|
fill: "none",
|
|
1545
|
-
stroke:
|
|
1594
|
+
stroke: Hn.value,
|
|
1546
1595
|
"stroke-width": "4",
|
|
1547
1596
|
opacity: "0.35",
|
|
1548
1597
|
filter: "url(#glow-strong)"
|
|
1549
1598
|
}, null, 8, Ae)) : n("", !0)], 64))), 128)),
|
|
1550
|
-
(u(!0), r(e, null, f(
|
|
1599
|
+
(u(!0), r(e, null, f(W.value, (t) => (u(), r(e, { key: `flow-${t.id}` }, [zi(t) ? (u(), r("g", je, [
|
|
1551
1600
|
i("path", {
|
|
1552
1601
|
d: $(t),
|
|
1553
1602
|
fill: "none",
|
|
@@ -1560,7 +1609,7 @@ var b = {
|
|
|
1560
1609
|
attributeName: "stroke-dashoffset",
|
|
1561
1610
|
from: "0",
|
|
1562
1611
|
to: "-52",
|
|
1563
|
-
dur:
|
|
1612
|
+
dur: Li(t),
|
|
1564
1613
|
repeatCount: "indefinite"
|
|
1565
1614
|
}, null, 8, Ne)], 8, Me),
|
|
1566
1615
|
i("path", {
|
|
@@ -1575,7 +1624,7 @@ var b = {
|
|
|
1575
1624
|
attributeName: "stroke-dashoffset",
|
|
1576
1625
|
from: "-30",
|
|
1577
1626
|
to: "-82",
|
|
1578
|
-
dur:
|
|
1627
|
+
dur: Li(t, 1.3),
|
|
1579
1628
|
repeatCount: "indefinite"
|
|
1580
1629
|
}, null, 8, Fe)], 8, Pe),
|
|
1581
1630
|
i("path", {
|
|
@@ -1591,18 +1640,18 @@ var b = {
|
|
|
1591
1640
|
attributeName: "stroke-dashoffset",
|
|
1592
1641
|
from: "0",
|
|
1593
1642
|
to: "-84",
|
|
1594
|
-
dur:
|
|
1643
|
+
dur: Li(t, .8),
|
|
1595
1644
|
repeatCount: "indefinite"
|
|
1596
1645
|
}, null, 8, Le)], 8, Ie)
|
|
1597
1646
|
])) : n("", !0)], 64))), 128)),
|
|
1598
|
-
(u(!0), r(e, null, f(
|
|
1647
|
+
(u(!0), r(e, null, f(W.value, (t) => (u(), r(e, { key: `particle-${t.id}` }, [Bi(t) ? (u(), r("g", Re, [i("circle", {
|
|
1599
1648
|
r: "3",
|
|
1600
1649
|
fill: Q(t),
|
|
1601
1650
|
opacity: "0.9",
|
|
1602
1651
|
filter: "url(#glow-core)"
|
|
1603
1652
|
}, [i("animateMotion", {
|
|
1604
1653
|
path: $(t),
|
|
1605
|
-
dur:
|
|
1654
|
+
dur: Ri(t),
|
|
1606
1655
|
repeatCount: "indefinite"
|
|
1607
1656
|
}, null, 8, Be)], 8, ze), i("circle", {
|
|
1608
1657
|
r: "8",
|
|
@@ -1611,17 +1660,17 @@ var b = {
|
|
|
1611
1660
|
filter: "url(#glow-strong)"
|
|
1612
1661
|
}, [i("animateMotion", {
|
|
1613
1662
|
path: $(t),
|
|
1614
|
-
dur:
|
|
1663
|
+
dur: Ri(t),
|
|
1615
1664
|
repeatCount: "indefinite"
|
|
1616
1665
|
}, null, 8, He)], 8, Ve)])) : n("", !0)], 64))), 128)),
|
|
1617
|
-
(u(!0), r(e, null, f(
|
|
1666
|
+
(u(!0), r(e, null, f(qi.value, (t) => (u(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (u(), r("g", {
|
|
1618
1667
|
key: 0,
|
|
1619
1668
|
transform: `translate(${t.center.x}, ${t.center.y}) rotate(${t.centerAngle})`
|
|
1620
1669
|
}, [i("rect", {
|
|
1621
1670
|
x: "-7",
|
|
1622
|
-
y: -
|
|
1671
|
+
y: -Wt(t.edge, null) / 2,
|
|
1623
1672
|
width: 14,
|
|
1624
|
-
height:
|
|
1673
|
+
height: Wt(t.edge, null),
|
|
1625
1674
|
rx: "2",
|
|
1626
1675
|
fill: "#FFFFFF",
|
|
1627
1676
|
opacity: "0.9",
|
|
@@ -1631,94 +1680,94 @@ var b = {
|
|
|
1631
1680
|
y: "0",
|
|
1632
1681
|
"dominant-baseline": "central",
|
|
1633
1682
|
"text-anchor": "middle",
|
|
1634
|
-
"font-size":
|
|
1635
|
-
fill:
|
|
1683
|
+
"font-size": Wt(t.edge, null),
|
|
1684
|
+
fill: S(t.edge, null),
|
|
1636
1685
|
"font-family": "'SF Mono', monospace",
|
|
1637
1686
|
opacity: "1"
|
|
1638
1687
|
}, m(t.info.count), 9, Ge)], 8, Ue)) : t.info.merged ? n("", !0) : (u(), r("g", Ke, [
|
|
1639
|
-
|
|
1688
|
+
Hi(t.edge.fromText) ? (u(), r("g", {
|
|
1640
1689
|
key: 0,
|
|
1641
|
-
transform:
|
|
1642
|
-
}, [
|
|
1690
|
+
transform: Ki(t.edge.fromText, t.start, t.startAngle)
|
|
1691
|
+
}, [jr.value ? (u(), r("rect", {
|
|
1643
1692
|
key: 0,
|
|
1644
1693
|
x: -t.fromBox.w / 2,
|
|
1645
1694
|
y: -t.fromBox.h / 2,
|
|
1646
1695
|
width: t.fromBox.w,
|
|
1647
1696
|
height: t.fromBox.h,
|
|
1648
1697
|
rx: "3",
|
|
1649
|
-
fill:
|
|
1698
|
+
fill: Mr.value,
|
|
1650
1699
|
opacity: "0.92",
|
|
1651
|
-
stroke:
|
|
1700
|
+
stroke: S(t.edge, t.edge.fromText),
|
|
1652
1701
|
"stroke-opacity": "0.35",
|
|
1653
1702
|
"stroke-width": "0.6"
|
|
1654
1703
|
}, null, 8, Je)) : n("", !0), i("text", {
|
|
1655
1704
|
y: "0",
|
|
1656
1705
|
"dominant-baseline": "central",
|
|
1657
1706
|
"text-anchor": "middle",
|
|
1658
|
-
"font-size":
|
|
1659
|
-
fill:
|
|
1707
|
+
"font-size": Wt(t.edge, t.edge.fromText),
|
|
1708
|
+
fill: S(t.edge, t.edge.fromText),
|
|
1660
1709
|
"font-family": "'SF Mono', monospace",
|
|
1661
1710
|
"font-weight": "500",
|
|
1662
1711
|
opacity: "0.9"
|
|
1663
|
-
}, m(
|
|
1664
|
-
|
|
1712
|
+
}, m(Vi(t.edge.fromText)), 9, Ye)], 8, qe)) : n("", !0),
|
|
1713
|
+
Hi(t.edge.centerText) ? (u(), r("g", {
|
|
1665
1714
|
key: 1,
|
|
1666
|
-
transform:
|
|
1667
|
-
}, [
|
|
1715
|
+
transform: Ki(t.edge.centerText, t.center, t.centerAngle)
|
|
1716
|
+
}, [jr.value ? (u(), r("rect", {
|
|
1668
1717
|
key: 0,
|
|
1669
1718
|
x: -t.centerBox.w / 2,
|
|
1670
1719
|
y: -t.centerBox.h / 2,
|
|
1671
1720
|
width: t.centerBox.w,
|
|
1672
1721
|
height: t.centerBox.h,
|
|
1673
1722
|
rx: "3",
|
|
1674
|
-
fill:
|
|
1723
|
+
fill: Mr.value,
|
|
1675
1724
|
opacity: "0.92",
|
|
1676
|
-
stroke:
|
|
1725
|
+
stroke: S(t.edge, t.edge.centerText),
|
|
1677
1726
|
"stroke-opacity": "0.35",
|
|
1678
1727
|
"stroke-width": "0.6"
|
|
1679
1728
|
}, null, 8, Ze)) : n("", !0), i("text", {
|
|
1680
1729
|
y: "0",
|
|
1681
1730
|
"dominant-baseline": "central",
|
|
1682
1731
|
"text-anchor": "middle",
|
|
1683
|
-
"font-size":
|
|
1684
|
-
fill:
|
|
1732
|
+
"font-size": Wt(t.edge, t.edge.centerText),
|
|
1733
|
+
fill: S(t.edge, t.edge.centerText),
|
|
1685
1734
|
"font-family": "'SF Mono', monospace",
|
|
1686
1735
|
"font-weight": "600",
|
|
1687
1736
|
opacity: "1"
|
|
1688
|
-
}, m(
|
|
1689
|
-
|
|
1737
|
+
}, m(Vi(t.edge.centerText)), 9, Qe)], 8, Xe)) : n("", !0),
|
|
1738
|
+
Hi(t.edge.toText) ? (u(), r("g", {
|
|
1690
1739
|
key: 2,
|
|
1691
|
-
transform:
|
|
1692
|
-
}, [
|
|
1740
|
+
transform: Ki(t.edge.toText, t.end, t.endAngle)
|
|
1741
|
+
}, [jr.value ? (u(), r("rect", {
|
|
1693
1742
|
key: 0,
|
|
1694
1743
|
x: -t.toBox.w / 2,
|
|
1695
1744
|
y: -t.toBox.h / 2,
|
|
1696
1745
|
width: t.toBox.w,
|
|
1697
1746
|
height: t.toBox.h,
|
|
1698
1747
|
rx: "3",
|
|
1699
|
-
fill:
|
|
1748
|
+
fill: Mr.value,
|
|
1700
1749
|
opacity: "0.92",
|
|
1701
|
-
stroke:
|
|
1750
|
+
stroke: S(t.edge, t.edge.toText),
|
|
1702
1751
|
"stroke-opacity": "0.35",
|
|
1703
1752
|
"stroke-width": "0.6"
|
|
1704
1753
|
}, null, 8, et)) : n("", !0), i("text", {
|
|
1705
1754
|
y: "0",
|
|
1706
1755
|
"dominant-baseline": "central",
|
|
1707
1756
|
"text-anchor": "middle",
|
|
1708
|
-
"font-size":
|
|
1709
|
-
fill:
|
|
1757
|
+
"font-size": Wt(t.edge, t.edge.toText),
|
|
1758
|
+
fill: S(t.edge, t.edge.toText),
|
|
1710
1759
|
"font-family": "'SF Mono', monospace",
|
|
1711
1760
|
"font-weight": "500",
|
|
1712
1761
|
opacity: "0.9"
|
|
1713
|
-
}, m(
|
|
1762
|
+
}, m(Vi(t.edge.toText)), 9, tt)], 8, $e)) : n("", !0)
|
|
1714
1763
|
]))], 64))), 128)),
|
|
1715
1764
|
X.value ? (u(), r("g", nt, [
|
|
1716
1765
|
i("line", {
|
|
1717
1766
|
x1: X.value.ax,
|
|
1718
1767
|
y1: X.value.ay,
|
|
1719
|
-
x2:
|
|
1720
|
-
y2:
|
|
1721
|
-
stroke:
|
|
1768
|
+
x2: Di.value.x,
|
|
1769
|
+
y2: Di.value.y,
|
|
1770
|
+
stroke: Ei.value,
|
|
1722
1771
|
"stroke-width": "2",
|
|
1723
1772
|
"stroke-dasharray": "6 6",
|
|
1724
1773
|
"stroke-linecap": "round",
|
|
@@ -1728,24 +1777,24 @@ var b = {
|
|
|
1728
1777
|
cx: X.value.px,
|
|
1729
1778
|
cy: X.value.py,
|
|
1730
1779
|
r: "3.5",
|
|
1731
|
-
fill:
|
|
1780
|
+
fill: Ei.value,
|
|
1732
1781
|
opacity: "0.9"
|
|
1733
1782
|
}, null, 8, it),
|
|
1734
|
-
X.value.overId &&
|
|
1783
|
+
X.value.overId && Oi.value ? (u(), r("rect", {
|
|
1735
1784
|
key: 0,
|
|
1736
|
-
x:
|
|
1737
|
-
y:
|
|
1738
|
-
width:
|
|
1739
|
-
height:
|
|
1785
|
+
x: Oi.value.x,
|
|
1786
|
+
y: Oi.value.y,
|
|
1787
|
+
width: Oi.value.w,
|
|
1788
|
+
height: Oi.value.h,
|
|
1740
1789
|
rx: "6",
|
|
1741
1790
|
fill: "none",
|
|
1742
|
-
stroke:
|
|
1791
|
+
stroke: Ei.value,
|
|
1743
1792
|
"stroke-width": "1.5",
|
|
1744
1793
|
"stroke-dasharray": "6 4",
|
|
1745
1794
|
opacity: "0.9"
|
|
1746
1795
|
}, null, 8, at)) : n("", !0)
|
|
1747
1796
|
])) : n("", !0),
|
|
1748
|
-
(u(!0), r(e, null, f(
|
|
1797
|
+
(u(!0), r(e, null, f(W.value, (e) => (u(), r("path", {
|
|
1749
1798
|
key: `hit-${e.id}`,
|
|
1750
1799
|
d: $(e),
|
|
1751
1800
|
fill: "none",
|
|
@@ -1755,100 +1804,104 @@ var b = {
|
|
|
1755
1804
|
"pointer-events": "stroke",
|
|
1756
1805
|
cursor: "pointer"
|
|
1757
1806
|
},
|
|
1758
|
-
onClick: g((t) =>
|
|
1807
|
+
onClick: g((t) => Un(e, t), ["stop"])
|
|
1759
1808
|
}, null, 8, ot))), 128)),
|
|
1760
|
-
(u(!0), r(e, null, f(
|
|
1809
|
+
(u(!0), r(e, null, f(ar.value, (a) => (u(), r("g", {
|
|
1761
1810
|
key: a.id,
|
|
1762
1811
|
transform: `translate(${a.x}, ${a.y})`,
|
|
1763
|
-
class: o(["topology-node",
|
|
1764
|
-
onMousedown: (e) =>
|
|
1765
|
-
onClick: (e) =>
|
|
1812
|
+
class: o(["topology-node", E.value === a.id ? "dragging" : ""]),
|
|
1813
|
+
onMousedown: (e) => Wr(e, a.id),
|
|
1814
|
+
onClick: (e) => In(a, e),
|
|
1766
1815
|
style: s({
|
|
1767
1816
|
cursor: v.editable && v.config.nodeDraggable !== !1 ? "grab" : "default",
|
|
1768
|
-
color:
|
|
1817
|
+
color: F(a)
|
|
1769
1818
|
})
|
|
1770
1819
|
}, [
|
|
1771
1820
|
i("rect", {
|
|
1772
1821
|
class: "node-hit-area",
|
|
1773
|
-
x:
|
|
1774
|
-
y:
|
|
1775
|
-
width:
|
|
1776
|
-
height:
|
|
1822
|
+
x: En(a).x,
|
|
1823
|
+
y: En(a).y,
|
|
1824
|
+
width: En(a).width,
|
|
1825
|
+
height: En(a).height,
|
|
1777
1826
|
fill: "transparent",
|
|
1778
1827
|
"pointer-events": "all"
|
|
1779
1828
|
}, null, 8, ct),
|
|
1780
|
-
|
|
1829
|
+
kn(a) && _.viewMode !== "3d" ? (u(), r("rect", {
|
|
1781
1830
|
key: 0,
|
|
1782
|
-
x:
|
|
1783
|
-
y:
|
|
1784
|
-
width:
|
|
1785
|
-
height:
|
|
1786
|
-
rx:
|
|
1787
|
-
fill:
|
|
1831
|
+
x: L(a).x,
|
|
1832
|
+
y: L(a).y,
|
|
1833
|
+
width: L(a).width,
|
|
1834
|
+
height: L(a).height,
|
|
1835
|
+
rx: Ur(a),
|
|
1836
|
+
fill: kn(a),
|
|
1788
1837
|
opacity: "0.15"
|
|
1789
1838
|
}, null, 8, lt)) : n("", !0),
|
|
1790
|
-
|
|
1839
|
+
On(a) && _.viewMode !== "3d" ? (u(), r("rect", {
|
|
1791
1840
|
key: 1,
|
|
1792
|
-
x:
|
|
1793
|
-
y:
|
|
1794
|
-
width:
|
|
1795
|
-
height:
|
|
1796
|
-
rx:
|
|
1841
|
+
x: On(a).x,
|
|
1842
|
+
y: On(a).y,
|
|
1843
|
+
width: On(a).width,
|
|
1844
|
+
height: On(a).height,
|
|
1845
|
+
rx: Ur(a),
|
|
1797
1846
|
fill: "none",
|
|
1798
|
-
stroke:
|
|
1799
|
-
"stroke-width":
|
|
1800
|
-
"stroke-dasharray":
|
|
1847
|
+
stroke: Br(a),
|
|
1848
|
+
"stroke-width": Vr(a),
|
|
1849
|
+
"stroke-dasharray": Hr(a),
|
|
1801
1850
|
opacity: "0.8"
|
|
1802
1851
|
}, null, 8, ut)) : n("", !0),
|
|
1803
|
-
|
|
1852
|
+
An(a) && _.viewMode !== "3d" ? (u(), r("rect", {
|
|
1804
1853
|
key: 2,
|
|
1805
|
-
x:
|
|
1806
|
-
y:
|
|
1807
|
-
width:
|
|
1808
|
-
height:
|
|
1809
|
-
rx:
|
|
1854
|
+
x: L(a).x,
|
|
1855
|
+
y: L(a).y,
|
|
1856
|
+
width: L(a).width,
|
|
1857
|
+
height: L(a).height,
|
|
1858
|
+
rx: Ur(a),
|
|
1810
1859
|
fill: "none",
|
|
1811
|
-
stroke:
|
|
1860
|
+
stroke: Fn.value,
|
|
1812
1861
|
"stroke-width": "2.5",
|
|
1813
1862
|
transform: "scale(1.1)",
|
|
1814
1863
|
style: { "pointer-events": "none" }
|
|
1815
1864
|
}, null, 8, dt)) : n("", !0),
|
|
1816
|
-
|
|
1865
|
+
_n(a) ? (u(), r(e, { key: 3 }, [i("rect", {
|
|
1817
1866
|
x: "-4",
|
|
1818
1867
|
y: "-10",
|
|
1819
1868
|
width: "8",
|
|
1820
1869
|
height: "20",
|
|
1821
|
-
fill:
|
|
1870
|
+
fill: gn(a).color,
|
|
1822
1871
|
opacity: "0.06"
|
|
1823
1872
|
}, null, 8, ft), i("text", {
|
|
1824
1873
|
y: "4",
|
|
1825
1874
|
transform: `rotate(${a.rotation || 0} 0 4)`,
|
|
1826
1875
|
"text-anchor": "middle",
|
|
1827
|
-
fill:
|
|
1828
|
-
"font-size":
|
|
1876
|
+
fill: Ht(a) || F(a) || gn(a).color,
|
|
1877
|
+
"font-size": Vt(a, 12),
|
|
1829
1878
|
"font-family": "'SF Mono', 'Cascadia Code', 'Consolas', monospace",
|
|
1830
1879
|
"font-weight": "600"
|
|
1831
|
-
}, m(a.label), 9, pt)], 64)) : (u(), r(e, { key: 4 }, [
|
|
1832
|
-
|
|
1880
|
+
}, m(a.label), 9, pt)], 64)) : vn(a) ? (u(), r(e, { key: 4 }, [], 64)) : (u(), r(e, { key: 5 }, [
|
|
1881
|
+
a.state !== "none" && Rr.value ? (u(), r("circle", {
|
|
1833
1882
|
key: 0,
|
|
1834
|
-
r:
|
|
1883
|
+
r: xn(a),
|
|
1835
1884
|
fill: "none",
|
|
1836
|
-
stroke:
|
|
1885
|
+
stroke: gn(a).color,
|
|
1837
1886
|
"stroke-width": "2.5",
|
|
1838
1887
|
opacity: "0"
|
|
1839
|
-
}, [
|
|
1888
|
+
}, [i("animate", {
|
|
1840
1889
|
attributeName: "r",
|
|
1841
|
-
values:
|
|
1890
|
+
values: `${xn(a)};${xn(a) * 1.6};${xn(a)}`,
|
|
1842
1891
|
dur: "2s",
|
|
1843
1892
|
repeatCount: "indefinite"
|
|
1844
|
-
}, null,
|
|
1893
|
+
}, null, 8, ht), c[6] ||= i("animate", {
|
|
1845
1894
|
attributeName: "opacity",
|
|
1846
1895
|
values: "0.4;0.05;0.4",
|
|
1847
1896
|
dur: "2s",
|
|
1848
1897
|
repeatCount: "indefinite"
|
|
1849
|
-
}, null, -1)]
|
|
1898
|
+
}, null, -1)], 8, mt)) : n("", !0),
|
|
1899
|
+
i("g", {
|
|
1900
|
+
class: "node-icon",
|
|
1901
|
+
transform: Sn(a)
|
|
1902
|
+
}, [p(t.$slots, "node-icon", {
|
|
1850
1903
|
node: a,
|
|
1851
|
-
color:
|
|
1904
|
+
color: F(a),
|
|
1852
1905
|
viewMode: _.viewMode
|
|
1853
1906
|
}, () => [i("rect", {
|
|
1854
1907
|
x: "-18",
|
|
@@ -1856,25 +1909,25 @@ var b = {
|
|
|
1856
1909
|
width: "36",
|
|
1857
1910
|
height: "36",
|
|
1858
1911
|
rx: "6",
|
|
1859
|
-
fill:
|
|
1912
|
+
fill: F(a),
|
|
1860
1913
|
opacity: "0.9"
|
|
1861
|
-
}, null, 8, _t)])]
|
|
1862
|
-
|
|
1863
|
-
key:
|
|
1864
|
-
transform:
|
|
1914
|
+
}, null, 8, _t)])], 8, gt),
|
|
1915
|
+
Pr.value ? (u(), r("g", {
|
|
1916
|
+
key: 1,
|
|
1917
|
+
transform: Cn(a)
|
|
1865
1918
|
}, [i("circle", {
|
|
1866
1919
|
r: "4",
|
|
1867
|
-
fill:
|
|
1920
|
+
fill: gn(a).color,
|
|
1868
1921
|
stroke: "#0a0e1a",
|
|
1869
1922
|
"stroke-width": "2"
|
|
1870
1923
|
}, null, 8, yt)], 8, vt)) : n("", !0),
|
|
1871
1924
|
i("text", {
|
|
1872
|
-
y:
|
|
1873
|
-
transform: `rotate(${a.rotation || 0} 0 ${
|
|
1925
|
+
y: Tn(a),
|
|
1926
|
+
transform: `rotate(${a.rotation || 0} 0 ${Tn(a)})`,
|
|
1874
1927
|
"text-anchor": "middle",
|
|
1875
|
-
fill:
|
|
1876
|
-
"font-size":
|
|
1877
|
-
"font-weight":
|
|
1928
|
+
fill: Ht(a),
|
|
1929
|
+
"font-size": Vt(a),
|
|
1930
|
+
"font-weight": Ut(a),
|
|
1878
1931
|
"font-family": "'Segoe UI', system-ui, sans-serif",
|
|
1879
1932
|
opacity: "0.9"
|
|
1880
1933
|
}, [(u(!0), r(e, null, f(String(a.label ?? "").split("\n"), (e, t) => (u(), r("tspan", {
|
|
@@ -1883,42 +1936,42 @@ var b = {
|
|
|
1883
1936
|
dy: t === 0 ? 0 : "1.2em"
|
|
1884
1937
|
}, m(e), 9, xt))), 128))], 8, bt)
|
|
1885
1938
|
], 64)),
|
|
1886
|
-
|
|
1939
|
+
Nr.value ? (u(), r("g", St, [(u(!0), r(e, null, f(ii(a), (e) => (u(), r("circle", {
|
|
1887
1940
|
key: e.side,
|
|
1888
1941
|
cx: e.x,
|
|
1889
1942
|
cy: e.y,
|
|
1890
1943
|
r: "4.5",
|
|
1891
1944
|
class: "node-handle",
|
|
1892
1945
|
fill: "#0a0e1a",
|
|
1893
|
-
stroke:
|
|
1946
|
+
stroke: F(a),
|
|
1894
1947
|
"stroke-width": "1.5",
|
|
1895
|
-
onPointerdown: g((t) =>
|
|
1896
|
-
onPointermove: g(
|
|
1897
|
-
onPointerup: g(
|
|
1898
|
-
onPointercancel: g(
|
|
1899
|
-
onLostpointercapture:
|
|
1948
|
+
onPointerdown: g((t) => si(t, a.id, e), ["stop", "prevent"]),
|
|
1949
|
+
onPointermove: g(_i, ["stop"]),
|
|
1950
|
+
onPointerup: g(vi, ["stop"]),
|
|
1951
|
+
onPointercancel: g(vi, ["stop"]),
|
|
1952
|
+
onLostpointercapture: vi,
|
|
1900
1953
|
onMousedown: c[0] ||= g(() => {}, ["stop", "prevent"]),
|
|
1901
1954
|
onClick: c[1] ||= g(() => {}, ["stop"])
|
|
1902
1955
|
}, null, 40, Ct))), 128))])) : n("", !0)
|
|
1903
1956
|
], 46, st))), 128)),
|
|
1904
|
-
|
|
1957
|
+
ri.value ? (u(), r("g", wt, [(u(!0), r(e, null, f(Zr(ri.value), (e) => (u(), r("rect", {
|
|
1905
1958
|
key: e.side,
|
|
1906
|
-
x:
|
|
1907
|
-
y:
|
|
1959
|
+
x: ri.value.x + e.x - 4.5,
|
|
1960
|
+
y: ri.value.y + e.y - 4.5,
|
|
1908
1961
|
width: "9",
|
|
1909
1962
|
height: "9",
|
|
1910
1963
|
rx: "2",
|
|
1911
1964
|
class: o(["node-resize-handle", `rt-${e.side}`]),
|
|
1912
|
-
onMousedown: g((t) =>
|
|
1965
|
+
onMousedown: g((t) => $r(t, ri.value, e.side), ["stop", "prevent"]),
|
|
1913
1966
|
onClick: c[2] ||= g(() => {}, ["stop"])
|
|
1914
1967
|
}, null, 42, Tt))), 128))])) : n("", !0),
|
|
1915
|
-
|
|
1968
|
+
K.value ? (u(), r("rect", {
|
|
1916
1969
|
key: 4,
|
|
1917
1970
|
class: "marquee-box",
|
|
1918
|
-
x:
|
|
1919
|
-
y:
|
|
1920
|
-
width:
|
|
1921
|
-
height:
|
|
1971
|
+
x: fr.value.x,
|
|
1972
|
+
y: fr.value.y,
|
|
1973
|
+
width: fr.value.width,
|
|
1974
|
+
height: fr.value.height,
|
|
1922
1975
|
rx: "2",
|
|
1923
1976
|
"vector-effect": "non-scaling-stroke"
|
|
1924
1977
|
}, null, 8, Et)) : n("", !0)
|