rAmCharts-shinymodules: Shiny module to export rAmCharts graphics on server-side

Description Usage Arguments Value Examples

Description

This function need the base64enc package to save image.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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 shiny::NS

input

standard, shiny input

output

standard, shiny output

session

standard, shiny session

list_am_graph

named list, reactive expression with all amCharts to export

  • "graph"rAmCharts object to export

  • "name"character, name of file, with ".jpg" extension

  • "width"Optionnal, character. Linked to amChartsOutput

  • "height"Optionnal, character. Linked to amChartsOutput

  • "type"Optionnal, character. Linked to amChartsOutput

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## 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)

rAmCharts documentation built on Dec. 6, 2019, 5:11 p.m.