markdown-links icon indicating copy to clipboard operation
markdown-links copied to clipboard

fix refresh of the graph

Open mathieudutour opened this issue 5 years ago • 4 comments

This change keeps the position of the nodes if we already have them instead of reseting them.

If we'd want to keep the same positions even closing/reopening the window, we can store the nodeData somewhere and pull it back later

mathieudutour avatar Jul 24 '20 13:07 mathieudutour

Thanks for the PR! I will test it soon and merge it if no problem occurs.

tchayen avatar Jul 25 '20 01:07 tchayen

@mathieudutour I am seeing different behavior than I have imagined so need to clarify a few things. Are your changes meant to keep all nodes in the same place if they existed before? Did you test it with changing a file's title?

If yes to both, then it doesn't work for me 😞 . If no – I might be hitting some edge case. Let me know which one is the case here 😄 .

tchayen avatar Jul 25 '20 12:07 tchayen

So they keep the same place when you add a file or change its title. It doesn’t when you close the window and reopen it

mathieudutour avatar Jul 25 '20 13:07 mathieudutour

I mean they don’t keep the exact same position, it just restarts the simulation with the previous position (so they can still spread, etc.)

mathieudutour avatar Jul 25 '20 13:07 mathieudutour