Skip to content

Commit

Permalink
Fix syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmelnikov82 committed Jul 28, 2022
1 parent 4c1a865 commit 37c771d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/components/legend/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,15 @@ function getTraceWidth(trace, legendObj, textGap) {
var legendItem = trace[0];
var legendWidth = legendItem.width;

var traceLegendWidth = legendItem.trace.legendwidth || legendObj.entrywidth
var traceLegendWidth = legendItem.trace.legendwidth || legendObj.entrywidth;

if (traceLegendWidth) {
if (legendObj.widthmode === "pixels") {
return traceLegendWidth + textGap
} else {
return legendObj._maxWidth * traceLegendWidth
}
if (traceLegendWidth) {
if (legendObj.widthmode === 'pixels') {
return traceLegendWidth + textGap;
} else {
return legendObj._maxWidth * traceLegendWidth;
}
}

return legendWidth + textGap;
}
Expand Down
2 changes: 0 additions & 2 deletions test/jasmine/tests/legend_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2420,8 +2420,6 @@ describe('legend with custom legendwidth', function() {
}).then(done);
});



it('should change width when legend has entrywidth and widthmode is fraction', function(done) {
var extendedLayout = Lib.extendDeep([], layout);
extendedLayout.legend.widthmode = 'fraction';
Expand Down

0 comments on commit 37c771d

Please sign in to comment.