Discrepancy between geom_point2 and geom_point_borderless (and similar)#435
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces new 'halo' geoms, such as geom_point_halo and geom_jitter_halo, which provide a visual separation for overlapping points by adding a contour that matches the plot's background color. Additionally, it refactors *_borderless geoms as aliases and includes bug fixes for their rendering. Review feedback highlights an inaccuracy in the documentation regarding color aesthetics for the refactored geoms, a typo in the news file, and potential issues in the internal halo logic related to shape conflicts and background color detection.
|
|
||
| ## Bug fixes | ||
|
|
||
| * Fixed the `*_borderless` aliases for `geom_point2()` or `geom_jitter2()`, which |
Comment on lines
+134
to
+137
| dots$colour <- NULL | ||
| dots$color <- .get_theme_bg_color() | ||
|
|
||
| fun_args <- c(list(pch = 21), dots) |
There was a problem hiding this comment.
There are two improvements possible here:
- Shape Conflict: If a user passes
shapeorpchin..., it will conflict with the hardcodedpch = 21. It is safer to explicitly remove these fromdotsto ensure the halo effect (which requires a shape with a border and fill) is preserved. - Background Color Logic: The
.get_theme_bg_color()function currently retrieves the grid line color (panel.grid.major$colour) rather than the actual background color (panel.background$fill). This might result in a halo that doesn't blend with the background if they differ (e.g., grey grid lines on a white background).
dots$colour <- dots$shape <- dots$pch <- NULL
dots$color <- .get_theme_bg_color()
fun_args <- c(list(pch = 21), dots)
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.
Fixes #395