-
Notifications
You must be signed in to change notification settings - Fork 3
/
ui.R
155 lines (149 loc) · 4.55 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
149
150
151
152
153
154
155
library(shiny)
library(here)
county_choice <- readRDS(here("data", "county_choice.RDS"))
shinyUI(fluidPage(
titlePanel(page_title),
## Top row
## How to subset the data ----
fluidRow(
column(
width = 4,
h4(page_subtitle),
p(page_desc),
selectInput(
inputId = "county_size",
label = NULL,
selected = 0,
choices = list(
"Include all counties" = 0,
"Exclude counties w/ pop. <1,000" = 1000,
"Exclude counties w/ pop. <5,000" = 5000,
"Exclude counties w/ pop. <10,000" = 10000,
"Exclude counties w/ pop. <25,000" = 25000,
"Exclude counties w/ pop. <50,000" = 50000,
"Exclude counties w/ pop. <100,000" = 100000
)
)
),
column(
width = 4,
h4("Risk Factor 1 (x-axis)"),
risk_factor_selector(value_id = "riskfactor1",
label = NULL,
selected_x = "icu_per_capita"),
sliderInput(inputId = "rf1slider",
label = "Threshold for moderate risk",
min = 0,
max = 150,
step = 1,
value = c(10, 25)),
selectInput(inputId = "rf1transform",
label = "Axis Transformation",
choices = list("None" = "identity",
"Natural log" = "log1p",
"Log10" = "log10"),
selected = "log10"),
),
column(
width = 4,
h4("Risk Factor 2 (y-axis)"),
risk_factor_selector(value_id = "riskfactor2",
label = NULL,
selected_x = "p70older"),
sliderInput(inputId = "rf2slider",
label = "Threshold for moderate risk",
min = 0,
max = 50,
step = 1,
value = c(10, 15)),
selectInput(inputId = "rf2transform",
label = "Axis Transformation",
choices = list("None" = "identity",
"Natural log" = "log1p",
"Log10" = "log10"),
selected = "identity"),
)
),
hr(),
## Plotting section ----
fluidRow(
column(
width = 8,
offset = 0,
h3("Bivariate Risk Map"),
align = "center",
plotOutput("bivariate_map", height = "600px")
),
column(
width = 4,
offset = 0,
h3("Scatterplot"),
align = "center",
plotOutput("scatterplot", height = "600px")
)
),
hr(),
# Text section ----
fluidRow(
column(
width = 4,
h4("Numbers in context"),
htmlOutput("context_text")
),
column(
width = 4,
h4("Highlight a county"),
selectizeInput(
inputId = "county",
label = NULL,
choices = county_choice,
selected = 6075,
multiple = FALSE
),
htmlOutput("county_text")
),
column(
width = 4,
more_info
)
),
hr(),
# Univariate section ----
fluidRow(
column(
width = 5,
offset = 1,
h4(htmlOutput("risk1_label")),
plotOutput("risk1_map", height = "300px")
),
column(
width = 5,
offset = 1,
h4(htmlOutput("risk2_label")),
plotOutput("risk2_map", height = "300px")
),
),
fluidRow(
column(
width = 5,
offset = 1,
plotOutput("risk1_caterpillar", height = "300px"),
),
column(
width = 5,
offset = 1,
plotOutput("risk2_caterpillar", height = "300px"),
),
),
hr(),
## Footer ----
fluidRow(p(),
br(),
column(
width = 12,
align = 'center',
footer_tag,
br(),
p()
))
))