-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathex4.R
40 lines (32 loc) · 867 Bytes
/
ex4.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
library(shiny)
zoom = FALSE
ui <- fluidPage(
titlePanel("Hello Cardiff"),
sidebarLayout(
sidebarPanel(
uiOutput("sidebarui"),
#TODO (part 1) place for actionButton
#TODO (part 2) place for textInput
),
mainPanel(
div(style = "background: grey; color: white;",
tags$p("Here is where the action takes place")
),
#TODO (part 2) "welcome_message" textOutput
tags$img(src="https://media.giphy.com/media/u47skfNmdGSM05XP5G/giphy.gif", width="200px")
)
)
)
server <- function(input, output) {
if (isTRUE(zoom))
output$sidebarui <- renderUI({
tags$h2("This is sidebar")
})
else
output$sidebarui <- renderUI({
tags$h4("This is sidebar")
})
#TODO (part 1) observe event from action button
#TODO (part 2) renderText
}
shinyApp(ui = ui, server = server)