Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e3d23e9

Browse files
committedDec 24, 2018
enforce "camelcase": [2, {"properties": "never"}] eslint rule
1 parent 18c70a4 commit e3d23e9

File tree

16 files changed

+102
-105
lines changed

16 files changed

+102
-105
lines changed
 

‎.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"max-len": [0, 80],
3030
"brace-style": [0, "stroustrup", {"allowSingleLine": true}],
3131
"curly": [2, "multi-line"],
32-
"camelcase": [0, {"properties": "never"}],
32+
"camelcase": [2, {"properties": "never"}],
3333
"comma-spacing": [2, {"before": false, "after": true}],
3434
"comma-style": [2, "last"],
3535
"semi": [2],

‎src/lib/geometry2d.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ exports.segmentDistance = function segmentDistance(x1, y1, x2, y2, x3, y3, x4, y
4545
var y12 = y2 - y1;
4646
var x34 = x4 - x3;
4747
var y34 = y4 - y3;
48-
var l2_12 = x12 * x12 + y12 * y12;
49-
var l2_34 = x34 * x34 + y34 * y34;
48+
var ll12 = x12 * x12 + y12 * y12;
49+
var ll34 = x34 * x34 + y34 * y34;
5050

5151
// calculate distance squared, then take the sqrt at the very end
5252
var dist2 = Math.min(
53-
perpDistance2(x12, y12, l2_12, x3 - x1, y3 - y1),
54-
perpDistance2(x12, y12, l2_12, x4 - x1, y4 - y1),
55-
perpDistance2(x34, y34, l2_34, x1 - x3, y1 - y3),
56-
perpDistance2(x34, y34, l2_34, x2 - x3, y2 - y3)
53+
perpDistance2(x12, y12, ll12, x3 - x1, y3 - y1),
54+
perpDistance2(x12, y12, ll12, x4 - x1, y4 - y1),
55+
perpDistance2(x34, y34, ll34, x1 - x3, y1 - y3),
56+
perpDistance2(x34, y34, ll34, x2 - x3, y2 - y3)
5757
);
5858

5959
return Math.sqrt(dist2);
@@ -63,15 +63,15 @@ exports.segmentDistance = function segmentDistance(x1, y1, x2, y2, x3, y3, x4, y
6363
* distance squared from segment ab to point c
6464
* [xab, yab] is the vector b-a
6565
* [xac, yac] is the vector c-a
66-
* l2_ab is the length squared of (b-a), just to simplify calculation
66+
* llab is the length squared of (b-a), just to simplify calculation
6767
*/
68-
function perpDistance2(xab, yab, l2_ab, xac, yac) {
69-
var fc_ab = (xac * xab + yac * yab);
70-
if(fc_ab < 0) {
68+
function perpDistance2(xab, yab, llab, xac, yac) {
69+
var fcAB = (xac * xab + yac * yab);
70+
if(fcAB < 0) {
7171
// point c is closer to point a
7272
return xac * xac + yac * yac;
7373
}
74-
else if(fc_ab > l2_ab) {
74+
else if(fcAB > llab) {
7575
// point c is closer to point b
7676
var xbc = xac - xab;
7777
var ybc = yac - yab;
@@ -80,7 +80,7 @@ function perpDistance2(xab, yab, l2_ab, xac, yac) {
8080
else {
8181
// perpendicular distance is the shortest
8282
var crossProduct = xac * yab - yac * xab;
83-
return crossProduct * crossProduct / l2_ab;
83+
return crossProduct * crossProduct / llab;
8484
}
8585
}
8686

‎src/plots/cartesian/layout_defaults.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
102102

103103
// plot_bgcolor only makes sense if there's a (2D) plot!
104104
// TODO: bgcolor for each subplot, to inherit from the main one
105-
var plot_bgcolor = Color.background;
105+
var plotBgColor = Color.background;
106106
if(xIds.length && yIds.length) {
107-
plot_bgcolor = Lib.coerce(layoutIn, layoutOut, basePlotLayoutAttributes, 'plot_bgcolor');
107+
plotBgColor = Lib.coerce(layoutIn, layoutOut, basePlotLayoutAttributes, 'plot_bgcolor');
108108
}
109109

110-
var bgColor = Color.combine(plot_bgcolor, layoutOut.paper_bgcolor);
110+
var bgColor = Color.combine(plotBgColor, layoutOut.paper_bgcolor);
111111

112112
var axName, axLetter, axLayoutIn, axLayoutOut;
113113

‎src/plots/geo/zoom.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function zoomNonClipped(geo, projection) {
192192
function zoomClipped(geo, projection) {
193193
var view = {r: projection.rotate(), k: projection.scale()},
194194
zoom = initZoom(geo, projection),
195-
event = d3_eventDispatch(zoom, 'zoomstart', 'zoom', 'zoomend'),
195+
event = d3eventDispatch(zoom, 'zoomstart', 'zoom', 'zoomend'),
196196
zooming = 0,
197197
zoomOn = zoom.on;
198198

@@ -440,7 +440,7 @@ function cross(a, b) {
440440
// events have a target component (such as a brush), a target element (such as
441441
// the svg:g element containing the brush) and the standard arguments `d` (the
442442
// target element's data) and `i` (the selection index of the target element).
443-
function d3_eventDispatch(target) {
443+
function d3eventDispatch(target) {
444444
var i = 0,
445445
n = arguments.length,
446446
argumentz = [];

‎src/plots/gl2d/scene2d.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ proto.updateTraces = function(fullData, calcData) {
489489
this.fullData = fullData;
490490

491491
// remove empty traces
492-
trace_id_loop:
492+
traceIdLoop:
493493
for(i = 0; i < traceIds.length; i++) {
494494
var oldUid = traceIds[i],
495495
oldTrace = this.traces[oldUid];
@@ -498,7 +498,7 @@ proto.updateTraces = function(fullData, calcData) {
498498
fullTrace = fullData[j];
499499

500500
if(fullTrace.uid === oldUid && fullTrace.type === oldTrace.type) {
501-
continue trace_id_loop;
501+
continue traceIdLoop;
502502
}
503503
}
504504

‎src/plots/gl3d/scene.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,11 @@ proto.plot = function(sceneData, fullLayout, layout) {
474474
// Remove empty traces
475475
var traceIds = Object.keys(this.traces);
476476

477-
trace_id_loop:
477+
traceIdLoop:
478478
for(i = 0; i < traceIds.length; ++i) {
479479
for(j = 0; j < sceneData.length; ++j) {
480480
if(sceneData[j].uid === traceIds[i] && sceneData[j].visible === true) {
481-
continue trace_id_loop;
481+
continue traceIdLoop;
482482
}
483483
}
484484
trace = this.traces[traceIds[i]];

‎src/plots/mapbox/mapbox.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,13 @@ proto.updateData = function(calcData) {
292292

293293
// remove empty trace objects
294294
var ids = Object.keys(traceHash);
295-
id_loop:
295+
idLoop:
296296
for(i = 0; i < ids.length; i++) {
297297
var id = ids[i];
298298

299299
for(j = 0; j < calcData.length; j++) {
300300
trace = calcData[j][0].trace;
301-
if(id === trace.uid) continue id_loop;
301+
if(id === trace.uid) continue idLoop;
302302
}
303303

304304
traceObj = traceHash[id];

‎src/plots/ternary/ternary.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ proto.updateLayers = function(ternaryLayout) {
166166
toplevel.order();
167167
};
168168

169-
var w_over_h = Math.sqrt(4 / 3);
169+
var whRatio = Math.sqrt(4 / 3);
170170

171171
proto.adjustLayout = function(ternaryLayout, graphSize) {
172172
var _this = this,
@@ -184,13 +184,13 @@ proto.adjustLayout = function(ternaryLayout, graphSize) {
184184

185185
var x0, y0, w, h, xDomainFinal, yDomainFinal;
186186

187-
if(wmax > w_over_h * hmax) {
187+
if(wmax > whRatio * hmax) {
188188
h = hmax;
189-
w = h * w_over_h;
189+
w = h * whRatio;
190190
}
191191
else {
192192
w = wmax;
193-
h = w / w_over_h;
193+
h = w / whRatio;
194194
}
195195

196196
xDomainFinal = xDomain * w / wmax;
@@ -253,7 +253,7 @@ proto.adjustLayout = function(ternaryLayout, graphSize) {
253253
// tickangle = 'auto' means 0 anyway for a y axis, need to coerce to 0 here
254254
// so we can shift by 30.
255255
tickangle: (+ternaryLayout.aaxis.tickangle || 0) - 30,
256-
domain: [yDomain0, yDomain0 + yDomainFinal * w_over_h],
256+
domain: [yDomain0, yDomain0 + yDomainFinal * whRatio],
257257
anchor: 'free',
258258
position: 0,
259259
_id: 'y',
@@ -282,7 +282,7 @@ proto.adjustLayout = function(ternaryLayout, graphSize) {
282282
range: [sum - amin - bmin, cmin],
283283
side: 'right',
284284
tickangle: (+ternaryLayout.caxis.tickangle || 0) + 30,
285-
domain: [yDomain0, yDomain0 + yDomainFinal * w_over_h],
285+
domain: [yDomain0, yDomain0 + yDomainFinal * whRatio],
286286
anchor: 'free',
287287
position: 0,
288288
_id: 'y',
@@ -620,7 +620,7 @@ proto.initInteractions = function() {
620620
xCenter = (xLeft + xRight) / 2,
621621
xSpan = xRight - xLeft,
622622
yBottom = (1 - afrac) * _this.h,
623-
yTop = yBottom - xSpan / w_over_h;
623+
yTop = yBottom - xSpan / whRatio;
624624

625625
if(xSpan < constants.MINZOOM) {
626626
mins = mins0;

‎tasks/util/pull_font_svg.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ module.exports = function pullFontSVG(data, pathOut) {
88
parser.parseString(data, function(err, result) {
99
if(err) throw err;
1010

11-
var font_obj = result.svg.defs[0].font[0],
12-
default_width = Number(font_obj.$['horiz-adv-x']),
13-
ascent = Number(font_obj['font-face'][0].$.ascent),
14-
descent = Number(font_obj['font-face'][0].$.descent),
11+
var fontObj = result.svg.defs[0].font[0],
12+
defaultWidth = Number(fontObj.$['horiz-adv-x']),
13+
ascent = Number(fontObj['font-face'][0].$.ascent),
14+
descent = Number(fontObj['font-face'][0].$.descent),
1515
chars = {};
1616

17-
font_obj.glyph.forEach(function(glyph) {
17+
fontObj.glyph.forEach(function(glyph) {
1818
var name = glyph.$['glyph-name'],
1919
transform = name === 'spikeline' ?
2020
'matrix(1.5 0 0 -1.5 0 ' + ascent + ')' :
2121
'matrix(1 0 0 -1 0 ' + ascent + ')';
2222

2323
chars[name] = {
24-
width: Number(glyph.$['horiz-adv-x']) || default_width,
24+
width: Number(glyph.$['horiz-adv-x']) || defaultWidth,
2525
height: ascent - descent,
2626
path: glyph.$.d,
2727
transform: transform,

‎tasks/util/wrap_locale.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var moduleMarker = 'module.exports = ';
1818
*
1919
* Logs basename of bundle when completed.
2020
*/
21-
module.exports = function wrap_locale(pathToInput, pathToOutput) {
21+
module.exports = function wrapLocale(pathToInput, pathToOutput) {
2222
fs.readFile(pathToInput, 'utf8', function(err, data) {
2323
var moduleStart = data.indexOf(moduleMarker) + moduleMarker.length;
2424
var moduleEnd = data.indexOf(';', moduleStart);

‎test/jasmine/tests/histogram_test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,11 +1043,11 @@ describe('getBinSpanLabelRound', function() {
10431043
var cn8i = Lib.dateTime2ms('1995-08i-01', cn);
10441044
var cn9 = Lib.dateTime2ms('1995-09-01', cn);
10451045

1046-
var cn1_00 = Lib.dateTime2ms('2000-01-01', cn);
1047-
var cn1_01 = Lib.dateTime2ms('2001-01-01', cn);
1048-
var cn1_02 = Lib.dateTime2ms('2002-01-01', cn);
1049-
var cn1_10 = Lib.dateTime2ms('2010-01-01', cn);
1050-
var cn1_20 = Lib.dateTime2ms('2020-01-01', cn);
1046+
var cn1x00 = Lib.dateTime2ms('2000-01-01', cn);
1047+
var cn1x01 = Lib.dateTime2ms('2001-01-01', cn);
1048+
var cn1x02 = Lib.dateTime2ms('2002-01-01', cn);
1049+
var cn1x10 = Lib.dateTime2ms('2010-01-01', cn);
1050+
var cn1x20 = Lib.dateTime2ms('2020-01-01', cn);
10511051

10521052
_test(100, 2000, [cn8i, cn8i + 10000, cn8i + 20000], cn,
10531053
[cn8i, cn8i + 9000, cn8i + 10000, cn8i + 19000]);
@@ -1059,17 +1059,17 @@ describe('getBinSpanLabelRound', function() {
10591059
_test(12 * hr, 12 * hr, [cn8 - 12 * hr, cn8i - 12 * hr, cn9 - 12 * hr], cn,
10601060
[cn8, cn8i - day, cn8i, cn9 - day]);
10611061

1062-
_test(0, 28 * day, [cn1_00, cn1_01, cn1_02], cn,
1063-
[cn1_00, Lib.dateTime2ms('2000-12-01', cn), cn1_01, Lib.dateTime2ms('2001-12-01', cn)]);
1064-
_test(14 * day, 14 * day, [cn1_00 - 14 * day, cn1_01 - 14 * day, cn1_02 - 14 * day], cn,
1065-
[cn1_00, Lib.dateTime2ms('2000-12-01', cn), cn1_01, Lib.dateTime2ms('2001-12-01', cn)]);
1062+
_test(0, 28 * day, [cn1x00, cn1x01, cn1x02], cn,
1063+
[cn1x00, Lib.dateTime2ms('2000-12-01', cn), cn1x01, Lib.dateTime2ms('2001-12-01', cn)]);
1064+
_test(14 * day, 14 * day, [cn1x00 - 14 * day, cn1x01 - 14 * day, cn1x02 - 14 * day], cn,
1065+
[cn1x00, Lib.dateTime2ms('2000-12-01', cn), cn1x01, Lib.dateTime2ms('2001-12-01', cn)]);
10661066

1067-
_test(0, 353 * day, [cn1_00, cn1_10, cn1_20], cn,
1068-
[cn1_00, Lib.dateTime2ms('2009-01-01', cn), cn1_10, Lib.dateTime2ms('2019-01-01', cn)]);
1067+
_test(0, 353 * day, [cn1x00, cn1x10, cn1x20], cn,
1068+
[cn1x00, Lib.dateTime2ms('2009-01-01', cn), cn1x10, Lib.dateTime2ms('2019-01-01', cn)]);
10691069
// occasionally we give extra precision for world dates (month when it should be year
10701070
// or day when it should be month). That's better than doing the opposite... not going
10711071
// to fix now, too many edge cases, better not to complicate the logic for them all.
1072-
_test(176 * day, 177 * day, [cn1_00 - 176 * day, cn1_10 - 176 * day, cn1_20 - 176 * day], cn, [
1072+
_test(176 * day, 177 * day, [cn1x00 - 176 * day, cn1x10 - 176 * day, cn1x20 - 176 * day], cn, [
10731073
Lib.dateTime2ms('1999-08-01', cn), Lib.dateTime2ms('2009-07-01', cn),
10741074
Lib.dateTime2ms('2009-08-01', cn), Lib.dateTime2ms('2019-07-01', cn)
10751075
]);

‎test/jasmine/tests/hover_spikeline_test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ describe('spikeline hover', function() {
3737
Lib.clearThrottle();
3838
}
3939

40-
function _set_hovermode(hovermode) {
40+
function _setHovermode(hovermode) {
4141
return Plotly.relayout(gd, 'hovermode', hovermode);
4242
}
4343

44-
function _set_spikedistance(spikedistance) {
44+
function _setSpikedistance(spikedistance) {
4545
return Plotly.relayout(gd, 'spikedistance', spikedistance);
4646
}
4747

@@ -165,7 +165,7 @@ describe('spikeline hover', function() {
165165

166166
Plotly.plot(gd, _mock)
167167
.then(function() {
168-
_set_spikedistance(200);
168+
_setSpikedistance(200);
169169
})
170170
.then(function() {
171171
_hover({xpx: 120, ypx: 180});
@@ -200,7 +200,7 @@ describe('spikeline hover', function() {
200200
[]
201201
);
202202

203-
_set_hovermode('x');
203+
_setHovermode('x');
204204
})
205205
.then(function() {
206206
_hover({xval: 2, yval: 3});
@@ -235,7 +235,7 @@ describe('spikeline hover', function() {
235235
[]
236236
);
237237

238-
_set_spikedistance(200);
238+
_setSpikedistance(200);
239239
})
240240
.then(function() {
241241
_hover({xval: 1.6, yval: 2.6});
@@ -271,7 +271,7 @@ describe('spikeline hover', function() {
271271
[]
272272
);
273273

274-
_set_spikedistance(-1);
274+
_setSpikedistance(-1);
275275
})
276276
.then(function() {
277277
_hover({xval: 1.6, yval: 2.6});
@@ -307,7 +307,7 @@ describe('spikeline hover', function() {
307307
[]
308308
);
309309

310-
_set_spikedistance(0);
310+
_setSpikedistance(0);
311311
})
312312
.then(function() {
313313
_hover({xval: 2, yval: 3});
@@ -365,7 +365,7 @@ describe('spikeline hover', function() {
365365
type: 'bar', y: [2, 1]
366366
}], spikeLayout())
367367
.then(_assertBarSpikes)
368-
.then(function() { _set_hovermode('closest'); })
368+
.then(function() { _setHovermode('closest'); })
369369
.then(_assertBarSpikes)
370370
.catch(failTest)
371371
.then(done);

‎test/jasmine/tests/lib_date_test.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ describe('dates', function() {
1818
d1c.setFullYear(13);
1919

2020
var thisYear = new Date().getFullYear(),
21-
thisYear_2 = thisYear % 100,
21+
thisYear2 = thisYear % 100,
2222
nowMinus70 = thisYear - 70,
23-
nowMinus70_2 = nowMinus70 % 100,
23+
nowMinus70x2 = nowMinus70 % 100,
2424
nowPlus29 = thisYear + 29,
25-
nowPlus29_2 = nowPlus29 % 100;
25+
nowPlus29x2 = nowPlus29 % 100;
2626

2727
function tweakedTZOffset(d) {
2828
var tzOffset = d.getTimezoneOffset() * 60000;
@@ -73,9 +73,9 @@ describe('dates', function() {
7373
['0013-1-1 1:00:00.60011111111', +d1c + 0.11111111],
7474

7575
// 2-digit years get mapped to now-70 -> now+29
76-
[thisYear_2 + '-05', new Date(thisYear, 4, 1)],
77-
[nowMinus70_2 + '-10-18', new Date(nowMinus70, 9, 18)],
78-
[nowPlus29_2 + '-02-12 14:29:32', new Date(nowPlus29, 1, 12, 14, 29, 32)],
76+
[thisYear2 + '-05', new Date(thisYear, 4, 1)],
77+
[nowMinus70x2 + '-10-18', new Date(nowMinus70, 9, 18)],
78+
[nowPlus29x2 + '-02-12 14:29:32', new Date(nowPlus29, 1, 12, 14, 29, 32)],
7979

8080
// including timezone info (that we discard)
8181
['2014-03-04 08:15Z', new Date(2014, 2, 4, 8, 15)],
@@ -112,8 +112,8 @@ describe('dates', function() {
112112

113113
[
114114
[10, 2010],
115-
[nowPlus29_2, nowPlus29],
116-
[nowMinus70_2, nowMinus70],
115+
[nowPlus29x2, nowPlus29],
116+
[nowMinus70x2, nowMinus70],
117117
[99, 1999]
118118
].forEach(function(v) {
119119
expect(Lib.dateTime2ms(v[0])).toBe(Date.UTC(v[1], 0, 1), v[0]);
@@ -292,28 +292,28 @@ describe('dates', function() {
292292
expect(Lib.ms2DateTime(0, 0, calendar)).toBe(dateStr, calendar);
293293
expect(Lib.dateTime2ms(dateStr, calendar)).toBe(0, calendar);
294294

295-
var expected_p1ms = dateStr + ' 00:00:00.0001',
296-
expected_1s = dateStr + ' 00:00:01',
297-
expected_1m = dateStr + ' 00:01',
298-
expected_1h = dateStr + ' 01:00',
299-
expected_lastinstant = dateStr + ' 23:59:59.9999';
295+
var expectedPlus1ms = dateStr + ' 00:00:00.0001',
296+
expected1s = dateStr + ' 00:00:01',
297+
expected1m = dateStr + ' 00:01',
298+
expected1h = dateStr + ' 01:00',
299+
expectedLastInstant = dateStr + ' 23:59:59.9999';
300300

301301
var oneSec = 1000,
302302
oneMin = 60 * oneSec,
303303
oneHour = 60 * oneMin,
304304
lastInstant = 24 * oneHour - 0.1;
305305

306-
expect(Lib.ms2DateTime(0.1, 0, calendar)).toBe(expected_p1ms, calendar);
307-
expect(Lib.ms2DateTime(oneSec, 0, calendar)).toBe(expected_1s, calendar);
308-
expect(Lib.ms2DateTime(oneMin, 0, calendar)).toBe(expected_1m, calendar);
309-
expect(Lib.ms2DateTime(oneHour, 0, calendar)).toBe(expected_1h, calendar);
310-
expect(Lib.ms2DateTime(lastInstant, 0, calendar)).toBe(expected_lastinstant, calendar);
311-
312-
expect(Lib.dateTime2ms(expected_p1ms, calendar)).toBe(0.1, calendar);
313-
expect(Lib.dateTime2ms(expected_1s, calendar)).toBe(oneSec, calendar);
314-
expect(Lib.dateTime2ms(expected_1m, calendar)).toBe(oneMin, calendar);
315-
expect(Lib.dateTime2ms(expected_1h, calendar)).toBe(oneHour, calendar);
316-
expect(Lib.dateTime2ms(expected_lastinstant, calendar)).toBe(lastInstant, calendar);
306+
expect(Lib.ms2DateTime(0.1, 0, calendar)).toBe(expectedPlus1ms, calendar);
307+
expect(Lib.ms2DateTime(oneSec, 0, calendar)).toBe(expected1s, calendar);
308+
expect(Lib.ms2DateTime(oneMin, 0, calendar)).toBe(expected1m, calendar);
309+
expect(Lib.ms2DateTime(oneHour, 0, calendar)).toBe(expected1h, calendar);
310+
expect(Lib.ms2DateTime(lastInstant, 0, calendar)).toBe(expectedLastInstant, calendar);
311+
312+
expect(Lib.dateTime2ms(expectedPlus1ms, calendar)).toBe(0.1, calendar);
313+
expect(Lib.dateTime2ms(expected1s, calendar)).toBe(oneSec, calendar);
314+
expect(Lib.dateTime2ms(expected1m, calendar)).toBe(oneMin, calendar);
315+
expect(Lib.dateTime2ms(expected1h, calendar)).toBe(oneHour, calendar);
316+
expect(Lib.dateTime2ms(expectedLastInstant, calendar)).toBe(lastInstant, calendar);
317317
});
318318
});
319319

‎test/jasmine/tests/localize_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ describe('localization', function() {
202202
// four locales, highest to lowest priority
203203
// hopefully nobody will supply this many conflicting locales, but
204204
// if they do, this is what should happen!
205-
var ctx_fr_QC = {
205+
var ctxFrQC = {
206206
dictionary: {a: 'a-ctx-QC'},
207207
format: {decimal: '~'}
208208
};
@@ -212,7 +212,7 @@ describe('localization', function() {
212212
dictionary: {a: 'a-reg-QC', b: 'b-reg-QC'},
213213
format: {decimal: 'X', thousands: '@'}
214214
});
215-
var ctx_fr = {
215+
var ctxFr = {
216216
dictionary: {a: 'a-ctx', b: 'b-ctx', c: 'c-ctx'},
217217
format: {decimal: 'X', thousands: 'X', shortMonths: monthNums}
218218
};
@@ -223,7 +223,7 @@ describe('localization', function() {
223223
format: {decimal: 'X', thousands: 'X', shortMonths: monthLetters, shortDays: dayLetters}
224224
});
225225

226-
plot('fr-QC', {fr: ctx_fr, 'fr-QC': ctx_fr_QC})
226+
plot('fr-QC', {fr: ctxFr, 'fr-QC': ctxFrQC})
227227
.then(function() {
228228
expect(_(gd, 'a')).toBe('a-ctx-QC');
229229
expect(_(gd, 'b')).toBe('b-reg-QC');

‎test/jasmine/tests/parcats_test.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ var CALLBACK_DELAY = 500;
1212

1313
// Testing constants
1414
// =================
15-
var basic_mock = Lib.extendDeep({}, require('@mocks/parcats_basic.json'));
16-
var margin = basic_mock.layout.margin;
17-
var domain = basic_mock.data[0].domain;
15+
var basicMock = Lib.extendDeep({}, require('@mocks/parcats_basic.json'));
16+
var margin = basicMock.layout.margin;
17+
var domain = basicMock.data[0].domain;
1818

1919
var categoryLabelPad = 40,
2020
dimWidth = 16,
@@ -175,7 +175,7 @@ describe('Basic parcats trace', function() {
175175
// Tests
176176
// -----
177177
it('should create trace properly', function(done) {
178-
Plotly.newPlot(gd, basic_mock)
178+
Plotly.newPlot(gd, basicMock)
179179
.then(function() {
180180
// Check trace properties
181181
var trace = gd.data[0];
@@ -188,7 +188,7 @@ describe('Basic parcats trace', function() {
188188
});
189189

190190
it('should compute initial model properly', function(done) {
191-
Plotly.newPlot(gd, basic_mock)
191+
Plotly.newPlot(gd, basicMock)
192192
.then(function() {
193193

194194
// Var check calc data
@@ -271,18 +271,15 @@ describe('Basic parcats trace', function() {
271271
Plotly.newPlot(gd, mock)
272272
.then(function() {
273273

274-
// Var check calc data
275-
var gd_traceData = gd.data[0];
276-
277274
// Check that trace data matches input
278-
expect(gd_traceData).toEqual(mock.data[0]);
275+
expect(gd.data[0]).toEqual(mock.data[0]);
279276
})
280277
.catch(failTest)
281278
.then(done);
282279
});
283280

284281
it('should compute initial fullData properly', function(done) {
285-
Plotly.newPlot(gd, basic_mock)
282+
Plotly.newPlot(gd, basicMock)
286283
.then(function() {
287284
// Check that some of the defaults are computed properly
288285
var fullTrace = gd._fullData[0];
@@ -296,7 +293,7 @@ describe('Basic parcats trace', function() {
296293

297294
it('should compute initial model views properly', function(done) {
298295

299-
Plotly.newPlot(gd, basic_mock)
296+
Plotly.newPlot(gd, basicMock)
300297
.then(function() {
301298
checkParcatsModelView(gd);
302299
})
@@ -306,7 +303,7 @@ describe('Basic parcats trace', function() {
306303
});
307304

308305
it('should compute initial svg properly', function(done) {
309-
Plotly.newPlot(gd, basic_mock)
306+
Plotly.newPlot(gd, basicMock)
310307
.then(function() {
311308
checkParcatsSvg(gd);
312309
})

‎test/jasmine/tests/parcoords_test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ describe('parcoords Lifecycle methods', function() {
850850

851851
it('@gl line.color `Plotly.restyle` should not change context layer', function(done) {
852852
var testLayer = '.gl-canvas-context';
853-
var old_rgb, new_rgb;
853+
var oldRGB, newRGB;
854854

855855
Plotly.plot(gd, [{
856856
type: 'parcoords',
@@ -866,19 +866,19 @@ describe('parcoords Lifecycle methods', function() {
866866
})
867867
.then(function() {
868868
var rgb = getAvgPixelByChannel(testLayer);
869-
old_rgb = rgb[0] + rgb[1] + rgb[2] / 3.0;
870-
expect(old_rgb).toBeGreaterThan(0, 'not all black');
871-
expect(old_rgb).toBeLessThan(255, 'not all white');
869+
oldRGB = rgb[0] + rgb[1] + rgb[2] / 3.0;
870+
expect(oldRGB).toBeGreaterThan(0, 'not all black');
871+
expect(oldRGB).toBeLessThan(255, 'not all white');
872872

873873
return Plotly.restyle(gd, 'line.color', 'red');
874874
})
875875
.then(function() {
876876
var rgb = getAvgPixelByChannel(testLayer);
877-
new_rgb = rgb[0] + rgb[1] + rgb[2] / 3.0;
878-
expect(new_rgb).toBeGreaterThan(0, 'not all black');
879-
expect(new_rgb).toBeLessThan(255, 'not all white');
877+
newRGB = rgb[0] + rgb[1] + rgb[2] / 3.0;
878+
expect(newRGB).toBeGreaterThan(0, 'not all black');
879+
expect(newRGB).toBeLessThan(255, 'not all white');
880880

881-
expect(new_rgb).toBe(old_rgb, 'no change to context');
881+
expect(newRGB).toBe(oldRGB, 'no change to context');
882882
})
883883
.catch(failTest)
884884
.then(done);

0 commit comments

Comments
 (0)
Please sign in to comment.