(
columnName, includeTime, normalize, beginIndex, length, stride)
| 206 | } |
| 207 | |
| 208 | getColumnData( |
| 209 | columnName, includeTime, normalize, beginIndex, length, stride) { |
| 210 | const columnIndex = this.dataColumnNames.indexOf(columnName); |
| 211 | tf.util.assert(columnIndex >= 0, `Invalid column name: ${columnName}`); |
| 212 | |
| 213 | if (beginIndex == null) { |
| 214 | beginIndex = 0; |
| 215 | } |
| 216 | if (length == null) { |
| 217 | length = this.numRows - beginIndex; |
| 218 | } |
| 219 | if (stride == null) { |
| 220 | stride = 1; |
| 221 | } |
| 222 | const out = []; |
| 223 | for (let i = beginIndex; i < beginIndex + length && i < this.numRows; |
| 224 | i += stride) { |
| 225 | let value = normalize ? this.normalizedData[i][columnIndex] : |
| 226 | this.data[i][columnIndex]; |
| 227 | if (includeTime) { |
| 228 | value = {x: this.dateTime[i].getTime(), y: value}; |
| 229 | } |
| 230 | out.push(value); |
| 231 | } |
| 232 | return out; |
| 233 | } |
| 234 | |
| 235 | /** |
| 236 | * Get a data iterator function. |
no test coverage detected