View source: R/Widget_DownloadPlotWidget.R
DownloadPlotWidget | R Documentation |
Generic module for modal dialogs that are launched from a button.
DownloadPlotWidget( input, output, session, R.filename = reactive({ paste0(strftime(Sys.time(), "%Y%m%d_%H%M%S"), "_", "plotoutput") }), R.plot = reactive({ plot(1:3) }), static = list(tooltip = "Download this plot", title = "Download Options", label = "", icon = icon("download", lib = "font-awesome")) ) DownloadPlotWidgetUI(id)
input |
arguments necessary for use with
|
output |
arguments necessary for use with
|
session |
arguments necessary for use with
|
R.filename |
File name, without extension. |
R.plot |
The plot object (will be evaluated in plotting device of download handler) |
static |
passed on to |
id |
id to be used to define a namespace via |
Because the UI elements of the modal dialog are passed in as
reactives()$fp
, they can be namespaced and easily accessed in the
parent module that can then handle the input from the modal dialog.
tooltip
tooltip when hovering over the button
title
title of the modal dialog
label
label of the button opening the modal dialog
icon
icon()
of the button opening the modal dialog
returns its internalValues
DownloadPlotWidget
: Server logic
DownloadPlotWidgetUI
: UI elements
## Not run: ui <- function(request){ DownloadPlotWidgetUI("PlotDownload") } server <- function(input, output, session) { callModule(DownloadPlotWidget, "PlotDownload") } #Create Shiny app ---- shinyApp(ui, server) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.