python-igraph manual

For using igraph from Python

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

Class AbstractGraphDrawer

source code

                object --+    
                         |    
baseclasses.AbstractDrawer --+
                             |
                            AbstractGraphDrawer
Known Subclasses:

Abstract class that serves as a base class for anything that draws an igraph.Graph.

Instance Methods [hide private]
 
draw(self, graph, *args, **kwds)
Abstract method, must be implemented in derived classes.
source code
 
ensure_layout(self, layout, graph=None)
Helper method that ensures that layout is an instance of Layout.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

source code 

Abstract method, must be implemented in derived classes.

Overrides: baseclasses.AbstractDrawer.draw

ensure_layout(self, layout, graph=None)

source code 

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:

  • If layout is a string, it is assumed to be a name of an igraph layout, and it will be passed on to the layout method of the given graph if graph is not None.
  • If layout is None, the layout method of graph will be invoked with no parameters, which will call the default layout algorithm.
  • Otherwise, layout will be passed on to the constructor of Layout. This handles lists of lists, lists of tuples and such.

If layout is already a Layout instance, it will still be copied and a copy will be returned. This is because graph drawers are allowed to transform the layout for their purposes, and we don't want the transformation to propagate back to the caller.


   Home       Trees       Indices       Help