Skip to content

try verlet integration#1

Merged
anvaka merged 1 commit intoanvaka:masterfrom
annxingyuan:master
Feb 18, 2017
Merged

try verlet integration#1
anvaka merged 1 commit intoanvaka:masterfrom
annxingyuan:master

Conversation

@annxingyuan
Copy link
Copy Markdown

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.

@anvaka
Copy link
Copy Markdown
Owner

anvaka commented Feb 16, 2017

First of all, thank you for doing this!

Let me take a closer look over the weekend and merge this PR!

@anvaka anvaka merged commit b5389d0 into anvaka:master Feb 18, 2017
@anvaka
Copy link
Copy Markdown
Owner

anvaka commented Feb 18, 2017

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 v0.0.16

Thanks again for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants