From 1ded19dc36de5881638b01ce15c99c6e2f11a24e Mon Sep 17 00:00:00 2001 From: Alex Slavenko Date: Mon, 18 Dec 2023 14:21:41 +1100 Subject: [PATCH] Fixed colour palette --- app.R | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app.R b/app.R index 1940445..1f53c93 100644 --- a/app.R +++ b/app.R @@ -105,13 +105,17 @@ ui <- shinyUI( server <- function(input, output, session){ map <- reactive({ - aus_SA2 %>% - dplyr::filter(.data[[input$select_map]] >= quantile(.data[[input$select_map]], .env$input$select_quant_map)) %>% + aus_SA2_filt <- aus_SA2 %>% + dplyr::filter(.data[[input$select_map]] >= quantile(.data[[input$select_map]], .env$input$select_quant_map)) + + ncols <- max(round(length(unique(aus_SA2_filt %>% dplyr::pull(input$select_map)))/10, 0), 2) + + aus_SA2_filt %>% mapview(map.types = "Esri.WorldStreetMap", layer.name = input$select_map, zcol = input$select_map, label = aus_SA2$SA2_NAME21, - col.regions = viridis::inferno(n = 100)) + col.regions = viridis::inferno(n = ncols)) }) # the maps