@html-graph/html-graph 8.19.1 → 8.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/html-graph.d.ts +22 -8
- package/dist/html-graph.js +119 -109
- package/dist/html-graph.min.js +739 -751
- package/dist/html-graph.min.umd.cjs +1 -1
- package/dist/html-graph.umd.cjs +118 -108
- package/package.json +1 -1
package/dist/html-graph.min.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var i = (r, e, t) =>
|
|
4
|
-
var
|
|
5
|
-
const
|
|
1
|
+
var ht = Object.defineProperty;
|
|
2
|
+
var dt = (r, e, t) => e in r ? ht(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var i = (r, e, t) => dt(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
var U = /* @__PURE__ */ ((r) => (r.Line = "line", r.NodeCycle = "node-cycle", r.PortCycle = "port-cycle", r))(U || {});
|
|
5
|
+
const ct = () => {
|
|
6
6
|
const r = document.createElement("div");
|
|
7
7
|
return r.style.width = "100%", r.style.height = "100%", r.style.position = "relative", r.style.overflow = "hidden", r;
|
|
8
|
-
},
|
|
8
|
+
}, lt = () => {
|
|
9
9
|
const r = document.createElement("div");
|
|
10
10
|
return r.style.position = "absolute", r.style.top = "0", r.style.left = "0", r.style.width = "0", r.style.height = "0", r;
|
|
11
|
-
},
|
|
11
|
+
}, ut = (r) => {
|
|
12
12
|
r.style.position = "absolute", r.style.top = "0", r.style.left = "0", r.style.visibility = "hidden";
|
|
13
|
-
},
|
|
13
|
+
}, gt = (r) => {
|
|
14
14
|
r.style.removeProperty("position"), r.style.removeProperty("top"), r.style.removeProperty("left"), r.style.removeProperty("visibility"), r.style.removeProperty("transform");
|
|
15
15
|
};
|
|
16
|
-
class
|
|
16
|
+
class Fe {
|
|
17
17
|
constructor(e, t, o) {
|
|
18
|
-
i(this, "host",
|
|
19
|
-
i(this, "container",
|
|
18
|
+
i(this, "host", ct());
|
|
19
|
+
i(this, "container", lt());
|
|
20
20
|
i(this, "edgeIdToElementMap", /* @__PURE__ */ new Map());
|
|
21
21
|
i(this, "attachedNodeIds", /* @__PURE__ */ new Set());
|
|
22
22
|
i(this, "applyTransform", () => {
|
|
@@ -27,11 +27,11 @@ class Ve {
|
|
|
27
27
|
}
|
|
28
28
|
attachNode(e) {
|
|
29
29
|
const t = this.graphStore.getNode(e);
|
|
30
|
-
|
|
30
|
+
ut(t.element), this.attachedNodeIds.add(e), this.container.appendChild(t.element), this.updateNodePosition(e), this.updateNodePriority(e), t.element.style.visibility = "visible";
|
|
31
31
|
}
|
|
32
32
|
detachNode(e) {
|
|
33
33
|
const t = this.graphStore.getNode(e);
|
|
34
|
-
|
|
34
|
+
gt(t.element), this.container.removeChild(t.element), this.attachedNodeIds.delete(e);
|
|
35
35
|
}
|
|
36
36
|
attachEdge(e) {
|
|
37
37
|
const t = this.graphStore.getEdge(e).payload.shape.svg;
|
|
@@ -71,9 +71,9 @@ class Ve {
|
|
|
71
71
|
n,
|
|
72
72
|
h,
|
|
73
73
|
d
|
|
74
|
-
),
|
|
75
|
-
let
|
|
76
|
-
o.element === s.element ?
|
|
74
|
+
), u = this.createEdgeRenderPort(s, a, h, d);
|
|
75
|
+
let l = U.Line;
|
|
76
|
+
o.element === s.element ? l = U.PortCycle : o.nodeId === s.nodeId && (l = U.NodeCycle), t.payload.shape.render({ from: c, to: u, category: l });
|
|
77
77
|
}
|
|
78
78
|
updateEdgePriority(e) {
|
|
79
79
|
const t = this.graphStore.getEdge(e);
|
|
@@ -93,7 +93,7 @@ class Ve {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
class
|
|
96
|
+
class pt {
|
|
97
97
|
constructor(e) {
|
|
98
98
|
i(this, "xFrom", 1 / 0);
|
|
99
99
|
i(this, "yFrom", 1 / 0);
|
|
@@ -109,11 +109,11 @@ class ut {
|
|
|
109
109
|
return o >= this.xFrom && o <= this.xTo && s >= this.yFrom && s <= this.yTo;
|
|
110
110
|
}
|
|
111
111
|
hasEdge(e) {
|
|
112
|
-
const t = this.graphStore.getEdge(e), o = this.graphStore.getPort(t.from).nodeId, s = this.graphStore.getPort(t.to).nodeId, n = this.graphStore.getNode(o).payload, a = this.graphStore.getNode(s).payload, h = Math.min(n.x, a.x), d = Math.max(n.x, a.x), c = Math.min(n.y, a.y),
|
|
113
|
-
return h <= this.xTo && d >= this.xFrom && c <= this.yTo &&
|
|
112
|
+
const t = this.graphStore.getEdge(e), o = this.graphStore.getPort(t.from).nodeId, s = this.graphStore.getPort(t.to).nodeId, n = this.graphStore.getNode(o).payload, a = this.graphStore.getNode(s).payload, h = Math.min(n.x, a.x), d = Math.max(n.x, a.x), c = Math.min(n.y, a.y), u = Math.max(n.y, a.y);
|
|
113
|
+
return h <= this.xTo && d >= this.xFrom && c <= this.yTo && u >= this.yFrom;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
class
|
|
116
|
+
class wt {
|
|
117
117
|
constructor(e, t, o, s) {
|
|
118
118
|
i(this, "attachedNodes", /* @__PURE__ */ new Set());
|
|
119
119
|
i(this, "attachedEdges", /* @__PURE__ */ new Set());
|
|
@@ -125,8 +125,8 @@ class gt {
|
|
|
125
125
|
const h = this.renderingBox.hasNode(a), d = this.attachedNodes.has(a);
|
|
126
126
|
h && !d ? t.add(a) : !h && d && o.add(a);
|
|
127
127
|
}), this.graphStore.getAllEdgeIds().forEach((a) => {
|
|
128
|
-
const h = this.renderingBox.hasEdge(a), d = this.attachedEdges.has(a), c = this.graphStore.getEdge(a),
|
|
129
|
-
h && (this.renderingBox.hasNode(
|
|
128
|
+
const h = this.renderingBox.hasEdge(a), d = this.attachedEdges.has(a), c = this.graphStore.getEdge(a), u = this.graphStore.getPort(c.from).nodeId, l = this.graphStore.getPort(c.to).nodeId;
|
|
129
|
+
h && (this.renderingBox.hasNode(u) || (t.add(u), o.delete(u)), this.renderingBox.hasNode(l) || (t.add(l), o.delete(l))), h && !d ? s.add(a) : !h && d && n.add(a);
|
|
130
130
|
}), n.forEach((a) => {
|
|
131
131
|
this.handleDetachEdge(a);
|
|
132
132
|
}), o.forEach((a) => {
|
|
@@ -137,7 +137,7 @@ class gt {
|
|
|
137
137
|
this.handleAttachEdge(a);
|
|
138
138
|
});
|
|
139
139
|
});
|
|
140
|
-
this.htmlView = e, this.graphStore = t, this.trigger = o, this.params = s, this.renderingBox = new
|
|
140
|
+
this.htmlView = e, this.graphStore = t, this.trigger = o, this.params = s, this.renderingBox = new pt(this.graphStore), this.trigger.subscribe(this.updateViewport);
|
|
141
141
|
}
|
|
142
142
|
attachNode(e) {
|
|
143
143
|
this.renderingBox.hasNode(e) && this.handleAttachNode(e);
|
|
@@ -191,7 +191,7 @@ class gt {
|
|
|
191
191
|
this.htmlView.detachEdge(e), this.attachedEdges.delete(e);
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
class
|
|
194
|
+
class yt {
|
|
195
195
|
constructor(e, t) {
|
|
196
196
|
i(this, "deferredNodes", /* @__PURE__ */ new Set());
|
|
197
197
|
i(this, "deferredEdges", /* @__PURE__ */ new Set());
|
|
@@ -265,7 +265,7 @@ const C = () => {
|
|
|
265
265
|
const r = new q();
|
|
266
266
|
return [r, r];
|
|
267
267
|
};
|
|
268
|
-
class
|
|
268
|
+
class Ue {
|
|
269
269
|
constructor(e, t, o, s) {
|
|
270
270
|
i(this, "beforeDestroyEmitter");
|
|
271
271
|
i(this, "destroyed", !1);
|
|
@@ -318,7 +318,7 @@ class Ie {
|
|
|
318
318
|
this.destroyed || (this.destroyed = !0, this.beforeDestroyEmitter.emit(), this.graphController.destroy(), this.viewportController.destroy());
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
-
class
|
|
321
|
+
class ft {
|
|
322
322
|
constructor() {
|
|
323
323
|
i(this, "singleToMultiMap", /* @__PURE__ */ new Map());
|
|
324
324
|
i(this, "multiToSingleMap", /* @__PURE__ */ new Map());
|
|
@@ -358,13 +358,13 @@ class wt {
|
|
|
358
358
|
return this.multiToSingleMap.get(e) !== void 0;
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
class
|
|
361
|
+
class S extends Error {
|
|
362
362
|
constructor() {
|
|
363
363
|
super(...arguments);
|
|
364
364
|
i(this, "name", "CanvasError");
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
const
|
|
367
|
+
const b = Object.freeze({
|
|
368
368
|
accessNonexistingNode: (r) => `Failed to access node with ID ${JSON.stringify(r)} because it does not exist`,
|
|
369
369
|
addNodeWithExistingId: (r) => `Failed to add node with ID ${JSON.stringify(r)} because a node with this ID already exists`,
|
|
370
370
|
addNodeWithElementInUse: (r, e) => `Failed to add node with ID ${JSON.stringify(r)} because its HTML element is already attached to node with ID ${JSON.stringify(e)}`,
|
|
@@ -387,7 +387,7 @@ const S = Object.freeze({
|
|
|
387
387
|
removeNonexistentEdge: (r) => `Failed to remove edge with ID ${JSON.stringify(r)} because it does not exist`,
|
|
388
388
|
accessEdgesForNonexistentPort: (r) => `Failed to access edges for port with ID ${JSON.stringify(r)} because the port does not exist`
|
|
389
389
|
});
|
|
390
|
-
class
|
|
390
|
+
class $e {
|
|
391
391
|
constructor() {
|
|
392
392
|
i(this, "nodes", /* @__PURE__ */ new Map());
|
|
393
393
|
i(this, "ports", /* @__PURE__ */ new Map());
|
|
@@ -396,7 +396,7 @@ class Fe {
|
|
|
396
396
|
i(this, "portIncomingEdges", /* @__PURE__ */ new Map());
|
|
397
397
|
i(this, "portOutgoingEdges", /* @__PURE__ */ new Map());
|
|
398
398
|
i(this, "portCycleEdges", /* @__PURE__ */ new Map());
|
|
399
|
-
i(this, "elementPorts", new
|
|
399
|
+
i(this, "elementPorts", new ft());
|
|
400
400
|
i(this, "edgesElementsMap", /* @__PURE__ */ new Map());
|
|
401
401
|
i(this, "afterNodeAddedEmitter");
|
|
402
402
|
i(this, "onAfterNodeAdded");
|
|
@@ -432,16 +432,16 @@ class Fe {
|
|
|
432
432
|
getNode(e) {
|
|
433
433
|
const t = this.nodes.get(e);
|
|
434
434
|
if (t === void 0)
|
|
435
|
-
throw new
|
|
435
|
+
throw new S(b.accessNonexistingNode(e));
|
|
436
436
|
return t;
|
|
437
437
|
}
|
|
438
438
|
addNode(e) {
|
|
439
439
|
if (this.hasNode(e.id))
|
|
440
|
-
throw new
|
|
440
|
+
throw new S(b.addNodeWithExistingId(e.id));
|
|
441
441
|
const t = this.findNodeIdByElement(e.element);
|
|
442
442
|
if (t !== void 0)
|
|
443
|
-
throw new
|
|
444
|
-
|
|
443
|
+
throw new S(
|
|
444
|
+
b.addNodeWithElementInUse(e.id, t)
|
|
445
445
|
);
|
|
446
446
|
const o = /* @__PURE__ */ new Map(), s = {
|
|
447
447
|
element: e.element,
|
|
@@ -463,13 +463,13 @@ class Fe {
|
|
|
463
463
|
}
|
|
464
464
|
updateNode(e, t) {
|
|
465
465
|
if (!this.hasNode(e))
|
|
466
|
-
throw new
|
|
466
|
+
throw new S(b.updateNonexistentNode(e));
|
|
467
467
|
const { payload: o } = this.nodes.get(e);
|
|
468
468
|
o.x = t.x ?? o.x, o.y = t.y ?? o.y, o.centerFn = t.centerFn ?? o.centerFn, t.priority !== void 0 && (o.priority = t.priority, this.afterNodePriorityUpdatedEmitter.emit(e)), this.afterNodeUpdatedEmitter.emit(e);
|
|
469
469
|
}
|
|
470
470
|
removeNode(e) {
|
|
471
471
|
if (!this.hasNode(e))
|
|
472
|
-
throw new
|
|
472
|
+
throw new S(b.removeNonexistentNode(e));
|
|
473
473
|
this.beforeNodeRemovedEmitter.emit(e);
|
|
474
474
|
const t = this.getNode(e);
|
|
475
475
|
this.nodesElementsMap.delete(t.element), this.nodes.delete(e);
|
|
@@ -480,15 +480,15 @@ class Fe {
|
|
|
480
480
|
getPort(e) {
|
|
481
481
|
const t = this.ports.get(e);
|
|
482
482
|
if (t === void 0)
|
|
483
|
-
throw new
|
|
483
|
+
throw new S(b.accessNonexistentPort(e));
|
|
484
484
|
return t;
|
|
485
485
|
}
|
|
486
486
|
addPort(e) {
|
|
487
487
|
if (this.hasPort(e.id))
|
|
488
|
-
throw new
|
|
488
|
+
throw new S(b.addPortWithExistingId(e.id));
|
|
489
489
|
if (!this.hasNode(e.nodeId))
|
|
490
|
-
throw new
|
|
491
|
-
|
|
490
|
+
throw new S(
|
|
491
|
+
b.addPortToNonexistentNode(e.id, e.nodeId)
|
|
492
492
|
);
|
|
493
493
|
this.ports.set(e.id, {
|
|
494
494
|
element: e.element,
|
|
@@ -500,7 +500,7 @@ class Fe {
|
|
|
500
500
|
}
|
|
501
501
|
updatePort(e, t) {
|
|
502
502
|
if (!this.hasPort(e))
|
|
503
|
-
throw new
|
|
503
|
+
throw new S(b.updateNonexistentPort(e));
|
|
504
504
|
const o = this.getPort(e).payload;
|
|
505
505
|
o.direction = t.direction ?? o.direction, this.afterPortUpdatedEmitter.emit(e);
|
|
506
506
|
}
|
|
@@ -513,14 +513,14 @@ class Fe {
|
|
|
513
513
|
getNodePortIds(e) {
|
|
514
514
|
const t = this.nodes.get(e);
|
|
515
515
|
if (t === void 0)
|
|
516
|
-
throw new
|
|
517
|
-
|
|
516
|
+
throw new S(
|
|
517
|
+
b.accessPortsOfNonexistentNode(e)
|
|
518
518
|
);
|
|
519
519
|
return Array.from(t.ports.keys());
|
|
520
520
|
}
|
|
521
521
|
removePort(e) {
|
|
522
522
|
if (!this.hasPort(e))
|
|
523
|
-
throw new
|
|
523
|
+
throw new S(b.removeNonexistentPort(e));
|
|
524
524
|
const t = this.getPort(e).nodeId;
|
|
525
525
|
this.beforePortRemovedEmitter.emit(e), this.getNode(t).ports.delete(e), this.ports.delete(e), this.elementPorts.removeByMulti(e);
|
|
526
526
|
}
|
|
@@ -530,7 +530,7 @@ class Fe {
|
|
|
530
530
|
getEdge(e) {
|
|
531
531
|
const t = this.edges.get(e);
|
|
532
532
|
if (t === void 0)
|
|
533
|
-
throw new
|
|
533
|
+
throw new S(b.accessNonexistentEdge(e));
|
|
534
534
|
return t;
|
|
535
535
|
}
|
|
536
536
|
findEdgeIdByElement(e) {
|
|
@@ -538,33 +538,33 @@ class Fe {
|
|
|
538
538
|
}
|
|
539
539
|
addEdge(e) {
|
|
540
540
|
if (this.hasEdge(e.id))
|
|
541
|
-
throw new
|
|
541
|
+
throw new S(b.addEdgeWithExistingId(e.id));
|
|
542
542
|
if (!this.hasPort(e.from))
|
|
543
|
-
throw new
|
|
544
|
-
|
|
543
|
+
throw new S(
|
|
544
|
+
b.addEdgeFromNonexistentPort(e.id, e.from)
|
|
545
545
|
);
|
|
546
546
|
if (!this.hasPort(e.to))
|
|
547
|
-
throw new
|
|
548
|
-
|
|
547
|
+
throw new S(
|
|
548
|
+
b.addEdgeToNonexistentPort(e.id, e.to)
|
|
549
549
|
);
|
|
550
550
|
const t = this.findEdgeIdByElement(e.shape.svg);
|
|
551
551
|
if (t !== void 0)
|
|
552
|
-
throw new
|
|
553
|
-
|
|
552
|
+
throw new S(
|
|
553
|
+
b.addEdgeWithElementInUse(e.id, t)
|
|
554
554
|
);
|
|
555
555
|
this.addEdgeInternal(e), this.afterEdgeAddedEmitter.emit(e.id);
|
|
556
556
|
}
|
|
557
557
|
updateEdge(e, t) {
|
|
558
558
|
if (!this.hasEdge(e))
|
|
559
|
-
throw new
|
|
559
|
+
throw new S(b.updateNonexistentEdge(e));
|
|
560
560
|
if (t.from !== void 0 || t.to !== void 0) {
|
|
561
561
|
if (t.from !== void 0 && !this.hasPort(t.from))
|
|
562
|
-
throw new
|
|
563
|
-
|
|
562
|
+
throw new S(
|
|
563
|
+
b.updateNonexistentEdgeSource(e, t.from)
|
|
564
564
|
);
|
|
565
565
|
if (t.to !== void 0 && !this.hasPort(t.to))
|
|
566
|
-
throw new
|
|
567
|
-
|
|
566
|
+
throw new S(
|
|
567
|
+
b.updateNonexistentEdgeTarget(e, t.to)
|
|
568
568
|
);
|
|
569
569
|
const s = this.getEdge(e), n = s.payload;
|
|
570
570
|
this.removeEdgeInternal(e), this.addEdgeInternal({
|
|
@@ -583,7 +583,7 @@ class Fe {
|
|
|
583
583
|
}
|
|
584
584
|
removeEdge(e) {
|
|
585
585
|
if (!this.hasEdge(e))
|
|
586
|
-
throw new
|
|
586
|
+
throw new S(b.removeNonexistentEdge(e));
|
|
587
587
|
this.beforeEdgeRemovedEmitter.emit(e), this.removeEdgeInternal(e);
|
|
588
588
|
}
|
|
589
589
|
clear() {
|
|
@@ -592,24 +592,24 @@ class Fe {
|
|
|
592
592
|
getPortIncomingEdgeIds(e) {
|
|
593
593
|
const t = this.portIncomingEdges.get(e);
|
|
594
594
|
if (t === void 0)
|
|
595
|
-
throw new
|
|
596
|
-
|
|
595
|
+
throw new S(
|
|
596
|
+
b.accessEdgesForNonexistentPort(e)
|
|
597
597
|
);
|
|
598
598
|
return Array.from(t);
|
|
599
599
|
}
|
|
600
600
|
getPortOutgoingEdgeIds(e) {
|
|
601
601
|
const t = this.portOutgoingEdges.get(e);
|
|
602
602
|
if (t === void 0)
|
|
603
|
-
throw new
|
|
604
|
-
|
|
603
|
+
throw new S(
|
|
604
|
+
b.accessEdgesForNonexistentPort(e)
|
|
605
605
|
);
|
|
606
606
|
return Array.from(t);
|
|
607
607
|
}
|
|
608
608
|
getPortCycleEdgeIds(e) {
|
|
609
609
|
const t = this.portCycleEdges.get(e);
|
|
610
610
|
if (t === void 0)
|
|
611
|
-
throw new
|
|
612
|
-
|
|
611
|
+
throw new S(
|
|
612
|
+
b.accessEdgesForNonexistentPort(e)
|
|
613
613
|
);
|
|
614
614
|
return Array.from(t);
|
|
615
615
|
}
|
|
@@ -686,18 +686,18 @@ const me = (r) => ({
|
|
|
686
686
|
scale: 1 / r.scale,
|
|
687
687
|
x: -r.x / r.scale,
|
|
688
688
|
y: -r.y / r.scale
|
|
689
|
-
}),
|
|
689
|
+
}), xe = {
|
|
690
690
|
scale: 1,
|
|
691
691
|
x: 0,
|
|
692
692
|
y: 0
|
|
693
|
-
},
|
|
693
|
+
}, Ee = (r, e) => ({
|
|
694
694
|
x: r.scale * e.x + r.x,
|
|
695
695
|
y: r.scale * e.y + r.y
|
|
696
696
|
});
|
|
697
|
-
class
|
|
697
|
+
class vt {
|
|
698
698
|
constructor(e) {
|
|
699
|
-
i(this, "viewportMatrix",
|
|
700
|
-
i(this, "contentMatrix",
|
|
699
|
+
i(this, "viewportMatrix", xe);
|
|
700
|
+
i(this, "contentMatrix", xe);
|
|
701
701
|
i(this, "beforeUpdateEmitter");
|
|
702
702
|
i(this, "onBeforeUpdated");
|
|
703
703
|
i(this, "afterUpdateEmitter");
|
|
@@ -734,10 +734,10 @@ class ft {
|
|
|
734
734
|
return { width: e, height: t };
|
|
735
735
|
}
|
|
736
736
|
createContentCoords(e) {
|
|
737
|
-
return
|
|
737
|
+
return Ee(this.viewportMatrix, e);
|
|
738
738
|
}
|
|
739
739
|
createViewportCoords(e) {
|
|
740
|
-
return
|
|
740
|
+
return Ee(this.contentMatrix, e);
|
|
741
741
|
}
|
|
742
742
|
destroy() {
|
|
743
743
|
this.observer.disconnect();
|
|
@@ -776,16 +776,16 @@ class ee {
|
|
|
776
776
|
this.canvas.updateNode(t);
|
|
777
777
|
}
|
|
778
778
|
}
|
|
779
|
-
const
|
|
779
|
+
const mt = (r, e, t) => {
|
|
780
780
|
const { x: o, y: s, width: n, height: a } = r.getBoundingClientRect();
|
|
781
781
|
return e >= o && e <= o + n && t >= s && t <= s + a;
|
|
782
|
-
},
|
|
783
|
-
class
|
|
782
|
+
}, xt = (r, e, t) => e >= 0 && e <= r.innerWidth && t >= 0 && t <= r.innerHeight;
|
|
783
|
+
class Et {
|
|
784
784
|
constructor(e, t) {
|
|
785
785
|
this.element = e, this.win = t;
|
|
786
786
|
}
|
|
787
787
|
verify(e, t) {
|
|
788
|
-
return
|
|
788
|
+
return mt(this.element, e, t) && xt(this.win, e, t);
|
|
789
789
|
}
|
|
790
790
|
}
|
|
791
791
|
const H = (r, e) => {
|
|
@@ -805,7 +805,7 @@ const H = (r, e) => {
|
|
|
805
805
|
}
|
|
806
806
|
]
|
|
807
807
|
};
|
|
808
|
-
},
|
|
808
|
+
}, At = (r, e) => {
|
|
809
809
|
let t = e;
|
|
810
810
|
for (; t !== null; ) {
|
|
811
811
|
const o = r.findPortIdsByElement(t)[0] ?? null;
|
|
@@ -824,21 +824,21 @@ const H = (r, e) => {
|
|
|
824
824
|
status: "notFound"
|
|
825
825
|
};
|
|
826
826
|
};
|
|
827
|
-
function*
|
|
827
|
+
function* Be(r, e) {
|
|
828
828
|
const t = r.elementsFromPoint(e.x, e.y);
|
|
829
829
|
for (const o of t) {
|
|
830
830
|
if (o.shadowRoot !== null) {
|
|
831
|
-
const s =
|
|
831
|
+
const s = Be(o.shadowRoot, e);
|
|
832
832
|
for (const n of s)
|
|
833
833
|
yield n;
|
|
834
834
|
}
|
|
835
835
|
yield o;
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
|
-
const
|
|
839
|
-
const t =
|
|
838
|
+
const Oe = (r, e) => {
|
|
839
|
+
const t = Be(document, e);
|
|
840
840
|
for (const o of t) {
|
|
841
|
-
const s =
|
|
841
|
+
const s = At(r, o);
|
|
842
842
|
if (s.status === "portFound")
|
|
843
843
|
return s.portId;
|
|
844
844
|
if (s.status === "nodeEncountered")
|
|
@@ -846,14 +846,14 @@ const $e = (r, e) => {
|
|
|
846
846
|
}
|
|
847
847
|
return null;
|
|
848
848
|
};
|
|
849
|
-
var
|
|
850
|
-
const
|
|
849
|
+
var R = /* @__PURE__ */ ((r) => (r.StaticNodeId = "static", r.DraggingNodeId = "dragging", r.EdgeId = "edge", r))(R || {});
|
|
850
|
+
const We = (r, e) => ({
|
|
851
851
|
x: r / 2,
|
|
852
852
|
y: e / 2
|
|
853
|
-
}),
|
|
853
|
+
}), x = (r, e, t) => ({
|
|
854
854
|
x: e.x * r.x - e.y * r.y + ((1 - e.x) * t.x + e.y * t.y),
|
|
855
855
|
y: e.y * r.x + e.x * r.y + ((1 - e.x) * t.y - e.y * t.x)
|
|
856
|
-
}),
|
|
856
|
+
}), ze = (r, e, t) => {
|
|
857
857
|
const o = {
|
|
858
858
|
x: r.x + r.width / 2,
|
|
859
859
|
y: r.y + r.height / 2
|
|
@@ -870,7 +870,7 @@ const Be = (r, e) => ({
|
|
|
870
870
|
to: { x: s.x - n, y: s.y - a }
|
|
871
871
|
};
|
|
872
872
|
};
|
|
873
|
-
class
|
|
873
|
+
class St {
|
|
874
874
|
constructor(e) {
|
|
875
875
|
i(this, "path");
|
|
876
876
|
i(this, "midpoint");
|
|
@@ -883,27 +883,27 @@ class xt {
|
|
|
883
883
|
curvature: h,
|
|
884
884
|
hasSourceArrow: d,
|
|
885
885
|
hasTargetArrow: c
|
|
886
|
-
} = e,
|
|
887
|
-
this.midpoint = { x:
|
|
888
|
-
const g =
|
|
886
|
+
} = e, u = (t.x + o.x) / 2, l = (t.y + o.y) / 2;
|
|
887
|
+
this.midpoint = { x: u, y: l };
|
|
888
|
+
const g = x(
|
|
889
889
|
{ x: t.x + s, y: t.y },
|
|
890
890
|
n,
|
|
891
891
|
t
|
|
892
|
-
), p =
|
|
892
|
+
), p = x(
|
|
893
893
|
{ x: o.x - s, y: o.y },
|
|
894
894
|
a,
|
|
895
895
|
o
|
|
896
896
|
), w = {
|
|
897
897
|
x: g.x + n.x * h,
|
|
898
898
|
y: g.y + n.y * h
|
|
899
|
-
},
|
|
899
|
+
}, y = {
|
|
900
900
|
x: p.x - a.x * h,
|
|
901
901
|
y: p.y - a.y * h
|
|
902
|
-
},
|
|
903
|
-
this.path = `${
|
|
902
|
+
}, f = `M ${g.x} ${g.y} C ${w.x} ${w.y}, ${y.x} ${y.y}, ${p.x} ${p.y}`, m = d ? "" : `M ${t.x} ${t.y} L ${g.x} ${g.y} `, E = c ? "" : ` M ${p.x} ${p.y} L ${o.x} ${o.y}`;
|
|
903
|
+
this.path = `${m}${f}${E}`;
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
|
-
class
|
|
906
|
+
class bt {
|
|
907
907
|
constructor(e) {
|
|
908
908
|
i(this, "path");
|
|
909
909
|
i(this, "midpoint");
|
|
@@ -916,95 +916,95 @@ class At {
|
|
|
916
916
|
detourDir: h,
|
|
917
917
|
from: d,
|
|
918
918
|
to: c,
|
|
919
|
-
arrowLength:
|
|
920
|
-
detourDistance:
|
|
921
|
-
} = e, g = t ?
|
|
922
|
-
{ x: d.x +
|
|
919
|
+
arrowLength: u,
|
|
920
|
+
detourDistance: l
|
|
921
|
+
} = e, g = t ? x(
|
|
922
|
+
{ x: d.x + u, y: d.y },
|
|
923
923
|
n,
|
|
924
924
|
d
|
|
925
|
-
) : d, p = o ?
|
|
925
|
+
) : d, p = o ? x(
|
|
926
926
|
{
|
|
927
|
-
x: c.x -
|
|
927
|
+
x: c.x - u,
|
|
928
928
|
y: c.y
|
|
929
929
|
},
|
|
930
930
|
a,
|
|
931
931
|
c
|
|
932
|
-
) : c, w = Math.cos(h) *
|
|
933
|
-
{ x: d.x +
|
|
932
|
+
) : c, w = Math.cos(h) * l, y = Math.sin(h) * l, f = x(
|
|
933
|
+
{ x: d.x + u, y: d.y },
|
|
934
934
|
n,
|
|
935
935
|
d
|
|
936
|
-
),
|
|
937
|
-
x:
|
|
938
|
-
y:
|
|
939
|
-
},
|
|
940
|
-
{ x: c.x -
|
|
936
|
+
), m = {
|
|
937
|
+
x: f.x + w,
|
|
938
|
+
y: f.y + y
|
|
939
|
+
}, E = x(
|
|
940
|
+
{ x: c.x - u, y: c.y },
|
|
941
941
|
a,
|
|
942
942
|
c
|
|
943
|
-
),
|
|
944
|
-
x:
|
|
945
|
-
y:
|
|
943
|
+
), A = {
|
|
944
|
+
x: E.x + w,
|
|
945
|
+
y: E.y + y
|
|
946
946
|
}, T = {
|
|
947
|
-
x: (
|
|
948
|
-
y: (
|
|
947
|
+
x: (m.x + A.x) / 2,
|
|
948
|
+
y: (m.y + A.y) / 2
|
|
949
|
+
}, M = {
|
|
950
|
+
x: f.x + s * n.x,
|
|
951
|
+
y: f.y + s * n.y
|
|
952
|
+
}, L = {
|
|
953
|
+
x: E.x - s * a.x,
|
|
954
|
+
y: E.y - s * a.y
|
|
955
|
+
}, V = {
|
|
956
|
+
x: f.x + w,
|
|
957
|
+
y: f.y + y
|
|
949
958
|
}, D = {
|
|
950
|
-
x:
|
|
951
|
-
y:
|
|
952
|
-
}, F = {
|
|
953
|
-
x: x.x - s * a.x,
|
|
954
|
-
y: x.y - s * a.y
|
|
955
|
-
}, U = {
|
|
956
|
-
x: y.x + w,
|
|
957
|
-
y: y.y + f
|
|
958
|
-
}, R = {
|
|
959
|
-
x: x.x + w,
|
|
960
|
-
y: x.y + f
|
|
959
|
+
x: E.x + w,
|
|
960
|
+
y: E.y + y
|
|
961
961
|
};
|
|
962
962
|
this.path = [
|
|
963
963
|
`M ${g.x} ${g.y}`,
|
|
964
|
-
`L ${
|
|
965
|
-
`C ${
|
|
966
|
-
`C ${
|
|
964
|
+
`L ${f.x} ${f.y}`,
|
|
965
|
+
`C ${M.x} ${M.y} ${V.x} ${V.y} ${T.x} ${T.y}`,
|
|
966
|
+
`C ${D.x} ${D.y} ${L.x} ${L.y} ${E.x} ${E.y}`,
|
|
967
967
|
`L ${p.x} ${p.y}`
|
|
968
968
|
].join(" "), this.midpoint = T;
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
971
|
const te = Object.freeze({
|
|
972
972
|
edgeColor: "--edge-color"
|
|
973
|
-
}),
|
|
973
|
+
}), ke = (r) => {
|
|
974
974
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
975
975
|
return e.style.pointerEvents = "none", e.style.position = "absolute", e.style.top = "0", e.style.left = "0", e.style.overflow = "visible", e.style.setProperty(te.edgeColor, r), e;
|
|
976
|
-
},
|
|
976
|
+
}, He = (r) => {
|
|
977
977
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
978
978
|
return e.setAttribute("stroke", `var(${te.edgeColor})`), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e;
|
|
979
979
|
}, X = () => {
|
|
980
980
|
const r = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
981
981
|
return r.setAttribute("fill", `var(${te.edgeColor})`), r;
|
|
982
|
-
},
|
|
982
|
+
}, Ye = (r, e) => {
|
|
983
983
|
r.style.transform = `translate(${e.x}px, ${e.y}px)`, r.style.width = `${e.width}px`, r.style.height = `${e.height}px`;
|
|
984
|
-
},
|
|
984
|
+
}, F = (r, e) => {
|
|
985
985
|
const t = [];
|
|
986
986
|
if (r.length > 0 && t.push(`M ${r[0].x} ${r[0].y}`), r.length === 2 && t.push(`L ${r[1].x} ${r[1].y}`), r.length > 2) {
|
|
987
987
|
const o = r.length - 1;
|
|
988
988
|
let s = 0, n = 0, a = 0;
|
|
989
989
|
r.forEach((h, d) => {
|
|
990
|
-
let c = 0,
|
|
990
|
+
let c = 0, u = 0, l = 0;
|
|
991
991
|
const g = d > 0, p = d < o, w = g && p;
|
|
992
|
-
if (g && (c = -s,
|
|
993
|
-
const
|
|
994
|
-
s =
|
|
992
|
+
if (g && (c = -s, u = -n, l = a), p) {
|
|
993
|
+
const M = r[d + 1];
|
|
994
|
+
s = M.x - h.x, n = M.y - h.y, a = Math.sqrt(s * s + n * n);
|
|
995
995
|
}
|
|
996
|
-
const
|
|
996
|
+
const f = a !== 0 ? Math.min((w ? e : 0) / a, d < o - 1 ? 0.5 : 1) : 0, m = w ? { x: h.x + s * f, y: h.y + n * f } : h, A = l !== 0 ? Math.min((w ? e : 0) / l, d > 1 ? 0.5 : 1) : 0, T = w ? { x: h.x + c * A, y: h.y + u * A } : h;
|
|
997
997
|
d > 0 && t.push(`L ${T.x} ${T.y}`), w && t.push(
|
|
998
|
-
`C ${h.x} ${h.y} ${h.x} ${h.y} ${
|
|
998
|
+
`C ${h.x} ${h.y} ${h.x} ${h.y} ${m.x} ${m.y}`
|
|
999
999
|
);
|
|
1000
1000
|
});
|
|
1001
1001
|
}
|
|
1002
1002
|
return t.join(" ");
|
|
1003
|
-
},
|
|
1003
|
+
}, Pt = (r, e) => {
|
|
1004
1004
|
const t = r.linePoint, o = e.linePoint, s = o.x - t.x >= 0, n = r.dirX >= 0, a = e.dirX >= 0;
|
|
1005
1005
|
if (n === a) {
|
|
1006
|
-
const
|
|
1007
|
-
return
|
|
1006
|
+
const l = n === s, g = (t.x + o.x) / 2, p = (t.y + o.y) / 2, w = { x: g, y: p };
|
|
1007
|
+
return l ? {
|
|
1008
1008
|
points: [
|
|
1009
1009
|
r.arrowPoint,
|
|
1010
1010
|
{ x: w.x, y: t.y },
|
|
@@ -1026,19 +1026,19 @@ const te = Object.freeze({
|
|
|
1026
1026
|
}
|
|
1027
1027
|
const d = n === s, c = (t.y + o.y) / 2;
|
|
1028
1028
|
if (d) {
|
|
1029
|
-
const
|
|
1029
|
+
const l = { x: o.x, y: t.y };
|
|
1030
1030
|
return {
|
|
1031
|
-
points: [r.arrowPoint,
|
|
1032
|
-
midpoint: { x:
|
|
1031
|
+
points: [r.arrowPoint, l, o, e.arrowPoint],
|
|
1032
|
+
midpoint: { x: l.x, y: c }
|
|
1033
1033
|
};
|
|
1034
1034
|
}
|
|
1035
|
-
const
|
|
1035
|
+
const u = { x: t.x, y: o.y };
|
|
1036
1036
|
return {
|
|
1037
|
-
points: [r.arrowPoint, t,
|
|
1038
|
-
midpoint: { x:
|
|
1037
|
+
points: [r.arrowPoint, t, u, e.arrowPoint],
|
|
1038
|
+
midpoint: { x: u.x, y: c }
|
|
1039
1039
|
};
|
|
1040
1040
|
};
|
|
1041
|
-
class
|
|
1041
|
+
class Nt {
|
|
1042
1042
|
constructor(e) {
|
|
1043
1043
|
i(this, "path");
|
|
1044
1044
|
i(this, "midpoint");
|
|
@@ -1051,23 +1051,23 @@ class bt {
|
|
|
1051
1051
|
arrowOffset: h,
|
|
1052
1052
|
roundness: d,
|
|
1053
1053
|
hasSourceArrow: c,
|
|
1054
|
-
hasTargetArrow:
|
|
1055
|
-
} = e,
|
|
1054
|
+
hasTargetArrow: u
|
|
1055
|
+
} = e, l = c ? x(
|
|
1056
1056
|
{ x: t.x + a, y: t.y },
|
|
1057
1057
|
s,
|
|
1058
1058
|
t
|
|
1059
|
-
) : t, g =
|
|
1059
|
+
) : t, g = u ? x({ x: o.x - a, y: o.y }, n, o) : o, p = a + h, w = x(
|
|
1060
1060
|
{ x: t.x + p, y: t.y },
|
|
1061
1061
|
s,
|
|
1062
1062
|
t
|
|
1063
|
-
),
|
|
1064
|
-
{ arrowPoint:
|
|
1065
|
-
{ arrowPoint: g, linePoint:
|
|
1063
|
+
), y = x({ x: o.x - p, y: o.y }, n, o), f = Pt(
|
|
1064
|
+
{ arrowPoint: l, linePoint: w, dirX: s.x },
|
|
1065
|
+
{ arrowPoint: g, linePoint: y, dirX: n.x }
|
|
1066
1066
|
);
|
|
1067
|
-
this.path =
|
|
1067
|
+
this.path = F(f.points, d), this.midpoint = f.midpoint;
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
1070
|
-
class
|
|
1070
|
+
class Ct {
|
|
1071
1071
|
constructor(e) {
|
|
1072
1072
|
i(this, "path");
|
|
1073
1073
|
i(this, "midpoint");
|
|
@@ -1080,45 +1080,45 @@ class Pt {
|
|
|
1080
1080
|
fromDir: h,
|
|
1081
1081
|
toDir: d,
|
|
1082
1082
|
arrowOffset: c,
|
|
1083
|
-
detourDir:
|
|
1084
|
-
detourDistance:
|
|
1083
|
+
detourDir: u,
|
|
1084
|
+
detourDistance: l,
|
|
1085
1085
|
roundness: g
|
|
1086
|
-
} = e, p = t ?
|
|
1086
|
+
} = e, p = t ? x(
|
|
1087
1087
|
{ x: s.x + a, y: s.y },
|
|
1088
1088
|
h,
|
|
1089
1089
|
s
|
|
1090
|
-
) : s, w = o ?
|
|
1090
|
+
) : s, w = o ? x(
|
|
1091
1091
|
{
|
|
1092
1092
|
x: n.x - a,
|
|
1093
1093
|
y: n.y
|
|
1094
1094
|
},
|
|
1095
1095
|
d,
|
|
1096
1096
|
n
|
|
1097
|
-
) : n,
|
|
1098
|
-
{ x: s.x +
|
|
1097
|
+
) : n, y = a + c, f = Math.cos(u) * l, m = Math.sin(u) * l, E = x(
|
|
1098
|
+
{ x: s.x + y, y: s.y },
|
|
1099
1099
|
h,
|
|
1100
1100
|
s
|
|
1101
|
-
),
|
|
1102
|
-
x:
|
|
1103
|
-
y:
|
|
1104
|
-
}, T =
|
|
1105
|
-
{ x: n.x -
|
|
1101
|
+
), A = {
|
|
1102
|
+
x: E.x + f,
|
|
1103
|
+
y: E.y + m
|
|
1104
|
+
}, T = x(
|
|
1105
|
+
{ x: n.x - y, y: n.y },
|
|
1106
1106
|
d,
|
|
1107
1107
|
n
|
|
1108
|
-
),
|
|
1109
|
-
x: T.x +
|
|
1110
|
-
y: T.y +
|
|
1108
|
+
), M = {
|
|
1109
|
+
x: T.x + f,
|
|
1110
|
+
y: T.y + m
|
|
1111
1111
|
};
|
|
1112
1112
|
this.midpoint = {
|
|
1113
|
-
x: (
|
|
1114
|
-
y: (
|
|
1115
|
-
}, this.path =
|
|
1116
|
-
[p,
|
|
1113
|
+
x: (A.x + M.x) / 2,
|
|
1114
|
+
y: (A.y + M.y) / 2
|
|
1115
|
+
}, this.path = F(
|
|
1116
|
+
[p, E, A, M, T, w],
|
|
1117
1117
|
g
|
|
1118
1118
|
);
|
|
1119
1119
|
}
|
|
1120
1120
|
}
|
|
1121
|
-
class
|
|
1121
|
+
class Tt {
|
|
1122
1122
|
constructor(e) {
|
|
1123
1123
|
i(this, "path");
|
|
1124
1124
|
i(this, "midpoint");
|
|
@@ -1131,8 +1131,8 @@ class Nt {
|
|
|
1131
1131
|
fromDir: h,
|
|
1132
1132
|
toDir: d,
|
|
1133
1133
|
arrowOffset: c,
|
|
1134
|
-
roundness:
|
|
1135
|
-
} = e,
|
|
1134
|
+
roundness: u
|
|
1135
|
+
} = e, l = this.createArrowPoint(
|
|
1136
1136
|
s,
|
|
1137
1137
|
h,
|
|
1138
1138
|
t,
|
|
@@ -1142,13 +1142,13 @@ class Nt {
|
|
|
1142
1142
|
d,
|
|
1143
1143
|
o,
|
|
1144
1144
|
-a
|
|
1145
|
-
), p = a + c, w = { x: t.x + p, y: t.y },
|
|
1146
|
-
this.path =
|
|
1147
|
-
[
|
|
1148
|
-
|
|
1145
|
+
), p = a + c, w = { x: t.x + p, y: t.y }, y = x(w, h, t), f = { x: o.x - p, y: o.y }, m = x(f, d, o);
|
|
1146
|
+
this.path = F(
|
|
1147
|
+
[l, y, m, g],
|
|
1148
|
+
u
|
|
1149
1149
|
);
|
|
1150
|
-
const
|
|
1151
|
-
this.midpoint = { x, y:
|
|
1150
|
+
const E = (y.x + m.x) / 2, A = (y.y + m.y) / 2;
|
|
1151
|
+
this.midpoint = { x: E, y: A };
|
|
1152
1152
|
}
|
|
1153
1153
|
createArrowPoint(e, t, o, s) {
|
|
1154
1154
|
if (!e)
|
|
@@ -1157,14 +1157,14 @@ class Nt {
|
|
|
1157
1157
|
x: o.x + s,
|
|
1158
1158
|
y: o.y
|
|
1159
1159
|
};
|
|
1160
|
-
return
|
|
1160
|
+
return x(n, t, o);
|
|
1161
1161
|
}
|
|
1162
1162
|
}
|
|
1163
|
-
const
|
|
1163
|
+
const Mt = (r, e) => {
|
|
1164
1164
|
const t = r.linePoint, o = e.linePoint, s = o.y - t.y >= 0, n = r.dirY >= 0, a = e.dirY >= 0;
|
|
1165
1165
|
if (n === a) {
|
|
1166
|
-
const
|
|
1167
|
-
return
|
|
1166
|
+
const l = n === s, g = (t.x + o.x) / 2, p = (t.y + o.y) / 2, w = { x: g, y: p };
|
|
1167
|
+
return l ? {
|
|
1168
1168
|
points: [
|
|
1169
1169
|
r.arrowPoint,
|
|
1170
1170
|
{ x: t.x, y: w.y },
|
|
@@ -1186,19 +1186,19 @@ const Ct = (r, e) => {
|
|
|
1186
1186
|
}
|
|
1187
1187
|
const d = n === s, c = (t.x + o.x) / 2;
|
|
1188
1188
|
if (d) {
|
|
1189
|
-
const
|
|
1189
|
+
const l = { x: t.x, y: o.y };
|
|
1190
1190
|
return {
|
|
1191
|
-
points: [r.arrowPoint,
|
|
1192
|
-
midpoint: { x: c, y:
|
|
1191
|
+
points: [r.arrowPoint, l, o, e.arrowPoint],
|
|
1192
|
+
midpoint: { x: c, y: l.y }
|
|
1193
1193
|
};
|
|
1194
1194
|
}
|
|
1195
|
-
const
|
|
1195
|
+
const u = { x: o.x, y: t.y };
|
|
1196
1196
|
return {
|
|
1197
|
-
points: [r.arrowPoint, t,
|
|
1198
|
-
midpoint: { x: c, y:
|
|
1197
|
+
points: [r.arrowPoint, t, u, e.arrowPoint],
|
|
1198
|
+
midpoint: { x: c, y: u.y }
|
|
1199
1199
|
};
|
|
1200
1200
|
};
|
|
1201
|
-
class
|
|
1201
|
+
class Dt {
|
|
1202
1202
|
constructor(e) {
|
|
1203
1203
|
i(this, "path");
|
|
1204
1204
|
i(this, "midpoint");
|
|
@@ -1211,27 +1211,27 @@ class Tt {
|
|
|
1211
1211
|
arrowOffset: h,
|
|
1212
1212
|
fromDir: d,
|
|
1213
1213
|
toDir: c,
|
|
1214
|
-
roundness:
|
|
1215
|
-
} = e,
|
|
1214
|
+
roundness: u
|
|
1215
|
+
} = e, l = s ? x(
|
|
1216
1216
|
{ x: t.x + a, y: t.y },
|
|
1217
1217
|
d,
|
|
1218
1218
|
t
|
|
1219
|
-
) : t, g = n ?
|
|
1219
|
+
) : t, g = n ? x({ x: o.x - a, y: o.y }, c, o) : o, p = a + h, w = x(
|
|
1220
1220
|
{ x: t.x + p, y: t.y },
|
|
1221
1221
|
d,
|
|
1222
1222
|
t
|
|
1223
|
-
),
|
|
1224
|
-
{ arrowPoint:
|
|
1225
|
-
{ arrowPoint: g, linePoint:
|
|
1223
|
+
), y = x({ x: o.x - p, y: o.y }, c, o), f = Mt(
|
|
1224
|
+
{ arrowPoint: l, linePoint: w, dirY: d.y },
|
|
1225
|
+
{ arrowPoint: g, linePoint: y, dirY: c.y }
|
|
1226
1226
|
);
|
|
1227
|
-
this.path =
|
|
1227
|
+
this.path = F(f.points, u), this.midpoint = f.midpoint;
|
|
1228
1228
|
}
|
|
1229
1229
|
}
|
|
1230
1230
|
class re {
|
|
1231
1231
|
constructor(e) {
|
|
1232
1232
|
i(this, "path");
|
|
1233
1233
|
i(this, "midpoint");
|
|
1234
|
-
const { side: t, arrowLength: o, arrowOffset: s, dir: n, origin: a, hasArrow: h } = e, d = o + s, c = d + 2 * t,
|
|
1234
|
+
const { side: t, arrowLength: o, arrowOffset: s, dir: n, origin: a, hasArrow: h } = e, d = o + s, c = d + 2 * t, l = [
|
|
1235
1235
|
{ x: o, y: 0 },
|
|
1236
1236
|
{ x: d, y: 0 },
|
|
1237
1237
|
{ x: d, y: t },
|
|
@@ -1240,78 +1240,33 @@ class re {
|
|
|
1240
1240
|
{ x: d, y: -t },
|
|
1241
1241
|
{ x: d, y: 0 },
|
|
1242
1242
|
{ x: o, y: 0 }
|
|
1243
|
-
].map((p) =>
|
|
1244
|
-
this.path = `${h ? "" : g}${
|
|
1243
|
+
].map((p) => x(p, n, { x: 0, y: 0 })).map((p) => ({ x: p.x + a.x, y: p.y + a.y })), g = `M ${a.x} ${a.y} L ${l[0].x} ${l[0].y} `;
|
|
1244
|
+
this.path = `${h ? "" : g}${F(l, e.roundness)}`, this.midpoint = { x: (l[3].x + l[4].x) / 2, y: (l[3].y + l[4].y) / 2 };
|
|
1245
1245
|
}
|
|
1246
1246
|
}
|
|
1247
|
-
class
|
|
1247
|
+
class Rt {
|
|
1248
1248
|
constructor(e) {
|
|
1249
1249
|
i(this, "path");
|
|
1250
1250
|
i(this, "midpoint");
|
|
1251
|
-
const { arrowLength: t, radius: o, smallRadius: s, dir: n, origin: a, hasArrow: h } = e, d = s + o, c = s * o / d,
|
|
1251
|
+
const { arrowLength: t, radius: o, smallRadius: s, dir: n, origin: a, hasArrow: h } = e, d = s + o, c = s * o / d, u = Math.sqrt(d * d - s * s), l = u * s / d, g = u + o + t, p = t + l, y = [
|
|
1252
1252
|
{ x: t, y: 0 },
|
|
1253
1253
|
{ x: p, y: c },
|
|
1254
1254
|
{ x: p, y: -c },
|
|
1255
1255
|
{ x: g, y: 0 }
|
|
1256
|
-
].map((
|
|
1257
|
-
`M ${
|
|
1258
|
-
`A ${s} ${s} 0 0 1 ${
|
|
1259
|
-
`A ${o} ${o} 0 1 0 ${
|
|
1260
|
-
`A ${s} ${s} 0 0 1 ${
|
|
1261
|
-
].join(" "),
|
|
1262
|
-
this.path = `${h ? "" :
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
class Dt {
|
|
1266
|
-
constructor(e) {
|
|
1267
|
-
i(this, "path");
|
|
1268
|
-
i(this, "midpoint");
|
|
1269
|
-
i(this, "diagonalDistance");
|
|
1270
|
-
const {
|
|
1271
|
-
from: t,
|
|
1272
|
-
to: o,
|
|
1273
|
-
sourceOffset: s,
|
|
1274
|
-
targetOffset: n,
|
|
1275
|
-
hasSourceArrow: a,
|
|
1276
|
-
hasTargetArrow: h,
|
|
1277
|
-
arrowLength: d
|
|
1278
|
-
} = e;
|
|
1279
|
-
this.midpoint = { x: (t.x + o.x) / 2, y: (t.y + o.y) / 2 };
|
|
1280
|
-
const c = o.x - t.x, l = o.y - t.y;
|
|
1281
|
-
if (this.diagonalDistance = Math.sqrt(c * c + l * l), this.diagonalDistance === 0) {
|
|
1282
|
-
this.path = "";
|
|
1283
|
-
return;
|
|
1284
|
-
}
|
|
1285
|
-
const u = { x: c, y: l }, g = this.createDirectLinePoint({
|
|
1286
|
-
offset: s,
|
|
1287
|
-
hasArrow: a,
|
|
1288
|
-
flip: 1,
|
|
1289
|
-
shift: t,
|
|
1290
|
-
arrowLength: d,
|
|
1291
|
-
dir: u
|
|
1292
|
-
}), p = this.createDirectLinePoint({
|
|
1293
|
-
offset: n,
|
|
1294
|
-
hasArrow: h,
|
|
1295
|
-
flip: -1,
|
|
1296
|
-
shift: o,
|
|
1297
|
-
arrowLength: d,
|
|
1298
|
-
dir: u
|
|
1299
|
-
});
|
|
1300
|
-
this.path = `M ${g.x} ${g.y} L ${p.x} ${p.y}`;
|
|
1301
|
-
}
|
|
1302
|
-
createDirectLinePoint(e) {
|
|
1303
|
-
const t = e.hasArrow ? e.arrowLength : 0, o = e.offset + t, s = e.flip * o / this.diagonalDistance, { dir: n, shift: a } = e;
|
|
1304
|
-
return {
|
|
1305
|
-
x: n.x * s + a.x,
|
|
1306
|
-
y: n.y * s + a.y
|
|
1307
|
-
};
|
|
1256
|
+
].map((E) => x(E, n, { x: 0, y: 0 })).map((E) => ({ x: E.x + a.x, y: E.y + a.y })), f = [
|
|
1257
|
+
`M ${y[0].x} ${y[0].y}`,
|
|
1258
|
+
`A ${s} ${s} 0 0 1 ${y[1].x} ${y[1].y}`,
|
|
1259
|
+
`A ${o} ${o} 0 1 0 ${y[2].x} ${y[2].y}`,
|
|
1260
|
+
`A ${s} ${s} 0 0 1 ${y[0].x} ${y[0].y}`
|
|
1261
|
+
].join(" "), m = `M ${a.x} ${a.y} L ${y[0].x} ${y[0].y} `;
|
|
1262
|
+
this.path = `${h ? "" : m}${f}`, this.midpoint = y[3];
|
|
1308
1263
|
}
|
|
1309
1264
|
}
|
|
1310
|
-
const
|
|
1265
|
+
const Lt = (r, e, t) => {
|
|
1311
1266
|
const o = Math.max(r.y, e.y), s = Math.min(r.y, e.y);
|
|
1312
1267
|
return (t >= 0 ? o : s) + t;
|
|
1313
1268
|
};
|
|
1314
|
-
class
|
|
1269
|
+
class Vt {
|
|
1315
1270
|
constructor(e) {
|
|
1316
1271
|
i(this, "path");
|
|
1317
1272
|
i(this, "midpoint");
|
|
@@ -1324,49 +1279,49 @@ class Lt {
|
|
|
1324
1279
|
fromDir: h,
|
|
1325
1280
|
toDir: d,
|
|
1326
1281
|
arrowOffset: c,
|
|
1327
|
-
roundness:
|
|
1328
|
-
detourDistance:
|
|
1329
|
-
} = e, g = t ?
|
|
1282
|
+
roundness: u,
|
|
1283
|
+
detourDistance: l
|
|
1284
|
+
} = e, g = t ? x(
|
|
1330
1285
|
{ x: n.x + s, y: n.y },
|
|
1331
1286
|
h,
|
|
1332
1287
|
n
|
|
1333
|
-
) : n, p = o ?
|
|
1288
|
+
) : n, p = o ? x(
|
|
1334
1289
|
{
|
|
1335
1290
|
x: a.x - s,
|
|
1336
1291
|
y: a.y
|
|
1337
1292
|
},
|
|
1338
1293
|
d,
|
|
1339
1294
|
a
|
|
1340
|
-
) : a, w = s + c,
|
|
1295
|
+
) : a, w = s + c, y = x(
|
|
1341
1296
|
{ x: n.x + w, y: n.y },
|
|
1342
1297
|
h,
|
|
1343
1298
|
n
|
|
1344
|
-
),
|
|
1299
|
+
), f = x(
|
|
1345
1300
|
{ x: a.x - w, y: a.y },
|
|
1346
1301
|
d,
|
|
1347
1302
|
a
|
|
1348
|
-
),
|
|
1303
|
+
), m = Lt(y, f, l);
|
|
1349
1304
|
this.midpoint = {
|
|
1350
|
-
x: (
|
|
1351
|
-
y:
|
|
1352
|
-
}, this.path =
|
|
1305
|
+
x: (y.x + f.x) / 2,
|
|
1306
|
+
y: m
|
|
1307
|
+
}, this.path = F(
|
|
1353
1308
|
[
|
|
1354
1309
|
g,
|
|
1355
|
-
f,
|
|
1356
|
-
{ x: f.x, y: E },
|
|
1357
|
-
{ x: y.x, y: E },
|
|
1358
1310
|
y,
|
|
1311
|
+
{ x: y.x, y: m },
|
|
1312
|
+
{ x: f.x, y: m },
|
|
1313
|
+
f,
|
|
1359
1314
|
p
|
|
1360
1315
|
],
|
|
1361
|
-
|
|
1316
|
+
u
|
|
1362
1317
|
);
|
|
1363
1318
|
}
|
|
1364
1319
|
}
|
|
1365
|
-
const
|
|
1320
|
+
const It = (r, e, t) => {
|
|
1366
1321
|
const o = Math.max(r.x, e.x), s = Math.min(r.x, e.x);
|
|
1367
1322
|
return (t >= 0 ? o : s) + t;
|
|
1368
1323
|
};
|
|
1369
|
-
class
|
|
1324
|
+
class Ft {
|
|
1370
1325
|
constructor(e) {
|
|
1371
1326
|
i(this, "path");
|
|
1372
1327
|
i(this, "midpoint");
|
|
@@ -1379,41 +1334,41 @@ class It {
|
|
|
1379
1334
|
from: h,
|
|
1380
1335
|
to: d,
|
|
1381
1336
|
arrowOffset: c,
|
|
1382
|
-
detourDistance:
|
|
1383
|
-
roundness:
|
|
1384
|
-
} = e, g = t ?
|
|
1337
|
+
detourDistance: u,
|
|
1338
|
+
roundness: l
|
|
1339
|
+
} = e, g = t ? x(
|
|
1385
1340
|
{ x: h.x + s, y: h.y },
|
|
1386
1341
|
n,
|
|
1387
1342
|
h
|
|
1388
|
-
) : h, p = o ?
|
|
1343
|
+
) : h, p = o ? x(
|
|
1389
1344
|
{
|
|
1390
1345
|
x: d.x - s,
|
|
1391
1346
|
y: d.y
|
|
1392
1347
|
},
|
|
1393
1348
|
a,
|
|
1394
1349
|
d
|
|
1395
|
-
) : d, w = s + c,
|
|
1350
|
+
) : d, w = s + c, y = x(
|
|
1396
1351
|
{ x: h.x + w, y: h.y },
|
|
1397
1352
|
n,
|
|
1398
1353
|
h
|
|
1399
|
-
),
|
|
1354
|
+
), f = x(
|
|
1400
1355
|
{ x: d.x - w, y: d.y },
|
|
1401
1356
|
a,
|
|
1402
1357
|
d
|
|
1403
|
-
),
|
|
1358
|
+
), m = It(y, f, u);
|
|
1404
1359
|
this.midpoint = {
|
|
1405
|
-
x:
|
|
1406
|
-
y: (
|
|
1407
|
-
}, this.path =
|
|
1360
|
+
x: m,
|
|
1361
|
+
y: (y.y + f.y) / 2
|
|
1362
|
+
}, this.path = F(
|
|
1408
1363
|
[
|
|
1409
1364
|
g,
|
|
1410
|
-
f,
|
|
1411
|
-
{ x: E, y: f.y },
|
|
1412
|
-
{ x: E, y: y.y },
|
|
1413
1365
|
y,
|
|
1366
|
+
{ x: m, y: y.y },
|
|
1367
|
+
{ x: m, y: f.y },
|
|
1368
|
+
f,
|
|
1414
1369
|
p
|
|
1415
1370
|
],
|
|
1416
|
-
|
|
1371
|
+
l
|
|
1417
1372
|
);
|
|
1418
1373
|
}
|
|
1419
1374
|
}
|
|
@@ -1438,7 +1393,7 @@ const v = Object.freeze({
|
|
|
1438
1393
|
smallCycleRadius: 15,
|
|
1439
1394
|
curvature: 90,
|
|
1440
1395
|
interactiveWidth: 10,
|
|
1441
|
-
|
|
1396
|
+
portOffset: 0
|
|
1442
1397
|
}), Ae = (r) => ({ x: Math.cos(r), y: Math.sin(r) });
|
|
1443
1398
|
class G {
|
|
1444
1399
|
constructor(e) {
|
|
@@ -1453,19 +1408,19 @@ class G {
|
|
|
1453
1408
|
i(this, "onAfterRender");
|
|
1454
1409
|
i(this, "afterRenderEmitter");
|
|
1455
1410
|
i(this, "arrowRenderer");
|
|
1456
|
-
this.params = e, [this.afterRenderEmitter, this.onAfterRender] = C(), this.arrowRenderer = this.params.arrowRenderer, this.svg =
|
|
1411
|
+
this.params = e, [this.afterRenderEmitter, this.onAfterRender] = C(), this.arrowRenderer = this.params.arrowRenderer, this.svg = ke(e.color), this.svg.appendChild(this.group), this.line = He(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = X(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = X(), this.group.appendChild(this.targetArrow));
|
|
1457
1412
|
}
|
|
1458
1413
|
render(e) {
|
|
1459
|
-
const { x: t, y: o, width: s, height: n, from: a, to: h } =
|
|
1414
|
+
const { x: t, y: o, width: s, height: n, from: a, to: h } = ze(
|
|
1460
1415
|
e.from,
|
|
1461
1416
|
e.to,
|
|
1462
1417
|
this.params.padding
|
|
1463
1418
|
);
|
|
1464
|
-
|
|
1419
|
+
Ye(this.svg, { x: t, y: o, width: s, height: n });
|
|
1465
1420
|
const d = Ae(e.from.direction), c = Ae(e.to.direction);
|
|
1466
|
-
let
|
|
1467
|
-
e.category ===
|
|
1468
|
-
const g =
|
|
1421
|
+
let u = { x: -c.x, y: -c.y }, l;
|
|
1422
|
+
e.category === U.PortCycle ? (l = this.params.createCyclePath, u = d) : e.category === U.NodeCycle ? l = this.params.createDetourPath : l = this.params.createLinePath;
|
|
1423
|
+
const g = l(a, h, d, c);
|
|
1469
1424
|
this.line.setAttribute("d", g.path);
|
|
1470
1425
|
let p = null;
|
|
1471
1426
|
this.sourceArrow && (p = this.arrowRenderer({
|
|
@@ -1475,7 +1430,7 @@ class G {
|
|
|
1475
1430
|
}), this.sourceArrow.setAttribute("d", p));
|
|
1476
1431
|
let w = null;
|
|
1477
1432
|
this.targetArrow && (w = this.arrowRenderer({
|
|
1478
|
-
direction:
|
|
1433
|
+
direction: u,
|
|
1479
1434
|
shift: h,
|
|
1480
1435
|
arrowLength: this.params.arrowLength
|
|
1481
1436
|
}), this.targetArrow.setAttribute("d", w)), this.afterRenderEmitter.emit({
|
|
@@ -1485,32 +1440,32 @@ class G {
|
|
|
1485
1440
|
});
|
|
1486
1441
|
}
|
|
1487
1442
|
}
|
|
1488
|
-
const
|
|
1443
|
+
const Ut = (r) => (e) => {
|
|
1489
1444
|
const o = [
|
|
1490
1445
|
{ x: 0, y: 0 },
|
|
1491
1446
|
{ x: e.arrowLength, y: r.radius },
|
|
1492
1447
|
{ x: e.arrowLength, y: -r.radius }
|
|
1493
1448
|
].map(
|
|
1494
|
-
(h) =>
|
|
1449
|
+
(h) => x(h, e.direction, { x: 0, y: 0 })
|
|
1495
1450
|
).map((h) => ({
|
|
1496
1451
|
x: h.x + e.shift.x,
|
|
1497
1452
|
y: h.y + e.shift.y
|
|
1498
1453
|
})), s = `M ${o[0].x} ${o[0].y}`, n = `L ${o[1].x} ${o[1].y}`, a = `L ${o[2].x} ${o[2].y}`;
|
|
1499
1454
|
return `${s} ${n} ${a} Z`;
|
|
1500
|
-
},
|
|
1455
|
+
}, $t = (r) => (e) => {
|
|
1501
1456
|
const t = r.radius, o = e.arrowLength, s = (o * o + 2 * o * t) / (2 * t), n = s + t, a = o + t - t * (o + t) / n, h = t * s / n, c = [
|
|
1502
1457
|
{ x: 0, y: 0 },
|
|
1503
1458
|
{ x: a, y: -h },
|
|
1504
1459
|
{ x: a, y: h }
|
|
1505
1460
|
].map(
|
|
1506
|
-
(w) =>
|
|
1461
|
+
(w) => x(w, e.direction, { x: 0, y: 0 })
|
|
1507
1462
|
).map((w) => ({
|
|
1508
1463
|
x: w.x + e.shift.x,
|
|
1509
1464
|
y: w.y + e.shift.y
|
|
1510
|
-
})),
|
|
1511
|
-
return `${
|
|
1512
|
-
},
|
|
1513
|
-
const t = r.smallRadius, o = r.radius, s =
|
|
1465
|
+
})), u = `M ${c[0].x} ${c[0].y}`, l = `A ${s} ${s} 0 0 0 ${c[1].x} ${c[1].y}`, g = `A ${t} ${t} 0 0 0 ${c[2].x} ${c[2].y}`, p = `A ${s} ${s} 0 0 0 ${c[0].x} ${c[0].y}`;
|
|
1466
|
+
return `${u} ${l} ${g} ${p}`;
|
|
1467
|
+
}, Bt = (r) => (e) => {
|
|
1468
|
+
const t = r.smallRadius, o = r.radius, s = x(
|
|
1514
1469
|
{
|
|
1515
1470
|
x: e.arrowLength,
|
|
1516
1471
|
y: 0
|
|
@@ -1524,33 +1479,33 @@ const Ft = (r) => (e) => {
|
|
|
1524
1479
|
y: 0
|
|
1525
1480
|
}
|
|
1526
1481
|
), a = [{ x: 0, y: 0 }, { x: s.x, y: -s.y }, s].map(
|
|
1527
|
-
(
|
|
1528
|
-
).map((
|
|
1529
|
-
x:
|
|
1530
|
-
y:
|
|
1531
|
-
})), h = `M ${a[0].x} ${a[0].y}`, d = `A ${o} ${o} 0 0 1 ${a[1].x} ${a[1].y}`, c = `A ${t} ${t} 0 0 1 ${a[2].x} ${a[2].y}`,
|
|
1532
|
-
return `${h} ${d} ${c} ${
|
|
1482
|
+
(l) => x(l, e.direction, { x: 0, y: 0 })
|
|
1483
|
+
).map((l) => ({
|
|
1484
|
+
x: l.x + e.shift.x,
|
|
1485
|
+
y: l.y + e.shift.y
|
|
1486
|
+
})), h = `M ${a[0].x} ${a[0].y}`, d = `A ${o} ${o} 0 0 1 ${a[1].x} ${a[1].y}`, c = `A ${t} ${t} 0 0 1 ${a[2].x} ${a[2].y}`, u = `A ${o} ${o} 0 0 1 ${a[0].x} ${a[0].y}`;
|
|
1487
|
+
return `${h} ${d} ${c} ${u}`;
|
|
1533
1488
|
}, B = (r) => {
|
|
1534
1489
|
if (typeof r == "function")
|
|
1535
1490
|
return r;
|
|
1536
1491
|
switch (r.type) {
|
|
1537
1492
|
case "triangle":
|
|
1538
|
-
return
|
|
1493
|
+
return Ut({
|
|
1539
1494
|
radius: r.radius ?? v.polygonArrowRadius
|
|
1540
1495
|
});
|
|
1541
1496
|
case "arc":
|
|
1542
|
-
return
|
|
1497
|
+
return $t({
|
|
1543
1498
|
radius: r.radius ?? v.circleArrowRadius
|
|
1544
1499
|
});
|
|
1545
1500
|
default:
|
|
1546
|
-
return
|
|
1501
|
+
return Bt({
|
|
1547
1502
|
smallRadius: r.smallRadius ?? v.wedgeArrowSmallRadius,
|
|
1548
1503
|
angle: r.angle ?? v.wedgeArrowAngle,
|
|
1549
1504
|
radius: r.radius ?? v.wedgeArrowRadius
|
|
1550
1505
|
});
|
|
1551
1506
|
}
|
|
1552
1507
|
}, O = 50;
|
|
1553
|
-
class
|
|
1508
|
+
class Ot {
|
|
1554
1509
|
constructor(e) {
|
|
1555
1510
|
i(this, "svg");
|
|
1556
1511
|
i(this, "group");
|
|
@@ -1567,7 +1522,7 @@ class Bt {
|
|
|
1567
1522
|
i(this, "hasSourceArrow");
|
|
1568
1523
|
i(this, "hasTargetArrow");
|
|
1569
1524
|
i(this, "pathShape");
|
|
1570
|
-
i(this, "createCyclePath", (e, t, o) => new
|
|
1525
|
+
i(this, "createCyclePath", (e, t, o) => new Rt({
|
|
1571
1526
|
origin: e,
|
|
1572
1527
|
dir: o,
|
|
1573
1528
|
radius: this.portCycleRadius,
|
|
@@ -1575,7 +1530,7 @@ class Bt {
|
|
|
1575
1530
|
arrowLength: this.arrowLength,
|
|
1576
1531
|
hasArrow: this.hasSourceArrow || this.hasTargetArrow
|
|
1577
1532
|
}));
|
|
1578
|
-
i(this, "createDetourPath", (e, t, o, s) => new
|
|
1533
|
+
i(this, "createDetourPath", (e, t, o, s) => new bt({
|
|
1579
1534
|
from: e,
|
|
1580
1535
|
to: t,
|
|
1581
1536
|
fromDir: o,
|
|
@@ -1587,7 +1542,7 @@ class Bt {
|
|
|
1587
1542
|
hasSourceArrow: this.hasSourceArrow,
|
|
1588
1543
|
hasTargetArrow: this.hasTargetArrow
|
|
1589
1544
|
}));
|
|
1590
|
-
i(this, "createLinePath", (e, t, o, s) => new
|
|
1545
|
+
i(this, "createLinePath", (e, t, o, s) => new St({
|
|
1591
1546
|
from: e,
|
|
1592
1547
|
to: t,
|
|
1593
1548
|
fromDir: o,
|
|
@@ -1615,7 +1570,7 @@ class Bt {
|
|
|
1615
1570
|
}
|
|
1616
1571
|
}
|
|
1617
1572
|
const Se = (r) => Math.cos(r) > 0 ? 0 : Math.PI;
|
|
1618
|
-
class
|
|
1573
|
+
class Wt {
|
|
1619
1574
|
constructor(e) {
|
|
1620
1575
|
i(this, "svg");
|
|
1621
1576
|
i(this, "group");
|
|
@@ -1640,7 +1595,7 @@ class Ot {
|
|
|
1640
1595
|
roundness: this.roundness,
|
|
1641
1596
|
hasArrow: this.hasSourceArrow || this.hasTargetArrow
|
|
1642
1597
|
}));
|
|
1643
|
-
i(this, "createDetourPath", (e, t, o, s) => new
|
|
1598
|
+
i(this, "createDetourPath", (e, t, o, s) => new Vt({
|
|
1644
1599
|
from: e,
|
|
1645
1600
|
to: t,
|
|
1646
1601
|
fromDir: o,
|
|
@@ -1652,7 +1607,7 @@ class Ot {
|
|
|
1652
1607
|
hasSourceArrow: this.hasSourceArrow,
|
|
1653
1608
|
hasTargetArrow: this.hasTargetArrow
|
|
1654
1609
|
}));
|
|
1655
|
-
i(this, "createLinePath", (e, t, o, s) => new
|
|
1610
|
+
i(this, "createLinePath", (e, t, o, s) => new Nt({
|
|
1656
1611
|
from: e,
|
|
1657
1612
|
to: t,
|
|
1658
1613
|
fromDir: o,
|
|
@@ -1697,7 +1652,7 @@ class Ot {
|
|
|
1697
1652
|
});
|
|
1698
1653
|
}
|
|
1699
1654
|
}
|
|
1700
|
-
class
|
|
1655
|
+
class zt {
|
|
1701
1656
|
constructor(e) {
|
|
1702
1657
|
i(this, "svg");
|
|
1703
1658
|
i(this, "group");
|
|
@@ -1723,7 +1678,7 @@ class Wt {
|
|
|
1723
1678
|
roundness: this.roundness,
|
|
1724
1679
|
hasArrow: this.hasSourceArrow || this.hasTargetArrow
|
|
1725
1680
|
}));
|
|
1726
|
-
i(this, "createDetourPath", (e, t, o, s) => new
|
|
1681
|
+
i(this, "createDetourPath", (e, t, o, s) => new Ct({
|
|
1727
1682
|
from: e,
|
|
1728
1683
|
to: t,
|
|
1729
1684
|
fromDir: o,
|
|
@@ -1736,7 +1691,7 @@ class Wt {
|
|
|
1736
1691
|
hasSourceArrow: this.hasSourceArrow,
|
|
1737
1692
|
hasTargetArrow: this.hasTargetArrow
|
|
1738
1693
|
}));
|
|
1739
|
-
i(this, "createLinePath", (e, t, o, s) => new
|
|
1694
|
+
i(this, "createLinePath", (e, t, o, s) => new Tt({
|
|
1740
1695
|
from: e,
|
|
1741
1696
|
to: t,
|
|
1742
1697
|
fromDir: o,
|
|
@@ -1771,7 +1726,7 @@ class Wt {
|
|
|
1771
1726
|
}
|
|
1772
1727
|
}
|
|
1773
1728
|
const be = Math.PI / 2, Pe = (r) => Math.sin(r) > 0 ? be : -be;
|
|
1774
|
-
class
|
|
1729
|
+
class kt {
|
|
1775
1730
|
constructor(e) {
|
|
1776
1731
|
i(this, "svg");
|
|
1777
1732
|
i(this, "group");
|
|
@@ -1796,7 +1751,7 @@ class zt {
|
|
|
1796
1751
|
roundness: this.roundness,
|
|
1797
1752
|
hasArrow: this.hasSourceArrow || this.hasTargetArrow
|
|
1798
1753
|
}));
|
|
1799
|
-
i(this, "createDetourPath", (e, t, o, s) => new
|
|
1754
|
+
i(this, "createDetourPath", (e, t, o, s) => new Ft({
|
|
1800
1755
|
from: e,
|
|
1801
1756
|
to: t,
|
|
1802
1757
|
fromDir: o,
|
|
@@ -1808,7 +1763,7 @@ class zt {
|
|
|
1808
1763
|
hasSourceArrow: this.hasSourceArrow,
|
|
1809
1764
|
hasTargetArrow: this.hasTargetArrow
|
|
1810
1765
|
}));
|
|
1811
|
-
i(this, "createLinePath", (e, t, o, s) => new
|
|
1766
|
+
i(this, "createLinePath", (e, t, o, s) => new Dt({
|
|
1812
1767
|
from: e,
|
|
1813
1768
|
to: t,
|
|
1814
1769
|
fromDir: o,
|
|
@@ -1853,7 +1808,8 @@ class zt {
|
|
|
1853
1808
|
});
|
|
1854
1809
|
}
|
|
1855
1810
|
}
|
|
1856
|
-
|
|
1811
|
+
const Ne = (r) => typeof r == "number" ? () => r : r, Ce = v.portOffset;
|
|
1812
|
+
class Xe {
|
|
1857
1813
|
constructor(e) {
|
|
1858
1814
|
i(this, "svg");
|
|
1859
1815
|
i(this, "group", document.createElementNS(
|
|
@@ -1866,88 +1822,119 @@ class He {
|
|
|
1866
1822
|
i(this, "color");
|
|
1867
1823
|
i(this, "width");
|
|
1868
1824
|
i(this, "arrowLength");
|
|
1869
|
-
i(this, "
|
|
1870
|
-
i(this, "
|
|
1825
|
+
i(this, "sourceOffsetFn");
|
|
1826
|
+
i(this, "targetOffsetFn");
|
|
1871
1827
|
i(this, "onAfterRender");
|
|
1872
1828
|
i(this, "afterRenderEmitter");
|
|
1873
1829
|
i(this, "arrowRenderer");
|
|
1874
|
-
[this.afterRenderEmitter, this.onAfterRender] = C(), this.color = (e == null ? void 0 : e.color) ?? v.color, this.width = (e == null ? void 0 : e.width) ?? v.width, this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? v.arrowLength, this.arrowRenderer = B((e == null ? void 0 : e.arrowRenderer) ?? {}), this.
|
|
1830
|
+
[this.afterRenderEmitter, this.onAfterRender] = C(), this.color = (e == null ? void 0 : e.color) ?? v.color, this.width = (e == null ? void 0 : e.width) ?? v.width, this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? v.arrowLength, this.arrowRenderer = B((e == null ? void 0 : e.arrowRenderer) ?? {}), this.sourceOffsetFn = Ne(
|
|
1831
|
+
(e == null ? void 0 : e.sourceOffset) ?? Ce
|
|
1832
|
+
), this.targetOffsetFn = Ne(
|
|
1833
|
+
(e == null ? void 0 : e.targetOffset) ?? Ce
|
|
1834
|
+
), this.svg = ke(this.color), this.svg.appendChild(this.group), this.line = He(this.width), this.group.appendChild(this.line), e != null && e.hasSourceArrow && (this.sourceArrow = X(), this.group.appendChild(this.sourceArrow)), e != null && e.hasTargetArrow && (this.targetArrow = X(), this.group.appendChild(this.targetArrow));
|
|
1875
1835
|
}
|
|
1876
1836
|
render(e) {
|
|
1877
|
-
const { x: t, y: o, width: s, height: n, from: a, to: h } =
|
|
1837
|
+
const { x: t, y: o, width: s, height: n, from: a, to: h } = ze(
|
|
1878
1838
|
e.from,
|
|
1879
1839
|
e.to,
|
|
1880
1840
|
O
|
|
1881
1841
|
);
|
|
1882
|
-
|
|
1883
|
-
const d =
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
let c = null, l = null;
|
|
1894
|
-
const u = d.diagonalDistance;
|
|
1895
|
-
if (u === 0)
|
|
1896
|
-
this.sourceArrow !== null && (c = "", this.sourceArrow.setAttribute("d", c)), this.targetArrow !== null && (l = "", this.targetArrow.setAttribute("d", l));
|
|
1897
|
-
else {
|
|
1898
|
-
const g = {
|
|
1899
|
-
x: (h.x - a.x) / u,
|
|
1900
|
-
y: (h.y - a.y) / u
|
|
1901
|
-
};
|
|
1902
|
-
if (this.sourceArrow) {
|
|
1903
|
-
const p = {
|
|
1904
|
-
x: g.x * this.sourceOffset + a.x,
|
|
1905
|
-
y: g.y * this.sourceOffset + a.y
|
|
1906
|
-
};
|
|
1907
|
-
c = this.arrowRenderer({
|
|
1908
|
-
direction: g,
|
|
1909
|
-
shift: p,
|
|
1910
|
-
arrowLength: this.arrowLength
|
|
1911
|
-
}), this.sourceArrow.setAttribute("d", c);
|
|
1842
|
+
Ye(this.svg, { x: t, y: o, width: s, height: n });
|
|
1843
|
+
const d = h.x - a.x, c = h.y - a.y, u = Math.sqrt(d * d + c * c);
|
|
1844
|
+
if (u === 0) {
|
|
1845
|
+
this.renderEmpty(a);
|
|
1846
|
+
return;
|
|
1847
|
+
}
|
|
1848
|
+
const l = { x: d / u, y: c / u }, g = this.sourceOffsetFn({
|
|
1849
|
+
direction: { x: l.x, y: l.y },
|
|
1850
|
+
radius: {
|
|
1851
|
+
horizontal: e.from.width / 2,
|
|
1852
|
+
vertical: e.from.height / 2
|
|
1912
1853
|
}
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
l = this.arrowRenderer({
|
|
1919
|
-
direction: { x: -g.x, y: -g.y },
|
|
1920
|
-
shift: {
|
|
1921
|
-
x: h.x - p.x,
|
|
1922
|
-
y: h.y - p.y
|
|
1923
|
-
},
|
|
1924
|
-
arrowLength: this.arrowLength
|
|
1925
|
-
}), this.targetArrow.setAttribute("d", l);
|
|
1854
|
+
}), p = this.targetOffsetFn({
|
|
1855
|
+
direction: { x: -l.x, y: -l.y },
|
|
1856
|
+
radius: {
|
|
1857
|
+
horizontal: e.to.width / 2,
|
|
1858
|
+
vertical: e.to.height / 2
|
|
1926
1859
|
}
|
|
1860
|
+
}), w = {
|
|
1861
|
+
x: a.x + g * l.x,
|
|
1862
|
+
y: a.y + g * l.y
|
|
1863
|
+
}, y = {
|
|
1864
|
+
x: h.x - p * l.x,
|
|
1865
|
+
y: h.y - p * l.y
|
|
1866
|
+
}, f = this.sourceArrow !== null ? this.arrowLength : 0, m = {
|
|
1867
|
+
x: w.x + f * l.x,
|
|
1868
|
+
y: w.y + f * l.y
|
|
1869
|
+
}, E = this.targetArrow !== null ? this.arrowLength : 0, A = {
|
|
1870
|
+
x: y.x - E * l.x,
|
|
1871
|
+
y: y.y - E * l.y
|
|
1872
|
+
}, T = {
|
|
1873
|
+
x: (w.x + y.x) / 2,
|
|
1874
|
+
y: (w.y + y.y) / 2
|
|
1875
|
+
}, M = `M ${m.x} ${m.y} L ${A.x} ${A.y}`;
|
|
1876
|
+
this.line.setAttribute("d", M);
|
|
1877
|
+
let L = null, V = null;
|
|
1878
|
+
if (this.sourceArrow) {
|
|
1879
|
+
const D = {
|
|
1880
|
+
x: l.x * g + a.x,
|
|
1881
|
+
y: l.y * g + a.y
|
|
1882
|
+
};
|
|
1883
|
+
L = this.arrowRenderer({
|
|
1884
|
+
direction: l,
|
|
1885
|
+
shift: D,
|
|
1886
|
+
arrowLength: this.arrowLength
|
|
1887
|
+
}), this.sourceArrow.setAttribute("d", L);
|
|
1888
|
+
}
|
|
1889
|
+
if (this.targetArrow) {
|
|
1890
|
+
const D = {
|
|
1891
|
+
x: l.x * p,
|
|
1892
|
+
y: l.y * p
|
|
1893
|
+
};
|
|
1894
|
+
V = this.arrowRenderer({
|
|
1895
|
+
direction: { x: -l.x, y: -l.y },
|
|
1896
|
+
shift: {
|
|
1897
|
+
x: h.x - D.x,
|
|
1898
|
+
y: h.y - D.y
|
|
1899
|
+
},
|
|
1900
|
+
arrowLength: this.arrowLength
|
|
1901
|
+
}), this.targetArrow.setAttribute("d", V);
|
|
1927
1902
|
}
|
|
1928
1903
|
this.afterRenderEmitter.emit({
|
|
1929
|
-
edgePath:
|
|
1930
|
-
sourceArrowPath:
|
|
1931
|
-
targetArrowPath:
|
|
1904
|
+
edgePath: { path: M, midpoint: T },
|
|
1905
|
+
sourceArrowPath: L,
|
|
1906
|
+
targetArrowPath: V
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1909
|
+
renderEmpty(e) {
|
|
1910
|
+
const t = "";
|
|
1911
|
+
let o = null, s = null;
|
|
1912
|
+
this.line.setAttribute("d", t), this.sourceArrow !== null && (o = "", this.sourceArrow.setAttribute("d", o)), this.targetArrow !== null && (s = "", this.targetArrow.setAttribute("d", s)), this.afterRenderEmitter.emit({
|
|
1913
|
+
edgePath: { path: t, midpoint: e },
|
|
1914
|
+
sourceArrowPath: o,
|
|
1915
|
+
targetArrowPath: s
|
|
1932
1916
|
});
|
|
1933
1917
|
}
|
|
1934
1918
|
}
|
|
1935
|
-
const
|
|
1919
|
+
const _r = (r) => {
|
|
1920
|
+
const { direction: e, radius: t } = r, { x: o, y: s } = e, { horizontal: n, vertical: a } = t, h = s / o, d = Math.abs(a / h), c = Math.abs(n * h), u = Math.min(n, d), l = Math.min(a, c);
|
|
1921
|
+
return Math.sqrt(u * u + l * l);
|
|
1922
|
+
}, Ht = () => {
|
|
1936
1923
|
const r = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
1937
1924
|
return r.style.pointerEvents = "auto", r.style.cursor = "pointer", r;
|
|
1938
|
-
},
|
|
1925
|
+
}, Yt = (r) => {
|
|
1939
1926
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1940
1927
|
return e.setAttribute("stroke", "transparent"), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e.setAttribute("stroke-linecap", "round"), e;
|
|
1941
|
-
},
|
|
1928
|
+
}, Te = (r) => {
|
|
1942
1929
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1943
1930
|
return e.setAttribute("stroke-linejoin", "round"), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "transparent"), e.setAttribute("stroke", "transparent"), e;
|
|
1944
1931
|
};
|
|
1945
|
-
class
|
|
1932
|
+
class Xt extends Error {
|
|
1946
1933
|
constructor(e) {
|
|
1947
1934
|
super(e), this.name = "InteractiveEdgeError";
|
|
1948
1935
|
}
|
|
1949
1936
|
}
|
|
1950
|
-
class
|
|
1937
|
+
class Ge {
|
|
1951
1938
|
constructor(e, t) {
|
|
1952
1939
|
i(this, "svg");
|
|
1953
1940
|
i(this, "group");
|
|
@@ -1959,18 +1946,18 @@ class Ye {
|
|
|
1959
1946
|
* @deprecated
|
|
1960
1947
|
* use shape.svg instead
|
|
1961
1948
|
*/
|
|
1962
|
-
i(this, "handle",
|
|
1949
|
+
i(this, "handle", Ht());
|
|
1963
1950
|
i(this, "onAfterRender");
|
|
1964
1951
|
i(this, "interactiveLine");
|
|
1965
1952
|
i(this, "interactiveSourceArrow", null);
|
|
1966
1953
|
i(this, "interactiveTargetArrow", null);
|
|
1967
|
-
if (this.baseEdge = e, e instanceof
|
|
1968
|
-
throw new
|
|
1954
|
+
if (this.baseEdge = e, e instanceof Ge)
|
|
1955
|
+
throw new Xt(
|
|
1969
1956
|
"interactive edge can be configured only once"
|
|
1970
1957
|
);
|
|
1971
1958
|
this.svg = this.baseEdge.svg, this.group = this.baseEdge.group, this.line = this.baseEdge.line, this.sourceArrow = this.baseEdge.sourceArrow, this.targetArrow = this.baseEdge.targetArrow, this.onAfterRender = this.baseEdge.onAfterRender;
|
|
1972
1959
|
const o = (t == null ? void 0 : t.distance) ?? v.interactiveWidth;
|
|
1973
|
-
this.interactiveLine =
|
|
1960
|
+
this.interactiveLine = Yt(o), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = Te(o), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = Te(o), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((s) => {
|
|
1974
1961
|
this.interactiveLine.setAttribute("d", s.edgePath.path), this.interactiveSourceArrow && this.interactiveSourceArrow.setAttribute("d", s.sourceArrowPath), this.interactiveTargetArrow && this.interactiveTargetArrow.setAttribute("d", s.targetArrowPath);
|
|
1975
1962
|
});
|
|
1976
1963
|
}
|
|
@@ -1978,7 +1965,7 @@ class Ye {
|
|
|
1978
1965
|
this.baseEdge.render(e);
|
|
1979
1966
|
}
|
|
1980
1967
|
}
|
|
1981
|
-
class
|
|
1968
|
+
class qr {
|
|
1982
1969
|
constructor(e, t) {
|
|
1983
1970
|
i(this, "group");
|
|
1984
1971
|
i(this, "line");
|
|
@@ -1995,7 +1982,7 @@ class Zr {
|
|
|
1995
1982
|
this.baseShape.render(e);
|
|
1996
1983
|
}
|
|
1997
1984
|
}
|
|
1998
|
-
class
|
|
1985
|
+
class je {
|
|
1999
1986
|
constructor(e) {
|
|
2000
1987
|
i(this, "onAfterNodeAdded");
|
|
2001
1988
|
i(this, "onAfterNodeUpdated");
|
|
@@ -2110,7 +2097,7 @@ class K {
|
|
|
2110
2097
|
this.counter = 0;
|
|
2111
2098
|
}
|
|
2112
2099
|
}
|
|
2113
|
-
class
|
|
2100
|
+
class Je {
|
|
2114
2101
|
constructor(e, t, o) {
|
|
2115
2102
|
i(this, "nodeIdGenerator", new K(
|
|
2116
2103
|
(e) => this.graphStore.hasNode(e)
|
|
@@ -2241,18 +2228,18 @@ class Ge {
|
|
|
2241
2228
|
), this.graphStore.onBeforeEdgeRemoved.unsubscribe(this.onBeforeEdgeRemoved), this.graphStore.onBeforeClear.unsubscribe(this.onBeforeClear), this.htmlView.destroy();
|
|
2242
2229
|
}
|
|
2243
2230
|
}
|
|
2244
|
-
const
|
|
2231
|
+
const Gt = (r) => {
|
|
2245
2232
|
setTimeout(() => {
|
|
2246
2233
|
r();
|
|
2247
2234
|
});
|
|
2248
|
-
},
|
|
2235
|
+
}, Me = (r) => {
|
|
2249
2236
|
queueMicrotask(() => {
|
|
2250
2237
|
r();
|
|
2251
2238
|
});
|
|
2252
2239
|
}, oe = (r) => {
|
|
2253
2240
|
r();
|
|
2254
2241
|
};
|
|
2255
|
-
class
|
|
2242
|
+
class Ke {
|
|
2256
2243
|
constructor(e) {
|
|
2257
2244
|
i(this, "onBeforeUpdated");
|
|
2258
2245
|
i(this, "onAfterUpdated");
|
|
@@ -2275,7 +2262,7 @@ class je {
|
|
|
2275
2262
|
return this.viewportStore.createViewportCoords(e);
|
|
2276
2263
|
}
|
|
2277
2264
|
}
|
|
2278
|
-
const
|
|
2265
|
+
const jt = (r, e) => Symbol.iterator in r ? {
|
|
2279
2266
|
minContentScale: e.focus.minContentScale,
|
|
2280
2267
|
nodes: r,
|
|
2281
2268
|
contentPadding: e.focus.contentPadding,
|
|
@@ -2285,16 +2272,16 @@ const Gt = (r, e) => Symbol.iterator in r ? {
|
|
|
2285
2272
|
nodes: r.nodes ?? [],
|
|
2286
2273
|
contentPadding: r.contentPadding ?? r.contentOffset ?? e.focus.contentPadding,
|
|
2287
2274
|
animationDuration: r.animationDuration ?? e.focus.animationDuration
|
|
2288
|
-
},
|
|
2275
|
+
}, Qe = (r, e, t) => ({
|
|
2289
2276
|
scale: r.scale,
|
|
2290
2277
|
x: r.x + r.scale * e,
|
|
2291
2278
|
y: r.y + r.scale * t
|
|
2292
|
-
}),
|
|
2279
|
+
}), Ze = (r, e, t, o) => ({
|
|
2293
2280
|
scale: r.scale * e,
|
|
2294
2281
|
x: r.scale * (1 - e) * t + r.x,
|
|
2295
2282
|
y: r.scale * (1 - e) * o + r.y
|
|
2296
2283
|
});
|
|
2297
|
-
class
|
|
2284
|
+
class _e {
|
|
2298
2285
|
constructor(e, t, o, s) {
|
|
2299
2286
|
this.graphStore = e, this.viewportStore = t, this.params = o, this.win = s;
|
|
2300
2287
|
}
|
|
@@ -2306,22 +2293,22 @@ class Qe {
|
|
|
2306
2293
|
}
|
|
2307
2294
|
center(e, t) {
|
|
2308
2295
|
const { width: o, height: s } = this.viewportStore.getDimensions(), n = { x: o / 2, y: s / 2 }, a = this.viewportStore.getViewportMatrix(), h = this.viewportStore.createViewportCoords(e), d = h.x - n.x, c = h.y - n.y;
|
|
2309
|
-
let
|
|
2310
|
-
const
|
|
2311
|
-
if (
|
|
2312
|
-
const p = 1 /
|
|
2313
|
-
|
|
2314
|
-
|
|
2296
|
+
let u = Qe(a, d, c);
|
|
2297
|
+
const l = t == null ? void 0 : t.contentScale;
|
|
2298
|
+
if (l !== void 0) {
|
|
2299
|
+
const p = 1 / l;
|
|
2300
|
+
u = Ze(
|
|
2301
|
+
u,
|
|
2315
2302
|
p / a.scale,
|
|
2316
2303
|
n.x,
|
|
2317
2304
|
n.y
|
|
2318
2305
|
);
|
|
2319
2306
|
}
|
|
2320
2307
|
const g = (t == null ? void 0 : t.animationDuration) ?? 0;
|
|
2321
|
-
g > 0 ? this.animateNavigation(a,
|
|
2308
|
+
g > 0 ? this.animateNavigation(a, u, g) : this.viewportStore.patchViewportMatrix(u);
|
|
2322
2309
|
}
|
|
2323
2310
|
focus(e) {
|
|
2324
|
-
const t =
|
|
2311
|
+
const t = jt(e ?? {}, this.params);
|
|
2325
2312
|
this.params.focus.schedule(() => {
|
|
2326
2313
|
this.navigate(t);
|
|
2327
2314
|
});
|
|
@@ -2342,12 +2329,12 @@ class Qe {
|
|
|
2342
2329
|
const d = {
|
|
2343
2330
|
x: (t + o) / 2,
|
|
2344
2331
|
y: (s + n) / 2
|
|
2345
|
-
}, { scale: c } = this.viewportStore.getContentMatrix(),
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
),
|
|
2332
|
+
}, { scale: c } = this.viewportStore.getContentMatrix(), u = (n - s) * c, l = (o - t) * c, { width: g, height: p } = this.viewportStore.getDimensions(), w = Math.max(
|
|
2333
|
+
l / g,
|
|
2334
|
+
u / p
|
|
2335
|
+
), y = w > 1 ? c / w : c, f = Math.max(y, e.minContentScale);
|
|
2349
2336
|
this.center(d, {
|
|
2350
|
-
contentScale:
|
|
2337
|
+
contentScale: f,
|
|
2351
2338
|
animationDuration: e.animationDuration
|
|
2352
2339
|
});
|
|
2353
2340
|
}
|
|
@@ -2370,20 +2357,20 @@ class Qe {
|
|
|
2370
2357
|
this.win.requestAnimationFrame(a);
|
|
2371
2358
|
}
|
|
2372
2359
|
}
|
|
2373
|
-
const
|
|
2374
|
-
const o = new
|
|
2360
|
+
const qe = (r, e, t) => {
|
|
2361
|
+
const o = new $e(), s = new je(o), n = new Ke(e), a = new Fe(o, e, r), h = {
|
|
2375
2362
|
nodes: {
|
|
2376
|
-
centerFn:
|
|
2363
|
+
centerFn: We,
|
|
2377
2364
|
priorityFn: () => 0
|
|
2378
2365
|
},
|
|
2379
2366
|
edges: {
|
|
2380
|
-
shapeFactory: () => new
|
|
2367
|
+
shapeFactory: () => new Xe(),
|
|
2381
2368
|
priorityFn: () => 0
|
|
2382
2369
|
},
|
|
2383
2370
|
ports: {
|
|
2384
2371
|
direction: 0
|
|
2385
2372
|
}
|
|
2386
|
-
}, d = new
|
|
2373
|
+
}, d = new Je(
|
|
2387
2374
|
o,
|
|
2388
2375
|
a,
|
|
2389
2376
|
h
|
|
@@ -2394,13 +2381,13 @@ const Ze = (r, e, t) => {
|
|
|
2394
2381
|
schedule: oe,
|
|
2395
2382
|
animationDuration: 0
|
|
2396
2383
|
}
|
|
2397
|
-
},
|
|
2384
|
+
}, u = new _e(
|
|
2398
2385
|
o,
|
|
2399
2386
|
e,
|
|
2400
2387
|
c,
|
|
2401
2388
|
t
|
|
2402
2389
|
);
|
|
2403
|
-
return new
|
|
2390
|
+
return new Ue(s, n, d, u);
|
|
2404
2391
|
};
|
|
2405
2392
|
class j {
|
|
2406
2393
|
constructor(e, t, o, s) {
|
|
@@ -2502,7 +2489,7 @@ class j {
|
|
|
2502
2489
|
this.window.removeEventListener("touchmove", this.onWindowTouchMove), this.window.removeEventListener("touchend", this.onWindowTouchFinish), this.window.removeEventListener("touchcancel", this.onWindowTouchFinish);
|
|
2503
2490
|
}
|
|
2504
2491
|
}
|
|
2505
|
-
class
|
|
2492
|
+
class Jt {
|
|
2506
2493
|
constructor() {
|
|
2507
2494
|
i(this, "field", "_htmlGraphTags");
|
|
2508
2495
|
}
|
|
@@ -2610,7 +2597,7 @@ const ne = (r, e) => ({
|
|
|
2610
2597
|
from: r.isDirect ? r.staticPortId : e,
|
|
2611
2598
|
to: r.isDirect ? e : r.staticPortId
|
|
2612
2599
|
});
|
|
2613
|
-
class
|
|
2600
|
+
class De {
|
|
2614
2601
|
constructor(e, t) {
|
|
2615
2602
|
this.graph = e, this.connectionAllowedVerifier = t;
|
|
2616
2603
|
}
|
|
@@ -2618,18 +2605,18 @@ class Te {
|
|
|
2618
2605
|
let t, o = 1 / 0;
|
|
2619
2606
|
const { cursor: s } = e;
|
|
2620
2607
|
return this.graph.getAllPortIds().forEach((n) => {
|
|
2621
|
-
const { element: a, direction: h, nodeId: d } = this.graph.getPort(n), { x: c, y:
|
|
2622
|
-
if (c === null ||
|
|
2608
|
+
const { element: a, direction: h, nodeId: d } = this.graph.getPort(n), { x: c, y: u } = this.graph.getNode(d);
|
|
2609
|
+
if (c === null || u === null)
|
|
2623
2610
|
return;
|
|
2624
|
-
const
|
|
2625
|
-
if (!this.connectionAllowedVerifier(
|
|
2611
|
+
const l = ne(e, n);
|
|
2612
|
+
if (!this.connectionAllowedVerifier(l))
|
|
2626
2613
|
return;
|
|
2627
|
-
const { top: g, left: p, width: w, height:
|
|
2628
|
-
|
|
2614
|
+
const { top: g, left: p, width: w, height: y } = a.getBoundingClientRect(), f = { x: p + w / 2, y: g + y / 2 }, m = s.x - f.x, E = s.y - f.y, A = Math.sqrt(m * m + E * E);
|
|
2615
|
+
A < o && (o = A, t = h);
|
|
2629
2616
|
}), t;
|
|
2630
2617
|
}
|
|
2631
2618
|
}
|
|
2632
|
-
class
|
|
2619
|
+
class Kt {
|
|
2633
2620
|
constructor(e) {
|
|
2634
2621
|
this.direction = e;
|
|
2635
2622
|
}
|
|
@@ -2947,7 +2934,7 @@ class J {
|
|
|
2947
2934
|
);
|
|
2948
2935
|
}
|
|
2949
2936
|
moveViewport(e, t) {
|
|
2950
|
-
const o = this.viewport.getViewportMatrix(), s =
|
|
2937
|
+
const o = this.viewport.getViewportMatrix(), s = Qe(o, e, t), { width: n, height: a } = this.viewport.getDimensions(), h = this.params.transformPreprocessor({
|
|
2951
2938
|
prevTransform: o,
|
|
2952
2939
|
nextTransform: s,
|
|
2953
2940
|
canvasWidth: n,
|
|
@@ -2956,7 +2943,7 @@ class J {
|
|
|
2956
2943
|
this.performTransform(h);
|
|
2957
2944
|
}
|
|
2958
2945
|
scaleViewport(e, t, o) {
|
|
2959
|
-
const s = this.canvas.viewport.getViewportMatrix(), n =
|
|
2946
|
+
const s = this.canvas.viewport.getViewportMatrix(), n = Ze(s, e, t, o), { width: a, height: h } = this.viewport.getDimensions(), d = this.params.transformPreprocessor({
|
|
2960
2947
|
prevTransform: s,
|
|
2961
2948
|
nextTransform: n,
|
|
2962
2949
|
canvasWidth: a,
|
|
@@ -3068,27 +3055,27 @@ class he {
|
|
|
3068
3055
|
}
|
|
3069
3056
|
scheduleEnsureViewportAreaLoaded() {
|
|
3070
3057
|
setTimeout(() => {
|
|
3071
|
-
const { width: e, height: t } = this.viewport.getDimensions(), { scale: o, x: s, y: n } = this.viewport.getViewportMatrix(), a = e * o, h = t * o, d = s - this.nodeHorizontal, c = n - this.nodeVertical,
|
|
3072
|
-
this.loadedArea.xFrom < d && this.loadedArea.xTo >
|
|
3058
|
+
const { width: e, height: t } = this.viewport.getDimensions(), { scale: o, x: s, y: n } = this.viewport.getViewportMatrix(), a = e * o, h = t * o, d = s - this.nodeHorizontal, c = n - this.nodeVertical, u = s + a + this.nodeHorizontal, l = n + h + this.nodeVertical;
|
|
3059
|
+
this.loadedArea.xFrom < d && this.loadedArea.xTo > u && this.loadedArea.yFrom < c && this.loadedArea.yTo > l || this.loadAreaAroundViewport();
|
|
3073
3060
|
});
|
|
3074
3061
|
}
|
|
3075
3062
|
loadAreaAroundViewport() {
|
|
3076
|
-
const { width: e, height: t } = this.viewport.getDimensions(), { scale: o, x: s, y: n } = this.viewport.getViewportMatrix(), a = e * o, h = t * o, d = s - a - this.nodeHorizontal, c = n - h - this.nodeVertical,
|
|
3063
|
+
const { width: e, height: t } = this.viewport.getDimensions(), { scale: o, x: s, y: n } = this.viewport.getViewportMatrix(), a = e * o, h = t * o, d = s - a - this.nodeHorizontal, c = n - h - this.nodeVertical, u = 3 * a + 2 * this.nodeHorizontal, l = 3 * h + 2 * this.nodeVertical;
|
|
3077
3064
|
this.trigger.emit({
|
|
3078
3065
|
x: d,
|
|
3079
3066
|
y: c,
|
|
3080
|
-
width:
|
|
3081
|
-
height:
|
|
3067
|
+
width: u,
|
|
3068
|
+
height: l
|
|
3082
3069
|
});
|
|
3083
3070
|
}
|
|
3084
3071
|
}
|
|
3085
|
-
const
|
|
3072
|
+
const Qt = () => {
|
|
3086
3073
|
const r = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3087
3074
|
return r.style.position = "absolute", r.style.inset = "0", r;
|
|
3088
|
-
},
|
|
3075
|
+
}, Zt = () => {
|
|
3089
3076
|
const r = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
3090
3077
|
return r.setAttribute("fill", "url(#pattern)"), r;
|
|
3091
|
-
},
|
|
3078
|
+
}, _t = () => {
|
|
3092
3079
|
const r = document.createElementNS(
|
|
3093
3080
|
"http://www.w3.org/2000/svg",
|
|
3094
3081
|
"pattern"
|
|
@@ -3097,9 +3084,9 @@ const Kt = () => {
|
|
|
3097
3084
|
};
|
|
3098
3085
|
class de {
|
|
3099
3086
|
constructor(e, t, o) {
|
|
3100
|
-
i(this, "svg",
|
|
3101
|
-
i(this, "patternRenderingRectangle",
|
|
3102
|
-
i(this, "pattern",
|
|
3087
|
+
i(this, "svg", Qt());
|
|
3088
|
+
i(this, "patternRenderingRectangle", Zt());
|
|
3089
|
+
i(this, "pattern", _t());
|
|
3103
3090
|
i(this, "patternContent");
|
|
3104
3091
|
i(this, "tileWidth");
|
|
3105
3092
|
i(this, "tileHeight");
|
|
@@ -3141,7 +3128,7 @@ class ce {
|
|
|
3141
3128
|
i(this, "onEdgeCreated", (e) => {
|
|
3142
3129
|
this.params.onAfterEdgeCreated(e);
|
|
3143
3130
|
});
|
|
3144
|
-
this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.pointInsideVerifier = n, this.params = a, this.overlayCanvas =
|
|
3131
|
+
this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.pointInsideVerifier = n, this.params = a, this.overlayCanvas = qe(
|
|
3145
3132
|
this.overlayLayer,
|
|
3146
3133
|
this.viewportStore,
|
|
3147
3134
|
this.window
|
|
@@ -3150,8 +3137,8 @@ class ce {
|
|
|
3150
3137
|
mouseDownEventVerifier: this.params.mouseDownEventVerifier,
|
|
3151
3138
|
mouseUpEventVerifier: this.params.mouseUpEventVerifier,
|
|
3152
3139
|
onPointerDownVerifier: (d, c) => {
|
|
3153
|
-
const
|
|
3154
|
-
return
|
|
3140
|
+
const u = this.params.connectionTypeResolver(d);
|
|
3141
|
+
return u === null ? !1 : (this.grabPort(d, c, u), !0);
|
|
3155
3142
|
},
|
|
3156
3143
|
onPointerMove: (d) => {
|
|
3157
3144
|
this.moveDraggingPort(d);
|
|
@@ -3185,11 +3172,11 @@ class ce {
|
|
|
3185
3172
|
const s = this.canvas.graph.getPort(e), n = s.element.getBoundingClientRect(), a = n.x + n.width / 2, h = n.y + n.height / 2, d = this.overlayLayer.getBoundingClientRect(), c = this.canvas.viewport.createContentCoords({
|
|
3186
3173
|
x: a - d.x,
|
|
3187
3174
|
y: h - d.y
|
|
3188
|
-
}),
|
|
3175
|
+
}), u = this.canvas.viewport.createContentCoords({
|
|
3189
3176
|
x: t.x - d.x,
|
|
3190
3177
|
y: t.y - d.y
|
|
3191
|
-
}),
|
|
3192
|
-
overlayNodeId:
|
|
3178
|
+
}), l = {
|
|
3179
|
+
overlayNodeId: R.StaticNodeId,
|
|
3193
3180
|
portCoords: c,
|
|
3194
3181
|
portDirection: s.direction
|
|
3195
3182
|
}, g = o === "direct";
|
|
@@ -3203,21 +3190,21 @@ class ce {
|
|
|
3203
3190
|
...this.edgeInProgress
|
|
3204
3191
|
}
|
|
3205
3192
|
), w = {
|
|
3206
|
-
overlayNodeId:
|
|
3207
|
-
portCoords:
|
|
3193
|
+
overlayNodeId: R.DraggingNodeId,
|
|
3194
|
+
portCoords: u,
|
|
3208
3195
|
portDirection: p ?? s.direction
|
|
3209
|
-
}, [
|
|
3210
|
-
this.overlayCanvas.addNode(Y(
|
|
3211
|
-
from:
|
|
3212
|
-
to:
|
|
3213
|
-
shape: this.params.edgeShapeFactory(
|
|
3196
|
+
}, [y, f] = g ? [l, w] : [w, l];
|
|
3197
|
+
this.overlayCanvas.addNode(Y(y)), this.overlayCanvas.addNode(Y(f)), this.overlayCanvas.addEdge({
|
|
3198
|
+
from: y.overlayNodeId,
|
|
3199
|
+
to: f.overlayNodeId,
|
|
3200
|
+
shape: this.params.edgeShapeFactory(R.EdgeId)
|
|
3214
3201
|
});
|
|
3215
3202
|
}
|
|
3216
3203
|
resetDragState() {
|
|
3217
3204
|
this.edgeInProgress = null, this.overlayCanvas.clear();
|
|
3218
3205
|
}
|
|
3219
3206
|
tryCreateConnection(e) {
|
|
3220
|
-
const t =
|
|
3207
|
+
const t = Oe(this.canvas.graph, e);
|
|
3221
3208
|
if (t === null) {
|
|
3222
3209
|
this.params.onEdgeCreationInterrupted(this.edgeInProgress);
|
|
3223
3210
|
return;
|
|
@@ -3239,10 +3226,10 @@ class ce {
|
|
|
3239
3226
|
cursor: e,
|
|
3240
3227
|
...this.edgeInProgress
|
|
3241
3228
|
});
|
|
3242
|
-
this.overlayCanvas.updateNode(
|
|
3229
|
+
this.overlayCanvas.updateNode(R.DraggingNodeId, {
|
|
3243
3230
|
x: o.x,
|
|
3244
3231
|
y: o.y
|
|
3245
|
-
}).updatePort(
|
|
3232
|
+
}).updatePort(R.DraggingNodeId, { direction: s });
|
|
3246
3233
|
}
|
|
3247
3234
|
}
|
|
3248
3235
|
class le {
|
|
@@ -3253,7 +3240,7 @@ class le {
|
|
|
3253
3240
|
i(this, "onEdgeReattached", (e) => {
|
|
3254
3241
|
this.params.onAfterEdgeReattached(e);
|
|
3255
3242
|
});
|
|
3256
|
-
this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.pointInsideVerifier = n, this.params = a, this.overlayCanvas =
|
|
3243
|
+
this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.pointInsideVerifier = n, this.params = a, this.overlayCanvas = qe(
|
|
3257
3244
|
this.overlayLayer,
|
|
3258
3245
|
this.viewportStore,
|
|
3259
3246
|
this.window
|
|
@@ -3302,12 +3289,12 @@ class le {
|
|
|
3302
3289
|
return !1;
|
|
3303
3290
|
const s = this.canvas.graph.getEdge(o), n = e === s.from, a = e === s.to, h = n ? s.to : s.from;
|
|
3304
3291
|
this.edgeInProgress = { staticPortId: h, isDirect: a };
|
|
3305
|
-
const d = this.canvas.graph.getPort(e), c = this.canvas.graph.getPort(h),
|
|
3306
|
-
x:
|
|
3307
|
-
y:
|
|
3292
|
+
const d = this.canvas.graph.getPort(e), c = this.canvas.graph.getPort(h), u = c.element.getBoundingClientRect(), l = {
|
|
3293
|
+
x: u.x + u.width / 2,
|
|
3294
|
+
y: u.y + u.height / 2
|
|
3308
3295
|
}, g = this.overlayLayer.getBoundingClientRect(), p = this.canvas.viewport.createContentCoords({
|
|
3309
|
-
x:
|
|
3310
|
-
y:
|
|
3296
|
+
x: l.x - g.x,
|
|
3297
|
+
y: l.y - g.y
|
|
3311
3298
|
}), w = this.canvas.viewport.createContentCoords({
|
|
3312
3299
|
x: t.x - g.x,
|
|
3313
3300
|
y: t.y - g.y
|
|
@@ -3319,26 +3306,26 @@ class le {
|
|
|
3319
3306
|
shape: s.shape,
|
|
3320
3307
|
priority: s.priority
|
|
3321
3308
|
}, this.canvas.removeEdge(o);
|
|
3322
|
-
const
|
|
3323
|
-
overlayNodeId:
|
|
3309
|
+
const y = {
|
|
3310
|
+
overlayNodeId: R.StaticNodeId,
|
|
3324
3311
|
portCoords: p,
|
|
3325
3312
|
portDirection: c.direction
|
|
3326
|
-
},
|
|
3313
|
+
}, f = this.params.draggingPortDirectionResolver.resolve(
|
|
3327
3314
|
{
|
|
3328
3315
|
cursor: t,
|
|
3329
3316
|
...this.edgeInProgress
|
|
3330
3317
|
}
|
|
3331
|
-
),
|
|
3332
|
-
overlayNodeId:
|
|
3318
|
+
), m = {
|
|
3319
|
+
overlayNodeId: R.DraggingNodeId,
|
|
3333
3320
|
portCoords: w,
|
|
3334
|
-
portDirection:
|
|
3335
|
-
}, [
|
|
3336
|
-
this.overlayCanvas.addNode(Y(
|
|
3337
|
-
const T = this.params.draggingEdgeShapeFactory !== null ? this.params.draggingEdgeShapeFactory(
|
|
3321
|
+
portDirection: f ?? d.direction
|
|
3322
|
+
}, [E, A] = a ? [y, m] : [m, y];
|
|
3323
|
+
this.overlayCanvas.addNode(Y(E)), this.overlayCanvas.addNode(Y(A));
|
|
3324
|
+
const T = this.params.draggingEdgeShapeFactory !== null ? this.params.draggingEdgeShapeFactory(R.EdgeId) : s.shape;
|
|
3338
3325
|
return this.overlayCanvas.addEdge({
|
|
3339
|
-
id:
|
|
3340
|
-
from:
|
|
3341
|
-
to:
|
|
3326
|
+
id: R.EdgeId,
|
|
3327
|
+
from: E.overlayNodeId,
|
|
3328
|
+
to: A.overlayNodeId,
|
|
3342
3329
|
shape: T
|
|
3343
3330
|
}), !0;
|
|
3344
3331
|
}
|
|
@@ -3353,14 +3340,14 @@ class le {
|
|
|
3353
3340
|
cursor: e,
|
|
3354
3341
|
...this.edgeInProgress
|
|
3355
3342
|
});
|
|
3356
|
-
this.overlayCanvas.updateNode(
|
|
3343
|
+
this.overlayCanvas.updateNode(R.DraggingNodeId, {
|
|
3357
3344
|
x: s.x,
|
|
3358
3345
|
y: s.y
|
|
3359
|
-
}).updatePort(
|
|
3346
|
+
}).updatePort(R.DraggingNodeId, { direction: n });
|
|
3360
3347
|
}
|
|
3361
3348
|
tryCreateConnection(e) {
|
|
3362
|
-
const t =
|
|
3363
|
-
if (this.overlayCanvas.removeEdge(
|
|
3349
|
+
const t = Oe(this.canvas.graph, e);
|
|
3350
|
+
if (this.overlayCanvas.removeEdge(R.EdgeId), t === null) {
|
|
3364
3351
|
const c = this.draggingEdgePayload;
|
|
3365
3352
|
this.params.onEdgeReattachInterrupted({
|
|
3366
3353
|
id: c.id,
|
|
@@ -3435,7 +3422,7 @@ class ge {
|
|
|
3435
3422
|
this.applyScheduled || (this.applyScheduled = !0, this.defererFn(this.apply));
|
|
3436
3423
|
}
|
|
3437
3424
|
}
|
|
3438
|
-
class
|
|
3425
|
+
class qt {
|
|
3439
3426
|
constructor(e, t, o) {
|
|
3440
3427
|
this.canvas = e, this.layoutAlgorithm = t, this.params = o;
|
|
3441
3428
|
}
|
|
@@ -3449,9 +3436,9 @@ class _t {
|
|
|
3449
3436
|
}), this.params.onAfterApplied();
|
|
3450
3437
|
}
|
|
3451
3438
|
}
|
|
3452
|
-
class
|
|
3439
|
+
class er {
|
|
3453
3440
|
static configure(e, t) {
|
|
3454
|
-
const o = t.applyOn, s = new
|
|
3441
|
+
const o = t.applyOn, s = new qt(e, t.algorithm, {
|
|
3455
3442
|
staticNodeResolver: t.staticNodeResolver,
|
|
3456
3443
|
onBeforeApplied: t.onBeforeApplied,
|
|
3457
3444
|
onAfterApplied: t.onAfterApplied
|
|
@@ -3475,7 +3462,7 @@ class qt {
|
|
|
3475
3462
|
}
|
|
3476
3463
|
}
|
|
3477
3464
|
}
|
|
3478
|
-
class
|
|
3465
|
+
class tr {
|
|
3479
3466
|
constructor(e, t) {
|
|
3480
3467
|
i(this, "previousTimeStamp");
|
|
3481
3468
|
i(this, "step", (e) => {
|
|
@@ -3490,7 +3477,7 @@ class er {
|
|
|
3490
3477
|
this.win = e, this.callback = t, this.win.requestAnimationFrame(this.step);
|
|
3491
3478
|
}
|
|
3492
3479
|
}
|
|
3493
|
-
class
|
|
3480
|
+
class rr {
|
|
3494
3481
|
constructor(e, t, o) {
|
|
3495
3482
|
this.canvas = e, this.layoutAlgorithm = t, this.params = o;
|
|
3496
3483
|
}
|
|
@@ -3511,11 +3498,11 @@ class pe {
|
|
|
3511
3498
|
i(this, "step", (e) => {
|
|
3512
3499
|
this.applier.apply(e);
|
|
3513
3500
|
});
|
|
3514
|
-
this.win = o, this.applier = new
|
|
3501
|
+
this.win = o, this.applier = new rr(e, t.algorithm, {
|
|
3515
3502
|
staticNodeResolver: t.staticNodeResolver,
|
|
3516
3503
|
onBeforeApplied: t.onBeforeApplied,
|
|
3517
3504
|
onAfterApplied: t.onAfterApplied
|
|
3518
|
-
}), new
|
|
3505
|
+
}), new tr(this.win, this.step);
|
|
3519
3506
|
}
|
|
3520
3507
|
static configure(e, t, o) {
|
|
3521
3508
|
new pe(e, t, o);
|
|
@@ -3564,7 +3551,7 @@ class we {
|
|
|
3564
3551
|
);
|
|
3565
3552
|
}
|
|
3566
3553
|
}
|
|
3567
|
-
class
|
|
3554
|
+
class ye {
|
|
3568
3555
|
constructor(e, t, o, s, n) {
|
|
3569
3556
|
i(this, "configurator");
|
|
3570
3557
|
i(this, "selectionHandledTag", se);
|
|
@@ -3598,7 +3585,7 @@ class fe {
|
|
|
3598
3585
|
), this.canvas.graph.onAfterEdgeAdded.subscribe(this.onAfterEdgeAdded), this.canvas.graph.onBeforeEdgeRemoved.subscribe(this.onBeforeEdgeRemoved), this.canvas.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.reset);
|
|
3599
3586
|
}
|
|
3600
3587
|
static configure(e, t, o, s, n) {
|
|
3601
|
-
new
|
|
3588
|
+
new ye(
|
|
3602
3589
|
e,
|
|
3603
3590
|
t,
|
|
3604
3591
|
o,
|
|
@@ -3607,7 +3594,7 @@ class fe {
|
|
|
3607
3594
|
);
|
|
3608
3595
|
}
|
|
3609
3596
|
}
|
|
3610
|
-
class
|
|
3597
|
+
class fe {
|
|
3611
3598
|
constructor(e, t, o, s, n, a) {
|
|
3612
3599
|
i(this, "configurator");
|
|
3613
3600
|
i(this, "onCanvasSelected");
|
|
@@ -3628,7 +3615,7 @@ class ye {
|
|
|
3628
3615
|
});
|
|
3629
3616
|
}
|
|
3630
3617
|
static configure(e, t, o, s, n, a) {
|
|
3631
|
-
new
|
|
3618
|
+
new fe(
|
|
3632
3619
|
e,
|
|
3633
3620
|
t,
|
|
3634
3621
|
o,
|
|
@@ -3638,30 +3625,30 @@ class ye {
|
|
|
3638
3625
|
);
|
|
3639
3626
|
}
|
|
3640
3627
|
}
|
|
3641
|
-
const
|
|
3628
|
+
const or = () => {
|
|
3642
3629
|
const r = document.createElement("div");
|
|
3643
3630
|
return r.style.width = "100%", r.style.height = "100%", r.style.position = "relative", r;
|
|
3644
3631
|
}, Q = () => {
|
|
3645
3632
|
const r = document.createElement("div");
|
|
3646
3633
|
return r.style.position = "absolute", r.style.inset = "0", r;
|
|
3647
|
-
},
|
|
3634
|
+
}, Re = () => {
|
|
3648
3635
|
const r = Q();
|
|
3649
3636
|
return r.style.pointerEvents = "none", r;
|
|
3650
3637
|
};
|
|
3651
|
-
class
|
|
3638
|
+
class sr {
|
|
3652
3639
|
constructor(e) {
|
|
3653
3640
|
i(this, "background", Q());
|
|
3654
3641
|
i(this, "main", Q());
|
|
3655
|
-
i(this, "overlayConnectablePorts",
|
|
3656
|
-
i(this, "overlayDraggableEdges",
|
|
3657
|
-
i(this, "host",
|
|
3642
|
+
i(this, "overlayConnectablePorts", Re());
|
|
3643
|
+
i(this, "overlayDraggableEdges", Re());
|
|
3644
|
+
i(this, "host", or());
|
|
3658
3645
|
this.element = e, this.element.appendChild(this.host), this.host.appendChild(this.background), this.host.appendChild(this.main), this.host.appendChild(this.overlayConnectablePorts), this.host.appendChild(this.overlayDraggableEdges);
|
|
3659
3646
|
}
|
|
3660
3647
|
destroy() {
|
|
3661
3648
|
this.host.removeChild(this.background), this.host.removeChild(this.main), this.host.removeChild(this.overlayConnectablePorts), this.host.removeChild(this.overlayDraggableEdges), this.element.removeChild(this.host);
|
|
3662
3649
|
}
|
|
3663
3650
|
}
|
|
3664
|
-
const
|
|
3651
|
+
const P = Object.freeze({
|
|
3665
3652
|
seed: "HTMLGraph is awesome",
|
|
3666
3653
|
maxTimeDeltaSec: 0.01,
|
|
3667
3654
|
nodeCharge: 1e5,
|
|
@@ -3675,23 +3662,23 @@ const b = Object.freeze({
|
|
|
3675
3662
|
nodeForceCoefficient: 1,
|
|
3676
3663
|
barnesHutAreaRadiusThreshold: 0.01,
|
|
3677
3664
|
barnesHutTheta: 1
|
|
3678
|
-
}),
|
|
3665
|
+
}), I = Object.freeze({
|
|
3679
3666
|
mouseDownEventVerifier: (r) => r.button === 0,
|
|
3680
3667
|
mouseUpEventVerifier: (r) => r.button === 0,
|
|
3681
3668
|
movementThreshold: 10
|
|
3682
|
-
}),
|
|
3683
|
-
},
|
|
3669
|
+
}), N = () => {
|
|
3670
|
+
}, et = (r, e, t) => r === "closest-connectable-port" ? new De(
|
|
3684
3671
|
e,
|
|
3685
3672
|
t
|
|
3686
|
-
) : r === "nearest-connectable-port" ? new
|
|
3673
|
+
) : r === "nearest-connectable-port" ? new De(
|
|
3687
3674
|
e,
|
|
3688
3675
|
t
|
|
3689
|
-
) : new
|
|
3676
|
+
) : new Kt(r), ve = (r) => {
|
|
3690
3677
|
if (typeof r == "function")
|
|
3691
3678
|
return r;
|
|
3692
3679
|
switch (r.type) {
|
|
3693
3680
|
case "straight":
|
|
3694
|
-
return () => new
|
|
3681
|
+
return () => new zt({
|
|
3695
3682
|
color: r.color,
|
|
3696
3683
|
width: r.width,
|
|
3697
3684
|
arrowLength: r.arrowLength,
|
|
@@ -3705,7 +3692,7 @@ const b = Object.freeze({
|
|
|
3705
3692
|
detourDirection: r.detourDirection
|
|
3706
3693
|
});
|
|
3707
3694
|
case "horizontal":
|
|
3708
|
-
return () => new
|
|
3695
|
+
return () => new Wt({
|
|
3709
3696
|
color: r.color,
|
|
3710
3697
|
width: r.width,
|
|
3711
3698
|
arrowLength: r.arrowLength,
|
|
@@ -3718,7 +3705,7 @@ const b = Object.freeze({
|
|
|
3718
3705
|
detourDistance: r.detourDistance
|
|
3719
3706
|
});
|
|
3720
3707
|
case "vertical":
|
|
3721
|
-
return () => new
|
|
3708
|
+
return () => new kt({
|
|
3722
3709
|
color: r.color,
|
|
3723
3710
|
width: r.width,
|
|
3724
3711
|
arrowLength: r.arrowLength,
|
|
@@ -3731,7 +3718,7 @@ const b = Object.freeze({
|
|
|
3731
3718
|
detourDistance: r.detourDistance
|
|
3732
3719
|
});
|
|
3733
3720
|
case "direct":
|
|
3734
|
-
return () => new
|
|
3721
|
+
return () => new Xe({
|
|
3735
3722
|
color: r.color,
|
|
3736
3723
|
width: r.width,
|
|
3737
3724
|
arrowLength: r.arrowLength,
|
|
@@ -3742,7 +3729,7 @@ const b = Object.freeze({
|
|
|
3742
3729
|
targetOffset: r.targetOffset
|
|
3743
3730
|
});
|
|
3744
3731
|
default:
|
|
3745
|
-
return () => new
|
|
3732
|
+
return () => new Ot({
|
|
3746
3733
|
color: r.color,
|
|
3747
3734
|
width: r.width,
|
|
3748
3735
|
arrowLength: r.arrowLength,
|
|
@@ -3756,9 +3743,9 @@ const b = Object.freeze({
|
|
|
3756
3743
|
detourDirection: r.detourDirection
|
|
3757
3744
|
});
|
|
3758
3745
|
}
|
|
3759
|
-
},
|
|
3760
|
-
var
|
|
3761
|
-
const e = r.nodeDragVerifier ?? (() => !0), t = r.moveOnTop !== !1, o = r.moveEdgesOnTop !== !1 && t, s = (
|
|
3746
|
+
}, ir = (r) => {
|
|
3747
|
+
var u, l, g, p, w, y;
|
|
3748
|
+
const e = r.nodeDragVerifier ?? (() => !0), t = r.moveOnTop !== !1, o = r.moveEdgesOnTop !== !1 && t, s = (u = r.mouse) == null ? void 0 : u.dragCursor, n = s !== void 0 ? s : "grab", a = (l = r.mouse) == null ? void 0 : l.mouseDownEventVerifier, h = a !== void 0 ? a : (f) => f.button === 0, d = (g = r.mouse) == null ? void 0 : g.mouseUpEventVerifier, c = d !== void 0 ? d : (f) => f.button === 0;
|
|
3762
3749
|
return {
|
|
3763
3750
|
moveOnTop: t,
|
|
3764
3751
|
moveEdgesOnTop: o,
|
|
@@ -3766,43 +3753,43 @@ const b = Object.freeze({
|
|
|
3766
3753
|
gridSize: r.gridSize ?? null,
|
|
3767
3754
|
mouseDownEventVerifier: h,
|
|
3768
3755
|
mouseUpEventVerifier: c,
|
|
3769
|
-
onNodeDragStarted: ((p = r.events) == null ? void 0 : p.onNodeDragStarted) ??
|
|
3770
|
-
onNodeDrag: ((w = r.events) == null ? void 0 : w.onNodeDrag) ??
|
|
3756
|
+
onNodeDragStarted: ((p = r.events) == null ? void 0 : p.onNodeDragStarted) ?? N,
|
|
3757
|
+
onNodeDrag: ((w = r.events) == null ? void 0 : w.onNodeDrag) ?? N,
|
|
3771
3758
|
nodeDragVerifier: e,
|
|
3772
|
-
onNodeDragFinished: ((
|
|
3759
|
+
onNodeDragFinished: ((y = r.events) == null ? void 0 : y.onNodeDragFinished) ?? N
|
|
3773
3760
|
};
|
|
3774
|
-
},
|
|
3761
|
+
}, nr = (r) => {
|
|
3775
3762
|
const e = r.minX !== null ? r.minX : -1 / 0, t = r.maxX !== null ? r.maxX : 1 / 0, o = r.minY !== null ? r.minY : -1 / 0, s = r.maxY !== null ? r.maxY : 1 / 0;
|
|
3776
3763
|
return (n) => {
|
|
3777
3764
|
let a = n.nextTransform.x, h = n.nextTransform.y;
|
|
3778
3765
|
a < e && a < n.prevTransform.x && (a = Math.min(n.prevTransform.x, e));
|
|
3779
3766
|
const d = n.canvasWidth * n.prevTransform.scale, c = t - d;
|
|
3780
3767
|
a > c && a > n.prevTransform.x && (a = Math.max(n.prevTransform.x, c)), h < o && h < n.prevTransform.y && (h = Math.min(n.prevTransform.y, o));
|
|
3781
|
-
const
|
|
3782
|
-
return h >
|
|
3768
|
+
const u = n.canvasHeight * n.prevTransform.scale, l = s - u;
|
|
3769
|
+
return h > l && h > n.prevTransform.y && (h = Math.max(n.prevTransform.y, l)), { scale: n.nextTransform.scale, x: a, y: h };
|
|
3783
3770
|
};
|
|
3784
|
-
},
|
|
3771
|
+
}, ar = (r) => {
|
|
3785
3772
|
const e = r.maxContentScale, t = r.minContentScale, o = e !== null ? 1 / e : 0, s = t !== null ? 1 / t : 1 / 0;
|
|
3786
3773
|
return (n) => {
|
|
3787
3774
|
const a = n.prevTransform, h = n.nextTransform;
|
|
3788
|
-
let d = h.scale, c = h.x,
|
|
3775
|
+
let d = h.scale, c = h.x, u = h.y;
|
|
3789
3776
|
if (h.scale > s && h.scale > a.scale) {
|
|
3790
|
-
d = Math.max(a.scale, s), c = a.x,
|
|
3791
|
-
const
|
|
3792
|
-
c = a.x + (h.x - a.x) *
|
|
3777
|
+
d = Math.max(a.scale, s), c = a.x, u = a.y;
|
|
3778
|
+
const l = (d - a.scale) / (h.scale - a.scale);
|
|
3779
|
+
c = a.x + (h.x - a.x) * l, u = a.y + (h.y - a.y) * l;
|
|
3793
3780
|
}
|
|
3794
3781
|
if (h.scale < o && h.scale < a.scale) {
|
|
3795
|
-
d = Math.min(a.scale, o), c = a.x,
|
|
3796
|
-
const
|
|
3797
|
-
c = a.x + (h.x - a.x) *
|
|
3782
|
+
d = Math.min(a.scale, o), c = a.x, u = a.y;
|
|
3783
|
+
const l = (d - a.scale) / (h.scale - a.scale);
|
|
3784
|
+
c = a.x + (h.x - a.x) * l, u = a.y + (h.y - a.y) * l;
|
|
3798
3785
|
}
|
|
3799
3786
|
return {
|
|
3800
3787
|
scale: d,
|
|
3801
3788
|
x: c,
|
|
3802
|
-
y:
|
|
3789
|
+
y: u
|
|
3803
3790
|
};
|
|
3804
3791
|
};
|
|
3805
|
-
},
|
|
3792
|
+
}, hr = (r) => (e) => r.reduce(
|
|
3806
3793
|
(t, o) => o({
|
|
3807
3794
|
prevTransform: e.prevTransform,
|
|
3808
3795
|
nextTransform: t,
|
|
@@ -3810,59 +3797,59 @@ const b = Object.freeze({
|
|
|
3810
3797
|
canvasHeight: e.canvasHeight
|
|
3811
3798
|
}),
|
|
3812
3799
|
e.nextTransform
|
|
3813
|
-
),
|
|
3800
|
+
), Le = (r) => {
|
|
3814
3801
|
if (typeof r == "function")
|
|
3815
3802
|
return r;
|
|
3816
3803
|
switch (r.type) {
|
|
3817
3804
|
case "scale-limit":
|
|
3818
|
-
return
|
|
3805
|
+
return ar({
|
|
3819
3806
|
minContentScale: r.minContentScale ?? 0,
|
|
3820
3807
|
maxContentScale: r.maxContentScale ?? 1 / 0
|
|
3821
3808
|
});
|
|
3822
3809
|
case "shift-limit":
|
|
3823
|
-
return
|
|
3810
|
+
return nr({
|
|
3824
3811
|
minX: r.minX ?? -1 / 0,
|
|
3825
3812
|
maxX: r.maxX ?? 1 / 0,
|
|
3826
3813
|
minY: r.minY ?? -1 / 0,
|
|
3827
3814
|
maxY: r.maxY ?? 1 / 0
|
|
3828
3815
|
});
|
|
3829
3816
|
}
|
|
3830
|
-
},
|
|
3831
|
-
var g, p, w, f,
|
|
3817
|
+
}, Ve = (r) => {
|
|
3818
|
+
var g, p, w, y, f, m, E, A, T, M, L, V;
|
|
3832
3819
|
const e = (g = r == null ? void 0 : r.scale) == null ? void 0 : g.mouseWheelSensitivity, t = e !== void 0 ? e : 1.2, o = r == null ? void 0 : r.transformPreprocessor;
|
|
3833
3820
|
let s;
|
|
3834
|
-
o !== void 0 ? Array.isArray(o) ? s =
|
|
3821
|
+
o !== void 0 ? Array.isArray(o) ? s = hr(
|
|
3835
3822
|
o.map(
|
|
3836
|
-
(
|
|
3823
|
+
(D) => Le(D)
|
|
3837
3824
|
)
|
|
3838
|
-
) : s =
|
|
3839
|
-
const n = ((p = r == null ? void 0 : r.shift) == null ? void 0 : p.cursor) !== void 0 ? r.shift.cursor : "grab", a = (w = r == null ? void 0 : r.shift) == null ? void 0 : w.mouseDownEventVerifier, h = a !== void 0 ? a : (
|
|
3825
|
+
) : s = Le(o) : s = (D) => D.nextTransform;
|
|
3826
|
+
const n = ((p = r == null ? void 0 : r.shift) == null ? void 0 : p.cursor) !== void 0 ? r.shift.cursor : "grab", a = (w = r == null ? void 0 : r.shift) == null ? void 0 : w.mouseDownEventVerifier, h = a !== void 0 ? a : (D) => D.button === 0, d = (y = r == null ? void 0 : r.shift) == null ? void 0 : y.mouseUpEventVerifier, c = d !== void 0 ? d : (D) => D.button === 0, u = (f = r == null ? void 0 : r.scale) == null ? void 0 : f.mouseWheelEventVerifier, l = u !== void 0 ? u : () => !0;
|
|
3840
3827
|
return {
|
|
3841
3828
|
wheelSensitivity: t,
|
|
3842
|
-
onTransformStarted: ((
|
|
3843
|
-
onTransformFinished: ((
|
|
3844
|
-
onBeforeTransformChange: ((
|
|
3845
|
-
onTransformChange: ((T = r == null ? void 0 : r.events) == null ? void 0 : T.onTransformChange) ??
|
|
3829
|
+
onTransformStarted: ((m = r == null ? void 0 : r.events) == null ? void 0 : m.onTransformStarted) ?? N,
|
|
3830
|
+
onTransformFinished: ((E = r == null ? void 0 : r.events) == null ? void 0 : E.onTransformFinished) ?? N,
|
|
3831
|
+
onBeforeTransformChange: ((A = r == null ? void 0 : r.events) == null ? void 0 : A.onBeforeTransformChange) ?? N,
|
|
3832
|
+
onTransformChange: ((T = r == null ? void 0 : r.events) == null ? void 0 : T.onTransformChange) ?? N,
|
|
3846
3833
|
transformPreprocessor: s,
|
|
3847
3834
|
shiftCursor: n,
|
|
3848
3835
|
mouseDownEventVerifier: h,
|
|
3849
3836
|
mouseUpEventVerifier: c,
|
|
3850
|
-
mouseWheelEventVerifier:
|
|
3851
|
-
scaleWheelFinishTimeout: ((
|
|
3852
|
-
onResizeTransformStarted: ((
|
|
3853
|
-
onResizeTransformFinished: ((
|
|
3837
|
+
mouseWheelEventVerifier: l,
|
|
3838
|
+
scaleWheelFinishTimeout: ((M = r == null ? void 0 : r.scale) == null ? void 0 : M.wheelFinishTimeout) ?? 500,
|
|
3839
|
+
onResizeTransformStarted: ((L = r == null ? void 0 : r.events) == null ? void 0 : L.onResizeTransformStarted) ?? N,
|
|
3840
|
+
onResizeTransformFinished: ((V = r == null ? void 0 : r.events) == null ? void 0 : V.onResizeTransformFinished) ?? N
|
|
3854
3841
|
};
|
|
3855
|
-
},
|
|
3842
|
+
}, dr = (r, e) => {
|
|
3856
3843
|
const t = document.createElementNS(
|
|
3857
3844
|
"http://www.w3.org/2000/svg",
|
|
3858
3845
|
"circle"
|
|
3859
3846
|
);
|
|
3860
3847
|
return t.setAttribute("cx", "0"), t.setAttribute("cy", "0"), t.setAttribute("r", `${r}`), t.setAttribute("fill", `${e}`), t;
|
|
3861
|
-
},
|
|
3848
|
+
}, cr = (r) => r instanceof SVGElement ? r : dr(
|
|
3862
3849
|
(r == null ? void 0 : r.radius) ?? 1.5,
|
|
3863
3850
|
(r == null ? void 0 : r.color) ?? "#d8d8d8"
|
|
3864
|
-
),
|
|
3865
|
-
const e = r.tileDimensions, t = (e == null ? void 0 : e.width) ?? 25, o = (e == null ? void 0 : e.height) ?? 25, s =
|
|
3851
|
+
), lr = (r) => {
|
|
3852
|
+
const e = r.tileDimensions, t = (e == null ? void 0 : e.width) ?? 25, o = (e == null ? void 0 : e.height) ?? 25, s = cr(r.renderer ?? {});
|
|
3866
3853
|
return {
|
|
3867
3854
|
tileWidth: t,
|
|
3868
3855
|
tileHeight: o,
|
|
@@ -3874,13 +3861,13 @@ const b = Object.freeze({
|
|
|
3874
3861
|
connectionPreprocessor: (r) => r,
|
|
3875
3862
|
connectionAllowedVerifier: () => !0,
|
|
3876
3863
|
mouseEventVerifier: (r) => r.button === 0
|
|
3877
|
-
}),
|
|
3864
|
+
}), ur = (r, e, t) => {
|
|
3878
3865
|
var s, n, a;
|
|
3879
3866
|
const o = r.connectionAllowedVerifier ?? $.connectionAllowedVerifier;
|
|
3880
3867
|
return {
|
|
3881
3868
|
connectionTypeResolver: r.connectionTypeResolver ?? $.connectionTypeResolver,
|
|
3882
3869
|
connectionAllowedVerifier: o,
|
|
3883
|
-
draggingPortDirectionResolver:
|
|
3870
|
+
draggingPortDirectionResolver: et(
|
|
3884
3871
|
r.dragPortDirection,
|
|
3885
3872
|
t,
|
|
3886
3873
|
o
|
|
@@ -3889,9 +3876,9 @@ const b = Object.freeze({
|
|
|
3889
3876
|
connectionPreprocessor: r.connectionPreprocessor ?? $.connectionPreprocessor,
|
|
3890
3877
|
mouseDownEventVerifier: r.mouseDownEventVerifier ?? $.mouseEventVerifier,
|
|
3891
3878
|
mouseUpEventVerifier: r.mouseUpEventVerifier ?? $.mouseEventVerifier,
|
|
3892
|
-
onAfterEdgeCreated: ((s = r.events) == null ? void 0 : s.onAfterEdgeCreated) ??
|
|
3893
|
-
onEdgeCreationInterrupted: ((n = r.events) == null ? void 0 : n.onEdgeCreationInterrupted) ??
|
|
3894
|
-
onEdgeCreationPrevented: ((a = r.events) == null ? void 0 : a.onEdgeCreationPrevented) ??
|
|
3879
|
+
onAfterEdgeCreated: ((s = r.events) == null ? void 0 : s.onAfterEdgeCreated) ?? N,
|
|
3880
|
+
onEdgeCreationInterrupted: ((n = r.events) == null ? void 0 : n.onEdgeCreationInterrupted) ?? N,
|
|
3881
|
+
onEdgeCreationPrevented: ((a = r.events) == null ? void 0 : a.onEdgeCreationPrevented) ?? N
|
|
3895
3882
|
};
|
|
3896
3883
|
}, z = Object.freeze({
|
|
3897
3884
|
connectionAllowedVerifier: () => !0,
|
|
@@ -3899,7 +3886,7 @@ const b = Object.freeze({
|
|
|
3899
3886
|
// TODO: remove ctrl key
|
|
3900
3887
|
mouseDownEventVerifier: (r) => r.button === 0 && r.ctrlKey,
|
|
3901
3888
|
mouseUpEventVerifier: (r) => r.button === 0
|
|
3902
|
-
}),
|
|
3889
|
+
}), gr = (r, e) => {
|
|
3903
3890
|
var s, n, a;
|
|
3904
3891
|
const t = (h) => {
|
|
3905
3892
|
const d = e.getPortAdjacentEdgeIds(h);
|
|
@@ -3912,32 +3899,32 @@ const b = Object.freeze({
|
|
|
3912
3899
|
mouseUpEventVerifier: r.mouseUpEventVerifier ?? z.mouseUpEventVerifier,
|
|
3913
3900
|
draggingEdgeResolver: r.draggingEdgeResolver ?? t,
|
|
3914
3901
|
draggingEdgeShapeFactory: r.draggingEdgeShape !== void 0 ? ve(r.draggingEdgeShape) : null,
|
|
3915
|
-
onAfterEdgeReattached: ((s = r.events) == null ? void 0 : s.onAfterEdgeReattached) ??
|
|
3916
|
-
onEdgeReattachInterrupted: ((n = r.events) == null ? void 0 : n.onEdgeReattachInterrupted) ??
|
|
3917
|
-
onEdgeReattachPrevented: ((a = r.events) == null ? void 0 : a.onEdgeReattachPrevented) ??
|
|
3918
|
-
draggingPortDirectionResolver:
|
|
3902
|
+
onAfterEdgeReattached: ((s = r.events) == null ? void 0 : s.onAfterEdgeReattached) ?? N,
|
|
3903
|
+
onEdgeReattachInterrupted: ((n = r.events) == null ? void 0 : n.onEdgeReattachInterrupted) ?? N,
|
|
3904
|
+
onEdgeReattachPrevented: ((a = r.events) == null ? void 0 : a.onEdgeReattachPrevented) ?? N,
|
|
3905
|
+
draggingPortDirectionResolver: et(
|
|
3919
3906
|
r.dragPortDirection,
|
|
3920
3907
|
e,
|
|
3921
3908
|
o
|
|
3922
3909
|
)
|
|
3923
3910
|
};
|
|
3924
|
-
},
|
|
3911
|
+
}, pr = (r) => ({
|
|
3925
3912
|
nodeVerticalRadius: r.nodeContainingRadius.vertical,
|
|
3926
3913
|
nodeHorizontalRadius: r.nodeContainingRadius.horizontal
|
|
3927
|
-
}),
|
|
3914
|
+
}), wr = (r) => {
|
|
3928
3915
|
var e, t;
|
|
3929
3916
|
return {
|
|
3930
|
-
onAfterNodeDetached: ((e = r == null ? void 0 : r.events) == null ? void 0 : e.onAfterNodeDetached) ??
|
|
3931
|
-
onBeforeNodeAttached: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeNodeAttached) ??
|
|
3917
|
+
onAfterNodeDetached: ((e = r == null ? void 0 : r.events) == null ? void 0 : e.onAfterNodeDetached) ?? N,
|
|
3918
|
+
onBeforeNodeAttached: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeNodeAttached) ?? N
|
|
3932
3919
|
};
|
|
3933
3920
|
};
|
|
3934
|
-
class
|
|
3921
|
+
class yr extends Error {
|
|
3935
3922
|
constructor() {
|
|
3936
3923
|
super(...arguments);
|
|
3937
3924
|
i(this, "name", "CanvasBuilderError");
|
|
3938
3925
|
}
|
|
3939
3926
|
}
|
|
3940
|
-
class
|
|
3927
|
+
class tt {
|
|
3941
3928
|
constructor(e, t, o) {
|
|
3942
3929
|
i(this, "dt");
|
|
3943
3930
|
i(this, "nodeMass");
|
|
@@ -3970,12 +3957,12 @@ class qe {
|
|
|
3970
3957
|
const o = this.graph.getEdge(t), s = this.graph.getPort(o.from), n = this.graph.getPort(o.to), a = this.currentCoords.get(s.nodeId), h = this.currentCoords.get(n.nodeId), d = this.distanceVectorGenerator.create(
|
|
3971
3958
|
a,
|
|
3972
3959
|
h
|
|
3973
|
-
),
|
|
3974
|
-
p.x +=
|
|
3960
|
+
), u = (d.d - this.edgeEquilibriumLength) * this.edgeStiffness, l = d.ex * u, g = d.ey * u, p = e.get(s.nodeId), w = e.get(n.nodeId);
|
|
3961
|
+
p.x += l, p.y += g, w.x -= l, w.y -= g;
|
|
3975
3962
|
});
|
|
3976
3963
|
}
|
|
3977
3964
|
}
|
|
3978
|
-
class
|
|
3965
|
+
class rt {
|
|
3979
3966
|
constructor(e) {
|
|
3980
3967
|
i(this, "PI2", 2 * Math.PI);
|
|
3981
3968
|
this.rand = e;
|
|
@@ -3994,7 +3981,7 @@ class et {
|
|
|
3994
3981
|
return { ex: h, ey: d, d: a };
|
|
3995
3982
|
}
|
|
3996
3983
|
}
|
|
3997
|
-
const
|
|
3984
|
+
const ot = (r) => {
|
|
3998
3985
|
if (r.distance === 0)
|
|
3999
3986
|
return r.maxForce;
|
|
4000
3987
|
const e = r.coefficient * (r.sourceCharge * r.targetCharge / (r.distance * r.distance));
|
|
@@ -4012,22 +3999,22 @@ class fr {
|
|
|
4012
3999
|
for (let n = 0; n < s; n++) {
|
|
4013
4000
|
const a = o[n];
|
|
4014
4001
|
for (let h = n + 1; h < s; h++) {
|
|
4015
|
-
const d = o[h], c = e.get(a),
|
|
4002
|
+
const d = o[h], c = e.get(a), u = e.get(d), l = this.distanceVectorGenerator.create(
|
|
4016
4003
|
c,
|
|
4017
|
-
|
|
4018
|
-
), g =
|
|
4004
|
+
u
|
|
4005
|
+
), g = ot({
|
|
4019
4006
|
coefficient: 1,
|
|
4020
4007
|
sourceCharge: this.nodeCharge,
|
|
4021
4008
|
targetCharge: this.nodeCharge,
|
|
4022
|
-
distance:
|
|
4009
|
+
distance: l.d,
|
|
4023
4010
|
maxForce: this.maxForce
|
|
4024
|
-
}), p = g *
|
|
4025
|
-
|
|
4011
|
+
}), p = g * l.ex, w = g * l.ey, y = t.get(a), f = t.get(d);
|
|
4012
|
+
y.x -= p, y.y -= w, f.x += p, f.y += w;
|
|
4026
4013
|
}
|
|
4027
4014
|
}
|
|
4028
4015
|
}
|
|
4029
4016
|
}
|
|
4030
|
-
const
|
|
4017
|
+
const vr = (r) => {
|
|
4031
4018
|
if (r.size === 0)
|
|
4032
4019
|
return {
|
|
4033
4020
|
centerX: 0,
|
|
@@ -4045,7 +4032,7 @@ const yr = (r) => {
|
|
|
4045
4032
|
radius: h / 2
|
|
4046
4033
|
};
|
|
4047
4034
|
};
|
|
4048
|
-
class
|
|
4035
|
+
class mr {
|
|
4049
4036
|
constructor(e) {
|
|
4050
4037
|
i(this, "root");
|
|
4051
4038
|
i(this, "leaves", /* @__PURE__ */ new Map());
|
|
@@ -4103,13 +4090,13 @@ class vr {
|
|
|
4103
4090
|
const { x: p, y: w } = this.coords.get(g);
|
|
4104
4091
|
p < t ? w < o ? d.add(g) : h.add(g) : w < o ? a.add(g) : n.add(g), e.nodeIds.delete(g);
|
|
4105
4092
|
});
|
|
4106
|
-
const
|
|
4093
|
+
const u = {
|
|
4107
4094
|
parent: e,
|
|
4108
4095
|
lb: null,
|
|
4109
4096
|
lt: null,
|
|
4110
4097
|
rb: null,
|
|
4111
4098
|
rt: null
|
|
4112
|
-
},
|
|
4099
|
+
}, l = [];
|
|
4113
4100
|
if (n.size > 0) {
|
|
4114
4101
|
const g = {
|
|
4115
4102
|
nodeIds: n,
|
|
@@ -4124,9 +4111,9 @@ class vr {
|
|
|
4124
4111
|
centerY: o + c,
|
|
4125
4112
|
radius: c
|
|
4126
4113
|
},
|
|
4127
|
-
...
|
|
4114
|
+
...u
|
|
4128
4115
|
};
|
|
4129
|
-
e.rt = g,
|
|
4116
|
+
e.rt = g, l.push(g);
|
|
4130
4117
|
}
|
|
4131
4118
|
if (a.size > 0) {
|
|
4132
4119
|
const g = {
|
|
@@ -4142,9 +4129,9 @@ class vr {
|
|
|
4142
4129
|
centerY: o - c,
|
|
4143
4130
|
radius: c
|
|
4144
4131
|
},
|
|
4145
|
-
...
|
|
4132
|
+
...u
|
|
4146
4133
|
};
|
|
4147
|
-
e.rb = g,
|
|
4134
|
+
e.rb = g, l.push(g);
|
|
4148
4135
|
}
|
|
4149
4136
|
if (h.size > 0) {
|
|
4150
4137
|
const g = {
|
|
@@ -4160,9 +4147,9 @@ class vr {
|
|
|
4160
4147
|
centerY: o + c,
|
|
4161
4148
|
radius: c
|
|
4162
4149
|
},
|
|
4163
|
-
...
|
|
4150
|
+
...u
|
|
4164
4151
|
};
|
|
4165
|
-
e.lt = g,
|
|
4152
|
+
e.lt = g, l.push(g);
|
|
4166
4153
|
}
|
|
4167
4154
|
if (d.size > 0) {
|
|
4168
4155
|
const g = {
|
|
@@ -4178,11 +4165,11 @@ class vr {
|
|
|
4178
4165
|
centerY: o - c,
|
|
4179
4166
|
radius: c
|
|
4180
4167
|
},
|
|
4181
|
-
...
|
|
4168
|
+
...u
|
|
4182
4169
|
};
|
|
4183
|
-
e.lb = g,
|
|
4170
|
+
e.lb = g, l.push(g);
|
|
4184
4171
|
}
|
|
4185
|
-
return
|
|
4172
|
+
return l;
|
|
4186
4173
|
}
|
|
4187
4174
|
setLeaf(e) {
|
|
4188
4175
|
e.totalMass = this.nodeMass * e.nodeIds.size, e.totalCharge = this.nodeCharge * e.nodeIds.size, e.chargeCenter = this.calculateLeafChargeCenter(e.nodeIds), e.nodeIds.forEach((t) => {
|
|
@@ -4202,7 +4189,7 @@ class vr {
|
|
|
4202
4189
|
}), { x: t / e.size, y: o / e.size };
|
|
4203
4190
|
}
|
|
4204
4191
|
}
|
|
4205
|
-
class
|
|
4192
|
+
class xr {
|
|
4206
4193
|
constructor(e) {
|
|
4207
4194
|
i(this, "areaRadiusThreshold");
|
|
4208
4195
|
i(this, "nodeMass");
|
|
@@ -4214,7 +4201,7 @@ class mr {
|
|
|
4214
4201
|
this.areaRadiusThreshold = e.areaRadiusThreshold, this.nodeMass = e.nodeMass, this.nodeCharge = e.nodeCharge, this.theta = e.theta, this.distanceVectorGenerator = e.distanceVectorGenerator, this.nodeForceCoefficient = e.nodeForceCoefficient, this.maxForce = e.maxForce;
|
|
4215
4202
|
}
|
|
4216
4203
|
apply(e, t) {
|
|
4217
|
-
const o =
|
|
4204
|
+
const o = vr(e), s = new mr({
|
|
4218
4205
|
box: o,
|
|
4219
4206
|
coords: e,
|
|
4220
4207
|
areaRadiusThreshold: this.areaRadiusThreshold,
|
|
@@ -4329,7 +4316,7 @@ class mr {
|
|
|
4329
4316
|
const t = this.distanceVectorGenerator.create(
|
|
4330
4317
|
e.sourceCoords,
|
|
4331
4318
|
e.targetCoords
|
|
4332
|
-
), o =
|
|
4319
|
+
), o = ot({
|
|
4333
4320
|
coefficient: this.nodeForceCoefficient,
|
|
4334
4321
|
sourceCharge: e.sourceCharge,
|
|
4335
4322
|
targetCharge: e.targetCharge,
|
|
@@ -4364,7 +4351,7 @@ class mr {
|
|
|
4364
4351
|
}
|
|
4365
4352
|
}
|
|
4366
4353
|
}
|
|
4367
|
-
const
|
|
4354
|
+
const st = (r) => r.theta !== 0 ? new xr({
|
|
4368
4355
|
nodeCharge: r.nodeCharge,
|
|
4369
4356
|
nodeForceCoefficient: r.nodeForceCoefficient,
|
|
4370
4357
|
distanceVectorGenerator: r.distanceVectorGenerator,
|
|
@@ -4378,7 +4365,7 @@ const rt = (r) => r.theta !== 0 ? new mr({
|
|
|
4378
4365
|
distanceVectorGenerator: r.distanceVectorGenerator,
|
|
4379
4366
|
maxForce: r.maxForce
|
|
4380
4367
|
});
|
|
4381
|
-
class
|
|
4368
|
+
class it {
|
|
4382
4369
|
constructor(e) {
|
|
4383
4370
|
i(this, "rand");
|
|
4384
4371
|
i(this, "sparsity");
|
|
@@ -4386,17 +4373,17 @@ class ot {
|
|
|
4386
4373
|
}
|
|
4387
4374
|
calculateCoordinates(e) {
|
|
4388
4375
|
const { graph: t, viewport: o } = e, s = /* @__PURE__ */ new Map(), n = t.getAllNodeIds().filter((w) => {
|
|
4389
|
-
const
|
|
4390
|
-
return
|
|
4391
|
-
}), a = Math.sqrt(n.length) * this.sparsity, { width: h, height: d } = o.getDimensions(), c = { x: h / 2, y: d / 2 },
|
|
4392
|
-
x:
|
|
4393
|
-
y:
|
|
4376
|
+
const y = t.getNode(w);
|
|
4377
|
+
return y.x === null || y.y === null;
|
|
4378
|
+
}), a = Math.sqrt(n.length) * this.sparsity, { width: h, height: d } = o.getDimensions(), c = { x: h / 2, y: d / 2 }, u = o.createContentCoords(c), l = a / 2, g = {
|
|
4379
|
+
x: u.x - l,
|
|
4380
|
+
y: u.y - l
|
|
4394
4381
|
};
|
|
4395
4382
|
return t.getAllNodeIds().forEach((w) => {
|
|
4396
|
-
const
|
|
4383
|
+
const y = t.getNode(w);
|
|
4397
4384
|
s.set(w, {
|
|
4398
|
-
x:
|
|
4399
|
-
y:
|
|
4385
|
+
x: y.x ?? g.x + a * this.rand(),
|
|
4386
|
+
y: y.y ?? g.y + a * this.rand()
|
|
4400
4387
|
});
|
|
4401
4388
|
}), s;
|
|
4402
4389
|
}
|
|
@@ -4412,7 +4399,7 @@ class Er {
|
|
|
4412
4399
|
i(this, "edgeEquilibriumLength");
|
|
4413
4400
|
i(this, "edgeStiffness");
|
|
4414
4401
|
i(this, "convergenceVelocity");
|
|
4415
|
-
this.maxIterations = e.maxIterations, this.dtSec = e.dtSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.convergenceVelocity = e.convergenceVelocity, this.distanceVectorGenerator = new
|
|
4402
|
+
this.maxIterations = e.maxIterations, this.dtSec = e.dtSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.convergenceVelocity = e.convergenceVelocity, this.distanceVectorGenerator = new rt(e.rand), this.nodeForcesApplicationStrategy = st({
|
|
4416
4403
|
distanceVectorGenerator: this.distanceVectorGenerator,
|
|
4417
4404
|
nodeCharge: e.nodeCharge,
|
|
4418
4405
|
maxForce: e.maxForce,
|
|
@@ -4420,7 +4407,7 @@ class Er {
|
|
|
4420
4407
|
theta: e.barnesHutTheta,
|
|
4421
4408
|
areaRadiusThreshold: e.barnesHutAreaRadiusThreshold,
|
|
4422
4409
|
nodeMass: e.nodeMass
|
|
4423
|
-
}), this.fillerLayoutAlgorithm = new
|
|
4410
|
+
}), this.fillerLayoutAlgorithm = new it({
|
|
4424
4411
|
rand: e.rand,
|
|
4425
4412
|
sparsity: e.edgeEquilibriumLength
|
|
4426
4413
|
});
|
|
@@ -4430,7 +4417,7 @@ class Er {
|
|
|
4430
4417
|
graph: t,
|
|
4431
4418
|
viewport: o
|
|
4432
4419
|
});
|
|
4433
|
-
for (let n = 0; n < this.maxIterations && !(new
|
|
4420
|
+
for (let n = 0; n < this.maxIterations && !(new tt(
|
|
4434
4421
|
t,
|
|
4435
4422
|
s,
|
|
4436
4423
|
{
|
|
@@ -4446,7 +4433,7 @@ class Er {
|
|
|
4446
4433
|
return s;
|
|
4447
4434
|
}
|
|
4448
4435
|
}
|
|
4449
|
-
class
|
|
4436
|
+
class Ar {
|
|
4450
4437
|
constructor(e, t) {
|
|
4451
4438
|
i(this, "forest", /* @__PURE__ */ new Set());
|
|
4452
4439
|
i(this, "remainingNodeIds");
|
|
@@ -4487,7 +4474,7 @@ class xr {
|
|
|
4487
4474
|
}
|
|
4488
4475
|
}
|
|
4489
4476
|
}
|
|
4490
|
-
class
|
|
4477
|
+
class Sr {
|
|
4491
4478
|
constructor(e) {
|
|
4492
4479
|
this.params = e;
|
|
4493
4480
|
}
|
|
@@ -4495,17 +4482,17 @@ class Ar {
|
|
|
4495
4482
|
let t = 0;
|
|
4496
4483
|
const o = [], s = e.length - 1, n = [];
|
|
4497
4484
|
e.forEach((h, d) => {
|
|
4498
|
-
if (t += this.params.spaceAroundRadius, h.forEach((c,
|
|
4499
|
-
n[
|
|
4485
|
+
if (t += this.params.spaceAroundRadius, h.forEach((c, u) => {
|
|
4486
|
+
n[u] === void 0 ? n[u] = {
|
|
4500
4487
|
start: t + c.start,
|
|
4501
4488
|
end: t + c.end
|
|
4502
|
-
} : n[
|
|
4489
|
+
} : n[u].end = t + c.end;
|
|
4503
4490
|
}), o.push(t), d !== s) {
|
|
4504
|
-
const c = e[d + 1],
|
|
4505
|
-
start:
|
|
4506
|
-
end:
|
|
4491
|
+
const c = e[d + 1], u = n.map((l) => ({
|
|
4492
|
+
start: l.start - t,
|
|
4493
|
+
end: l.end - t
|
|
4507
4494
|
}));
|
|
4508
|
-
t += this.calculateMaxDiff(
|
|
4495
|
+
t += this.calculateMaxDiff(u, c);
|
|
4509
4496
|
}
|
|
4510
4497
|
t += this.params.spaceAroundRadius;
|
|
4511
4498
|
});
|
|
@@ -4528,12 +4515,12 @@ class Ar {
|
|
|
4528
4515
|
return o - 2 * this.params.spaceAroundRadius;
|
|
4529
4516
|
}
|
|
4530
4517
|
}
|
|
4531
|
-
class
|
|
4518
|
+
class br {
|
|
4532
4519
|
constructor(e, t) {
|
|
4533
4520
|
i(this, "offsets", /* @__PURE__ */ new Map());
|
|
4534
4521
|
i(this, "treeSpans", /* @__PURE__ */ new Map());
|
|
4535
4522
|
this.tree = e;
|
|
4536
|
-
const o = t.spaceAroundRadius, s = new
|
|
4523
|
+
const o = t.spaceAroundRadius, s = new Sr({
|
|
4537
4524
|
spaceAroundRadius: o
|
|
4538
4525
|
});
|
|
4539
4526
|
[...this.tree.sequence].reverse().forEach((n) => {
|
|
@@ -4555,40 +4542,40 @@ class Sr {
|
|
|
4555
4542
|
return this.offsets;
|
|
4556
4543
|
}
|
|
4557
4544
|
}
|
|
4558
|
-
class
|
|
4545
|
+
class Pr {
|
|
4559
4546
|
constructor(e) {
|
|
4560
4547
|
this.params = e;
|
|
4561
4548
|
}
|
|
4562
4549
|
calculateCoordinates(e) {
|
|
4563
|
-
const t = /* @__PURE__ */ new Map(), s = new
|
|
4550
|
+
const t = /* @__PURE__ */ new Map(), s = new Ar(
|
|
4564
4551
|
e.graph,
|
|
4565
4552
|
this.params.nextLayerNodesResolver
|
|
4566
4553
|
).generate();
|
|
4567
4554
|
let n = 0;
|
|
4568
4555
|
return s.forEach((a) => {
|
|
4569
4556
|
t.set(a.root.nodeId, { x: n, y: 0 });
|
|
4570
|
-
const d = new
|
|
4557
|
+
const d = new br(a, {
|
|
4571
4558
|
spaceAroundRadius: this.params.layerSpace / 2
|
|
4572
4559
|
}).generate();
|
|
4573
4560
|
let c = [a.root];
|
|
4574
4561
|
for (; c.length > 0; ) {
|
|
4575
|
-
const
|
|
4576
|
-
n += this.params.layerWidth, c.forEach((
|
|
4577
|
-
|
|
4578
|
-
const p = t.get(
|
|
4562
|
+
const u = [];
|
|
4563
|
+
n += this.params.layerWidth, c.forEach((l) => {
|
|
4564
|
+
l.children.forEach((g) => {
|
|
4565
|
+
const p = t.get(l.nodeId).y;
|
|
4579
4566
|
t.set(g.nodeId, {
|
|
4580
4567
|
y: p + d.get(g.nodeId),
|
|
4581
4568
|
x: n
|
|
4582
|
-
}),
|
|
4569
|
+
}), u.push(g);
|
|
4583
4570
|
});
|
|
4584
|
-
}), c =
|
|
4571
|
+
}), c = u;
|
|
4585
4572
|
}
|
|
4586
4573
|
}), t.forEach((a, h) => {
|
|
4587
4574
|
t.set(h, this.params.transform(a));
|
|
4588
4575
|
}), t;
|
|
4589
4576
|
}
|
|
4590
4577
|
}
|
|
4591
|
-
const
|
|
4578
|
+
const Nr = (r) => {
|
|
4592
4579
|
const { graph: e, currentNodeId: t } = r, o = e.getNodeOutgoingEdgeIds(t).map((n) => {
|
|
4593
4580
|
const a = e.getEdge(n);
|
|
4594
4581
|
return e.getPort(a.to).nodeId;
|
|
@@ -4597,20 +4584,20 @@ const Pr = (r) => {
|
|
|
4597
4584
|
return e.getPort(a.from).nodeId;
|
|
4598
4585
|
});
|
|
4599
4586
|
return /* @__PURE__ */ new Set([...o, ...s]);
|
|
4600
|
-
},
|
|
4587
|
+
}, Cr = (r) => {
|
|
4601
4588
|
const { graph: e, currentNodeId: t } = r, o = e.getNodeOutgoingEdgeIds(t).map((s) => {
|
|
4602
4589
|
const n = e.getEdge(s);
|
|
4603
4590
|
return e.getPort(n.to).nodeId;
|
|
4604
4591
|
});
|
|
4605
4592
|
return new Set(o);
|
|
4606
|
-
},
|
|
4593
|
+
}, Tr = (r) => {
|
|
4607
4594
|
const { graph: e, currentNodeId: t } = r, o = e.getNodeIncomingEdgeIds(t).map((s) => {
|
|
4608
4595
|
const n = e.getEdge(s);
|
|
4609
4596
|
return e.getPort(n.from).nodeId;
|
|
4610
4597
|
});
|
|
4611
4598
|
return new Set(o);
|
|
4612
4599
|
};
|
|
4613
|
-
class
|
|
4600
|
+
class Mr {
|
|
4614
4601
|
constructor(e) {
|
|
4615
4602
|
i(this, "distanceVectorGenerator");
|
|
4616
4603
|
i(this, "nodeForcesApplicationStrategy");
|
|
@@ -4620,7 +4607,7 @@ class Tr {
|
|
|
4620
4607
|
i(this, "edgeEquilibriumLength");
|
|
4621
4608
|
i(this, "edgeStiffness");
|
|
4622
4609
|
i(this, "fillerLayoutAlgorithm");
|
|
4623
|
-
this.convergenceVelocity = e.convergenceVelocity, this.maxTimeDeltaSec = e.maxTimeDeltaSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.distanceVectorGenerator = new
|
|
4610
|
+
this.convergenceVelocity = e.convergenceVelocity, this.maxTimeDeltaSec = e.maxTimeDeltaSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.distanceVectorGenerator = new rt(e.rand), this.nodeForcesApplicationStrategy = st({
|
|
4624
4611
|
distanceVectorGenerator: this.distanceVectorGenerator,
|
|
4625
4612
|
nodeCharge: e.nodeCharge,
|
|
4626
4613
|
maxForce: e.maxForce,
|
|
@@ -4628,7 +4615,7 @@ class Tr {
|
|
|
4628
4615
|
theta: e.barnesHutTheta,
|
|
4629
4616
|
areaRadiusThreshold: e.barnesHutAreaRadiusThreshold,
|
|
4630
4617
|
nodeMass: e.nodeMass
|
|
4631
|
-
}), this.fillerLayoutAlgorithm = new
|
|
4618
|
+
}), this.fillerLayoutAlgorithm = new it({
|
|
4632
4619
|
rand: e.rand,
|
|
4633
4620
|
sparsity: e.edgeEquilibriumLength
|
|
4634
4621
|
});
|
|
@@ -4638,7 +4625,7 @@ class Tr {
|
|
|
4638
4625
|
graph: t,
|
|
4639
4626
|
viewport: o
|
|
4640
4627
|
});
|
|
4641
|
-
return new
|
|
4628
|
+
return new tt(
|
|
4642
4629
|
t,
|
|
4643
4630
|
n,
|
|
4644
4631
|
{
|
|
@@ -4650,65 +4637,65 @@ class Tr {
|
|
|
4650
4637
|
edgeStiffness: this.edgeStiffness
|
|
4651
4638
|
}
|
|
4652
4639
|
).apply() < this.convergenceVelocity && !t.getAllNodeIds().some((c) => {
|
|
4653
|
-
const
|
|
4654
|
-
return
|
|
4640
|
+
const u = t.getNode(c);
|
|
4641
|
+
return u.x === null || u.y === null;
|
|
4655
4642
|
}) ? /* @__PURE__ */ new Map() : n;
|
|
4656
4643
|
}
|
|
4657
4644
|
}
|
|
4658
|
-
const
|
|
4645
|
+
const nt = (r) => {
|
|
4659
4646
|
let e = 1779033703, t = 3144134277, o = 1013904242, s = 2773480762;
|
|
4660
4647
|
for (let n = 0, a; n < r.length; n++)
|
|
4661
4648
|
a = r.charCodeAt(n), e = t ^ Math.imul(e ^ a, 597399067), t = o ^ Math.imul(t ^ a, 2869860233), o = s ^ Math.imul(o ^ a, 951274213), s = e ^ Math.imul(s ^ a, 2716044179);
|
|
4662
4649
|
return e = Math.imul(o ^ e >>> 18, 597399067), t = Math.imul(s ^ t >>> 22, 2869860233), o = Math.imul(e ^ o >>> 17, 951274213), s = Math.imul(t ^ s >>> 19, 2716044179), e ^= t ^ o ^ s, t ^= e, o ^= e, s ^= e, [e >>> 0, t >>> 0, o >>> 0, s >>> 0];
|
|
4663
|
-
},
|
|
4650
|
+
}, at = (r, e, t, o) => function() {
|
|
4664
4651
|
r |= 0, e |= 0, t |= 0, o |= 0;
|
|
4665
4652
|
const s = (r + e | 0) + o | 0;
|
|
4666
4653
|
return o = o + 1 | 0, r = e ^ e >>> 9, e = t + (t << 3) | 0, t = t << 21 | t >>> 11, t = t + s | 0, (s >>> 0) / 4294967296;
|
|
4667
|
-
},
|
|
4654
|
+
}, Dr = (r) => {
|
|
4668
4655
|
var e, t;
|
|
4669
4656
|
switch (r == null ? void 0 : r.type) {
|
|
4670
4657
|
case "custom":
|
|
4671
4658
|
return r.instance;
|
|
4672
4659
|
default: {
|
|
4673
|
-
const o =
|
|
4674
|
-
return new
|
|
4660
|
+
const o = nt((r == null ? void 0 : r.seed) ?? P.seed), s = at(o[0], o[1], o[2], o[3]);
|
|
4661
|
+
return new Mr({
|
|
4675
4662
|
rand: s,
|
|
4676
|
-
maxTimeDeltaSec: (r == null ? void 0 : r.maxTimeDeltaSec) ??
|
|
4677
|
-
nodeCharge: (r == null ? void 0 : r.nodeCharge) ??
|
|
4678
|
-
nodeMass: (r == null ? void 0 : r.nodeMass) ??
|
|
4679
|
-
edgeEquilibriumLength: (r == null ? void 0 : r.edgeEquilibriumLength) ??
|
|
4680
|
-
edgeStiffness: (r == null ? void 0 : r.edgeStiffness) ??
|
|
4663
|
+
maxTimeDeltaSec: (r == null ? void 0 : r.maxTimeDeltaSec) ?? P.maxTimeDeltaSec,
|
|
4664
|
+
nodeCharge: (r == null ? void 0 : r.nodeCharge) ?? P.nodeCharge,
|
|
4665
|
+
nodeMass: (r == null ? void 0 : r.nodeMass) ?? P.nodeMass,
|
|
4666
|
+
edgeEquilibriumLength: (r == null ? void 0 : r.edgeEquilibriumLength) ?? P.edgeEquilibriumLength,
|
|
4667
|
+
edgeStiffness: (r == null ? void 0 : r.edgeStiffness) ?? P.edgeStiffness,
|
|
4681
4668
|
// TODO: rename no `minVelocity`
|
|
4682
|
-
convergenceVelocity: (r == null ? void 0 : r.convergenceVelocity) ??
|
|
4683
|
-
maxForce: (r == null ? void 0 : r.maxForce) ??
|
|
4684
|
-
nodeForceCoefficient: (r == null ? void 0 : r.nodeForceCoefficient) ??
|
|
4685
|
-
barnesHutTheta: ((e = r == null ? void 0 : r.barnesHut) == null ? void 0 : e.theta) ??
|
|
4686
|
-
barnesHutAreaRadiusThreshold: ((t = r == null ? void 0 : r.barnesHut) == null ? void 0 : t.areaRadiusThreshold) ??
|
|
4669
|
+
convergenceVelocity: (r == null ? void 0 : r.convergenceVelocity) ?? P.convergenceVelocity,
|
|
4670
|
+
maxForce: (r == null ? void 0 : r.maxForce) ?? P.maxForce,
|
|
4671
|
+
nodeForceCoefficient: (r == null ? void 0 : r.nodeForceCoefficient) ?? P.nodeForceCoefficient,
|
|
4672
|
+
barnesHutTheta: ((e = r == null ? void 0 : r.barnesHut) == null ? void 0 : e.theta) ?? P.barnesHutTheta,
|
|
4673
|
+
barnesHutAreaRadiusThreshold: ((t = r == null ? void 0 : r.barnesHut) == null ? void 0 : t.areaRadiusThreshold) ?? P.barnesHutAreaRadiusThreshold
|
|
4687
4674
|
});
|
|
4688
4675
|
}
|
|
4689
4676
|
}
|
|
4690
|
-
},
|
|
4677
|
+
}, Rr = {
|
|
4691
4678
|
staticNodeResolver: () => !1
|
|
4692
|
-
},
|
|
4679
|
+
}, Lr = (r) => {
|
|
4693
4680
|
var t, o;
|
|
4694
4681
|
return {
|
|
4695
|
-
algorithm:
|
|
4696
|
-
staticNodeResolver: (r == null ? void 0 : r.staticNodeResolver) ??
|
|
4697
|
-
onBeforeApplied: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeApplied) ??
|
|
4698
|
-
onAfterApplied: ((o = r == null ? void 0 : r.events) == null ? void 0 : o.onAfterApplied) ??
|
|
4682
|
+
algorithm: Dr((r == null ? void 0 : r.algorithm) ?? {}),
|
|
4683
|
+
staticNodeResolver: (r == null ? void 0 : r.staticNodeResolver) ?? Rr.staticNodeResolver,
|
|
4684
|
+
onBeforeApplied: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeApplied) ?? N,
|
|
4685
|
+
onAfterApplied: ((o = r == null ? void 0 : r.events) == null ? void 0 : o.onAfterApplied) ?? N
|
|
4699
4686
|
};
|
|
4700
|
-
},
|
|
4687
|
+
}, Vr = (r) => r instanceof q ? {
|
|
4701
4688
|
type: "trigger",
|
|
4702
4689
|
trigger: r
|
|
4703
4690
|
} : r === "topologyChangeMicrotask" ? {
|
|
4704
4691
|
type: "topologyChangeSchedule",
|
|
4705
|
-
schedule:
|
|
4692
|
+
schedule: Me
|
|
4706
4693
|
} : (r == null ? void 0 : r.type) === "topologyChangeMacrotask" ? {
|
|
4707
4694
|
type: "topologyChangeSchedule",
|
|
4708
|
-
schedule:
|
|
4695
|
+
schedule: Gt
|
|
4709
4696
|
} : {
|
|
4710
4697
|
type: "topologyChangeSchedule",
|
|
4711
|
-
schedule:
|
|
4698
|
+
schedule: Me
|
|
4712
4699
|
}, Z = Object.freeze({
|
|
4713
4700
|
staticNodeResolver: () => !1,
|
|
4714
4701
|
hierarchicalLayout: {
|
|
@@ -4722,7 +4709,7 @@ const st = (r) => {
|
|
|
4722
4709
|
d: r.d * e.a + r.e * e.d,
|
|
4723
4710
|
e: r.d * e.b + r.e * e.e,
|
|
4724
4711
|
f: r.d * e.c + r.e * e.f + r.f
|
|
4725
|
-
}),
|
|
4712
|
+
}), Ir = (r) => {
|
|
4726
4713
|
const { a: e, b: t, c: o, d: s, e: n, f: a } = r, h = e * n - t * s;
|
|
4727
4714
|
return {
|
|
4728
4715
|
a: n / h,
|
|
@@ -4733,7 +4720,7 @@ const st = (r) => {
|
|
|
4733
4720
|
f: (o * s - e * a) / h
|
|
4734
4721
|
};
|
|
4735
4722
|
};
|
|
4736
|
-
class
|
|
4723
|
+
class Fr {
|
|
4737
4724
|
resolve(e) {
|
|
4738
4725
|
if ("shift" in e)
|
|
4739
4726
|
return this.createShiftBaseMatrix(e.shift);
|
|
@@ -4777,7 +4764,7 @@ class Ir {
|
|
|
4777
4764
|
const o = k(
|
|
4778
4765
|
t,
|
|
4779
4766
|
e
|
|
4780
|
-
), s =
|
|
4767
|
+
), s = Ir(t);
|
|
4781
4768
|
return k(o, s);
|
|
4782
4769
|
}
|
|
4783
4770
|
createShiftBaseMatrix(e) {
|
|
@@ -4822,7 +4809,7 @@ class Ir {
|
|
|
4822
4809
|
};
|
|
4823
4810
|
}
|
|
4824
4811
|
}
|
|
4825
|
-
const
|
|
4812
|
+
const Ur = (r) => {
|
|
4826
4813
|
if (r === void 0)
|
|
4827
4814
|
return (s) => s;
|
|
4828
4815
|
if (typeof r == "function")
|
|
@@ -4836,7 +4823,7 @@ const Fr = (r) => {
|
|
|
4836
4823
|
e: 1,
|
|
4837
4824
|
f: 0
|
|
4838
4825
|
};
|
|
4839
|
-
const o = new
|
|
4826
|
+
const o = new Fr();
|
|
4840
4827
|
return e.forEach((s) => {
|
|
4841
4828
|
const n = o.resolve(s);
|
|
4842
4829
|
t = k(t, n);
|
|
@@ -4847,59 +4834,59 @@ const Fr = (r) => {
|
|
|
4847
4834
|
y: t.d * n + t.e * a + t.f
|
|
4848
4835
|
};
|
|
4849
4836
|
};
|
|
4850
|
-
},
|
|
4837
|
+
}, $r = (r) => {
|
|
4851
4838
|
if (typeof r == "function")
|
|
4852
4839
|
return r;
|
|
4853
4840
|
switch (r) {
|
|
4854
4841
|
case "outgoing":
|
|
4855
|
-
return Nr;
|
|
4856
|
-
case "incoming":
|
|
4857
4842
|
return Cr;
|
|
4843
|
+
case "incoming":
|
|
4844
|
+
return Tr;
|
|
4858
4845
|
default:
|
|
4859
|
-
return
|
|
4846
|
+
return Nr;
|
|
4860
4847
|
}
|
|
4861
|
-
},
|
|
4848
|
+
}, Br = (r) => {
|
|
4862
4849
|
var e, t;
|
|
4863
4850
|
switch (r == null ? void 0 : r.type) {
|
|
4864
4851
|
case "custom":
|
|
4865
4852
|
return r.instance;
|
|
4866
4853
|
case "hierarchical":
|
|
4867
|
-
return new
|
|
4854
|
+
return new Pr({
|
|
4868
4855
|
layerWidth: r.layerWidth ?? Z.hierarchicalLayout.layerWidth,
|
|
4869
4856
|
layerSpace: r.layerSpace ?? Z.hierarchicalLayout.layerSpace,
|
|
4870
|
-
transform:
|
|
4871
|
-
nextLayerNodesResolver:
|
|
4857
|
+
transform: Ur(r.transform),
|
|
4858
|
+
nextLayerNodesResolver: $r(
|
|
4872
4859
|
r.nextLayerNodesResolver
|
|
4873
4860
|
)
|
|
4874
4861
|
});
|
|
4875
4862
|
default: {
|
|
4876
|
-
const o =
|
|
4863
|
+
const o = nt((r == null ? void 0 : r.seed) ?? P.seed), s = at(o[0], o[1], o[2], o[3]);
|
|
4877
4864
|
return new Er({
|
|
4878
|
-
dtSec: (r == null ? void 0 : r.dtSec) ??
|
|
4879
|
-
maxIterations: (r == null ? void 0 : r.maxIterations) ??
|
|
4865
|
+
dtSec: (r == null ? void 0 : r.dtSec) ?? P.dtSec,
|
|
4866
|
+
maxIterations: (r == null ? void 0 : r.maxIterations) ?? P.maxIterations,
|
|
4880
4867
|
rand: s,
|
|
4881
|
-
nodeCharge: (r == null ? void 0 : r.nodeCharge) ??
|
|
4882
|
-
nodeMass: (r == null ? void 0 : r.nodeMass) ??
|
|
4883
|
-
edgeEquilibriumLength: (r == null ? void 0 : r.edgeEquilibriumLength) ??
|
|
4884
|
-
edgeStiffness: (r == null ? void 0 : r.edgeStiffness) ??
|
|
4885
|
-
convergenceVelocity: (r == null ? void 0 : r.convergenceVelocity) ??
|
|
4886
|
-
maxForce: (r == null ? void 0 : r.maxForce) ??
|
|
4887
|
-
nodeForceCoefficient: (r == null ? void 0 : r.nodeForceCoefficient) ??
|
|
4888
|
-
barnesHutTheta: ((e = r == null ? void 0 : r.barnesHut) == null ? void 0 : e.theta) ??
|
|
4889
|
-
barnesHutAreaRadiusThreshold: ((t = r == null ? void 0 : r.barnesHut) == null ? void 0 : t.areaRadiusThreshold) ??
|
|
4868
|
+
nodeCharge: (r == null ? void 0 : r.nodeCharge) ?? P.nodeCharge,
|
|
4869
|
+
nodeMass: (r == null ? void 0 : r.nodeMass) ?? P.nodeMass,
|
|
4870
|
+
edgeEquilibriumLength: (r == null ? void 0 : r.edgeEquilibriumLength) ?? P.edgeEquilibriumLength,
|
|
4871
|
+
edgeStiffness: (r == null ? void 0 : r.edgeStiffness) ?? P.edgeStiffness,
|
|
4872
|
+
convergenceVelocity: (r == null ? void 0 : r.convergenceVelocity) ?? P.convergenceVelocity,
|
|
4873
|
+
maxForce: (r == null ? void 0 : r.maxForce) ?? P.maxForce,
|
|
4874
|
+
nodeForceCoefficient: (r == null ? void 0 : r.nodeForceCoefficient) ?? P.nodeForceCoefficient,
|
|
4875
|
+
barnesHutTheta: ((e = r == null ? void 0 : r.barnesHut) == null ? void 0 : e.theta) ?? P.barnesHutTheta,
|
|
4876
|
+
barnesHutAreaRadiusThreshold: ((t = r == null ? void 0 : r.barnesHut) == null ? void 0 : t.areaRadiusThreshold) ?? P.barnesHutAreaRadiusThreshold
|
|
4890
4877
|
});
|
|
4891
4878
|
}
|
|
4892
4879
|
}
|
|
4893
|
-
},
|
|
4880
|
+
}, Or = (r) => {
|
|
4894
4881
|
var e, t;
|
|
4895
4882
|
return {
|
|
4896
|
-
algorithm:
|
|
4897
|
-
applyOn:
|
|
4883
|
+
algorithm: Br(r.algorithm),
|
|
4884
|
+
applyOn: Vr(r.applyOn),
|
|
4898
4885
|
staticNodeResolver: r.staticNodeResolver ?? Z.staticNodeResolver,
|
|
4899
|
-
onBeforeApplied: ((e = r.events) == null ? void 0 : e.onBeforeApplied) ??
|
|
4900
|
-
onAfterApplied: ((t = r.events) == null ? void 0 : t.onAfterApplied) ??
|
|
4886
|
+
onBeforeApplied: ((e = r.events) == null ? void 0 : e.onBeforeApplied) ?? N,
|
|
4887
|
+
onAfterApplied: ((t = r.events) == null ? void 0 : t.onAfterApplied) ?? N
|
|
4901
4888
|
};
|
|
4902
|
-
},
|
|
4889
|
+
}, Wr = (r, e) => ({
|
|
4903
4890
|
...r,
|
|
4904
4891
|
onNodeDragStarted: (t) => {
|
|
4905
4892
|
e.add(t), r.onNodeDragStarted(t);
|
|
@@ -4907,7 +4894,7 @@ const Fr = (r) => {
|
|
|
4907
4894
|
onNodeDragFinished: (t) => {
|
|
4908
4895
|
e.delete(t), r.onNodeDragFinished(t);
|
|
4909
4896
|
}
|
|
4910
|
-
}),
|
|
4897
|
+
}), zr = (r, e) => {
|
|
4911
4898
|
r.graph.onBeforeNodeRemoved.subscribe((t) => {
|
|
4912
4899
|
e.delete(t);
|
|
4913
4900
|
}), r.graph.onBeforeClear.subscribe(() => {
|
|
@@ -4915,28 +4902,28 @@ const Fr = (r) => {
|
|
|
4915
4902
|
}), r.onBeforeDestroy.subscribe(() => {
|
|
4916
4903
|
e.clear();
|
|
4917
4904
|
});
|
|
4918
|
-
},
|
|
4905
|
+
}, kr = (r, e) => ({
|
|
4919
4906
|
...r,
|
|
4920
4907
|
staticNodeResolver: (t) => r.staticNodeResolver(t) || e.has(t)
|
|
4921
|
-
}), _ = (r) => () => r,
|
|
4908
|
+
}), _ = (r) => () => r, Ie = _(0), Hr = () => {
|
|
4922
4909
|
let r = 0;
|
|
4923
4910
|
return () => r++;
|
|
4924
|
-
},
|
|
4925
|
-
let t =
|
|
4926
|
-
const s =
|
|
4911
|
+
}, Yr = (r, e) => {
|
|
4912
|
+
let t = Ie, o = Ie;
|
|
4913
|
+
const s = Hr();
|
|
4927
4914
|
return r === "incremental" && (t = s), e === "incremental" && (o = s), typeof r == "number" && (t = _(r)), typeof e == "number" && (o = _(e)), typeof r == "function" && (t = r), typeof e == "function" && (o = e), {
|
|
4928
4915
|
nodesPriorityFn: t,
|
|
4929
4916
|
edgesPriorityFn: o
|
|
4930
4917
|
};
|
|
4931
|
-
},
|
|
4918
|
+
}, Xr = (r) => {
|
|
4932
4919
|
var t, o, s, n, a;
|
|
4933
|
-
const e =
|
|
4920
|
+
const e = Yr(
|
|
4934
4921
|
(t = r.nodes) == null ? void 0 : t.priority,
|
|
4935
4922
|
(o = r.edges) == null ? void 0 : o.priority
|
|
4936
4923
|
);
|
|
4937
4924
|
return {
|
|
4938
4925
|
nodes: {
|
|
4939
|
-
centerFn: ((s = r.nodes) == null ? void 0 : s.centerFn) ??
|
|
4926
|
+
centerFn: ((s = r.nodes) == null ? void 0 : s.centerFn) ?? We,
|
|
4940
4927
|
priorityFn: e.nodesPriorityFn
|
|
4941
4928
|
},
|
|
4942
4929
|
ports: {
|
|
@@ -4947,9 +4934,9 @@ const Fr = (r) => {
|
|
|
4947
4934
|
priorityFn: e.edgesPriorityFn
|
|
4948
4935
|
}
|
|
4949
4936
|
};
|
|
4950
|
-
},
|
|
4937
|
+
}, Gr = (r) => r.applyOn.type === "topologyChangeSchedule" ? r.applyOn.schedule : oe, jr = (r) => {
|
|
4951
4938
|
var o, s, n, a;
|
|
4952
|
-
const { canvasDefaults: e } = r, t = r.hasLayout ?
|
|
4939
|
+
const { canvasDefaults: e } = r, t = r.hasLayout ? Gr(r.layoutParams) : oe;
|
|
4953
4940
|
return {
|
|
4954
4941
|
focus: {
|
|
4955
4942
|
contentPadding: ((o = e.focus) == null ? void 0 : o.contentPadding) ?? ((s = e.focus) == null ? void 0 : s.contentOffset) ?? 100,
|
|
@@ -4958,23 +4945,23 @@ const Fr = (r) => {
|
|
|
4958
4945
|
animationDuration: ((a = e.focus) == null ? void 0 : a.animationDuration) ?? 0
|
|
4959
4946
|
}
|
|
4960
4947
|
};
|
|
4961
|
-
},
|
|
4948
|
+
}, Jr = (r) => ({
|
|
4962
4949
|
onNodeSelected: r.onNodeSelected,
|
|
4963
|
-
mouseDownEventVerifier: r.mouseDownEventVerifier ??
|
|
4964
|
-
mouseUpEventVerifier: r.mouseUpEventVerifier ??
|
|
4965
|
-
movementThreshold: r.movementThreshold ??
|
|
4966
|
-
}), Jr = (r) => ({
|
|
4967
|
-
onCanvasSelected: r.onCanvasSelected,
|
|
4968
|
-
mouseDownEventVerifier: r.mouseDownEventVerifier ?? L.mouseDownEventVerifier,
|
|
4969
|
-
mouseUpEventVerifier: r.mouseUpEventVerifier ?? L.mouseUpEventVerifier,
|
|
4970
|
-
movementThreshold: r.movementThreshold ?? L.movementThreshold
|
|
4950
|
+
mouseDownEventVerifier: r.mouseDownEventVerifier ?? I.mouseDownEventVerifier,
|
|
4951
|
+
mouseUpEventVerifier: r.mouseUpEventVerifier ?? I.mouseUpEventVerifier,
|
|
4952
|
+
movementThreshold: r.movementThreshold ?? I.movementThreshold
|
|
4971
4953
|
}), Kr = (r) => ({
|
|
4954
|
+
onCanvasSelected: r.onCanvasSelected,
|
|
4955
|
+
mouseDownEventVerifier: r.mouseDownEventVerifier ?? I.mouseDownEventVerifier,
|
|
4956
|
+
mouseUpEventVerifier: r.mouseUpEventVerifier ?? I.mouseUpEventVerifier,
|
|
4957
|
+
movementThreshold: r.movementThreshold ?? I.movementThreshold
|
|
4958
|
+
}), Qr = (r) => ({
|
|
4972
4959
|
onEdgeSelected: r.onEdgeSelected,
|
|
4973
|
-
mouseDownEventVerifier: r.mouseDownEventVerifier ??
|
|
4974
|
-
mouseUpEventVerifier: r.mouseUpEventVerifier ??
|
|
4975
|
-
movementThreshold: r.movementThreshold ??
|
|
4960
|
+
mouseDownEventVerifier: r.mouseDownEventVerifier ?? I.mouseDownEventVerifier,
|
|
4961
|
+
mouseUpEventVerifier: r.mouseUpEventVerifier ?? I.mouseUpEventVerifier,
|
|
4962
|
+
movementThreshold: r.movementThreshold ?? I.movementThreshold
|
|
4976
4963
|
});
|
|
4977
|
-
class
|
|
4964
|
+
class eo {
|
|
4978
4965
|
constructor(e) {
|
|
4979
4966
|
i(this, "used", !1);
|
|
4980
4967
|
i(this, "canvasDefaults", {});
|
|
@@ -5001,8 +4988,8 @@ class _r {
|
|
|
5001
4988
|
i(this, "window", window);
|
|
5002
4989
|
i(this, "animationStaticNodes", /* @__PURE__ */ new Set());
|
|
5003
4990
|
i(this, "pointInsideVerifier");
|
|
5004
|
-
i(this, "eventTagger", new
|
|
5005
|
-
this.element = e, this.pointInsideVerifier = new
|
|
4991
|
+
i(this, "eventTagger", new Jt());
|
|
4992
|
+
this.element = e, this.pointInsideVerifier = new Et(e, this.window);
|
|
5006
4993
|
}
|
|
5007
4994
|
setDefaults(e) {
|
|
5008
4995
|
return this.canvasDefaults = e, this;
|
|
@@ -5045,44 +5032,44 @@ class _r {
|
|
|
5045
5032
|
}
|
|
5046
5033
|
build() {
|
|
5047
5034
|
if (this.used)
|
|
5048
|
-
throw new
|
|
5035
|
+
throw new yr(
|
|
5049
5036
|
"Failed to build Canvas because CanvasBuilder is a single-use object"
|
|
5050
5037
|
);
|
|
5051
5038
|
this.used = !0;
|
|
5052
|
-
const e = new
|
|
5039
|
+
const e = new vt(this.element), t = new $e(), o = new sr(this.element), s = this.createHtmlView(
|
|
5053
5040
|
o.main,
|
|
5054
5041
|
t,
|
|
5055
5042
|
e
|
|
5056
|
-
), n =
|
|
5043
|
+
), n = Xr(
|
|
5057
5044
|
this.canvasDefaults
|
|
5058
|
-
), a = new
|
|
5045
|
+
), a = new Je(
|
|
5059
5046
|
t,
|
|
5060
5047
|
s,
|
|
5061
5048
|
n
|
|
5062
|
-
), h =
|
|
5049
|
+
), h = Or(this.layoutConfig), d = jr({
|
|
5063
5050
|
canvasDefaults: this.canvasDefaults,
|
|
5064
5051
|
hasLayout: this.hasLayout,
|
|
5065
5052
|
layoutParams: h
|
|
5066
|
-
}), c = new
|
|
5053
|
+
}), c = new _e(
|
|
5067
5054
|
t,
|
|
5068
5055
|
e,
|
|
5069
5056
|
d,
|
|
5070
5057
|
this.window
|
|
5071
|
-
),
|
|
5072
|
-
u,
|
|
5058
|
+
), u = new Ke(e), l = new je(t), g = new Ue(
|
|
5073
5059
|
l,
|
|
5060
|
+
u,
|
|
5074
5061
|
a,
|
|
5075
5062
|
c
|
|
5076
5063
|
);
|
|
5077
5064
|
if (this.hasBackground && de.configure(
|
|
5078
5065
|
g,
|
|
5079
|
-
|
|
5066
|
+
lr(this.backgroundConfig),
|
|
5080
5067
|
o.background
|
|
5081
5068
|
), this.hasNodeResizeReactiveEdges && ee.configure(g), this.userSelectableEdgesConfig !== void 0) {
|
|
5082
|
-
const p =
|
|
5069
|
+
const p = Qr(
|
|
5083
5070
|
this.userSelectableEdgesConfig
|
|
5084
5071
|
);
|
|
5085
|
-
|
|
5072
|
+
ye.configure(
|
|
5086
5073
|
g,
|
|
5087
5074
|
this.window,
|
|
5088
5075
|
this.pointInsideVerifier,
|
|
@@ -5091,7 +5078,7 @@ class _r {
|
|
|
5091
5078
|
);
|
|
5092
5079
|
}
|
|
5093
5080
|
if (this.userSelectableNodesConfig !== void 0) {
|
|
5094
|
-
const p =
|
|
5081
|
+
const p = Jr(
|
|
5095
5082
|
this.userSelectableNodesConfig
|
|
5096
5083
|
);
|
|
5097
5084
|
we.configure(
|
|
@@ -5103,10 +5090,10 @@ class _r {
|
|
|
5103
5090
|
);
|
|
5104
5091
|
}
|
|
5105
5092
|
if (this.userSelectableCanvasConfig !== void 0) {
|
|
5106
|
-
const p =
|
|
5093
|
+
const p = Kr(
|
|
5107
5094
|
this.userSelectableCanvasConfig
|
|
5108
5095
|
);
|
|
5109
|
-
|
|
5096
|
+
fe.configure(
|
|
5110
5097
|
g,
|
|
5111
5098
|
o.main,
|
|
5112
5099
|
this.window,
|
|
@@ -5116,8 +5103,8 @@ class _r {
|
|
|
5116
5103
|
);
|
|
5117
5104
|
}
|
|
5118
5105
|
if (this.hasDraggableNodes) {
|
|
5119
|
-
let p =
|
|
5120
|
-
this.hasAnimatedLayout && (p =
|
|
5106
|
+
let p = ir(this.dragConfig);
|
|
5107
|
+
this.hasAnimatedLayout && (p = Wr(
|
|
5121
5108
|
p,
|
|
5122
5109
|
this.animationStaticNodes
|
|
5123
5110
|
)), ae.configure(
|
|
@@ -5129,7 +5116,7 @@ class _r {
|
|
|
5129
5116
|
);
|
|
5130
5117
|
}
|
|
5131
5118
|
if (this.hasUserConnectablePorts) {
|
|
5132
|
-
const p =
|
|
5119
|
+
const p = ur(
|
|
5133
5120
|
this.connectablePortsConfig,
|
|
5134
5121
|
n.edges.shapeFactory,
|
|
5135
5122
|
g.graph
|
|
@@ -5144,7 +5131,7 @@ class _r {
|
|
|
5144
5131
|
);
|
|
5145
5132
|
}
|
|
5146
5133
|
if (this.hasUserDraggableEdges) {
|
|
5147
|
-
const p =
|
|
5134
|
+
const p = gr(
|
|
5148
5135
|
this.draggableEdgesConfig,
|
|
5149
5136
|
g.graph
|
|
5150
5137
|
);
|
|
@@ -5161,22 +5148,22 @@ class _r {
|
|
|
5161
5148
|
g,
|
|
5162
5149
|
o.main,
|
|
5163
5150
|
this.window,
|
|
5164
|
-
|
|
5151
|
+
Ve(this.transformConfig),
|
|
5165
5152
|
this.boxRenderingTrigger,
|
|
5166
5153
|
this.pointInsideVerifier,
|
|
5167
|
-
|
|
5154
|
+
pr(this.virtualScrollConfig)
|
|
5168
5155
|
) : this.hasTransformableViewport && J.configure(
|
|
5169
5156
|
g,
|
|
5170
5157
|
o.main,
|
|
5171
5158
|
this.window,
|
|
5172
5159
|
this.pointInsideVerifier,
|
|
5173
|
-
|
|
5174
|
-
), this.hasLayout &&
|
|
5175
|
-
let p =
|
|
5176
|
-
this.hasDraggableNodes && (
|
|
5160
|
+
Ve(this.transformConfig)
|
|
5161
|
+
), this.hasLayout && er.configure(g, h), this.hasAnimatedLayout) {
|
|
5162
|
+
let p = Lr(this.animatedLayoutConfig);
|
|
5163
|
+
this.hasDraggableNodes && (zr(
|
|
5177
5164
|
g,
|
|
5178
5165
|
this.animationStaticNodes
|
|
5179
|
-
), p =
|
|
5166
|
+
), p = kr(
|
|
5180
5167
|
p,
|
|
5181
5168
|
this.animationStaticNodes
|
|
5182
5169
|
)), pe.configure(g, p, this.window);
|
|
@@ -5186,27 +5173,28 @@ class _r {
|
|
|
5186
5173
|
}), g;
|
|
5187
5174
|
}
|
|
5188
5175
|
createHtmlView(e, t, o) {
|
|
5189
|
-
let s = new
|
|
5190
|
-
return this.virtualScrollConfig !== void 0 && (s = new
|
|
5176
|
+
let s = new Fe(t, o, e);
|
|
5177
|
+
return this.virtualScrollConfig !== void 0 && (s = new wt(
|
|
5191
5178
|
s,
|
|
5192
5179
|
t,
|
|
5193
5180
|
this.boxRenderingTrigger,
|
|
5194
|
-
|
|
5195
|
-
)), s = new
|
|
5181
|
+
wr(this.virtualScrollConfig)
|
|
5182
|
+
)), s = new yt(s, t), s;
|
|
5196
5183
|
}
|
|
5197
5184
|
}
|
|
5198
5185
|
export {
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5186
|
+
Ot as BezierEdgeShape,
|
|
5187
|
+
eo as CanvasBuilder,
|
|
5188
|
+
yr as CanvasBuilderError,
|
|
5189
|
+
S as CanvasError,
|
|
5190
|
+
U as ConnectionCategory,
|
|
5191
|
+
Xe as DirectEdgeShape,
|
|
5205
5192
|
q as EventSubject,
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5193
|
+
Wt as HorizontalEdgeShape,
|
|
5194
|
+
Xt as InteractiveEdgeError,
|
|
5195
|
+
Ge as InteractiveEdgeShape,
|
|
5196
|
+
qr as MidpointEdgeShape,
|
|
5197
|
+
zt as StraightEdgeShape,
|
|
5198
|
+
kt as VerticalEdgeShape,
|
|
5199
|
+
_r as boxPortOffsetFn
|
|
5212
5200
|
};
|