coatless / quarto-webr

Community developed Quarto Extension to Embed webR for HTML Documents, RevealJS, Websites, Blogs, and Books.
https://quarto-webr.thecoatlessprofessor.com/
394 stars 19 forks source link

Supporting `browse` type so htmlwidgets can be viewed from webR #223

Closed dipterix closed 1 month ago

dipterix commented 2 months ago

This PR paves the path for Step 2 mentioned in the issue https://github.com/coatless/quarto-webr/issues/222

coatless commented 1 month ago

Thanks! I added some documentation.

Do you have an example that you want to include to show that it is working? (Code is fine, I can handle the prose.)

dipterix commented 1 month ago

Thanks for consider this PR! I would love to add my own WebGL widget but considering that the package is pretty heavy-weighted (~300MB including packages and data), I would just suggest the code mentioned in the issue page : )

library(dygraphs)
view <- function(widget) {
    webr::viewer_install()
    path <- save_selfcontained(v)
    getOption("viewer")(path)
}

v <- dygraph(nhtemp, main = "New Haven Temperatures") %>% 
  dyRangeSelector(dateWindow = c("1920-01-01", "1960-01-01"))
view(v)