()
| 67 | } |
| 68 | |
| 69 | update_data() { |
| 70 | this.dirty = true; |
| 71 | // Handling data updates |
| 72 | const numCols = this.colors[0].length; |
| 73 | |
| 74 | const flatColors = [].concat.apply( |
| 75 | [], |
| 76 | this.colors.map((x) => Array.prototype.slice.call(x, 0)) |
| 77 | ); |
| 78 | |
| 79 | this.mark_data = flatColors.map((data, index) => { |
| 80 | const rowNum = Math.floor(index / numCols); |
| 81 | const colNum = index % numCols; |
| 82 | |
| 83 | return { |
| 84 | rowNum: rowNum, |
| 85 | row: this.rows[rowNum], |
| 86 | column: this.columns[colNum], |
| 87 | columnNum: colNum, |
| 88 | color: data, |
| 89 | cellNum: index, |
| 90 | }; |
| 91 | }); |
| 92 | this.identifyModes(); |
| 93 | this.update_domains(); |
| 94 | this.dirty = false; |
| 95 | this.trigger('data_updated'); |
| 96 | } |
| 97 | |
| 98 | update_domains() { |
| 99 | if (!this.mark_data) { |
no test coverage detected