File tree 2 files changed +10
-10
lines changed 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -126,10 +126,11 @@ module.exports = function setConvert(ax, fullLayout) {
126
126
*/
127
127
function setCategoryIndex ( v ) {
128
128
if ( v !== null && v !== undefined ) {
129
- if ( ax . _categoriesMap === undefined )
129
+ if ( ax . _categoriesMap === undefined ) {
130
130
ax . _categoriesMap = { } ;
131
+ }
131
132
132
- if ( ax . _categoriesMap [ v ] !== undefined ) {
133
+ if ( ax . _categoriesMap [ v ] !== undefined ) {
133
134
return ax . _categoriesMap [ v ] ;
134
135
} else {
135
136
ax . _categories . push ( v ) ;
@@ -146,11 +147,10 @@ module.exports = function setConvert(ax, fullLayout) {
146
147
function getCategoryIndex ( v ) {
147
148
// d2l/d2c variant that that won't add categories but will also
148
149
// allow numbers to be mapped to the linearized axis positions
149
- if ( ax . _categoriesMap )
150
- var index = ax . _categoriesMap [ v ] ?ax . _categoriesMap :undefined ;
151
-
152
- if ( index !== undefined ) return index ;
153
- if ( typeof v === 'number' ) return v ;
150
+ var index ;
151
+ if ( ax . _categoriesMap ) { index = ax . _categoriesMap [ v ] ? ax . _categoriesMap : undefined ; }
152
+ if ( index !== undefined ) { return index ; }
153
+ if ( typeof v === 'number' ) { return v ; }
154
154
}
155
155
156
156
function l2p ( v ) {
Original file line number Diff line number Diff line change @@ -1951,9 +1951,9 @@ plots.doCalcdata = function(gd, traces) {
1951
1951
for ( i = 0 ; i < axList . length ; i ++ ) {
1952
1952
axList [ i ] . _categories = axList [ i ] . _initialCategories . slice ( ) ;
1953
1953
1954
- //Build the lookup map for initialized categories
1954
+ // Build the lookup map for initialized categories
1955
1955
axList [ i ] . _categoriesMap = { } ;
1956
- for ( var j = 0 ; j < axList [ i ] . _categories . length ; j ++ ) {
1956
+ for ( j = 0 ; j < axList [ i ] . _categories . length ; j ++ ) {
1957
1957
axList [ i ] . _categoriesMap [ axList [ i ] . _categories [ j ] ] = j ;
1958
1958
}
1959
1959
@@ -2001,7 +2001,7 @@ plots.doCalcdata = function(gd, traces) {
2001
2001
axList [ i ] . _min = [ ] ;
2002
2002
axList [ i ] . _max = [ ] ;
2003
2003
axList [ i ] . _categories = [ ] ;
2004
- //Reset the look up map
2004
+ // Reset the look up map
2005
2005
axList [ i ] . _categoriesMap = { } ;
2006
2006
}
2007
2007
}
You can’t perform that action at this time.
0 commit comments