frameWidget: A widget that wraps another widget inside a responsive...

Description Usage Arguments Details See Also Examples

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

1
2
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

1
2
3
4
5
## Not run: 
l <- leaflet() %>% addTiles() %>% setView(0,0,1)
frameWidget(l)

## End(Not run)

widgetframe documentation built on May 1, 2019, 7:05 p.m.