I have a bizarre and very frustrating problem. When I build plotly graphs within storyboards (from the flexdashboard package), I get a very annoying and totally unnecessary scroll bar in my legend. When someone tries to click one of the dots on or off, the scroll bar twitches and its practically impossible to click the thing. This scroll bar only appears when the tab with the plotly graph is not immediately visible during the load of the page - i.e. if the page loads with some other tab selected.
I can make the same graph outside of the storyboard, with no problems either in RStudio, or saving it as an htmlwidget and loading it in Chrome. But when I load my storyboard, either in RStudio or in Chrome, I get this annoying scrollbar. The scrollbar exists whether it's a vertical or horizontal legend.
ggplotly objects do not have this problem.
Here's an example of the unnecessary scroll bar. The ggplotly graph is fine, and the plotly one has the scrollbar.
---
title: "Untitled"
output:
flexdashboard::flex_dashboard:
storyboard: true
---
```{r setup, include=FALSE}
library(flexdashboard)
```
### ggplot
```{r}
library(plotly)
carggplot <- ggplot(mtcars, aes(hp, mpg, fill = as.factor(carb))) +
geom_point() +
theme_bw()
ggplotly(carggplot)
```
### plotly
```{r}
carsplot <- plot_ly(
data = mtcars,
x = ~hp,
y = ~mpg,
color = ~as.factor(carb),
type = "scatter",
mode = "markers"
)
carsplot
```
I have been unable to find any documentation on this issue, although I found a similar problem posted by someone using the python interface to plotly.
I'm looking for a way to either turn off the scroll bar completely (while keeping the legend), or some explanation of the scroll bar's twitchy behavior.
flexdashboard is 0.5, plotly is 4.7.1, R is 64 bit 3.4.1, Windows 7.