Skip to content

Commit

Permalink
Expose force.tick. Fixes #419.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jan 23, 2012
1 parent ad76418 commit 56818fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions d3.layout.js
Expand Up @@ -254,7 +254,7 @@ d3.layout.force = function() {
};
}

function tick() {
force.tick = function() {
var n = nodes.length,
m = links.length,
q,
Expand Down Expand Up @@ -322,7 +322,7 @@ d3.layout.force = function() {

// simulated annealing, basically
return (alpha *= .99) < .005;
}
};

force.nodes = function(x) {
if (!arguments.length) return nodes;
Expand Down Expand Up @@ -458,7 +458,7 @@ d3.layout.force = function() {

force.resume = function() {
alpha = .1;
d3.timer(tick);
d3.timer(force.tick);
return force;
};

Expand Down

0 comments on commit 56818fd

Please sign in to comment.