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

Fix for #4228 #4229

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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: 3 additions & 3 deletions lib/network/modules/LayoutEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ class LayoutEngine {
this.lastNodeOnLevel = {};
this.hierarchical = new HierarchicalStatus();

for (nodeId in this.body.nodes) {
for (nodeId of this.body.nodeIndices) {
if (this.body.nodes.hasOwnProperty(nodeId)) {
node = this.body.nodes[nodeId];
if (node.options.level !== undefined) {
Expand Down Expand Up @@ -746,7 +746,7 @@ class LayoutEngine {


// fallback for cases where there are nodes but no edges
for (let nodeId in this.body.nodes) {
for (let nodeId of this.body.nodeIndices) {
if (this.body.nodes.hasOwnProperty(nodeId)) {
this.hierarchical.ensureLevel(nodeId);
}
Expand Down Expand Up @@ -1106,7 +1106,7 @@ class LayoutEngine {

// center all parents
let centerAllParents = () => {
for (let nodeId in this.body.nodes) {
for (let nodeId of this.body.nodeIndices) {
if (this.body.nodes.hasOwnProperty(nodeId))
this._centerParent(this.body.nodes[nodeId]);
}
Expand Down