-
Notifications
You must be signed in to change notification settings - Fork 1
/
ui.R
148 lines (145 loc) · 4.17 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
ui <- fluidPage(
# Dropdown boxes appear over panels
tags$head(tags$style(".selectize-control.single { width: 100%; z-index: 1; }")),
## Main navbar and pages
navbarPage(paste0("PoolTools v", appVersion),
id = "main_nav",
## Home ----
tabPanel(
"Home",
fluidRow(
column(
width = 4,
style = "text-align: center;",
p(
"To estimate marker prevalence from", tags$br(),
"pooled test results, select:"
),
actionButton("btnAnalysePage", "Analyse pooled data"),
),
column(
width = 4,
style = "text-align: center;",
p(
"To design cost-effective tests, or evaluate", tags$br(),
"the power of an existing design, select:"
),
actionButton("btnDesignPage", "Design a pooled survey")
)
)
),
## About ----
tabPanel(
"About",
includeMarkdown("inst/app/www/about.md")
),
## Analyse ----
tabPanel(
"Analyse",
h2("Analyse pooled data"),
br(),
sidebarLayout(
fluid = T,
sidebarPanel(
style = "max-height: 75vh; overflow-y: auto;",
fileInput(
"fileAnalyse",
accept = c(".csv", ".xlsx"),
tags$span(
"Upload data (.xlsx or .csv)",
shinyBS::tipify(icon("info-circle"), "See Help tab for formatting requirements", placement = "right")
)
),
uiOutput("colSelectTestResults"),
uiOutput("colSelectUnitNumber"),
uiOutput("validColSelect"),
uiOutput("checkStratify"),
uiOutput("colSelectStratify"),
uiOutput("checkHierarchy"),
uiOutput("colHierarchyOrder"),
uiOutput("uiDisplay"),
uiOutput("uiAnalyseAdv"),
uiOutput("btnAnalyse")
),
mainPanel(
tabsetPanel(
type = "tabs",
tabPanel(
"Results",
br(),
dataTableOutput("outAnalyse"),
uiOutput("btnDlAnalyse")
),
tabPanel(
"Help",
includeMarkdown("inst/app/www/help_analyse.md")
)
)
)
)
),
## Design ----
tabPanel(
"Design",
h2("Design a pooled survey"),
br(),
sidebarLayout(
sidebarPanel(
style = "max-height: 75vh; overflow-y: auto;",
### Survey options ----
selectInputTT(
"optsMode",
"Analysis mode",
tooltip = "See Help tab for more information",
choices = c(
"Select" = "",
"Identify cost-effective designs",
"Calculate power of existing designs (Coming soon...)"
)
),
# TODO: Split Mode and the remaining below to Submode
selectInputTT(
"optsObjective",
"Survey objective",
tooltip = "tooltip",
choices = c("Select" = "", "Estimate prevalence", "Detect pathogen (Coming soon...)")
),
selectInputTT(
"optsTrapping",
"Collection strategy",
tooltip = "tooltip",
choices = c("Select" = "", "Fixed sample size", "Fixed sampling period")
),
checkboxInputTT(
"optsClustered",
"Cluster/hierarchical sampling?",
tooltip = "tooltip",
value = TRUE
),
### Main settings ----
# UI are conditional based on survey options
uiOutput("uiRandPrev"),
uiOutput("uiCost"),
uiOutput("uiParams"),
uiOutput("uiDesignAdv"),
textOutput("uiValidOther"),
uiOutput("btnDesign")
), ### End of sidebarPanel ----
mainPanel(
tabsetPanel(
type = "tabs",
tabPanel(
"Results",
tags$br(),
uiOutput("outDesign")
),
tabPanel(
"Help",
includeMarkdown("inst/app/www/help_design.md")
)
)
)
) ### End of sidebarLayout ----
)
)
)