Must be a valid CSS unit (like "100%",
"400px", "auto") or a number, which will be coerced to a
string and have "px" appended.
package
Package containing widget (defaults to name)
inline
use an inline (span()) or block container (div())
for the output
expr
An expression that generates an HTML widget
outputFunction
Shiny output function corresponding to this render
function.
env
The environment in which to evaluate expr.
quoted
Is expr a quoted expression (with quote())? This
is useful if you want to save an expression in a variable.
Details
These functions are delegated to from within your widgets own shiny
output and render functions. The delegation is boilerplate and always works
the same for all widgets (see example below).
Value
An output or render function that enables the use of the widget
within Shiny applications.
Examples
# shiny output binding for a widget named 'foo'
fooOutput <- function(outputId, width = "100%", height = "400px") {
htmlwidgets::shinyWidgetOutput(outputId, "foo", width, height)
}
# shiny render function for a widget named 'foo'
renderFoo <- function(expr, env = parent.frame(), quoted = FALSE) {
if (!quoted) { expr <- substitute(expr) } # force quoted
htmlwidgets::shinyRenderWidget(expr, fooOutput, env, quoted = TRUE)
}