Repository navigation
Enable 2D structures as aesthetics - #6076
Merged
Merged
Conversation
Collaborator
Author
|
I'm unsure why the coverage CI is failing |
Collaborator
Author
|
TODO: check errors in scales |
Collaborator
Author
|
Also incorporated #6090 as it is thematically related in the sense of "ggplot2 should give vctrs treatment to input". devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2
p <- ggplot(mpg, aes(displ, hwy)) +
geom_point() +
scale_x_continuous(
breaks = 2:7,
labels = data.frame(foo = LETTERS[1:6], bar = 1:6)
)
get_guide_data(p, aesthetic = "x")
#> x .value .label.foo .label.bar y
#> 1 0.1127946 2 A 1 0
#> 2 0.2811448 3 B 2 0
#> 3 0.4494949 4 C 3 0
#> 4 0.6178451 5 D 4 0
#> 5 0.7861953 6 E 5 0
#> 6 0.9545455 7 F 6 0Created on 2024-09-20 with reprex v2.1.1 |
Merge branch 'main' into vctrs_columns # Conflicts: # R/scale-.R # R/utilities.R
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to fix #4189 and fix #6090.
Briefly, this PR would allow people to use 2D structures like matrices, data.frames and tibbles as aesthetics.
We just had to adopt the {vctrs} way of measure sizes and setting names at select places for this to.
Importantly, this does not implement appropriate scales for such aesthetics, but it removes a barrier for extension developers to implement them.
Created on 2024-09-04 with reprex v2.1.1