8000 Ignore calculated aesthetics that match specified aesthestics by cpsievert · Pull Request #1650 · plotly/plotly.R · GitHub
[go: up one dir, main page]

Skip to content

Ignore calculated aesthetics that match specified aesthestics #1650

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

Merged
merged 1 commit into from
Jan 7, 2020

Conversation

cpsievert
Copy link
Collaborator
@cpsievert cpsievert commented Nov 7, 2019

After tidyverse/ggplot2@10fa0014, it's now possible for calculated aes to exist for all default_aes...27db11e just removes any "calculated aes" that are also a "user-specified aes" from consideration when building the tooltip

27db11e also changes the ordering in which the aes appear in the tooltip from:

  • Layer aes
  • Calculated aes
  • Global aes

to what I think is a better default:

  • Calculated aes
  • Layer aes
  • Global aes

Testing notes

Confirm that density appears once (not twice) in the tooltip when hovering on the density lines:

library(plotly)

p <- ggplot(mtcars, aes(x = mpg, fill = factor(cyl))) + 
  geom_density()
ggplotly(p)

After tidyverse/ggplot2@10fa0014, it's possible for calculated aes to exist for all default_aes
@cpsievert cpsievert requested a review from jcheng5 January 7, 2020 20:10
@cpsievert cpsievert merged commit 669db9c into master Jan 7, 2020
@cpsievert cpsievert deleted the ggplotly-calculated-tooltip branch February 6, 2020 21:09
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.

2 participants
0