File size: 262 Bytes
e7b2eb4
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
function d3_uninterpolateNumber(a, b) {
  b = (b -= a = +a) || 1 / b;
  return function(x) { return (x - a) / b; };
}

function d3_uninterpolateClamp(a, b) {
  b = (b -= a = +a) || 1 / b;
  return function(x) { return Math.max(0, Math.min(1, (x - a) / b)); };
}