Skip to content

Commit 33e4357

Browse files
vizanshemilykl
andauthored
Apply suggestions from code review
Co-authored-by: Emily KL <4672118+emilykl@users.noreply.github.com>
1 parent f291d70 commit 33e4357

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/traces/bar/plot.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,9 +958,11 @@ function toMoveOutsideBar(x0, x1, y0, y1, textBB, opts) {
958958
var anchorX = 0;
959959
var anchorY = 0;
960960

961-
var dir = isHorizontal ? dirSign(x1, x0) : dirSign(y0, y1);
961+
var dir;
962962
if ((isHorizontal ? x0 === x1 : y0 === y1) && opts.zeroBarDir) {
963963
dir = opts.zeroBarDir;
964+
} else {
965+
dir = isHorizontal ? dirSign(x1, x0) : dirSign(y0, y1);
964966
}
965967
if (isHorizontal) {
966968
targetX = x1 - dir * (textpad + axisPad);
@@ -1197,5 +1199,4 @@ function calcTextinfo(cd, index, xa, ya) {
11971199
module.exports = {
11981200
plot: plot,
11991201
toMoveInsideBar: toMoveInsideBar,
1200-
toMoveOutsideBar: toMoveOutsideBar
12011202
};

0 commit comments

Comments
 (0)