VivaGraphJS icon indicating copy to clipboard operation
VivaGraphJS copied to clipboard

webGlEvent for click outside node

Open ArnauC opened this issue 9 years ago • 1 comments

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!

ArnauC avatar May 04 '15 12:05 ArnauC

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;
});

zppinto avatar Oct 20 '15 14:10 zppinto