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

[axis] fix label transform #59

Merged
merged 1 commit into from
Jun 11, 2017

Conversation

williaster
Copy link
Collaborator

This PR fixes a bug with the (y-axis) label transform logic. For y-axes you often have a pattern where you set the following domain and range to correct for the upper-right (0,0) svg coord:

domain = [min val, max val];
range = [height, 0] 
// y-axis has `min val` at the bottom and `max val` at the top

If you want to have the min value at the top of the scale you actually invert the range to [0, height]. The current y-label transform assumes the former and this PR fixes it.

Before:
screen shot 2017-06-09 at 3 02 10 pm

After:
screen shot 2017-06-09 at 3 04 05 pm

Verified that current transforms still work as expected:
screen shot 2017-06-09 at 3 05 54 pm
screen shot 2017-06-09 at 3 05 40 pm

@coveralls
Copy link

Coverage Status

Coverage remained the same at 27.126% when pulling e8148b7 on williaster:chris--label-transform into a7fbf04 on hshoff:master.

@hshoff hshoff added this to the v0.0.120 milestone Jun 11, 2017
@hshoff
Copy link
Member

hshoff commented Jun 11, 2017

👍

@hshoff hshoff merged commit 080274c into airbnb:master Jun 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants