@@ -897,7 +897,6 @@ describe('calculated data and points', function() {
897
897
898
898
// oneOrientationTraces are traces for which swapping x/y is not supported
899
899
var oneOrientationTraces = [ 'ohlc' , 'candlestick' ] ;
900
- oneOrientationTraces . push ( 'splom' ) ; // TODO: support splom and remove this
901
900
902
901
function makeData ( type , a , b , axId ) {
903
902
var input = [ a , b ] ;
@@ -949,11 +948,11 @@ describe('calculated data and points', function() {
949
948
dimensions : [
950
949
{
951
950
label : 'DimensionA' ,
952
- values : cat
951
+ values : a
953
952
} ,
954
953
{
955
954
label : 'DimensionB' ,
956
- values : data
955
+ values : b
957
956
}
958
957
]
959
958
} ) ;
@@ -963,7 +962,7 @@ describe('calculated data and points', function() {
963
962
[ 'xaxis' , 'yaxis' ] . forEach ( function ( axId ) {
964
963
if ( axId === 'yaxis' && oneOrientationTraces . indexOf ( trace . type ) !== - 1 ) return ;
965
964
[ 'value ascending' , 'value descending' ] . forEach ( function ( categoryorder ) {
966
- it ( 'sorts ' + trace . type + ' by ' + categoryorder , function ( done ) {
965
+ it ( 'sorts ' + axId + ' by ' + categoryorder + 'for trace type ' + trace . type , function ( done ) {
967
966
var data = [ 7 , 2 , 3 ] ;
968
967
var baseMock = { data : [ makeData ( trace . type , cat , data , axId ) ] , layout : { } } ;
969
968
var mock = Lib . extendDeep ( { } , baseMock ) ;
@@ -980,7 +979,7 @@ describe('calculated data and points', function() {
980
979
981
980
Plotly . newPlot ( gd , mock )
982
981
. then ( function ( gd ) {
983
- expect ( gd . _fullLayout [ axId ] . _categories ) . toEqual ( finalOrder , 'for trace ' + trace . type ) ;
982
+ expect ( gd . _fullLayout [ trace . type === 'splom' ? 'xaxis' : axId ] . _categories ) . toEqual ( finalOrder , 'for trace ' + trace . type ) ;
984
983
} )
985
984
. catch ( failTest )
986
985
. then ( done ) ;
@@ -999,7 +998,7 @@ describe('calculated data and points', function() {
999
998
1000
999
Plotly . newPlot ( gd , mock )
1001
1000
. then ( function ( gd ) {
1002
- var agg = gd . _fullLayout [ axId ] . _categoriesAggregatedValue . sort ( function ( a , b ) {
1001
+ var agg = gd . _fullLayout [ mock . data [ 0 ] . type === 'splom' ? 'xaxis' : axId ] . _categoriesAggregatedValue . sort ( function ( a , b ) {
1003
1002
return a [ 0 ] > b [ 0 ] ;
1004
1003
} ) ;
1005
1004
expect ( agg ) . toEqual ( expectedAgg , 'wrong aggregation for ' + axId ) ;
0 commit comments