-
Notifications
You must be signed in to change notification settings - Fork 11
/
ui.R
124 lines (122 loc) · 6.71 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
#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#* Nepal quake dashboard *
#* 2015-05-31, 2015-07-12 *
#* *
#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
library(shinydashboard)
library(leaflet)
dashboardPage(skin = "green",
dashboardHeader(title = "2015 Nepal Quake"),
dashboardSidebar(
sidebarMenu(
menuItem("Earthquakes", tabName="dashboard", icon = icon("bullseye")),
menuItem("Fatalities", tabName="damage", icon = icon("ambulance")),
menuItem("Data", tabName="data", icon = icon("table")),
menuItem("About", tabName="about", icon = icon("circle-info"))
)
),
dashboardBody(
# tags$head(
# tags$link(rel = "stylesheet", type = "text/css", href = "custom.css")
# ),
tabItems(
tabItem(tabName ="dashboard",
# h2("Map"),
fluidRow(
column(width = 12,
box(width = NULL, solidHeader = TRUE,
leafletOutput("quakemap2", height = 400),
htmlOutput("countQuake", inline = FALSE)
)
),
column(width=12,
box(#title="Select time window",
background = "red",
# solidHeader = TRUE,
width=NULL,
# collapsible=TRUE,
dateRangeInput("daterange", "Select date range:",
start = "2015-04-12",
end = "2016-05-29",
min = "2015-04-12",
max = "2016-05-29"),
actionButton("resetDate", "Reset dates")
# verbatimTextOutput("adf")
)),
column(width=12,
box(title='Quake timeline', solidHeader=TRUE,
background = "light-blue",
width = NULL,
collapsible = TRUE,
plotOutput("magHist", height=200)
)
),
column(width=8,
box(title="Histogram",
background = "light-blue",
solidHeader = TRUE,
width=NULL,
collapsible=TRUE,
plotOutput("quakeHist", height = 200)
)),
column(width=4, #3
box(title="Frequency table",
background = "light-blue",
solidHeader = TRUE,
width=NULL,
collapsible=TRUE,
tableOutput("outFrequency")
))
)),
## Damage tab
tabItem(tabName ="damage",
fluidRow(
column(width = 12,
# h2("Fatalities and injuries"),
box(width = NULL, solidHeader = TRUE,
leafletOutput("damagemap", height = 400),
br(),
box(title='Fatalities by gender (12 most impacted districts)', solidHeader=TRUE,
background = "black",
width = NULL,
collapsible = TRUE,
plotOutput("damagegraph2", height=400)
#
)
#
)
))
),
## Data tab
tabItem(tabName ="data",
tabsetPanel(
tabPanel("Earthquakes", #tabPanel 1
fluidRow(
column(width=12,
# h2("Data"),
# p("Source: USGS"),
box(title = 'Earthquake records from USGS', solidHeader=TRUE,
width = 12, collapsible=FALSE,
dataTableOutput("quaketable")
)
)) #end fluidRow
), #end tabPanel 1
tabPanel("Fatalities, injuries and damage", #tabPanel 2
fluidRow(
column(width=12,
# h2("Data"),
# p("Source: Ministry of Home Affairs (MoHA)/National Emergency Operation Center (NEOC) official figures for casualties and damages [5 June update] "),
box(title = "MoHA/NEOC official fatalities, injuries and damage figures", solidHeader=TRUE,
width = 12, collapsible=FALSE,
dataTableOutput("damagetable")
)
)) #end fluidRow
)
)),
## About tab
tabItem(tabName ="about",
# h1("About"),
includeHTML("about.html")
))
)
)