edgarodriguez commited on
Commit
1fc4cdd
·
verified ·
1 Parent(s): 5bff32f

Upload depth_interactive_map_alpha.R

Browse files
Files changed (1) hide show
  1. depth_interactive_map_alpha.R +8 -5
depth_interactive_map_alpha.R CHANGED
@@ -117,9 +117,9 @@ POP_PAL <- c("#f7fcf0", "#e0f3db", "#ccebc5",
117
  "#a8ddb5", "#7bccc4", "#4eb3d3",
118
  "#2b8cbe") # GnBu 7 (Exposure)
119
  PATP_PAL <- c("#fff7f3", "#fde0dd", "#fcc5c0",
120
- "#fa9fb5", "#f768a1", "#c51b8a") # RdPu 6 (Vulnerability)
121
- POBREZA_PAL <- c("#feebe2", "#fbb4b9", "#f768a1",
122
- "#c51b8a", "#7a0177", "#49006a") # RdPu 6 (deep, poverty)
123
 
124
  # Categorical palettes for the two non-numeric patp sub-types. Stable colour-blind
125
  # safe Set2-style hues; keys must match the truncated label list in setPATPType().
@@ -3558,9 +3558,12 @@ server <- function(input, output, session) {
3558
  if ("ocved-pts" %in% active) lazy_add_pts("ocved", "ocved_events", "ocved-pts", COL_AMBER, 1, 80000)
3559
  if ("ged-pts" %in% active) lazy_add_pts("ged", "ged_events", "ged-pts", COL_LIGHT_BLUE, 1, 80000)
3560
 
3561
- # Grid niveles N4-N6 load the first time the user enables grid mode
 
 
 
3562
  if (grid_on) {
3563
- for (nv in c("4", "5", "6")) lazy_add_grid(nv)
3564
  }
3565
  },
3566
  ignoreNULL = TRUE, ignoreInit = TRUE
 
117
  "#a8ddb5", "#7bccc4", "#4eb3d3",
118
  "#2b8cbe") # GnBu 7 (Exposure)
119
  PATP_PAL <- c("#fff7f3", "#fde0dd", "#fcc5c0",
120
+ "#fa9fb5", "#f768a1", "#c51b8a", "#7a0177") # RdPu 7 (step_expr needs n_breaks+1)
121
+ POBREZA_PAL <- c("#fff7f3", "#feebe2", "#fbb4b9", "#f768a1",
122
+ "#c51b8a", "#7a0177", "#49006a") # RdPu 7 (step_expr needs n_breaks+1)
123
 
124
  # Categorical palettes for the two non-numeric patp sub-types. Stable colour-blind
125
  # safe Set2-style hues; keys must match the truncated label list in setPATPType().
 
3558
  if ("ocved-pts" %in% active) lazy_add_pts("ocved", "ocved_events", "ocved-pts", COL_AMBER, 1, 80000)
3559
  if ("ged-pts" %in% active) lazy_add_pts("ged", "ged_events", "ged-pts", COL_LIGHT_BLUE, 1, 80000)
3560
 
3561
+ # Grid: only load the nivel the user actually selected. Loading all three
3562
+ # eagerly used to make first-click block the session on HF (3 sequential
3563
+ # 9-LEFT-JOIN queries). Switching to a different nivel later will load
3564
+ # that one on demand -- cost is amortised over the user's clicks.
3565
  if (grid_on) {
3566
+ lazy_add_grid(nivel %||% "6")
3567
  }
3568
  },
3569
  ignoreNULL = TRUE, ignoreInit = TRUE