From 061738f44dfa36b7adfd19ff2188f50d4a841299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ver=C3=ADssimo?= <211358+averissimo@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:27:31 +0000 Subject: [PATCH] Fixes width problem in `plot_with_settings` (#273) # Pull Request Fixes #272 --- R/plot_with_settings.R | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/R/plot_with_settings.R b/R/plot_with_settings.R index 2efeba6b..482fdd59 100644 --- a/R/plot_with_settings.R +++ b/R/plot_with_settings.R @@ -372,8 +372,19 @@ plot_with_settings_srv <- function(id, } }) - p_height <- reactive(`if`(!is.null(input$height), input$height, height[1])) - p_width <- reactive(`if`(!is.null(input$width), input$width, default_slider_width()[1])) + p_height <- reactive(if (!is.null(input$height)) input$height else height[1]) + p_width <- reactive( + if (!is.null(input$width)) { + input$width + } else { + if (!is.null(default_slider_width()[1])) { + default_slider_width()[1] + } else { + # Fallback to "auto" + "auto" + } + } + ) output$plot_main <- renderPlot( apply_plot_modifications( plot_obj = plot_suppress(plot_r()),