python-igraph manual

For using igraph from Python

   Home       Trees       Indices       Help   
Package igraph :: Package drawing :: Module shapes :: Class ShapeDrawerDirectory
[hide private]

Class ShapeDrawerDirectory

source code

object --+
         |
        ShapeDrawerDirectory

Static class that resolves shape names to their corresponding shape drawer classes.

Classes that are derived from ShapeDrawer in this module are automatically registered by ShapeDrawerDirectory when the module is loaded for the first time.

Instance Methods [hide private]

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

Class Methods [hide private]
 
register(cls, drawer_class)
Registers the given shape drawer class under the given names.
source code
 
register_namespace(cls, namespace)
Registers all ShapeDrawer classes in the given namespace
source code
 
resolve(cls, shape)
Given a shape name, returns the corresponding shape drawer class
source code
 
resolve_default(cls, shape, default=<class 'igraph.drawing.shapes.NullDrawer'>)
Given a shape name, returns the corresponding shape drawer class or the given default shape drawer if the shape name is unknown.
source code
Class Variables [hide private]
  known_shapes = {'': <class 'igraph.drawing.shapes.NullDrawer'>...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

register(cls, drawer_class)
Class Method

source code 

Registers the given shape drawer class under the given names.

Parameters:
  • drawer_class - the shape drawer class to be registered

register_namespace(cls, namespace)
Class Method

source code 

Registers all ShapeDrawer classes in the given namespace

Parameters:
  • namespace - a Python dict mapping names to Python objects.

resolve(cls, shape)
Class Method

source code 

Given a shape name, returns the corresponding shape drawer class

Parameters:
  • shape - the name of the shape
Returns:
the corresponding shape drawer class
Raises:
  • ValueError - if the shape is unknown

resolve_default(cls, shape, default=<class 'igraph.drawing.shapes.NullDrawer'>)
Class Method

source code 

Given a shape name, returns the corresponding shape drawer class or the given default shape drawer if the shape name is unknown.

Parameters:
  • shape - the name of the shape
  • default - the default shape drawer to return when the shape is unknown
Returns:
the shape drawer class corresponding to the given name or the default shape drawer class if the name is unknown

Class Variable Details [hide private]

known_shapes

Value:
{'': <class 'igraph.drawing.shapes.NullDrawer'>,
 'arrow': <class 'igraph.drawing.shapes.UpTriangleDrawer'>,
 'arrow-down': <class 'igraph.drawing.shapes.DownTriangleDrawer'>,
 'arrow-up': <class 'igraph.drawing.shapes.UpTriangleDrawer'>,
 'box': <class 'igraph.drawing.shapes.RectangleDrawer'>,
 'circle': <class 'igraph.drawing.shapes.CircleDrawer'>,
 'circular': <class 'igraph.drawing.shapes.CircleDrawer'>,
 'diamond': <class 'igraph.drawing.shapes.DiamondDrawer'>,
...

   Home       Trees       Indices       Help