dabeng / vue-orgchart

It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
MIT License
290 stars 89 forks source link

Pan to location of a node #51

Open newalphamedia opened 3 years ago

newalphamedia commented 3 years ago

Is there any way to programmatically pan to the location of a node?

For example, if the orgchart becomes really wide we may want to pan to the top-most node so that it appears on screen. Or, we might want to have a side menu that lists items from the current 'node levels deep' which, when selected, jumps to the location of that node in the orgchart.

I have attempted this myself, but I am unable to figure it out - I've dived into grabbing what I can with document.getElementsByClassName("orgchart") but this hasn't worked for me - it's probably not ideal to be trying to go through the DOM anyway.