You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be great if there was some mechanism in which packages can register a colour palette that then could natively interface with scales/ggplot2. It would save having to write separate scale_colour/fill_*() functions for packages providing the palettes, and save having to write scale_{custom_colour_aesthetic}_{palette_type} for packages that extend layers with custom colour-like aesthetics.
Which then gets used in e.g. ggplot2 scales. A nicety that can be added is to pre-populate these list of registered palettes with R's build-in palettes.
Awesome work - this will be super useful! I wonder if the set_palette function here could be called register_palette@teunbrand? This might reflect more accurately what it does. I.e. nothing is set for subsequent plots. It's just available to be retrieved. This stuff is subjective, so maybe what you've got is better. I just would expect setting a palette would change the colours by default
Hmm, I like set set_/get_ symmetry, but I suppose it could be set_registered_palette() and get_registered_palette() to make it somewhat less ambiguous.
Hmm, set_registered_palette does look a little long-winded.
Another idea: set_known_palette and get_known_palette? Think it still could be misinterpreted as setting a default palette for subsequent plots. I suppose people can read the help.
So think I prefer register_palette for the reason mentioned above. Not sure what to call the get_* one though ..
Activity
davidhodge931 commentedon Sep 24, 2024
Awesome work - this will be super useful! I wonder if the
set_palettefunction here could be calledregister_palette@teunbrand? This might reflect more accurately what it does. I.e. nothing is set for subsequent plots. It's just available to be retrieved. This stuff is subjective, so maybe what you've got is better. I just would expect setting a palette would change the colours by defaultteunbrand commentedon Sep 25, 2024
Hmm, I like set
set_/get_symmetry, but I suppose it could beset_registered_palette()andget_registered_palette()to make it somewhat less ambiguous.davidhodge931 commentedon Sep 25, 2024
Hmm,
set_registered_palettedoes look a little long-winded.Another idea:
set_known_paletteandget_known_palette? Think it still could be misinterpreted as setting a default palette for subsequent plots. I suppose people can read the help.So think I prefer
register_palettefor the reason mentioned above. Not sure what to call theget_*one though ..