@@ -233,25 +233,26 @@ axes.minDtick = function(ax, newDiff, newFirst, allow) {
233233 // and the plot itself may decide to cancel (ie non-grouped bars)
234234 if ( [ 'log' , 'category' , 'multicategory' ] . indexOf ( ax . type ) !== - 1 || ! allow ) {
235235 ax . _minDtick = 0 ;
236- }
237- // undefined means there's nothing there yet
238- else if ( ax . _minDtick === undefined ) {
236+ } else if ( ax . _minDtick === undefined ) {
237+ // undefined means there's nothing there yet
238+
239239 ax . _minDtick = newDiff ;
240240 ax . _forceTick0 = newFirst ;
241241 } else if ( ax . _minDtick ) {
242- // existing minDtick is an integer multiple of newDiff
243- // (within rounding err)
244- // and forceTick0 can be shifted to newFirst
245242 if ( ( ax . _minDtick / newDiff + 1e-6 ) % 1 < 2e-6 &&
243+ // existing minDtick is an integer multiple of newDiff
244+ // (within rounding err)
245+ // and forceTick0 can be shifted to newFirst
246+
246247 ( ( ( newFirst - ax . _forceTick0 ) / newDiff % 1 ) +
247248 1.000001 ) % 1 < 2e-6 ) {
248249 ax . _minDtick = newDiff ;
249250 ax . _forceTick0 = newFirst ;
250- }
251- // if the converse is true (newDiff is a multiple of minDtick and
252- // newFirst can be shifted to forceTick0) then do nothing - same
253- // forcing stands. Otherwise, cancel forced minimum
254- else if ( ( newDiff / ax . _minDtick + 1e-6 ) % 1 > 2e-6 ||
251+ } else if ( ( newDiff / ax . _minDtick + 1e-6 ) % 1 > 2e-6 ||
252+ // if the converse is true (newDiff is a multiple of minDtick and
253+ // newFirst can be shifted to forceTick0) then do nothing - same
254+ // forcing stands. Otherwise, cancel forced minimum
255+
255256 ( ( ( newFirst - ax . _forceTick0 ) / ax . _minDtick % 1 ) +
256257 1.000001 ) % 1 > 2e-6 ) {
257258 ax . _minDtick = 0 ;
@@ -431,17 +432,18 @@ function autoShiftNumericBins(binStart, data, ax, dataMin, dataMax) {
431432 var dataCount = data . length - blankCount ;
432433
433434 if ( intcount === dataCount && ax . type !== 'date' ) {
434- // all integers: if bin size is <1, it's because
435- // that was specifically requested (large nbins)
436- // so respect that... but center the bins containing
437- // integers on those integers
438435 if ( ax . dtick < 1 ) {
436+ // all integers: if bin size is <1, it's because
437+ // that was specifically requested (large nbins)
438+ // so respect that... but center the bins containing
439+ // integers on those integers
440+
439441 binStart = dataMin - 0.5 * ax . dtick ;
440- }
441- // otherwise start half an integer down regardless of
442- // the bin size, just enough to clear up endpoint
443- // ambiguity about which integers are in which bins.
444- else {
442+ } else {
443+ // otherwise start half an integer down regardless of
444+ // the bin size, just enough to clear up endpoint
445+ // ambiguity about which integers are in which bins.
446+
445447 binStart -= 0.5 ;
446448 if ( binStart + ax . dtick < dataMin ) binStart += ax . dtick ;
447449 }
@@ -829,9 +831,10 @@ function autoTickRound(ax) {
829831 ax . _tickexponent = 3 * Math . round ( ( rangeexp - 1 ) / 3 ) ;
830832 } else ax . _tickexponent = rangeexp ;
831833 }
834+ } else {
835+ // D1 or D2 (log)
836+ ax . _tickround = null ;
832837 }
833- // D1 or D2 (log)
834- else ax . _tickround = null ;
835838}
836839
837840// months and years don't have constant millisecond values
@@ -915,10 +918,9 @@ axes.tickFirst = function(ax) {
915918 }
916919 Lib . error ( 'tickFirst did not converge' , ax ) ;
917920 return t0 ;
918- }
921+ } else if ( tType === 'L' ) {
922+ // Log scales: Linear, Digits
919923
920- // Log scales: Linear, Digits
921- else if ( tType === 'L' ) {
922924 return Math . log ( sRound (
923925 ( Math . pow ( 10 , r0 ) - tick0 ) / dtNum ) * dtNum + tick0 ) / Math . LN10 ;
924926 } else if ( tType === 'D' ) {
0 commit comments