@@ -29,8 +29,8 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
29
29
yaListCartesian = [ ] ,
30
30
xaListGl2d = [ ] ,
31
31
yaListGl2d = [ ] ,
32
- xaListCheater = [ ] ,
33
- xaListNonCheater = [ ] ,
32
+ xaCheater = { } ,
33
+ xaNonCheater = { } ,
34
34
outerTicks = { } ,
35
35
noGrids = { } ,
36
36
i ;
@@ -57,15 +57,15 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
57
57
// 1. is not carpet
58
58
// 2. carpet that's not cheater
59
59
if ( ! Registry . traceIs ( trace , 'carpet' ) || ( trace . type === 'carpet' && ! trace . _cheater ) ) {
60
- if ( xaName ) Lib . pushUnique ( xaListNonCheater , xaName ) ;
60
+ if ( xaName ) xaNonCheater [ xaName ] = 1 ;
61
61
}
62
62
63
63
// The above check for definitely-not-cheater is not adequate. This
64
64
// second list tracks which axes *could* be a cheater so that the
65
65
// full condition triggering hiding is:
66
66
// *could* be a cheater and *is not definitely visible*
67
67
if ( trace . type === 'carpet' && trace . _cheater ) {
68
- if ( xaName ) Lib . pushUnique ( xaListCheater , xaName ) ;
68
+ if ( xaName ) xaCheater [ xaName ] = 1 ;
69
69
}
70
70
71
71
// add axes implied by traces
@@ -186,7 +186,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
186
186
data : fullData ,
187
187
bgColor : bgColor ,
188
188
calendar : layoutOut . calendar ,
189
- cheateronly : axLetter === 'x' && ( xaListCheater . indexOf ( axName ) !== - 1 && xaListNonCheater . indexOf ( axName ) === - 1 )
189
+ cheateronly : axLetter === 'x' && ( xaCheater [ axName ] && ! xaNonCheater [ axName ] )
190
190
} ;
191
191
192
192
handleAxisDefaults ( axLayoutIn , axLayoutOut , coerce , defaultOptions , layoutOut ) ;
0 commit comments