-
Notifications
You must be signed in to change notification settings - Fork 633
Issue with plotlyOutput width argument #1036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Just noticed something interesting ... as I change the size of the viewer panel in Rstudio, the size of the plot changes in the browser (after refresh). |
I'm not sure specifying For now, you can specify height/width in |
Ok, yea, that's definitely a problem. Does the same thing happen if you launch the app outside of RStudio? |
Also, BTW, an official fix for this may take a bit, but for now, if you want the old behavior back: l <- ggplotly(qplot(1:10))
l$x$layout$width <- NULL
l$x$layout$height <- NULL
l$width <- NULL
l$height <- NULL
l |
The issue doesn't seems to occur outside of Rstudio. The fix does seems to work from Rstudio. |
Works! Thanks @cpsievert |
@cpsievert The fix works for dynamically adjusting the plotly output wrt width. However, the height of the plot is not dynamically adjusting to the browser window. |
It seems width+height in |
Could you be more specific by "doesn't work"? Both height/width seem to work for me. |
the height and width arguments seem to be completely ignored when used in plotlyOutput in a shiny app
Actually, after doing a specific small code example I think that the container is set to the proper dimensions, but the plot isn't. Example:
Result: Notice that the small plot (which is p2) looks like it's starting 100px down, meaning the p1 actually does think it's only 100px tall, but the plot itself is regular sized. Hope that makes sense |
Changes have been made here since 4.7.0 -- 7a8ee9c Can you please try with a more recent version? |
Ah yes the dev version works! The bug report title is for v 4.7.0 so I thought that was the latest |
I was seeing this issue with the newest dev version - reverting back to 4.7.1 version on CRAN did fix the issue though. |
Still seeing this issue in 4.9.0 when using plotlyOutput inside renderUI. Setting the plotlyOutput width to "auto" results in a plot that is too small width-wise, and setting the width to NULL removes the height style attribute alltogether. Setting the width to 100% doesn't work at all, the app just crashes. |
Same install with 4.6.0 the width arguments works fine. After upgrading to 4.7.0 the default width is very narrow and changing the width setting has no effect in the browser. After reinstalling 4.6.0 the width argument works fine again. Any ideas?
The text was updated successfully, but these errors were encountered: