plotly / plotly/plotly.js

allow multiple legends by size, symbol, color etc

Open
#5,099 9 comments 49 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature P3
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing issues #1668, #5098, and #5100, then compare the existing legend and colorbar behavior. Define how separate legends for color, size, symbol, and other visual attributes should represent multiple traces and how click-to-toggle interaction should work. Done means each attribute can have its own interactive legend without conflating it with per-trace legends.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.