Commit 5a66fa87 authored by Midoux Cedric's avatar Midoux Cedric

plotDownload

parent b066cf50
...@@ -175,9 +175,24 @@ output$downloadData <- { ...@@ -175,9 +175,24 @@ output$downloadData <- {
) )
} }
output$downloadPlot <- downloadHandler( plotDownload <- function() {
filename = function() {"plot.png"}, modalDialog(
content = function(file) {ggsave(file)} title = "Download last modified plot",
size = "s",
textInput("plotName", "File name : ", value = "plot"),
numericInput("plotWidth", "Width : ", value = 7),
numericInput("plotHeight", "Height : ", value = 7),
numericInput("plotDPI", "DPI : ", value = 300),
radioButtons("plotFormat", "File format : ", choices = c("png", "pdf", "jpeg", "svg", "wmf"), selected = 1, inline = TRUE),
footer = tagList(modalButton("Cancel"),
downloadButton("okPlot", "Download")
)
)
}
output$okPlot <- downloadHandler(
filename = function() {paste(input$plotName, input$plotFormat, sep = ".")},
content = function(file) {ggsave(file, width = input$plotWidth, height = input$plotHeight, dpi = input$plotDPI)}
) )
# output$rarefactionMin <- renderText({ # output$rarefactionMin <- renderText({
......
...@@ -32,4 +32,8 @@ shinyServer ...@@ -32,4 +32,8 @@ shinyServer
showModal(dataInput()) showModal(dataInput())
}) })
observeEvent(input$plotButton, {
showModal(plotDownload())
})
}) })
...@@ -23,8 +23,8 @@ dashboardHeader(title = "Easy16S"), ...@@ -23,8 +23,8 @@ dashboardHeader(title = "Easy16S"),
"Download data as RData", "Download data as RData",
icon = icon("download"), icon = icon("download"),
style = "width: 80% ; color: black ; background-color: gray90"), style = "width: 80% ; color: black ; background-color: gray90"),
downloadButton("downloadPlot", actionButton("plotButton",
"Download last plot", "Download last plot",
icon = icon("download"), icon = icon("download"),
style = "width: 80% ; color: black ; background-color: gray90"), style = "width: 80% ; color: black ; background-color: gray90"),
sidebarMenu( sidebarMenu(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment