@@ -2890,7 +2890,7 @@ function sortAxisCategoriesByValue(axList, gd) {
2890
2890
var cdi = cd [ k ] ;
2891
2891
var cat , catIndex , value ;
2892
2892
2893
- // Collect values across dimensions
2893
+ // If `splom`, collect values across dimensions
2894
2894
if ( type === 'splom' ) {
2895
2895
// Find which dimension the current axis is representing
2896
2896
var currentDimensionIndex = cdi . trace [ ax . _id . charAt ( 0 ) + 'axes' ] . indexOf ( ax . _id ) ;
@@ -2907,6 +2907,7 @@ function sortAxisCategoriesByValue(axList, gd) {
2907
2907
categoriesValue [ catIndex ] [ 1 ] . push ( dimension . values [ l ] ) ;
2908
2908
}
2909
2909
}
2910
+ // If `scattergl`, collect all values stashed under cdi.t
2910
2911
} else if ( type === 'scattergl' ) {
2911
2912
for ( l = 0 ; l < cdi . t . x . length ; l ++ ) {
2912
2913
if ( ax . _id . charAt ( 0 ) === 'x' ) {
@@ -2927,6 +2928,7 @@ function sortAxisCategoriesByValue(axList, gd) {
2927
2928
if ( cdi . t && cdi . t . _scene ) {
2928
2929
delete cdi . t . _scene . dirty ;
2929
2930
}
2931
+ // For all other 2d cartesian traces
2930
2932
} else {
2931
2933
if ( ax . _id . charAt ( 0 ) === 'x' ) {
2932
2934
cat = cdi . p + 1 ? cdi . p : cdi . x ;
@@ -2936,6 +2938,7 @@ function sortAxisCategoriesByValue(axList, gd) {
2936
2938
value = cdi . s || cdi . v || cdi . x ;
2937
2939
}
2938
2940
2941
+ // If 2dMap, collect values in `z`
2939
2942
if ( cdi . hasOwnProperty ( 'z' ) ) {
2940
2943
value = cdi . z ;
2941
2944
@@ -2946,11 +2949,6 @@ function sortAxisCategoriesByValue(axList, gd) {
2946
2949
}
2947
2950
}
2948
2951
} else {
2949
- if ( fullData . orientation === 'h' ) {
2950
- cat = cdi . p + 1 ? cdi . p : cdi . x ;
2951
- value = cdi . s || cdi . v || cdi . y ;
2952
- }
2953
-
2954
2952
if ( ! Array . isArray ( value ) ) value = [ value ] ;
2955
2953
for ( l = 0 ; l < value . length ; l ++ ) {
2956
2954
categoriesValue [ cat ] [ 1 ] . push ( value [ l ] ) ;
0 commit comments