-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Horizontal legend traces wrap to new lines #786
Conversation
…tarting new row of legend items
Horizontal legend in columns
Legend item wrap with layout.legend.orientation = h
@psalmody looking good. Thanks a lot for doing this. To complete this PR:
Let me know if you have any questions. |
@etpinard I added the mock and test. On the mock, I added more traces in the legend for better visibility (particularly in vertical legend orientation). I setup docker (I'm on Win10 and new to docker) and had some problems. Even extracting the linux commands from |
Here's the link image baseline associated with the mock you added. Simpy download it and move it to
Yeah that's correct. I've been wanting to rewrite the shell scripts found in |
|
||
it('changed to vertical, scrollbar appeared', function(done) { | ||
//changed orientation to vertical | ||
expect(gd._fullLayout.legend.orientation).toBe('v'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@psalmody can you rewrite this test as
Plotly.relayout(gd, 'legend.orientation', 'v').then(function() {
/* assertions */
return Plotly.relayout(gd, 'legend.orientation', 'h');
}.then(function() {
/* assertions (back to base case) /*
});
and remove the assertion-less it('changing to vertical orientation', ...
above? Thanks.
@psalmody Great. I'll merge this PR in as soon as #786 (comment) is addressed. Thanks again for this PR! |
@etpinard I updated the test (I think) the way you would like it. However, I had to completely destroy the graph and recreate in order to get the legend scrollbar to appear. Using |
Oh. Looks like you discovered some buggy
So, I suggest removing the jasmine test you added in 3a2cf7b and patched in c31eb68 and instead add a jasmine test case testing some that |
Ah - that makes sense. Removed old tests and created new test as recommended. |
@psalmody Great. Thanks very much for this PR. You get my vote for PR of the week 🏆 |
Resolves #769
Iterate through traces, get maximum width, use margin and trace width to calculate if a new row is needed. Thanks @n-riesco for reviewing.