Skip to content

Don't export LayerSf #3158

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

Closed
clauswilke opened this issue Feb 22, 2019 · 3 comments · Fixed by #3208
Closed

Don't export LayerSf #3158

clauswilke opened this issue Feb 22, 2019 · 3 comments · Fixed by #3208
Assignees

Comments

@clauswilke
Copy link
Member

When I implemented custom layers for sf objects, I exported the relevant layer object, LayerSf():

ggplot2/R/layer-sf.R

Lines 3 to 8 in 033fb52

#' @export
#' @include layer.r
#' @rdname ggsf
#' @usage NULL
#' @format NULL
LayerSf <- ggproto("LayerSf", Layer,

This is bad, because we currently don't export its parent, Layer(), and we don't want to export it at this time.

The correct way to make the sf-specific layer available is to add a constructor function, layer_sf(), which replaces the layer() function for sf layers.

@yutannihilation
Copy link
Member

Probably, we should not expose layer_class argument of layer() as well; the user cannot provide any Layer class as it's not exported.

show.legend = NA, layer_class = Layer) {

@paleolimbot
Copy link
Member

@clauswilke : I think you asked...I've never needed to use layer() when creating a geom_sf() layer...the only thing I've changed is the Stat passed to geom_sf().

@lock
Copy link

lock bot commented Sep 23, 2019

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/

@lock lock bot locked and limited conversation to collaborators Sep 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants