Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shiny_Migration_path
# 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
You can’t perform that action at this time.