-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
125 lines (116 loc) · 8.75 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
ui = bootstrapPage(
# TODO: test the Google Analytics
tags$head(includeHTML("Google Analytics/gtag.html")),
# TODO: click the name should be back to the index.html
navbarPage(title = "COVID-19 Tracker",
id = "nav",
theme = shinytheme("cerulean"), # https://bootswatch.com/, theme layout of navigation bar
collapsible = TRUE, # collapse the navigation elements into a menu when the width of the browser is less than 940 pixels...
tabPanel(title = "COVID-19 Mapper",
div(class = "outer",
tags$head(includeCSS("styles.css")),
leafletOutput(outputId = "mymap", width="100%", height="100%"),
absolutePanel(id = "controls", fixed = TRUE, draggable = TRUE,
top = 70, left = 50, width = 280, height = "auto",
h3(textOutput("reactive_case_count"), align = "right"),
h4(textOutput("reactive_death_count"), align = "right"),
h4(textOutput("reactive_recovered_count"), align = "right"), # green
h4(textOutput("reactive_active_count"), align = "right"), #red
h6(textOutput("clean_date_reactive"), align = "right"),
tags$i(h6("Updated once daily. For more regular updates, refer to: ", tags$a(href = "https://gisanddata.maps.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6", "Johns Hopkins COVID-19 dashboard."))),
plotlyOutput("new_cases_curve", height ="130px", width = "100%"),
plotlyOutput("cumulative_case_cure", height = "130px", width = "100%"),
plotOutput("new_case_recovery_death_cure", height = "130px", width = "100%"), #plotOutput
sliderInput("plot_date",
label = h5("Select Date"),
min = cv_min_date,
max = cv_max_date,
value = cv_max_date,
timeFormat = "%d %b",
animate = animationOptions(interval = 1000, loop = FALSE, playButton = icon('play', lib = 'glyphicon'))
)
),
#absolutePanel(id = "logo", bottom = 20, left = 60, width = 80, fixed = TRUE, draggable = FALSE, height = "auto", tags$a(href='https://www.lshtm.ac.uk', tags$img(src='lshtm_dark.png', height='40', width='80'))),
absolutePanel(id = "logo", bottom = 20, left = 20, width = 80, fixed = TRUE, draggable = FALSE, height = "auto", actionButton(inputId = "envelope", label = "", icon = icon("envelope"), style='padding:5px', onclick = sprintf("window.open('%s')", "https://mail.google.com/mail/u/0/?view=cm&tf=0%22+++&[email protected]++&su=Covid-19%20Tracker%20Comment++&body=Thank%20you%20for%20your%20valuable%20time.%20Please%20give%20me%20some%20comment.&fs=1")))
)
),
tabPanel(title = "Region plots",
helpText("Coming soon......")
# sidebarLayout(
#
# sidebarPanel(
#
# pickerInput(inputId = "level_select",
# label = "Level",
# choices = c("Global", "Continent", "Country"),
# selected = c("Country"),
# multiple = FALSE),
#
# pickerInput(inputId = "region_select",
# label = "Country/Region",
# choices = c("TEMP-VALUE"),
# options = list(`actions-box` = TRUE, `none-selected-text` = "Please make a selection!"),
# selected = c("TEMP-VALUE"),
# multiple = TRUE),
#
# pickerInput(inputId = "outcome_slect",
# label = "Outcome",
# choices = c("Cases", "Deaths"),
# selected = c("Cases"),
# multiple = FALSE),
#
# "Plots from the selected dropdown list value. Countries with at least 100 confirmed cases are included."
# ),
#
# mainPanel(
# tabsetPanel(
# tabPanel("New"),
# tabPanel("Cumulative"),
# tabPanel("Cumulative (log10)"))
# )
# )
),
tabPanel(title = "SARS mapper", helpText("Coming soon......")),
tabPanel(title = "Outbreak comparisons", helpText("Coming soon......")
# sidebarLayout(
#
# sidebarPanel(
# radioButtons(inputId = "comparison_metric",
# label = h3("Select comparison"),
# choices = c("Cases" = "cases", "Deaths" = "deaths", "Countries/regions affected" = "countries", "Case fatality rate" = "cfr")
# ),
# textOutput(outputId = "epi_notes_1"),
# textOutput(outputId = "epi_notes_2"),
# textOutput(outputId = "epi_notes_3")
# ),
#
# mainPanel(
# #plotlyOutput("comparison_plot"), width = 6)
# )
# )
),
tabPanel(title = "Data",
numericInput(inputId = "maxrows", label = h3("Show latest day rows"), value = 20, min = 10, max = 60),
# ------------------------------------------------------------------
# | Output function | render function | CREATES |
# ------------------------------------------------------------------
# |htmlOutput/uiOutput | renderUI | a Shiny tag object or HTML|
# ------------------------------------------------------------------
# | imageOutput | renderImage | images |
# ------------------------------------------------------------------
# | plotOutput | renderPlot | plots |
# ------------------------------------------------------------------
# | tableOutput | renderTable | data frame, matrixs |
# ------------------------------------------------------------------
# | textOutput | renderText | character strings |
# ------------------------------------------------------------------
# | verbatimTextOutput | renderPrint | any printed output |
# ------------------------------------------------------------------
tableOutput(outputId = "rawtable"),
downloadButton(outputId = "downloadCsv", label = h5("Download latest day")),
tags$br(),tags$br(),
"Adapted from timeline data published by ",
tags$a(href="https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_time_series", "Johns Hopkins Center for Systems Science and Engineering.")
)
)
)