Skip to content

Commit e5a4194

Browse files
committed
eslint: add / enforce spaced-comment rule
1 parent 813fb2e commit e5a4194

File tree

33 files changed

+87
-87
lines changed

33 files changed

+87
-87
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"space-in-parens": [2, "never"],
3636
"space-before-function-paren": [2, "never"],
3737
"space-before-blocks": [2],
38+
"spaced-comment": [2, "always"],
3839
"no-tabs": [2],
3940
"no-multi-spaces": [2],
4041
"no-whitespace-before-property": [2],

src/components/annotations/draw.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,16 +409,16 @@ function drawOne(gd, index, opt, value) {
409409
// and the annotation center are visible
410410
if(options.showarrow) {
411411
if(options.axref === options.xref) {
412-
//we don't want to constrain if the tail is absolute
413-
//or the slope (which is meaningful) will change.
412+
// we don't want to constrain if the tail is absolute
413+
// or the slope (which is meaningful) will change.
414414
arrowX = annPosPx.x;
415415
} else {
416416
arrowX = Lib.constrain(annPosPx.x - options.ax, 1, fullLayout.width - 1);
417417
}
418418

419419
if(options.ayref === options.yref) {
420-
//we don't want to constrain if the tail is absolute
421-
//or the slope (which is meaningful) will change.
420+
// we don't want to constrain if the tail is absolute
421+
// or the slope (which is meaningful) will change.
422422
arrowY = annPosPx.y;
423423
} else {
424424
arrowY = Lib.constrain(annPosPx.y - options.ay, 1, fullLayout.height - 1);

src/components/colorbar/draw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ module.exports = function draw(gd, id) {
527527
container.attr('transform',
528528
'translate(' + (gs.l - xoffset) + ',' + gs.t + ')');
529529

530-
//auto margin adjustment
530+
// auto margin adjustment
531531
Plots.autoMargin(gd, id, {
532532
x: opts.x,
533533
y: opts.y,

src/components/legend/draw.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ function computeLegendDimensions(gd, groups, traces) {
590590
maxTraceWidth = 0,
591591
offsetX = 0;
592592

593-
//calculate largest width for traces and use for width of all legend items
593+
// calculate largest width for traces and use for width of all legend items
594594
traces.each(function(d) {
595595
maxTraceWidth = Math.max(40 + d[0].width, maxTraceWidth);
596596
});
@@ -604,7 +604,7 @@ function computeLegendDimensions(gd, groups, traces) {
604604
offsetX = 0;
605605
rowHeight = rowHeight + maxTraceHeight;
606606
opts.height = opts.height + maxTraceHeight;
607-
//reset for next row
607+
// reset for next row
608608
maxTraceHeight = 0;
609609
}
610610

@@ -615,7 +615,7 @@ function computeLegendDimensions(gd, groups, traces) {
615615
opts.width += traceGap + traceWidth;
616616
opts.height = Math.max(opts.height, legendItem.height);
617617

618-
//keep track of tallest trace in group
618+
// keep track of tallest trace in group
619619
offsetX += traceGap + traceWidth;
620620
maxTraceHeight = Math.max(legendItem.height, maxTraceHeight);
621621
});

src/lib/matrix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ exports.apply2DTransform = function(transform) {
9393
var args = arguments;
9494
if(args.length === 3) {
9595
args = args[0];
96-
}//from map
96+
}// from map
9797
var xy = arguments.length === 1 ? args[0] : [args[0], args[1]];
9898
return exports.dot(transform, [xy[0], xy[1], 1]).slice(0, 2);
9999
};

src/plot_api/plot_api.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ function setPlotContext(gd, config) {
355355
}
356356
}
357357

358-
//staticPlot forces a bunch of others:
358+
// staticPlot forces a bunch of others:
359359
if(context.staticPlot) {
360360
context.editable = false;
361361
context.autosizable = false;
@@ -418,8 +418,8 @@ function plotPolar(gd, data, layout) {
418418

419419
var titleLayout = function() {
420420
this.call(svgTextUtils.convertToTspans);
421-
//TODO: html/mathjax
422-
//TODO: center title
421+
// TODO: html/mathjax
422+
// TODO: center title
423423
};
424424

425425
var title = polarPlotSVG.select('.title-group text')
@@ -1490,7 +1490,7 @@ function _restyle(gd, aobj, _traces) {
14901490
} else if(Registry.traceIs(cont, 'cartesian')) {
14911491
Lib.nestedProperty(cont, 'marker.colors')
14921492
.set(Lib.nestedProperty(cont, 'marker.color').get());
1493-
//look for axes that are no longer in use and delete them
1493+
// look for axes that are no longer in use and delete them
14941494
flagAxForDelete[cont.xaxis || 'x'] = true;
14951495
flagAxForDelete[cont.yaxis || 'y'] = true;
14961496
}

src/plots/cartesian/axes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ axes.coerceRef = function(containerIn, containerOut, gd, axLetter, dflt) {
5555
return Lib.coerce(containerIn, containerOut, attrDef, refAttr);
5656
};
5757

58-
//todo: duplicated per github PR 610. Should be consolidated with axes.coerceRef.
58+
// todo: duplicated per github PR 610. Should be consolidated with axes.coerceRef.
5959
// find the list of possible axes to reference with an axref or ayref attribute
6060
// and coerce it to that list
6161
axes.coerceARef = function(containerIn, containerOut, gd, axLetter, dflt) {
@@ -689,15 +689,15 @@ axes.autoTicks = function(ax, roughDTick) {
689689
ax.dtick = roundDTick(roughDTick, 1000, roundBase60);
690690
}
691691
else {
692-
//milliseconds
692+
// milliseconds
693693
base = Math.pow(10, Math.floor(Math.log(roughDTick) / Math.LN10));
694694
ax.dtick = roundDTick(roughDTick, base, roundBase10);
695695
}
696696
}
697697
else if(ax.type === 'log') {
698698
ax.tick0 = 0;
699699

700-
//only show powers of 10
700+
// only show powers of 10
701701
if(roughDTick > 0.7) ax.dtick = Math.ceil(roughDTick);
702702
else if(Math.abs(ax.range[1] - ax.range[0]) < 1) {
703703
// span is less than one power of 10

src/plots/cartesian/graph_interact.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ function hoverAvoidOverlaps(hoverData, ax) {
12101210
p1 = g1[0];
12111211
topOverlap = p0.pos + p0.dp + p0.size - p1.pos - p1.dp + p1.size;
12121212

1213-
//Only group points that lie on the same axes
1213+
// Only group points that lie on the same axes
12141214
if(topOverlap > 0.01 && (p0.pmin === p1.pmin) && (p0.pmax === p1.pmax)) {
12151215
// push the new point(s) added to this group out of the way
12161216
for(j = g1.length - 1; j >= 0; j--) g1[j].dp += topOverlap;

src/plots/cartesian/layout_attributes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ module.exports = {
475475
valType: 'enumerated',
476476
values: [
477477
'trace', 'category ascending', 'category descending', 'array'
478-
/*, 'value ascending', 'value descending'*/ // value ascending / descending to be implemented later
478+
/* , 'value ascending', 'value descending'*/ // value ascending / descending to be implemented later
479479
],
480480
dflt: 'trace',
481481
role: 'info',
@@ -484,7 +484,7 @@ module.exports = {
484484
'By default, plotly uses *trace*, which specifies the order that is present in the data supplied.',
485485
'Set `categoryorder` to *category ascending* or *category descending* if order should be determined by',
486486
'the alphanumerical order of the category names.',
487-
/*'Set `categoryorder` to *value ascending* or *value descending* if order should be determined by the',
487+
/* 'Set `categoryorder` to *value ascending* or *value descending* if order should be determined by the',
488488
'numerical order of the values.',*/ // // value ascending / descending to be implemented later
489489
'Set `categoryorder` to *array* to derive the ordering from the attribute `categoryarray`. If a category',
490490
'is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to',

src/plots/gl3d/camera.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function createCamera(element, options) {
112112
var curCenter = view.computedCenter.slice();
113113
view.setMode(mode);
114114
if(mode === 'turntable') {
115-
//Hacky time warping stuff to generate smooth animation
115+
// Hacky time warping stuff to generate smooth animation
116116
var t0 = now();
117117
view._active.lookAt(t0, curEye, curCenter, curUp);
118118
view._active.lookAt(t0 + 500, curEye, curCenter, [0, 0, 1]);
@@ -204,17 +204,17 @@ function createCamera(element, options) {
204204
var drot = Math.PI * camera.rotateSpeed;
205205

206206
if((rotate && left && !ctrl && !alt && !shift) || (left && !ctrl && !alt && shift)) {
207-
//Rotate
207+
// Rotate
208208
view.rotate(t, flipX * drot * dx, -flipY * drot * dy, 0);
209209
}
210210

211211
if((pan && left && !ctrl && !alt && !shift) || right || (left && ctrl && !alt && !shift)) {
212-
//Pan
212+
// Pan
213213
view.pan(t, -camera.translateSpeed * dx * distance, camera.translateSpeed * dy * distance, 0);
214214
}
215215

216216
if((zoom && left && !ctrl && !alt && !shift) || middle || (left && !ctrl && alt && !shift)) {
217-
//Zoom
217+
// Zoom
218218
var kzoom = -camera.zoomSpeed * dy / window.innerHeight * (t - view.lastT()) * 100;
219219
view.pan(t, 0, 0, distance * (Math.exp(kzoom) - 1));
220220
}

0 commit comments

Comments
 (0)