try verlet integration#1
Merged
anvaka merged 1 commit intoanvaka:masterfrom Feb 18, 2017
annxingyuan:master
Merged
Conversation
Owner
|
First of all, thank you for doing this! Let me take a closer look over the weekend and merge this PR! |
Owner
|
I merged your changes. I noticed that Verlet integration takes longer to converge but indeed is much smoother than Euler schema. Also for larger time steps Verlet integration was not stable. I'd like to keep both schemas available. The module uses Euler method by default, but if you pass a configuration object, it will switch to Verlet: var layout = require('ngraph.forcelayout3d')(graph, {
integrator: 'verlet'
});Hope this compromise works well for you and old clients of the library. The change is published as Thanks again for contributing! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey @anvaka - thank you so much for this library - it's been unbelievably helpful and I use it every day :)
I experimented with using Verlet integration rather than Euler integration to update the particle positions. You can't see much of a difference in the demo for this repo, but I'm using this package for larger network layouts, and I've found Verlet integration dramatically reduces jitter with the particles.
To show you what I mean, here's a video of the graph I'm laying out with your forcelayout3d module (using Euler integration):
https://www.youtube.com/watch?v=84gb8BwmRLU&feature=youtu.be
And here it is again with Verlet integration swapped in:
https://www.youtube.com/watch?v=YgHrCLeSqdQ&feature=youtu.be
Let me know what you think. Thank you again for all your work on ngraph.