6

I would like to make a clickable hyperlink in a tooltip text in ggplotly. The hyperlink does seem to appear in the tooltip, but it can't be clicked. Before I can click, the tooltip dissappears. How can I make the tooltip appear long enough for me to click the hyperlink?

Here's an example of what I mean:

mtcars$hyperlink <- "<a href='https://plot.ly/ggplot2/'>plotly ggplot2 website</a>"
p <- ggplot(mtcars, aes(wt, mpg, text = hyperlink)) + 
  geom_point()
ggplotly(p)

You will notice the unclickable hyperlink. Has anyone an idea about how to solve this?

rdatasculptor
  • 8,112
  • 14
  • 56
  • 81

1 Answers1

0

paste0("<a href='",lu_url,"' target='_blank'>",lu_url,"","</a>")) works for me ... but now the tooltip disappears when the cursor moves :(

Sarah
  • 25
  • 4
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 28 '22 at 09:11