pypath.visual.igraph_drawing.edge.AlphaVaryingEdgeDrawer§
- class pypath.visual.igraph_drawing.edge.AlphaVaryingEdgeDrawer(context, alpha_at_src, alpha_at_dest)[source]§
Bases:
AbstractEdgeDrawer
Edge drawer implementation that draws undirected edges as straight lines and directed edges by varying the alpha value of the specified edge color between the source and the destination.
- __init__(context, alpha_at_src, alpha_at_dest)[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, alpha_at_src, alpha_at_dest)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)§
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)§
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)§
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.