frameWidget {widgetframe} | R Documentation |
A widget that wraps another widget inside a responsive iframe.
Description
Uses Pym.js. Pym.js embeds and resizes an iframe responsively (width and height) within its parent container. It also bypasses the usual cross-domain issues.
Usage
frameWidget(targetWidget, width = "100%", height = NULL,
elementId = NULL, options = frameOptions())
Arguments
targetWidget |
The widget to embed inside an iframe. |
width |
Defaults to 100 100, 200 (in pixel). This will override the width of the enclosed widget. |
height |
Defaults to NULL. You can either specify '10 100, 200 (in pixel). This will override the height of the enclosed widget. |
elementId |
The element ID of the parent widget. |
options |
Options for the iframe. |
Details
This widget can be used in places where a HTML page's CSS rules or Javascript code can cause issues in a widget. Wrapping your widgets this way allows for the widget code to be unaffected by the parent HTML's CSS/JS. The target widget is conveniently displaed in a responsive iframe and not subject to parent HTML's CSS/JS.
See Also
frameOptions()
.
Examples
## Not run:
l <- leaflet() %>% addTiles() %>% setView(0,0,1)
frameWidget(l)
## End(Not run)