diff --git a/lib/network/modules/LayoutEngine.js b/lib/network/modules/LayoutEngine.js index 87a35cec..368acd42 100644 --- a/lib/network/modules/LayoutEngine.js +++ b/lib/network/modules/LayoutEngine.js @@ -526,8 +526,13 @@ class LayoutEngine { this._setMinLevelToZero(); } + + /** + * Small util method to set the minimum levels of the nodes to zero. + * @private + */ _setMinLevelToZero() { - let minLevel; + let minLevel = 1e9; // get the minimum level for (let nodeId in this.body.nodes) { if (this.body.nodes.hasOwnProperty(nodeId)) { @@ -619,13 +624,12 @@ class LayoutEngine { * This is a recursively called function to enumerate the branches from the largest hubs and place the nodes * on a X position that ensures there will be no overlap. * - * @param edges * @param parentId - * @param distribution * @param parentLevel * @private */ _placeBranchNodes(parentId, parentLevel) { + // if this is not a parent, cancel the placing. This can happen with multiple parents to one child. if (this.hierarchicalParents[parentId] === undefined) { return; }