src/scale/Log.js
function (approxTickNum) {
        approxTickNum = approxTickNum || 10;
        var extent = this._extent;
        var span = extent[1] - extent[0];
        if (span === Infinity || span <= 0) {
            return;
        }

        var interval = numberUtil.quantity(span);
        var err = approxTickNum / span * interval;

        // Filter ticks to get closer to the desired count.
        if (err <= 0.5) {
            interval *= 10;
        }

        // Interval should be integer
        while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {
            interval *= 10;
        }

        var niceExtent = [
            numberUtil.round(mathCeil(extent[0] / interval) * interval),
            numberUtil.round(mathFloor(extent[1] / interval) * interval)
        ];

        this._interval = interval;
        this._niceExtent = niceExtent;
    }
function (approxTickNum) {
        approxTickNum = approxTickNum || 10;
        var extent = this._extent;
        var span = extent[1] - extent[0];
        if (span === Infinity || span <= 0) {
            return;
        }

        var interval = numberUtil.quantity(span);
        var err = approxTickNum / span * interval;

        // Filter ticks to get closer to the desired count.
        if (err <= 0.5) {
            interval *= 10;
        }

        // Interval should be integer
        while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {
            interval *= 10;
        }

        var niceExtent = [
            numberUtil.round(mathCeil(extent[0] / interval) * interval),
            numberUtil.round(mathFloor(extent[1] / interval) * interval)
        ];

        this._interval = interval;
        this._niceExtent = niceExtent;
    }
function ( approxTickNum ) { approxTickNum = approxTickNum || 10 ; var extent = this . _extent ; var span = extent [ 1 ] - extent [ 0 ] ; if ( span === Infinity || span <= 0 ) { return ; } var interval = numberUtil . quantity ( span ) ; var err = approxTickNum / span * interval ; // Filter ticks to get closer to the desired count. if ( err <= 0.5 ) { interval *= 10 ; } // Interval should be integer while ( ! isNaN ( interval ) && Math . abs ( interval ) < 1 && Math . abs ( interval ) > 0 ) { interval *= 10 ; } var niceExtent = [ numberUtil . round ( mathCeil ( extent [ 0 ] / interval ) * interval ) , numberUtil . round ( mathFloor ( extent [ 1 ] / interval ) * interval ) ] ; this . _interval = interval ; this . _niceExtent = niceExtent ; }
Update interval and extent of intervals for nice ticks
@param  {number} [approxTickNum = 10] Given approx tick number
Update interval and extent of intervals for nice ticks