anvaka / VivaGraphJS

Graph drawing library for JavaScript
Other
3.76k stars 425 forks source link

Go to the link by clicking on the node. #253

Open vd28 opened 4 years ago

vd28 commented 4 years ago

Hi.Could you tell me how to create mouse click event on node.And how to create a constantly visible label.Thanks in advance.

joaquin-alc commented 4 years ago

Hi, you must use "Viva.Graph.webglInputEvents" function. Like this:

var vivaGraphMain = Viva.Graph.graph(); var graphics = Viva.Graph.View.webglGraphics();

const events = Viva.Graph.webglInputEvents( graphics, vivaGraphMain ); events.click( YOUR FUNCTION );

Good look,