You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In knitr we were using webshot but now default to webshot2 is installed on the user side so that we can do screenshots of html widgets to include in PDF for example. Dimensions for the screenshot is passed from value set in chunk options out.width and out.height converted in px units, except if passed in % that we keep. This means for such chunk
```{r}#| out.height="100%"library(plotly)p <- plot_ly(economics, x = ~date, y = ~unemploy / pop)p```
this will be equivalent to passing vwidth = 468 and vheight = "100%.
Simulating that outside of knitr we get the error also
> webshot2::webshot("https://github.com/rstudio/shiny", vwidth = 468, vheight = "100%")
Error in s$close() : attempt to apply non-function
I don't know if this is a chromote error only, or a webshot2 one
Or maybe v(height|width) can't be set in % - but if this is the case, then it could be checked early and error more friendly. We would also need to decide what to pass as value from knitr.
Precision on why I consider this a potential error in webshot2 - It was working with webshot
fig.width=6; dpi=72; fig.asp=0.618webshot2::webshot("https://github.com/rstudio/shiny", vwidth=fig.width*dpi, vheight=fig.width*dpi*fig.asp)
#> Error in s$close(): tentative d'appliquer un objet qui n'est pas une fonction
It seems vheight does accept only integer really.
If this is requirement, there could be some checks, and better error message. Then we can decide how to process the parameters in knitr to pass them correctly for snapshoting. webshot R package supported those values, so it is appearing just now.
This comes from rstudio/rmarkdown#2460
In knitr we were using webshot but now default to webshot2 is installed on the user side so that we can do screenshots of html widgets to include in PDF for example. Dimensions for the screenshot is passed from value set in chunk options
out.width
andout.height
converted inpx
units, except if passed in % that we keep. This means for such chunkthis will be equivalent to passing
vwidth = 468
andvheight = "100%
.Simulating that outside of knitr we get the error also
Full backtrace
I don't know if this is a chromote error only, or a webshot2 one
Or maybe
v(height|width)
can't be set in%
- but if this is the case, then it could be checked early and error more friendly. We would also need to decide what to pass as value from knitr.Precision on why I consider this a potential error in webshot2 - It was working with webshot
The text was updated successfully, but these errors were encountered: