Skip to content

Commit a60e75d

Browse files
authored
Merge branch 'main' into joe/feature/raster-options
2 parents c8c8d9b + 7ae5ca3 commit a60e75d

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Imports:
6363
scales (>= 1.0.0),
6464
sp,
6565
stats,
66-
viridis (>= 0.5.1),
66+
viridisLite,
6767
xfun
6868
Suggests:
6969
knitr,

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
* Fixed #893: Correctly call `terra::crs()` when checking the CRS of a `SpatVector` object in `pointData()` or `polygonData()` (thanks @mkoohafkan, #894).
44

5+
* Replace viridis dependency by viridisLite (@olivroy, #897)
6+
57
* `addRasterImage` now takes `options = gridOptions()`, so that arbitrary Leaflet layer options can be controlled. (#692)
68

79
# leaflet 2.2.1

R/colors.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ toPaletteFunc.character <- function(pal, alpha, nlevels) {
332332
colors <- brewer_pal(pal) # Get all colors
333333
}
334334
} else if (length(pal) == 1 && pal %in% c("viridis", "magma", "inferno", "plasma")) {
335-
colors <- viridis::viridis(n = 256, option = pal)
335+
colors <- viridisLite::viridis(n = 256, option = pal)
336336
} else {
337337
colors <- pal
338338
}

inst/examples/polygon-colors.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ leaf <- leaflet(spdf)
4242
#'
4343
#' ### Quantiles
4444

45-
qpal <- colorQuantile(rev(viridis::viridis(10)), spdf$POPDENSITY, n = 10)
45+
qpal <- colorQuantile(rev(viridisLite::viridis(10)), spdf$POPDENSITY, n = 10)
4646

4747
leaf %>%
4848
addPolygons(weight = 1, color = "#333333", fillOpacity = 1,
@@ -55,7 +55,7 @@ leaf %>%
5555
#'
5656
#'
5757
#' ### Bins
58-
binpal <- colorBin(rev(viridis::viridis(10)), spdf$POPDENSITY, bins = 10)
58+
binpal <- colorBin(rev(viridisLite::viridis(10)), spdf$POPDENSITY, bins = 10)
5959

6060
leaf %>%
6161
addPolygons(weight = 1, color = "#333333", fillOpacity = 1,
@@ -67,7 +67,7 @@ leaf %>%
6767
#'
6868
#'
6969
#' ### Numeric
70-
numpal <- colorNumeric(rev(viridis::viridis(256)), spdf$POPDENSITY)
70+
numpal <- colorNumeric(rev(viridisLite::viridis(256)), spdf$POPDENSITY)
7171

7272
leaf %>%
7373
addPolygons(weight = 1, color = "#333333", fillOpacity = 1,

0 commit comments

Comments
 (0)