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

Visual tests fail with scales 1.0 #2824

Closed
clauswilke opened this issue Aug 11, 2018 · 5 comments
Closed

Visual tests fail with scales 1.0 #2824

clauswilke opened this issue Aug 11, 2018 · 5 comments

Comments

@clauswilke
Copy link
Member

I updated to scales 1.0 and now numerous visual tests fail. I could just accept them but I think it would be good if somebody who has worked on scales could look them over to make sure it's all good. Most noticeable are substantial changes in default data ranges for data sets with only a single x or y value (see screenshots).

Before:
screen shot 2018-08-10 at 9 01 39 pm

After:
screen shot 2018-08-10 at 9 01 46 pm

Before:
screen shot 2018-08-10 at 8 59 03 pm

After:
screen shot 2018-08-10 at 8 58 47 pm

@dpseidel
Copy link
Collaborator

So I expect both the failures above come from our fix to #2281 in r-lib/scales#161 -- the behavior is as expected for zero range discrete scales and a little surprising for the continuous scale, I'll look into both to confirm. Presumably because of the same or similar reason why visual tests weren't running on travis, tests on my system weren't showing any failures at all until I updated my version of vdiffr this morning. Now that I can actually see the failures, I'll look them over and get a sense of what are expected changes and if there is anything to be concerned about.

@clauswilke
Copy link
Member Author

It seems to me that the result for continuous scales is as expected given the change in
r-lib/scales#161: You set the zero range to 1 and then expand by 5% in either direction, yielding a range of 0.95 to 1.05.

@dpseidel
Copy link
Collaborator

Yep, it's behaving as expected by the change in code, I simply failed to consider the continuous scale defaults when making the change. I still think it's appropriate to have the mul and add parameters affect zero_range scales but @hadley should probably have a final say on whether this magnitude of a change in default behavior is appropriate.

After review, scales PR161 was the source of almost all new failures. The rest were caused by changes to scales::log_breaks() and sec_axis() and should be validated.

@hadley
Copy link
Member

hadley commented Aug 20, 2018

Yeah, I think it makes a lot of sense - the previous values were pure magic, and now they arise from the scale expansion parameters.

@lock
Copy link

lock bot commented Feb 17, 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 Feb 17, 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

No branches or pull requests

3 participants