Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Commit 30bba26

Browse files
committed
Fix test and remove dead code from bar trace
1 parent f690d9b commit 30bba26

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/traces/bar/plot.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ function getTransformToMoveOutsideBar(x0, x1, y0, y1, textBB, orientation, const
350350
}
351351

352352
// compute rotation and scale
353-
var rotate = false;
354353
var scale = 1;
355354
if(constrained) {
356355
scale = (orientation === 'h') ?
@@ -365,14 +364,9 @@ function getTransformToMoveOutsideBar(x0, x1, y0, y1, textBB, orientation, const
365364
targetHeight,
366365
targetX,
367366
targetY;
368-
if(rotate) {
369-
targetWidth = scale * textBB.height;
370-
targetHeight = scale * textBB.width;
371-
}
372-
else {
373-
targetWidth = scale * textBB.width;
374-
targetHeight = scale * textBB.height;
375-
}
367+
368+
targetWidth = scale * textBB.width;
369+
targetHeight = scale * textBB.height;
376370

377371
if(orientation === 'h') {
378372
if(x1 < x0) {
@@ -397,7 +391,7 @@ function getTransformToMoveOutsideBar(x0, x1, y0, y1, textBB, orientation, const
397391
}
398392
}
399393

400-
return getTransform(textX, textY, targetX, targetY, scale, rotate);
394+
return getTransform(textX, textY, targetX, targetY, scale, false);
401395
}
402396

403397
function getTransform(textX, textY, targetX, targetY, scale, rotate) {

test/jasmine/tests/bar_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ describe('Bar.supplyDefaults', function() {
9595
expect(traceOut.texfont).toBeUndefined();
9696
expect(traceOut.insidetexfont).toBeUndefined();
9797
expect(traceOut.outsidetexfont).toBeUndefined();
98-
expect(traceOut.constraintext).toBe();
98+
expect(traceOut.constraintext).toBeUndefined();
9999
});
100100

101101
it('should default textfont to layout.font', function() {

0 commit comments

Comments
 (0)