Skip to content

Commit

Permalink
moved servr to imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mtennekes committed Jan 27, 2025
1 parent c0756d0 commit bc8a6c2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ Imports:
stats,
s2,
tmaptools (>= 3.1),
units (>= 0.6-1)
units (>= 0.6-1),
servr,
Suggests:
av,
colorspace,
Expand All @@ -55,7 +56,6 @@ Suggests:
knitr,
maptiles,
png,
servr,
shiny,
terra,
testthat (>= 3.2.0),
Expand Down
2 changes: 1 addition & 1 deletion R/spatial_terra.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tmapShape.SpatRaster = function(shp, is.main, crs, bbox, unit, filter, shp_name,
ctabs = terra::coltab(shp)
cats = terra::levels(shp)

minmax = as.list(as.data.frame(terra::minmax(shp)))
minmax = as.list(as.data.frame(terra::minmax(shp, compute = all(!terra::hasMinMax(shp)))))

dt = data.table::setDT(terra::as.data.frame(shp, na.rm=FALSE))
dt[, tmapID__:=1L:nrow(dt)]
Expand Down
2 changes: 0 additions & 2 deletions R/tmapLeafletRun.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ tmapLeafletRun = function(o, q, show, knit, args) {
paneHeight = -1
}
if (ide == "vscode") {
rlang::check_installed("servr")
# VSCode's viewer can't ignore cross-origin requests. Need to serve the
# map so assests can be read, e.g. .fgb files.
server <- servr::httd(
Expand All @@ -110,7 +109,6 @@ tmapLeafletRun = function(o, q, show, knit, args) {
viewer(url, height = paneHeight)
}
} else {
rlang::check_installed("servr")
viewerFunc = function(url) {
dir = get_url_dir(url)
switch(ide,
Expand Down
10 changes: 10 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@

* Running time examples decreased

## Reresubmission note

* Running time examples further decreased

## Reverse dependency checks

* MazamaSpatialPlots: contacted the author about this issue. He promised to submit an update to resolve this once tmap 4.0 is on CRAN.
* spatialrisk: to solve this, we've moved servr from Suggests to Imports.
* mapping: this is a minor note due to the change of argument names ("col" has been renamed to "color"). It does not effect the output.

## R CMD check results

0 errors | 0 warnings | 0 note
Expand Down
2 changes: 1 addition & 1 deletion examples/tm_rgb.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
\dontrun{
require(stars)
file = system.file("tif/L7_ETMs.tif", package = "stars")

Expand All @@ -6,7 +7,6 @@ L7 = stars::read_stars(file)
tm_shape(L7) +
tm_rgb()

\dontrun{
# the previous example was a shortcut of this call
tm_shape(L7) +
tm_rgb(col = tm_vars("band", dimvalues = 1:3, multivariate = TRUE))
Expand Down
2 changes: 1 addition & 1 deletion man/tm_rgb.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bc8a6c2

Please sign in to comment.