Skip to content
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

Feature request: improve palette interface #6064

Open
teunbrand opened this issue Aug 27, 2024 · 0 comments · May be fixed by #6112
Open

Feature request: improve palette interface #6064

teunbrand opened this issue Aug 27, 2024 · 0 comments · May be fixed by #6112

Comments

@teunbrand
Copy link
Collaborator

The current interface for interacting with palettes is by wrapping each one in a scale.
I dislike this for the following reasons:

  • It expanded the number of scale functions in ggplot2 beyond modesty (do we really need continuous, discrete and binned variants of every palette?).
  • It encourages developers of palette packages to model their interface after ggplot2's interface.

It is no good reverting the scales we already have, but we may yet prevent wildgrowth of future scale functions. The proposal is to make the palette argument in scales more accessible to users, by for example:

  • Directly expose the palette argument in some scale functions
  • This palette argument would then accept:
    • A function, as it does currently
    • A keyword, like "viridis" or "okabe-ito"
    • A vector of values that can be translated to a function
  • Abstract away the distinction between discrete and continuous palettes.
    • A user shouldn't have to worry about this
    • Auto-translate discrete palettes to continuous ones
    • Auto-translate continuous palettes to discrete ones
@teunbrand teunbrand linked a pull request Sep 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant