dash14 / v-network-graph

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

Expose svgPanZoom as component property #99

Closed pavelhoral closed 1 year ago

pavelhoral commented 1 year ago

Recent versions are not exposing svgPanZoom instance in a way that previous version did (not sure which change caused this). Being able to work with svgPanZoom is very helpful when rendering additional stuff inside the graph.

It is possible to workaround this by capturing svgPanZoom instance in view.onSvgPanZoomInitialized configuration, but that is quite ugly approach.

Would it be possible to add svgPanZoom in defineExpose and make it official API?

pavelhoral commented 1 year ago

If you are interested in what I am doing with your library - https://prekladyher.github.io/disco-website/#/conversations/5?entryId=25 . You can open the "minimap" by clicking the map icon and you will see that I am showing viewport windows for the big graph there - to calculate the window position I need svgPanZoom of both the main graph and minimap.

pavelhoral commented 1 year ago

Didn't notice I can get what I need from getViewBox() instance method.