anvaka / VivaGraphJS

Graph drawing library for JavaScript
Other
3.75k stars 425 forks source link

Update node centers the node briefly #149

Closed superawe closed 9 years ago

superawe commented 9 years ago

Hi!

I am using VivaGraph in my project and really like it. However there is an issue with addNode in Safari and on iOS-device browsers that I cannot fix. All added nodes (no matter new or already existing) appear at the center of the graph for 1 frame or so and then finds their correct positions. This is a video screen capture of the completely unmodified dynamic node change example from latest release: https://www.youtube.com/watch?v=U3P20b9jzCc

It all seems to work well in Chrome and Firefox though.

Best regards, Arvid Sahlin

anvaka commented 9 years ago

Hi Arvid,

Thanks for reporting this. I can reproduce it and will look at the problem later today.

anvaka commented 9 years ago

Should be fixed by this commit: Demo

Apparently when graph changes I completely destroy old UI and recreate a new one. I don't think that is necessary, but this is a quick workaround for a problem.

I will try to address partial change in the future.

bitjoy commented 9 years ago

Thank you! Works like a charm!