diff --git a/lib/network/modules/LayoutEngine.js b/lib/network/modules/LayoutEngine.js index 78ab7f79..b068133a 100644 --- a/lib/network/modules/LayoutEngine.js +++ b/lib/network/modules/LayoutEngine.js @@ -234,8 +234,11 @@ class LayoutEngine { // perturb the nodes a little bit to force the physics to kick in let offset = 70; for (let i = 0; i < this.body.nodeIndices.length; i++) { - this.body.nodes[this.body.nodeIndices[i]].x += (0.5 - this.seededRandom())*offset; - this.body.nodes[this.body.nodeIndices[i]].y += (0.5 - this.seededRandom())*offset; + // Only perturb the nodes that aren't fixed + if (this.body.nodes[this.body.nodeIndices[i]].predefinedPosition === false) { + this.body.nodes[this.body.nodeIndices[i]].x += (0.5 - this.seededRandom())*offset; + this.body.nodes[this.body.nodeIndices[i]].y += (0.5 - this.seededRandom())*offset; + } } // uncluster all clusters