function tightDistanceBasedGenerator({
  distance,
  scale,
  minorCount = 0,
  unitDivider = 100,
  formatter = undefined,
}) {
  const step = !notNumber(unitDivider) && !notNumber(distance) ? Math.max(distance / unitDivider, 2) : 2;
  const count = Math.min(1000, Math.round(step)); // safe guard against huge numbers
  const n = count > 10 ? 10 : count;
  scale.nice(n);

  const majorTicks = scale.ticks(count);
  const ticks = minorCount > 0 ? appendMinorTicks(majorTicks, minorCount, scale) : majorTicks;
  ticks.sort((a, b) => a - b);

  const ticksFormatted = ticks.map(applyFormat(formatter));

  return ticks.map((tick, i) => {
    const position = scale(tick);
    return {
      position,
      start: position,
      end: position,
      label: ticksFormatted[i],
      value: tick,
      isMinor: majorTicks.indexOf(tick) === -1,
    };
  });
}
/**
 * Generate ticks based on a distance, for each 100th unit, one additional tick may be added.
 * Will attempt to round the bounds of domain to even values and generate ticks hitting the domain bounds.
 * @private
 * @param  {Number} distance       Distance between each tick
 * @param  {Number} scale         The scale instance
 * @param  {Number} [minorCount=0]     Number of tick added between each distance
 * @param  {Number} [unitDivider=100]   Number to divide distance with
 * @return {Array}               Array of ticks
 */
Generate ticks based on a distance, for each 100th unit, one additional tick may be added.
Will attempt to round the bounds of domain to even values and generate ticks hitting the domain bounds.
Generate ticks based on a distance for each 100th unit one additional tick may be added . Will attempt to round the bounds of domain to even values and generate ticks hitting the domain bounds .
function tightDistanceBasedGenerator({
  distance,
  scale,
  minorCount = 0,
  unitDivider = 100,
  formatter = undefined,
}) {
  const step = !notNumber(unitDivider) && !notNumber(distance) ? Math.max(distance / unitDivider, 2) : 2;
  const count = Math.min(1000, Math.round(step)); 
  const n = count > 10 ? 10 : count;
  scale.nice(n);
  const majorTicks = scale.ticks(count);
  const ticks = minorCount > 0 ? appendMinorTicks(majorTicks, minorCount, scale) : majorTicks;
  ticks.sort((a, b) => a - b);
  const ticksFormatted = ticks.map(applyFormat(formatter));
  return ticks.map((tick, i) => {
    const position = scale(tick);
    return {
      position,
      start: position,
      end: position,
      label: ticksFormatted[i],
      value: tick,
      isMinor: majorTicks.indexOf(tick) === -1,
    };
  });
}
function tightDistanceBasedGenerator ( { distance , scale , minorCount = 0 , unitDivider = 100 , formatter = undefined , } ) { const step = ! notNumber ( unitDivider ) && ! notNumber ( distance ) ? Math . max ( distance / unitDivider , 2 ) : 2 ; const count = Math . min ( 1000 , Math . round ( step ) ) ; const n = count > 10 ? 10 : count ; scale . nice ( n ) ; const majorTicks = scale . ticks ( count ) ; const ticks = minorCount > 0 ? appendMinorTicks ( majorTicks , minorCount , scale ) : majorTicks ; ticks . sort ( ( a , b ) => a - b ) ; const ticksFormatted = ticks . map ( applyFormat ( formatter ) ) ; return ticks . map ( ( tick , i ) => { const position = scale ( tick ) ; return { position , start : position , end : position , label : ticksFormatted [ i ] , value : tick , isMinor : majorTicks . indexOf ( tick ) === - 1 , } ; } ) ; }
Generate ticks based on a distance, for each 100th unit, one additional tick may be added.
Generate ticks based on a distance for each 100th unit one additional tick may be added .
// safe guard against huge numbers