antvis/G6

The issue has been closed
No Animation in gForce Layout and Initial Positioning Issues #4704
Gykonik posted onGitHub
Describe the bug
I'm encountering two issues related to the gForce layout (but also others) in the G6 library. Here are the details:
- No animation during the layout process:
Despite configuring the layout with
animate: true
, the gForce layout does not animate during the layout process. Instead, it immediately "jumps" to the final layout once it's calculated. Other layouts likeforce
didn't work smoothly for me either. Is there a way to enable animation for the gForce layout, or am I doing something wrong? - Initial graph positioning: The graph initially appears in the top left corner of the container and then abruptly jumps to the center after the layouting has finished. Is there a way to achieve a smooth transition where the graph gradually moves to the center of the container once the layout process is complete?
Your Example Website or App
https://codesandbox.io/p/sandbox/romantic-grothendieck-6h4vtc?file=undefined
Steps to Reproduce the Bug or Issue
Just open the code sandbox and wait until the layout has finished (= graph jumps in the center)
Expected behavior
I would expect the graph to initially be in the center of the screen. Afterwards, it should nicely animate its node positions and edges until the final and stable force-directed layout has been reached.
Screenshots or Videos
No response
Platform
- OS: [Windows]
- Browser: [Chrome]
- Version: [114.0.5735.199]
Additional context
No response