python-igraph API reference

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

class documentation

class DefaultGraphDrawer(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.
Instance Variable vertex_drawer_factory Undocumented
Instance Variable edge_drawer_factory Undocumented
Instance Variable label_drawer_factory Undocumented
Method draw Abstract method, must be implemented in derived classes.
Method _determine_edge_order No summary
Method _determine_vertex_order No summary

Inherited from AbstractGraphDrawer (via AbstractCairoGraphDrawer):

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:

Inherited from AbstractCairoDrawer (via AbstractCairoGraphDrawer):

Instance Variable context Undocumented
Property bbox The bounding box of the drawing area where this drawer will draw.
Method bbox.setter Sets the bounding box of the drawing area where this drawer will draw.
Instance Variable _bbox Undocumented
Method _mark_point Marks the given point with a small circle on the canvas. Used primarily for debugging purposes.
def __init__(self, context, bbox, vertex_drawer_factory=DefaultVertexDrawer, edge_drawer_factory=ArrowEdgeDrawer, label_drawer_factory=TextDrawer):

Constructs the graph drawer and associates it to the given Cairo context and the given BoundingBox.

Parameterscontextthe 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 three parameters: the Cairo context, the bounding box of the drawing area and the palette to be used for drawing colored vertices. The default vertex drawer is DefaultVertexDrawer.
edge_drawer_factorya factory method that returns an AbstractEdgeDrawer 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 ArrowEdgeDrawer.
label_drawer_factorya factory method that returns a TextDrawer instance bound to a given Cairo context. The method must take one parameter: the Cairo context. The default label drawer is TextDrawer.
vertex_drawer_factory =

Undocumented

edge_drawer_factory =

Undocumented

label_drawer_factory =

Undocumented

def _determine_edge_order(self, graph, kwds):

Returns the order in which the edge of the given graph have to be drawn, assuming that the relevant keyword arguments (edge_order and edge_order_by) are given in kwds as a dictionary. If neither edge_order nor edge_order_by is present in kwds, this function returns None to indicate that the graph drawer is free to choose the most convenient edge ordering.

def _determine_vertex_order(self, graph, kwds):

Returns the order in which the vertices of the given graph have to be drawn, assuming that the relevant keyword arguments (vertex_order and vertex_order_by) are given in kwds as a dictionary. If neither vertex_order nor vertex_order_by is present in kwds, this function returns None to indicate that the graph drawer is free to choose the most convenient vertex ordering.

def draw(self, graph, palette, *args, **kwds):

Abstract method, must be implemented in derived classes.

API Documentation for python-igraph, generated by pydoctor 21.2.2 at 2021-03-26 11:21:53.