File size: 702 Bytes
f5b1acc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 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.")