downloadablePlot: downloadablePlot Module

Description Usage Arguments Notes Shiny Usage See Also Examples

View source: R/downloadablePlot.R

Description

Server-side function for the downloadablePlotUI. This is a custom plot output paired with a linked downloadFile button.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
downloadablePlot(
  input,
  output,
  session,
  logger,
  filenameroot,
  aspectratio = 1,
  downloadfxns = list(),
  visibleplot
)

Arguments

input

provided by shiny::callModule

output

provided by shiny::callModule

session

provided by shiny::callModule

logger

logger to use

filenameroot

the base text used for user-downloaded file - can be either a character string or a reactive expression returning a character string

aspectratio

the downloaded chart image width:height ratio (ex: 1 = square, 1.3 = 4:3, 0.5 = 1:2). Where not applicable for a download type it is ignored (e.g. data, html downloads)

downloadfxns

a named list of functions providing download images or data tables as return values. The names for the list should be the same names that were used when the plot UI was created.

visibleplot

function or reactive expression providing the plot to display as a return value. This function should require no input parameters.

Notes

When there are no values to download in any of the linked downloadfxns the button will be hidden as there is nothing to download.

Shiny Usage

This function is not called directly by consumers - it is accessed in server.R using the same id provided in downloadablePlotUI:

callModule(downloadablePlot, id, logger, filenameroot, downloadfxns, visibleplot)

See Also

downloadablePlotUI

callModule

Examples

1
2
3
4
5
6
7
8
9
# Inside server_local.R

# callModule(downloadablePlot,
#            "object_id1", 
#            logger = ss_userAction.Log,
#            filenameroot = "mydownload1",
#            aspectratio = 1.33,
#            downloadfxns = list(png = myplotfxn, tsv = mydatafxn),
#            visibleplot = myplotfxn)

periscope documentation built on July 8, 2020, 7:18 p.m.