mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-11 07:58:11 -05:00
Compare commits
1 Commits
jeff-skele
...
feature/as
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e92ed4af85 |
@@ -124,6 +124,7 @@ export(reactiveValuesToList)
|
||||
export(registerInputHandler)
|
||||
export(removeInputHandler)
|
||||
export(renderDataTable)
|
||||
export(renderHTML)
|
||||
export(renderImage)
|
||||
export(renderPlot)
|
||||
export(renderPrint)
|
||||
|
||||
@@ -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
|
||||
|
||||
10
inst/examples/12_justgage/server.R
Normal file
10
inst/examples/12_justgage/server.R
Normal file
@@ -0,0 +1,10 @@
|
||||
library(shiny)
|
||||
library(rmdexamples)
|
||||
|
||||
shinyServer(function(input, output) {
|
||||
|
||||
output$gage <- renderHTML({
|
||||
justgage("Foo", 5, 1, 10)
|
||||
})
|
||||
|
||||
})
|
||||
9
inst/examples/12_justgage/ui.R
Normal file
9
inst/examples/12_justgage/ui.R
Normal file
@@ -0,0 +1,9 @@
|
||||
library(shiny)
|
||||
|
||||
shinyUI(fluidPage(
|
||||
|
||||
titlePanel("Hello Shiny!"),
|
||||
|
||||
htmlOutput("gage")
|
||||
|
||||
))
|
||||
Reference in New Issue
Block a user