def drag(self, node):
dx = self.mouse.x - self.graph.x<EOL>dy = self.mouse.y - self.graph.y<EOL>s = self.graph.styles.default<EOL>self._ctx.nofill()<EOL>self._ctx.nostroke()<EOL>if s.stroke: <EOL><INDENT>self._ctx.strokewidth(s.strokewidth)<EOL>self._ctx.stroke(<EOL>s.stroke.r, <EOL>s.stroke.g, <EOL>s.stroke.g, <EOL><NUM_LIT><EOL>)<EOL><DEDENT>p = self._ctx.line(node.x, node.y, dx, dy, draw=False)<EOL>try: p._nsBezierPath.setLineDash_count_phase_([<NUM_LIT:2>,<NUM_LIT:4>], <NUM_LIT:2>, <NUM_LIT:50>)<EOL>except:<EOL><INDENT>pass<EOL><DEDENT>self._ctx.drawpath(p)<EOL>r = node.__class__(None).r * <NUM_LIT><EOL>self._ctx.oval(dx-r/<NUM_LIT:2>, dy-r/<NUM_LIT:2>, r, r)<EOL>node.vx = dx / self.graph.d<EOL>node.vy = dy / self.graph.d<EOL>
Drags given node to mouse location.