Implement individual hints and hints with ggvis

I want to implement a hover tip to view the details and a hint for all the details, which includes some hyperlinks. I can implement them separately, but when they are implemented together, the hover action also kills the click on on mouseout hint. 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

+4
source share

Source: https://habr.com/ru/post/1677197/


All Articles