GoDigram for .NET Framework and .NET Core
Northwoods.Go.Layout Namespace / GoLayoutLayeredDigraph Class
Properties Methods Events


In This Topic
    GoLayoutLayeredDigraph Class Members
    In This Topic

    The following tables list the members exposed by GoLayoutLayeredDigraph.

    Public Constructors
     NameDescription
    Public ConstructorOverloaded.   
    Top
    Public Properties
     NameDescription
    Public Property Gets or sets which Aggressive Option is being used to look for link crossings.  
    Public PropertyGets or sets the top-left corner point at which LayoutNodes will position the nodes.  
    Public Property Gets or sets the size of each column  
    Public Property (Inherited from System.ComponentModel.Component)
    Public Property Gets or sets which cycle removal option is being used.  
    Public Property Gets or sets which Direction Option is being used.  
    Public PropertyGets or sets the Northwoods.Go.GoDocument that the layout will be performed on. (Inherited from Northwoods.Go.Layout.GoLayout)
    Public Property Gets or sets which indices initialization option is being used.  
    Public Property Gets or sets the number of iterations are to be done.  
    Public Property Gets or sets which layering option is being used.  
    Public Property Gets or sets the size of each layer  
    Public Property Gets the largest column value.  
    Public Property Gets the largest index value.  
    Public Property Gets the largest index layer.  
    Public Property Gets the largest layer value.  
    Public Property Gets the smallest index layer  
    Public PropertyGets or sets the GoLayoutLayeredDigraphNetwork that the layout will be performed on.  
    Public PropertyGets or sets the options used by StraightenAndPack.  
    Public PropertyGets or sets whether the Northwoods.Go.GoPort.Northwoods.Go.GoPort.FromSpot and Northwoods.Go.GoPort.ToSpot of every single-port node should be set to values appropriate for the given DirectionOption.  
    Public Property (Inherited from System.ComponentModel.Component)
    Public PropertyGets or sets the Northwoods.Go.GoView whose thread is used to run document-updating code and Progress events. (Inherited from Northwoods.Go.Layout.GoLayout)
    Top
    Protected Properties
    Public Methods
     NameDescription
    Public MethodAllocate a GoLayoutLayeredDigraphNetwork.  
    Public Method Returns the indices array.  
    Public Method (Inherited from System.MarshalByRefObject)
    Public Method (Inherited from System.MarshalByRefObject)
    Public Method Updates the physical location of "real" nodes and links to reflect the layout.  
    Public MethodOverridden.  Performs a layered-digraph auto-layout.  
    Public MethodOverloaded.  (Inherited from Northwoods.Go.Layout.GoLayout)
    Public Method (Inherited from System.ComponentModel.Component)
    Top
    Protected Methods
     NameDescription
    Protected MethodAdjusts the columns of nodes within the unfixedLayer to simultaneously reduce the number of link crossings and the number of "bends" between the unfixedLayer and its adjacent layers between the unfixedLayer and its adjacent layers. The directionCR argument indicates which of the adjacent layers should be taken into consideration when reducing the number of link crossings. direction == 0 -- use unfixedLayer - 1 and unfixedLayer + 1 direction > 0 -- use unfixedLayer - 1 (sweeping away from layer 0) direction < 0 -- use unfixedLayer + 1 (sweepeing towards layer 0) The directionBS argument indicates which of the adjacent layers should be taken into consideration when reducing the number of bends. direction == 0 -- use unfixedLayer - 1 and unfixedLayer + 1 direction > 0 -- use unfixedLayer - 1 (sweeping away from layer 0) direction < 0 -- use unfixedLayer + 1 (sweepeing towards layer 0) The "weighted bend" between a node U and a node V connected by link L is calculated by abs((U.column + L.portFromColOffset) - (V.column + L.portToColOffset)) * LinkStraightenWeight(L) The LinkStraightenWeight attempts to give higher priority to links between "artificial" nodes; i.e., long links in the final layout will be straighter. The idea is to use a bubble-sort technique to exchange adjacent nodes whenever doing so reduces the number of link crossings or the number of bends. This function is used in both crossing reduction and bend straightening. Returns true if some change was made to the layer.  
    Protected Method Assigns every node in the input network to a layer. The layering satisfies the following: if L is a link from node U to node V, then U.layer > V.layer; further, U.layer - V.layer >= LinkMinLength(L). This method can be overridden to customize how nodes are assigned layers.  
    Protected Method Try to avoid overlapping segments of Orthogonal links.  
    Protected Method Computes the array of barycenters (average) columns for the nodes in the unfixedLayer based on the columns of predecessors (direction < 0), successors (direction > 0), or both predecessors and successors (direction == 0) Elements without a defined barycenter will have an entry of -1.  
    Protected MethodComputes the bends between the unfixedLayer and its adjacent layers. The "bend" between a node U and a node V connected by a link L is calcluated by abs((U.column + L.portFromColOffset) - (V.column + L.portToColOffset)) The "weighted bend" between a node U and a node V connected by link L is calculated by abs((U.column + L.portFromColOffset) - (V.column + L.portToColOffset)) * LinkStraightenWeight(L) The LinkStraightenWeight attempts to give higher priority to links between "artificial" nodes; i.e., long links in the final layout will be straighter. The direction argument indicates which adjacent layers should be taken into consideration when computing the crossing matrix: direction == 0 -- use unfixedLayer - 1 and unfixedLayer + 1 direction > 0 -- use unfixedLayer - 1 (sweeping away from layer 0) direction < 0 -- use unfixedLayer + 1 (sweepeing towards layer 0)  
    Protected MethodAdjusts the columns of nodes within the unfixedLayer to reduce the number of "bends" between the unfixedLayer and its adjacent layers. The direction argument indicates which of the adjacent layers should be taken into consideration when reducing the number of bends. The "weighted bend" between a node U and a node V connected by link L is calculated by abs((U.column + L.portFromColOffset) - (V.column + L.portToColOffset)) * LinkStraightenWeight(L) The LinkStraightenWeight attempts to give higher priority to links between "artificial" nodes; i.e., long links in the final layout will be straighter. The idea is to iterate the ShiftBendStraighten and adjacentExchangeBendStraighten methods until no improvements are made.  
    Protected Method Adjusts the columns of nodes in the network to produce a layout which is tightly packed. The idea is that the network can be fragmented from a given column in the following way: all nodes "behind" the column are placed into a single component, and the remainder of the network is divided into connected components. Each of these new components can be examined, and those that can be merged with the given column do so.  
    Protected Method Attempts to augment the argument column by merging components into from the argument direction. direction > 0 -- columns > the argument column are shifted direction < 0 -- columns < the argument column are shifted Returns true if the argument column was changed.  
    Protected Method Uses a depth first search algorithm to set the component of all nodes in a component. **Unset functions only set the component and recurse on nodes whose component is currently set to the unset value. The forward and backward bools indicate the direction to use for a directed depth first search from node.  
    Protected MethodReturns the total number of bends in the network. The "bend" between a node U and a node V connected by a link L is calcluated by abs((U.column + L.portFromColOffset) - (V.column + L.portToColOffset)) The "weighted bend" between a node U and a node V connected by link L is calculated by abs((U.column + L.portFromColOffset) - (V.column + L.portToColOffset)) * LinkStraightenWeight(L) The LinkStraightenWeight attempts to give higher priority to links between "artificial" nodes; i.e., long links in the final layout will be straighter.  
    Protected MethodReturns the total number of crossings in the network. Internal method used by ReduceCrossings.  
    Protected MethodComputes the crossing matrix between the unfixedLayer and its adjacent layers. The direction argument indicates which adjacent layers should be taken into consideration when computing the crossing matrix: direction == 0 -- use unfixedLayer - 1 and unfixedLayer + 1 direction > 0 -- use unfixedLayer - 1 (sweeping away from layer 0) direction < 0 -- use unfixedLayer + 1 (sweeping towards layer 0) The resulting integer array can be used as follows: if index1 and index2 are the indices corresponding to two nodes on the unfixedLayer and crossmat is the crossing matrix, then crossmat[index1 * indices[unfixedLayer] + index2] is the number of crossing that occur if the node corresponding to index1 is placed to the left of the node corresponding to index2. If index1 == index2, then crossmat[index1 * indices[unfixedLayer] + index2] is the number of crossings between links to and from the node corresponding to index1.  
    Protected Method Assigns every node in the input network an index number, such that nodes in the same layer will be labeled with consecutive indices in left to right order. Uses a depth first "inward" (i.e., following links from "to-node" to "from-node") traversal of the network, assigning indices to nodes as they are discovered.  
    Protected Method Assigns node the appropriate index and updates the indices array. Implements the recursive portion of a depth first search.  
    Protected Method Assigns every node in the input network an index number, such that nodes in the same layer will be labeled with consecutive indices in left to right order. Uses a depth first "outward" (i.e., following links from "from-node" to "to-node") traversal of the network, assigning indices to nodes as they are discovered.  
    Protected Method Assigns node the appropriate index and updates the indices array. Implements the recursive portion of a depth first search.  
    Protected Method Removes cycles from the input network using a depth first search. A link not in the depth first forest is reversed if the from-node was discovered and finished by the depth first search after the to-node was discovered but before the to-node was finished.  
    Protected Method Peforms the recursive step of the depth first search on node. Updates the discover and finish time of node. Updates the forest flag of followed links.  
    Protected MethodOverloaded.  (Inherited from System.ComponentModel.Component)
    Protected Method (Inherited from System.ComponentModel.Component)
    Protected Method (Inherited from System.ComponentModel.Component)
    Protected Method Removes cycles from the input network using a Greedy-Cycle-Removal algorithm. The idea is to induce an order on all nodes in the network (U1, U2, U3, ..., Uk) such that for the majority of links L = (Ui, Uj) it is true that i < j. All links L = (Ui, Uj) such that i > j are reversed.  
    Protected Method Finds a valid node in the network. Returns null if no valid node exists. Used by GreedyCycleRemoval.  
    Protected Method Finds a valid node in the network that maximizes outdeg - indeg. The degree difference is computed using valid successors and predecessors. Returns null if no valid node exists. Used by GreedyCycleRemoval.  
    Protected Method Finds a sink node in the network. A node is considered a sink node if it is valid and all of its predecessors are invalid. A valid node with no predecessors is vacously a sink. Returns null if no valid sink node exists. Used by GreedyCycleRemoval.  
    Protected Method Finds a source node in the network. A node is considered a sink node if it is valid and all of its successors are invalid. A valid node with no successors is vacously a source. Returns null if no valid source node exists. Used by GreedyCycleRemoval.  
    Protected Method Assigns every node in the input network a column number, such that nodes in the same layer will be labeled with increasing indices in left to right order.  
    Protected Method Assigns every node in the input network an index number, such that nodes in the same layer will be labeled with consecutive indices in left to right order. All consecutive layout operations will preserve or update the indices. In addition, the indices array is initialized such that indices[layer] indicates the number of nodes in the layer. Finally, the variables minIndexLayer and maxIndexLayer record the layers that correspond to the minimum and maximum nodes in a layer.  
    Protected MethodRoutes the links. Called by LayoutNodesAndLinks  
    Protected MethodLays out the nodes. Called by LayoutNodesAndLinks  
    Protected Method The function LinkLengthWeight returns the weight of the link represented by the GoLayoutLayeredDigraphLink link. This weight is used by OptimalLinkLengthLayering to minimize weighted link lengths. The default implementation gives all links a length weight of 1. This function can be overridden to provide "fine-tuning" of the layout.  
    Protected Method The function LinkMinLength returns the minimum length of the link represented by the GoLayoutLayeredDigraphLink link. The default implementation gives multi-links a minimum length of 2, and all other links a minimum length of 1. This function can be overridden to provide "fine-tuning" of the layout.  
    Protected Method The function LinkStraightenWeight returns the weight of the link represented by the GoLayoutLayeredDigraphLink link. This weight is used by the straightening methods to give priority straightening to those links with higher weights. The default implementation gives links between two "real" nodes a weight of 1, links between a "real" node and an "artifical" node a weight of 4, and links between two "artificial" nodes a weight of 8. This function can be overridden to provide "fine-tuning" of the layout.  
    Protected Method Assigns every node in the input network to a layer. In addition to the requirements described in AssignLayers(), LongestPathSinkLayering ensures that every sink appears in layer 0 and every node is as close to a sink as possible.  
    Protected Method Computes the length of the longest path from node to a sink node and sets the layer of node to that length. Returns the length of the longest path from node to a sink node.  
    Protected MethodAssigns every node in the input network to a layer. In addition to the requirements described in AssignLayers, LongestPathSourceLayering ensures that every source appears in layer maxLayer and every node is as close to a source as possible.  
    Protected Method Computes the length of the longest path from node to a source node and sets the layer of node to that length. Returns the length of the longest path from node to a source node.  
    Protected Method Converts the input network into a proper digraph; i.e., artificial nodes and links are introduced into the network such that every link is between nodes in adjacent layers. This has the effect of breaking up long links into a sequence of artificial nodes.  
    Protected MethodReorders nodes within the unfixedLayer to reduce the number of link crossings between the unfixedLayer and its adjacent layers. The direction argument indicates which of the adjacent layers should be taken into consideration when reducing the number of crossings. direction == 0 -- use unfixedLayer - 1 and unfixedLayer + 1 direction > 0 -- use unfixedLayer - 1 (sweeping away from layer 0) direction < 0 -- use unfixedLayer + 1 (sweepeing towards layer 0) The idea is to calculate the median and barycenter for each node in the unfixedLayer, and to sort the nodes in the unfixedLayer by their median and barycenter values. Returns true if some change was made to the layer.  
    Protected Method Computes the array of median columns for the nodes in the unfixedLayer based on the columns of predecessors (direction < 0), successors (direction > 0), or both predecessors and successors (direction == 0). Elements without a defined median will have an entry of -1.  
    Protected Method Adjusts the columns of nodes within the unfixedLayer in order to move nodes towards their median columns. The direction argument indicates which of the adjacent layers should be taken into consideration when computing the median column. The idea is shift nodes to the left and to the right to move nodes towards their median columns, ensuring that no two nodes have overlapping "allocations" of columns. Returns true if some change was made to the layer.  
    Protected MethodOverloaded.  (Inherited from System.MarshalByRefObject)
    Protected Method Assigns every node in the input network an index number, such that nodes in the same layer will be labeled with consecutive indices in left to right order. Uses a naive implementation that assigns indices to nodes as they are encountered in a sweep of the network. Because of the way networks are stored, this has the effect of initialy placing all "artificial" nodes to the right of all "real" nodes.  
    Protected MethodThe function NodeMinColumnSpace returns the minimum space reserved to either side of this node. The default implementation returns 0 for nodes that do not correspond to top-level Go objects. For nodes that do correspond to top-level Go objects, the column space is determined by the width and height of the object divided by the ColumnSpacing. Note: all sub-classes that override this method should ensure that nodes that do not correspond to top-level Go objects have a minimum column space of 0. This function can be overridden to provide "fine-tuning" of the layout.  
    Protected Method This function returns the minimum space reserved for this node from the center point for the "depth" of the layer that it is in.  
    Protected Method Adjusts the columns of all nodes such that the leftmost column will be column 0 and maxColumn is updated appropriately.  
    Protected Method Invoke all Progress event handlers. (Inherited from Northwoods.Go.Layout.GoLayout)
    Protected Method Assigns every node in the input network to a layer. In addition to the requirements described in AssignLayers(), OptimalLinkLengthLayering ensures that nodes are set in layers to minimize the total weighted link length. Hence, OptimalLinkLengthLayering minimizes the sum (U.layer - V.layer) * LinkLengthWeight(L) over all links L = (U,V).  
    Protected Method Peforms the depth first search of the network. After traversing all decendents, the node is "pull"-ed into the appropriate layer.  
    Protected Method Attempts to move node and it's tight component to a higher layer.  
    Protected Method Attempts to move node and it's tight component to a lower layer.  
    Protected Method Adjusts the columns of nodes in the network to produce a layout which is tightly packed. The idea is that columns which are "un-allocated" through all layers can be eliminated and the nodes can be shifted into that space.  
    Protected Method Attempts to remove the argument column by shifting columns into from the argument direction. direction > 0 -- columns > argument column are shifted direction < 0 -- columns < argument column are shifted Returns true if the argument column was removed.  
    Protected Method Reorders nodes within layers to reduce the total number of link crossings in the network. There are many, many possible implementations of this function. Basically, some iteration of MedianBarycenterCrossingReduction and AdjacentExchangeCrossingReductionBendStraighten sweeping back and forth over the layers is needed. The default implementation has performed favorably on a large number of networks, but other options are available.  
    Protected Method Removes cycles from the input network by reversing some number of links.  
    Protected MethodOverridden. Set Network to null.  
    Protected Method The function RestoreLayout restores the layer, column, and index of all nodes from an array of integers.  
    Protected Method The function SaveLayout stores the layer, column, and index of all nodes in an array of integers.  
    Protected Method Uses a depth first search algorithm to set the component of all nodes in a component. The forward and backward bools indicate the direction to use for a directed depth first search from node.  
    Protected MethodAdjusts the columns of nodes within the unfixedLayer to reduce the number of "bends" between the unfixedLayer and its adjacent layers. The direction argument indicates which of the adjacent layers should be taken into consideration when reducing the number of bends. The "weighted bend" between a node U and a node V connected by link L is calculated by abs((U.column + L.portFromColOffset) - (V.column + L.portToColOffset)) * LinkStraightenWeight(L) The LinkStraightenWeight attempts to give higher priority to links between "artificial" nodes; i.e., long links in the final layout will be straighter. The idea is shift nodes to the left and to the right to reduce the bends ensuring that no two nodes have overlapping "allocations" of columns. Return true if some change was made to the layer.  
    Protected Method Adjusts the columns of nodes in the network to produce a layout which reduces the number of bends and is tightly packed.  
    Protected Method Uses a depth first search algorithm to set the component of all nodes in a component. The forward and backward bools indicate the direction to use for a directed depth first search from node. **Unset functions only set the component and recurse on nodes whose component is currently set to the unset value. Tight** functions only set the component and recurse on nodes which are "tight", in the sense that the nodes are separated by a link which corresponds to the minumum link length of the link between the two nodes.  
    Protected Method Uses a depth first search algorithm to set the component of all nodes in a component. Tight** functions only set the component and recurse on nodes which are "tight", in the sense that the nodes are separated by a link which corresponds to the minumum link length of the link between the two nodes. **Unset functions only set the component and recurse on nodes whose component is currently set to the unset value. The forward and backward bools indicate the direction to use for a directed depth first search from node.  
    Protected Method Adjusts the columns of nodes in the network to produce a layout which is tightly packed. The idea is that two adjacent columns can be "merged" if each layer has at most one of the two columns "allocated" to a node.  
    Protected Method Attempts to augment the argument column by merging columns into from the argument direction. direction > 0 -- columns > the argument column are shifted direction < 0 -- columns < the argument column are shifted Returns true if the argument column was changed.  
    Top
    Public Events
     NameDescription
    Public Event (Inherited from System.ComponentModel.Component)
    Public EventThe Progress event is raised at various times during the PerformLayout routine to indicate progress. In particular, a Progress event should be raised at the start of the layout with a progress of 0.0 and at the end of the layout with a progress of 1.0. Other calls with progress values should be layout routine specific. (Inherited from Northwoods.Go.Layout.GoLayout)
    Top
    See Also