ggplot2 icon indicating copy to clipboard operation
ggplot2 copied to clipboard

POC: Standardise `width` calculation

Open teunbrand opened this issue 1 year ago • 0 comments

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 avatar Aug 28 '24 09:08 teunbrand