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

Y Axes alignment option: addendum #1033

Closed
wants to merge 4 commits into from

Conversation

gazal-k
Copy link
Contributor

@gazal-k gazal-k commented Oct 31, 2015

Follow up to #985

separated the code for aligning axes into function alignYAxisRanges to
reduce cyclomatic complexity
@gordonwoodhull
Copy link
Contributor

Just as a progress report, I'm merging this in the hotfix/2.0.0-beta.32 branch. Here is a matrix of the 25 cases which I'm adding as an example and visual test case.

(There are at least 25 cases because left and right can each be all positive, mostly positive, even positive/negative, mostly negative, or all negative.)

image

Looks like the current heuristic gets many cases well, but severely squishes one series or the other in about 8 cases, and loses one or the other in two cases.

I'm going to try a more comprehensive approach.

gordonwoodhull added a commit that referenced this pull request Jul 17, 2016
this closes #1033 - a very simple, clear implementation
will revisit when we implement #667 allowing stack charts to depart
from the y axis.
gordonwoodhull added a commit that referenced this pull request Jul 18, 2016
gordonwoodhull added a commit that referenced this pull request Jul 19, 2016
this closes #1033 - a very simple, clear implementation
will revisit when we implement #667 allowing stack charts to depart
from the y axis.
gordonwoodhull added a commit that referenced this pull request Jul 19, 2016
gordonwoodhull added a commit that referenced this pull request Jul 28, 2016
@gordonwoodhull
Copy link
Contributor

Improved algorithm:
image
image
http://dc-js.github.io/dc.js/examples/align-axes.html

@gordonwoodhull
Copy link
Contributor

Live in 2.0 beta 32. Thanks @gazal-k!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants