@@ -496,7 +496,8 @@ function updatePositionAxis(gd, pa, sieve, allowMinDtick) {
496496 }
497497 }
498498
499- Axes . expand ( pa , [ pMin , pMax ] , { padded : false } ) ;
499+ var extremes = Axes . findExtremes ( pa , [ pMin , pMax ] , { padded : false } ) ;
500+ putExtremes ( calcTraces , pa , extremes ) ;
500501}
501502
502503function expandRange ( range , newValue ) {
@@ -530,7 +531,8 @@ function setBaseAndTop(gd, sa, sieve) {
530531 }
531532 }
532533
533- Axes . expand ( sa , sRange , { tozero : true , padded : true } ) ;
534+ var extremes = Axes . findExtremes ( sa , sRange , { tozero : true , padded : true } ) ;
535+ putExtremes ( traces , sa , extremes ) ;
534536}
535537
536538
@@ -568,7 +570,10 @@ function stackBars(gd, sa, sieve) {
568570 }
569571
570572 // if barnorm is set, let normalizeBars update the axis range
571- if ( ! barnorm ) Axes . expand ( sa , sRange , { tozero : true , padded : true } ) ;
573+ if ( ! barnorm ) {
574+ var extremes = Axes . findExtremes ( sa , sRange , { tozero : true , padded : true } ) ;
575+ putExtremes ( traces , sa , extremes ) ;
576+ }
572577}
573578
574579
@@ -633,14 +638,21 @@ function normalizeBars(gd, sa, sieve) {
633638 }
634639
635640 // update range of size axis
636- Axes . expand ( sa , sRange , { tozero : true , padded : padded } ) ;
641+ var extremes = Axes . findExtremes ( sa , sRange , { tozero : true , padded : padded } ) ;
642+ putExtremes ( traces , sa , extremes ) ;
637643}
638644
639645
640646function getAxisLetter ( ax ) {
641647 return ax . _id . charAt ( 0 ) ;
642648}
643649
650+ function putExtremes ( cd , ax , extremes ) {
651+ for ( var i = 0 ; i < cd . length ; i ++ ) {
652+ cd [ i ] [ 0 ] . trace . _extremes [ ax . _id ] = extremes ;
653+ }
654+ }
655+
644656// find the full position span of bars at each position
645657// for use by hover, to ensure labels move in if bars are
646658// narrower than the space they're in.
0 commit comments