diff --git a/lib/network/modules/components/physics/BarnesHutSolver.js b/lib/network/modules/components/physics/BarnesHutSolver.js index 2c514e20..413ee870 100644 --- a/lib/network/modules/components/physics/BarnesHutSolver.js +++ b/lib/network/modules/components/physics/BarnesHutSolver.js @@ -115,7 +115,7 @@ class BarnesHutSolver { dx = distance; } - if (this.overlapAvoidanceFactor < 1) { + if (this.overlapAvoidanceFactor < 1 && node.shape.radius) { distance = Math.max(0.1 + (this.overlapAvoidanceFactor * node.shape.radius), distance - node.shape.radius); } @@ -462,4 +462,4 @@ class BarnesHutSolver { } -export default BarnesHutSolver; \ No newline at end of file +export default BarnesHutSolver; diff --git a/lib/network/modules/components/physics/FA2BasedRepulsionSolver.js b/lib/network/modules/components/physics/FA2BasedRepulsionSolver.js index 24fe2742..030da003 100644 --- a/lib/network/modules/components/physics/FA2BasedRepulsionSolver.js +++ b/lib/network/modules/components/physics/FA2BasedRepulsionSolver.js @@ -21,7 +21,7 @@ class ForceAtlas2BasedRepulsionSolver extends BarnesHutSolver { dx = distance; } - if (this.overlapAvoidanceFactor < 1) { + if (this.overlapAvoidanceFactor < 1 && node.shape.radius) { distance = Math.max(0.1 + (this.overlapAvoidanceFactor * node.shape.radius), distance - node.shape.radius); } @@ -37,4 +37,4 @@ class ForceAtlas2BasedRepulsionSolver extends BarnesHutSolver { } } -export default ForceAtlas2BasedRepulsionSolver; \ No newline at end of file +export default ForceAtlas2BasedRepulsionSolver;