class documentation

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

Method draw_directed_edge Draws a directed edge.
Method draw_undirected_edge Draws an undirected edge.
Method get_label_position 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.
Method get_label_rotation Get the rotation angle of the label to align with the edge.
Static Method _curvature_to_float Converts values given to the 'curved' edge style argument in plotting calls to floating point values.
@abstractmethod
def draw_directed_edge(self, edge, src_vertex, dest_vertex): (source)

Draws a directed edge.

Parameters
edgethe edge to be drawn. Visual properties of the edge are defined by the attributes of this object.
src_vertexthe source vertex. Visual properties are defined by the attributes of this object.
dest_vertexthe source vertex. Visual properties are defined by the attributes of this object.
@abstractmethod
def draw_undirected_edge(self, edge, src_vertex, dest_vertex): (source)

Draws an undirected edge.

Parameters
edgethe edge to be drawn. Visual properties of the edge are defined by the attributes of this object.
src_vertexthe source vertex. Visual properties are defined by the attributes of this object.
dest_vertexthe source vertex. Visual properties are defined by the attributes of this object.
def get_label_position(self, edge, src_vertex, dest_vertex): (source)

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
edgethe edge to be drawn. visual properties of the edge are defined by the attributes of this object.
src_vertexthe source vertex. visual properties are given again as attributes.
dest_vertexthe 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 c{(x, y)} and the alignment is given as c{(horizontal, vertical)}. members of the alignment tuple are taken from constants in the l{textalignment} class.
def get_label_rotation(self, edge, src_vertex, dest_vertex): (source)

Get the rotation angle of the label to align with the edge.

Parameters
edgethe edge to be drawn. visual properties of the edge are defined by the attributes of this object.
src_vertexthe source vertex. visual properties are given again as attributes.
dest_vertexthe target vertex. visual properties are given again as attributes.
Returns
a float with the desired angle, in degrees (out of 360).
@staticmethod
def _curvature_to_float(value): (source)

Converts values given to the 'curved' edge style argument in plotting calls to floating point values.