-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
70 lines (59 loc) · 2.93 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
library(shinydashboard)
library(shinycssloaders)
# Header ------------------------------------------------------------------
header <- dashboardHeader(title = "COVID-19 Dashboard")
# Sidebar -----------------------------------------------------------------
sidebar <- dashboardSidebar(
sidebarMenu(
# Setting id makes input$tabs give the tabName of currently-selected tab
id = "tabs",
menuItem("About", tabName = "About", icon = icon("info-circle"), selected = TRUE),
menuItem("Vaccine Dashboard", icon = icon('dashboard'), startExpanded = TRUE,
menuSubItem("Providers Map", tabName = "Map", icon = icon("map")),
menuSubItem("Data Table", tabName = "Data", icon = icon("table"))
),
menuItem("Future Development", tabName = "FutureDev", icon = icon("code")),
menuItem("Sample Report", tabName = "SampleReport", icon = icon("file-pdf")),
menuItem("://rishigoutam", icon = icon("github"), badgeLabel = "open",
href = "https://www.github.com/rishigoutam/vaccines", newtab = TRUE),
menuItem(""), # spacing
menuItem(""), # spacing
menuItem("") # spacing
),
# Show filters for the 'Maps' and 'Data' tabs only
conditionalPanel(condition = "input.tabs == 'Map' || input.tabs == 'Data'",
menuItem("Filters", icon = icon("filter"), badgeLabel = "clear"),
selectInput("state_input", "State/Territory", choices = states_list, multiple = TRUE),
checkboxGroupInput("vaccine_type_input", "Vaccine in Stock",
choiceNames = c("J&J Janssen (18+)", "Moderna (18+)", "Pfizer (12+)", "Pfizer (5-11)"),
choiceValues = c("Janssen", "Moderna", "Pfizer", "Pfizer_child")),
checkboxGroupInput("preferences_title", "Provider Preferences"),
div(id = "preferences",
checkboxInput("insurance_input", "Accepts Insurance", value = FALSE),
checkboxInput("walkin_input", "Walk-Ins Allowed", value = FALSE)),
# Report Generation
radioButtons('format', 'Document format', c('PDF', 'HTML', 'Word'),
inline = TRUE),
div(id = "download", downloadButton("downloadReport"))
)
)
# Body --------------------------------------------------------------------
body <- dashboardBody(
useShinyjs(),
tags$head(
tags$link(rel = "stylesheet", type = "text/css", href = "vaccines.css"),
tags$style("@import url(https://use.fontawesome.com/releases/v6.0.0/css/all.css);"),
),
tabItems(
tabItem("Map",
textOutput("num_providers"),
withSpinner(leafletOutput("vaccine_map"), type = 7, color = "#00a65a")),
tabItem("Data",
withSpinner(DT::dataTableOutput("providers"), color = "#00a65a")),
tabItem("About", includeMarkdown("./README.md")),
tabItem("SampleReport", includeMarkdown("./sample_report.md")),
tabItem("FutureDev", includeMarkdown("./TODO.md"))
)
)
# Page --------------------------------------------------------------------
dashboardPage(header, sidebar, body, skin = 'green')