plotly / plotly/plotly.js

Legend cannot be scrolled to the end if `xref`/`yref` is set to `container`

Open
#7,072 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

If a legend is anchored to the container, the container sizes aren't taken into account when the legend sizes are computed.

In the example codepen legends aren't visible fully and it is not possible to scroll then to the end.

function computeLegendDimensions should take into account the container sizes for calculation of _maxHeight and _maxWidth

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 in src/components/legend/draw.js at computeLegendDimensions, and reproduce the issue using the linked CodePen with xref/yref set to container. Check how container sizes contribute to _maxHeight and _maxWidth; done means the legend is fully visible and can be scrolled to its end.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.