Uh oh!
There was an error while loading. Please reload this page.
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
etpinard
commented
Jul 28, 2016
@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 |
etpinard
commented
Jul 29, 2016
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.
@psalmody can you rewrite this test as
Plotly.relayout(gd,'legend.orientation','v').then(function(){/* assertions */returnPlotly.relayout(gd,'legend.orientation','h');}.then(function(){/*assertions(backtobasecase)/*});and remove the assertion-less it('changing to vertical orientation', ... above? Thanks.
etpinard
commented
Aug 1, 2016
@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 |
etpinard
commented
Aug 2, 2016
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 |
psalmody
commented
Aug 2, 2016
Ah - that makes sense. Removed old tests and created new test as recommended. |
etpinard
commented
Aug 2, 2016
@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.