Update app.R
Browse files
app.R
CHANGED
@@ -10,6 +10,7 @@ library(rnaturalearth)
|
|
10 |
library(rnaturalearthdata)
|
11 |
library(countrycode)
|
12 |
library(leaflet) # <-- For OpenStreetMap-based map
|
|
|
13 |
|
14 |
# =============================
|
15 |
# UI
|
@@ -283,7 +284,7 @@ server <- function(input, output, session) {
|
|
283 |
|
284 |
# Build a color palette based on the chosen index
|
285 |
pal <- colorNumeric(
|
286 |
-
palette =
|
287 |
domain = plot_data[[index_col]],
|
288 |
na.color = "white"
|
289 |
)
|
@@ -338,8 +339,8 @@ server <- function(input, output, session) {
|
|
338 |
clearControls() %>% # clear existing legends
|
339 |
addPolygons(
|
340 |
fillColor = ~pal(get(index_col)),
|
341 |
-
fillOpacity = 0.
|
342 |
-
color = "
|
343 |
weight = 0.4,
|
344 |
layerId = ~iso_a3,
|
345 |
label = labels,
|
|
|
10 |
library(rnaturalearthdata)
|
11 |
library(countrycode)
|
12 |
library(leaflet) # <-- For OpenStreetMap-based map
|
13 |
+
library(viridisLite)
|
14 |
|
15 |
# =============================
|
16 |
# UI
|
|
|
284 |
|
285 |
# Build a color palette based on the chosen index
|
286 |
pal <- colorNumeric(
|
287 |
+
palette = viridisLite::viridis(256, begin = 0, end = 0.80),
|
288 |
domain = plot_data[[index_col]],
|
289 |
na.color = "white"
|
290 |
)
|
|
|
339 |
clearControls() %>% # clear existing legends
|
340 |
addPolygons(
|
341 |
fillColor = ~pal(get(index_col)),
|
342 |
+
fillOpacity = 0.95,
|
343 |
+
color = "gray",
|
344 |
weight = 0.4,
|
345 |
layerId = ~iso_a3,
|
346 |
label = labels,
|