Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
d3.scale = {};

function d3_scaleExtent(domain) {
  var start = domain[0], stop = domain[domain.length - 1];
  return start < stop ? [start, stop] : [stop, start];
}

function d3_scaleRange(scale) {
  return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range());
}
New to GrepCode? Check out our FAQ X