Skip to content

Commit 5cb5cd1

Browse files
committed
run formatter
1 parent e0c2df7 commit 5cb5cd1

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

src/plots/cartesian/tick_value_defaults.js

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,37 @@ var isTypedArraySpec = require('../../lib/array').isTypedArraySpec;
66
var decodeTypedArraySpec = require('../../lib/array').decodeTypedArraySpec;
77

88
module.exports = function handleTickValueDefaults(containerIn, containerOut, coerce, axType, opts) {
9-
if(!opts) opts = {};
9+
if (!opts) opts = {};
1010
var isMinor = opts.isMinor;
1111
var cIn = isMinor ? containerIn.minor || {} : containerIn;
1212
var cOut = isMinor ? containerOut.minor : containerOut;
1313
var prefix = isMinor ? 'minor.' : '';
1414

1515
function readInput(attr) {
1616
var v = cIn[attr];
17-
if(isTypedArraySpec(v)) v = decodeTypedArraySpec(v);
17+
if (isTypedArraySpec(v)) v = decodeTypedArraySpec(v);
1818

19-
return (
20-
v !== undefined
21-
) ? v : (cOut._template || {})[attr];
19+
return v !== undefined ? v : (cOut._template || {})[attr];
2220
}
2321

2422
var _tick0 = readInput('tick0');
2523
var _dtick = readInput('dtick');
2624
var _tickvals = readInput('tickvals');
2725

28-
var tickmodeDefault = isArrayOrTypedArray(_tickvals) ? 'array' :
29-
_dtick ? 'linear' :
30-
'auto';
26+
var tickmodeDefault = isArrayOrTypedArray(_tickvals) ? 'array' : _dtick ? 'linear' : 'auto';
3127
var tickmode = coerce(prefix + 'tickmode', tickmodeDefault);
3228

33-
if(tickmode === 'auto' || tickmode === 'sync') {
29+
if (tickmode === 'auto' || tickmode === 'sync') {
3430
coerce(prefix + 'nticks');
35-
} else if(tickmode === 'linear') {
31+
} else if (tickmode === 'linear') {
3632
// dtick is usually a positive number, but there are some
3733
// special strings available for log or date axes
3834
// tick0 also has special logic
39-
var dtick = cOut.dtick = cleanTicks.dtick(
40-
_dtick, axType);
41-
cOut.tick0 = cleanTicks.tick0(
42-
_tick0, axType, containerOut.calendar, dtick);
43-
} else if(axType !== 'multicategory') {
35+
var dtick = (cOut.dtick = cleanTicks.dtick(_dtick, axType));
36+
cOut.tick0 = cleanTicks.tick0(_tick0, axType, containerOut.calendar, dtick);
37+
} else if (axType !== 'multicategory') {
4438
var tickvals = coerce(prefix + 'tickvals');
45-
if(tickvals === undefined) cOut.tickmode = 'auto';
46-
else if(!isMinor) coerce('ticktext');
39+
if (tickvals === undefined) cOut.tickmode = 'auto';
40+
else if (!isMinor) coerce('ticktext');
4741
}
4842
};

0 commit comments

Comments
 (0)