@@ -52,15 +52,9 @@ describe('calculated data and points', function() {
52
52
Plotly . plot ( gd , [ { x : [ 'c' , 'a' , 'e' , 'b' , 'd' ] , y : [ 15 , 11 , 12 , 13 , 14 ] } ] , { xaxis : {
53
53
type : 'category' ,
54
54
categorymode : 'trace'
55
- // Wouldn't it be preferred to supply a function and plotly would have several functions like this?
56
- // E.g. it's easier for symbol completion (whereas there's no symbol completion on string config)
57
- // See arguments from Mike Bostock, highlighted in medium green here:
58
- // https://medium.com/@mbostock /what-makes-software-good-943557f8a488#eef9
59
- // Plus if it's a function, then users can roll their own.
60
- //
61
55
// Also, if axis tick order is made configurable, shouldn't we make trace order configurable?
62
56
// Trace order as in, if a line or curve is drawn through points, what's the trace sequence.
63
- // These are two orthogonal concepts. In this round, I'm assuming that the trace order is implied
57
+ // These are two orthogonal concepts. Currently, the trace order is implied
64
58
// by the order the {x,y} arrays are specified.
65
59
} } ) ;
66
60
@@ -214,11 +208,14 @@ describe('calculated data and points', function() {
214
208
categorylist : [ 'y' , 'b' , 'x' , 'a' , 'd' , 'z' , 'e' , 'c' ]
215
209
} } ) ;
216
210
217
- expect ( gd . calcdata [ 0 ] [ 0 ] . y ) . toEqual ( 13 ) ;
218
- expect ( gd . calcdata [ 0 ] [ 1 ] . y ) . toEqual ( 11 ) ;
219
- expect ( gd . calcdata [ 0 ] [ 2 ] . y ) . toEqual ( 14 ) ;
220
- expect ( gd . calcdata [ 0 ] [ 3 ] . y ) . toEqual ( 12 ) ;
221
- expect ( gd . calcdata [ 0 ] [ 4 ] . y ) . toEqual ( 15 ) ;
211
+ expect ( gd . calcdata [ 0 ] [ 0 ] . y ) . toEqual ( null ) ;
212
+ expect ( gd . calcdata [ 0 ] [ 1 ] . y ) . toEqual ( 13 ) ;
213
+ expect ( gd . calcdata [ 0 ] [ 2 ] . y ) . toEqual ( null ) ;
214
+ expect ( gd . calcdata [ 0 ] [ 3 ] . y ) . toEqual ( 11 ) ;
215
+ expect ( gd . calcdata [ 0 ] [ 4 ] . y ) . toEqual ( 14 ) ;
216
+ expect ( gd . calcdata [ 0 ] [ 5 ] . y ) . toEqual ( null ) ;
217
+ expect ( gd . calcdata [ 0 ] [ 6 ] . y ) . toEqual ( 12 ) ;
218
+ expect ( gd . calcdata [ 0 ] [ 7 ] . y ) . toEqual ( 15 ) ;
222
219
} ) ;
223
220
224
221
it ( 'should output categories in explicitly supplied order first, if not all categories are covered' , function ( ) {
@@ -231,7 +228,8 @@ describe('calculated data and points', function() {
231
228
232
229
expect ( gd . calcdata [ 0 ] [ 0 ] . y ) . toEqual ( 13 ) ;
233
230
expect ( gd . calcdata [ 0 ] [ 1 ] . y ) . toEqual ( 11 ) ;
234
- expect ( gd . calcdata [ 0 ] [ 2 ] . y ) . toEqual ( 15 ) ;
231
+ expect ( gd . calcdata [ 0 ] [ 2 ] . y ) . toEqual ( null ) ;
232
+ expect ( gd . calcdata [ 0 ] [ 3 ] . y ) . toEqual ( 15 ) ;
235
233
236
234
// The order of the rest is unspecified, no need to check. Alternative: make _both_ categorymode and
237
235
// categories effective; categories would take precedence and the remaining items would be sorted
0 commit comments