Created
August 7, 2016 14:02
-
-
Save nlddfn/b65e2a45925b8d58f0ef2870491ff7c1 to your computer and use it in GitHub Desktop.
Shiny_Migration_path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create Map | |
output$map <- renderPlotly({ | |
sel.data <- filter(balkanRoute.map, Date == input$slider.map) | |
# light grey boundaries | |
l <- list(color = toRGB("grey"), width = 0.5) | |
# specify map projection/options | |
g <- list( | |
scope='world', | |
projection=list(scale = 1), | |
showframe = T, | |
showcoastlines = T, | |
projection = list(type = 'Mercator'), | |
lataxis = list(range = c(30,50)), | |
lonaxis = list(range = c(-10,40)), | |
showsubunits = T, | |
showcountries = T | |
) | |
plot_ly(sel.data, z = Arrivals, text = Country, locations = Code, type = 'choropleth', | |
color = Arrivals, colors = 'Blues', marker = list(line = l),inherit = FALSE, | |
colorbar = list(title = 'Arrivals')) %>% | |
add_trace(.,type="scattergeo", | |
locations = country_codes$Code, text = country_codes$Country, mode="text") %>% | |
layout(title ='Daily arrivals across the Balkans', geo = g, width = "100%") | |
}) | |
# Plot time series | |
output$arrivals_by_day <- renderDygraph({ | |
dygraph(balkanTimeSeries) %>% | |
dyHighlight(highlightCircleSize = 5, | |
highlightSeriesBackgroundAlpha = 0.2, | |
hideOnMouseOut = FALSE) %>% | |
dyRangeSelector() %>% | |
dyRoller(rollPeriod = 7) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment