File tree 2 files changed +12
-12
lines changed
2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ module.exports = function calc(gd, trace) {
118
118
119
119
var getArray = function ( c ) { return c === 'x' ? x : c === 'y' ? y : z ; } ;
120
120
var getVals = function ( c ) { return c === 'x' ? Xs : c === 'y' ? Ys : Zs ; } ;
121
- var getDir = function ( c ) { return ( + ( c [ len - 1 ] - c [ 0 ] ) ) * 2 + 1 ; } ;
121
+ var getDir = function ( c ) { return ( c [ len - 1 ] < c [ 0 ] ) ? - 1 : 1 ; } ;
122
122
123
123
var arrK = getArray ( gridFill [ 1 ] ) ;
124
124
var arrJ = getArray ( gridFill [ 3 ] ) ;
Original file line number Diff line number Diff line change @@ -305,17 +305,13 @@ describe('Test streamtube interactions', function() {
305
305
var v = [ ] ;
306
306
var w = [ ] ;
307
307
308
- for ( var i = 0 ; i < 3 ; i ++ ) {
309
- for ( var j = i ; j < 4 ; j ++ ) {
310
- for ( var k = j ; k < 5 ; k ++ ) {
311
- x . push ( i ) ;
312
- y . push ( j ) ;
313
- z . push ( k ) ;
314
- u . push ( 1 ) ;
315
- v . push ( 1 ) ;
316
- w . push ( 1 ) ;
317
- }
318
- }
308
+ for ( var n = 0 ; n < 1000 ; n ++ ) {
309
+ x . push ( ( 10 * Math . random ( ) ) | 0 ) ;
310
+ y . push ( ( 10 * Math . random ( ) ) | 0 ) ;
311
+ z . push ( ( 10 * Math . random ( ) ) | 0 ) ;
312
+ u . push ( 1 ) ;
313
+ v . push ( 1 ) ;
314
+ w . push ( 1 ) ;
319
315
}
320
316
321
317
var fig = {
@@ -338,11 +334,15 @@ describe('Test streamtube interactions', function() {
338
334
expect ( exp . cellsLength ) . toBe ( objs [ 0 ] . cells . length , 'cells length - ' + msg ) ;
339
335
}
340
336
337
+ spyOn ( Lib , 'warn' ) ;
338
+
341
339
Plotly . plot ( gd , fig ) . then ( function ( ) {
342
340
_assert ( 'arbitrary coordinates' , {
343
341
positionsLength : 0 ,
344
342
cellsLength : 0
345
343
} ) ;
344
+ } ) . then ( function ( ) {
345
+ expect ( Lib . warn ) . toHaveBeenCalledWith ( 'Encountered arbitrary coordinates! Unable to input data grid.' ) ;
346
346
} )
347
347
. catch ( failTest )
348
348
. then ( done ) ;
You can’t perform that action at this time.
0 commit comments