visible-tooltip: Conceal & Reveal Tooltips

Description Usage Arguments Examples

Description

Conceal & reveal tooltips.

Usage

1
2
3
conceal_tooltip(proxy)

reveal_tooltip(proxy, x, y)

Arguments

proxy

A g2r proxy as returned by g2Proxy

x, y

Coordinates of tooltip

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
library(shiny)

ui <- fluidPage(
  actionButton("hide", "hide"),
  actionButton("show", "show"),
  g2Output("chart")
)

server <- function(input, output) {
  output$chart <- renderG2({
    g2(cars, asp(speed, dist)) %>% 
      fig_point() 
  })

  observeEvent(input$hide, {
    g2Proxy("chart") %>% 
      conceal_tooltip()
  })

  observeEvent(input$show, {
    g2Proxy("chart") %>% 
      reveal_tooltip(8, 16)
  })
}

## Not run: shinyApp(ui, server)

JohnCoene/g2r documentation built on March 6, 2021, 8:11 p.m.