@@ -870,13 +870,13 @@ module.exports = function setConvert(ax, fullLayout) {
870870 }
871871 } ;
872872
873+ ax . _emptyCategories = function ( ) {
874+ ax . _categories = [ ] ;
875+ ax . _categoriesMap = { } ;
876+ } ;
877+
873878 // should skip if not category nor multicategory
874879 ax . clearCalc = function ( ) {
875- var emptyCategories = function ( ) {
876- ax . _categories = [ ] ;
877- ax . _categoriesMap = { } ;
878- } ;
879-
880880 var matchGroups = fullLayout . _axisMatchGroups ;
881881
882882 if ( matchGroups && matchGroups . length ) {
@@ -903,14 +903,14 @@ module.exports = function setConvert(ax, fullLayout) {
903903 ax . _categories = categories ;
904904 ax . _categoriesMap = categoriesMap ;
905905 } else {
906- emptyCategories ( ) ;
906+ ax . _emptyCategories ( ) ;
907907 }
908908 break ;
909909 }
910910 }
911- if ( ! found ) emptyCategories ( ) ;
911+ if ( ! found ) ax . _emptyCategories ( ) ;
912912 } else {
913- emptyCategories ( ) ;
913+ ax . _emptyCategories ( ) ;
914914 }
915915
916916 if ( ax . _initialCategories ) {
@@ -924,12 +924,8 @@ module.exports = function setConvert(ax, fullLayout) {
924924 // returns the indices of the traces affected by the reordering
925925 ax . sortByInitialCategories = function ( ) {
926926 var affectedTraces = [ ] ;
927- var emptyCategories = function ( ) {
928- ax . _categories = [ ] ;
929- ax . _categoriesMap = { } ;
930- } ;
931927
932- emptyCategories ( ) ;
928+ ax . _emptyCategories ( ) ;
933929
934930 if ( ax . _initialCategories ) {
935931 for ( var j = 0 ; j < ax . _initialCategories . length ; j ++ ) {
0 commit comments