Visualizer Module

Visualization tool.

This module provides:

class graphqomb.visualizer.ColorMap[source]

Color map for the nodes.

__new__(value)
class graphqomb.visualizer.FigureSetup[source]

Parameters for setting up the figure.

x_min: float

Alias for field number 0

x_max: float

Alias for field number 1

y_min: float

Alias for field number 2

y_max: float

Alias for field number 3

padding: float

Alias for field number 4

fig_width: float

Alias for field number 5

fig_height: float

Alias for field number 6

static __new__(_cls, x_min, x_max, y_min, y_max, padding, fig_width, fig_height)

Create new instance of FigureSetup(x_min, x_max, y_min, y_max, padding, fig_width, fig_height)

graphqomb.visualizer.visualize(graph, *, ax=None, show_node_labels=True, node_size=300, show_legend=True, use_graph_coordinates=True)[source]

Visualize the GraphState.

Parameters:
  • graph (BaseGraphState) – GraphState to visualize.

  • ax (matplotlib.axes.Axes | None, optional) – Matplotlib Axes to draw on, by default None

  • show_node_labels (bool, optional) – Whether to show node index labels, by default True

  • node_size (float, optional) – Size of nodes (scatter size), by default 300

  • show_legend (bool, optional) – Whether to show color legend, by default True

  • use_graph_coordinates (bool, optional) – Whether to use coordinates stored in the graph. If True and the graph has coordinates, those coordinates are used (projected to 2D for 3D coordinates). Nodes without coordinates will use auto-calculated positions. By default True.

Returns:

The Axes object containing the visualization

Return type:

matplotlib.axes.Axes

Notes

Currently only 2D visualization is supported. For 3D coordinates, only the x and y components are used; the z component is ignored. 3D visualization support is planned for a future release.