Make year selectable for comparison

This commit is contained in:
2026-01-21 10:23:38 +01:00
parent 49a39e8cf0
commit 36446df4ae

View File

@@ -39,6 +39,10 @@ server <- function(input, output, session) {
currently_selected_maptype(input$rd_maptype) currently_selected_maptype(input$rd_maptype)
}) })
observeEvent(input$vergleichs_jahr, {
currently_compared_year(input$vergleichs_jahr)
})
observe({ observe({
maptype <- currently_selected_maptype() maptype <- currently_selected_maptype()
heatmap <- currently_selected_heatmap_crime() heatmap <- currently_selected_heatmap_crime()
@@ -257,7 +261,7 @@ server <- function(input, output, session) {
data_tibble <- map_data_to_plot( data_tibble <- map_data_to_plot(
locations = currently_compared_location(), locations = currently_compared_location(),
crimes = currently_compared_crimes(), crimes = currently_compared_crimes(),
year = "2024" year = currently_compared_year()
) )
ggplot(data_tibble, aes(x = Location, y = Erfasst, group = Name, fill = Name)) + ggplot(data_tibble, aes(x = Location, y = Erfasst, group = Name, fill = Name)) +