Skip to content

Commit 35b0c92

Browse files
committed
fixup variable name in legend maxWidth logic block
1 parent e92ca98 commit 35b0c92

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/legend/draw.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -519,15 +519,15 @@ function computeLegendDimensions(gd, groups, traces) {
519519
var xanchor = getXanchor(opts);
520520
var isLeftOfPlotArea = opts.x < 0 || (opts.x === 0 && xanchor === 'right');
521521
var isRightOfPlotArea = opts.x > 1 || (opts.x === 1 && xanchor === 'left');
522-
var isBeyondPlotAreaX = isAbovePlotArea || isBelowPlotArea;
522+
var isBeyondPlotAreaY = isAbovePlotArea || isBelowPlotArea;
523523
var hw = fullLayout.width / 2;
524524

525525
// - if placed within x-margins, extend the width of the plot area
526526
// - else if below/above plot area and anchored in the margin, extend to opposite margin,
527527
// - otherwise give it the maximum potential margin-push value
528528
opts._maxWidth = Math.max(
529-
isLeftOfPlotArea ? ((isBeyondPlotAreaX && xanchor === 'left') ? gs.l + gs.w : hw) :
530-
isRightOfPlotArea ? ((isBeyondPlotAreaX && yanchor === 'right') ? gs.r + gs.w : hw) :
529+
isLeftOfPlotArea ? ((isBeyondPlotAreaY && xanchor === 'left') ? gs.l + gs.w : hw) :
530+
isRightOfPlotArea ? ((isBeyondPlotAreaY && xanchor === 'right') ? gs.r + gs.w : hw) :
531531
gs.w,
532532
2 * textGap);
533533
var maxItemWidth = 0;

0 commit comments

Comments
 (0)