gtool#
circ_position#
colorcomponents#
- gunfolds.viz.gtool.colorcomponents(gr)[source]#
Assigns a color to each vertex to ensure that vertices from the same strongly connected component have the same color.
By default 12 distinct colors from colorbrewer2 quantitative palette are used and anything beyond that is assigned a white color. In the future that behaviour may change to assigning random colors or to assigning useful semantics to color temperature or shade (such as SCC density or size).
- Parameters:
gr (a
graph-tool
object of class Graph) –graph-tool
graph
every_edge_control_points#
- gunfolds.viz.gtool.every_edge_control_points(n)[source]#
Generate a graph-tool Graph class object with all possible edges (a superclicue).
The function generates a graph and populates all parameters for all edges. It first does not include the bidirected adges to compute the control_points for directed edges so that they all curve. Subsequently it adds bidirected (red) edges and resets their control points to have all bidirected edges be rendered as straight lines.
- Parameters:
n (integer) – number of nodes
- Returns:
graph-tool
graph- Return type:
a
graph-tool
object of class Graph
g2gt#
- gunfolds.viz.gtool.g2gt(g)[source]#
Converts a
gunfolds
graph to an object of class Graph ofgraph-tool
package. This includes setting all parameters of edges and vertices but vertex colors.- Parameters:
g (dictionary (
gunfolds
graphs)) –gunfolds
graph- Returns:
graph-tool
graph- Return type:
a
graph-tool
object of class Graph
getscreensize#
gt2g#
hshift#
linegraph#
- gunfolds.viz.gtool.linegraph(glist, sccs=True)[source]#
Takes a list of
gunfolds
graphs and merges them into a single Graph classgraph-tool
object taking care of node positions of each graph to ensure that the constituent graphs are arranged in a single raw when plotted.- Parameters:
glist (list of dictionaries (
gunfolds
graphs)) – a list ofgunfold
graphssccs (boolean) – whether to distinguish SCCs by color
- Returns:
graph-tool
graph- Return type:
a
graph-tool
object of class Graph
plotg#
- gunfolds.viz.gtool.plotg(g, sccs=True, output=None, fmt='auto')[source]#
Given a
gunfolds
graph, plots it in an interactive window- Parameters:
g (dictionary (
gunfolds
graphs)) –gunfolds
graphsccs (boolean) – whether to distinguish SCCs by color
output (string or file object (optional, default: None)) – Output file name (or object). If not given, the graph will be displayed via interactive_window().
fmt (string or file object (optional, default: None)) – Output file format. Possible values are
"auto"
,"ps"
,"pdf"
,"svg"
, and"png"
. If the value is"auto"
, the format is guessed from the output parameter.
plotgunfolds#
- gunfolds.viz.gtool.plotgunfolds(g, sccs=True, output=None, fmt='auto')[source]#
Given a
gunfolds
graph plots all of its undersamples versions arranged sequentially in a horizontal line.- Parameters:
g (dictionary (
gunfolds
graphs)) –gunfolds
graphinteractive (boolean) – whether to make the window interactive
sccs (boolean) – whether to distinguish SCCs by color
output (string or file object (optional, default: None)) – Output file name (or object). If not given, the graph will be displayed via interactive_window().
fmt (string or file object (optional, default: None)) – Output file format. Possible values are
"auto"
,"ps"
,"pdf"
,"svg"
, and"png"
. If the value is"auto"
, the format is guessed from the output parameter.