dash14 / v-network-graph

An interactive network graph visualization component for Vue 3
https://dash14.github.io/v-network-graph/
MIT License
495 stars 44 forks source link

View:unload #24

Closed rolandovillarreal closed 2 years ago

rolandovillarreal commented 2 years ago

Hi dash, I don't know if it is just me or something that I may be using wrong. But I found that when I change between router-links and the unload event is triggered after I leave the component where the v-network-graph is loaded, two more events are triggered (zoom and pan) causing to increase the size of the nodes and move the position at the last second of the transition... is it posible to stop those events from being triggered?

image

dash14 commented 2 years ago

Hi @rolandovillarreal,

Thanks for your report. I have checked the load/unload state handling and fixed the problem. (v0.3.9) Please check it out.

Best Regards

rolandovillarreal commented 2 years ago

Thank you for your prompt response

The validation with the status == 2 indeed solved the problem of triggering events after unload, but the behavior is still present for me. I thought that by preventing those events being triggered the unexpected "grow/fit" of the graph will be solved

Please find enclosed a short video of how the unload event even without those extra events that previously were and now are not present still update the v-network-graph (second 11 &12 of the video)

https://user-images.githubusercontent.com/95439600/144667141-52ef50ca-e7f8-4c45-b58d-6b7f3ffc9a3b.mp4

dash14 commented 2 years ago

Hi @rolandovillarreal,

Thank you for the detailed information. I was able to reproduce the problem as well.

The reason was that the library I was using to implement SVG pan/zoom was resetting pan and zoom on destroy. I have seen that changing this behavior fixes the problem. Please try v0.3.10.

rolandovillarreal commented 2 years ago

Thank you Dash, You made it look easy! Have an excellent weekend