Skip to content

Standardise width calculation #6065

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 5 commits into from
Jan 27, 2025

Conversation

teunbrand
Copy link
Collaborator

@teunbrand teunbrand commented Aug 28, 2024

This PR aims to fix #2800.

Briefly; it adds a helper function to standardise computing widths and applies it to several geoms that compute it.

There are several problems with the current situation;

  1. Some geoms have width as an aesthetic, some have width as a parameter.
  2. The Geom$default_aes$width is a 'dummy' default which was never actually used.

Respecitvely, this PR solves these thus:

  1. All width is implemented as aesthetic.
  2. The Geom$default_aes$width is used as a multiplier after calculating the data resolution. It replaces hardcoded defaults.

As a caveat; I didn't treat GeomErrorbarh in this PR, but that is because I think it should be deprecated (#5961). For this reason I still treat this as POC.

@teunbrand teunbrand changed the title Standardise width calculation POC: Standardise width calculation Aug 28, 2024
@teunbrand
Copy link
Collaborator Author

With #5961 merged, this is ready for review

@teunbrand teunbrand changed the title POC: Standardise width calculation Standardise width calculation Dec 10, 2024
Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teunbrand teunbrand merged commit 628d7ab into tidyverse:main Jan 27, 2025
13 checks passed
@teunbrand teunbrand deleted the standardise_width_calculation branch January 27, 2025 11:02
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

default width aesthetic of geom_errorbar does not impact plot
2 participants