json.links.forEach(function (e) {
var sourceNode = json.nodes.filter(function (n) {
return n.name === e.source;
})[0],
targetNode = json.nodes.filter(function (n) {
return n.name === e.target;
})[0];
e.source = sourceNode
e.target = targetNode
});
https://*.com/questions/23986466/d3-force-layout-linking-nodes-by-name-instead-of-index