library(shiny)
library(shinyjs)
library(shinydlplot)
library(plotly)
ui <- fluidPage(
useShinyjs(),
downloadablePlotlyUI(id = 'iris')
)
server <- function(input, output, session) {
plot <- plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length)
callModule(downloadablePlotly,
id = 'iris',
plot = plot,
filename = 'iris.csv',
content = function(file) {write.csv(iris, file)})
}
if (FALSE) shinyApp(ui, server)
Run the code above in your browser using DataLab