Open cderv opened 1 year ago
This is kind of related (and also reported as part of https://github.com/rstudio/rmarkdown/issues/2460
fig.width = 6; dpi = 72; fig.asp = 0.618
webshot2::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 https://github.com/rstudio/rmarkdown/issues/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 chunkFull 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