Commit 96394afa authored by Midoux Cedric's avatar Midoux Cedric

Revert "download the last plot"

This reverts commit 77c6fbbe.
parent 77c6fbbe
options(shiny.maxRequestSize = 30 * 1024 ^ 2) options(shiny.maxRequestSize = 30*1024^2)
library(shinydashboard) library(shinydashboard)
library(dplyr) library(dplyr)
...@@ -152,66 +152,39 @@ shinyServer ...@@ -152,66 +152,39 @@ shinyServer
) )
} }
output$downloadDataUI <- renderUI({ output$downloadUI <- renderUI({
validate(need(data16S(), "")) validate(need(data16S(), ""))
tags$div( tags$div(
style = "text-align:center", style = "text-align:center",
title = "Download file as RData", title = "Download file as RData",
hr(),
downloadButton("downloadData", "Download RData file", style = "color: black; background-color: gray90") downloadButton("downloadData", "Download RData file", style = "color: black; background-color: gray90")
) )
}) })
# current_plot <- reactive({last_plot()})
output$downloadPlotUI <- renderUI({
# validate(need(current_plot(), "azerty"))
tags$div(
style = "text-align:center",
title = "Download the last plot",
downloadButton("downloadPlot", "Download the last plot", style = "color: black; background-color: gray90")
)
})
output$downloadPlot <- {
downloadHandler(
filename = function() {
paste("Easy16S-plot",
ifelse(is.null(input$plotDevice), "png", input$plotDevice),
sep = ".")
},
content = function(file) {
ggsave(
file,
last_plot(),
device = ifelse(is.null(input$plotDevice), "png", input$plotDevice),
units = "cm",
width = ifelse(is.null(input$plotWidth), NA, input$plotWidth),
height = ifelse(is.null(input$plotHeight), NA, input$plotHeight),
dpi = ifelse(is.null(input$plotDPI), 300, input$plotDPI),
limitsize = FALSE
)
}
)
}
observeEvent(input$plotSize, { observeEvent(input$plotSize, {
showModal( showModal(
modalDialog( modalDialog(
title = "Setting plot size", title = "Setting plot size",
numericInput( numericInput(
"plotWidth", "plotWidth",
label = "Plot width (cm) : ", label = "Plot width : ",
value = 20, value = 6,
min = 1, min = 1,
max = 100 max = 50
), ),
numericInput( numericInput(
"plotHeight", "plotHeight",
label = "Plot height (cm) : ", label = "Plot height : ",
value = 20, value = 6,
min = 1, min = 1,
max = 100 max = 50
),
radioButtons(
"plotUnits",
label = "Units : ",
choices = list("in", "cm", "mm"),
selected = "cm",
inline = TRUE
), ),
numericInput( numericInput(
"plotDPI", "plotDPI",
...@@ -225,7 +198,7 @@ shinyServer ...@@ -225,7 +198,7 @@ shinyServer
"plotDevice", "plotDevice",
label = "Plot device : ", label = "Plot device : ",
choices = list("eps", "ps", "tex", "pdf", "jpeg", "tiff", "png", "bmp", "svg"), choices = list("eps", "ps", "tex", "pdf", "jpeg", "tiff", "png", "bmp", "svg"),
selected = "png" selected = "pdf"
), ),
size = "s", size = "s",
easyClose = TRUE, easyClose = TRUE,
...@@ -295,7 +268,7 @@ shinyServer ...@@ -295,7 +268,7 @@ shinyServer
}) })
output$tableGlom <- DT::renderDataTable(server = FALSE, { output$tableGlom <- DT::renderDataTable(server = FALSE, {
Glom <- tax_glom(data16S(), input$glomRank, NArm = FALSE) Glom <- tax_glom(data16S(), input$glomRank, NArm=FALSE)
taxTableGlom <- Glom %>% taxTableGlom <- Glom %>%
tax_table() %>% tax_table() %>%
as.data.frame(stringsAsFactors = FALSE) %>% as.data.frame(stringsAsFactors = FALSE) %>%
......
...@@ -76,9 +76,8 @@ shinyUI(dashboardPage( ...@@ -76,9 +76,8 @@ shinyUI(dashboardPage(
# placeholder = "data.fasta" # placeholder = "data.fasta"
# ) # )
# ), # ),
uiOutput("downloadDataUI"),
hr(), hr(),
uiOutput("downloadPlotUI"), uiOutput("downloadUI"),
tags$div( tags$div(
align = "center", align = "center",
actionButton("plotSize", label = "Plot size") actionButton("plotSize", label = "Plot size")
......
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