Skip to content

Commit

Permalink
Fix #135.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Mar 14, 2019
1 parent 5170427 commit 39a72a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/simulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 39a72a3

Please sign in to comment.