Skip to content

Commit 8b24220

Browse files
camdecosteremilykl
andauthored
Clarify documentation, conditional logic
Co-authored-by: Emily KL <[email protected]>
1 parent 969e8b0 commit 8b24220

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/components/legend/attributes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ module.exports = {
3838
min: 0,
3939
editType: 'legend',
4040
description: [
41-
'Sets the max height (in px) of the legend, or max height ratio (reference height * ratio) if less than one.',
41+
'Sets the max height (in px) of the legend, or max height ratio (reference height * ratio) if less than or equal to 1.',
4242
'Default value is: 0.5 for horizontal legends; 1 for vertical legends. The minimum allowed height is 30px.',
4343
'For a ratio of 0.5, the legend will take up to 50% of the reference height before displaying a scrollbar.',
4444
'The reference height is the full layout height with the following exception: vertically oriented legends with',
45-
'a `yref` of `"paper"`, unless the legend is located above/below the plot. In this case, the reference height',
45+
'a `yref` of `"paper" located to the side of the plot. In this case, the reference height',
4646
'is the plot height.'
4747
].join(' ')
4848
},

src/components/legend/draw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
771771

772772
const { orientation, yref } = legendObj;
773773
let { maxheight } = legendObj;
774-
const useFullLayoutHeight = isBelowPlotArea || isAbovePlotArea && !(orientation === "v" && yref === "paper")
774+
const useFullLayoutHeight = (isBelowPlotArea || isAbovePlotArea) && !(orientation === "v" && yref === "paper")
775775
// Set default maxheight here since it depends on values passed in by user
776776
maxheight ||= useFullLayoutHeight ? 0.5 : 1;
777777
const heightToBeScaled = useFullLayoutHeight ? fullLayout.height : gs.h;

0 commit comments

Comments
 (0)