* Add row. * * @param {number} row Visual row index. * @param {Map} samples Samples Map object.
(row: number, samples: Map<string | number, SampleEntry>)
| 113 | * @param {Map} samples Samples Map object. |
| 114 | */ |
| 115 | addRow(row: number, samples: Map<string | number, SampleEntry>) { |
| 116 | if (this.columns.length) { |
| 117 | throwWithCause('Doesn\'t support multi-dimensional table'); |
| 118 | } |
| 119 | if (!this.rows.length) { |
| 120 | this.container = this.createContainer(this.hot!.rootElement.className); |
| 121 | } |
| 122 | const rowObject: Record<string, unknown> = { row }; |
| 123 | |
| 124 | this.rows.push(rowObject); |
| 125 | |
| 126 | this.samples = samples; |
| 127 | this.table = this.createTable(this.hot!.table.className); |
| 128 | this.table.colGroup.appendChild(this.createColGroupsCol(row)); |
| 129 | this.table.tr.appendChild(this.createRow(row)); |
| 130 | |
| 131 | this.container!.container.appendChild(this.table.fragment); |
| 132 | |
| 133 | rowObject.table = this.table.table; |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * Add a row consisting of the column headers. |
no test coverage detected