function buildLabels(mappedData, accessors) {
  const {getAngle, getAngle0, getLabel, getRadius0} = accessors;

  return mappedData.filter(getLabel).map(row => {
    const truedAngle = -1 * getAngle(row) + Math.PI / 2;
    const truedAngle0 = -1 * getAngle0(row) + Math.PI / 2;
    const angle = (truedAngle0 + truedAngle) / 2;
    const rotateLabels = !row.dontRotateLabel;
    const rotAngle = (-angle / (2 * Math.PI)) * 360;

    return {
      ...row,
      children: null,
      angle: null,
      radius: null,
      x: getRadius0(row) * Math.cos(angle),
      y: getRadius0(row) * Math.sin(angle),
      style: {
        textAnchor: rotAngle > 90 ? 'end' : 'start',
        ...row.labelStyle
      },
      rotation: rotateLabels
        ? rotAngle > 90
          ? rotAngle + 180
          : rotAngle === 90
          ? 90
          : rotAngle
        : null
    };
  });
}
Convert arc nodes into label rows.
Important to use mappedData rather than regular data, bc it is already unrolled
@param {Array} mappedData - Array of nodes.
@param {Object} accessors - object of accessors
@returns {Array} array of node for rendering as labels