(table)
| 125 | } |
| 126 | |
| 127 | function fillInTable(table) { |
| 128 | let h_max = maxHeight(table); |
| 129 | let w_max = maxWidth(table); |
| 130 | debug(`Max rows: ${h_max}; Max cols: ${w_max}`); |
| 131 | for (let y = 0; y < h_max; y++) { |
| 132 | for (let x = 0; x < w_max; x++) { |
| 133 | if (!conflictExists(table, x, y)) { |
| 134 | let opts = { x: x, y: y, colSpan: 1, rowSpan: 1 }; |
| 135 | x++; |
| 136 | while (x < w_max && !conflictExists(table, x, y)) { |
| 137 | opts.colSpan++; |
| 138 | x++; |
| 139 | } |
| 140 | let y2 = y + 1; |
| 141 | while (y2 < h_max && allBlank(table, y2, opts.x, opts.x + opts.colSpan)) { |
| 142 | opts.rowSpan++; |
| 143 | y2++; |
| 144 | } |
| 145 | let cell = new Cell(opts); |
| 146 | cell.x = opts.x; |
| 147 | cell.y = opts.y; |
| 148 | warn(`Missing cell at ${cell.y}-${cell.x}.`); |
| 149 | insertCell(cell, table[y]); |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | function generateCells(rows) { |
| 156 | return rows.map(function (row) { |
no test coverage detected
searching dependent graphs…