Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept iterables. #153

Merged
merged 18 commits into from
Aug 19, 2020
Prev Previous commit
Next Next commit
Rename.
  • Loading branch information
mbostock committed Nov 19, 2019
commit 32221b2fca3da201bd18adfb288c7952af826a6d
6 changes: 3 additions & 3 deletions src/stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export default function() {
function stack(data) {
var kz = keys.apply(this, arguments),
sz = kz.map(stackSeries),
i, n = sz.length, m = -1,
i, n = sz.length, j = -1,
oz;

for (const d of data) {
for (i = 0, ++m; i < n; ++i) {
(sz[i][m] = [0, +value(d, kz[i], m, data)]).data = d;
for (i = 0, ++j; i < n; ++i) {
(sz[i][j] = [0, +value(d, kz[i], j, data)]).data = d;
}
}

Expand Down