Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace {viridis} dependency by {viridisLite} #897

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Imports:
scales (>= 1.0.0),
sp,
stats,
viridis (>= 0.5.1),
viridisLite,
xfun
Suggests:
knitr,
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

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

* Replace viridis dependency by viridisLite (@olivroy, #897)

# leaflet 2.2.1

* When `addProviderTiles()` is used with `{leaflet.providers}` version 2.0.0 or later, the `leaflet-providers` HTML dependency produced can be correctly cached by knitr. When used with older versions of `{leaflet.providers}`, the HTML dependency uses temp files that break knitr's caching mechanism (thanks @qdread, @jaredlander; #884).
Expand Down
2 changes: 1 addition & 1 deletion R/colors.R
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ toPaletteFunc.character <- function(pal, alpha, nlevels) {
colors <- brewer_pal(pal) # Get all colors
}
} else if (length(pal) == 1 && pal %in% c("viridis", "magma", "inferno", "plasma")) {
colors <- viridis::viridis(n = 256, option = pal)
colors <- viridisLite::viridis(n = 256, option = pal)
} else {
colors <- pal
}
Expand Down
6 changes: 3 additions & 3 deletions inst/examples/polygon-colors.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ leaf <- leaflet(spdf)
#'
#' ### Quantiles

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

leaf %>%
addPolygons(weight = 1, color = "#333333", fillOpacity = 1,
Expand All @@ -55,7 +55,7 @@ leaf %>%
#'
#'
#' ### Bins
binpal <- colorBin(rev(viridis::viridis(10)), spdf$POPDENSITY, bins = 10)
binpal <- colorBin(rev(viridisLite::viridis(10)), spdf$POPDENSITY, bins = 10)

leaf %>%
addPolygons(weight = 1, color = "#333333", fillOpacity = 1,
Expand All @@ -67,7 +67,7 @@ leaf %>%
#'
#'
#' ### Numeric
numpal <- colorNumeric(rev(viridis::viridis(256)), spdf$POPDENSITY)
numpal <- colorNumeric(rev(viridisLite::viridis(256)), spdf$POPDENSITY)

leaf %>%
addPolygons(weight = 1, color = "#333333", fillOpacity = 1,
Expand Down