@@ -33,23 +33,23 @@ test_that("geom_sf() determines the legend type automatically", {
33
33
34
34
# test the automatic choice
35
35
expect_identical(fun_geom_sf(mp , TRUE )$ plot $ layers [[1 ]]$ show.legend , TRUE )
36
- expect_identical(fun_geom_sf(mp , TRUE )$ plot $ layers [[1 ]]$ geom_params $ legend , " point" )
36
+ expect_identical(fun_geom_sf(mp , TRUE )$ plot $ layers [[1 ]]$ computed_geom_params $ legend , " point" )
37
37
38
38
expect_identical(fun_geom_sf(mls , TRUE )$ plot $ layers [[1 ]]$ show.legend , TRUE )
39
- expect_identical(fun_geom_sf(mls , TRUE )$ plot $ layers [[1 ]]$ geom_params $ legend , " line" )
39
+ expect_identical(fun_geom_sf(mls , TRUE )$ plot $ layers [[1 ]]$ computed_geom_params $ legend , " line" )
40
40
41
41
expect_identical(fun_geom_sf(mpol , TRUE )$ plot $ layers [[1 ]]$ show.legend , TRUE )
42
- expect_identical(fun_geom_sf(mpol , TRUE )$ plot $ layers [[1 ]]$ geom_params $ legend , " polygon" )
42
+ expect_identical(fun_geom_sf(mpol , TRUE )$ plot $ layers [[1 ]]$ computed_geom_params $ legend , " polygon" )
43
43
44
44
# test that automatic choice can be overridden manually
45
45
expect_identical(fun_geom_sf(mp , " point" )$ plot $ layers [[1 ]]$ show.legend , TRUE )
46
- expect_identical(fun_geom_sf(mp , " point" )$ plot $ layers [[1 ]]$ geom_params $ legend , " point" )
46
+ expect_identical(fun_geom_sf(mp , " point" )$ plot $ layers [[1 ]]$ computed_geom_params $ legend , " point" )
47
47
48
48
expect_identical(fun_geom_sf(mls , " point" )$ plot $ layers [[1 ]]$ show.legend , TRUE )
49
- expect_identical(fun_geom_sf(mls , " point" )$ plot $ layers [[1 ]]$ geom_params $ legend , " point" )
49
+ expect_identical(fun_geom_sf(mls , " point" )$ plot $ layers [[1 ]]$ computed_geom_params $ legend , " point" )
50
50
51
51
expect_identical(fun_geom_sf(mpol , " point" )$ plot $ layers [[1 ]]$ show.legend , TRUE )
52
- expect_identical(fun_geom_sf(mpol , " point" )$ plot $ layers [[1 ]]$ geom_params $ legend , " point" )
52
+ expect_identical(fun_geom_sf(mpol , " point" )$ plot $ layers [[1 ]]$ computed_geom_params $ legend , " point" )
53
53
})
54
54
55
55
test_that(" geom_sf() determines the legend type from mapped geometry column" , {
@@ -70,19 +70,19 @@ test_that("geom_sf() determines the legend type from mapped geometry column", {
70
70
p <- ggplot_build(
71
71
ggplot(d_sf ) + geom_sf(aes(geometry = g_point , colour = " a" ))
72
72
)
73
- expect_identical(p $ plot $ layers [[1 ]]$ geom_params $ legend , " point" )
73
+ expect_identical(p $ plot $ layers [[1 ]]$ computed_geom_params $ legend , " point" )
74
74
75
75
p <- ggplot_build(
76
76
ggplot(d_sf ) + geom_sf(aes(geometry = g_line , colour = " a" ))
77
77
)
78
- expect_identical(p $ plot $ layers [[1 ]]$ geom_params $ legend , " line" )
78
+ expect_identical(p $ plot $ layers [[1 ]]$ computed_geom_params $ legend , " line" )
79
79
80
80
# If `geometry` is not a symbol, `LayerSf$setup_layer()` gives up guessing
81
81
# the legend type, and falls back to "polygon"
82
82
p <- ggplot_build(
83
83
ggplot(d_sf ) + geom_sf(aes(geometry = identity(g_point ), colour = " a" ))
84
84
)
85
- expect_identical(p $ plot $ layers [[1 ]]$ geom_params $ legend , " polygon" )
85
+ expect_identical(p $ plot $ layers [[1 ]]$ computed_geom_params $ legend , " polygon" )
86
86
})
87
87
88
88
test_that(" geom_sf() removes rows containing missing aes" , {
0 commit comments