@dagrejs/dagre 3.1.1 → 3.1.2
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/dagre.cjs +1 -1
- package/dist/dagre.cjs.map +3 -3
- package/dist/dagre.esm.js +1 -1
- package/dist/dagre.esm.js.map +3 -3
- package/dist/dagre.js +29 -5
- package/dist/dagre.js.map +2 -2
- package/dist/dagre.min.js +1 -1
- package/dist/dagre.min.js.map +3 -3
- package/dist/types/lib/position/bk.d.ts.map +1 -1
- package/dist/types/lib/version.d.ts +1 -1
- package/package.json +2 -2
package/dist/dagre.js
CHANGED
|
@@ -635,7 +635,7 @@ var dagre = (() => {
|
|
|
635
635
|
throw new Error("Not possible to find intersection inside of the rectangle");
|
|
636
636
|
}
|
|
637
637
|
let sx, sy;
|
|
638
|
-
if (Math.abs(dy) * w2 > Math.abs(dx) * h) {
|
|
638
|
+
if (dx === 0 || Math.abs(dy) * w2 > Math.abs(dx) * h) {
|
|
639
639
|
if (dy < 0) {
|
|
640
640
|
h = -h;
|
|
641
641
|
}
|
|
@@ -837,7 +837,7 @@ var dagre = (() => {
|
|
|
837
837
|
}
|
|
838
838
|
|
|
839
839
|
// lib/version.ts
|
|
840
|
-
var version = "3.1.
|
|
840
|
+
var version = "3.1.2";
|
|
841
841
|
|
|
842
842
|
// lib/data/list.ts
|
|
843
843
|
var List = class {
|
|
@@ -1946,7 +1946,7 @@ var dagre = (() => {
|
|
|
1946
1946
|
entries.splice(i, 1);
|
|
1947
1947
|
i--;
|
|
1948
1948
|
break;
|
|
1949
|
-
} else {
|
|
1949
|
+
} else if (!reversedPairs[nameI]) {
|
|
1950
1950
|
reversedPairs[nameI] = entries[j2];
|
|
1951
1951
|
entries.splice(j2, 1);
|
|
1952
1952
|
j2--;
|
|
@@ -2170,6 +2170,14 @@ var dagre = (() => {
|
|
|
2170
2170
|
}
|
|
2171
2171
|
function findType2Conflicts(graph, layering) {
|
|
2172
2172
|
const conflicts = {};
|
|
2173
|
+
function isBorderDummy(v2) {
|
|
2174
|
+
var _a;
|
|
2175
|
+
return ((_a = graph.node(v2)) == null ? void 0 : _a.dummy) === "border";
|
|
2176
|
+
}
|
|
2177
|
+
const hasBorderDummy = graph.nodes().some(isBorderDummy);
|
|
2178
|
+
if (!hasBorderDummy) {
|
|
2179
|
+
return conflicts;
|
|
2180
|
+
}
|
|
2173
2181
|
function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) {
|
|
2174
2182
|
range(southPos, southEnd).forEach((i) => {
|
|
2175
2183
|
const v2 = south[i];
|
|
@@ -2193,7 +2201,7 @@ var dagre = (() => {
|
|
|
2193
2201
|
let nextNorthPos = -1;
|
|
2194
2202
|
let southPos = 0;
|
|
2195
2203
|
south.forEach((v2, southLookahead) => {
|
|
2196
|
-
if (
|
|
2204
|
+
if (isBorderDummy(v2)) {
|
|
2197
2205
|
const predecessors = graph.predecessors(v2);
|
|
2198
2206
|
if (predecessors && predecessors.length) {
|
|
2199
2207
|
const firstPred = predecessors[0];
|
|
@@ -2614,7 +2622,9 @@ var dagre = (() => {
|
|
|
2614
2622
|
g.edges().forEach((e) => {
|
|
2615
2623
|
const srcChild = topLevelChildOf(g, e.v, v2);
|
|
2616
2624
|
const tgtChild = topLevelChildOf(g, e.w, v2);
|
|
2617
|
-
if (srcChild
|
|
2625
|
+
if (srcChild === e.v && tgtChild === e.w) {
|
|
2626
|
+
subgraph.setEdge(e, { ...g.edge(e) });
|
|
2627
|
+
} else if (srcChild && tgtChild && srcChild !== tgtChild) {
|
|
2618
2628
|
const key = `${srcChild}\0${tgtChild}`;
|
|
2619
2629
|
if (!proxiedEdges.has(key)) {
|
|
2620
2630
|
proxiedEdges.add(key);
|
|
@@ -2771,6 +2781,7 @@ var dagre = (() => {
|
|
|
2771
2781
|
mainNode.y = clusterY + (subNode.y - subgraphCenterY);
|
|
2772
2782
|
}
|
|
2773
2783
|
});
|
|
2784
|
+
updateClusterEdges(g, subgraph, clusterX - subgraphCenterX, clusterY - subgraphCenterY);
|
|
2774
2785
|
delete clusterNode._dagreClusterSubgraph;
|
|
2775
2786
|
});
|
|
2776
2787
|
clusterNodes.forEach((v2) => {
|
|
@@ -2794,10 +2805,23 @@ var dagre = (() => {
|
|
|
2794
2805
|
mainNode.y = parentY + dy;
|
|
2795
2806
|
}
|
|
2796
2807
|
});
|
|
2808
|
+
updateClusterEdges(g, subgraph, parentX - subgraphCenterX, parentY - subgraphCenterY);
|
|
2797
2809
|
delete node._dagreClusterSubgraph;
|
|
2798
2810
|
}
|
|
2799
2811
|
});
|
|
2800
2812
|
}
|
|
2813
|
+
function updateClusterEdges(g, subgraph, offsetX, offsetY) {
|
|
2814
|
+
subgraph.edges().forEach((e) => {
|
|
2815
|
+
if (!g.hasEdge(e)) return;
|
|
2816
|
+
const source = subgraph.edge(e);
|
|
2817
|
+
const target = g.edge(e);
|
|
2818
|
+
target.points = source.points.map((p2) => ({ x: p2.x + offsetX, y: p2.y + offsetY }));
|
|
2819
|
+
if (Object.hasOwn(source, "x")) {
|
|
2820
|
+
target.x = source.x + offsetX;
|
|
2821
|
+
target.y = source.y + offsetY;
|
|
2822
|
+
}
|
|
2823
|
+
});
|
|
2824
|
+
}
|
|
2801
2825
|
function runLayout(g, time2, opts, previous = null) {
|
|
2802
2826
|
var _a, _b;
|
|
2803
2827
|
const dynamic = (opts == null ? void 0 : opts.useDynamic) !== false;
|