fix for multiple plots that consist of a single plot#210
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts editImage()’s interactive editing path to support interactive plot objects that may be collections (e.g., “multiple plots that consist of a single plot”), by cloning and comparing plots differently depending on whether the object is a plain ggplot or a multi-plot container.
Changes:
- Broadened the
"interactive"editing branch to handle non-ggplot plot objects by cloning the container and cloning each subplot. - Reworked the “did editing change anything?” check to support multi-plot objects rather than relying solely on
identical()for ggplots.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1131
to
+1133
| } else { | ||
| !all(vapply(seq_along(plot), \(i) identical(plot[[i]], newPlot[[i]]), FUN.VALUE = logical(1L))) | ||
| } |
|
what do you think of the comments? |
Contributor
Author
|
eh here I think the AI is overdoing it. The code is written generically so that when we can actually edit multiple panels in the future then it still works (not entirely, but mostly). But to already now built in code that work when we add or remove subplots is a bit too much. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.