View source: R/downloadablePlotly.R
| downloadablePlotlyUI | R Documentation |
UI for plotly with download data button in modebar
downloadablePlotlyUI(id, width = "100%", height = "auto", inline = FALSE)
id |
id string that gets namespaced by |
width, height |
Must be a valid CSS unit (like |
inline |
use an inline ( |
an HTML tag object corresponding to the UI for downloadablePlotly.
NS, downloadablePlotly
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)})
}
## Not run: shinyApp(ui, server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.