@staticmethod
def _layoutChunk(entries, start, dims):
    """Layout the entries into the given box, starting at start"""
    row, col = start
    numrows, numcols = dims
    colstats = [0] * numcols
    layout = []
    for plotter, num, lines in entries:
        if row + lines > numrows:
            col += 1
            row = 0
        if col >= numcols:
            return [], [], numrows + 1
        if lines > numrows:
            return [], [], lines
        layout.append((plotter, num, col, row, lines))
        row += lines
        colstats[col] += 1
    return layout, colstats, numrows
