mirror of
https://github.com/dylanbenzi/hurricane_normalization_app.git
synced 2026-07-30 05:08:57 +00:00
update growth trends to select on storm selection
This commit is contained in:
+21
-6
@@ -801,12 +801,17 @@ test_storm <- reactiveValues(
|
|||||||
)
|
)
|
||||||
|
|
||||||
test_counties <- reactive({
|
test_counties <- reactive({
|
||||||
req(storm_selection$is_selected)
|
req(
|
||||||
|
storm_selection$is_selected,
|
||||||
|
input$growth_trend_lf_select
|
||||||
|
)
|
||||||
|
|
||||||
counties <- get_normalized_metric_growth(test_storm, "LF1")
|
selected_lf <- input$growth_trend_lf_select
|
||||||
|
|
||||||
|
counties <- get_normalized_metric_growth(storm_selection, selected_lf)
|
||||||
|
|
||||||
result <- counties %>%
|
result <- counties %>%
|
||||||
filter(year == 2024) %>%
|
#filter(year == 2024) %>%
|
||||||
mutate(
|
mutate(
|
||||||
population_opacity = rescale(
|
population_opacity = rescale(
|
||||||
normalized_population,
|
normalized_population,
|
||||||
@@ -837,9 +842,19 @@ output$housing_growth_map <- renderLeaflet({
|
|||||||
})
|
})
|
||||||
|
|
||||||
observe({
|
observe({
|
||||||
req(test_counties)
|
req(
|
||||||
|
test_counties,
|
||||||
|
input$growth_trend_map_slider
|
||||||
|
)
|
||||||
|
|
||||||
leafletProxy("pop_growth_map", data = test_counties()) %>%
|
growth_year <- input$growth_trend_map_slider
|
||||||
|
|
||||||
|
test_county_year <- test_counties() %>%
|
||||||
|
filter(
|
||||||
|
year == growth_year
|
||||||
|
)
|
||||||
|
|
||||||
|
leafletProxy("pop_growth_map", data = test_county_year) %>%
|
||||||
clearShapes() %>%
|
clearShapes() %>%
|
||||||
addPolygons(
|
addPolygons(
|
||||||
fillColor = "red",
|
fillColor = "red",
|
||||||
@@ -848,7 +863,7 @@ observe({
|
|||||||
weight = 2
|
weight = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
leafletProxy("housing_growth_map", data = test_counties()) %>%
|
leafletProxy("housing_growth_map", data = test_county_year) %>%
|
||||||
clearShapes() %>%
|
clearShapes() %>%
|
||||||
addPolygons(
|
addPolygons(
|
||||||
fillColor = "blue",
|
fillColor = "blue",
|
||||||
|
|||||||
Reference in New Issue
Block a user