Description Usage Arguments Details See Also Examples
This function augments a htmlwidget so that when saved, the resulting HTML document can be rendered correctly inside a responsive iframe (created using Pym.js) of another HTML document.
1 | frameableWidget(widget, renderCallback = NULL)
|
widget |
The widget to add the pymjs code to. |
renderCallback |
An optional Javascript function wrapped in |
Generate your htmlwidget in the normal way and then call this function
passing in your widget. Then call saveWidget()
and
the saved HTML file is now embeddable inside a Pym.js iframe of another HTML document.
See Pym.js documentation on how to
create an HTML document with a responsive iframe.
1 2 3 4 5 6 7 | ## Not run:
library(leaflet)
l <- leaflet() %>% addTiles() %>% setView(0,0,1)
htmlwidgets::saveWidget(
widgetframe::frameableWidget(l),'some-directory-on-your-disk')
## End(Not run)
|
Loading required package: htmlwidgets
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.