plotly / plotly.js

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

Update axis categories via legend interaction when categoryarray is specified #1618

Open cpsievert opened 7 years ago

cpsievert commented 7 years ago

Some context in https://github.com/ropensci/plotly/issues/689

https://codepen.io/cpsievert/pen/aWZdWK

etpinard commented 7 years ago

This and https://github.com/plotly/plotly.js/issues/1516 makes me think our one lone category axis type is insufficient to cover all cases.

I'm thinking about adding a categoryvisible attribute with possible values 'trace' (show categories of traces that have visible: true or visible: 'legendonly' - the current behavior), 'array' (always show all categories in categoryarray) and 'legend' (show categories of trace that have visible: true). Setting categoryvisible: 'legend' would give the desired result here.

talgalili commented 7 years ago

Hi @etpinard, thanks for pointing us to this thread. This issue is important for an R package we created based on R/plotly (i.e.: heatmaply). Would you, by chance, be willing to give this issue another look/thought to see if this could be moved forward?

Thanks.

etpinard commented 7 years ago

@talgalili this won't be on our priority list for the next few months I'm afraid.

jplauri commented 4 years ago

Is there any update or workaround for this issue? It would be great to have the mentioned functionality.

pjedge commented 3 years ago

I would also love to see this issue resolved. I am using drop-down menus to reorder the boxes in a boxplot using 'categoryarray' and unfortunately it results in legend toggling not working as expected.