source:
node_modules/d3-array/src/cumsum.js@
e4c61dd
| Last change on this file since e4c61dd was e4c61dd, checked in by , 6 months ago | |
|---|---|
|
|
| File size: 218 bytes | |
| Line | |
|---|---|
| 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.
