Initialize link.index, too.
This commit is contained in:
parent
541ef54098
commit
166bda8cdd
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user