downloadablePlotlyUI: UI for plotly with download data button in modebar

View source: R/downloadablePlotly.R

downloadablePlotlyUIR Documentation

UI for plotly with download data button in modebar

Description

UI for plotly with download data button in modebar

Usage

downloadablePlotlyUI(id, width = "100%", height = "auto", inline = FALSE)

Arguments

id

id string that gets namespaced by shiny::NS.

width, height

Must be a valid CSS unit (like "100%", "400px", "auto") or a number, which will be coerced to a string and have "px" appended. Note that, for height, using "auto" or "100%" generally will not work as expected, because of how height is computed with HTML/CSS.

inline

use an inline (span()) or block container (div()) for the output

Value

an HTML tag object corresponding to the UI for downloadablePlotly.

See Also

NS, downloadablePlotly

Examples

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)


shinydlplot documentation built on Nov. 19, 2022, 1:06 a.m.