Vue/graf/src/middleware/GrafModel.js
// Wrapper to check if an edge can be added to the given selection, calls helper if it can
Wrapper to check if an edge can be added to the given selection, calls helper if it can
Wrapper to check if an edge can be added to the given selection calls helper if it can
addEdge() {
		if (this.selection != null
			&& this.selection.getSelectionAmount() == 2
			&& this.selection.getSelectionType() == "Node") {
			let s_id = this.selection.getSelectedNodeIds()[0];
			let t_id = this.selection.getSelectedNodeIds()[1];
			this.addEdgeHelper(s_id, t_id);
			this.selection = null;
		}
		else {
			console.log("WARNING: attempted to add an edge given an invalid selection, attempt ignored");
		}
	}
addEdge ( ) { if ( this . selection != null && this . selection . getSelectionAmount ( ) == 2 && this . selection . getSelectionType ( ) == "Node" ) { let s_id = this . selection . getSelectedNodeIds ( ) [ 0 ] ; let t_id = this . selection . getSelectedNodeIds ( ) [ 1 ] ; this . addEdgeHelper ( s_id , t_id ) ; this . selection = null ; } else { console . log ( "WARNING: attempted to add an edge given an invalid selection, attempt ignored" ) ; } }
Wrapper to check if an edge can be added to the given selection, calls helper if it can
Wrapper to check if an edge can be added to the given selection calls helper if it can