How can I get node screen Point

I find a node by key and I want to eject a dialog . So I want to get the node screen position.
I use below code, but it don’t work.

node = diagram.findNodeForKey(1);
var position = node.position;

the position value is not the screen position.

help me! thank you !

A node’s position is in document coordinates. You can translate document coordinates into view coordinates with: Diagram.transformDocToView(position): http://gojs.net/latest/api/symbols/Diagram.html#transformDocToView

See also: http://gojs.net/latest/intro/viewport.html