I have a tree with on click event listeners. I'd like to re-centre my tree on whichever node the user clicked.
How do I get the actual x / y values of a tree node inside the click event?
I have a tree with on click event listeners. I'd like to re-centre my tree on whichever node the user clicked.
How do I get the actual x / y values of a tree node inside the click event?
To get the x/y you must translate the nodes back through whatever translation you've already applied:
http://jsfiddle.net/WLaVU shows a working example of what you want.