ego_graph(G, n, radius=1, center=True, undirected=False, distance=None)
For directed graphs D this produces the "out" neighborhood or successors. If you want the neighborhood of predecessors first reverse the graph with D.reverse(). If you want both directions use the keyword argument undirected=True.
Node, edge, and graph attributes are copied to the returned subgraph.
A NetworkX Graph or DiGraph
A single node
Include all neighbors of distance<=radius from n.
If False, do not include center node in graph
If True use both in- and out-neighbors of directed graphs.
Use specified edge data key as distance. For example, setting distance='weight' will use the edge weight to measure the distance from the node n.
Returns induced subgraph of neighbors centered at node n within a given radius.
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them