python-igraph manual

For using igraph from Python

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

Class ShapeDrawer

source code

object --+
         |
        ShapeDrawer
Known Subclasses:

Static class, the ancestor of all vertex shape drawer classes.

Custom shapes must implement at least the draw_path method of the class. The method must not stroke or fill, it should just set up the current Cairo path appropriately.

Instance Methods [hide private]

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

Static Methods [hide private]
 
draw_path(ctx, center_x, center_y, width, height=None)
Draws the path of the shape on the given Cairo context, without stroking or filling it.
source code
 
intersection_point(center_x, center_y, source_x, source_y, width, height=None)
Determines where the shape centered at (center_x, center_y) intersects with a line drawn from (source_x, source_y) to (center_x, center_y).
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

draw_path(ctx, center_x, center_y, width, height=None)
Static Method

source code 

Draws the path of the shape on the given Cairo context, without stroking or filling it.

This method must be overridden in derived classes implementing custom shapes and declared as a static method using staticmethod(...).

Parameters:
  • ctx - the context to draw on
  • center_x - the X coordinate of the center of the object
  • center_y - the Y coordinate of the center of the object
  • width - the width of the object
  • height - the height of the object. If None, equals to the width.

intersection_point(center_x, center_y, source_x, source_y, width, height=None)
Static Method

source code 

Determines where the shape centered at (center_x, center_y) intersects with a line drawn from (source_x, source_y) to (center_x, center_y).

Can be overridden in derived classes. Must always be defined as a static method using staticmethod(...)

Parameters:
  • width - the width of the shape
  • height - the height of the shape. If None, defaults to the width
Returns:
the intersection point (the closest to (source_x, source_y) if there are more than one) or (center_x, center_y) if there is no intersection

   Home       Trees       Indices       Help