This PR is an amendment to #5834, as it didn't handle the non-standard defaults for geom_sf() legends.
Briefly, this PR let's Layer$compute_geom_2() instead of Geom$use_defaults() handle populating legend keys with defaults.
The legend code was mirroring Layer$compute_geom_2() in many ways anyway, so this shouldn't be much of a stretch.
This ensures that the layer could impose some of its non-aesthetic parameters on the legend keys.
That is needed to resolve the defaults for the correct legend type in geom_sf(), which we'd need for #5833.
In addition the following changes are made:
Layer$compute_geom_2() now accepts a custom params object, as legends only pass static aesthetics when they are of length 1.
The sf legend detection mechanism has moved from LayerSf$setup_layer() to LayerSf$compute_geom_1(). This allows for more readable code and abolishes the stateful computed_legend_key_type field in LayerSf.
There is now a visual test for geom_sf()'s legend types, because we had detected problems in revdepchecks that weren't covered in our own tests.
There is now a test for legend keys when a geom does not having matching aesthetics, which we didn't cover before.
This PR is an amendment to #5834, as it didn't handle the non-standard defaults for
geom_sf()
legends.Briefly, this PR let's
Layer$compute_geom_2()
instead ofGeom$use_defaults()
handle populating legend keys with defaults.The legend code was mirroring
Layer$compute_geom_2()
in many ways anyway, so this shouldn't be much of a stretch. This ensures that the layer could impose some of its non-aesthetic parameters on the legend keys. That is needed to resolve the defaults for the correct legend type ingeom_sf()
, which we'd need for #5833.In addition the following changes are made:
Layer$compute_geom_2()
now accepts a customparams
object, as legends only pass static aesthetics when they are of length 1.LayerSf$setup_layer()
toLayerSf$compute_geom_1()
. This allows for more readable code and abolishes the statefulcomputed_legend_key_type
field inLayerSf
.geom_sf()
's legend types, because we had detected problems in revdepchecks that weren't covered in our own tests.