plotly / plotly.js

Open-source JavaScript charting library behind Plotly and Dash
https://plotly.com/javascript/
MIT License
16.85k stars 1.85k forks source link

Grouped legend alignment issue from 1.50 #4336

Open mjordan84 opened 4 years ago

mjordan84 commented 4 years ago

Hi,

I've been using plotly.js for a few month now (great work by the way) and noticed that since 1.50 legend groups are no longer aligned. As you can see in the attached example the 5th group is not aligned with the 2nd. Is this an expected behaviour?

Example: https://codepen.io/mjordan84/pen/LYYdeog

Thanks, Marc

archmoj commented 4 years ago

Possibly related to https://github.com/plotly/plotly.js/pull/4160.

etpinard commented 4 years ago

That's correct, the behaviour changed after #4160 (released in v1.50.0).

I didn't intend to change it (see pre-1.50.0 behaviour here: https://codepen.io/etpinard/pen/abbXKpM), but I can't say which behaviour is better. What do you think @mjordan84 and @archmoj ?

That said, a breaking change is a breaking change, so I'll tag this as type: bug. If some people like the current (post v1.50.0) behaviour better, maybe we should think about adding a new grouped legend option.

This ticket is somewhat related to https://github.com/plotly/plotly.js/issues/960

etpinard commented 4 years ago

current:

image

pre v1.50.0

image

mjordan84 commented 4 years ago

@etpinard as you said both seems valid. The new behaviour is a bit more problematic when only the first Item of each legend group is visible. image

etpinard commented 4 years ago

The new behaviour is a bit more problematic when only the first Item of each legend group is visible.

You mean when all but the first trace of each group has showlegend: false?

mjordan84 commented 4 years ago

Yes @etpinard , when the first element of each group has showlegend: true then the rest set to false in that group. https://codepen.io/mjordan84/pen/GRRzXoz

gvwilson commented 2 months ago

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

mjordan84 commented 2 months ago

The issue is still present in the latest version.

gvwilson commented 2 months ago

Thanks @mjordan84 - I'll reopen it and try to get it into our backlog