VivaGraphJS icon indicating copy to clipboard operation
VivaGraphJS copied to clipboard

Is there a way to subscribe to node move events?

Open DrMiaow opened this issue 8 years ago • 1 comments
trafficstars

I want to be able to get an event when a node is dragged with the nodes new location.

Is this possible? What is the best way of doing this please?

DrMiaow avatar Nov 23 '16 03:11 DrMiaow

There is input event handler you can use:

const events = Viva.Graph.webglInputEvents(graphics, graph);
events.click(({ id }) => /* your listener */);

Full list of available events - console.log(events):

click(callback): click(callback)
dblClick: dblClick(callback)
mouseCapture: mouseCapture(node)
mouseDown: mouseDown(callback)
mouseEnter: mouseEnter(callback)
mouseLeave: mouseLeave(callback)
mouseMove: mouseMove(callback)
mouseUp: mouseUp(callback)
releaseMouseCapture: releaseMouseCapture()

baransu avatar Mar 24 '17 07:03 baransu