vega_embed | R Documentation |
Helper-function to specify the embed
argument to vegawidget()
.
These arguments reflect the options to the
vega-embed
library, which ultimately renders the chart specification as HTML.
vega_embed(
renderer = c("canvas", "svg"),
actions = NULL,
defaultStyle = TRUE,
config = NULL,
patch = NULL,
bind = NULL,
...
)
renderer |
|
actions |
|
defaultStyle |
|
config |
|
patch |
|
bind |
|
... |
other named items, outlined in vega-embed options. |
The most important arguments are renderer
, actions
, and defaultStyle
:
The default renderer
is "canvas"
.
The default for actions
is NULL
, which means that the export
,
source
, and editor
links are shown, but the compiled
link is
not shown.
To suppress all action links, call with actions = FALSE
.
To change from the default for a given action link, call with a list:
actions = list(editor = FALSE)
.
The default for defaultStyle
is TRUE
, which means that action-links
are rendered in a widget at the upper-right corner of the rendered chart.
The vega-embed library has a lot
more options, you can supply these as names arguments using ...
.
For example, it is ineffective to set the width
and height
parameters
here when embedding a Vega-Lite specification, as they will be overridden
by the value in the chart specification.
list
to to be used with vega-embed JavaScript library
vega-embed library,
vegawidget()
vega_embed(renderer = "svg")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.