23
23
from neo4j_graphrag .utils .logging import prettify
24
24
25
25
try :
26
- from neo4j_viz import Node , Relationship , VisualizationGraph as NeoVizGraph
26
+ from neo4j_viz import Node , Relationship , VisualizationGraph as NeoVizGraph , CaptionAlignment
27
27
28
28
HAS_NEO4J_VIZ = True
29
29
except ImportError :
@@ -244,6 +244,11 @@ def get_neo4j_viz_graph(self, hide_unused_outputs: bool = True) -> NeoVizGraph:
244
244
caption = f"{ node .component .__class__ .__name__ } : { n } ({ comp_inputs } )" ,
245
245
size = 20 , # Component nodes are larger
246
246
color = "#4C8BF5" , # Blue for component nodes
247
+ caption_align = CaptionAlignment .CENTER ,
248
+ caption_size = 12 ,
249
+ pinned = False ,
250
+ x = 0 ,
251
+ y = 0
247
252
)
248
253
)
249
254
node_counter += 1
@@ -258,12 +263,20 @@ def get_neo4j_viz_graph(self, hide_unused_outputs: bool = True) -> NeoVizGraph:
258
263
caption = o ,
259
264
size = 10 , # Output nodes are smaller
260
265
color = "#34A853" , # Green for output nodes
266
+ caption_align = CaptionAlignment .CENTER ,
267
+ caption_size = 10 ,
268
+ pinned = False ,
269
+ x = 0 ,
270
+ y = 0
261
271
)
262
272
)
263
273
# Connect component to its output
264
274
relationships .append (
265
275
Relationship (
266
- source = node_ids [n ], target = node_ids [param_node_name ], caption = ""
276
+ source = node_ids [n ], target = node_ids [param_node_name ], caption = "" ,
277
+ caption_align = CaptionAlignment .CENTER ,
278
+ caption_size = 10 ,
279
+ color = "#000000"
267
280
)
268
281
)
269
282
node_counter += 1
@@ -285,6 +298,8 @@ def get_neo4j_viz_graph(self, hide_unused_outputs: bool = True) -> NeoVizGraph:
285
298
target = node_ids [component_name ],
286
299
caption = param ,
287
300
color = "#EA4335" , # Red for parameter connections
301
+ caption_align = CaptionAlignment .CENTER ,
302
+ caption_size = 10
288
303
)
289
304
)
290
305
0 commit comments