Commit b8ac11ff authored by Jean-Francois Rey's avatar Jean-Francois Rey

update immunity map loading

parent 38c18d17
Pipeline #2067 passed with stages
in 3 minutes and 42 seconds
......@@ -307,27 +307,31 @@ server <- function(input, output, session){
output$mapImmunity <- renderLeaflet({
mapFranceDepartement[["Rt_immunity"]] = immun_M3_k[[as.character(max(immunityDate))]][selection]
leaflet(data = mapFranceDepartement) %>%
addTiles() %>%
fitBounds(~-5.142238, ~42.332755, ~8.231781, ~51.089842) %>%
addLegend(position = "bottomright",
title = "Immunity rate",
pal = palImmunity(),
values = ~ unlist(immun_M3_k)) # %>%
# leaflet::addPolygons()
values = ~ unlist(immun_M3_k)) %>%
leaflet::addPolygons(
fillColor = ~palImmunity()(Rt_immunity),
weight = 2,
opacity = 1,
color = "white",
dashArray = "3",
fillOpacity = 0.7)
})
#
# Use a separate observer to recreate polygons as needed.
observe({
proxyImmunity <- leafletProxy("mapImmunity", data = dataImmunity())
colorpal = palImmunity()
proxyImmunity %>%
leafletProxy("mapImmunity", data = dataImmunity()) %>%
clearShapes() %>%
leaflet::addPolygons( data = dataImmunity(),
# color = ~colorpal(Rt_immunity),
fillColor = ~colorpal(Rt_immunity),
leaflet::addPolygons( fillColor = ~palImmunity()(Rt_immunity),
weight = 2,
opacity = 1,
color = "white",
......
......@@ -160,7 +160,7 @@ ui <- tagList(
box(width = 12,
sliderInput("DateSelectImmunty", "Days",
min(immunityDate), max(immunityDate),
value = min(immunityDate), step = 7)
value = max(immunityDate), step = 7)
)
),
fluidRow(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment