Merge branch 'main' into fix-entity-name-string

This commit is contained in:
zrguo
2024-12-09 17:30:40 +08:00
committed by GitHub
8 changed files with 406 additions and 289 deletions

View File

@@ -11,9 +11,17 @@ net = Network(height="100vh", notebook=True)
# Convert NetworkX graph to Pyvis network
net.from_nx(G)
# Add colors to nodes
# Add colors and title to nodes
for node in net.nodes:
node["color"] = "#{:06x}".format(random.randint(0, 0xFFFFFF))
if "description" in node:
node["title"] = node["description"]
# Add title to edges
for edge in net.edges:
if "description" in edge:
edge["title"] = edge["description"]
# Save and display the network
net.show("knowledge_graph.html")