@@ -113,6 +113,8 @@ test_that("plot_ly() defaults to blank axes", {
113
113
})
114
114
115
115
test_that(" discrete color informs fillcolor" , {
116
+ skip_if_not_installed(" sf" )
117
+
116
118
res <- unique(res_mn $ INDRESNAME )
117
119
cols <- viridisLite :: magma(length(res ))
118
120
@@ -132,6 +134,8 @@ test_that("discrete color informs fillcolor", {
132
134
133
135
134
136
test_that(" discrete color informs fillcolor" , {
137
+ skip_if_not_installed(" sf" )
138
+
135
139
res <- unique(res_mn $ INDRESNAME )
136
140
cols <- viridisLite :: magma(length(res ))
137
141
@@ -166,6 +170,7 @@ test_that("discrete color informs fillcolor", {
166
170
167
171
168
172
test_that(" numeric color informs fillcolor" , {
173
+ skip_if_not_installed(" sf" )
169
174
170
175
p <- plot_mapbox(res_mn , color = ~ AREA )
171
176
expect_warning(plotly_build(p ), " Only one fillcolor per trace allowed" )
@@ -209,6 +214,7 @@ test_that("numeric color informs fillcolor", {
209
214
210
215
211
216
test_that(" sizing constants" , {
217
+ skip_if_not_installed(" sf" )
212
218
213
219
# span controls 'stroke-size'
214
220
p <- plot_mapbox(res_mn , span = I(5 )) %> % plotly_build()
@@ -253,6 +259,7 @@ test_that("sizing constants", {
253
259
254
260
255
261
test_that(" size mappings" , {
262
+ skip_if_not_installed(" sf" )
256
263
257
264
expect_warning(
258
265
plotly_build(plot_mapbox(res_mn , span = ~ PERIMETER )),
@@ -287,6 +294,7 @@ test_that("size mappings", {
287
294
288
295
289
296
test_that(" altogether now" , {
297
+ skip_if_not_installed(" sf" )
290
298
291
299
s <- subplot(plot_ly(nc ), plot_geo(nc ), plot_mapbox(nc ), nrows = 3 ) %> % plotly_build()
292
300
d <- s $ x $ data
@@ -320,6 +328,7 @@ test_that("altogether now", {
320
328
321
329
322
330
test_that(" color and stroke scales can be set independently" , {
331
+ skip_if_not_installed(" sf" )
323
332
324
333
n <- length(unique(res_mn $ INDRESNAME ))
325
334
p <- plot_mapbox(res_mn , split = ~ INDRESNAME , color = ~ AREA , stroke = ~ PERIMETER , span = I(2 )) %> %
0 commit comments