Skip to content

Multicategory Multilevel 2+ & Sorting Multicategory#6327

Open
richardnm-2 wants to merge 62 commits into
plotly:masterfrom
richardnm-2:PR
Open

Multicategory Multilevel 2+ & Sorting Multicategory#6327
richardnm-2 wants to merge 62 commits into
plotly:masterfrom
richardnm-2:PR

Conversation

@richardnm-2

@richardnm-2 richardnm-2 commented Sep 27, 2022

Copy link
Copy Markdown

update: see #6966 (?)

closes #2175
closes #3723

#2175 requests for a multicategory multilevel (2+). This is great for data visualization on, as mentioned, "Variability Charts".

In order to expand the capabilities of multicategory axis type, the list structure previously implemented has been changed at set_convert.js ax.setupMultiCategory(), adding a new file to src/lib -> sort_traces.js. Working with the traces as a list of objects instead, to try to provide the same data structure to setCategoryIndex() seemed easier. Sorting is performed reversed, in order to achieve a stable sorting. I don't know about the implementation, but the result is the same as if sorted backwards in pandas (Python), or an Excel table.

The capabilities upgrade was then achieved, and the other changes were to make tha axis draw the new data shape, as pushing multiple functions to seq, in a loop, to account for every level. Also, category indexes had to be updated to comply with the new data shape.

The categorical data on the axis was drawn accordingly, but the sorting issue, #3723 showed that this was a known problem. Testing showed that providing the data already sorted to the newPlot function outputed the desired result. So, as the trace levels were already beein looped inside ax.setupMultiCategory(), and the object list was easyly sortable, before transforming it to a matrix again, it made sense to also update gd._fullData with the sorted data. The place to do so may not be the best and some thought can be given to that.

@AndreasUntch

Copy link
Copy Markdown

@richardnm-2 Hello, great to see that someone is working on this and tries to provide a solution :) It is quite a pain with multicategory axis right now. Sorting breaks whenever an item is missing in one stack for example... Hope there will be a fix soon. fyi: We are using plotly in R

@zupdaz

zupdaz commented Jun 28, 2023

Copy link
Copy Markdown

@richardnm-2 It's fantastic to see your efforts to improve the current handling of multicategory axes. Currently, when a category lacks data points, it can significantly disrupt the visualization integrity. Also, having more than 2 levels is a must for most of modern data analysis. Is this feature still being worked on at the moment?

@PhilippaTreacy

Copy link
Copy Markdown

Is this close to merging? Would be a great feature to have.

@DianYing123

DianYing123 commented Jan 24, 2024

Copy link
Copy Markdown

@richardnm-2 May I inquire about the approach you used to resolve this issue in plotly.py?

@alon-aviv-ni

Copy link
Copy Markdown

Hi, is this PR still in progress? Looking forward for this functionality to be introduced in the library.

@wowoxiapqi

Copy link
Copy Markdown

I really hope this feature will be ok

@gvwilson gvwilson assigned gvwilson and unassigned gvwilson Jul 26, 2024
@gvwilson gvwilson added the feature something new label Aug 8, 2024
@gvwilson gvwilson changed the title #2175 & #3723 - Multicategory Multilevel 2+ & Sorting Multicategory Multicategory Multilevel 2+ & Sorting Multicategory Aug 8, 2024
@gvwilson gvwilson added P3 backlog community community contribution labels Aug 8, 2024
@lucasrea1998

Copy link
Copy Markdown

What's the status on this PR, looking forward to this being implemented.

@gvwilson

Copy link
Copy Markdown
Contributor

hi @lucasrea1998 we are currently trying to get a major release out the door and will circle back to re-prioritize backlog once that's done - hopefully mid-November. Thanks - @gvwilson

@dmitrii-erkin

Copy link
Copy Markdown

Hello. Do you have any update regarding this PR, please? Thank you.

@gvwilson gvwilson self-assigned this Nov 21, 2024
@gvwilson gvwilson added the cs customer success label Nov 21, 2024
@Pfizer-BradleyBare

Pfizer-BradleyBare commented Feb 27, 2025

Copy link
Copy Markdown

I'm super excited to see this almost complete. Will this be merged soon?

@gvwilson

gvwilson commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

@Pfizer-BradleyBare unfortunately I don't have a timeline for getting this reviewed and merged :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community community contribution cs customer success feature something new P3 backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-category sorting misbehaves with missing categories Extend multicategory axes to more than 2 levels