mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-06 20:55:24 -05:00
use html builder for example 2
This commit is contained in:
@@ -2,12 +2,9 @@ library(shiny)
|
||||
|
||||
client <- clientPage(
|
||||
|
||||
textInput("val",
|
||||
label = "Input:",
|
||||
value = "Hello, World!",
|
||||
labelOnTop = TRUE),
|
||||
textInput("val", caption = "Input:", initialValue = "Hello, World!"),
|
||||
|
||||
p("You said:"), shinyText("valUpper")
|
||||
textOutput("valUpper", caption = "You said:")
|
||||
)
|
||||
|
||||
server <- function(input, output) {
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
library(shiny)
|
||||
library(digest)
|
||||
|
||||
app <- function(input, output) {
|
||||
client <- clientPage(
|
||||
|
||||
textInput("input1", caption="Input:", initialValue="Hello, world!"),
|
||||
checkboxInput("addnewline", caption = "Append newline", initialValue=TRUE),
|
||||
|
||||
textOutput("md5_hash", caption = "MD5:"),
|
||||
textOutput("sha1_hash", caption = "SHA-1:")
|
||||
|
||||
)
|
||||
|
||||
server <- function(input, output) {
|
||||
text <- reactive(function() {
|
||||
str <- input$input1
|
||||
if (input$addnewline)
|
||||
@@ -18,4 +28,4 @@ app <- function(input, output) {
|
||||
})
|
||||
}
|
||||
|
||||
runApp(client='./www', server=app)
|
||||
runApp(client, server, port=8500)
|
||||
Reference in New Issue
Block a user