View source: R/webshot_shiny.R
webshot_shiny | R Documentation |
The webshot_shiny()
function is designed to create the screenshot image of
a Shiny application, with an icon suggesting to click on it for launching
the application. The image created can then be used by launch_shiny()
in
a bookdown to differ the start of Shiny application, while displaying useful
information to the user (how the Shiny application would look like if it was
started).
webshot_shiny(
url,
app = NULL,
imgdir = "images/shinyapps",
img = paste0(imgdir, "/", app, ".png"),
width = 790,
height = 500,
offsetx = 30,
offsety = 30,
delay = 10,
...
)
url |
The URL to launch the Shiny app, or to a screenshot of the app in PNG format. |
app |
The name of the Shiny application. If |
imgdir |
The directory without trailing "/" where images relative
to Shiny applications are stored. By default, it is relative to current
directory, in |
img |
The path to the image that is created. Not needed if |
width |
The requested weight of the screenshot (it may differ if the Shiny application defines other (limit) values. |
height |
The requested height of the screenshot (idem). |
offsetx |
The offset from left where to place the click icon in pixels. |
offsety |
The offset to bottom where to place the click icon in pixels. |
delay |
Time to wait (in sec) after the Shiny application has started and before the screenshot is taken. If the screenshot does not contain the complete application UI, try increase this value. |
... |
Further arguments passed to |
The path to the created image, invisibly.
launch_shiny()
## Not run:
# We wait 10 sec to make sure it is loaded when the screenshot is taken
(webshot_shiny("https://phgrosjean.shinyapps.io/histogram/", delay = 10))
# Now, look at this image. You can use it with launch_shiny()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.