Skip to content

🚑 Repair layer names that might have become lost #6298

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

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #6295.

It bequeaths the 'unknown' name upon layers that have lost their names.
Reprex from issue:

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2

p <- ggplot(mpg, aes(displ, hwy)) +
  geom_point()

# To wipe out names
p$layers <- list(geom_path(), geom_path())
p <- p + geom_point() + geom_point()
names(p$layers)
#> [1] "unknown...1"    "unknown...2"    "geom_point"     "geom_point...4"

Created on 2025-01-22 with reprex v2.1.1

@teunbrand teunbrand changed the title 🚑 Repair names that might have become lost 🚑 Repair layer names that might have become lost Jan 22, 2025
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 66d6ee4 into tidyverse:main Jan 28, 2025
13 checks passed
@teunbrand teunbrand deleted the name_stability branch January 28, 2025 12:27
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.

Stability of layer names
2 participants