Uh oh!
There was an error while loading. Please reload this page.
fix legend when figures has large margins - #2983
Merged
Merged
Conversation
| // check if legend fits in one row | ||
| oneRowLegend = (fullLayout.width - (fullLayout.margin.r + fullLayout.margin.l)) > borderwidth + fullTracesWidth - traceGap; | ||
| oneRowLegend = (fullLayout.width - (fullLayout._size.r + fullLayout._size.l)) > borderwidth + fullTracesWidth - traceGap; |
Collaborator
There was a problem hiding this comment.
fullLayout.width - (fullLayout._size.r + fullLayout._size.l) === fullLayout._size.w
ContributorAuthor
There was a problem hiding this comment.
Nothing gets by you :) Thank you again for the quick review!
alexcjohnson
commented
Sep 7, 2018
Collaborator
An image is the way to go here, since it's a presentation element, so it's harder (and more fragile in case we change element structure) in jasmine to be sure we're testing the right thing. |
alexcjohnson
commented
Sep 7, 2018
Collaborator
Looks great! Nice detective work @antoinerg 💃 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#2971
Simple fix: the width of a legend was compared to user-supplied margins instead of computed margins.
For testing, I added a baseline image. Should I do this in jasmine instead?
@etpinard@alexcjohnson