@@ -1539,10 +1539,8 @@ axes.doTicks = function(gd, axid, skipTitle) {
15391539 return function ( ) {
15401540 if ( ! ax . _id ) return ;
15411541 var axDone = axes . doTicks ( gd , ax . _id ) ;
1542- if ( axid === 'redraw' ) {
1543- ax . _r = ax . range . slice ( ) ;
1544- ax . _rl = Lib . simpleMap ( ax . _r , ax . r2l ) ;
1545- }
1542+ ax . _r = ax . range . slice ( ) ;
1543+ ax . _rl = Lib . simpleMap ( ax . _r , ax . r2l ) ;
15461544 return axDone ;
15471545 } ;
15481546 } ) ) ;
@@ -1552,21 +1550,22 @@ axes.doTicks = function(gd, axid, skipTitle) {
15521550 // set scaling to pixels
15531551 ax . setScale ( ) ;
15541552
1555- var axLetter = axid . charAt ( 0 ) ,
1556- counterLetter = axes . counterLetter ( axid ) ,
1557- vals = axes . calcTicks ( ax ) ,
1558- datafn = function ( d ) { return [ d . text , d . x , ax . mirror , d . font , d . fontSize , d . fontColor ] . join ( '_' ) ; } ,
1559- tcls = axid + 'tick' ,
1560- gcls = axid + 'grid' ,
1561- zcls = axid + 'zl' ,
1562- pad = ( ax . linewidth || 1 ) / 2 ,
1563- labelStandoff = ( ax . ticks === 'outside' ? ax . ticklen : 0 ) ,
1564- labelShift = 0 ,
1565- gridWidth = Drawing . crispRound ( gd , ax . gridwidth , 1 ) ,
1566- zeroLineWidth = Drawing . crispRound ( gd , ax . zerolinewidth , gridWidth ) ,
1567- tickWidth = Drawing . crispRound ( gd , ax . tickwidth , 1 ) ,
1568- sides , transfn , tickpathfn , subplots ,
1569- i ;
1553+ var axLetter = axid . charAt ( 0 ) ;
1554+ var counterLetter = axes . counterLetter ( axid ) ;
1555+ var vals = axes . calcTicks ( ax ) ;
1556+ var datafn = function ( d ) { return [ d . text , d . x , ax . mirror , d . font , d . fontSize , d . fontColor ] . join ( '_' ) ; } ;
1557+ var tcls = axid + 'tick' ;
1558+ var gcls = axid + 'grid' ;
1559+ var zcls = axid + 'zl' ;
1560+ var pad = ( ax . linewidth || 1 ) / 2 ;
1561+ var labelStandoff = ( ax . ticks === 'outside' ? ax . ticklen : 0 ) ;
1562+ var labelShift = 0 ;
1563+ var gridWidth = Drawing . crispRound ( gd , ax . gridwidth , 1 ) ;
1564+ var zeroLineWidth = Drawing . crispRound ( gd , ax . zerolinewidth , gridWidth ) ;
1565+ var tickWidth = Drawing . crispRound ( gd , ax . tickwidth , 1 ) ;
1566+ var sides , transfn , tickpathfn , subplots ;
1567+ var tickLabels ;
1568+ var i ;
15701569
15711570 if ( ax . _counterangle && ax . ticks === 'outside' ) {
15721571 var caRad = ax . _counterangle * Math . PI / 180 ;
@@ -1616,10 +1615,11 @@ axes.doTicks = function(gd, axid, skipTitle) {
16161615 Lib . warn ( 'Unrecognized doTicks axis:' , axid ) ;
16171616 return ;
16181617 }
1619- var axside = ax . side || sides [ 0 ] ,
1618+
1619+ var axside = ax . side || sides [ 0 ] ;
16201620 // which direction do the side[0], side[1], and free ticks go?
16211621 // then we flip if outside XOR y axis
1622- ticksign = [ - 1 , 1 , axside === sides [ 1 ] ? 1 : - 1 ] ;
1622+ var ticksign = [ - 1 , 1 , axside === sides [ 1 ] ? 1 : - 1 ] ;
16231623 if ( ( ax . ticks !== 'inside' ) === ( axLetter === 'x' ) ) {
16241624 ticksign = ticksign . map ( function ( v ) { return - v ; } ) ;
16251625 }
@@ -1647,6 +1647,7 @@ axes.doTicks = function(gd, axid, skipTitle) {
16471647 function drawTicks ( container , tickpath ) {
16481648 var ticks = container . selectAll ( 'path.' + tcls )
16491649 . data ( ax . ticks === 'inside' ? valsClipped : vals , datafn ) ;
1650+
16501651 if ( tickpath && ax . ticks ) {
16511652 ticks . enter ( ) . append ( 'path' ) . classed ( tcls , 1 ) . classed ( 'ticks' , 1 )
16521653 . classed ( 'crisp' , 1 )
@@ -1662,7 +1663,7 @@ axes.doTicks = function(gd, axid, skipTitle) {
16621663 function drawLabels ( container , position ) {
16631664 // tick labels - for now just the main labels.
16641665 // TODO: mirror labels, esp for subplots
1665- var tickLabels = container . selectAll ( 'g.' + tcls ) . data ( vals , datafn ) ;
1666+ tickLabels = container . selectAll ( 'g.' + tcls ) . data ( vals , datafn ) ;
16661667
16671668 if ( ! isNumeric ( position ) ) {
16681669 tickLabels . remove ( ) ;
@@ -2013,14 +2014,12 @@ axes.doTicks = function(gd, axid, skipTitle) {
20132014 // now this only applies to regular cartesian axes; colorbars and
20142015 // others ALWAYS call doTicks with skipTitle=true so they can
20152016 // configure their own titles.
2016- var ax = axisIds . getFromId ( gd , axid ) ;
20172017
20182018 // rangeslider takes over a bottom title so drop it here
20192019 if ( ax . rangeslider && ax . rangeslider . visible && ax . _boundingBox && ax . side === 'bottom' ) return ;
20202020
2021- var avoidSelection = d3 . select ( gd ) . selectAll ( 'g.' + axid + 'tick' ) ;
20222021 var avoid = {
2023- selection : avoidSelection ,
2022+ selection : tickLabels ,
20242023 side : ax . side
20252024 } ;
20262025 var axLetter = axid . charAt ( 0 ) ;
@@ -2030,8 +2029,8 @@ axes.doTicks = function(gd, axid, skipTitle) {
20302029
20312030 var transform , counterAxis , x , y ;
20322031
2033- if ( avoidSelection . size ( ) ) {
2034- var translation = Drawing . getTranslate ( avoidSelection . node ( ) . parentNode ) ;
2032+ if ( tickLabels . size ( ) ) {
2033+ var translation = Drawing . getTranslate ( tickLabels . node ( ) . parentNode ) ;
20352034 avoid . offsetLeft = translation . x ;
20362035 avoid . offsetTop = translation . y ;
20372036 }
0 commit comments