@@ -144,7 +144,7 @@ module.exports = function setPositions(gd, plotinfo) {
144
144
for ( j = 0 ; j < ti . length ; j ++ ) {
145
145
sv = Math . round ( ti [ j ] . p / sumround ) ;
146
146
// store the negative sum value for p at the same key, with sign flipped
147
- if ( relative && ti [ j ] . s < 0 ) sv = - sv ;
147
+ if ( relative && ti [ j ] . s < 0 ) sv = - sv ;
148
148
var previousSum = sums [ sv ] || 0 ;
149
149
if ( stack || relative ) ti [ j ] . b = previousSum ;
150
150
barEnd = ti [ j ] . b + ti [ j ] . s ;
@@ -164,7 +164,7 @@ module.exports = function setPositions(gd, plotinfo) {
164
164
if ( norm ) {
165
165
padded = false ;
166
166
var top = norm === 'fraction' ? 1 : 100 ,
167
- isNegative = false ,
167
+ relAndNegative = false ,
168
168
tiny = top / 1e9 ; // in case of rounding error in sum
169
169
sMin = 0 ;
170
170
sMax = stack ? top : 0 ;
@@ -173,9 +173,9 @@ module.exports = function setPositions(gd, plotinfo) {
173
173
for ( j = 0 ; j < ti . length ; j ++ ) {
174
174
relAndNegative = relative && ti [ j ] . s < 0 ;
175
175
sv = Math . round ( ti [ j ] . p / sumround ) ;
176
- if ( relAndNegative ) sv = - sv ; // locate negative sum amount for this p val
176
+ if ( relAndNegative ) sv = - sv ; // locate negative sum amount for this p val
177
177
scale = top / sums [ sv ] ;
178
- if ( relAndNegative ) scale *= - 1 ; // preserve sign if negative
178
+ if ( relAndNegative ) scale *= - 1 ; // preserve sign if negative
179
179
ti [ j ] . b *= scale ;
180
180
ti [ j ] . s *= scale ;
181
181
barEnd = ti [ j ] . b + ti [ j ] . s ;
0 commit comments