Saturday, 31 August 2013

Getting Screen Positions of D3 Nodes After Transform

Getting Screen Positions of D3 Nodes After Transform

I'm trying to get the screen position of a node after the layout has been
transformed by d3.behavior.zoom() but I'm not having much luck. How might
I go about getting a node's actual position in the window after
translating and scaling the layout?
mouseOver = function(node) {
screenX = magic(node.x); // Need a magic function to transform node
screenY = magic(node.y); // positions into screen coordinates.
};
Any guidance would be appreciated.

No comments:

Post a Comment