# 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 index_file_path = "graphs/index.json" # Path to your index.json file output_image = "test_graph_visualization.png" # Step 1: Build the graph G = build_graph(index_file_path) # Pass the index file path here output_image = "test_graph_visualization.png" # 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.")