class AbstractEdgeDrawer(object):
Known subclasses: igraph.drawing.edge.AlphaVaryingEdgeDrawer
, igraph.drawing.edge.ArrowEdgeDrawer
, igraph.drawing.edge.TaperedEdgeDrawer
Abstract edge drawer object from which all concrete edge drawer implementations are derived.
Method | __init__ |
Constructs the edge drawer. |
Method | draw |
Draws a directed edge. |
Method | draw |
Draws a loop edge. |
Method | draw |
Draws an undirected edge. |
Method | get |
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. |
Instance Variable | context |
Undocumented |
Instance Variable | palette |
Undocumented |
Instance Variable |
|
Undocumented |
Static Method | _curvature |
Converts values given to the 'curved' edge style argument in plotting calls to floating point values. |
Method | _construct |
Construct the visual edge builder that will collect the visual attributes of an edge when it is being drawn. |
igraph.drawing.edge.AlphaVaryingEdgeDrawer
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 |
igraph.drawing.edge.AlphaVaryingEdgeDrawer
, igraph.drawing.edge.ArrowEdgeDrawer
, igraph.drawing.edge.TaperedEdgeDrawer
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 | the source vertex. Visual properties are given again as attributes. |
dest | the target vertex. Visual properties are given again as attributes. |
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. |
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 | the source vertex. Visual properties are given again as attributes. |
dest | the target vertex. Visual properties are given again as attributes. |
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 | the source vertex. Visual properties are given again as attributes. |
dest | 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. |
Converts values given to the 'curved' edge style argument in plotting calls to floating point values.