rstudio / shinydashboard

Shiny Dashboarding framework
https://rstudio.github.io/shinydashboard/
Other
886 stars 300 forks source link

ggplot overflows from box when height is defined in renderPlot() #338

Closed Ljupch0 closed 4 years ago

Ljupch0 commented 4 years ago

I have noticed that whenever I define height in renderPlot(), and put the resulting output in a box(), the plot overflows the box.

I have seen that the solution for this is to define the height in box() as well, but I cannot do this in my case as the plot height is reactive and dynamically generated. I think it's not possible to use reactive values directly in the shiny UI.

Ljupch0 commented 4 years ago

The solution with dynamic UI elements is renderUI and uiOutput. The entire ui component is placed inside renderUI and uses any reactive values. With input changes it generates the UI and uiOutput displays it.