anvaka / anvaka/ngraph.forcelayout
what is the purpose of simulator.getTotalMovement()?
- Dominant language
- JavaScript
- Stars
- 215
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
Hi & first of all thank you for this great library!
I am trying to find out when the simulation has reached a certain "heat" to stop the rendering and save performance. I thought simulation.getTotalMovement() could help me there but that always returns 0. Is that intended or am i using it wrong?
I am calling getTotalMovement() directly after step(). I can see the simulation is working because i am rendering the nodes as threejs objects.
( I guess [this line](https://github.com/anvaka/ngraph.forcelayout/blob/b94f48ccf98e00e808652283fef77cb2ff9a1826/lib/createPhysicsSimulator.js#L251) is somehow related? You can also see the totalMovement var never being set to anything different than 0... )
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in lib/createPhysicsSimulator.js at the line linked in the issue and trace how totalMovement is handled during step(). Reproduce the simulation, call getTotalMovement() immediately after step(), and compare its value with the rendered node movement. Done means the function's intended behavior is established and it no longer unexpectedly remains 0, with coverage for the observed case if the repository has a relevant test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100