| # test_script.py | |
| import os | |
| import sys | |
| sys.path.append(os.path.join(os.path.dirname(__file__), "../")) | |
| from app.services.agn_service.build_graph import build_graph | |
| from app.services.agn_service.visualize_graph import visualize_graph | |
| # Define paths | |
| graph_file = "graphs/healthcare.json" # Update this to your actual graph file path | |
| output_image = "test_graph_visualization.png" | |
| # Step 1: Build the graph | |
| G = build_graph(graph_file) # This function should return the graph object | |
| # Step 2: Generate and save the graph visualization | |
| if G: | |
| visualize_graph(G, output_file=output_image) | |
| print(f"Graph visualization generated and saved as {output_image}") | |
| else: | |
| print("Failed to build graph.") |