Description Usage Arguments Details Value Examples
Helpers to create output and render functions for using HTML widgets within Shiny applications and interactive Rmd documents.
1 2 3 4 | shinyWidgetOutput(outputId, name, width, height, package = name,
inline = FALSE)
shinyRenderWidget(expr, outputFunction, env, quoted)
|
outputId |
output variable to read from |
name |
Name of widget to create output binding for |
width, height |
Must be a valid CSS unit (like |
package |
Package containing widget (defaults to |
inline |
use an inline ( |
expr |
An expression that generates an HTML widget |
outputFunction |
Shiny output function corresponding to this render function. |
env |
The environment in which to evaluate |
quoted |
Is |
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).
An output or render function that enables the use of the widget within Shiny applications.
1 2 3 4 5 6 7 8 9 10 | # 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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.