Take what reaches the graph's background rather than a node or link: a click clears the selection, a double-click adds a node, and a drag with Shift held draws a selection box (a drag without it pans the view instead).
Background properties.
Called with the world point the background was double-clicked at.
Called when the background is clicked.
Called with the area a selection box covered, in world coordinates.
Take what reaches the graph's background rather than a node or link: a click clears the selection, a double-click adds a node, and a drag with Shift held draws a selection box (a drag without it pans the view instead).