Collapsible Tree with Boxes - Link Tooltips Bugs

I’m using the collapsible tree with boxes example found here.

I haven’t been able yet to get any response from the developer.

Everything works fine except for the tooltips on the links. I list the issues below. I’ve tried a number of things and solved several issues with these particular tooltips, but the ones below have me stuck. In the code you will see indicated the changes I’ve made to make the link tooltips more functional.

  1. As long as you don’t collapse any part of the tree, the link tooltips work Ok, except for the fact that I can’t get the link tooltip boxes (rects) and their text contents to re-position together so they appear closer to the links they are associated with. I have the rects and the text in a ‘g’ element with translation, but when I attempt to reposition things the text drifts away from the rects.

  2. If you do collapse any part of the tree, the remaining link tooltips popups experience notable shifting of the text away from the rects.

  3. When you expand the node(s) that were collapsed, the tooltips for those now-restored links drift way off to the lower-right corner of the browser window.

I’m currently at a loss as to what to try next. Please access the complete code and sample data here.

Additional notes:

When not using the mods I made, noted in the .js file, namely, when not appending the linkTooltips rect and text elements inside a ‘g’ element with translation, then every time you collapse any part of the tree, then expand, the tooltips rect and text elements just keep multiplying in the DOM. It’s as if none of the collapsed tooltips elements get removed. So that group of elements keeps bloating.

However - one thing that does work correctly in that case is that re-expanded portions’ of the tree do work correctly as far as the link tooltips are concerned. But the issue remains of the tooltip rect and the tooltip text drifting away from each other on the non-collapsed part of the tree.

So my mods haven’t really fixed anything except the bloating of the tooltip elements in the DOM, and in the process issue #3 was created by my mods.

So Issue #1 and #2 are relevant and valid issues - and also what about the bloating of the DOM when you back out my problematic mods?