VivaGraphJS
VivaGraphJS copied to clipboard
webGlEvent for click outside node
Hi, thankcs for the precious help you use to provide me, I come with another question:
Is there any way to register the event of a click outside a node, I mean a click in the void space?
I want to highlight the related nodes when I click in a node, but I want to unhighlight them when clicking in the void space.
Any ideas?
Thank you very much!
What I've done to accomplish that was:
- on mouse enter event
graph.forEachLinkedNode(node.id, function(node, link){
var linkUI = graphics.getLinkUI(link.id);
linkUI.color = 65535; //set to blue color
});
- on mouse leave event
graph.forEachLinkedNode(node.id, function(node, link){
var linkUI = graphics.getLinkUI(link.id);
convertedColor = Viva.Graph.View._webglUtil.parseColor(link.stroke); //it was the way I've found out for this too work (it replaces the mouseover color to the default color value)
linkUI.color = convertedColor;
});