createHourlyValueDistribution = hourlyValueMap => {
  return Object.keys(hourlyValueMap).map(hour => {
    const histogram = hourlyValueMap[hour].reduce((histo, value) => {
      const bin = Math.sign(value) * Math.floor(Math.abs(value) * RESOLUTION);
      if (histo[bin]) {
        histo[bin] += 1;
      } else {
        histo[bin] = 1;
      }
      return histo;
    }, {});

    const sortedEntries = Object.entries(histogram)
      .map(([bin, count]) => [Number(bin), count])
      .sort(([a], [b]) => a - b);

    const prefixSumEntries = sortedEntries.reduce(
      (prefixSum, [bin, count], idx) => {
        const prevCount = prefixSum[idx][1];
        prefixSum.push([bin, prevCount + count]);
        return prefixSum;
      },
      [sortedEntries[0]]
    );

    const prefixSum = prefixSumEntries[prefixSumEntries.length - 1][1];
    const distribution = prefixSumEntries.map(([bin, count]) => ({
      // decimal => percentage
      stop: (count / prefixSum) * 100,
      value: bin / RESOLUTION,
    }));

    return {
      day: Math.floor(hour / 24),
      hour: hour % 24,
      distribution,
    };
  });
}
Convert a given hour: values map to an array of calendar meta data
TODO: will break this funciton into multiple functions and reuse those in mlvis-common
@param {object} hourlyValueMap - a hash map of hour: values
@return an array of object, with day & hour as row & column Ids
and the equalized distribution