(ranges, dimension)
| 506 | // for use by supplyDefaults, but it needed tons of pieces from here so |
| 507 | // seemed to make more sense just to put the whole routine here |
| 508 | function cleanRanges(ranges, dimension) { |
| 509 | if(Array.isArray(ranges[0])) { |
| 510 | ranges = ranges.map(function(ri) { return ri.sort(sortAsc); }); |
| 511 | |
| 512 | if(!dimension.multiselect) ranges = [ranges[0]]; |
| 513 | else ranges = dedupeRealRanges(ranges.sort(startAsc)); |
| 514 | } else ranges = [ranges.sort(sortAsc)]; |
| 515 | |
| 516 | // ordinal snapping |
| 517 | if(dimension.tickvals) { |
| 518 | var sortedTickVals = dimension.tickvals.slice().sort(sortAsc); |
| 519 | ranges = ranges.map(function(ri) { |
| 520 | var rSnapped = [ |
| 521 | ordinalScaleSnap(0, sortedTickVals, ri[0], []), |
| 522 | ordinalScaleSnap(1, sortedTickVals, ri[1], []) |
| 523 | ]; |
| 524 | if(rSnapped[1] > rSnapped[0]) return rSnapped; |
| 525 | }) |
| 526 | .filter(function(ri) { return ri; }); |
| 527 | |
| 528 | if(!ranges.length) return; |
| 529 | } |
| 530 | return ranges.length > 1 ? ranges : ranges[0]; |
| 531 | } |
| 532 | |
| 533 | module.exports = { |
| 534 | makeBrush: makeBrush, |
nothing calls this directly
no test coverage detected
searching dependent graphs…