Skip to content

Conversation

@attatrol
Copy link

@attatrol attatrol commented Sep 17, 2024

Description

Fixes maximum height calculation for legends anchored to the container (yref: "container"). Previously, legends would overflow outside the available container space. This fix ensures that when a legend is positioned relative to the container, its maximum height is constrained to the available space based on the y position and yanchor settings.

Resolves #7072

Changes

  • Updated computeLegendDimensions function in src/components/legend/draw.js to calculate and constrain maxheight when yref === 'container'
  • Added test mock legend_overflow_height.json to verify the bug fix

Demo Video:

Before:

Screen.Recording.2025-10-27.at.11.30.24.PM.mov

After:

Screen.Recording.2025-10-27.at.11.30.52.PM.mov

Testing

  • Start the dev dashboard with npm start
  • Search for the legend_overflow_height mock
  • Scroll vertically in the legend component
  • Check that the legend respects the boundaries of the container and doesn't overflow outside the available space

@attatrol attatrol changed the title Fix legend container overflow #7072 Fix legend container overflow Sep 17, 2024
godyaev added 2 commits September 17, 2024 12:49
…ontainer.

Need these for the case yref === 'container' && xref === 'paper'
@gvwilson gvwilson requested a review from archmoj September 23, 2024 14:21
@gvwilson gvwilson added community community contribution P3 backlog fix fixes something broken labels Sep 23, 2024
@gvwilson gvwilson assigned gvwilson and unassigned archmoj Nov 20, 2024
@gvwilson gvwilson added the cs customer success label Nov 21, 2024
@gvwilson gvwilson assigned alexshoe and unassigned camdecoster and gvwilson Oct 10, 2025
@alexshoe
Copy link
Contributor

@emilykl @camdecoster
Fixed the merge conflict for this one and made some minor changes for readability + reducing redundancy.
Filled in the description too so that it matches the standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community community contribution cs customer success fix fixes something broken P3 backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

5 participants