DownloadPlotWidget: DownloadPlotWidget

View source: R/Widget_DownloadPlotWidget.R

DownloadPlotWidgetR Documentation

DownloadPlotWidget

Description

Generic module for modal dialogs that are launched from a button.

Usage

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)

Arguments

input

arguments necessary for use with callModule()

output

arguments necessary for use with callModule()

session

arguments necessary for use with callModule()

R.filename

File name, without extension.

R.plot

The plot object (will be evaluated in plotting device of download handler)

static

passed on to ModalWidget

id

id to be used to define a namespace via NS() (must match id in callModule for the server Module)

Details

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.

static
  • 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

Value

returns its internalValues

Functions

  • DownloadPlotWidget: Server logic

  • DownloadPlotWidgetUI: UI elements

Examples

## Not run: 
ui <- function(request){
DownloadPlotWidgetUI("PlotDownload")
}
server <- function(input, output, session) {
   callModule(DownloadPlotWidget, "PlotDownload")
}
#Create Shiny app ----
shinyApp(ui, server)

## End(Not run)


mjhelf/Mosaic documentation built on April 28, 2022, 11:32 a.m.