python-igraph API reference

List of all classes, functions and methods in python-igraph

class documentation

class CairoGraphDrawer(AbstractCairoGraphDrawer):

View In Hierarchy

Class implementing the default visualisation of a graph.

The default visualisation of a graph draws the nodes on a 2D plane according to a given Layout, then draws a straight or curved edge between nodes connected by edges. This is the visualisation used when one invokes the plot() function on a Graph object.

See Graph.__plot__() for the keyword arguments understood by this drawer.

Method __init__ Constructs the graph drawer and associates it to the given Cairo context and the given BoundingBox.
Method draw Abstract method, must be implemented in derived classes.
Instance Variable bbox The bounding box of the drawing area where this drawer will draw.
Instance Variable edge​_drawer​_factory Undocumented
Instance Variable label​_drawer​_factory Undocumented
Instance Variable vertex​_drawer​_factory Undocumented

Inherited from AbstractGraphDrawer (via AbstractCairoGraphDrawer):

Static Method ensure​_layout Helper method that ensures that layout is an instance of Layout. If it is not, the method will try to convert it to a Layout according to the following rules:
Static Method _determine​_edge​_order No summary
Static Method _determine​_vertex​_order No summary

Inherited from AbstractCairoDrawer (via AbstractCairoGraphDrawer):

Method bbox​.setter Sets the bounding box of the drawing area where this drawer will draw.
Instance Variable context Undocumented
Method _mark​_point Marks the given point with a small circle on the canvas. Used primarily for debugging purposes.
Instance Variable _bbox Undocumented
def __init__(self, context, bbox=None, vertex_drawer_factory=CairoVertexDrawer, edge_drawer_factory=CairoArrowEdgeDrawer, label_drawer_factory=CairoTextDrawer):
Constructs the graph drawer and associates it to the given Cairo context and the given BoundingBox.
Parameters
contextthe context on which we will draw
bboxthe bounding box within which we will draw. Can be anything accepted by the constructor of BoundingBox (i.e., a 2-tuple, a 4-tuple or a BoundingBox object).
vertex​_drawer​_factorya factory method that returns an AbstractCairoVertexDrawer instance bound to a given Cairo context. The factory method must take four parameters: the Cairo context, the bounding box of the drawing area, the palette to be used for drawing colored vertices, and the graph layout. The default vertex drawer is CairoVertexDrawer.
edge​_drawer​_factorya factory method that returns an AbstractCairoEdgeDrawer instance bound to a given Cairo context. The factory method must take two parameters: the Cairo context and the palette to be used for drawing colored edges. You can use any of the actual AbstractEdgeDrawer implementations here to control the style of edges drawn by igraph. The default edge drawer is CairoArrowEdgeDrawer.
label​_drawer​_factorya factory method that returns a CairoTextDrawer instance bound to a given Cairo context. The method must take one parameter: the Cairo context. The default label drawer is CairoTextDrawer.
def draw(self, graph, *args, **kwds):
Abstract method, must be implemented in derived classes.
bbox =
The bounding box of the drawing area where this drawer will draw.
edge_drawer_factory =

Undocumented

label_drawer_factory =

Undocumented

vertex_drawer_factory =

Undocumented