You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Vasturiano, thank you for the great package! I'm using the 2D version of react-force-graph.
What's the best way to keep the nodes and links in the same place after a page refresh?
Storing the x and y values of each node and trying to render that causes issues because the force is applied to them on component mount / page refresh. However, if I use fx and fy instead of x and y, then the nodes are draggable but the force is turned off it seems. Below is a simple component I made where it loads the x and y positions from local storage. When I refresh the page, it loads the nodes in almost the right place, just that the force applies to it, pushing them farther apart.
Hello Vasturiano, thank you for the great package! I'm using the 2D version of react-force-graph.
What's the best way to keep the nodes and links in the same place after a page refresh?
Storing the x and y values of each node and trying to render that causes issues because the force is applied to them on component mount / page refresh. However, if I use fx and fy instead of x and y, then the nodes are draggable but the force is turned off it seems. Below is a simple component I made where it loads the x and y positions from local storage. When I refresh the page, it loads the nodes in almost the right place, just that the force applies to it, pushing them farther apart.
Please let me know if my question was clear and if you need any more information to help me out!
The text was updated successfully, but these errors were encountered: