@@ -239,18 +239,18 @@ describe('Test histogram', function() {
239
239
barModes . forEach ( function ( mode ) {
240
240
gd = {
241
241
data : [
242
- { type : 'histogram' , y : [ 1 ] } ,
243
- { type : 'histogram' , y : [ 2 ] } ,
242
+ { type : 'histogram' , y : [ 1 , 2 ] } ,
243
+ { type : 'histogram' , y : [ 2 , 3 ] } ,
244
244
245
- { type : 'histogram' , y : [ 1 ] , xaxis : 'x2' } ,
246
- { type : 'histogram' , y : [ 3 ] , xaxis : 'x2' } ,
245
+ { type : 'histogram' , y : [ 1 , 2 ] , xaxis : 'x2' } ,
246
+ { type : 'histogram' , y : [ 3 , 4 ] , xaxis : 'x2' } ,
247
247
248
- { type : 'histogram' , y : [ 3 ] } ,
249
- { type : 'histogram' , y : [ 2 ] , xaxis : 'x2' } ,
248
+ { type : 'histogram' , y : [ 3 , 4 ] } ,
249
+ { type : 'histogram' , y : [ 2 , 4 ] , xaxis : 'x2' } ,
250
250
251
- { type : 'histogram' , x : [ 1 ] } ,
252
- { uid : 'solo' , type : 'histogram' , x : [ 2 ] , yaxis : 'y2' } ,
253
- { type : 'histogram' , x : [ 2 ] }
251
+ { type : 'histogram' , x : [ 1 , 3 ] } ,
252
+ { uid : 'solo' , type : 'histogram' , x : [ 2 , 2 ] , yaxis : 'y2' } ,
253
+ { type : 'histogram' , x : [ 2 , 3 ] }
254
254
] ,
255
255
layout : { barmode : mode }
256
256
} ;
@@ -270,10 +270,10 @@ describe('Test histogram', function() {
270
270
barModes . forEach ( function ( mode ) {
271
271
gd = {
272
272
data : [
273
- { type : 'histogram' , y : [ 1 ] } ,
274
- { type : 'histogram' , y : [ 2 ] , xaxis : 'x2' } ,
275
- { type : 'histogram' , x : [ 1 ] , yaxis : 'y2' } ,
276
- { type : 'histogram' , x : [ 2 ] , yaxis : 'y2' } ,
273
+ { type : 'histogram' , y : [ 1 , 2 ] } ,
274
+ { type : 'histogram' , y : [ 2 , 3 ] , xaxis : 'x2' } ,
275
+ { type : 'histogram' , x : [ 1 , 2 ] , yaxis : 'y2' } ,
276
+ { type : 'histogram' , x : [ 2 , 3 ] , yaxis : 'y2' } ,
277
277
] ,
278
278
layout : {
279
279
barmode : mode ,
@@ -292,18 +292,18 @@ describe('Test histogram', function() {
292
292
it ( 'should not group traces by default under barmode:overlay ' , function ( ) {
293
293
gd = {
294
294
data : [
295
- { uid : 'a' , type : 'histogram' , y : [ 1 ] } ,
296
- { uid : 'b' , type : 'histogram' , y : [ 2 ] } ,
295
+ { uid : 'a' , type : 'histogram' , y : [ 1 , 2 ] } ,
296
+ { uid : 'b' , type : 'histogram' , y : [ 2 , 3 ] } ,
297
297
298
- { uid : 'c' , type : 'histogram' , y : [ 1 ] , xaxis : 'x2' } ,
299
- { uid : 'd' , type : 'histogram' , y : [ 3 ] , xaxis : 'x2' } ,
298
+ { uid : 'c' , type : 'histogram' , y : [ 1 , 2 ] , xaxis : 'x2' } ,
299
+ { uid : 'd' , type : 'histogram' , y : [ 3 , 4 ] , xaxis : 'x2' } ,
300
300
301
- { uid : 'e' , type : 'histogram' , y : [ 3 ] } ,
302
- { uid : 'f' , type : 'histogram' , y : [ 2 ] , xaxis : 'x2' } ,
301
+ { uid : 'e' , type : 'histogram' , y : [ 3 , 1 ] } ,
302
+ { uid : 'f' , type : 'histogram' , y : [ 2 , 1 ] , xaxis : 'x2' } ,
303
303
304
- { uid : 'g' , type : 'histogram' , x : [ 1 ] } ,
305
- { uid : 'h' , type : 'histogram' , x : [ 2 ] , yaxis : 'y2' } ,
306
- { uid : 'i' , type : 'histogram' , x : [ 2 ] }
304
+ { uid : 'g' , type : 'histogram' , x : [ 1 , 2 ] } ,
305
+ { uid : 'h' , type : 'histogram' , x : [ 2 , 3 ] , yaxis : 'y2' } ,
306
+ { uid : 'i' , type : 'histogram' , x : [ 2 , 4 ] }
307
307
] ,
308
308
layout : { barmode : 'overlay' }
309
309
} ;
@@ -318,10 +318,10 @@ describe('Test histogram', function() {
318
318
it ( 'should not group histogram2d* traces by default' , function ( ) {
319
319
gd = {
320
320
data : [
321
- { uid : 'a' , type : 'histogram2d' , x : [ 1 ] , y : [ 1 ] } ,
322
- { uid : 'b' , type : 'histogram2d' , x : [ 2 ] , y : [ 2 ] } ,
323
- { uid : 'c' , type : 'histogram2dcontour' , x : [ 1 ] , y : [ 1 ] , xaxis : 'x2' , yaxis : 'y2' } ,
324
- { uid : 'd' , type : 'histogram2dcontour' , x : [ 2 ] , y : [ 2 ] , xaxis : 'x2' , yaxis : 'y2' } ,
321
+ { uid : 'a' , type : 'histogram2d' , x : [ 1 , 2 ] , y : [ 1 , 3 ] } ,
322
+ { uid : 'b' , type : 'histogram2d' , x : [ 2 , 3 ] , y : [ 2 , 3 ] } ,
323
+ { uid : 'c' , type : 'histogram2dcontour' , x : [ 1 , 3 ] , y : [ 1 , 2 ] , xaxis : 'x2' , yaxis : 'y2' } ,
324
+ { uid : 'd' , type : 'histogram2dcontour' , x : [ 2 , 3 ] , y : [ 2 , 4 ] , xaxis : 'x2' , yaxis : 'y2' } ,
325
325
] ,
326
326
layout : { }
327
327
} ;
@@ -337,15 +337,15 @@ describe('Test histogram', function() {
337
337
it ( 'should be able to group traces by *bingroup* under barmode:overlay ' , function ( ) {
338
338
gd = {
339
339
data : [
340
- { bingroup : '1' , type : 'histogram' , y : [ 1 ] } ,
341
- { uid : 'b' , type : 'histogram' , y : [ 2 ] } ,
342
- { bingroup : '2' , type : 'histogram' , y : [ 1 ] , xaxis : 'x2' } ,
343
- { bingroup : '1' , type : 'histogram' , y : [ 3 ] , xaxis : 'x2' } ,
344
- { bingroup : '2' , type : 'histogram' , y : [ 3 ] } ,
345
- { uid : 'f' , type : 'histogram' , y : [ 2 ] , xaxis : 'x2' } ,
346
- { bingroup : '3' , type : 'histogram' , x : [ 1 ] } ,
347
- { bingroup : '1' , type : 'histogram' , x : [ 2 ] , yaxis : 'y2' } ,
348
- { bingroup : '3' , type : 'histogram' , x : [ 2 ] }
340
+ { bingroup : '1' , type : 'histogram' , y : [ 1 , 2 ] } ,
341
+ { uid : 'b' , type : 'histogram' , y : [ 2 , 3 ] } ,
342
+ { bingroup : '2' , type : 'histogram' , y : [ 1 , 4 ] , xaxis : 'x2' } ,
343
+ { bingroup : '1' , type : 'histogram' , y : [ 3 , 4 ] , xaxis : 'x2' } ,
344
+ { bingroup : '2' , type : 'histogram' , y : [ 3 , 4 ] } ,
345
+ { uid : 'f' , type : 'histogram' , y : [ 2 , 4 ] , xaxis : 'x2' } ,
346
+ { bingroup : '3' , type : 'histogram' , x : [ 1 , 5 ] } ,
347
+ { bingroup : '1' , type : 'histogram' , x : [ 2 , 5 ] , yaxis : 'y2' } ,
348
+ { bingroup : '3' , type : 'histogram' , x : [ 2 , 5 ] }
349
349
] ,
350
350
layout : { barmode : 'overlay' }
351
351
} ;
@@ -362,11 +362,11 @@ describe('Test histogram', function() {
362
362
it ( 'should be able to group histogram2d traces by *bingroup*' , function ( ) {
363
363
gd = {
364
364
data : [
365
- { uid : 'a' , type : 'histogram2d' , x : [ 1 ] , y : [ 1 ] } ,
366
- { uid : 'b' , type : 'histogram2d' , x : [ 1 ] , y : [ 1 ] } ,
367
- { bingroup : '1' , type : 'histogram2d' , x : [ 1 ] , y : [ 1 ] } ,
368
- { bingroup : '1' , type : 'histogram2d' , x : [ 1 ] , y : [ 1 ] } ,
369
- { uid : 'e' , type : 'histogram2d' , x : [ 1 ] , y : [ 1 ] } ,
365
+ { uid : 'a' , type : 'histogram2d' , x : [ 1 , 2 ] , y : [ 1 , 2 ] } ,
366
+ { uid : 'b' , type : 'histogram2d' , x : [ 1 , 3 ] , y : [ 1 , 1 ] } ,
367
+ { bingroup : '1' , type : 'histogram2d' , x : [ 1 , 2 ] , y : [ 1 , 2 ] } ,
368
+ { bingroup : '1' , type : 'histogram2d' , x : [ 1 , 2 ] , y : [ 1 , 2 ] } ,
369
+ { uid : 'e' , type : 'histogram2d' , x : [ 1 , 3 ] , y : [ 1 , 3 ] } ,
370
370
]
371
371
} ;
372
372
supplyAllDefaults ( gd ) ;
@@ -382,10 +382,10 @@ describe('Test histogram', function() {
382
382
it ( 'should be able to group histogram and histogram2d* traces together' , function ( ) {
383
383
gd = {
384
384
data : [
385
- { bingroup : '1' , type : 'histogram' , y : [ 1 ] } ,
386
- { bingroup : '1' , type : 'histogram' , y : [ 3 ] , xaxis : 'x2' } ,
387
- { bingroup : '1' , type : 'histogram2d' , x : [ 1 ] , y : [ 3 ] } ,
388
- { bingroup : '1' , type : 'histogram2dcontour' , x : [ 1 ] , y : [ 3 ] }
385
+ { bingroup : '1' , type : 'histogram' , y : [ 1 , 3 ] } ,
386
+ { bingroup : '1' , type : 'histogram' , y : [ 3 , 3 ] , xaxis : 'x2' } ,
387
+ { bingroup : '1' , type : 'histogram2d' , x : [ 1 , 3 ] , y : [ 3 , 2 ] } ,
388
+ { bingroup : '1' , type : 'histogram2dcontour' , x : [ 1 , 2 ] , y : [ 3 , 4 ] }
389
389
] ,
390
390
layout : { barmode : 'overlay' }
391
391
} ;
@@ -400,8 +400,8 @@ describe('Test histogram', function() {
400
400
it ( 'should not group traces across axes of different types' , function ( ) {
401
401
gd = {
402
402
data : [
403
- { uid : 'a' , bingroup : '1' , type : 'histogram' , y : [ 1 ] } ,
404
- { uid : 'b' , bingroup : '1' , type : 'histogram' , y : [ 'cats' ] , yaxis : 'y2' } ,
403
+ { uid : 'a' , bingroup : '1' , type : 'histogram' , y : [ 1 , 2 ] } ,
404
+ { uid : 'b' , bingroup : '1' , type : 'histogram' , y : [ 'cats' , 'dogs' ] , yaxis : 'y2' } ,
405
405
] ,
406
406
layout : { barmode : 'overlay' }
407
407
} ;
@@ -420,9 +420,9 @@ describe('Test histogram', function() {
420
420
gd = {
421
421
data : [
422
422
// these 3 traces "have to match"
423
- { bingroup : '1' , type : 'histogram' , y : [ 1 ] } ,
424
- { type : 'histogram' , y : [ 1 ] } ,
425
- { bingroup : '2' , type : 'histogram' , y : [ 2 ] }
423
+ { bingroup : '1' , type : 'histogram' , y : [ 1 , 2 ] } ,
424
+ { type : 'histogram' , y : [ 1 , 3 ] } ,
425
+ { bingroup : '2' , type : 'histogram' , y : [ 2 , 3 ] }
426
426
] ,
427
427
layout : { barmode : 'stack' }
428
428
} ;
@@ -440,15 +440,15 @@ describe('Test histogram', function() {
440
440
gd = {
441
441
data : [
442
442
// these 2 traces "have to match"
443
- { bingroup : '1' , type : 'histogram' , y : [ 1 ] } ,
444
- { type : 'histogram' , y : [ 1 ] } ,
443
+ { bingroup : '1' , type : 'histogram' , y : [ 1 , 3 ] } ,
444
+ { type : 'histogram' , y : [ 1 , 3 ] } ,
445
445
// this one does not have to match with the above two,
446
446
// (it's on another subplot), but it can be grouped
447
- { bingroup : '1' , type : 'histogram' , y : [ 2 ] , xaxis : 'x2' , yaxis : 'y2' } ,
447
+ { bingroup : '1' , type : 'histogram' , y : [ 2 , 3 ] , xaxis : 'x2' , yaxis : 'y2' } ,
448
448
// this one does not have to match either
449
449
// (it's a histogram2d* traces), but it can be grouped
450
450
// TODO should this be just "bingroup"???
451
- { xbingroup : '1' , ybingroup : '1' , type : 'histogram2d' , x : [ 3 ] , y : [ 3 ] }
451
+ { xbingroup : '1' , ybingroup : '1' , type : 'histogram2d' , x : [ 3 , 4 ] , y : [ 3 , 4 ] }
452
452
] ,
453
453
layout : { }
454
454
} ;
@@ -486,7 +486,7 @@ describe('Test histogram', function() {
486
486
traces = [ { } , { } , { yaxis : 'y2' } , { yaxis : 'y2' } ] ;
487
487
traces . forEach ( function ( t ) {
488
488
t . type = 'histogram' ;
489
- t . x = [ 1 ] ;
489
+ t . x = [ 1 , 2 ] ;
490
490
} ) ;
491
491
}
492
492
0 commit comments