function _getScaleDistanceAndAdjustedDomain(data, scaleObject) {
  const {domain, type, accessor, accessor0} = scaleObject;

  const uniqueValues = getUniquePropertyValues(data, accessor);

  // Fix time scale if a data has only one value.
  const values = _normalizeValues(data, uniqueValues, accessor0, type);
  const index = _getSmallestDistanceIndex(values, scaleObject);

  const adjustedDomain = [].concat(domain);

  adjustedDomain[0] -= _computeLeftDomainAdjustment(values);
  adjustedDomain[domain.length - 1] += _computeRightDomainAdjustment(values);
  // Fix log scale if it's too small.
  if (type === LOG_SCALE_TYPE && domain[0] <= 0) {
    adjustedDomain[0] = Math.min(domain[1] / 10, 1);
  }

  const adjustedScaleFn = getScaleFnFromScaleObject({
    ...scaleObject,
    domain: adjustedDomain
  });

  const distance = _computeScaleDistance(
    values,
    adjustedDomain,
    index,
    adjustedScaleFn
  );

  return {
    domain0: adjustedDomain[0],
    domainN: adjustedDomain[adjustedDomain.length - 1],
    distance
  };
}
Get the distance, the smallest and the largest value of the domain.
@param {Array} data Array of data for the single series.
@param {Object} scaleObject Scale object.
@returns {{domain0: number, domainN: number, distance: number}} Result.
@private