// for use with `d3-playbooks-riot-components`

export default ({
  data,
  yCol,
  getColor
}, {getLabel}) => {
  if (!getLabel) getLabel = q => Math.round(q)
  return getColor.quantiles().map(q => {
    return {
      label: getLabel(q),
      color: getColor(q)
    }
  })
}

// for use with `d3-playbooks-riot-components`

export default ({
  yDomain,
  getColor
}, {getLabel}) => {
  if (!getLabel) getLabel = q => Math.round(q)
  const quantiles = getColor.quantiles()
  const quantileWidth = quantiles[0]
  quantiles.push(yDomain[1])
  return quantiles.map(q => {
    return {
      label: getLabel(q),
      color: getColor(q-quantileWidth/2)
    }
  })
}

Add maximum extent value to quantiles for legend
Add maximum extent value to quantiles for legend
