pypath.visual.igraph_drawing.edge.AbstractEdgeDrawer§
- class pypath.visual.igraph_drawing.edge.AbstractEdgeDrawer(context, palette)[source]§
Bases:
object
Abstract edge drawer object from which all concrete edge drawer implementations are derived.
- __init__(context, palette)[source]§
Constructs the edge drawer.
@param context: a Cairo context on which the edges will be drawn. @param palette: the palette that can be used to map integer
color indices to colors when drawing edges
Methods
__init__
(context, palette)Constructs the edge drawer.
draw_directed_edge
(edge, src_vertex, dest_vertex)Draws a directed edge.
draw_loop_edge
(edge, vertex)Draws a loop edge.
draw_undirected_edge
(edge, src_vertex, ...)Draws an undirected edge.
get_label_position
(edge, src_vertex, dest_vertex)Returns the position where the label of an edge should be drawn.
- draw_directed_edge(edge, src_vertex, dest_vertex)[source]§
Draws a directed edge.
- @param edge: the edge to be drawn. Visual properties of the edge
are defined by the attributes of this object.
- @param src_vertex: the source vertex. Visual properties are given
again as attributes.
- @param dest_vertex: the target vertex. Visual properties are given
again as attributes.
- draw_loop_edge(edge, vertex)[source]§
Draws a loop edge.
The default implementation draws a small circle.
- @param edge: the edge to be drawn. Visual properties of the edge
are defined by the attributes of this object.
- @param vertex: the vertex to which the edge is attached. Visual
properties are given again as attributes.
- draw_undirected_edge(edge, src_vertex, dest_vertex)[source]§
Draws an undirected edge.
The default implementation of this method draws undirected edges as straight lines. Loop edges are drawn as small circles.
- @param edge: the edge to be drawn. Visual properties of the edge
are defined by the attributes of this object.
- @param src_vertex: the source vertex. Visual properties are given
again as attributes.
- @param dest_vertex: the target vertex. Visual properties are given
again as attributes.
- get_label_position(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.
- @param edge: the edge to be drawn. Visual properties of the edge
are defined by the attributes of this object.
- @param src_vertex: the source vertex. Visual properties are given
again as attributes.
- @param dest_vertex: the target vertex. Visual properties are given
again as attributes.
- @return: 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.