VisGraph
A complete graph prepared for visualization.
Usage
VisGraph()Parameters
nodes: list[VisNode] = list()-
Visualization nodes.
edges: list[VisEdge] = list()-
Visualization edges.
title: str = "Knowledge Graph"- Graph title.
Examples
import talk_box as tb
graph = tb.prepare_vis_graph(kg)
graph.node_count # 10
graph.edge_count # 15Attributes
| Name | Description |
|---|---|
| edge_count | Number of edges in the visualization. |
| node_count | Number of nodes in the visualization. |
edge_count
Number of edges in the visualization.
edge_count: int
Examples
graph.edge_count # 15node_count
Number of nodes in the visualization.
node_count: int
Examples
graph.node_count # 10Methods
| Name | Description |
|---|---|
| to_dict() | Serialize to a dictionary. |
to_dict()
Serialize to a dictionary.
Usage
to_dict()Examples
d = graph.to_dict()
len(d["nodes"]) # 10