We usually set the x,y positions of visual elements from data. Last week we saw a way to generate x,y positions from high-dimensional data using eigenvectors. Today we'll do something similar, but using physics simulations.
I've modified the code so that it does the simulation "silently" before laying out any of the visible elements. This mode allows you to define a force-directed layout that looks like a static layout.
If you are, say, trying to lay out a set of circles that are slightly random but not overlapping, you might want to sample desired x and y positions from Math.random(), add appropriate x and y forces, and then add a collision force with radius larger than the the radius of the circles.