Skip to content

Commit 4b1bf62

Browse files
committed
888: various syntax fixes
1 parent 84ede31 commit 4b1bf62

File tree

3 files changed

+26
-38
lines changed

3 files changed

+26
-38
lines changed

src/plots/polar/polar.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,6 @@ proto.updateMainDrag = function(fullLayout) {
840840
}
841841

842842
function zoomMove(dx, dy) {
843-
844843
dx = dx * scaleX;
845844
dy = dy * scaleY;
846845

test/jasmine/tests/cartesian_interact_test.js

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@ var mouseEvent = require('../assets/mouse_event');
1212
var failTest = require('../assets/fail_test');
1313
var selectButton = require('../assets/modebar_button');
1414
var drag = require('../assets/drag');
15-
var click = require('../assets/click');
1615
var doubleClick = require('../assets/double_click');
1716
var getNodeCoords = require('../assets/get_node_coords');
1817
var delay = require('../assets/delay');
1918

2019
var customAssertions = require('../assets/custom_assertions');
2120
var assertNodeDisplay = customAssertions.assertNodeDisplay;
22-
var assertHoverLabelContent = customAssertions.assertHoverLabelContent;
2321

2422
var MODEBAR_DELAY = 500;
25-
var HOVERMINTIME = require('@src/components/fx').constants.HOVERMINTIME;
2623

2724
describe('zoom box element', function() {
2825
var mock = require('@mocks/14.json');
@@ -2292,7 +2289,7 @@ describe('Cartesian plots with css transforms', function() {
22922289
function _dragRelease(start, end) {
22932290
var localEnd = _getLocalPos(gd, end);
22942291
_drag(start, end);
2295-
mouseEvent('mouseup',localEnd[0], localEnd[1]);
2292+
mouseEvent('mouseup', localEnd[0], localEnd[1]);
22962293
}
22972294

22982295
function _hover(pos) {
@@ -2333,9 +2330,7 @@ describe('Cartesian plots with css transforms', function() {
23332330
var transforms = ['scale(0.5)'];
23342331

23352332
transforms.forEach(function(transform) {
2336-
2337-
it(`hover behaves correctly after css transform: ${transform}`, function(done) {
2338-
2333+
it('hover behaves correctly after css transform: ' + transform, function(done) {
23392334
function _hoverAndAssertEventOccurred(point, label) {
23402335
return _hover(point)
23412336
.then(function() {
@@ -2345,7 +2340,7 @@ describe('Cartesian plots with css transforms', function() {
23452340
_unhover(point);
23462341
});
23472342
}
2348-
2343+
23492344
Plotly.plot(gd, Lib.extendDeep({}, mock))
23502345
.then(function() {
23512346
gd.on('plotly_hover', function(d) {
@@ -2362,9 +2357,8 @@ describe('Cartesian plots with css transforms', function() {
23622357
.catch(failTest)
23632358
.then(done);
23642359
});
2365-
2366-
it(`drag-zoom behaves correctly after css transform: ${transform}`, function(done) {
2367-
2360+
2361+
it('drag-zoom behaves correctly after css transform: ' + transform, function(done) {
23682362
// return a rect of form {left, top, width, height} from the zoomlayer
23692363
// svg path.
23702364
function _getZoomlayerPathRect(pathStr) {
@@ -2376,7 +2370,7 @@ describe('Cartesian plots with css transforms', function() {
23762370
rect.top = Number(startCoordsString.split(',')[1]);
23772371
return rect;
23782372
}
2379-
2373+
23802374
// asserts that the zoombox path must go from the start to end positions,
23812375
// in css-transformed coordinates.
23822376
function _assertTransformedZoombox(startPos, endPos) {
@@ -2390,41 +2384,41 @@ describe('Cartesian plots with css transforms', function() {
23902384
expect(zoomboxRect.width).toBeCloseTo(size[0]);
23912385
expect(zoomboxRect.height).toBeCloseTo(size[1]);
23922386
}
2393-
2387+
23942388
var start = [50, 50];
2395-
var end = [150, 150]
2396-
2389+
var end = [150, 150];
2390+
23972391
Plotly.plot(gd, Lib.extendDeep({}, mock))
23982392
.then(function() {
23992393
transformPlot(gd, transform);
24002394
recalculateInverse(gd);
24012395
})
2402-
.then(function() {_drag(start, end); })
2403-
.then(function() {
2404-
_assertTransformedZoombox(start, end);
2396+
.then(function() {_drag(start, end); })
2397+
.then(function() {
2398+
_assertTransformedZoombox(start, end);
24052399
})
24062400
.then(function() { mouseEvent('mouseup', 0, 0); })
24072401
.catch(failTest)
24082402
.then(done);
24092403
});
2410-
2411-
it(`select behaves correctly after css transform: ${transform}`, function(done) {
2412-
2404+
2405+
it('select behaves correctly after css transform: ' + transform, function(done) {
24132406
function _assertSelected(expectation) {
24142407
var data = gd._fullData[0];
24152408
var points = data.selectedpoints;
24162409
expect(typeof(points) !== 'undefined').toBeTrue();
2417-
if (expectation.numPoints)
2410+
if(expectation.numPoints) {
24182411
expect(points.length).toBe(expectation.numPoints);
2419-
if (expectation.selectedLabels) {
2420-
var selectedLabels = points.map(function(i) { return data.x[i]; })
2412+
}
2413+
if(expectation.selectedLabels) {
2414+
var selectedLabels = points.map(function(i) { return data.x[i]; });
24212415
expect(selectedLabels).toEqual(expectation.selectedLabels);
24222416
}
24232417
}
2424-
2418+
24252419
var start = [10, 10];
24262420
var end = [200, 200];
2427-
2421+
24282422
Plotly.plot(gd, Lib.extendDeep({}, mock))
24292423
.then(function() {
24302424
transformPlot(gd, transform);
@@ -2437,11 +2431,10 @@ describe('Cartesian plots with css transforms', function() {
24372431
_dragRelease(start, end);
24382432
})
24392433
.then(function() {
2440-
_assertSelected({numPoints: 2, selectedLabels: ["one", "two"]});
2434+
_assertSelected({numPoints: 2, selectedLabels: ['one', 'two']});
24412435
})
24422436
.catch(failTest)
24432437
.then(done);
24442438
});
24452439
});
2446-
2447-
});
2440+
});

test/jasmine/tests/polar_test.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,6 @@ describe('Polar plots with css transforms', function() {
16011601
var gd;
16021602

16031603
beforeEach(function() {
1604-
eventRecordings = {};
16051604
gd = createGraphDiv();
16061605
});
16071606

@@ -1667,11 +1666,9 @@ describe('Polar plots with css transforms', function() {
16671666
var transforms = ['scale(0.5)'];
16681667

16691668
transforms.forEach(function(transform) {
1670-
1671-
it(`@transform_test @alex_test hover behaves correctly after css transform: ${transform}`, function(done) {
1672-
1669+
it('@transform_test @alex_test hover behaves correctly after css transform: ' + transform, function(done) {
16731670
var hoverEvents = {};
1674-
1671+
16751672
Plotly.plot(gd, Lib.extendDeep({}, mock))
16761673
.then(function() {
16771674
gd.on('plotly_hover', function(d) {
@@ -1686,12 +1683,11 @@ describe('Polar plots with css transforms', function() {
16861683
.then(function() { _hover([65, 65]); })
16871684
.then(function() { _hover([132, 132]); })
16881685
.then(function() { _hover([165, 165]); })
1689-
.then(function() {
1690-
expect(Object.keys(hoverEvents).length).toBe(4);
1686+
.then(function() {
1687+
expect(Object.keys(hoverEvents).length).toBe(4);
16911688
})
16921689
.catch(failTest)
16931690
.then(done);
16941691
});
16951692
});
1696-
16971693
});

0 commit comments

Comments
 (0)