Build a canvas component from an htmlwidget or HTML
Source:R/genui_components.R
canvas_component_widget.Rdwidget returns any htmlwidget (plotly, leaflet, reactable, ...) or
htmltools tag; it is rendered with shiny::renderUI(), so no
widget-specific output function is needed.
Arguments
- name
Component name; the model calls it as
canvas_<name>.- description
What the component shows; the model reads it.
- args
Named list of ellmer types (
ellmer::type_string(),type_enum(),type_integer(),type_array(), ...) for the arguments the model fills in. Other ellmer types cannot be re-validated on restore and are refused.- widget
function(args, data)returning an htmlwidget or tag.datais the data frame the model named indataset(orNULLwhendata = FALSE).- check
Optional
function(args, data)returningNULLwhen the arguments fit the data, or a message the model sees when they do not.datais the data frame itself.- width
One of
"auto","wide","full".- data
If
TRUE(default) the tool takes adatasetargument naming a data frame.- code
Optional
function(args, dataset)returning standalone R code that reproduces the component, used when the canvas is exported.