-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
53 lines (37 loc) · 1.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
# custom download functions
plotDownloadButton <- function(outputId, label = "Download") {
tags$a(id = outputId, class = "btn btn-default shiny-download-link", href = "",
target = "_blank", download = NA, icon("chart-bar"), label)
}
excelDownloadButton <- function(outputId, label = "Download") {
tags$a(id = outputId, class = "btn btn-default shiny-download-link", href = "",
target = "_blank", download = NA, icon("file-excel"), label)
}
# ui
ui <- shiny::htmlTemplate(
# Index Page
"www/index.html",
# Total MP count
nr_of_mps = textOutput("nr_of_mps", inline = T),
total_nr_of_mps = textOutput("total_nr_of_mps", inline = T),
# Number of sessions supported
nr_of_sessions = textOutput("nr_of_sessions", inline = T),
total_nr_of_sessions = textOutput("total_nr_of_sessions", inline = T),
# Number of countries supported
nr_of_countries = textOutput("nr_of_countries", inline = T),
# Session input
session_selector = selectInput("session_input", "Select Legislative Sessions", session_list, multiple = TRUE, selected = "19"),
# Party input
party_selector = selectInput("party_input", "Select Parties", party_list, multiple = TRUE),
# Name input
name_selector = selectInput("name_input", "MP Name", mp_list, selected = FALSE, multiple = FALSE),
# Downloads
age_plot_download_button = plotDownloadButton("age_plot_download", label = "Save Plot"),
term_plot_download_button = plotDownloadButton("term_length_plot_download", label = "Save Plot"),
# Leaflet map
leaflet_map = leafletOutput(outputId = "map", height = "650"),
age_plot = plotOutput("age_plot_final") %>%
withSpinner(color = "black"),
session_plot = plotOutput("session_plot_final") %>%
withSpinner(color = "black")
)