score:11

Accepted answer

I recommend you to read the documentation of the force layout. It is really good.

As you mentioned, you have to set the px and py attributes for each node. Then, you can set the attribute fixed to true in each node.

This will imply that computing force.start() won't have any effect.


Another thing you can try is to set the alpha value to 0, and then start the simulation:

force.alpha(0)
    .start()

I am not sure whether this method works. Post a jsFiddle if it does not.


Related Query