Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Network: Fix tree collision in hierarchical layout #2625

Merged
merged 1 commit into from
Jan 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/network/modules/LayoutEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,11 @@ class LayoutEngine {
// the main method to shift the trees
let shiftTrees = () => {
let treeSizes = getTreeSizes();
let shiftBy = 0;
for (let i = 0; i < treeSizes.length - 1; i++) {
let diff = treeSizes[i].max - treeSizes[i+1].min;
shiftTree(i + 1, diff + this.options.hierarchical.treeSpacing);
shiftBy += diff + this.options.hierarchical.treeSpacing;
shiftTree(i + 1, shiftBy);
}
};

Expand Down Expand Up @@ -1358,4 +1360,4 @@ class LayoutEngine {

}

export default LayoutEngine;
export default LayoutEngine;