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

It is not possible to pan (focus on a specific node) on load #41

Closed pavelhoral closed 2 years ago

pavelhoral commented 2 years ago

I am trying to focus on a specific node when the graph gets loaded. However it seems that there is always a call to panToCenter after view:loaded event is fired.

This behavior can be observed on the examples page - https://dash14.github.io/v-network-graph/examples/event.html#capture-all-events:

obrazek

This behavior forces users to pan in setTimeout (so there is a workaround).

pavelhoral commented 2 years ago

Also first mouswheel zoom seems to be broken and tries to initialize itself to "fit to contents". But that is probably unrelated bug.

dash14 commented 2 years ago

Hi @pavelhoral, Thank you for your report. Centering on load was implemented intentionally, but I did not provide a way to disable it. I have just added this feature and released it. (v0.5.1) Also created an example, please check it out.

By the way, I have not been able to reproduce the mouse wheel zoom problem. If this problem still occurs after this fix, more detailed information would be appreciated. (e.g., browser you use, minimum reproduction code, etc.)

pavelhoral commented 2 years ago

Thank you, awesome work! If I came across the zoom issue again I will create a separate issue here on github.