Skip to content

Add bidirectionality to layers#183

Open
thomasp85 wants to merge 2 commits intomainfrom
issue111-orientation-v2
Open

Add bidirectionality to layers#183
thomasp85 wants to merge 2 commits intomainfrom
issue111-orientation-v2

Conversation

@thomasp85
Copy link
Collaborator

Fixes #111

Superseedes #176

This PR adds unified support for bidirectionality to layers using the same ideas as we did in ggplot2. However, we can be a bit less guessing about it here because we have access to the actual scales.

It also sets in stone what a layers primary axis must be to work with this:

If the layer only need one positional aesthetic (because the second is calculated) then that aesthetic must be the primary one (e.g. histogram)
If the layer has a discrete axis and a continuous one then the discrete is the primary (e.g. box plot)
If a layer has two continuous axes and one of them takes a range mapping (e.g. ymin/ymax) then the range axis is the secondary one (e.g. ribbon)
If a layer accepts no positional mappings then the remapping goes to the secondary axis (e.g. bar)
Any new layer with orientation should follow these rules

Only area and line currently needs orientation explicitly set for flipping - the rest can be deduced with certainty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle layer orientation

1 participant