@@ -1721,6 +1721,10 @@ exports.relayout = function relayout(gd, astr, val) {
17211721 } ) ;
17221722} ;
17231723
1724+ var AX_RANGE_RE = / ^ [ x y z ] a x i s [ 0 - 9 ] * \. r a n g e ( \[ [ 0 | 1 ] \] ) ? $ / ;
1725+ var AX_AUTORANGE_RE = / ^ [ x y z ] a x i s [ 0 - 9 ] * \. a u t o r a n g e $ / ;
1726+ var AX_DOMAIN_RE = / ^ [ x y z ] a x i s [ 0 - 9 ] * \. d o m a i n ( \[ [ 0 | 1 ] \] ) ? $ / ;
1727+
17241728function _relayout ( gd , aobj ) {
17251729 var layout = gd . layout ,
17261730 fullLayout = gd . _fullLayout ,
@@ -1834,11 +1838,11 @@ function _relayout(gd, aobj) {
18341838 fullLayout [ ai ] = gd . _initialAutoSize [ ai ] ;
18351839 }
18361840 // check autorange vs range
1837- else if ( pleafPlus . match ( / ^ [ x y z ] a x i s [ 0 - 9 ] * \. r a n g e ( \[ [ 0 | 1 ] \] ) ? $ / ) ) {
1841+ else if ( pleafPlus . match ( AX_RANGE_RE ) ) {
18381842 recordAlteredAxis ( pleafPlus ) ;
18391843 Lib . nestedProperty ( fullLayout , ptrunk + '._inputRange' ) . set ( null ) ;
18401844 }
1841- else if ( pleafPlus . match ( / ^ [ x y z ] a x i s [ 0 - 9 ] * \. a u t o r a n g e $ / ) ) {
1845+ else if ( pleafPlus . match ( AX_AUTORANGE_RE ) ) {
18421846 recordAlteredAxis ( pleafPlus ) ;
18431847 Lib . nestedProperty ( fullLayout , ptrunk + '._inputRange' ) . set ( null ) ;
18441848 var axFull = Lib . nestedProperty ( fullLayout , ptrunk ) . get ( ) ;
@@ -1848,7 +1852,7 @@ function _relayout(gd, aobj) {
18481852 axFull . _input . domain = axFull . _inputDomain . slice ( ) ;
18491853 }
18501854 }
1851- else if ( pleafPlus . match ( / ^ [ x y z ] a x i s [ 0 - 9 ] * \. d o m a i n ( \[ [ 0 | 1 ] \] ) ? $ / ) ) {
1855+ else if ( pleafPlus . match ( AX_DOMAIN_RE ) ) {
18521856 Lib . nestedProperty ( fullLayout , ptrunk + '._inputDomain' ) . set ( null ) ;
18531857 }
18541858
0 commit comments