rstudio / shinydashboard

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

Plotly graph width & height do not stay within box #219

Closed nsittler closed 5 years ago

nsittler commented 7 years ago

I am having an issue related to a closed post (#164). I just updated my plotly package to 4.7.0.9000 and now the output graphs will not stay within the bounds of a box in my shinydashboard app. Specifying width or height arguments to plotlyOutput do not solve the issue.

Is there a way to force the plot to stay within the bounds of the box? Any help is appreciated.

box(width = 12, title = tagList(shiny::icon("flask")," Crude Yield:"), status = "primary", solidHeader = TRUE, plotlyOutput("primer_crude_od"))

An example image where it can be seen that the plot ignores both height and width arguments can be found attached. screenshot_060117_010119_pm

Anand-Anushka commented 7 years ago

I am also having the same problem. I have installed CRAN version of packages for both ggplot2 and plotly. It is showing a warning message. We recommend that you use the dev version of ggplot2 with ggplotly() Install it with: devtools::install_github('hadley/ggplot2'). It this problem is solved in github version of packages? P.S: I am not able to install github version. It is showing installation failed because 'tibble' is not available.

nicholaelaw commented 7 years ago

Same here. This is what I did to make plotly graphs behave:

To be honest, it just doesn't feel right at this point. I think I'm going to try ggplot2 or maybe ggvis and write my own controls. plotly is not touch optimized, and has layout problems even in regular Rmd.

cpsievert commented 5 years ago

When using ggplotly(), you may have to route the container's height/width the ggplotly() call. See here for an example https://github.com/ropensci/plotly/blob/master/inst/examples/shiny/ggplotly_sizing/app.R