Skip to content

Commit

Permalink
Fixes width problem in plot_with_settings (#273)
Browse files Browse the repository at this point in the history
# Pull Request

Fixes #272
  • Loading branch information
averissimo authored Nov 26, 2024
1 parent fec9578 commit 061738f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions R/plot_with_settings.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit 061738f

Please sign in to comment.