python-igraph manual

For using igraph from Python

   Home       Trees       Indices       Help   
Package igraph :: Package drawing :: Module baseclasses :: Class AbstractCairoDrawer
[hide private]

Class AbstractCairoDrawer

source code

    object --+    
             |    
AbstractDrawer --+
                 |
                AbstractCairoDrawer
Known Subclasses:

Abstract class that serves as a base class for anything that draws on a Cairo context within a given bounding box.

A subclass of AbstractCairoDrawer is guaranteed to have an attribute named context that represents the Cairo context to draw on, and an attribute named bbox for the BoundingBox of the drawing area.

Instance Methods [hide private]
 
__init__(self, context, bbox)
Constructs the drawer and associates it to the given Cairo context and the given BoundingBox.
source code
 
draw(self, *args, **kwds)
Abstract method, must be implemented in derived classes.
source code
 
_mark_point(self, x, y, color=0, size=4)
Marks the given point with a small circle on the canvas.
source code

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

Properties [hide private]
  bbox
The bounding box of the drawing area where this drawer will draw.

Inherited from object: __class__

Method Details [hide private]

__init__(self, context, bbox)
(Constructor)

source code 

Constructs the 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).
Overrides: object.__init__

draw(self, *args, **kwds)

source code 

Abstract method, must be implemented in derived classes.

Overrides: AbstractDrawer.draw

_mark_point(self, x, y, color=0, size=4)

source code 

Marks the given point with a small circle on the canvas. Used primarily for debugging purposes.

Parameters:
  • x - the X coordinate of the point to mark
  • y - the Y coordinate of the point to mark
  • color - the color of the marker. It can be a 3-tuple (RGB components, alpha=0.5), a 4-tuple (RGBA components) or an index where zero means red, 1 means green, 2 means blue and so on.
  • size - the diameter of the marker.

Property Details [hide private]

bbox

The bounding box of the drawing area where this drawer will draw.

Get Method:
unreachable.bbox(self) - The bounding box of the drawing area where this drawer will draw.
Set Method:
unreachable.bbox(self, bbox) - Sets the bounding box of the drawing area where this drawer will draw.

   Home       Trees       Indices       Help