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

The future of update_geom_defaults() #6085

Open
teunbrand opened this issue Sep 6, 2024 · 3 comments
Open

The future of update_geom_defaults() #6085

teunbrand opened this issue Sep 6, 2024 · 3 comments

Comments

@teunbrand
Copy link
Collaborator

teunbrand commented Sep 6, 2024

This issue came up in #6084 (comment).

Briefly, now that we can do theme(geom = element_geom(...)), there is much less need for update_geom_defaults(). Per #6084 (comment), we should ask ourselves if update_geom_defaults() should be deprecated in a future release.

In my opinion, there is still a niche for update_geom_defaults() as one might want to swap out defaults anyway, in particular when it should affect 1 particular geom and not all of them. I sometimes (ab)use it to get geoms to accept the aesthetics I want (example). I'd therefore advise against future deprecation, but we should probably pivot from recommending update_geom_defaults() to theme(geom).

@yutannihilation
Copy link
Member

Sorry, it might be a bit confusing that I use the term "soft-deprecated" in #6084. I didn't mean to formally deprecate it. Let me clarify a bit.

In my understanding, now the recommendation is

  1. want to change a parameter of a specific geom of a specific plot -> specify the parameter in geom_*() directly
  2. want to change a parameter of all geoms of a specific plot -> use theme(geom = element_geom(...))
  3. want to change a parameter of a specific geom of all plots -> use update_geom_defaults()
  4. want to change a parameter of all geoms of all plots -> use theme_update(geom = element_geom(...)) (or theme_set()?)

and there's still no alternative for case 3. So, update_geom_defaults() needs to be kept. What I meant was, since the usage looks like rather for exports, the documentation for ordinary users should recommend geom = element_geom() over update_geom_defaults() in general. But, while saying this is easy, deciding the nuance is probably subtle and difficult. Honestly, I don't know what to do...

@teunbrand
Copy link
Collaborator Author

teunbrand commented Sep 6, 2024

Thanks for the clarification, I had thought you meant lifecycle::deprecate_soft() but it is clearer now :)
If we agree that there are niche use cases but generally users should opt for theme(geom), perhaps it makes sense to mark update_geom_defaults() as superseded? I think that'd send the right message of 'hey, it is still here, but we'd prefer you to use something else'.
I think your recommendations would make a fine section for a future release post

@yutannihilation
Copy link
Member

perhaps it makes sense to mark update_geom_defaults() as superseded?

In my understanding, "superseded" is the status that all usages are superseded by other functions. So, as long as it still has its unique use, probably it's not superseded yet. But, it's true that some of the usages are superseded. It's difficult to describe the nuance precisely...

I think your recommendations would make a fine section for a future release post

Hope it helps.

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

No branches or pull requests

2 participants