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 46d6e44

Browse files
committed
lint titles var statements
1 parent 27b4be3 commit 46d6e44

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/components/titles/index.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -133,33 +133,33 @@ Titles.draw = function(gd, titleClass, options) {
133133

134134
// move toward avoid.side (= left, right, top, bottom) if needed
135135
// can include pad (pixels, default 2)
136-
var shift = 0,
137-
backside = {
138-
left: 'right',
139-
right: 'left',
140-
top: 'bottom',
141-
bottom: 'top'
142-
}[avoid.side],
143-
shiftSign = (['left', 'top'].indexOf(avoid.side) !== -1) ?
144-
-1 : 1,
145-
pad = isNumeric(avoid.pad) ? avoid.pad : 2,
146-
titlebb = Drawing.bBox(titleGroup.node()),
147-
paperbb = {
148-
left: 0,
149-
top: 0,
150-
right: fullLayout.width,
151-
bottom: fullLayout.height
152-
},
153-
maxshift = avoid.maxShift || (
154-
(paperbb[avoid.side] - titlebb[avoid.side]) *
155-
((avoid.side === 'left' || avoid.side === 'top') ? -1 : 1));
136+
var shift = 0;
137+
var backside = {
138+
left: 'right',
139+
right: 'left',
140+
top: 'bottom',
141+
bottom: 'top'
142+
}[avoid.side];
143+
var shiftSign = (['left', 'top'].indexOf(avoid.side) !== -1) ?
144+
-1 : 1;
145+
var pad = isNumeric(avoid.pad) ? avoid.pad : 2;
146+
var titlebb = Drawing.bBox(titleGroup.node());
147+
var paperbb = {
148+
left: 0,
149+
top: 0,
150+
right: fullLayout.width,
151+
bottom: fullLayout.height
152+
};
153+
var maxshift = avoid.maxShift || (
154+
(paperbb[avoid.side] - titlebb[avoid.side]) *
155+
((avoid.side === 'left' || avoid.side === 'top') ? -1 : 1));
156156
// Prevent the title going off the paper
157157
if(maxshift < 0) shift = maxshift;
158158
else {
159159
// so we don't have to offset each avoided element,
160160
// give the title the opposite offset
161-
var offsetLeft = avoid.offsetLeft || 0,
162-
offsetTop = avoid.offsetTop || 0;
161+
var offsetLeft = avoid.offsetLeft || 0;
162+
var offsetTop = avoid.offsetTop || 0;
163163
titlebb.left -= offsetLeft;
164164
titlebb.right -= offsetLeft;
165165
titlebb.top -= offsetTop;

0 commit comments

Comments
 (0)