Skip to content
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

scale_name property should be removed from Scale objects #1312

Closed
wch opened this issue Aug 31, 2015 · 6 comments · Fixed by #5343
Closed

scale_name property should be removed from Scale objects #1312

wch opened this issue Aug 31, 2015 · 6 comments · Fixed by #5343
Labels
feature a feature request or enhancement internals 🔎

Comments

@wch
Copy link
Member

wch commented Aug 31, 2015

One issue with simply removing this property is that the Scale objects will no longer have labels that indicate their subtype. For example, the brewer and grey scales are subtypes of color scales.

@hadley hadley added feature a feature request or enhancement ready labels Jul 29, 2016
@hadley hadley added this to the v2.2.0 milestone Jul 29, 2016
@thomasp85
Copy link
Member

Is there a real issue or is it just a nicety? I cannot find anywhere in the code where this property is queried so there should be no problem in just removing it. On the other hand there doesn't seem to be an urgent need for the removal either as it is just a label...

@hadley
Copy link
Member

hadley commented Aug 23, 2016

Mostly just a nicety as part of continuing to clean up the API so it's easier to understand

@hadley
Copy link
Member

hadley commented Sep 23, 2016

It should really become the ggproto() class name, not a separate attribute.

@hadley hadley removed this from the v2.2.0 milestone Sep 23, 2016
@hadley
Copy link
Member

hadley commented Sep 23, 2016

But this doesn't seem super important, so lets not worry about for this release

@hadley
Copy link
Member

hadley commented Oct 30, 2017

Needs a little thought as ScaleContinous$transform() currently does:

type <- if (self$scale_name == "position_c") "continuous" else "discrete"

@paleolimbot
Copy link
Member

Scale$scale_name should probably be set to the function that the user used to create the scale (e.g., "scale_x_continuous") so that it can generate the appropriate error message (I can't think of a better way to generate an informative error message given the other information available at transformation time). The current values of Scale$scale_name() only generate good error messages for x and y scales (which most commonly generate errors).

I do, however, feel that Scale$call should be removed, since it is never used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement internals 🔎
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants