From 6d820f7ea896cb36bf5d7f696e7a84bc2cd7e4d3 Mon Sep 17 00:00:00 2001 From: Glenn Matthys Date: Thu, 29 Mar 2018 11:03:59 +0200 Subject: [PATCH 1/9] Add "selectdirection" layout attribute --- src/components/fx/layout_attributes.js | 12 ++++++++++++ src/components/fx/layout_defaults.js | 1 + 2 files changed, 13 insertions(+) diff --git a/src/components/fx/layout_attributes.js b/src/components/fx/layout_attributes.js index 542be419e6d..4c35c2b4086 100644 --- a/src/components/fx/layout_attributes.js +++ b/src/components/fx/layout_attributes.js @@ -101,5 +101,17 @@ module.exports = { ].join(' ') }, editType: 'none' + }, + selectdirection: { + valType: 'enumerated', + role: 'info', + values: ['h', 'v', 'd', 'any'], + dflt: 'any', + description: [ + 'When "dragmode" is set to "select", this limits the selection of the drag to', + 'horizontal, vertical or diagonal. "h" only allows horizontal selection,', + '"v" only vertical, "d" only diagonal and "any" sets no limit.' + ].join(' '), + editType: 'none' } }; diff --git a/src/components/fx/layout_defaults.js b/src/components/fx/layout_defaults.js index b88b652d9e2..49e23774749 100644 --- a/src/components/fx/layout_defaults.js +++ b/src/components/fx/layout_defaults.js @@ -17,6 +17,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { } coerce('dragmode'); + coerce('selectdirection', 'any'); var hovermodeDflt; if(layoutOut._has('cartesian')) { From 9595cbe4775a647196357ab2b0d6f34dc5e7abc2 Mon Sep 17 00:00:00 2001 From: Glenn Matthys Date: Thu, 29 Mar 2018 11:05:15 +0200 Subject: [PATCH 2/9] Implement support for selectdirection layout attribute in cartesian select --- src/plots/cartesian/select.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/plots/cartesian/select.js b/src/plots/cartesian/select.js index 92837250622..c5ac85c37c7 100644 --- a/src/plots/cartesian/select.js +++ b/src/plots/cartesian/select.js @@ -159,6 +159,8 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) { } } + var direction = fullLayout.selectdirection; + dragOptions.moveFn = function(dx0, dy0) { x1 = Math.max(0, Math.min(pw, dx0 + x0)); y1 = Math.max(0, Math.min(ph, dy0 + y0)); @@ -167,7 +169,17 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) { dy = Math.abs(y1 - y0); if(mode === 'select') { - if(dy < Math.min(dx * 0.6, MINSELECT)) { + + if(fullLayout.selectdirection === 'any') { + if(dy < Math.min(dx * 0.6, MINSELECT)) direction = 'h'; + else if(dx < Math.min(dy * 0.6, MINSELECT)) direction = 'v'; + else direction = 'd'; + } + else { + direction = fullLayout.selectdirection; + } + + if(direction === 'h') { // horizontal motion: make a vertical box currentPolygon = [[x0, 0], [x0, ph], [x1, ph], [x1, 0]]; currentPolygon.xmin = Math.min(x0, x1); @@ -181,7 +193,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) { 'h4v' + (2 * MINSELECT) + 'h-4Z'); } - else if(dx < Math.min(dy * 0.6, MINSELECT)) { + else if(direction === 'v') { // vertical motion: make a horizontal box currentPolygon = [[0, y0], [0, y1], [pw, y1], [pw, y0]]; currentPolygon.xmin = Math.min(0, pw); @@ -193,7 +205,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) { 'M' + (x0 - MINSELECT) + ',' + (currentPolygon.ymax - 1) + 'v4h' + (2 * MINSELECT) + 'v-4Z'); } - else { + else if(direction === 'd') { // diagonal motion currentPolygon = [[x0, y0], [x0, y1], [x1, y1], [x1, y0]]; currentPolygon.xmin = Math.min(x0, x1); From 5cfc4747c8acc6e133418d4b6e32b78b0ca4b3c9 Mon Sep 17 00:00:00 2001 From: Glenn Matthys Date: Thu, 29 Mar 2018 11:05:35 +0200 Subject: [PATCH 3/9] Image mocks for selectdirection --- test/image/mocks/limit_select_any.json | 15 +++++++++++++++ test/image/mocks/limit_select_d.json | 15 +++++++++++++++ test/image/mocks/limit_select_h.json | 15 +++++++++++++++ test/image/mocks/limit_select_v.json | 15 +++++++++++++++ 4 files changed, 60 insertions(+) create mode 100644 test/image/mocks/limit_select_any.json create mode 100644 test/image/mocks/limit_select_d.json create mode 100644 test/image/mocks/limit_select_h.json create mode 100644 test/image/mocks/limit_select_v.json diff --git a/test/image/mocks/limit_select_any.json b/test/image/mocks/limit_select_any.json new file mode 100644 index 00000000000..08bc11b8b97 --- /dev/null +++ b/test/image/mocks/limit_select_any.json @@ -0,0 +1,15 @@ +{ + "data": [ + { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram" }, + { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar" }, + { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar", "yaxis":"y2" }, + { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram", "yaxis":"y2" } + ], + "layout": { + "yaxis": { "domain": [0,0.49] }, + "yaxis2": { "domain": [0.51, 1] }, + "showlegend": false, + "dragmode": "select", + "selectdirection": "any" + } +} diff --git a/test/image/mocks/limit_select_d.json b/test/image/mocks/limit_select_d.json new file mode 100644 index 00000000000..5dfb81d9cf8 --- /dev/null +++ b/test/image/mocks/limit_select_d.json @@ -0,0 +1,15 @@ +{ + "data": [ + { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram" }, + { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar" }, + { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar", "yaxis":"y2" }, + { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram", "yaxis":"y2" } + ], + "layout": { + "yaxis": { "domain": [0,0.49] }, + "yaxis2": { "domain": [0.51, 1] }, + "showlegend": false, + "dragmode": "select", + "selectdirection": "d" + } +} diff --git a/test/image/mocks/limit_select_h.json b/test/image/mocks/limit_select_h.json new file mode 100644 index 00000000000..00f6f83e5f4 --- /dev/null +++ b/test/image/mocks/limit_select_h.json @@ -0,0 +1,15 @@ +{ + "data": [ + { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram" }, + { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar" }, + { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar", "yaxis":"y2" }, + { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram", "yaxis":"y2" } + ], + "layout": { + "yaxis": { "domain": [0,0.49] }, + "yaxis2": { "domain": [0.51, 1] }, + "showlegend": false, + "dragmode": "select", + "selectdirection": "h" + } +} diff --git a/test/image/mocks/limit_select_v.json b/test/image/mocks/limit_select_v.json new file mode 100644 index 00000000000..d6ab91358bc --- /dev/null +++ b/test/image/mocks/limit_select_v.json @@ -0,0 +1,15 @@ +{ + "data": [ + { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram" }, + { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar" }, + { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar", "yaxis":"y2" }, + { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram", "yaxis":"y2" } + ], + "layout": { + "yaxis": { "domain": [0,0.49] }, + "yaxis2": { "domain": [0.51, 1] }, + "showlegend": false, + "dragmode": "select", + "selectdirection": "v" + } +} From b782c88b668bcfea27ad476d35fa713143e21bbf Mon Sep 17 00:00:00 2001 From: Glenn Matthys Date: Fri, 30 Mar 2018 10:28:57 +0200 Subject: [PATCH 4/9] Remove redundant default --- src/components/fx/layout_defaults.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/fx/layout_defaults.js b/src/components/fx/layout_defaults.js index 49e23774749..252ef3b01c6 100644 --- a/src/components/fx/layout_defaults.js +++ b/src/components/fx/layout_defaults.js @@ -17,7 +17,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { } coerce('dragmode'); - coerce('selectdirection', 'any'); + coerce('selectdirection'); var hovermodeDflt; if(layoutOut._has('cartesian')) { From 2112759bee5780695f38cb91aade43a103659298 Mon Sep 17 00:00:00 2001 From: Glenn Matthys Date: Fri, 30 Mar 2018 10:31:10 +0200 Subject: [PATCH 5/9] Remove unnecessary test cases --- test/image/mocks/limit_select_any.json | 15 --------------- test/image/mocks/limit_select_d.json | 15 --------------- test/image/mocks/limit_select_h.json | 15 --------------- test/image/mocks/limit_select_v.json | 15 --------------- 4 files changed, 60 deletions(-) delete mode 100644 test/image/mocks/limit_select_any.json delete mode 100644 test/image/mocks/limit_select_d.json delete mode 100644 test/image/mocks/limit_select_h.json delete mode 100644 test/image/mocks/limit_select_v.json diff --git a/test/image/mocks/limit_select_any.json b/test/image/mocks/limit_select_any.json deleted file mode 100644 index 08bc11b8b97..00000000000 --- a/test/image/mocks/limit_select_any.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": [ - { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram" }, - { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar" }, - { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar", "yaxis":"y2" }, - { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram", "yaxis":"y2" } - ], - "layout": { - "yaxis": { "domain": [0,0.49] }, - "yaxis2": { "domain": [0.51, 1] }, - "showlegend": false, - "dragmode": "select", - "selectdirection": "any" - } -} diff --git a/test/image/mocks/limit_select_d.json b/test/image/mocks/limit_select_d.json deleted file mode 100644 index 5dfb81d9cf8..00000000000 --- a/test/image/mocks/limit_select_d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": [ - { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram" }, - { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar" }, - { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar", "yaxis":"y2" }, - { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram", "yaxis":"y2" } - ], - "layout": { - "yaxis": { "domain": [0,0.49] }, - "yaxis2": { "domain": [0.51, 1] }, - "showlegend": false, - "dragmode": "select", - "selectdirection": "d" - } -} diff --git a/test/image/mocks/limit_select_h.json b/test/image/mocks/limit_select_h.json deleted file mode 100644 index 00f6f83e5f4..00000000000 --- a/test/image/mocks/limit_select_h.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": [ - { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram" }, - { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar" }, - { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar", "yaxis":"y2" }, - { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram", "yaxis":"y2" } - ], - "layout": { - "yaxis": { "domain": [0,0.49] }, - "yaxis2": { "domain": [0.51, 1] }, - "showlegend": false, - "dragmode": "select", - "selectdirection": "h" - } -} diff --git a/test/image/mocks/limit_select_v.json b/test/image/mocks/limit_select_v.json deleted file mode 100644 index d6ab91358bc..00000000000 --- a/test/image/mocks/limit_select_v.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": [ - { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram" }, - { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar" }, - { "x": [1,2,3], "y":[-1,-2,-3], "type": "bar", "yaxis":"y2" }, - { "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram", "yaxis":"y2" } - ], - "layout": { - "yaxis": { "domain": [0,0.49] }, - "yaxis2": { "domain": [0.51, 1] }, - "showlegend": false, - "dragmode": "select", - "selectdirection": "v" - } -} From c49d829dd4b9fa5ead634039dbe9217b1647b4c2 Mon Sep 17 00:00:00 2001 From: Glenn Matthys Date: Thu, 5 Apr 2018 16:40:12 +0200 Subject: [PATCH 6/9] Add initial test case --- test/jasmine/tests/select_test.js | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/test/jasmine/tests/select_test.js b/test/jasmine/tests/select_test.js index 644a7d6a4c6..829f3d576c0 100644 --- a/test/jasmine/tests/select_test.js +++ b/test/jasmine/tests/select_test.js @@ -552,6 +552,54 @@ describe('@flaky Test select box and lasso in general:', function() { .catch(fail) .then(done); }); + + it('should select the right data with the corresponding select direction', function(done) { + + var gd = createGraphDiv(); + + var selectPath = [[170 - 68, 100 - 96], [255 - 68, 160 - 96]]; + + Plotly.newPlot(gd, [ + {x: [1, 1, 1, 1, 1, 2, 2, 2, 3, 3], type: 'histogram'}, + {x: [1, 2, 3], y: [-1, -2, -3], type: 'bar'} + ], { + width: 400, + height: 300, + showlegend: false, + dragmode: 'select' + }) + .then(function() { + + // expect(gd.fullLayout.selectdirection).toBe('any'); + + resetEvents(gd); + + drag(selectPath); + + selectedPromise.then(function() { + expect(selectedData.points.length).toBe(1); + expect(selectedData.points[0].x).toBe(1.8); + expect(selectedData.points[0].y).toBe(3); + }); + + // do a drag and check that the selection is correct for the default `selectdirection` + + return Plotly.relayout(gd, {selectdirection: 'h'}); + }) + .then(function() { + // do probably the SAME drag and check that the selection is correct for the `selectdirection='h'` + + return Plotly.relayout(gd, {selectdirection: 'v'}); + }) + .then(function() { + // ... + }) + .catch(fail) // hmm, we should change the name of this import to failTest, since fail is already a jasmine global, for sync failure, we're overriding it here with our async version (we've already done this in other places) + .then(done); + + + }); + }); describe('@flaky Test select box and lasso per trace:', function() { From 69c3157dce84e5a4e45c98b603b096d5a6fa2157 Mon Sep 17 00:00:00 2001 From: Glenn Matthys Date: Fri, 6 Apr 2018 12:52:50 +0200 Subject: [PATCH 7/9] Add tests for h, v and d select directions & cleanup --- test/jasmine/tests/select_test.js | 39 ++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/test/jasmine/tests/select_test.js b/test/jasmine/tests/select_test.js index 829f3d576c0..40c6dd7605a 100644 --- a/test/jasmine/tests/select_test.js +++ b/test/jasmine/tests/select_test.js @@ -569,11 +569,8 @@ describe('@flaky Test select box and lasso in general:', function() { dragmode: 'select' }) .then(function() { - // expect(gd.fullLayout.selectdirection).toBe('any'); - resetEvents(gd); - drag(selectPath); selectedPromise.then(function() { @@ -582,22 +579,48 @@ describe('@flaky Test select box and lasso in general:', function() { expect(selectedData.points[0].y).toBe(3); }); - // do a drag and check that the selection is correct for the default `selectdirection` - return Plotly.relayout(gd, {selectdirection: 'h'}); }) .then(function() { - // do probably the SAME drag and check that the selection is correct for the `selectdirection='h'` + resetEvents(gd); + drag(selectPath); + + selectedPromise.then(function() + { + expect(selectedData.points.length).toBe(2); + expect(selectedData.points[0].x).toBe(1.8); + expect(selectedData.points[1].x).toBe(2.2); + }); return Plotly.relayout(gd, {selectdirection: 'v'}); }) .then(function() { - // ... + resetEvents(gd); + drag(selectPath); + + selectedPromise.then(function() + { + expect(selectedData.points.length).toBe(2); + expect(selectedData.points[0].x).toBe(1.8); + expect(selectedData.points[1].x).toBe(2.8000000000000003); + }); + + return Plotly.relayout(gd, {selectdirection: 'd'}); + }) + .then(function() { + resetEvents(gd); + drag(selectPath); + + selectedPromise.then(function() + { + expect(selectedData.points.length).toBe(2); + expect(selectedData.points[0].x).toBe(1.8); + expect(selectedData.points[1].x).toBe(2.2); + }); }) .catch(fail) // hmm, we should change the name of this import to failTest, since fail is already a jasmine global, for sync failure, we're overriding it here with our async version (we've already done this in other places) .then(done); - }); }); From 6d4a4f82fad6e3ca427dafa5781bd21e3cd015b9 Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Tue, 17 Apr 2018 13:14:35 -0400 Subject: [PATCH 8/9] edit selectdirection test - flatten the promise chain - simplify the test plot so I can better understand what *should* happen --- test/jasmine/tests/select_test.js | 106 ++++++++++++++---------------- 1 file changed, 49 insertions(+), 57 deletions(-) diff --git a/test/jasmine/tests/select_test.js b/test/jasmine/tests/select_test.js index c460c9f0748..81931219d6d 100644 --- a/test/jasmine/tests/select_test.js +++ b/test/jasmine/tests/select_test.js @@ -557,69 +557,61 @@ describe('@flaky Test select box and lasso in general:', function() { var gd = createGraphDiv(); - var selectPath = [[170 - 68, 100 - 96], [255 - 68, 160 - 96]]; + // drag around just the center point, but if we have a selectdirection we may + // get either the ones to the left and right or above and below + var selectPath = [[175, 175], [225, 225]]; - Plotly.newPlot(gd, [ - {x: [1, 1, 1, 1, 1, 2, 2, 2, 3, 3], type: 'histogram'}, - {x: [1, 2, 3], y: [-1, -2, -3], type: 'bar'} - ], { + function selectDrag() { + resetEvents(gd); + drag(selectPath); + return selectedPromise; + } + + function assertSelectedPointNumbers(pointNumbers) { + var pts = selectedData.points; + expect(pts.length).toBe(pointNumbers.length); + pointNumbers.forEach(function(pointNumber, i) { + expect(pts[i].pointNumber).toBe(pointNumber); + }); + } + + Plotly.newPlot(gd, [{ + x: [1, 1, 1, 2, 2, 2, 3, 3, 3], + y: [1, 2, 3, 1, 2, 3, 1, 2, 3], + mode: 'markers' + }], { width: 400, - height: 300, - showlegend: false, - dragmode: 'select' + height: 400, + dragmode: 'select', + margin: {l: 100, r: 100, t: 100, b: 100}, + xaxis: {range: [0, 4]}, + yaxis: {range: [0, 4]} }) - .then(function() { - // expect(gd.fullLayout.selectdirection).toBe('any'); - resetEvents(gd); - drag(selectPath); - - selectedPromise.then(function() { - expect(selectedData.points.length).toBe(1); - expect(selectedData.points[0].x).toBe(1.8); - expect(selectedData.points[0].y).toBe(3); - }); + .then(selectDrag) + .then(function() { + expect(gd._fullLayout.selectdirection).toBe('any'); + assertSelectedPointNumbers([4]); - return Plotly.relayout(gd, {selectdirection: 'h'}); - }) - .then(function() { - resetEvents(gd); - drag(selectPath); - - selectedPromise.then(function() - { - expect(selectedData.points.length).toBe(2); - expect(selectedData.points[0].x).toBe(1.8); - expect(selectedData.points[1].x).toBe(2.2); - }); + return Plotly.relayout(gd, {selectdirection: 'h'}); + }) + .then(selectDrag) + .then(function() { + assertSelectedPointNumbers([3, 4, 5]); - return Plotly.relayout(gd, {selectdirection: 'v'}); - }) - .then(function() { - resetEvents(gd); - drag(selectPath); - - selectedPromise.then(function() - { - expect(selectedData.points.length).toBe(2); - expect(selectedData.points[0].x).toBe(1.8); - expect(selectedData.points[1].x).toBe(2.8000000000000003); - }); + return Plotly.relayout(gd, {selectdirection: 'v'}); + }) + .then(selectDrag) + .then(function() { + assertSelectedPointNumbers([1, 4, 7]); - return Plotly.relayout(gd, {selectdirection: 'd'}); - }) - .then(function() { - resetEvents(gd); - drag(selectPath); - - selectedPromise.then(function() - { - expect(selectedData.points.length).toBe(2); - expect(selectedData.points[0].x).toBe(1.8); - expect(selectedData.points[1].x).toBe(2.2); - }); - }) - .catch(fail) // hmm, we should change the name of this import to failTest, since fail is already a jasmine global, for sync failure, we're overriding it here with our async version (we've already done this in other places) - .then(done); + return Plotly.relayout(gd, {selectdirection: 'd'}); + }) + .then(selectDrag) + .then(function() { + assertSelectedPointNumbers([4]); + }) + .catch(failTest) + .then(done); }); From 9dd166c69bd654bd0a70dac6d2f0cb4f3d6c7235 Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Tue, 17 Apr 2018 13:43:28 -0400 Subject: [PATCH 9/9] selectdirection PR review edits --- src/components/fx/layout_defaults.js | 4 ++-- src/plots/cartesian/select.js | 3 +-- test/jasmine/tests/shapes_test.js | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/fx/layout_defaults.js b/src/components/fx/layout_defaults.js index 252ef3b01c6..742c6eb1621 100644 --- a/src/components/fx/layout_defaults.js +++ b/src/components/fx/layout_defaults.js @@ -16,8 +16,8 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt); } - coerce('dragmode'); - coerce('selectdirection'); + var dragMode = coerce('dragmode'); + if(dragMode === 'select') coerce('selectdirection'); var hovermodeDflt; if(layoutOut._has('cartesian')) { diff --git a/src/plots/cartesian/select.js b/src/plots/cartesian/select.js index ba80c461e5a..5dd418441f8 100644 --- a/src/plots/cartesian/select.js +++ b/src/plots/cartesian/select.js @@ -192,8 +192,6 @@ function prepSelect(e, startX, startY, dragOptions, mode) { } } - var direction = fullLayout.selectdirection; - dragOptions.moveFn = function(dx0, dy0) { x1 = Math.max(0, Math.min(pw, dx0 + x0)); y1 = Math.max(0, Math.min(ph, dy0 + y0)); @@ -202,6 +200,7 @@ function prepSelect(e, startX, startY, dragOptions, mode) { dy = Math.abs(y1 - y0); if(mode === 'select') { + var direction = fullLayout.selectdirection; if(fullLayout.selectdirection === 'any') { if(dy < Math.min(dx * 0.6, MINSELECT)) direction = 'h'; diff --git a/test/jasmine/tests/shapes_test.js b/test/jasmine/tests/shapes_test.js index c5c9b5e77b6..7463db6f01d 100644 --- a/test/jasmine/tests/shapes_test.js +++ b/test/jasmine/tests/shapes_test.js @@ -1026,7 +1026,7 @@ describe('A fixed size shape', function() { var shapeAndResizeTypes = combinations(shapeTypes, resizeTypes); shapeAndResizeTypes.forEach(function(testCase) { - describe('of type ' + testCase.type + ' can be ' + testCase.resizeDisplayName, function() { + describe('@flaky of type ' + testCase.type + ' can be ' + testCase.resizeDisplayName, function() { resizeDirections.forEach(function(direction) { it('over direction ' + direction, function(done) { layout.shapes[0].type = testCase.type;