I tried stopping, updating linkdistance and resuming, no hope...
Thanks.
The link distances and strengths are cached on the link objects, so
you need to call start() when these parameters change rather than
resume().
Mike
force.stop();
force.linkDistance = anotherVal;
force.start();
Thanks :)
Cenk
That's not how you call a function. Take a look at the documentation:
http://github.com/mbostock/d3/wiki/Force-Layout
Mike
Here's the starters code if anyone will be interested:
var linkDistanceVariable = 50;
force = d3.layout.force()
.linkDistance( function() { return linkDistanceVariable; } )
.size([w, h])
.start();
// Stop the layout
force.stop();
// Set the new linkDistance val
linkDistanceVariable = 150; // new
// Start the layout
force.start();