collapsibleTree icon indicating copy to clipboard operation
collapsibleTree copied to clipboard

Link in tooltip

Open ShKlinkenberg opened this issue 2 years ago • 5 comments

Hi @AdeelK93

I want to create a collapsibleTreeNetwork with a link in the tooltip. I have forked your repo so I could change the mouseout function for hiding the tooltip. I now have some time to actually go to the link. Though the link is not clickable. My three can be found here, and the code here.

I have read this article so I would think it would be possible in D3. Though while looking at the code i do not see a difference in approach.

Do you have any suggestions to get this to work?

ShKlinkenberg avatar May 04 '22 12:05 ShKlinkenberg

I managed to solve it. Two things needed to be changed

  1. Mouseout needed to be deleted to allow the permanent visibility of the tooltip.
  2. In the CSS for the htmlwidget, collapsibleTree.css, the pointer-event needed to be deleted to allow mouse click.

It would be cool to add tooltipPermanent as an additional argument in the collapsibleTree function.

ShKlinkenberg avatar May 09 '22 12:05 ShKlinkenberg

@ShKlinkenberg thank you, I have tried to do this previously and failed.

rlderi avatar May 11 '22 12:05 rlderi

@ShKlinkenberg I'm wanting to add a tooltipHTML to my tree, but one that is made with the collapsibleTree() function instead of collapsibleTreeNetwork() function. Currently, collapsibleTree() only allows for numeric tooltips, unless it's in the flat network format and paired with collapsibleTreeNetwork(). However, my nodes do not have unique names and are in a nested lists.

Any suggestions on trying to get strings/HTML to show up for collapsibleTree()? I'm attempting to either make a dataframe that can be read into collapsibleTreeNetwork, or change the underlying code for collapsibleTree to allow for character class arguements for tooltip. But I'm not sure which will be doable.

askarlupka avatar Aug 25 '22 17:08 askarlupka

@ShKlinkenberg I think I figured it out. For future reference I changed the code for collapsibleTree.Node in line 18 from

if(!is.null(tooltipHtml)) if(!(tooltipHtml %in% df$attributes)) stop("tooltipHtml column name is incorrect") to if(!is.null(tooltipHtml)) if(!(tooltipHtml %in% df$attributesAll)) stop("tooltipHtml column name is incorrect")

So far it seems to be working as expected.

askarlupka avatar Aug 25 '22 18:08 askarlupka

@askarlupka good catch. I know I haven't been great at maintaining this, but if you want to PR that, I can put out a release

AdeelK93 avatar Sep 13 '22 03:09 AdeelK93