Skip to content

scale_name property should be removed from Scale objects #1312

Closed

Description

@wch

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.

Activity

  1. added this to the v2.2.0 milestone on Jul 29, 2016
  2. thomasp85 commented on Aug 3, 2016

    @thomasp85
    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...

  3. hadley commented on Aug 23, 2016

    @hadley
    Member

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

  4. hadley commented on Sep 23, 2016

    @hadley
    Member

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

  5. removed this from the v2.2.0 milestone on Sep 23, 2016
  6. hadley commented on Sep 23, 2016

    @hadley
    Member

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

  7. hadley commented on Oct 30, 2017

    @hadley
    Member

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

    type <- if (self$scale_name == "position_c") "continuous" else "discrete"
  8. paleolimbot commented on Jun 18, 2019

    @paleolimbot
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions