Esempio n. 1
0
        /// <summary>
        /// Performs the actual layout algorithm.
        /// </summary>
        /// <param name="graph">The object containing the graph data</param>
        /// <param name="rootNode">Root node</param>
        protected override void PerformLayout(GraphMapData graph, INode rootNode)
        {
            AdjacencyGraph <string, Edge <string> > adjacencyGraph = GraphSharpUtility.GetAdjacencyGraph(graph);
            EfficientSugiyamaLayoutParameters       efficientSugiyamaLayoutParameters = new EfficientSugiyamaLayoutParameters();
            IDictionary <string, Vector>            nodePositions = GraphSharpUtility.GetNodePositions(graph);
            IDictionary <string, Size> nodeSizes = GraphSharpUtility.GetNodeSizes(graph);

            EfficientSugiyamaLayoutAlgorithm <string, Edge <string>, AdjacencyGraph <string, Edge <string> > > efficientSugiyamaLayoutAlgorithm = new EfficientSugiyamaLayoutAlgorithm <string, Edge <string>, AdjacencyGraph <string, Edge <string> > >(adjacencyGraph, efficientSugiyamaLayoutParameters, nodePositions, nodeSizes);

            efficientSugiyamaLayoutAlgorithm.Compute();

            GraphSharpUtility.SetNodePositions(graph, efficientSugiyamaLayoutAlgorithm.VertexPositions);
        }
Esempio n. 2
0
        /// <summary>
        /// Performs the actual layout algorithm.
        /// </summary>
        /// <param name="graph">The object containing the graph data</param>
        /// <param name="rootNode">Root node</param>
        protected override void PerformLayout(GraphMapData graph, INode rootNode)
        {
            AdjacencyGraph <string, Edge <string> > adjacencyGraph = GraphSharpUtility.GetAdjacencyGraph(graph);
            IDictionary <string, Vector>            nodePositions  = GraphSharpUtility.GetNodePositions(graph);
            FreeFRLayoutParameters freeFRLayoutParameters          = new FreeFRLayoutParameters()
            {
                IdealEdgeLength = 125D
            };

            FRLayoutAlgorithm <string, Edge <string>, AdjacencyGraph <string, Edge <string> > > frLayoutAlgorithm = new FRLayoutAlgorithm <string, Edge <string>, AdjacencyGraph <string, Edge <string> > >(adjacencyGraph, nodePositions, freeFRLayoutParameters);

            frLayoutAlgorithm.Compute();

            GraphSharpUtility.SetNodePositions(graph, frLayoutAlgorithm.VertexPositions);
            GraphSharpUtility.FSAOverlapRemoval(graph);
        }