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

plotDownload

parent b066cf50
......@@ -175,9 +175,24 @@ output$downloadData <- {
)
}
output$downloadPlot <- downloadHandler(
filename = function() {"plot.png"},
content = function(file) {ggsave(file)}
plotDownload <- function() {
modalDialog(
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({
......
......@@ -32,4 +32,8 @@ shinyServer
showModal(dataInput())
})
observeEvent(input$plotButton, {
showModal(plotDownload())
})
})
......@@ -23,7 +23,7 @@ dashboardHeader(title = "Easy16S"),
"Download data as RData",
icon = icon("download"),
style = "width: 80% ; color: black ; background-color: gray90"),
downloadButton("downloadPlot",
actionButton("plotButton",
"Download last plot",
icon = icon("download"),
style = "width: 80% ; color: black ; background-color: gray90"),
......
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