I hit this same thing a few weeks back. Not resolved it... :-( but not had time really.
I know that when nodes are reloaded the force still generates random locations upon entry. Causing the huge wobble at load time.
I tried using the previous location px py (I think) when loading but that did not seem to work.
Hope someone has done this before. Would be really nice.
3. Load your data or whatever you're going to do.
d3.selectAll(".node").map(function (d) {
if (myObj.prevLoc[d.name]) {oldX = myObj.prevLoc[d.name][0];oldY = myObj.prevLoc[d.name][1];} else {// If no previous coordinate... Start from off screen for a fun zoom-in effect .oldX = -100;oldY = -100;}return {id: d.name+"-node",name: d.name,x: oldX,y: oldY,px: oldX,py: oldY,index: d.index};
}
Looks ideal... Will give it a try... :-)
d3.selectAll(".node").map(function (d) {
if (d) { myObj.prevLoc[d.name] = [d.x,d.y];}
return d;