function addLinks(links) {
		graph.edges =graph.edges || [];
		if (links!==undefined && links.length) {
			links.forEach(function(link, index) {
				var indexOfSourceAndTarget= getIndexOfSourceAndTarget(link);
				if (indexOfSourceAndTarget!==undefined && indexOfSourceAndTarget.sourceIndex!==undefined && indexOfSourceAndTarget.targetIndex!==undefined) {
					link.source =indexOfSourceAndTarget.sourceIndex;
					link.target = indexOfSourceAndTarget.targetIndex;
					graph.edges.push(link);
				}
			});
		}
	}
//parses the raw links to graph links and Add to the graph

parses the raw links to graph links and Add to the graph
parses the raw links to graph links and Add to the graph
function addLinks(links) {
		graph.edges =graph.edges || [];
		if (links!==undefined && links.length) {
			links.forEach(function(link, index) {
				var indexOfSourceAndTarget= getIndexOfSourceAndTarget(link);
				if (indexOfSourceAndTarget!==undefined && indexOfSourceAndTarget.sourceIndex!==undefined && indexOfSourceAndTarget.targetIndex!==undefined) {
					link.source =indexOfSourceAndTarget.sourceIndex;
					link.target = indexOfSourceAndTarget.targetIndex;
					graph.edges.push(link);
				}
			});
		}
	}
function addLinks ( links ) { graph . edges = graph . edges || [ ] ; if ( links !== undefined && links . length ) { links . forEach ( function ( link , index ) { var indexOfSourceAndTarget = getIndexOfSourceAndTarget ( link ) ; if ( indexOfSourceAndTarget !== undefined && indexOfSourceAndTarget . sourceIndex !== undefined && indexOfSourceAndTarget . targetIndex !== undefined ) { link . source = indexOfSourceAndTarget . sourceIndex ; link . target = indexOfSourceAndTarget . targetIndex ; graph . edges . push ( link ) ; } } ) ; } }
parses the raw links to graph links and Add to the graph
parses the raw links to graph links and Add to the graph