plotly / plotly.js

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

Multiple legends: by size, symbol, color etc #5099

Open nicolaskruchten opened 3 years ago

nicolaskruchten commented 3 years ago

Breaking off of https://github.com/plotly/plotly.js/issues/1668 ...

Multiple users have requested the ability to have per-visual-attribute legends, similar to systems like ggplot2, Tableau etc so one legend for discrete color, one for size, one for symbol and so on. This is distinct from simply having multiple legends where each trace has a single legend item because in this concept, each trace would cause a legend item to appear in each legend, and furthermore, each legend item could refer to multiple traces. It's more similar to our existing coloraxis/colorbar concept than to our legend concept.

The major challenge for us is interactivity: it's relatively easy in a static tool like ggplot2 or matplotlib to just draw a second legend, but our legends support click-to-toggle etc (although our colorbars don't, today, and should!) and this would require a fairly big engineering lift.

nicolaskruchten commented 3 years ago

It's a good feature and we'd love to have it in the library but it's not on anyone's roadmap at the moment as far as I know. That said, we as maintainers would be happy to help someone from the community to implement it in Plotly.js, or to accept sponsorship to get it on to our short-term roadmap :)

nicolaskruchten commented 3 years ago

This issue has been tagged with NEEDS SPON$OR

A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort.

What Sponsorship includes:

Please include the link to this issue when contacting us to discuss.

gvwilson commented 3 weeks 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 a while, 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. Alternatively, if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

j-andrews7 commented 3 weeks ago

This is still not functional in plotly.js (v2.33.0), see #7023.

gvwilson commented 3 weeks ago

Thanks @j-andrews7 - I'll reopen and add to our backlog, but I don't know when or if we'll get to it :-(