Skip to content

Update geoms to handle upcoming {ggplot2} linewidth/size changes #82

@trevorld

Description

@trevorld

According to a twitter thread from Thomas Lin Pedersen:

Substitute all references to the "size" column in the data with a reference to "linewidth" while falling back to "size" (so that your code works prior to the next release of ggplot2). Example:

data$size

changes to

data$linewidth %||% data$size

Add a new field to your ggproto Geom class:

rename_size = TRUE

(this takes care of converting incoming size aesthetics to linewidth and hooking it up with the correct scale etc)

That's it! As a minimal example see geom_rect: https://github.com/tidyverse/ggplot2/blob/main/R/geom-rect.r

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions