mbostock/d3 — pull request #967 by gedejong (2012-12-16 18:39:45+00:00)
Title: Force layout using forces instead of dx/dy

Hi Mike,

Happily been using your library for quite some time. I need to show you our web app 'scotty' one time, which uses some really nice technologies and visualizations. Currently I have it hosted internally, but I'm sure I can port-forward it for you.

Now the pull request. I noticed the amount of forces applied to the nodes was smaller on my machine compared with a laptop of a coworker. Also, during 'long' frames, I saw a change in the amount of force. I isolated it to the force layouter, which doesn't take framerate into account.

The commit I added to my repo:

- Use forces instead of dx/dy to calculate next frame proportional to dt (delta-t)
- Allow user to set function for extra calculation of force.
- Drag force added to better simulate fluid environment in addition to friction. Allows simulation of air/water drag.

This creates problems with the examples which most likely need to be updated. Let me know what you think and I'll fix it somewhere next week.

With kind regards,

Edwin de Jong