4

I want to implement a hover tooltip to view a summary detail and a click tooltip for full details, which includes some hyperlinks. I can implement these separately, but when implemented together the hover action also kills the click tooltip on on mouseout. Any ideas for a workaround?

require(ggvis); require(shiny)

headline = function(x) "Now click on the point"
all_values = function(x) "<a href='http://google.com/'>I want to click here</a>"

server = function(input, output, session) {
  observe({
    ggvis(mtcars, ~disp, ~mpg) %>% layer_points() %>%
      add_tooltip(headline, 'hover') %>%
      add_tooltip(all_values, 'click') %>% 
      bind_shiny('ggvis_plot', 'ggvis_ui')
  })
}

ui = fluidPage( uiOutput("ggvis_ui"), ggvisOutput("ggvis_plot"))
shinyApp(ui, server)

enter image description here

geotheory
  • 22,624
  • 29
  • 119
  • 196

0 Answers0