rAmCharts-shinymodules {rAmCharts} | R Documentation |
Shiny module to export rAmCharts graphics on server-side
Description
This function need the base64enc
package to save image.
Usage
rAmChartsExportServerUI(id)
rAmChartsExportServer(
input,
output,
session,
list_am_graph,
path = shiny::reactive(tempdir()),
mode = "single",
progress = T,
message = "Calculation in progress",
detail = "This may take a while..."
)
Arguments
id |
character, used to specify namesapce, see |
input |
standard, |
output |
standard, |
session |
standard, |
list_am_graph |
named list, reactive expression with all amCharts to export
|
path |
character, directory. tempdir() by Defaut |
mode |
character, 'single' : graphics are rendered and saved one by one. 'multiple' all at same time |
progress |
boolean, set a progress bar or not ? |
message |
character, if progress, message. Defaut to "Calculation in progress" |
detail |
character, if progress, detail. Defaut to "This may take a while...' |
Value
a reactive expression
Examples
## Not run:
# ui
rAmChartsExportServerUI("export_server_graphs")
# server
mult_amgraph <- reactive({
if(input$goSave > 0){
isolate({
list(
list(graph = amPie(data = data_pie), name = "pie.jpg", height = "200px", width = "300px"),
list(graph = amBarplot(x = "country", y = "visits", data = data_bar, main = "example") %>%
setExport(), name = "bar.jpg", height = "600px")
)
})
} else {
NULL
}
})
callModule(rAmChartsExportServer, "export_server_graphs", mult_amgraph,
reactive("/home/benoit/amchart_export"))
## End(Not run)