function getPolygons(props) {
  const {
    animation,
    colorRange,
    domains,
    data,
    style,
    startingAngle,
    onSeriesMouseOver,
    onSeriesMouseOut
  } = props;

  const scales = domains.reduce((acc, {domain, name}) => {
    acc[name] = scaleLinear()
      .domain(domain)
      .range([0, 1]);
    return acc;
  }, {});

  return data.map((row, rowIndex) => {
    const mappedData = domains.map(({name, getValue}, index) => {
      const dataPoint = getValue ? getValue(row) : row[name];
      // error handling if point doesn't exist
      const angle = (index / domains.length) * Math.PI * 2 + startingAngle;
      // dont let the radius become negative
      const radius = Math.max(scales[name](dataPoint), 0);
      return {
        x: radius * Math.cos(angle),
        y: radius * Math.sin(angle),
        name: row.name
      };
    });

    return (
      <PolygonSeries
        animation={animation}
        className={`${predefinedClassName}-polygon`}
        key={`${rowIndex}-polygon`}
        data={mappedData}
        style={{
          stroke:
            row.color || row.stroke || colorRange[rowIndex % colorRange.length],
          fill:
            row.color || row.fill || colorRange[rowIndex % colorRange.length],
          ...style.polygons
        }}
        onSeriesMouseOver={onSeriesMouseOver}
        onSeriesMouseOut={onSeriesMouseOut}
      />
    );
  });
}
Generate the actual polygons to be plotted
@param {Object} props
 - props.animation {Boolean}
 - props.data {Array} array of object specifying what values are to be plotted
 - props.domains {Array} array of object specifying the way each axis is to be plotted
 - props.startingAngle {number} the initial angle offset
 - props.style {object} style object for the whole chart
@return {Array} the plotted axis components