Commit 072f854c authored by Midoux Cedric's avatar Midoux Cedric
Browse files
parent f41208ce
invisible(sapply(list.files('src', full.names = TRUE), source))
......@@ -69,6 +69,7 @@ output$barplotUI <- renderUI({
uiOutput("barplotNbTaxaUI"),
uiOutput("barplotGridUI"),
uiOutput("barplotXUI"),
#downloadButton('downloadPlot', 'Download Plot'),
collapsedBox(verbatimTextOutput("barplotScript"), title = "RCode")
)
})
......@@ -104,7 +105,7 @@ output$barplotScript <- renderText({
return(glue_collapse(script, sep = "\n"))
})
output$barplot <- renderPlot({
plotBarplot <- reactive({
validate(
need(data16S(), "Requires an abundance dataset"),
need(input$barplotShowRank, "")
......@@ -122,3 +123,16 @@ output$barplot <- renderPlot({
}
return(p)
})
callModule(plotDownload, "barplot" ,plotBarplot)
# output$barplot <- renderPlot({plot()})
# output$downloadPlot <- downloadHandler(
# filename = "barplot.png",
# content = function(file) {
# png(file)
# print(plot())
# dev.off()
# }
# )
barplot <-fluidPage(withLoader(plotOutput("barplot", height = 700)),
uiOutput("barplotUI"))
barplot <-fluidPage(plotDownloadUI("barplot"),
#withLoader(plotOutput("barplot", height = 700)),
uiOutput("barplotUI")
)
plotDownloadUI <- function(id, height = 400) {
ns <- NS(id)
tagList(
fluidRow(
plotOutput(ns('plot'), height = height)
),
fluidRow(
column(
2, offset = 10,
downloadButton(ns("download_plot"), "Download figure")
)
)
)
}
plotDownload <- function(input, output, session, plotFun) {
output$plot <- renderPlot({
plotFun()
})
output$download_plot <- downloadHandler(
filename = function() {
"plot.png"
},
content = function(file) {
ggsave(file, plotFun(), width = 16, height = 10.4)
}
)
}
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