VisGraph

A complete graph prepared for visualization.

Usage

Source

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  # 15

Attributes

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  # 15

node_count

Number of nodes in the visualization.

node_count: int

Examples
graph.node_count  # 10

Methods

Name Description
to_dict() Serialize to a dictionary.

to_dict()

Serialize to a dictionary.

Usage

Source

to_dict()
Examples
d = graph.to_dict()
len(d["nodes"])  # 10