function getColumnSpan(itemWidth, columnWidth, columns, threshold) {
  let columnSpan = itemWidth / columnWidth;

  // If the difference between the rounded column span number and the
  // calculated column span number is really small, round the number to
  // make it fit.
  if (Math.abs(Math.round(columnSpan) - columnSpan) < threshold) {
    // e.g. columnSpan = 4.0089945390298745
    columnSpan = Math.round(columnSpan);
  }

  // Ensure the column span is not more than the amount of columns in the whole layout.
  return Math.min(Math.ceil(columnSpan), columns);
}
Determine the number of columns an items spans.
@param {number} itemWidth Width of the item.
@param {number} columnWidth Width of the column (includes gutter).
@param {number} columns Total number of columns
@param {number} threshold A buffer value for the size of the column to fit.
@return {number}