Closed hadley closed 9 years ago
sparklineOutput <- function(outputId, width = "60px", height = "20px") {
htmlwidgets::shinyWidgetOutput(outputId, "sparkline", width, height)
}
# shiny render function for a widget named 'foo'
renderSparkline <- function(expr, env = parent.frame(), quoted = FALSE) {
if (!quoted) { expr <- substitute(expr) } # force quoted
htmlwidgets::shinyRenderWidget(expr, sparklineOutput, env, quoted = TRUE)
}
Done!
Could you please add so we can use this package with shiny?