x: extent()

in src/AreaHeatmap.js [57:95]


      x: extent(
        flatten([data.map(makeAccessor2(x)), data.map(makeAccessor2(xEnd))]),
      ),
      y: extent(
        flatten([data.map(makeAccessor2(y)), data.map(makeAccessor2(yEnd))]),
      ),
    };
  }

  shouldComponentUpdate(nextProps) {
    const shouldUpdate = !xyPropsEqual(this.props, nextProps, ['rectStyle']);
    return shouldUpdate;
  }

  onMouseEnter = e => {
    this.props.onMouseEnter(e);
  };

  onMouseLeave = e => {
    this.props.onMouseLeave(e);
  };

  onMouseMove = e => {
    const { xScale, yScale, onMouseMove } = this.props;
    if (!isFunction(onMouseMove)) return;

    const boundBox = this.refs.background.getBoundingClientRect();
    if (!boundBox) return;
    const [x, y] = [
      e.clientX - (boundBox.left || 0),
      e.clientY - (boundBox.top || 0),
    ];
    const [xVal, yVal] = [xScale.invert(x), yScale.invert(y)];

    onMouseMove(e, { xVal, yVal });
  };

  render() {
    const {