Conceal & reveal figures.

conceal(proxy, figures = NULL)

reveal(proxy, figures = NULL)

Arguments

proxy

A g2r proxy as returned by g2Proxy

figures

Index of figures to apply the change to.

Examples

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() %>% fig_line() }) observeEvent(input$hide, { g2Proxy("chart") %>% conceal() }) observeEvent(input$show, { g2Proxy("chart") %>% reveal() }) }
# NOT RUN { shinyApp(ui, server) # }