library(shiny)
library(shinythemes)
library(leaflet)
ui <- navbarPage(theme = shinytheme("flatly"),
"Tokyo 2020 Olympics Medal List by Luis Ballesteros 2021/08/14",
tabPanel(icon("home"),
fluidRow(column(tags$img(src="Summer_Olympics_tokyo_2020.png",
width="275px",
align = "center"),width=2),
column(
br(),
p("This App has been created as final exercise of the course Developing Data Products by Johns Hopkins University on the ", a(href="https://www.coursera.org/learn/data-products/home/welcome/", strong("Coursera platform.")),
style="text-align:justify;color:black;background-color:lavender;padding:15px;border-radius:10px"),
br(),
p("An interactive map has been created with Shiny showing the medals won by each country at the Tokyo 2020 Olympic Games, held in 2021. ", icon("map")),
br(),
p("When selecting the type of medal the map will create a circle according to the number of medals. You can see the name of the country and the number of medals by hovering over the circle. You can select more than one medal and the map will show the sum of the number of medals."),
br(),
p("An interactive table has also been created with Shiny with the medal data. ", icon("table")),
br(),
p("When the variable is selected, the table includes it in the selected order."),
br(),
p("The medal data has been obtained from Kkaggle. See ", a(href="https://www.kaggle.com/berkayalan/2021-olympics-medals-in-tokyo", "Dataset.")),
br(),
p("The data with geographic coordinates have been obtained from Google. See ", a(href="https://developers.google.com/public-data/docs/canonical/countries_csv", "Dataset.")),
width=10)))
,
# Panel title
tabPanel(icon("map"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
checkboxGroupInput("select_medal",
"Select Medal",
choices = list("Gold" = "Gold",
"Silver" = "Silver",
"Bronze" = "Bronze")
),
),
# Show a plot of the generated distribution
mainPanel(
leafletOutput("mymap")
)))
,
tabPanel(icon("table"),
sidebarLayout(
sidebarPanel(
selectInput(
inputId = "variables",
label = "Select the variables",
choices = c("Country",
"Gold",
"Silver",
"Bronze",
"Total",
"Rank",
"cod_contry",
"lat",
"lng"),
selected = "",
multiple = TRUE
)
),
# Show a plot of the generated distribution
mainPanel(
dataTableOutput("country_medals")
)
))
)