File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -3207,8 +3207,12 @@ function sortAxisCategoriesByValue(axList, gd) {
3207
3207
median : function ( values ) { return Lib . median ( values ) ; }
3208
3208
} ;
3209
3209
3210
- function sortValues ( a , b , order ) {
3211
- return order === 'descending' ? b [ 1 ] - a [ 1 ] : a [ 1 ] - b [ 1 ] ;
3210
+ function sortAscending ( a , b ) {
3211
+ return a [ 1 ] - b [ 1 ] ;
3212
+ }
3213
+
3214
+ function sortDescending ( a , b ) {
3215
+ return b [ 1 ] - a [ 1 ] ;
3212
3216
}
3213
3217
3214
3218
for ( i = 0 ; i < axList . length ; i ++ ) {
@@ -3332,7 +3336,7 @@ function sortAxisCategoriesByValue(axList, gd) {
3332
3336
}
3333
3337
3334
3338
// Sort by aggregated value
3335
- categoriesAggregatedValue . sort ( ( a , b ) => sortValues ( a , b , order ) ) ;
3339
+ categoriesAggregatedValue . sort ( order === 'descending' ? sortDescending : sortAscending ) ;
3336
3340
3337
3341
ax . _categoriesAggregatedValue = categoriesAggregatedValue ;
3338
3342
You can’t perform that action at this time.
0 commit comments