-
Notifications
You must be signed in to change notification settings - Fork 298
Description
Describe the bug
When dynamically switching graph data (nodes and links) using a Dagre layout, edges are rendered in incorrect positions after the graph data changes.
Calling update$ forces the layout to recompute and corrects the edge positions, but introduces a visible flicker where edges briefly render incorrectly before snapping into the correct layout.
In ngx-graph v8.4.0, switching graph data results in correctly positioned edges without requiring any additional update trigger
To Reproduce
Steps to reproduce the behavior:
- Go to demo
- Notice the edge positioning in the initial loading
- Switch between scenario 1 and 2 and notice the subsequent edge positioning
Expected behavior
That the edges properly positioned
Screenshots
Initial load
First switch (click scenario 2) - notice the edge positioning
Second switch (click back scenario 1) - notice the edge positioning
Demo
https://stackblitz.com/edit/playground-angular-17-material-nsu3nd-zcaeusbs
ngx-graph version
>=9.0.0
Additional context
Manually triggering the update$ or using a setTimeout would properly position the edges, but with a visible flicker