The purpose of this vignette is to document a slight change
in API expectation with certain
geom_*side* when there are
global aesthetic mappings for both
ggside (<0.1.0), the user was expected to
explicitly map all computed aesthetics, especially in the case when
y are mapped globally for the main
panel. The nature of
ggside is generally to plot
supplemental data, and the user will likely want to inherit the
x global mapping if they use a
geometry, but map something different to
This decision was made in order to keep all
geometries as similar to their
counterparts. However, using
ggside becomes a tad bit
annoying when you must specify every positional
aesthetic, especially when it obvious what the user may want.
ggside (>=0.1.0), certain
geometries will use the default aesthetic mapping of the associated
Stat, depending on the
geom_xsidedensity will ignore the
y global mapping and assign
y = after_stat(density) to that layer’s aesthetic mappings
y mapping was specified. The same can be said for
geom_ysidedensity, it will ignore the
mapping and assign
x = after_stat(density) if no
x mapping was specified.
This should be much less typing.
Of course, if you would like to use a different computed variables, you will need to specify it like normal.
You can even use
geom_xsidedensity(orientation = "y") to
force it to inherit the
y global mapping and map
x = after_stat(density). I don’t expect many users will do
this, but the option is available nonetheless.
geom_*side* geometries have been updated
such that the default expected behavior is easier to use.
This can only be applied to geometries that have a
"identity" with a
the geometries have an
orientation parameter, this can
control which aesthetic is inherited.
geom_*sideviolin are not included in this update
orientation largely depends the aesthetic
mapping of the layer, and these two geometries could go either way
depending on position scales of
geom_*side* geometries will need their
mappings to be explicitly assigned or they will try to inherit from the
global mapping (so long as
inherit.aes = TRUE).