fix: Update legend maxheight calculation logic#7483
Merged
camdecoster merged 16 commits intomasterfrom Aug 7, 2025
Merged
Conversation
archmoj
reviewed
Jul 24, 2025
archmoj
reviewed
Jul 24, 2025
…end-maxheight-logic
emilykl
reviewed
Aug 5, 2025
emilykl
reviewed
Aug 5, 2025
emilykl
reviewed
Aug 5, 2025
Co-authored-by: Emily KL <4672118+emilykl@users.noreply.github.com>
emilykl
requested changes
Aug 5, 2025
Contributor
emilykl
left a comment
There was a problem hiding this comment.
See comments about the boolean logic and attribute description, otherwise looks good!
Contributor
|
@camdecoster The new image test is failing, can you double check? |
emilykl
reviewed
Aug 7, 2025
src/components/legend/attributes.js
Outdated
Comment on lines
44
to
45
| 'The reference height is the full layout height with the following exceptions: legends to the side of the plot', | ||
| 'or vertically oriented legends with a `yref` of `"paper". In this case, the reference height is the plot height.' |
Contributor
There was a problem hiding this comment.
@camdecoster I think the previous version of this docstring correctly reflects what is in the code after your latest changes -- can you confirm?
Suggested change
| 'The reference height is the full layout height with the following exceptions: legends to the side of the plot', | |
| 'or vertically oriented legends with a `yref` of `"paper". In this case, the reference height is the plot height.' | |
| 'The reference height is the full layout height, except in the case of vertically oriented legends with', | |
| 'a `yref` of `"paper" located to the side of the plot, in which case the reference height', | |
| 'is the plot height.' |
Contributor
Author
There was a problem hiding this comment.
As we discussed, you're right. In some JS-like pseudocode:
isAboveBelow = isBelowPlotArea || isAbovePlotArea
!(isAboveBelow || !(orientation === "v" && yref === "paper")) -> !isAboveBelow && !(!(orientation === "v" && yref === "paper")) -> !isAboveBelow && (orientation === "v" && yref === "paper")I'll switch it back the description back.
For future Cam reference, remember De Morgan's laws.
emilykl
reviewed
Aug 7, 2025
emilykl
approved these changes
Aug 7, 2025
Co-authored-by: Emily KL <4672118+emilykl@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Update the legend maxheight calculation logic to account for the legend being located above/below the plot. Closes #7473.
Changes
maxheightcalculation logicDemo
Testing instructions