Skip to content

Standardise width calculation - #6065

Merged
teunbrand merged 5 commits into
tidyverse:mainfrom
teunbrand:standardise_width_calculation
Jan 27, 2025
Merged

teunbrand merged 5 commits into
tidyverse:mainfrom
teunbrand:standardise_width_calculation

Conversation

@teunbrand

@teunbrand teunbrand commented Aug 28, 2024 •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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

@thomasp85 thomasp85 left a comment

Copy link
Copy Markdown
Member

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
@teunbrand
teunbrand deleted the standardise_width_calculation branch January 27, 2025 11:02
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.

default width aesthetic of geom_errorbar does not impact plot

2 participants