Tooltip or Labels to appear in visnetwork when the node is selected and disappear when node is deselected

Hi Team,

I am building a R shiny app with visnetwork visualization. And the user has a requirement of making tooltips or labels to appear when the node is selected and disappear when the node is deselected. If the user selects multiple nodes, the tooltip or label must stay for those multiple nodes and that would be easy for user to take a snip for their reporting purpose.

For this I have verified many documents related to visEvents but I couldn,t find any. Also, I have a visnetwork javascript file, where I have managed to change some EventListeners and functions, but I couldn't get the desired result yet.

I have attached the screenshot of my js file below for your reference.

It would be good if I could get this working.

Any help on this is also much appreciated.

Thanks,
Jay.

Hello and welcome,
firstly what you've shared is pure javascript, so I have to wonder if you wouldn't get a greater level of support on a Javascript community forum, rather than an R one?

Secondly, I'm sure you shared your code as a screenshot/image with good intentions, however doing this removes the possibility of a fellow forum user copy and pasting your code to pick it up and try it out. You are effectively asking them to type it...
you can format text as code nicely on this forum by preceding any such text with triple backticks

```
# nice code 
```

Good luck with your project :slight_smile: