source:
node_modules/d3-interpolate/src/discrete.js@
e4c61dd
| Last change on this file since e4c61dd was e4c61dd, checked in by , 6 months ago | |
|---|---|
|
|
| File size: 154 bytes | |
| Line | |
|---|---|
| 1 | export default function(range) { |
| 2 | var n = range.length; |
| 3 | return function(t) { |
| 4 | return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))]; |
| 5 | }; |
| 6 | } |
Note:
See TracBrowser
for help on using the repository browser.
