export default function useChartArea(sizes, disableYAxis) {
  const {
    width: containerWidth,
    height: containerHeight,
    abbrYears
  } = sizes;
  const leftMargin = function getLeftMargin() {
    if (disableYAxis) {
      return 2;
    }
    if (abbrYears) {
      return 32;
    }
    return 45;
  }();
  const margin = {
    top: 20,
    right: 2,
    bottom: 5,
    left: leftMargin
  };
  const padding = {
    top: 14,
    bottom: 14
  };
  const width = containerWidth - margin.left - margin.right;
  const height = containerHeight - margin.top - margin.bottom;
  return {
    margin,
    padding,
    width,
    height
  };
}