/
ui.R
84 lines (75 loc) · 3.12 KB
/
ui.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
shinyUI(dashboardPage(
dashboardHeader(title = "The Pleasing Ratio Project",
titleWidth = 280),
dashboardSidebar(
sidebarMenu(id = "tabs",
menuItem("Play!", tabName = "play", icon = icon("play")),
menuItem("Results", tabName = "resu", icon = icon("bar-chart")),
menuItem("The Project", tabName = "proj", icon = icon("globe"))
)
),
dashboardBody(
useShinyjs(),
extendShinyjs(text = "shinyjs.refresh = function() { location.reload(); }", functions = c("refresh")),
tabItems(
tabItem(tabName = "proj",
fluidRow(column(width = 12,
style='padding:10px;',
includeMarkdown("files/project.md")))),
tabItem(tabName = "play",
fluidRow(column(width = 12,
style='padding:10px;',
includeMarkdown("files/briefing.md"))),
fluidRow(
box(title = 'Option A',
status = "primary",
solidHeader = TRUE,
plotOutput("A_plot", height = "180px")),
box(title = 'Option B',
status = "primary",
solidHeader = TRUE,
plotOutput("B_plot", height = "180px"))
),
fluidRow(
column(12, align="center",
radioButtons("choice",
"Which one do you like most?",
c("Option A" = "A",
"Option B" = "B"),
inline = TRUE,
selected=character(0)))
),
fluidRow(
column(12,
align="center",
conditionalPanel(
condition = "input.choice == 'A'||
input.choice == 'B'||
input.choice == 'N'",
uiOutput("vote")))),
fluidRow(
column(12, align="center", div(style = "height:10px;"),
conditionalPanel(
condition = "input.vote == '1'",
HTML("<b>Thank you!</b>")))),
fluidRow(
column(6,div(style = "height:10px;"),
align="right",
conditionalPanel(
condition = "input.vote == '1'",
uiOutput("refresh"))),
column(6, div(style = "height:10px;"),
align="left",
conditionalPanel(
condition = "input.vote == '1'",
uiOutput("results")))
)
),
tabItem(tabName = "resu",
fluidRow(valueBoxOutput("no_votes", width=3)),
fluidRow(highchartOutput("hc_results"))
)
)
)
)
)