Key for nodes

This commit is contained in:
ziajka 2017-12-01 13:12:52 +01:00
parent 93bb5a4117
commit 732fcae48d

View File

@ -63,7 +63,9 @@ export class NodesWidget implements Widget {
const self = this; const self = this;
const node = view.selectAll<SVGGElement, any>('g.node') const node = view.selectAll<SVGGElement, any>('g.node')
.data(nodes); .data(nodes, (n: Node) => {
return n.node_id;
});
const node_enter = node.enter() const node_enter = node.enter()
.append<SVGGElement>('g') .append<SVGGElement>('g')