(indices)
| 465 | } |
| 466 | |
| 467 | private computeDataIndices(indices) { |
| 468 | //input is a list of indices corresponding to the bars. Output is |
| 469 | //the list of indices in the data |
| 470 | const intervals = this.reduceIntervals(indices); |
| 471 | if (intervals.length === 0) { |
| 472 | return []; |
| 473 | } |
| 474 | |
| 475 | const x_data = this.model.get('sample'); |
| 476 | const num_intervals = intervals.length; |
| 477 | const indices_data = new Uint32Array(_.range(x_data.length)); |
| 478 | const selected = indices_data.filter((index) => { |
| 479 | const elem = x_data[index]; |
| 480 | for (let iter = 0; iter < num_intervals; iter++) { |
| 481 | if (elem <= intervals[iter][1] && elem >= intervals[iter][0]) { |
| 482 | return true; |
| 483 | } |
| 484 | } |
| 485 | return false; |
| 486 | }); |
| 487 | return selected; |
| 488 | } |
| 489 | |
| 490 | private reduceIntervals(indices: number[]) { |
| 491 | //for a series of indices, reduces them to the minimum possible |
no test coverage detected