View source: R/ptt_plot_widget.R
ptt_plot_create_widget | R Documentation |
Writes an html element for embedding, and optionally png files.
ptt_plot_create_widget(
p,
title,
filepath,
render = T,
self_contained = F,
png_artefacts,
png_folder,
iframe_height = "550px"
)
p |
A plotly object. |
title |
The filename of the html element (without file format). The function will clean the name up, or try to extract it from param p if missing. |
render |
Logical. Is the plot rendered to viewer after saving the widget (default true). Returns the plot object nonetheless. |
self_contained |
Logical. Will the html artefact have self-contained dependencies, increasing size. Default false. |
png_artefacts |
Optional character vector of s(mall), n(arrow), and/or w(ide) corresponding to the expected .png sizes. |
png_folder |
A folder to save png-files. |
path |
The path of the saved file. When knitting and .Rmd file, the a folder is created matching the file name of the currently knit document and the path is set there. |
iframe_heigh |
A height of the iframe. |
The plotly object p.
p |> ptt_plot_create_widget()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.