File size: 734 Bytes
64ed965
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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.")