Skip to content

Commit 9f358aa

Browse files
committed
maptools and rgeos are useful for some sf functionality
1 parent aa750b0 commit 9f358aa

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
CONDUCT.md
66
CONTRIBUTING.md
77
build_site.R
8+
travis_debug.R
89
todo.R
910
.github/
1011
inst/examples/rmd/*.html

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ inst/examples/*/rsconnect/*
1414
Untitled*
1515
rsconnect/
1616
revdep/
17+
travis_debug.R

DESCRIPTION

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Suggests:
6363
listviewer,
6464
dendextend,
6565
sf,
66+
maptools,
67+
rgeos,
6668
RSelenium,
6769
png,
6870
IRdisplay

tests/testthat/test-plotly-sf.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ test_that("Can plot sfc with a missing crs", {
8484

8585
test_that("plot_ly() defaults to blank axes", {
8686
skip_if_not_installed("sf")
87+
skip_if_not_installed("maptools")
88+
skip_if_not_installed("rgeos")
8789

8890
m <- sf::st_as_sf(maps::map("world", plot = FALSE, fill = TRUE))
89-
print(m)
9091

9192
p <- plot_ly() %>%
9293
add_sf(data = m, color = I("black"), fillcolor = "transparent", hoverinfo = "none") %>%
@@ -108,7 +109,7 @@ test_that("plot_ly() defaults to blank axes", {
108109
expect_true(xaxis$title == "just a test")
109110
expect_null(yaxis$title)
110111

111-
expect_true(yaxis$ticks == "")
112+
expect_true(xaxis$ticks == "")
112113
expect_true(yaxis$ticks == "")
113114
})
114115

@@ -165,7 +166,6 @@ test_that("discrete color informs fillcolor", {
165166

166167
linecolors <- sapply(d, function(tr) tr$line$color)
167168
expect_match(linecolors, "rgba(0,0,0,1)", fixed = TRUE)
168-
169169
})
170170

171171

@@ -175,7 +175,6 @@ test_that("numeric color informs fillcolor", {
175175
p <- plot_mapbox(res_mn, color = ~AREA)
176176
expect_warning(plotly_build(p), "Only one fillcolor per trace allowed")
177177

178-
# TODO: shouldn't add markers to mode!
179178
d <- plotly_build(p)$x$data
180179
expect_true(d[[1]]$mode == "lines")
181180

0 commit comments

Comments
 (0)