src/getNiceTickValues.js
function getTickValuesFn([min, max], tickCount = 6, allowDecimals = true) {
  // More than two ticks should be return
  const count = Math.max(tickCount, 2);
  const [cormin, cormax] = getValidInterval([min, max]);

  if (cormin === -Infinity || cormax === Infinity) {
    return [min, max];
  }

  if (cormin === cormax) {
    return getTickOfSingleValue(cormin, tickCount, allowDecimals);
  }

  const step = getFormatStep(new Decimal(cormax).sub(cormin).div(count - 1), allowDecimals, 0);

  const fn = compose(
    map(n => new Decimal(cormin).add(new Decimal(n).mul(step)).toNumber()),
    range,
  );

  const values = fn(0, count).filter(entry => (entry >= cormin && entry <= cormax));

  return min > max ? reverse(values) : values;
}
function getTickValuesFn([min, max], tickCount = 6, allowDecimals = true) {
  // More than two ticks should be return
  const count = Math.max(tickCount, 2);
  const [cormin, cormax] = getValidInterval([min, max]);

  if (cormin === -Infinity || cormax === Infinity) {
    return [min, max];
  }

  if (cormin === cormax) {
    return getTickOfSingleValue(cormin, tickCount, allowDecimals);
  }

  const step = getFormatStep(new Decimal(cormax).sub(cormin).div(count - 1), allowDecimals, 0);

  const fn = compose(
    map(n => new Decimal(cormin).add(new Decimal(n).mul(step)).toNumber()),
    range,
  );

  const values = fn(0, count).filter(entry => (entry >= cormin && entry <= cormax));

  return min > max ? reverse(values) : values;
}
function getTickValuesFn ( [ min , max ] , tickCount = 6 , allowDecimals = true ) { // More than two ticks should be return const count = Math . max ( tickCount , 2 ) ; const [ cormin , cormax ] = getValidInterval ( [ min , max ] ) ; if ( cormin === - Infinity || cormax === Infinity ) { return [ min , max ] ; } if ( cormin === cormax ) { return getTickOfSingleValue ( cormin , tickCount , allowDecimals ) ; } const step = getFormatStep ( new Decimal ( cormax ) . sub ( cormin ) . div ( count - 1 ) , allowDecimals , 0 ) ; const fn = compose ( map ( n => new Decimal ( cormin ) . add ( new Decimal ( n ) . mul ( step ) ) . toNumber ( ) ) , range , ) ; const values = fn ( 0 , count ) . filter ( entry => ( entry >= cormin && entry <= cormax ) ) ; return min > max ? reverse ( values ) : values ; }
Calculate the ticks of an interval, the count of ticks won't be guraranteed

@param  {Number}  min, max      min: The minimum value, max: The maximum value
@param  {Integer} tickCount     The count of ticks
@param  {Boolean} allowDecimals Allow the ticks to be decimals or not
@return {Array}   ticks
Calculate the ticks of an interval the count of ticks won t be guraranteed