Skip to content

Commit

Permalink
Fixed reactivity of plot download buttons
Browse files Browse the repository at this point in the history
Also, used req() with the 'order.by' parameter of plot_upset to avoid errors in shiny
  • Loading branch information
gavieira committed Dec 2, 2023
1 parent 90c7136 commit 1d9830a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions inst/biblioverApp/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ server <- function(input, output, session) {
})

upset_plot <- reactive ({
req(input$order.by)
biblioverlap::plot_upset(calculate_results()$db_list,
nsets = length(calculate_results()$db_list),
nintersects = input$nintersects,
Expand Down Expand Up @@ -262,7 +263,7 @@ server <- function(input, output, session) {
name
},
content = function(file) {
ggplot2::ggsave(file, plot = plot_obj,
ggplot2::ggsave(file, plot = plot_obj(),
limitsize = FALSE,
bg = 'white',
height = input$plot_height,
Expand All @@ -274,11 +275,11 @@ server <- function(input, output, session) {
}


output$download_summary <- download_plot('summary_plot.png', summary_plot())
output$download_summary <- download_plot('summary_plot.png', summary_plot)

output$download_venn <- download_plot('venn_plot.png', venn_plot())
output$download_venn <- download_plot('venn_plot.png', venn_plot)

output$download_upset <- download_plot('upset_plot.png', upset_plot())
output$download_upset <- download_plot('upset_plot.png', upset_plot)


# Function to merge multiple input_files
Expand Down

0 comments on commit 1d9830a

Please sign in to comment.