-
Notifications
You must be signed in to change notification settings - Fork 2.1k
allow geom_sf to accept line parameters (#2826) #2847
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
Conversation
Updated `discrete_scale` documentation to match functionality and `continuous_scale` (@alistaire47, $2052).
# Conflicts: # NEWS.md
Looks good to me. I have only one comment: Since The extraneous git commits will disappear when we squash-merge, so don't worry about them. |
Sorry, one more comment: Could you add a news bullet to NEWS.md with a brief description and your github user name and issue number? |
Oh, I think that's better; those The arguments will still get passed to library(ggplot2)
ggplot(sf::st_polygon(list(matrix(c(0, 1, 2, 0, 0, 2, 1, 0), ncol = 2)))) +
geom_sf(size = 3, linejoin = 'mitre', fill = 'pink') ggplot(sf::st_polygon(list(matrix(c(0, 1, 2, 0, 0, 2, 1, 0), ncol = 2)))) +
geom_sf(size = 3, linejoin = 'bevel', fill = 'lightgreen') |
Oops, forgot, sorry! Updated. |
Apologies for being picky. Would you mind adding a comma after |
Hah, that's now the smallest commit I've ever made. |
@hadley Looks good to me. |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
This closes #2826, allowing
lineend
,linejoin
, andlinemitre
arguments to be passed throughgeom_sf
. I copied the defaults directly fromgeom_path
, so this shouldn't alter the results of current code.The only change I had to make beyond what Claus mentioned on the issue was assigning the parameters to
coord
so they get passed through tosf_grob
. There may be a simpler way to structure that. If so, let me know and I'll refactor.For now, I decided against adding them as explicit parameters to
geom_sf
, as while it would make sense for lines, it would sound like they'd apply to polygons, too, which they wouldn't, and thus may cause more confusion than it'd remove.This builds and performs fine. I didn't add any tests, as the
geom_sf
tests don't currently test its line behavior, but can if you like. I do get an error when checking due to theeconomics_long
dataset. I didn't touch it, but it gives me a C++ error when printed, even thoughstr
works fine:I suspect this means I've got a dependency issue with tibble or something, but I can't figure out what. I presume that if it has been working in CI builds, it will continue to do so.
Apologies for the extra commits in there; I realized too late that I didn't rebase fully. They shouldn't do anything at this point, so if there's some git-fu to clean them out, I'd be happy to remove them.