plotly / plotly/plotly.js

Add size option for layout.legend.itemsizing : 'constant'

Open
#7,007 1 comment 0 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

As of Plotly 2.32.0 and 2.33.0, the itemsizing from Parent: layout.legend does not offer an option to further customize the size of the legend symbols.

If I want my trace symbols to be smaller, the legend symbols are too small, but when I set itemsizing: "constant" the legend symbols are too large in comparison with the chart.

Example with itemsizing: "constant"

image

Example with itemsizing: "trace"

image

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 locating the implementation and tests for layout.legend.itemsizing in the plotly.js codebase, then compare the existing constant and trace behaviors. Determine how a size customization should be exposed without changing current defaults; done means the new option produces appropriately sized legend symbols and has regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.