The rgl
widget responds to the figure width and height specified in knitr code chunk options, e.g.
```{r fig.width=2, fig.height=2}
library(rgl); example(plot3d);
rglwidget()
```
gives a small plot (192 x 192 on my screen). However, if I put rglwidget()
in a browsable tagList, it doesn't:
```{r fig.width=2, fig.height=2}
library(rgl); example(plot3d)
library(htmltools)
browsable(tagList(rglwidget(), rglwidget()))
```
This gives two full size widgets. Debugging the Javascript shows that each is being initialized as 960 by 500, not 192 by 192 as in the first example.
Is there a way to say that I want the width and height values to be passed into the widgets in the tagList?
P.S. This has nothing to do with rgl
; leaflet
has the same problem in
```{r fig.width=2, fig.height=2}
library(leaflet); library(htmltools)
browsable(tagList(leaflet() %>% addTiles())
```