nexxT.services.gui.GraphLayering module
This module implements a graph layering algorithm inspired by https://en.wikipedia.org/wiki/Layered_graph_drawing
- class nexxT.services.gui.GraphLayering.GraphRep(baseGraphScene=None)[source]
Bases:
objectThis class implements the “auto layout” feature for nexxT configuration GUI service.
- addEdge(n1, n2)[source]
Adds an edge to the graph
- Parameters:
n1 – from node (string id)
n2 – to node (string id)
- Returns:
- assignLayers()[source]
Assign nodes to layers
- Returns:
layers (a list of a list of nodes), node2layer (a dictionary assigning nodes to layer indices)
- dump(title=None)[source]
Dump to stdout for debugging
- Parameters:
title – an optional title for the stdout section
- Returns:
- layersToNodeNames(layers)[source]
convert the layering result back to node names
- Parameters:
layers – result from sortLayers (list of list of int)
- Returns:
list of list of string