Initialize link.index, too.

This commit is contained in:
Mike Bostock 2016-04-20 12:38:01 -07:00
parent 541ef54098
commit 166bda8cdd

View File

@ -38,7 +38,7 @@ export default function(links) {
}
for (i = 0, bias = new Array(m); i < m; ++i) {
l = links[i];
l = links[i], l.index = i;
if (typeof l.source === "number") l.source = nodes[l.source];
if (typeof l.target === "number") l.target = nodes[l.target];
++count[l.source.index];