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(dplyr)
......@@ -152,66 +152,39 @@ shinyServer
)
}
output$downloadDataUI <- renderUI({
output$downloadUI <- renderUI({
validate(need(data16S(), ""))
tags$div(
style = "text-align:center",
title = "Download file as RData",
hr(),
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, {
showModal(
modalDialog(
title = "Setting plot size",
numericInput(
"plotWidth",
label = "Plot width (cm) : ",
value = 20,
label = "Plot width : ",
value = 6,
min = 1,
max = 100
max = 50
),
numericInput(
"plotHeight",
label = "Plot height (cm) : ",
value = 20,
label = "Plot height : ",
value = 6,
min = 1,
max = 100
max = 50
),
radioButtons(
"plotUnits",
label = "Units : ",
choices = list("in", "cm", "mm"),
selected = "cm",
inline = TRUE
),
numericInput(
"plotDPI",
......@@ -225,7 +198,7 @@ shinyServer
"plotDevice",
label = "Plot device : ",
choices = list("eps", "ps", "tex", "pdf", "jpeg", "tiff", "png", "bmp", "svg"),
selected = "png"
selected = "pdf"
),
size = "s",
easyClose = TRUE,
......@@ -295,7 +268,7 @@ shinyServer
})
output$tableGlom <- DT::renderDataTable(server = FALSE, {
Glom <- tax_glom(data16S(), input$glomRank, NArm = FALSE)
Glom <- tax_glom(data16S(), input$glomRank, NArm=FALSE)
taxTableGlom <- Glom %>%
tax_table() %>%
as.data.frame(stringsAsFactors = FALSE) %>%
......
......@@ -76,9 +76,8 @@ shinyUI(dashboardPage(
# placeholder = "data.fasta"
# )
# ),
uiOutput("downloadDataUI"),
hr(),
uiOutput("downloadPlotUI"),
uiOutput("downloadUI"),
tags$div(
align = "center",
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