()
| 461 | } |
| 462 | |
| 463 | function makeFilter() { |
| 464 | var filter = []; |
| 465 | var consolidated; |
| 466 | var bounds; |
| 467 | return { |
| 468 | set: function(a) { |
| 469 | filter = a |
| 470 | .map(function(d) { return d.slice().sort(sortAsc); }) |
| 471 | .sort(startAsc); |
| 472 | |
| 473 | // handle unselected case |
| 474 | if(filter.length === 1 && |
| 475 | filter[0][0] === -Infinity && |
| 476 | filter[0][1] === Infinity) { |
| 477 | filter = [[0, -1]]; |
| 478 | } |
| 479 | |
| 480 | consolidated = dedupeRealRanges(filter); |
| 481 | bounds = filter.reduce(function(p, n) { |
| 482 | return [Math.min(p[0], n[0]), Math.max(p[1], n[1])]; |
| 483 | }, [Infinity, -Infinity]); |
| 484 | }, |
| 485 | get: function() { return filter.slice(); }, |
| 486 | getConsolidated: function() { return consolidated; }, |
| 487 | getBounds: function() { return bounds; } |
| 488 | }; |
| 489 | } |
| 490 | |
| 491 | function makeBrush(state, rangeSpecified, initialRange, brushStartCallback, brushCallback, brushEndCallback) { |
| 492 | var filter = makeFilter(); |
no test coverage detected
searching dependent graphs…