Tooltip problems force directed graph

Hello again.

I’ve created a force directed graph with the nodes rendered after the links.

When the user mouses over a node, a tooltip appears and disappears with mouseout.

However, this doesn’t work cosistently. Sometimes hovering over a node does not display a tooltip. However, when I hover over another node that does display a tooltip and re-hover over the node which first didn’t work, voila it works now.

This seems to be related to when many nodes are packed together, but I cannot prove this.

This is very strange behavior and trying painstakingly to debug the problem leaves me empty handed.

Any ideas what I might be doing wrong?

Without being able to see your graph or the code that made it, it will be pretty much impossible to figure out what’s going on. Can you share what you’re working on in an Observable Notebook or something like a JSFiddle?

I was able to solve the problem on my own.

Turns out that for the ‘mouseout’ event, I need to set the visibility to hidden.