Vue/graf/src/middleware/GrafModel.js
// Removes node corresponding to node_id from the graph model and the simulation
Removes node corresponding to node_id from the graph model and the simulation
Removes node corresponding to node_id from the graph model and the simulation
removeNode(node_id) {
		let node = this.id_node_map.get(node_id);
		let sim_id = parseInt(`${node_id}`);
		for (let edge of node.getEdges()) {
			this.removeEdge(edge.getId());
		}
		this.id_node_map.delete(node_id);
		this.sim_wrapper.removeSimNode(sim_id);
		if (this.id_node_map.size === 0) {
			this.curr_node_id = 0;
			this.curr_edge_id = 0;
		}
	}
removeNode ( node_id ) { let node = this . id_node_map . get ( node_id ) ; let sim_id = parseInt ( ` ${ node_id } ` ) ; for ( let edge of node . getEdges ( ) ) { this . removeEdge ( edge . getId ( ) ) ; } this . id_node_map . delete ( node_id ) ; this . sim_wrapper . removeSimNode ( sim_id ) ; if ( this . id_node_map . size === 0 ) { this . curr_node_id = 0 ; this . curr_edge_id = 0 ; } }
Removes node corresponding to node_id from the graph model and the simulation
Removes node corresponding to node_id from the graph model and the simulation