ForceDirectedLayout animation questions

Hi,



I am using ForceDirectedLayout to implement an interactive diagram control. I set Stretch to Uniform, HorizontalContentAlignment and VerticalContentAlignment to Stretch. When the user click a node, I generate a new model, Layout will play animations to move new nodes/links. Things are all good until the scale becomes less than 1. The animation plays as if the scale is still 1. Nodes are much bigger than they should. Then when the layout is completed, the whole diagram “shrinks” itself to fit the area.



If I understand it correctly, the scale can only be determined after the layout is completed. That’s why animation can’t take scale into consideration. But, is it possible to do a “two-round” layout - first do a full layout, calculate the scale and final positions for every node/link; second round plays the animation. I think this can eliminate the “jerking” behavior at the end of layout.



Any suggestions?



Thanks.

Kai

I think that’s a good suggestion. We’ll implement it for the next version.

That would be great!