Capturing threejs widgets in R Markdown using Rmdshot function of webshot

49 Views Asked by At

I have written a R markdown file given below.

---
title: "Embedding 3D htmlwidget into R Markdown"
output: html_document
---

<!-- Setting up the widgets -->
```{r setup, include=FALSE}
library(threejs)

# Create a threejs widget
data(LeMis) # load the LeMis igraph data
widget <- graphjs(LeMis, bg="white")
```

<!-- now lets view the widgets -->
```{r}
widget 
```

My target is to take a screenshot using rmdshot function of webshot package. I have written another R file in same location to perform the same.

library(webshot)

# render Rmd and take screenshot
rmdshot("./test7.Rmd", delay = 10, file = "./rmd_screenshot.png")

I have added delay of 10 s and even tried with higher values to complete the render yet the screenshot is blank without widget as shown below.

screenshot

Where am I going wrong, please guide me thorugh the process, I am a beginner to R programming and still learning.

I was try to take a screenshot of widget in a R markdown file using rmdshot of webshot package but failed to do so, require help!

0

There are 0 best solutions below