diff --git a/src/simulation.js b/src/simulation.js index 083be26..a0b5b8c 100644 --- a/src/simulation.js +++ b/src/simulation.js @@ -62,8 +62,8 @@ export default function(nodes) { function initializeNodes() { for (var i = 0, n = nodes.length, node; i < n; ++i) { node = nodes[i], node.index = i; - if (!isNaN(node.fx)) node.x = node.fx; - if (!isNaN(node.fy)) node.y = node.fy; + if (node.fx != null) node.x = node.fx; + if (node.fy != null) node.y = node.fy; if (isNaN(node.x) || isNaN(node.y)) { var radius = initialRadius * Math.sqrt(i), angle = i * initialAngle; node.x = radius * Math.cos(angle);