Integrate UI builder into Shiny

Replace example #1 HTML with builder
This commit is contained in:
Joe Cheng
2012-07-18 15:26:13 -07:00
parent 442f3d93c6
commit 04081ec2d3
6 changed files with 125 additions and 79 deletions

View File

@@ -1,9 +1,22 @@
library(shiny)
ui <- defineUI(
h1("Example 1: All Caps"),
p(
"Input:", br(),
input(name='val', type='text', value='Hello World!')
),
p(
"You said:", br(),
shinyText("valUpper")
)
)
app <- function(input, output) {
output$valUpper <- reactive(function() {
toupper(input$val)
})
}
runApp(client='./www', server=app)
runApp(client=page(ui), server=app)

View File

@@ -1,21 +0,0 @@
<html>
<head>
<script src="shared/jquery.js" type="text/javascript"></script>
<script src="shared/shiny.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="shared/shiny.css"/>
</head>
<body>
<h1>Example 1: All Caps</h1>
<p>
Input:<br/>
<input name="val" type="text" value="Hello World!"/>
</p>
<p>
You said:<br/>
<div id="valUpper" class="live-text"/>
</p>
</body>
</html>