ch/graph-coloring/app.js
//mouseup on vertices propagates to svg which calls hideDragLine
mouseup on vertices propagates to svg which calls hideDragLine
mouseup on vertices propagates to svg which calls hideDragLine
function endDragLine(d){
	if(!mousedownNode || mousedownNode===d) return;
	for(let i=0; i<links.length; i++){
		var l = links[i];
		if((l.source===mousedownNode && l.target===d) || (l.source===d && l.target===mousedownNode)){
			return;
		}
	}
	var newLink = {source: mousedownNode, target:d};
	links.push(newLink);
  restart();
  showGraphLatex();
}
function endDragLine ( d ) { if ( ! mousedownNode || mousedownNode === d ) return ; for ( let i = 0 ; i < links . length ; i ++ ) { var l = links [ i ] ; if ( ( l . source === mousedownNode && l . target === d ) || ( l . source === d && l . target === mousedownNode ) ) { return ; } } var newLink = { source : mousedownNode , target : d } ; links . push ( newLink ) ; restart ( ) ; showGraphLatex ( ) ; }
mouseup on vertices propagates to svg which calls hideDragLine
mouseup on vertices propagates to svg which calls hideDragLine
//return if link already exists