Convert chart to a dataURL or an image.

to_dataURL(proxy)

download_image(proxy, name = "g2r")

Arguments

proxy

A g2r proxy as returned by g2Proxy

name

Name of file.

Examples

library(shiny) ui <- fluidPage( actionButton("dl", "download"), g2Output("chart") ) server <- function(input, output) { output$chart <- renderG2({ g2(cars, asp(speed, dist)) %>% fig_point() }) observeEvent(input$dl, { g2Proxy("chart") %>% download_image() }) }
# NOT RUN { shinyApp(ui, server) # }