Skip to content

Commit 76df847

Browse files
authored
Upkeep August 2023 (#871)
1 parent 05a9b85 commit 76df847

31 files changed

+21020
-34711
lines changed

DESCRIPTION

Lines changed: 54 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,81 @@
1-
Package: leaflet
21
Type: Package
2+
Package: leaflet
33
Title: Create Interactive Web Maps with the JavaScript 'Leaflet' Library
44
Version: 2.1.2.9000
55
Authors@R: c(
6-
person("Joe", "Cheng", email = "[email protected]", role = c("aut", "cre")),
7-
person("Barret", "Schloerke", role = c("aut")),
8-
person("Bhaskar", "Karambelkar", role = c("aut")),
9-
person("Yihui", "Xie", role = c("aut")),
10-
person("Hadley", "Wickham", role = c("ctb")),
11-
person("Kenton", "Russell", role = c("ctb")),
12-
person("Kent", "Johnson", role = c("ctb")),
13-
person("Vladimir", "Agafonkin", role = c("ctb", "cph"), comment = "Leaflet library"),
14-
person("CloudMade", role = c("cph"), comment = "Leaflet library"),
15-
person("Leaflet contributors", role = c("ctb"), comment = "Leaflet library"),
16-
person("Brandon Copeland", role = c("ctb", "cph"), comment = "leaflet-measure plugin"),
17-
person("Joerg Dietrich", role = c("ctb", "cph"), comment = "Leaflet.Terminator plugin"),
18-
person("Benjamin Becquet", role = c("ctb", "cph"), comment = "Leaflet.MagnifyingGlass plugin"),
19-
person("Norkart AS", role = c("ctb", "cph"), comment = "Leaflet.MiniMap plugin"),
20-
person("L. Voogdt", role = c("ctb", "cph"), comment = "Leaflet.awesome-markers plugin"),
21-
person("Daniel Montague", role = c("ctb", "cph"), comment = "Leaflet.EasyButton plugin"),
22-
person("Kartena AB", role = c("ctb", "cph"), comment = "Proj4Leaflet plugin"),
23-
person("Robert Kajic", role = c("ctb", "cph"), comment = "leaflet-locationfilter plugin"),
24-
person("Mapbox", role = c("ctb", "cph"), comment = "leaflet-omnivore plugin"),
25-
person("Michael Bostock", role = c("ctb", "cph"), comment = "topojson"),
26-
person("RStudio", role = c("cph"))
27-
)
6+
person("Joe", "Cheng", , "[email protected]", role = c("aut", "cre")),
7+
person("Barret", "Schloerke", role = "aut"),
8+
person("Bhaskar", "Karambelkar", role = "aut"),
9+
person("Yihui", "Xie", role = "aut"),
10+
person("Hadley", "Wickham", role = "ctb"),
11+
person("Kenton", "Russell", role = "ctb"),
12+
person("Kent", "Johnson", role = "ctb"),
13+
person("Vladimir", "Agafonkin", role = c("ctb", "cph"),
14+
comment = "Leaflet library"),
15+
person("CloudMade", role = "cph",
16+
comment = "Leaflet library"),
17+
person("Leaflet contributors", role = "ctb",
18+
comment = "Leaflet library"),
19+
person("Brandon Copeland", role = c("ctb", "cph"),
20+
comment = "leaflet-measure plugin"),
21+
person("Joerg Dietrich", role = c("ctb", "cph"),
22+
comment = "Leaflet.Terminator plugin"),
23+
person("Benjamin Becquet", role = c("ctb", "cph"),
24+
comment = "Leaflet.MagnifyingGlass plugin"),
25+
person("Norkart AS", role = c("ctb", "cph"),
26+
comment = "Leaflet.MiniMap plugin"),
27+
person("L. Voogdt", role = c("ctb", "cph"),
28+
comment = "Leaflet.awesome-markers plugin"),
29+
person("Daniel Montague", role = c("ctb", "cph"),
30+
comment = "Leaflet.EasyButton plugin"),
31+
person("Kartena AB", role = c("ctb", "cph"),
32+
comment = "Proj4Leaflet plugin"),
33+
person("Robert Kajic", role = c("ctb", "cph"),
34+
comment = "leaflet-locationfilter plugin"),
35+
person("Mapbox", role = c("ctb", "cph"),
36+
comment = "leaflet-omnivore plugin"),
37+
person("Michael Bostock", role = c("ctb", "cph"),
38+
comment = "topojson"),
39+
person("Posit Software, PBC", role = c("cph", "fnd"))
40+
)
2841
Description: Create and customize interactive maps using the 'Leaflet'
29-
JavaScript library and the 'htmlwidgets' package. These maps can be used
30-
directly from the R console, from 'RStudio', in Shiny applications and R Markdown
31-
documents.
42+
JavaScript library and the 'htmlwidgets' package. These maps can be
43+
used directly from the R console, from 'RStudio', in Shiny
44+
applications and R Markdown documents.
3245
License: GPL-3
33-
URL: https://rstudio.github.io/leaflet/
46+
URL: https://rstudio.github.io/leaflet/,
47+
https://github.com/rstudio/leaflet
3448
BugReports: https://github.com/rstudio/leaflet/issues
35-
Depends: R (>= 3.1.0)
49+
Depends:
50+
R (>= 3.1.0)
3651
Imports:
37-
xfun,
3852
crosstalk,
39-
htmlwidgets (>= 1.5.4),
4053
htmltools,
54+
htmlwidgets (>= 1.5.4),
4155
jquerylib,
56+
leaflet.providers (>= 1.8.0),
4257
magrittr,
4358
methods,
4459
png,
45-
RColorBrewer,
4660
raster (>= 3.6.3),
61+
RColorBrewer,
4762
scales (>= 1.0.0),
4863
sp,
4964
stats,
5065
viridis (>= 0.5.1),
51-
leaflet.providers (>= 1.8.0)
66+
xfun
5267
Suggests:
5368
knitr,
5469
maps,
55-
sf (>= 0.9-6),
56-
shiny,
70+
purrr,
5771
R6,
5872
RJSONIO,
59-
purrr,
60-
testthat (>= 3.0.0),
6173
s2,
62-
terra
63-
RoxygenNote: 7.2.3
74+
sf (>= 0.9-6),
75+
shiny,
76+
terra,
77+
testthat (>= 3.0.0)
78+
Config/testthat/edition: 3
6479
Encoding: UTF-8
6580
LazyData: true
66-
Config/testthat/edition: 3
81+
RoxygenNote: 7.2.3

R/layers.R

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,12 @@ addRasterLegend <- function(map, x, layer = 1, ...) {
326326
stopifnot(inherits(x, "SpatRaster"))
327327
stopifnot(length(layer) == 1 && layer > 0 && layer <= terra::nlyr(x))
328328

329-
## might as well do this here and only once. Subsetting would otherwise have been necessary in
330-
## color_info <- base::subset(color_info, value %in% terra::values(x))
329+
# might as well do this here and only once. Subsetting would otherwise have
330+
# been necessary in
331+
# color_info <- base::subset(color_info, value %in% terra::values(x))
331332
x <- x[[layer]]
332333

334+
333335
# Retrieve the color table from the layer. If one doesn't exist, that means
334336
# the raster was colored some other way, like using colorFactor or something,
335337
# and the regular addLegend() is designed for those cases.
@@ -342,25 +344,23 @@ addRasterLegend <- function(map, x, layer = 1, ...) {
342344
# Extract the colors in #RRGGBBAA format
343345
color_info <- data.frame(
344346
value = ct[[1]],
345-
color = grDevices::rgb(ct$red/255, ct$green/255, ct$blue/255, ct$alpha/255)
347+
color = grDevices::rgb(ct$red / 255, ct$green / 255, ct$blue / 255, ct$alpha / 255)
346348
)
347349

348350
lvls <- terra::levels(x)[[1]]
349351

350-
# Drop values that aren't part of the layer
351-
## unlike "values", "unique" is memory-safe; it does not load all values
352-
## into memory if the raster is large. So instead of:
353-
354-
# color_info <- base::subset(color_info, value %in% terra::values(x))
355-
356-
## remove the levels to get the raw cell values
352+
# Drop values that aren't part of the layer unlike "values", "unique" is
353+
# memory-safe; it does not load all values into memory if the raster is large.
354+
# So instead of:
355+
#
356+
# color_info <- base::subset(color_info, value %in% terra::values(x))
357+
#
358+
# remove the levels to get the raw cell values
357359
levels(x) <- NULL
358360
color_info <- base::subset(color_info, value %in% terra::unique(x)[[1]])
359361

360362
res <- if (is.data.frame(lvls)) {
361-
# Use the labels from levels(x), and look up the matching colors in the
362-
# color table
363-
363+
# Use the labels from levels(x), and look up the matching colors.
364364
# The levels data frame can have varying colnames, just normalize them
365365
colnames(lvls) <- c("value", "label")
366366
base::merge(color_info, lvls, by.x = "value", by.y = 1)

R/leaflet-package.R

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#' @keywords internal
2+
#' @aliases leaflet-package NULL
3+
"_PACKAGE"
4+
5+
## usethis namespace: start
6+
#' @importFrom grDevices col2rgb
7+
#' @importFrom grDevices rgb
8+
#' @importFrom htmlwidgets JS
9+
#' @importFrom magrittr %>%
10+
#' @importFrom methods substituteDirect
11+
#' @importFrom stats na.omit
12+
#' @importFrom stats quantile
13+
#' @importFrom utils getFromNamespace
14+
#' @importFrom utils packageVersion
15+
## usethis namespace: end
16+
NULL
17+
18+
## Re-exports
19+
#' @export %>%
20+
#' @export JS
21+
NULL
22+
23+
release_bullets <- function() {
24+
c(
25+
"Update static imports: `staticimports::import()`",
26+
"`system(\"npm run build\")`",
27+
"Rebuild website: `source(\"scripts/docs_update.R\")",
28+
'Check Super Zip example: `shiny::runGitHub("rstudio/shiny-examples", subdir = "063-superzip-example")`',
29+
"Check licenses if bundled dependencies were updated",
30+
'`source("scripts/viztest.R")`'
31+
)
32+
}

R/package.R

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/_includes/after_body.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<footer>
2-
<p><small>The "leaflet" R package is copyright &copy; 2014-2016 RStudio, Inc.<br/>
3-
The Leaflet JavaScript library is &copy; 2010–2016 <a href="http://agafonkin.com/en">Vladimir Agafonkin</a>, 2010–2011 <a href="http://cloudmade.com">CloudMade</a>.<br/>
2+
<p><small>The "leaflet" R package is copyright &copy; 2014-2023 Posit Software, PBC.<br/>
3+
The Leaflet JavaScript library is &copy; 2010–2023 <a href="http://agafonkin.com/en">Vladimir Agafonkin</a>, 2010–2011 <a href="http://cloudmade.com">CloudMade</a>.<br/>
44
Maps &copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors unless otherwise noted.
55
</small></p>
66
</footer>
77

88
</div>
99
</div>
1010

11-
<a href="https://github.com/rstudio/leaflet"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
11+
<a href="https://github.com/rstudio/leaflet" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#2c3e50; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>

docs/basemaps.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ <h3>Default (OpenStreetMap) Tiles</h3>
267267
}
268268
},
269269
"setView": [
270-
[42.3601, -71.0589],
270+
[42.3601, -71.05889999999999],
271271
12,
272272
[]
273273
],
@@ -331,7 +331,7 @@ <h3>Third-Party Tiles</h3>
331331
}
332332
},
333333
"setView": [
334-
[42.3601, -71.0589],
334+
[42.3601, -71.05889999999999],
335335
12,
336336
[]
337337
],
@@ -368,7 +368,7 @@ <h3>Third-Party Tiles</h3>
368368
}
369369
},
370370
"setView": [
371-
[42.3601, -71.0589],
371+
[42.3601, -71.05889999999999],
372372
12,
373373
[]
374374
],
@@ -405,7 +405,7 @@ <h3>Third-Party Tiles</h3>
405405
}
406406
},
407407
"setView": [
408-
[42.3601, -71.0589],
408+
[42.3601, -71.05889999999999],
409409
12,
410410
[]
411411
],
@@ -508,7 +508,7 @@ <h3>WMS Tiles</h3>
508508
}
509509
],
510510
"setView": [
511-
[42.0285, -93.65],
511+
[42.0285, -93.65000000000001],
512512
4,
513513
[]
514514
]
@@ -540,7 +540,7 @@ <h3>Combining Tile Layers</h3>
540540
}
541541
},
542542
"setView": [
543-
[42.3601, -71.0589],
543+
[42.3601, -71.05889999999999],
544544
12,
545545
[]
546546
],
@@ -594,16 +594,16 @@ <h3>Combining Tile Layers</h3>
594594
</div>
595595

596596
<footer>
597-
<p><small>The "leaflet" R package is copyright &copy; 2014-2016 RStudio, Inc.<br/>
598-
The Leaflet JavaScript library is &copy; 2010–2016 <a href="http://agafonkin.com/en">Vladimir Agafonkin</a>, 2010–2011 <a href="http://cloudmade.com">CloudMade</a>.<br/>
597+
<p><small>The "leaflet" R package is copyright &copy; 2014-2023 Posit Software, PBC.<br/>
598+
The Leaflet JavaScript library is &copy; 2010–2023 <a href="http://agafonkin.com/en">Vladimir Agafonkin</a>, 2010–2011 <a href="http://cloudmade.com">CloudMade</a>.<br/>
599599
Maps &copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors unless otherwise noted.
600600
</small></p>
601601
</footer>
602602

603603
</div>
604604
</div>
605605

606-
<a href="https://github.com/rstudio/leaflet"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
606+
<a href="https://github.com/rstudio/leaflet" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#2c3e50; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
607607

608608

609609

0 commit comments

Comments
 (0)