widgetDownload: Download widgets as html

Description Usage Arguments Examples

View source: R/downloadWidget.R

Description

Shiny module to save shiny widgets as html files. Internally, the conversion is done with htmlwidgets::saveWidget.

Usage

1
2
3
widgetDownload(input, output, session, rWidget, filename = "widget.html")

widgetDownloadUI(id, btnText = "Download widget")

Arguments

input, output, session

Standard shiny module parameters

rWidget

A reactive returning a shiny widget

filename

Argument to be passed to shiny::downloadHandler

id

The id of the module

btnText

The text appearing on the download button

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
shinyApp(
  fluidPage(widgetDownloadUI("wd")),
  function(input, output, session) {
    callModule(widgetDownload, "wd", reactive({ DT::datatable(mtcars) }))
  }
)

## End(Not run)

statistikat/codeModules documentation built on Feb. 17, 2021, 11:42 a.m.