change plotting to work with ggplot2 >=v3.5 #2236
Merged
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.
Details
ggplot2 version 3.5 had added a myriad of changes to legend objects, converting from S3 objects, to ggproto. Additionally, the legend interface had been heavily rewritten, with the grobs now having attr for legends in four positions rather than the one shared position in a plot previously. Lastly, empty grob objects, which were previously dropped, are no longer dropped, breaking our internal logic (
<simpleError in g$grobs[[legend]]: no such index at level 2>
)This broke ArchR's ability to create legends, since we use this information when fixing plot sizes. This fixes plotting issues by validating that any legends detecting in a plot's grob are indeed non-empty.
Fixes issues #2150, #2123, #2130, #2168, #2234, #2210
Tests