Open jonmmease opened 5 years ago
I think that's the intended behavior under the default configuration. A priori (forget these are numbers) why should 1
be sorted before 4
?
What we should do though is implement categoryorder
and categoryarray
for multicategory
. Ok, if I convert this ticket into a type: feature
?
This patch
https://github.com/plotly/plotly.js/compare/multicategory-sort-questionable-fix
would "fix" this. It does generate a diff in a few of our mocks. I wouldn't be comfortable releasing this in v1 w/o a new attribute.
It would be a complicated algorithm, but I think we could do better than that:
This would probably still change some of the existing test images, but less so and with any luck we'll be able to deem those changes bugfixes.
Hi, if anyone comes up with a PR for this I wanted to remind him to future-proof the algorithm i.e. plan for more than 2 levels (see https://github.com/plotly/plotly.js/pull/3300#issuecomment-470855357). Wish I could help but my javascript knowledge is close to zero. Anyways thanks again for putting my issue from plotly.py to plotly.js.
Also reported in https://community.plotly.com/t/multicategory-xaxis-label-arrangement-is-not-proper/37359/3 and the corresponding codepen is https://codepen.io/emmanuelle-plotly/pen/zYGgMjz?editable=true If I understand well there is no way to force the inner labels to be sorted in ascending order?
Hi - we are currently trying to tidy up Plotly's public repositories to help us focus our efforts on things that will help users most. Since this issue has been sitting for several years, I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our backlog. Thanks for your help - @gvwilson
Originally reported in https://github.com/plotly/plotly.py/issues/1491.
There seems to a multi-category sorting bug that wasn't fixed by #3362.
CodePen: https://codepen.io/jonmmease/pen/VNeEqq?editors=1010
The problem is that in the second multi-category (2018), the 4 is sorted before 1, 2, 3 even though they are specified in ascending sorted order.
As noted in https://github.com/plotly/plotly.py/issues/1491, this seems to happen for categories that are not present in the first multi-category (2017).