-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Domesticate NULL aesthetic labels
#6644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Domesticate NULL aesthetic labels
#6644
Conversation
R/aes-evaluation.R
Outdated
| if (is.null(mapping)) { | ||
| return(structure(aesthetic, fallback = TRUE)) | ||
| } | ||
| if (is.atomic(mapping)) { | ||
| return(aesthetic) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an argument to be made to also have atomic mappings return fallback labels.
#6616 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I'm in favour of this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead and implemented this after I pulsed your opinion in slack, so this should be ready for review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR aims to fix #6616.
Briefly, whenever a (default) label is derived from a
NULLaesthetic, we set thefallback = TRUEattribute. This allows labels derived from other layers to overrule that label.Reprex from the issue, notice that we have
ctyandhwylabels instead ofx/ylabels.Created on 2025-09-24 with reprex v2.1.1