python-igraph manual

For using igraph from Python

   Home       Trees       Indices       Help   
Package igraph :: Package drawing :: Module edge :: Class AbstractEdgeDrawer
[hide private]

Class AbstractEdgeDrawer

source code

object --+
         |
        AbstractEdgeDrawer
Known Subclasses:

Abstract edge drawer object from which all concrete edge drawer implementations are derived.

Instance Methods [hide private]
 
__init__(self, context, palette)
Constructs the edge drawer.
source code
 
_construct_visual_edge_builder(self)
Construct the visual edge builder that will collect the visual attributes of an edge when it is being drawn.
source code
 
draw_directed_edge(self, edge, src_vertex, dest_vertex)
Draws a directed edge.
source code
 
draw_loop_edge(self, edge, vertex)
Draws a loop edge.
source code
 
draw_undirected_edge(self, edge, src_vertex, dest_vertex)
Draws an undirected edge.
source code
 
get_label_position(self, edge, src_vertex, dest_vertex)
Returns the position where the label of an edge should be drawn.
source code

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

Static Methods [hide private]
 
_curvature_to_float(value)
Converts values given to the 'curved' edge style argument in plotting calls to floating point values.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, context, palette)
(Constructor)

source code 

Constructs the edge drawer.

Parameters:
  • context - a Cairo context on which the edges will be drawn.
  • palette - the palette that can be used to map integer color indices to colors when drawing edges
Overrides: object.__init__

draw_directed_edge(self, edge, src_vertex, dest_vertex)

source code 

Draws a directed edge.

Parameters:
  • edge - the edge to be drawn. Visual properties of the edge are defined by the attributes of this object.
  • src_vertex - the source vertex. Visual properties are given again as attributes.
  • dest_vertex - the target vertex. Visual properties are given again as attributes.

draw_loop_edge(self, edge, vertex)

source code 

Draws a loop edge.

The default implementation draws a small circle.

Parameters:
  • edge - the edge to be drawn. Visual properties of the edge are defined by the attributes of this object.
  • vertex - the vertex to which the edge is attached. Visual properties are given again as attributes.

draw_undirected_edge(self, edge, src_vertex, dest_vertex)

source code 

Draws an undirected edge.

The default implementation of this method draws undirected edges as straight lines. Loop edges are drawn as small circles.

Parameters:
  • edge - the edge to be drawn. Visual properties of the edge are defined by the attributes of this object.
  • src_vertex - the source vertex. Visual properties are given again as attributes.
  • dest_vertex - the target vertex. Visual properties are given again as attributes.

get_label_position(self, edge, src_vertex, dest_vertex)

source code 

Returns the position where the label of an edge should be drawn. The default implementation returns the midpoint of the edge and an alignment that tries to avoid overlapping the label with the edge.

Parameters:
  • edge - the edge to be drawn. Visual properties of the edge are defined by the attributes of this object.
  • src_vertex - the source vertex. Visual properties are given again as attributes.
  • dest_vertex - the target vertex. Visual properties are given again as attributes.
Returns:
a tuple containing two more tuples: the desired position of the label and the desired alignment of the label, where the position is given as (x, y) and the alignment is given as (horizontal, vertical). Members of the alignment tuple are taken from constants in the TextAlignment class.

   Home       Trees       Indices       Help