()
| 123 | // Column names from the current data for the data table. |
| 124 | @computed |
| 125 | get keys(): ColumnHeader[] { |
| 126 | function createColumnHeader(name: string, type: LitType) { |
| 127 | const [minWidth, maxWidth] = type.name in LIT_TYPE_MIN_MAX_WIDTHS ? |
| 128 | LIT_TYPE_MIN_MAX_WIDTHS[type.name] : []; |
| 129 | |
| 130 | const header = { |
| 131 | name, |
| 132 | maxWidth, |
| 133 | minWidth, |
| 134 | width: maxWidth, |
| 135 | vocab: (type as LitTypeWithVocab).vocab |
| 136 | }; |
| 137 | |
| 138 | if (type instanceof BooleanLitType) { |
| 139 | header.vocab = ['✔', ' ']; |
| 140 | } |
| 141 | return header; |
| 142 | } |
| 143 | |
| 144 | // Use currentInputData to get keys / column names because filteredData |
| 145 | // might have 0 length; |
| 146 | const keyNames = this.appState.currentInputDataKeys; |
| 147 | const keys = |
| 148 | keyNames.map(key => createColumnHeader(key, this.dataSpec[key])); |
| 149 | const dataKeys = this.dataService.cols.map( |
| 150 | col => createColumnHeader(col.name, col.dataType)); |
| 151 | return keys.concat(dataKeys); |
| 152 | } |
| 153 | |
| 154 | // Filtered keys that hide ones tagged as not to be shown by default in the |
| 155 | // data table. The filtered ones can still be enabled through the "Columns" |
no outgoing calls