-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathui.R
121 lines (118 loc) · 4.6 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
#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#* Nepal quake dashboard *
#* 2015-05-31 *
#* *
#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
library(shinydashboard)
library(leaflet)
# library(shinythemes)
header <- dashboardHeader(
title = "Nepal quake"
)
sidebar <- dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName="dashboard", icon = icon("tachometer")),
menuItem("Impact", tabName="damage", icon = icon("ambulance")),
menuItem("Data", tabName="data", icon = icon("table")),
menuItem("About", tabName="about", icon = icon("info"))
)
)
body <- 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("quakemap", 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 = "2015-06-13",
min = "2015-04-12",
max = "2015-06-13"),
actionButton("updateButton", "Update graphs")
# verbatimTextOutput("adf")
)),
column(width=12,
box(title='Quake timeline', solidHeader=TRUE,
background = "light-blue",
width = NULL,
collapsible = TRUE,
plotOutput("magHist", height=200)
# actionButton("refreshButton", "Draw timeline")
)
),
column(width=6,
box(title="Histogram",
background = "light-blue",
solidHeader = TRUE,
width=NULL,
# status = "success",
collapsible=TRUE,
plotOutput("quakeHist", height = 200)
# actionButton("histButton", "Draw histogram")
)),
column(width=6, #3
box(title="Frequency table",
background = "light-blue",
# status="success",
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='Damage graph', solidHeader=TRUE,
background = "light-blue",
width = NULL,
collapsible = TRUE,
plotOutput("damagegraph", height=400)
# actionButton("refreshButton", "Draw timeline")
)
# htmlOutput("countQuake", inline = FALSE)
)
))
),
## Data tab
tabItem(tabName ="data",
fluidRow(
column(width=12,
h2("Data"),
p("Data source: Earthquake data downloaded from http://earthquake.usgs.gov/earthquakes/feed/v1.0/csv.php"),
box(title = 'Earthquake records', solidHeader=TRUE,
width = 12, collapsible=FALSE,
dataTableOutput("quaketable")
)
))
),
## About tab
tabItem(tabName ="about",
h1("About"),
includeHTML("about.txt")
)
))
dashboardPage(skin='green',
header,
sidebar,
body
)