code: function(positions, rows_left) {
          var lasts_in_row = [];
          var n_overlaps = 0;
  
          for (var i = 0; i < positions.length; i++) {
              var pos_info = positions[i];
              var overlaps = [];
  
              // See if we can add item to an existing row without
              // overlapping the previous item in that row
              delete pos_info.row;
  
              for (var j = 0; j < lasts_in_row.length; j++) {
                  overlaps.push(lasts_in_row[j].end - pos_info.start);
                  if(overlaps[j] <= 0) {
                      pos_info.row = j;
                      lasts_in_row[j] = pos_info;
                      break;
                  }
              }
  
              // If we couldn't add to an existing row without overlap...
              if (typeof(pos_info.row) == 'undefined') {
                  if (rows_left === null) {
                      // Make a new row
                      pos_info.row = lasts_in_row.length;
                      lasts_in_row.push(pos_info);
                  } else if (rows_left > 0) {
                      // Make a new row
                      pos_info.row = lasts_in_row.length;
                      lasts_in_row.push(pos_info);
                      rows_left--;
                  } else {
                      // Add to existing row with minimum overlap.
                      var min_overlap = Math.min.apply(null, overlaps);
                      var idx = overlaps.indexOf(min_overlap);
                      pos_info.row = idx;
                      if (pos_info.end > lasts_in_row[idx].end) {
                          lasts_in_row[idx] = pos_info;
                      }
                      n_overlaps++;
                  }
              }
          }
  
          return {n_rows: lasts_in_row.length, n_overlaps: n_overlaps};
      }
docs: /*  Compute the marker row positions, minimizing the number of
  overlaps.
  
  @positions = list of objects from this._positions
  @rows_left = number of rows available (assume > 0)