Skip to content

Commit b9947a9

Browse files
committed
Revert "apply new lint rule in various files"
This reverts commit 21bdf78.
1 parent 21bdf78 commit b9947a9

File tree

348 files changed

+424
-426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

348 files changed

+424
-426
lines changed

Diff for: src/components/annotations/calc_autorange.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var Axes = require('../../plots/cartesian/axes');
1515
var draw = require('./draw').draw;
1616

1717

18-
module.exports = function(gd) {
18+
module.exports = function calcAutorange(gd) {
1919
var fullLayout = gd._fullLayout;
2020
var annotationList = Lib.filterVisible(fullLayout.annotations);
2121

Diff for: src/components/annotations/common_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var Lib = require('../../lib');
1212
var Color = require('../color');
1313

1414
// defaults common to 'annotations' and 'annotations3d'
15-
module.exports = function(annIn, annOut, fullLayout, coerce) {
15+
module.exports = function handleAnnotationCommonDefaults(annIn, annOut, fullLayout, coerce) {
1616
coerce('opacity');
1717
var bgColor = coerce('bgcolor');
1818

Diff for: src/components/annotations/convert_coords.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var toLogRange = require('../../lib/to_log_range');
2525
* Use this to make the changes as it's aware if any other changes in the
2626
* same relayout call should override this conversion.
2727
*/
28-
module.exports = function(gd, ax, newType, doExtra) {
28+
module.exports = function convertCoords(gd, ax, newType, doExtra) {
2929
ax = ax || {};
3030

3131
var toLog = (newType === 'log') && (ax.type === 'linear');

Diff for: src/components/annotations/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var handleAnnotationCommonDefaults = require('./common_defaults');
1717
var attributes = require('./attributes');
1818

1919

20-
module.exports = function(layoutIn, layoutOut) {
20+
module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {
2121
handleArrayContainerDefaults(layoutIn, layoutOut, {
2222
name: 'annotations',
2323
handleItemDefaults: handleAnnotationDefaults

Diff for: src/components/annotations/draw_arrow_head.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var ARROWPATHS = require('./arrow_paths');
3535
* of both the line and head has opacity applied to it so there isn't greater opacity
3636
* where they overlap.
3737
*/
38-
module.exports = function(el3, ends, options) {
38+
module.exports = function drawArrowHead(el3, ends, options) {
3939
var el = el3.node();
4040
var headStyle = ARROWPATHS[options.arrowhead || 0];
4141
var startHeadStyle = ARROWPATHS[options.startarrowhead || 0];

Diff for: src/components/annotations3d/convert.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
var Lib = require('../../lib');
1212
var Axes = require('../../plots/cartesian/axes');
1313

14-
module.exports = function(scene) {
14+
module.exports = function convert(scene) {
1515
var fullSceneLayout = scene.fullSceneLayout;
1616
var anns = fullSceneLayout.annotations;
1717

Diff for: src/components/annotations3d/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var handleArrayContainerDefaults = require('../../plots/array_container_defaults
1414
var handleAnnotationCommonDefaults = require('../annotations/common_defaults');
1515
var attributes = require('./attributes');
1616

17-
module.exports = function(sceneLayoutIn, sceneLayoutOut, opts) {
17+
module.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {
1818
handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {
1919
name: 'annotations',
2020
handleItemDefaults: handleAnnotationDefaults,

Diff for: src/components/annotations3d/draw.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var drawRaw = require('../annotations/draw').drawRaw;
1212
var project = require('../../plots/gl3d/project');
1313
var axLetters = ['x', 'y', 'z'];
1414

15-
module.exports = function(scene) {
15+
module.exports = function draw(scene) {
1616
var fullSceneLayout = scene.fullSceneLayout;
1717
var dataScale = scene.dataScale;
1818
var anns = fullSceneLayout.annotations;

Diff for: src/components/colorbar/connect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var flipScale = require('../colorscale/helpers').flipScale;
3636
* used only if min/max fail. May be omitted if these are always
3737
* pre-calculated.
3838
*/
39-
module.exports = function(gd, cd, moduleOpts) {
39+
module.exports = function connectColorbar(gd, cd, moduleOpts) {
4040
if(typeof moduleOpts === 'function') return moduleOpts(gd, cd);
4141

4242
var trace = cd[0].trace;

Diff for: src/components/colorbar/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var handleTickLabelDefaults = require('../../plots/cartesian/tick_label_defaults
1818

1919
var attributes = require('./attributes');
2020

21-
module.exports = function(containerIn, containerOut, layout) {
21+
module.exports = function colorbarDefaults(containerIn, containerOut, layout) {
2222
var colorbarOut = Template.newContainer(containerOut, 'colorbar');
2323
var colorbarIn = containerIn.colorbar || {};
2424

Diff for: src/components/colorbar/draw.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var axisLayoutAttrs = require('../../plots/cartesian/layout_attributes');
3535
var attributes = require('./attributes');
3636
var cn = require('./constants').cn;
3737

38-
module.exports = function(gd, id) {
38+
module.exports = function draw(gd, id) {
3939
// opts: options object, containing everything from attributes
4040
// plus a few others that are the equivalent of the colorbar "data"
4141
var opts = {};

Diff for: src/components/colorbar/has_colorbar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
var Lib = require('../../lib');
1313

1414

15-
module.exports = function(container) {
15+
module.exports = function hasColorbar(container) {
1616
return Lib.isPlainObject(container.colorbar);
1717
};

Diff for: src/components/colorscale/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function code(s) {
5858
*
5959
* @return {object}
6060
*/
61-
module.exports = function(context, opts) {
61+
module.exports = function colorScaleAttrs(context, opts) {
6262
context = context || '';
6363
opts = opts || {};
6464

Diff for: src/components/colorscale/calc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
var Lib = require('../../lib');
1212

13-
module.exports = function(gd, trace, opts) {
13+
module.exports = function calc(gd, trace, opts) {
1414
var fullLayout = gd._fullLayout;
1515
var vals = opts.vals;
1616
var containerStr = opts.containerStr;

Diff for: src/components/colorscale/cross_trace_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
var Lib = require('../../lib');
1212
var hasColorscale = require('./helpers').hasColorscale;
1313

14-
module.exports = function(fullData) {
14+
module.exports = function crossTraceDefaults(fullData) {
1515
function replace(cont, k) {
1616
var val = cont['_' + k];
1717
if(val !== undefined) {

Diff for: src/components/colorscale/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function npMaybe(cont, prefix) {
2323
cont;
2424
}
2525

26-
module.exports = function(traceIn, traceOut, layout, coerce, opts) {
26+
module.exports = function colorScaleDefaults(traceIn, traceOut, layout, coerce, opts) {
2727
var prefix = opts.prefix;
2828
var cLetter = opts.cLetter;
2929
var containerIn = npMaybe(traceIn, prefix);

Diff for: src/components/colorscale/layout_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var Lib = require('../../lib');
1212
var colorscaleAttrs = require('./layout_attributes');
1313
var Template = require('../../plot_api/plot_template');
1414

15-
module.exports = function(layoutIn, layoutOut) {
15+
module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {
1616
var colorscaleIn = layoutIn.colorscale;
1717
var colorscaleOut = Template.newContainer(layoutOut, 'colorscale');
1818
function coerce(attr, dflt) {

Diff for: src/components/dragelement/align.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// >2/3 means right, and between is center. Pick the right fraction
1515
// based on where you are, and return the fraction corresponding to
1616
// that position on the object
17-
module.exports = function(v, dv, v0, v1, anchor) {
17+
module.exports = function align(v, dv, v0, v1, anchor) {
1818
var vmin = (v - v0) / (v1 - v0);
1919
var vmax = vmin + dv / (v1 - v0);
2020
var vc = (vmin + vmax) / 2;

Diff for: src/components/dragelement/cursor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var cursorset = [
2121
['nw-resize', 'n-resize', 'ne-resize']
2222
];
2323

24-
module.exports = function(x, y, xanchor, yanchor) {
24+
module.exports = function getCursor(x, y, xanchor, yanchor) {
2525
if(xanchor === 'left') x = 0;
2626
else if(xanchor === 'center') x = 1;
2727
else if(xanchor === 'right') x = 2;

Diff for: src/components/dragelement/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ dragElement.unhoverRaw = unhover.raw;
7979
* By default, clamping is done using `minDrag` to x and y displacements
8080
* independently.
8181
*/
82-
dragElement.init = function(options) {
82+
dragElement.init = function init(options) {
8383
var gd = options.gd;
8484
var numClicks = 1;
8585
var DBLCLICKDELAY = interactConstants.DBLCLICKDELAY;

Diff for: src/components/dragelement/unhover.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ unhover.wrapped = function(gd, evt, subplot) {
3232

3333

3434
// remove hover effects on mouse out, and emit unhover event
35-
unhover.raw = function(gd, evt) {
35+
unhover.raw = function unhoverRaw(gd, evt) {
3636
var fullLayout = gd._fullLayout;
3737
var oldhoverdata = gd._hoverdata;
3838

Diff for: src/components/errorbars/calc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var Lib = require('../../lib');
1616

1717
var makeComputeError = require('./compute_error');
1818

19-
module.exports = function(gd) {
19+
module.exports = function calc(gd) {
2020
var calcdata = gd.calcdata;
2121

2222
for(var i = 0; i < calcdata.length; i++) {

Diff for: src/components/errorbars/compute_error.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@
2525
* - error[0] : error magnitude in the negative direction
2626
* - error[1] : " " " " positive "
2727
*/
28-
module.exports = function(opts) {
28+
module.exports = function makeComputeError(opts) {
2929
var type = opts.type;
3030
var symmetric = opts.symmetric;
3131

3232
if(type === 'data') {
3333
var array = opts.array || [];
3434

3535
if(symmetric) {
36-
return function(dataPt, index) {
36+
return function computeError(dataPt, index) {
3737
var val = +(array[index]);
3838
return [val, val];
3939
};
4040
} else {
4141
var arrayminus = opts.arrayminus || [];
42-
return function(dataPt, index) {
42+
return function computeError(dataPt, index) {
4343
var val = +array[index];
4444
var valMinus = +arrayminus[index];
4545
// in case one is present and the other is missing, fill in 0
@@ -56,12 +56,12 @@ module.exports = function(opts) {
5656
var computeErrorValueMinus = makeComputeErrorValue(type, opts.valueminus);
5757

5858
if(symmetric || opts.valueminus === undefined) {
59-
return function(dataPt) {
59+
return function computeError(dataPt) {
6060
var val = computeErrorValue(dataPt);
6161
return [val, val];
6262
};
6363
} else {
64-
return function(dataPt) {
64+
return function computeError(dataPt) {
6565
return [
6666
computeErrorValueMinus(dataPt),
6767
computeErrorValue(dataPt)

Diff for: src/components/errorbars/plot.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var isNumeric = require('fast-isnumeric');
1515
var Drawing = require('../drawing');
1616
var subTypes = require('../../traces/scatter/subtypes');
1717

18-
module.exports = function(gd, traces, plotinfo, transitionOpts) {
18+
module.exports = function plot(gd, traces, plotinfo, transitionOpts) {
1919
var isNew;
2020

2121
var xa = plotinfo.xaxis;

Diff for: src/components/errorbars/style.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var d3 = require('d3');
1414
var Color = require('../color');
1515

1616

17-
module.exports = function(traces) {
17+
module.exports = function style(traces) {
1818
traces.each(function(d) {
1919
var trace = d[0].trace;
2020
var yObj = trace.error_y || {};

Diff for: src/components/fx/calc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
var Lib = require('../../lib');
1212
var Registry = require('../../registry');
1313

14-
module.exports = function(gd) {
14+
module.exports = function calc(gd) {
1515
var calcdata = gd.calcdata;
1616
var fullLayout = gd._fullLayout;
1717

Diff for: src/components/fx/click.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
var Registry = require('../../registry');
1212
var hover = require('./hover').hover;
1313

14-
module.exports = function(gd, evt, subplot) {
14+
module.exports = function click(gd, evt, subplot) {
1515
var annotationsDone = Registry.getComponentMethod('annotations', 'onClick')(gd, gd._hoverdata);
1616

1717
// fallback to fail-safe in case the plot type's hover method doesn't pass the subplot.

Diff for: src/components/fx/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var Lib = require('../../lib');
1212
var attributes = require('./attributes');
1313
var handleHoverLabelDefaults = require('./hoverlabel_defaults');
1414

15-
module.exports = function(traceIn, traceOut, defaultColor, layout) {
15+
module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
1616
function coerce(attr, dflt) {
1717
return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
1818
}

Diff for: src/components/fx/helpers.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ var Lib = require('../../lib');
1212

1313
// look for either subplot or xaxis and yaxis attributes
1414
// does not handle splom case
15-
exports.getSubplot = function(trace) {
15+
exports.getSubplot = function getSubplot(trace) {
1616
return trace.subplot || (trace.xaxis + trace.yaxis) || trace.geo;
1717
};
1818

1919
// is trace in given list of subplots?
2020
// does handle splom case
21-
exports.isTraceInSubplots = function(trace, subplots) {
21+
exports.isTraceInSubplots = function isTraceInSubplot(trace, subplots) {
2222
if(trace.type === 'splom') {
2323
var xaxes = trace.xaxes || [];
2424
var yaxes = trace.yaxes || [];
@@ -36,28 +36,28 @@ exports.isTraceInSubplots = function(trace, subplots) {
3636
};
3737

3838
// convenience functions for mapping all relevant axes
39-
exports.flat = function(subplots, v) {
39+
exports.flat = function flat(subplots, v) {
4040
var out = new Array(subplots.length);
4141
for(var i = 0; i < subplots.length; i++) {
4242
out[i] = v;
4343
}
4444
return out;
4545
};
4646

47-
exports.p2c = function(axArray, v) {
47+
exports.p2c = function p2c(axArray, v) {
4848
var out = new Array(axArray.length);
4949
for(var i = 0; i < axArray.length; i++) {
5050
out[i] = axArray[i].p2c(v);
5151
}
5252
return out;
5353
};
5454

55-
exports.getDistanceFunction = function(mode, dx, dy, dxy) {
55+
exports.getDistanceFunction = function getDistanceFunction(mode, dx, dy, dxy) {
5656
if(mode === 'closest') return dxy || exports.quadrature(dx, dy);
5757
return mode === 'x' ? dx : dy;
5858
};
5959

60-
exports.getClosest = function(cd, distfn, pointData) {
60+
exports.getClosest = function getClosest(cd, distfn, pointData) {
6161
// do we already have a point number? (array mode only)
6262
if(pointData.index !== false) {
6363
if(pointData.index >= 0 && pointData.index < cd.length) {
@@ -87,11 +87,11 @@ exports.getClosest = function(cd, distfn, pointData) {
8787
* @param {number} v1: signed difference between the current position and the right edge
8888
* @param {number} passVal: the value to return on success
8989
*/
90-
exports.inbox = function(v0, v1, passVal) {
90+
exports.inbox = function inbox(v0, v1, passVal) {
9191
return (v0 * v1 < 0 || v0 === 0) ? passVal : Infinity;
9292
};
9393

94-
exports.quadrature = function(dx, dy) {
94+
exports.quadrature = function quadrature(dx, dy) {
9595
return function(di) {
9696
var x = dx(di);
9797
var y = dy(di);
@@ -114,7 +114,7 @@ exports.quadrature = function(dx, dy) {
114114
* @param {object} cd
115115
* @return {object}
116116
*/
117-
exports.makeEventData = function(pt, trace, cd) {
117+
exports.makeEventData = function makeEventData(pt, trace, cd) {
118118
// hover uses 'index', select uses 'pointNumber'
119119
var pointNumber = 'index' in pt ? pt.index : pt.pointNumber;
120120

Diff for: src/components/fx/hover.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ var HOVERTEXTPAD = constants.HOVERTEXTPAD;
6666
//
6767
// We wrap the hovers in a timer, to limit their frequency.
6868
// The actual rendering is done by private function _hover.
69-
exports.hover = function(gd, evt, subplot, noHoverEvent) {
69+
exports.hover = function hover(gd, evt, subplot, noHoverEvent) {
7070
gd = Lib.getGraphDiv(gd);
7171

7272
Lib.throttle(
@@ -109,7 +109,7 @@ exports.hover = function(gd, evt, subplot, noHoverEvent) {
109109
the index of the hover item used as an anchor for positioning.
110110
The other hover items will be pushed up or down to prevent overlap.
111111
*/
112-
exports.loneHover = function(hoverItems, opts) {
112+
exports.loneHover = function loneHover(hoverItems, opts) {
113113
var multiHover = true;
114114
if(!Array.isArray(hoverItems)) {
115115
multiHover = false;

Diff for: src/components/fx/hoverlabel_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
var Lib = require('../../lib');
1212

13-
module.exports = function(contIn, contOut, coerce, opts) {
13+
module.exports = function handleHoverLabelDefaults(contIn, contOut, coerce, opts) {
1414
opts = opts || {};
1515

1616
coerce('hoverlabel.bgcolor', opts.bgcolor);

Diff for: src/components/fx/layout_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
var Lib = require('../../lib');
1212
var layoutAttributes = require('./layout_attributes');
1313

14-
module.exports = function(layoutIn, layoutOut, fullData) {
14+
module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
1515
function coerce(attr, dflt) {
1616
return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);
1717
}

Diff for: src/components/fx/layout_global_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var Lib = require('../../lib');
1212
var handleHoverLabelDefaults = require('./hoverlabel_defaults');
1313
var layoutAttributes = require('./layout_attributes');
1414

15-
module.exports = function(layoutIn, layoutOut) {
15+
module.exports = function supplyLayoutGlobalDefaults(layoutIn, layoutOut) {
1616
function coerce(attr, dflt) {
1717
return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);
1818
}

0 commit comments

Comments
 (0)