python-igraph manual

For using igraph from Python

   Home       Trees       Indices       Help   
Package igraph :: Package drawing :: Module graph :: Class DefaultGraphDrawer
[hide private]

Class DefaultGraphDrawer

source code

                 object --+            
                          |            
 baseclasses.AbstractDrawer --+        
                              |        
            AbstractGraphDrawer --+    
                                  |    
                 object --+       |    
                          |       |    
 baseclasses.AbstractDrawer --+   |    
                              |   |    
baseclasses.AbstractCairoDrawer --+    
                                  |    
           AbstractCairoGraphDrawer --+
                                      |
                                     DefaultGraphDrawer

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.

Instance Methods [hide private]
 
__init__(self, context, bbox, vertex_drawer_factory=<class 'igraph.drawing.vertex.DefaultVertexDrawer'>, edge_drawer_factory=<class 'igraph.drawing.edge.ArrowEdgeDrawer'>, label_drawer_factory=<class 'igraph.drawing.text.TextDrawer'>)
Constructs the graph drawer and associates it to the given Cairo context and the given BoundingBox.
source code
 
_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.
source code
 
_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.
source code
 
draw(self, graph, palette, *args, **kwds)
Abstract method, must be implemented in derived classes.
source code

Inherited from AbstractGraphDrawer: ensure_layout

Inherited from baseclasses.AbstractCairoDrawer (private): _mark_point

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from baseclasses.AbstractCairoDrawer: bbox

Inherited from object: __class__

Method Details [hide private]

__init__(self, context, bbox, vertex_drawer_factory=<class 'igraph.drawing.vertex.DefaultVertexDrawer'>, edge_drawer_factory=<class 'igraph.drawing.edge.ArrowEdgeDrawer'>, label_drawer_factory=<class 'igraph.drawing.text.TextDrawer'>)
(Constructor)

source code 

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

Parameters:
  • context - the context on which we will draw
  • bbox - the 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_factory - a 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_factory - a 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_factory - a 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.
Overrides: object.__init__

_determine_edge_order(self, graph, kwds)

source code 

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.

_determine_vertex_order(self, graph, kwds)

source code 

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.

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

source code 

Abstract method, must be implemented in derived classes.

Overrides: baseclasses.AbstractDrawer.draw
(inherited documentation)

   Home       Trees       Indices       Help