@@ -62,7 +62,7 @@ describe('filter transforms defaults:', function() {
62
62
traceIn = {
63
63
x : [ 1 , 2 , 3 ] ,
64
64
transforms : [ {
65
- type : 'filter' ,
65
+ type : 'filter'
66
66
} , {
67
67
type : 'filter' ,
68
68
target : 0
@@ -143,6 +143,7 @@ describe('filter transforms calc:', function() {
143
143
expect ( out [ 0 ] . x ) . toEqual ( [ 0 , 1 ] ) ;
144
144
expect ( out [ 0 ] . y ) . toEqual ( [ 1 , 2 ] ) ;
145
145
expect ( out [ 0 ] . z ) . toEqual ( [ '2016-10-21' , '2016-12-02' ] ) ;
146
+ expect ( out [ 0 ] . transforms [ 0 ] . indexToPoints ) . toEqual ( { 0 : [ 3 ] , 1 :[ 4 ] } ) ;
146
147
} ) ;
147
148
148
149
it ( 'should use the calendar from the target attribute if target is a string' , function ( ) {
@@ -261,13 +262,14 @@ describe('filter transforms calc:', function() {
261
262
expect ( out [ 0 ] . x ) . toEqual ( [ - 2 , 2 , 3 ] ) ;
262
263
expect ( out [ 0 ] . y ) . toEqual ( [ 3 , 3 , 1 ] ) ;
263
264
expect ( out [ 0 ] . marker . color ) . toEqual ( [ 0.3 , 0.3 , 0.4 ] ) ;
265
+ expect ( out [ 0 ] . transforms [ 0 ] . indexToPoints ) . toEqual ( { 0 : [ 2 ] , 1 :[ 5 ] , 2 : [ 6 ] } ) ;
264
266
} ) ;
265
267
266
268
it ( 'filters should handle array on base trace attributes' , function ( ) {
267
269
var out = _transform ( [ Lib . extendDeep ( { } , base , {
268
270
hoverinfo : [ 'x' , 'y' , 'text' , 'name' , 'none' , 'skip' , 'all' ] ,
269
271
hoverlabel : {
270
- bgcolor : [ 'red' , 'green' , 'blue' , 'black' , 'yellow' , 'cyan' , 'pink' ] ,
272
+ bgcolor : [ 'red' , 'green' , 'blue' , 'black' , 'yellow' , 'cyan' , 'pink' ]
271
273
} ,
272
274
transforms : [ {
273
275
type : 'filter' ,
@@ -314,6 +316,8 @@ describe('filter transforms calc:', function() {
314
316
315
317
expect ( out [ 0 ] . x ) . toEqual ( [ 1 , 2 ] ) ;
316
318
expect ( out [ 0 ] . y ) . toEqual ( [ 2 , 3 ] ) ;
319
+ expect ( out [ 0 ] . transforms [ 0 ] . indexToPoints ) . toEqual ( { 0 : [ 4 ] , 1 :[ 5 ] , 2 : [ 6 ] } ) ;
320
+ expect ( out [ 0 ] . transforms [ 1 ] . indexToPoints ) . toEqual ( { 0 : [ 4 ] , 1 :[ 5 ] } ) ;
317
321
} ) ;
318
322
319
323
it ( 'filters should chain as AND (case 2)' , function ( ) {
@@ -339,6 +343,8 @@ describe('filter transforms calc:', function() {
339
343
340
344
expect ( out [ 0 ] . x ) . toEqual ( [ 3 ] ) ;
341
345
expect ( out [ 0 ] . y ) . toEqual ( [ 1 ] ) ;
346
+ expect ( out [ 0 ] . transforms [ 0 ] . indexToPoints ) . toEqual ( { 0 : [ 4 ] , 1 :[ 5 ] , 2 : [ 6 ] } ) ;
347
+ expect ( out [ 0 ] . transforms [ 2 ] . indexToPoints ) . toEqual ( { 0 : [ 6 ] } ) ;
342
348
} ) ;
343
349
344
350
it ( 'should preserve gaps in data when `preservegaps` is turned on' , function ( ) {
0 commit comments