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-toolobject of class Graph) –graph-toolgraph
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-toolgraph- Return type:
a
graph-toolobject of class Graph
g2gt#
- gunfolds.viz.gtool.g2gt(g)[source]#
Converts a
gunfoldsgraph to an object of class Graph ofgraph-toolpackage. This includes setting all parameters of edges and vertices but vertex colors.- Parameters:
g (dictionary (
gunfoldsgraphs)) –gunfoldsgraph- Returns:
graph-toolgraph- Return type:
a
graph-toolobject of class Graph
getscreensize#
gt2g#
hshift#
linegraph#
- gunfolds.viz.gtool.linegraph(glist, sccs=True)[source]#
Takes a list of
gunfoldsgraphs and merges them into a single Graph classgraph-toolobject 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 (
gunfoldsgraphs)) – a list ofgunfoldgraphssccs (boolean) – whether to distinguish SCCs by color
- Returns:
graph-toolgraph- Return type:
a
graph-toolobject of class Graph
plotg#
- gunfolds.viz.gtool.plotg(g, sccs=True, output=None, fmt='auto')[source]#
Given a
gunfoldsgraph, plots it in an interactive window- Parameters:
g (dictionary (
gunfoldsgraphs)) –gunfoldsgraphsccs (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
gunfoldsgraph plots all of its undersamples versions arranged sequentially in a horizontal line.- Parameters:
g (dictionary (
gunfoldsgraphs)) –gunfoldsgraphinteractive (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.