static getDomain()

in src/MarkerLineChart.js [194:232]


  static getDomain(props) {
    if (getTickType(props) === 'RangeValue') {
      // set range domain for range type
      const {
        data,
        x,
        xEnd,
        y,
        yEnd,
        xScaleType,
        yScaleType,
        horizontal,
      } = props;

      // only have to specify range axis domain, other axis uses default domainFromData
      // in this chart type, the range axis, if there is one, is always the *independent* variable
      const rangeAxis = horizontal ? 'y' : 'x';
      const rangeStartAccessor = horizontal
        ? makeAccessor2(y)
        : makeAccessor2(x);
      const rangeEndAccessor = horizontal
        ? makeAccessor2(yEnd)
        : makeAccessor2(xEnd);
      const rangeDataType = dataTypeFromScaleType(
        horizontal ? yScaleType : xScaleType,
      );

      return {
        [`${rangeAxis}Domain`]: domainFromRangeData(
          data,
          rangeStartAccessor,
          rangeEndAccessor,
          rangeDataType,
        ),
      };
    }

    return {};
  }