Build a canvas component from a Shiny output
Source:R/genui_components.R
canvas_component_output.RdWraps any *Output() / render*() pair – base Shiny, or a package such
as plotly (plotlyOutput / renderPlotly) – as a canvas component.
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.- output
An output constructor taking an output id, e.g.
shiny::plotOutput.- render
function(args, data)returning a render function, e.g.shiny::renderPlot(...).datais a function returning 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.