I am trying to apply the van Wijk Smooth Zooming example to a D3 force-directed graph I am working that already has the drag+zoom functioning on it. However, I don't know how to get my current position in order to make that the starting point of the transform. The I have the same issue with trying to use a normal transform.
I also tried looking at the click-to-zoom-transform but I wasn't sure how to apply that to a force-directed graph.
There are a couple things I want to apply it to, including being able to zoom and jump to a link's target node when I click on the link. Is there a way to get the current screen screen position so I could use it as a starting point to jump to where I want to go?
[d.target.x, d.target.y], wheredis the data bound to the link. - Lars Kotthoff.transition().attr("transform", ...)on the element, you don't need to know the current position. - Lars Kotthoff