@@ -613,6 +613,7 @@ module.exports = function setConvert(ax, fullLayout) {
613
613
} ;
614
614
615
615
// sort the axis (and all the matching ones) by _initialCategories
616
+ // returns the indices of the traces affected by the reordering
616
617
ax . sortByInitialCategories = function ( ) {
617
618
var affectedTraces = [ ] ;
618
619
var emptyCategories = function ( ) {
@@ -630,19 +631,14 @@ module.exports = function setConvert(ax, fullLayout) {
630
631
631
632
affectedTraces = affectedTraces . concat ( ax . _traceIndices ) ;
632
633
633
- var matchGroups = fullLayout . _axisMatchGroups ;
634
-
635
- if ( matchGroups && matchGroups . length ) {
636
- for ( var i = 0 ; i < matchGroups . length ; i ++ ) {
637
- var group = matchGroups [ i ] ;
638
- for ( var axId2 in group ) {
639
- if ( axId === axId2 ) continue ;
640
- var ax2 = fullLayout [ axisIds . id2name ( axId2 ) ] ;
641
- ax2 . _categories = ax . _categories ;
642
- ax2 . _categoriesMap = ax . _categoriesMap ;
643
- affectedTraces = affectedTraces . concat ( ax2 . _traceIndices ) ;
644
- }
645
- }
634
+ // Propagate to matching axes
635
+ var group = ax . _matchGroup ;
636
+ for ( var axId2 in group ) {
637
+ if ( axId === axId2 ) continue ;
638
+ var ax2 = fullLayout [ axisIds . id2name ( axId2 ) ] ;
639
+ ax2 . _categories = ax . _categories ;
640
+ ax2 . _categoriesMap = ax . _categoriesMap ;
641
+ affectedTraces = affectedTraces . concat ( ax2 . _traceIndices ) ;
646
642
}
647
643
return affectedTraces ;
648
644
} ;
0 commit comments