Compare commits

...

1 Commits

Author SHA1 Message Date
JJ Allaire
e92ed4af85 add renderHTML function 2014-05-13 14:00:11 -04:00
4 changed files with 41 additions and 0 deletions

View File

@@ -124,6 +124,7 @@ export(reactiveValuesToList)
export(registerInputHandler)
export(removeInputHandler)
export(renderDataTable)
export(renderHTML)
export(renderImage)
export(renderPlot)
export(renderPrint)

View File

@@ -407,6 +407,27 @@ renderText <- function(expr, env=parent.frame(), quoted=FALSE, func=NULL) {
})
}
#' @export
renderHTML <- function(expr, env=parent.frame(), quoted=FALSE) {
installExprFunction(expr, "func", env, quoted)
markRenderFunction(htmlOutput, function() {
result <- func()
if (is.null(result) || length(result) == 0)
return(NULL)
output <- list(
html = result,
deps = attr(result, "dependencies")
)
return(output)
})
}
#' UI Output
#'
#' \bold{Experimental feature.} Makes a reactive version of a function that

View File

@@ -0,0 +1,10 @@
library(shiny)
library(rmdexamples)
shinyServer(function(input, output) {
output$gage <- renderHTML({
justgage("Foo", 5, 1, 10)
})
})

View File

@@ -0,0 +1,9 @@
library(shiny)
shinyUI(fluidPage(
titlePanel("Hello Shiny!"),
htmlOutput("gage")
))