-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.R
More file actions
85 lines (81 loc) · 3.86 KB
/
Copy pathui.R
File metadata and controls
85 lines (81 loc) · 3.86 KB
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
## Load libraries only necessary within ui.R:
library(shinydashboard)
source('helper.R')
# Define UI as adaptive page:
shinyUI(fluidPage(#theme = "bootstrap.min.css",
tags$head(tags$style(HTML("
p {
font-size: large;
}
"))),
dashboardPage(skin = "blue",
dashboardHeader(title = 'American Pollution'),
dashboardSidebar(
sidebarMenu(
## Define sidebar with all selectable options:
menuItem('Guide', tabName = 'guide', icon = icon('sitemap')),
# Sidebar selections for "Pollution Maps" page
menuItem("Pollution Maps", tabName = "maps", icon = icon("map")),
selectizeInput("yearselected", "Select Year", sort(yearsavailable)),
selectizeInput("stateselected", "Select State", choices = NULL),
selectizeInput("pollutantselected", "Select Pollutant", pollutantsavailable),
# Sidebar selections for "Local Pollution History" page
menuItem("Local Pollution History", tabName = "city", icon = icon("calendar")),
selectizeInput('cityselected', 'Select City', citiesavailable)
)
),
## Create dashboard body with 2 tabs: one for national/statewide averages, one for city timeseries
dashboardBody(
tabItems(
## Create page to explain the app:
# Offer the solution
# Validate the solution
tabItem(tabName = 'guide',
fluidRow(
column(width = 6,
backgroundbox,
questionsbox),
column(width = 6,
whybox,
datasourcebox)
)
),
tabItem(tabName = "maps",
fluidRow(
column(width = 6,
box(leafletOutput("pollutionmap"), width = '50%')
),
column(width = 6,
box(plotOutput('popscatter'), width = '50%')
)
),
box(
plotOutput('citycompare'), width = '50%')
),
tabItem(tabName = "city",
fluidRow(
box(
plotlyOutput("timeplot"), width = '100%')
),
fluidRow(
box(
plotOutput('correlationplot')
),
box(
# Plot all aggregate valueBoxes to display city statistics:
valueBoxOutput('NumModerateDays_NO2', width = 3),
valueBoxOutput('NumModerateDays_O3', width = 3),
valueBoxOutput('NumModerateDays_CO', width = 3),
valueBoxOutput('NumModerateDays_SO2', width = 3),
valueBoxOutput('NumHighDays_NO2', width = 3),
valueBoxOutput('NumHighDays_O3', width = 3),
valueBoxOutput('NumHighDays_CO', width = 3),
valueBoxOutput('NumHighDays_SO2', width = 3)
)
)
)
)
)
)
)
)