Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d5ad834

Browse files
committed
Autofix lint errors
1 parent 52f53ce commit d5ad834

File tree

6 files changed

+14
-22
lines changed

6 files changed

+14
-22
lines changed

src/plots/smith/layout_defaults.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
4040
axOut._id = axOut._name = axName;
4141
axOut._attr = opts.id + '.' + axName;
4242
axOut._traceIndices = subplotData.map(function(t) { return t._expandedIndex; });
43-
44-
var dataAttr = constants.axisName2dataArray[axName];
45-
var axType = handleAxisTypeDefaults(axIn, axOut, coerceAxis, subplotData, dataAttr, opts);
43+
axOut.type = 'linear';
4644

4745
var visible = coerceAxis('visible');
4846
setConvert(axOut, contOut, layoutOut);
@@ -123,11 +121,6 @@ function handleDefaults(contIn, contOut, coerce, opts) {
123121
}
124122
}
125123

126-
function handleAxisTypeDefaults(axIn, axOut) {
127-
axOut.type = 'linear';
128-
return axOut.type;
129-
}
130-
131124
module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
132125
handleSubplotDefaults(layoutIn, layoutOut, fullData, {
133126
type: constants.name,

src/plots/smith/set_convert.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ function fromRadians(v, unit) {
121121
return unit === 'degrees' ? rad2deg(v) : v;
122122
}
123123

124-
function setConvertAngular(ax, smithLayout) {
124+
function setConvertAngular(ax) {
125125
var _d2c = ax.d2c;
126126
var _c2d = ax.c2d;
127127

128-
ax.d2c = function (v, unit) { return toRadians(_d2c(v), unit); };
129-
ax.c2d = function (v, unit) { return _c2d(fromRadians(v, unit)); };
128+
ax.d2c = function(v, unit) { return toRadians(_d2c(v), unit); };
129+
ax.c2d = function(v, unit) { return _c2d(fromRadians(v, unit)); };
130130

131131
// override makeCalcdata to handle thetaunit and special theta0/dtheta logic
132132
ax.makeCalcdata = function(trace, coord) {

src/plots/smith/smith.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
'use strict';
22

33
var d3 = require('@plotly/d3');
4-
var tinycolor = require('tinycolor2');
54

6-
var Registry = require('../../registry');
75
var Lib = require('../../lib');
86
var strRotate = Lib.strRotate;
97
var strTranslate = Lib.strTranslate;
@@ -404,7 +402,9 @@ proto.updateRadialAxis = function(fullLayout, smithLayout) {
404402

405403
// circular grid lines
406404
Axes.drawGrid(gd, ax, {
407-
vals: realStops.map(v => ({x: v})),
405+
vals: realStops.map(function(v) {
406+
return {x: v};
407+
}),
408408
layer: layers['radial-grid'],
409409
path: gridPathFn,
410410
transFn: Lib.noop,

src/traces/scattersmith/attributes.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplat
44
var texttemplateAttrs = require('../../plots/template_attributes').texttemplateAttrs;
55
var extendFlat = require('../../lib/extend').extendFlat;
66
var scatterAttrs = require('../scatter/attributes');
7-
var baseAttrs = require('../../plots/attributes');
87
var lineAttrs = scatterAttrs.line;
98

109
module.exports = {

test/jasmine/tests/scattersmith_test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var Plotly = require('@lib/index');
22
var ScatterSmith = require('@src/traces/scattersmith');
33
var Lib = require('@src/lib');
4-
const { assertHoverLabelContent } = require('../assets/custom_assertions');
4+
var assertHoverLabelContent = require('../assets/custom_assertions').assertHoverLabelContent;
55

66
var createGraphDiv = require('../assets/create_graph_div');
77
var destroyGraphDiv = require('../assets/destroy_graph_div');
@@ -41,7 +41,7 @@ describe('Test scattersmith trace defaults:', function() {
4141
});
4242
});
4343

44-
describe('Test scattersmith hover', function () {
44+
describe('Test scattersmith hover', function() {
4545
var gd;
4646

4747
afterEach(destroyGraphDiv);
@@ -60,7 +60,7 @@ describe('Test scattersmith hover', function () {
6060

6161
var pos = specs.pos || [200, 200];
6262

63-
return Plotly.newPlot(gd, fig).then(function () {
63+
return Plotly.newPlot(gd, fig).then(function() {
6464
mouseEvent('mousemove', pos[0], pos[1]);
6565
assertHoverLabelContent(specs);
6666
});
@@ -71,9 +71,9 @@ describe('Test scattersmith hover', function () {
7171
nums: '0.1 + 0.1j',
7272
pos: [80, 175],
7373
name: 'trace 0'
74-
}].forEach(function (specs) {
75-
it('should generate correct hover labels ' + specs.desc, function (done) {
74+
}].forEach(function(specs) {
75+
it('should generate correct hover labels ' + specs.desc, function(done) {
7676
run(specs).then(done, done.fail);
7777
});
78-
})
78+
});
7979
});

test/jasmine/tests/smith_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('Test smith plot defaults:', function() {
2424
_supply({
2525
smith: {}
2626
});
27-
27+
2828
var smith = layoutOut.smith;
2929

3030
expect(smith.domain.x).toEqual([0, 1]);

0 commit comments

Comments
 (0)