@@ -3648,7 +3648,7 @@ axes.drawLabels = function(gd, ax, opts) {
3648
3648
'text-anchor' : anchor
3649
3649
} ) ;
3650
3650
3651
- thisText . style ( 'opacity ' , 1 ) ; // visible
3651
+ thisText . style ( 'display ' , null ) ; // visible
3652
3652
3653
3653
if ( ax . _adjustTickLabelsOverflow ) {
3654
3654
ax . _adjustTickLabelsOverflow ( ) ;
@@ -3706,9 +3706,9 @@ axes.drawLabels = function(gd, ax, opts) {
3706
3706
3707
3707
var t = thisLabel . select ( 'text' ) ;
3708
3708
if ( adjust ) {
3709
- if ( hideOverflow ) t . style ( 'opacity ' , 0 ) ; // hidden
3709
+ if ( hideOverflow ) t . style ( 'display ' , 'none' ) ; // hidden
3710
3710
} else {
3711
- t . style ( 'opacity ' , 1 ) ; // visible
3711
+ t . style ( 'display ' , null ) ; // visible
3712
3712
3713
3713
if ( side === 'bottom' || side === 'right' ) {
3714
3714
visibleLabelMin = Math . min ( visibleLabelMin , isX ? bb . top : bb . left ) ;
@@ -3783,7 +3783,7 @@ axes.drawLabels = function(gd, ax, opts) {
3783
3783
q > ax [ '_visibleLabelMin_' + anchorAx . _id ]
3784
3784
) {
3785
3785
t . style ( 'display' , 'none' ) ; // hidden
3786
- } else if ( e . K === 'tick' && ! idx ) {
3786
+ } else if ( e . K === 'tick' && ! idx && t . style ( 'display' ) != 'none' ) {
3787
3787
t . style ( 'display' , null ) ; // visible
3788
3788
}
3789
3789
} ) ;
@@ -3807,6 +3807,7 @@ axes.drawLabels = function(gd, ax, opts) {
3807
3807
var autoangle = null ;
3808
3808
3809
3809
function fixLabelOverlaps ( ) {
3810
+ console . log ( "fix label overlaps!" ) ;
3810
3811
positionLabels ( tickLabels , tickAngle ) ;
3811
3812
3812
3813
// check for auto-angling if x labels overlap
@@ -3915,24 +3916,11 @@ axes.drawLabels = function(gd, ax, opts) {
3915
3916
}
3916
3917
}
3917
3918
3918
- function removeHiddenLabels ( ) {
3919
- // Remove all hidden labels to prevent them from affecting the layout.
3920
- tickLabels . each ( function ( d ) {
3921
- var thisLabel = d3 . select ( this ) ;
3922
- var textNode = thisLabel . select ( 'text' ) . node ( ) ;
3923
- var opacity = window . getComputedStyle ( textNode ) . opacity ;
3924
- if ( opacity == '0' ) {
3925
- thisLabel . select ( 'text' ) . text ( '' ) ;
3926
- d3 . select ( textNode ) . text ( '' ) ;
3927
- }
3928
- } ) ;
3929
- }
3930
-
3931
3919
if ( ax . _selections ) {
3932
3920
ax . _selections [ cls ] = tickLabels ;
3933
3921
}
3934
3922
3935
- var seq = [ allLabelsReady , removeHiddenLabels ] ;
3923
+ var seq = [ allLabelsReady ] ;
3936
3924
3937
3925
// N.B. during auto-margin redraws, if the axis fixed its label overlaps
3938
3926
// by rotating 90 degrees, do not attempt to re-fix its label overlaps
0 commit comments