function getDomainByAccessor(allData, accessor, accessor0, type) {
  let domain;

  // Collect both attr and available attr0 values from the array of data.
  const values = allData.reduce((data, d) => {
    const value = accessor(d);
    const value0 = accessor0(d);
    if (_isDefined(value)) {
      data.push(value);
    }
    if (_isDefined(value0)) {
      data.push(value0);
    }
    return data;
  }, []);

  if (!values.length) {
    return [];
  }

  // Create proper domain depending on the type of the scale.
  if (type !== ORDINAL_SCALE_TYPE && type !== CATEGORY_SCALE_TYPE) {
    domain = extent(values);
  } else {
    domain = set(values).values();
  }
  return domain;
}
Get the domain from the array of data.
@param {Array} allData All data.
@param {function} accessor - accessor for main value.
@param {function} accessor0 - accessor for the naught value.
@param {string} type Scale type.
@returns {Array} Domain.
@private