vispy.visuals.graphs.graph module

Graph Visual

This visual can be used to visualise graphs or networks.

class vispy.visuals.graphs.graph.GraphVisual(adjacency_mat=None, directed=False, layout=None, animate=False, line_color=None, line_width=None, arrow_type=None, arrow_size=None, node_symbol=None, node_size=None, border_color=None, face_color=None, border_width=None)

Bases: vispy.visuals.visual.CompoundVisual

Visual for displaying graphs or networks.

Parameters
adjacency_matarray or sparse

The adjacency matrix of the graph.

directedbool

Whether the graph is directed or not. If True, then this visual will draw arrows for the directed edges.

layoutstr

They layout to use.

animatebool

Whether or not to animate.

line_colorstr or vispy.color.colormap.ColorMap

The color to use for the edges.

line_widthnumber

The edge thickness.

arrow_typestr

The kind of arrow head to use. See vispy.visuals.ArrowHead for more information.

arrow_sizenumber

The size of the arrow head.

node_symbolstring

The marker to use for nodes. See vispy.visuals.MarkersVisual for more information.

node_sizenumber

The size of the node

border_colorstr or vispy.color.colormap.ColorMap

The border color for nodes.

face_colorstr or vispy.color.colormap.ColorMap

The face color for nodes.

border_widthnumber

The border size for nodes.

See also

ArrowVisual, MarkersVisual
property adjacency_matrix
property animate
animate_layout()
property directed
property layout
reset_layout()
set_data(adjacency_mat=None, **kwargs)

Set the data

Parameters
adjacency_matndarray | None

The adjacency matrix.

**kwargsdict

Keyword arguments to pass to the arrows.

set_final_layout()