@@ -834,7 +834,7 @@ describe('A fixed size path shape', function() {
834
834
it ( 'is draggable' , function ( done ) {
835
835
Plotly . plot ( gd , data , layout , { editable : true } )
836
836
. then ( function ( ) {
837
- drag ( getFirstShapeNode ( ) , 50 , 50 ) . then ( function ( ) {
837
+ drag ( { node : getFirstShapeNode ( ) , dpos : [ 50 , 50 ] } ) . then ( function ( ) {
838
838
assertShapeSize ( getFirstShapeNode ( ) , 30 , 20 ) ;
839
839
done ( ) ;
840
840
} ) ;
@@ -852,7 +852,7 @@ describe('A fixed size path shape', function() {
852
852
var shapeNodeBeforeDrag = getFirstShapeNode ( ) ;
853
853
var widthBeforeDrag = shapeNodeBeforeDrag . getBoundingClientRect ( ) . width ;
854
854
855
- drag ( shapeNodeBeforeDrag , 300 , 50 ) . then ( function ( ) {
855
+ drag ( { node : shapeNodeBeforeDrag , dpos : [ 300 , 50 ] } ) . then ( function ( ) {
856
856
var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
857
857
var bbox = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
858
858
expect ( bbox . height ) . toBe ( 20 ) ;
@@ -874,7 +874,7 @@ describe('A fixed size path shape', function() {
874
874
var shapeNodeBeforeDrag = getFirstShapeNode ( ) ;
875
875
var heightBeforeDrag = shapeNodeBeforeDrag . getBoundingClientRect ( ) . height ;
876
876
877
- drag ( shapeNodeBeforeDrag , 50 , 300 ) . then ( function ( ) {
877
+ drag ( { node : shapeNodeBeforeDrag , dpos : [ 50 , 300 ] } ) . then ( function ( ) {
878
878
var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
879
879
var bbox = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
880
880
expect ( bbox . width ) . toBe ( 30 ) ;
@@ -1006,7 +1006,7 @@ describe('A fixed size shape', function() {
1006
1006
it ( 'is draggable' , function ( done ) {
1007
1007
Plotly . plot ( gd , data , layout , { editable : true } )
1008
1008
. then ( function ( ) {
1009
- drag ( getFirstShapeNode ( ) , 50 , 50 ) . then ( function ( ) {
1009
+ drag ( { node : getFirstShapeNode ( ) , dpos : [ 50 , 50 ] } ) . then ( function ( ) {
1010
1010
assertShapeSize ( getFirstShapeNode ( ) , 25 , 25 ) ;
1011
1011
done ( ) ;
1012
1012
} ) ;
@@ -1025,7 +1025,7 @@ describe('A fixed size shape', function() {
1025
1025
var shapeNodeBeforeDrag = getFirstShapeNode ( ) ;
1026
1026
var widthBeforeDrag = shapeNodeBeforeDrag . getBoundingClientRect ( ) . width ;
1027
1027
1028
- drag ( shapeNodeBeforeDrag , 300 , 50 ) . then ( function ( ) {
1028
+ drag ( { node : shapeNodeBeforeDrag , dpos : [ 300 , 50 ] } ) . then ( function ( ) {
1029
1029
var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
1030
1030
var bbox = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
1031
1031
expect ( bbox . height ) . toBe ( 25 ) ;
@@ -1048,7 +1048,7 @@ describe('A fixed size shape', function() {
1048
1048
var shapeNodeBeforeDrag = getFirstShapeNode ( ) ;
1049
1049
var heightBeforeDrag = shapeNodeBeforeDrag . getBoundingClientRect ( ) . height ;
1050
1050
1051
- drag ( shapeNodeBeforeDrag , 50 , 300 ) . then ( function ( ) {
1051
+ drag ( { node : shapeNodeBeforeDrag , dpos : [ 50 , 300 ] } ) . then ( function ( ) {
1052
1052
var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
1053
1053
var bbox = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
1054
1054
expect ( bbox . width ) . toBe ( 25 ) ;
@@ -1088,7 +1088,7 @@ describe('A fixed size shape', function() {
1088
1088
var dx = shallShrink ? dxToShrinkWidth [ direction ] : dxToEnlargeWidth [ direction ] ;
1089
1089
var dy = shallShrink ? dyToShrinkHeight [ direction ] : dyToEnlargeHeight [ direction ] ;
1090
1090
1091
- drag ( shapeNodeBeforeDrag , dx , dy , direction )
1091
+ drag ( { node : shapeNodeBeforeDrag , dpos : [ dx , dy ] , edge : direction } )
1092
1092
. then ( function ( ) {
1093
1093
var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
1094
1094
var bBoxAfterDrag = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
@@ -1117,7 +1117,7 @@ describe('A fixed size shape', function() {
1117
1117
var bBoxBeforeDrag = shapeNodeBeforeDrag . getBoundingClientRect ( ) ;
1118
1118
1119
1119
var dragSensitiveElement = getMoveLineDragElement ( 0 ) ;
1120
- drag ( dragSensitiveElement , 10 , - 10 )
1120
+ drag ( { node : dragSensitiveElement , dpos : [ 10 , - 10 ] } )
1121
1121
. then ( function ( ) {
1122
1122
var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
1123
1123
var bBoxAfterDrag = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
@@ -1138,7 +1138,7 @@ describe('A fixed size shape', function() {
1138
1138
var bBoxBeforeDrag = shapeNodeBeforeDrag . getBoundingClientRect ( ) ;
1139
1139
1140
1140
var dragSensitiveElement = getResizeLineOverStartPointElement ( ) ;
1141
- drag ( dragSensitiveElement , 50 , - 10 )
1141
+ drag ( { node : dragSensitiveElement , dpos : [ 50 , - 10 ] } )
1142
1142
. then ( function ( ) {
1143
1143
var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
1144
1144
var bBoxAfterDrag = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
@@ -1161,7 +1161,7 @@ describe('A fixed size shape', function() {
1161
1161
var bBoxBeforeDrag = shapeNodeBeforeDrag . getBoundingClientRect ( ) ;
1162
1162
1163
1163
var dragSensitiveElement = getResizeLineOverEndPointElement ( ) ;
1164
- drag ( dragSensitiveElement , 50 , - 10 )
1164
+ drag ( { node : dragSensitiveElement , dpos : [ 50 , - 10 ] } )
1165
1165
. then ( function ( ) {
1166
1166
var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
1167
1167
var bBoxAfterDrag = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
@@ -1464,7 +1464,7 @@ describe('Test shapes', function() {
1464
1464
1465
1465
var initialCoordinates = getShapeCoordinates ( layoutShape , x2p , y2p ) ;
1466
1466
1467
- return drag ( node , dx , dy ) . then ( function ( ) {
1467
+ return drag ( { node : node , dpos : [ dx , dy ] } ) . then ( function ( ) {
1468
1468
var finalCoordinates = getShapeCoordinates ( layoutShape , x2p , y2p ) ;
1469
1469
1470
1470
expect ( finalCoordinates . x0 - initialCoordinates . x0 ) . toBeCloseTo ( dx ) ;
@@ -1494,7 +1494,7 @@ describe('Test shapes', function() {
1494
1494
1495
1495
expect ( initialCoordinates . length ) . toBe ( 6 ) ;
1496
1496
1497
- return drag ( node , dx , dy ) . then ( function ( ) {
1497
+ return drag ( { node : node , dpos : [ dx , dy ] } ) . then ( function ( ) {
1498
1498
var finalPath = layoutShape . path ;
1499
1499
var finalCoordinates = getPathCoordinates ( finalPath , x2p , y2p ) ;
1500
1500
@@ -1523,7 +1523,7 @@ describe('Test shapes', function() {
1523
1523
1524
1524
var initialCoordinates = getShapeCoordinates ( layoutShape , x2p , y2p ) ;
1525
1525
1526
- return drag ( node , dx , dy , direction ) . then ( function ( ) {
1526
+ return drag ( { node : node , dpos : [ dx , dy ] , edge : direction } ) . then ( function ( ) {
1527
1527
var finalCoordinates = getShapeCoordinates ( layoutShape , x2p , y2p ) ;
1528
1528
1529
1529
var keyN , keyS , keyW , keyE ;
@@ -1572,7 +1572,7 @@ describe('Test shapes', function() {
1572
1572
getResizeLineOverEndPointElement ( ) ;
1573
1573
1574
1574
var initialCoordinates = getShapeCoordinates ( layoutShape , x2p , y2p ) ;
1575
- return drag ( dragHandle , 10 , 10 ) . then ( function ( ) {
1575
+ return drag ( { node : dragHandle , dpos : [ 10 , 10 ] } ) . then ( function ( ) {
1576
1576
var finalCoordinates = getShapeCoordinates ( layoutShape , x2p , y2p ) ;
1577
1577
1578
1578
if ( pointToMove === 'start' ) {
0 commit comments