addon/utils/graph-view.js
function _getLinks(nodes) {
  var links = [],
      nodeHash;

  nodeHash = nodes.reduce(function (obj, node) {
    obj[node.id] = node;
    return obj;
  }, {});

  _data.links.forEach(function (link) {
    var source = nodeHash[link.sourceId],
        target = nodeHash[link.targetId];
    if(source && target) {
      link.setProperties({
        source: source,
        target: target,
        isBackwardLink: source.isSelfOrAncestor(target)
      });
      links.push(link);
    }
  });

  return links;
}
function _getLinks(nodes) {
  var links = [],
      nodeHash;

  nodeHash = nodes.reduce(function (obj, node) {
    obj[node.id] = node;
    return obj;
  }, {});

  _data.links.forEach(function (link) {
    var source = nodeHash[link.sourceId],
        target = nodeHash[link.targetId];
    if(source && target) {
      link.setProperties({
        source: source,
        target: target,
        isBackwardLink: source.isSelfOrAncestor(target)
      });
      links.push(link);
    }
  });

  return links;
}
function _getLinks ( nodes ) { var links = [ ] , nodeHash ; nodeHash = nodes . reduce ( function ( obj , node ) { obj [ node . id ] = node ; return obj ; } , { } ) ; _data . links . forEach ( function ( link ) { var source = nodeHash [ link . sourceId ] , target = nodeHash [ link . targetId ] ; if ( source && target ) { link . setProperties ( { source : source , target : target , isBackwardLink : source . isSelfOrAncestor ( target ) } ) ; links . push ( link ) ; } } ) ; return links ; }
Create a list of all links connecting nodes in the given array.
@param nodes {Array} A list of d3 nodes created by tree layout
@return links {Array} All links between nodes in the current DAG
Create a list of all links connecting nodes in the given array .