plotly / plotly/plotly.js

Change the height of the legend graphic (specifically for fill)

Open
#6,984 0 comments 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

Currently the height of the "fill" section of the legend "key" (for want of a better word) is fixed:

https://github.com/plotly/plotly.js/blob/6f34028d9fe50c05d20569c5a930cc3ad600c1b3/src/components/legend/style.js#L152-L153

Please could functionality to change this be implemented. A number of our users find the distinction between line and fill keys to be too indistinguishable (particularly when using plots with wider line thicknesses).

I am aware of https://github.com/plotly/plotly.js/issues/3735 but feel this is much more targeted (thus easier) than a general overhaul of the legend styling.

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 at src/components/legend/style.js around lines 152–153 and trace how the fill section height is applied to legend keys. Determine where a configurable height could be exposed without changing unrelated legend styling. Done means users can distinguish fill and line keys by changing the fill height, with the relevant legend behavior covered by tests.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.