function _adjustContinuousScale(props, scaleObject) {
  const {_allData: allSeriesData, _adjustWhat: adjustWhat = []} = props;

  // Assign the initial values.
  const domainLength = scaleObject.domain.length;
  const {domain} = scaleObject;
  let scaleDomain0 = domain[0];
  let scaleDomainN = domain[domainLength - 1];
  let scaleDistance = scaleObject.distance;

  // Find the smallest left position of the domain, the largest right position
  // of the domain and the best distance for them.
  allSeriesData.forEach((data, index) => {
    if (adjustWhat.indexOf(index) === -1) {
      return;
    }
    if (data && data.length) {
      const {domain0, domainN, distance} = _getScaleDistanceAndAdjustedDomain(
        data,
        scaleObject
      );
      scaleDomain0 = Math.min(scaleDomain0, domain0);
      scaleDomainN = Math.max(scaleDomainN, domainN);
      scaleDistance = Math.max(scaleDistance, distance);
    }
  });

  scaleObject.domain = [scaleDomain0, ...domain.slice(1, -1), scaleDomainN];

  scaleObject.distance = scaleDistance;

  return scaleObject;
}
Adjust continuous scales (e.g. 'linear', 'log' and 'time') by adding the
space from the left and right of them and by computing the best distance.
@param {Object} props Props.
@param {Object} scaleObject Scale object.
@returns {*} Scale object with adjustments.
@private