Spaces:
Paused
Paused
Hemang Thakur
commited on
Commit
·
95dc0b5
1
Parent(s):
23c4573
graph display height
Browse files
frontend/src/Components/AiComponents/Graph.css
CHANGED
@@ -71,7 +71,7 @@
|
|
71 |
display: flex !important;
|
72 |
justify-content: center !important;
|
73 |
align-items: center !important;
|
74 |
-
height:
|
75 |
color: #fff !important;
|
76 |
}
|
77 |
|
@@ -80,6 +80,6 @@
|
|
80 |
display: flex !important;
|
81 |
justify-content: center !important;
|
82 |
align-items: center !important;
|
83 |
-
height:
|
84 |
color: red !important;
|
85 |
}
|
|
|
71 |
display: flex !important;
|
72 |
justify-content: center !important;
|
73 |
align-items: center !important;
|
74 |
+
height: 50% !important;
|
75 |
color: #fff !important;
|
76 |
}
|
77 |
|
|
|
80 |
display: flex !important;
|
81 |
justify-content: center !important;
|
82 |
align-items: center !important;
|
83 |
+
height: 50% !important;
|
84 |
color: red !important;
|
85 |
}
|
src/rag/graph_rag.py
CHANGED
@@ -1183,7 +1183,7 @@ class GraphRAG:
|
|
1183 |
graph_data = self._get_current_graph_data()
|
1184 |
graph = graph_data["graph"]
|
1185 |
node_map = graph_data["node_map"]
|
1186 |
-
net = Network(height="
|
1187 |
net.options = {"physics": {"enabled": False}}
|
1188 |
all_nodes = set()
|
1189 |
all_edges = []
|
@@ -1220,13 +1220,17 @@ class GraphRAG:
|
|
1220 |
net.options["layout"] = {"improvedLayout": True}
|
1221 |
net.options["interaction"] = {"dragNodes": True}
|
1222 |
|
|
|
1223 |
os.chdir(os.getenv("WRITABLE_DIR", "/tmp"))
|
|
|
1224 |
net.save_graph("temp_graph.html")
|
1225 |
|
1226 |
with open("temp_graph.html", "r", encoding="utf-8") as f:
|
1227 |
html_str = f.read()
|
1228 |
|
1229 |
os.remove("temp_graph.html")
|
|
|
|
|
1230 |
return html_str
|
1231 |
|
1232 |
def verify_graph_integrity(self):
|
|
|
1183 |
graph_data = self._get_current_graph_data()
|
1184 |
graph = graph_data["graph"]
|
1185 |
node_map = graph_data["node_map"]
|
1186 |
+
net = Network(height="550px", width="100%", directed=True, bgcolor="#222222", font_color="white")
|
1187 |
net.options = {"physics": {"enabled": False}}
|
1188 |
all_nodes = set()
|
1189 |
all_edges = []
|
|
|
1220 |
net.options["layout"] = {"improvedLayout": True}
|
1221 |
net.options["interaction"] = {"dragNodes": True}
|
1222 |
|
1223 |
+
original_dir = os.getcwd()
|
1224 |
os.chdir(os.getenv("WRITABLE_DIR", "/tmp"))
|
1225 |
+
|
1226 |
net.save_graph("temp_graph.html")
|
1227 |
|
1228 |
with open("temp_graph.html", "r", encoding="utf-8") as f:
|
1229 |
html_str = f.read()
|
1230 |
|
1231 |
os.remove("temp_graph.html")
|
1232 |
+
os.chdir(original_dir)
|
1233 |
+
|
1234 |
return html_str
|
1235 |
|
1236 |
def verify_graph_integrity(self):
|