plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

add Interactive Legends for Plotly Express Sunburst Charts

Open mlouis9 opened this issue 1 year ago • 2 comments
trafficstars

Motivation

I'm a huge fan of Plotly Express Sunburst charts, but when viewing data with lots of small proportions (that are meaningful), it can be difficult to expand individual wedges because they're so small.

A Solution

I think it might be nice if there was a scrollable, clickable legend listing all of the inner wedges of the pie chart. I've included an an example .html spec that I hacked together by wrapping the plotly html. Clicking on the label in the legend expands the corresponding wedge in the sunburst chart. I'm not sure how feasible something like this is, but I think it might be a nice feature.

mlouis9 avatar Jul 24 '24 12:07 mlouis9

Is this the duplicate of https://github.com/plotly/plotly.js/issues/4760?

archmoj avatar Jul 24 '24 14:07 archmoj

Not quite; the suggested addition is to deal with wedges that are too small to click on by hovering over them by adding an interactive legend showing the inner wedges of the sunburst. As far as I can tell by looking at the example in the linked issue, it doesn't implement the type of legend included in the html spec I linked here and still has issues with small wedges.

mlouis9 avatar Jul 24 '24 18:07 mlouis9