Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link in tooltip #65

Open
ShKlinkenberg opened this issue May 4, 2022 · 5 comments
Open

Link in tooltip #65

ShKlinkenberg opened this issue May 4, 2022 · 5 comments

Comments

@ShKlinkenberg
Copy link

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
Copy link
Author

ShKlinkenberg commented May 9, 2022

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.

@rlderi
Copy link

rlderi commented May 11, 2022

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

@askarlupka
Copy link

@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
Copy link

@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.

@AdeelK93
Copy link
Owner

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants