source:
node_modules/d3-array/src/cumsum.js@
a762898
| Last change on this file since a762898 was e4c61dd, checked in by , 6 months ago | |
|---|---|
|
|
| File size: 218 bytes | |
| Rev | Line | |
|---|---|---|
| [e4c61dd] | 1 | export default function cumsum(values, valueof) { |
| 2 | var sum = 0, index = 0; | |
| 3 | return Float64Array.from(values, valueof === undefined | |
| 4 | ? v => (sum += +v || 0) | |
| 5 | : v => (sum += +valueof(v, index++, values) || 0)); | |
| 6 | } |
Note:
See TracBrowser
for help on using the repository browser.
