New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is there a way to keep the gentle floating movement after the initial graph animation? #479
Comments
@Jing1524 you can try setting the node's velocities (via Take a look at this example. react-force-graph/example/collision-detection/index.html Lines 49 to 53 in 0fd8cac
|
@vasturiano thank you so much for the quick response! will try it out! :) |
@vasturiano hey sorry to bother you again. here is the current result
|
I'm working on a project using a basic graph visualization example. Implementing it has been straightforward for the most part. However, I'm struggling with a specific aspect: I want the nodes in the graph to continue floating after the initial render, similar to an effect seen in a Three.js example floating
Here are the methods I've tried so far:
Adjusting cooldownTime to slow down the node movement, hoping to maintain a floating effect. Unfortunately, this hasn't worked as expected.
Attempting to reheat the simulation. This approach causes the graph to re-render and results in the nodes floating off the screen.
Using useEffect to monitor and update each node's location. While this gets me closer to the desired effect, I'm still unable to achieve the smoothness of the floating animation, and I can't prevent the nodes from floating off the screen.
Ideally, I'd like a solution that provides an option to toggle between continuous floating and allowing the graph to gradually come to a stop.
Additional context
below is a quick version of what i have for context, the node stops completely towards the end.
codesandbox
The text was updated successfully, but these errors were encountered: