feat(stacking): disable auto layering, instead configure via zIndex prop

This commit is contained in:
Christopher Möller
2021-11-10 18:06:28 +01:00
parent f0e79c634a
commit c29decade5
4 changed files with 62 additions and 36 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ function groupEdgesByZLevel(edges: Edge[], nodeInternals: NodeInternals) {
let maxLevel = -1;
const levelLookup = edges.reduce<Record<string, Edge[]>>((tree, edge) => {
const z = Math.max(nodeInternals.get(edge.source)?.z || 0, nodeInternals.get(edge.target)?.z || 0);
const z = edge.zIndex || Math.max(nodeInternals.get(edge.source)?.z || 0, nodeInternals.get(edge.target)?.z || 0);
if (tree[z]) {
tree[z].push(edge);
} else {