Vue/graf/src/middleware/GrafModel.js
// Wrapper to check if selection is valid for contraction, calls corresponding helper function
Wrapper to check if selection is valid for contraction, calls corresponding helper function
Wrapper to check if selection is valid for contraction calls corresponding helper function
contract() {
		if (this.selection
			&& this.selection.getSelectionAmount() == 1
			&& this.selection.getSelectionType() == "Node") {
			let id = this.selection.getSelectedNodeIds()[0];
			this.contractNode(id);
			this.selection = null;
		}
		else if (this.selection
			&& this.selection.getSelectionAmount() == 1
			&& this.selection.getSelectionType() == "Edge") {
			let id = this.selection.getSelectedEdgeIds()[0];
			this.contractEdge(id);
			this.selection = null;
		}
		else {
			console.log("WARNING: attempted to contract given an invalid selection, attempt ignored");
		}
	}
contract ( ) { if ( this . selection && this . selection . getSelectionAmount ( ) == 1 && this . selection . getSelectionType ( ) == "Node" ) { let id = this . selection . getSelectedNodeIds ( ) [ 0 ] ; this . contractNode ( id ) ; this . selection = null ; } else if ( this . selection && this . selection . getSelectionAmount ( ) == 1 && this . selection . getSelectionType ( ) == "Edge" ) { let id = this . selection . getSelectedEdgeIds ( ) [ 0 ] ; this . contractEdge ( id ) ; this . selection = null ; } else { console . log ( "WARNING: attempted to contract given an invalid selection, attempt ignored" ) ; } }
Wrapper to check if selection is valid for contraction, calls corresponding helper function
Wrapper to check if selection is valid for contraction calls corresponding helper function