normalize = ({ value, min, max, scaleMin = 0, scaleMax = 1 }) => {
  // If the `min` and `max` are the same value, it means our dataset is flat.
  // For now, let's assume that flat data should be aligned to the bottom.
  if (min === max) {
    return scaleMin;
  }

  return scaleMin + (value - min) * (scaleMax - scaleMin) / (max - min);
}
normalize
This lets us translate a value from one scale to another.

@param {Number} value - Our initial value to translate
@param {Number} min - the current minimum value possible
@param {Number} max - the current maximum value possible
@param {Number} scaleMin - the min value of the scale we're translating to
@param {Number} scaleMax - the max value of the scale we're translating to

@returns {Number} the value on its new scale