Vue/graf/src/middleware/GrafModel.js
// These two new nodes are adjacent to all nodes the original node was adjacent to
These two new nodes are adjacent to all nodes the original node was adjacent to
These two new nodes are adjacent to all nodes the original node was adjacent to
expandNode(id) {
		let node = this.id_node_map.get(id);
		let outgoing_set = node.getAdjacentOutgoing();
		let incoming_set = node.getAdjacentIncoming(); 
		let new_node_id = this.curr_node_id;
		this.addNode();
		for (let adj_node of outgoing_set) {
			this.addEdgeHelper(new_node_id, adj_node.id);
		}
		for (let adj_node of incoming_set) {
			this.addEdgeHelper(adj_node.id, new_node_id);
		}
		this.addEdgeHelper(new_node_id, id);
	}
expandNode ( id ) { let node = this . id_node_map . get ( id ) ; let outgoing_set = node . getAdjacentOutgoing ( ) ; let incoming_set = node . getAdjacentIncoming ( ) ; let new_node_id = this . curr_node_id ; this . addNode ( ) ; for ( let adj_node of outgoing_set ) { this . addEdgeHelper ( new_node_id , adj_node . id ) ; } for ( let adj_node of incoming_set ) { this . addEdgeHelper ( adj_node . id , new_node_id ) ; } this . addEdgeHelper ( new_node_id , id ) ; }
These two new nodes are adjacent to all nodes the original node was adjacent to
These two new nodes are adjacent to all nodes the original node was adjacent to
// nodes that will be the targets of new edges // nodes that will be the sources of new edges