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)
        {
            BidirectionalGraph <string, WeightedEdge <string> > bGraph = GraphSharpUtility.GetBidirectionalGraph(graph);
            IDictionary <string, Vector> nodePositions        = GraphSharpUtility.GetNodePositions(graph);
            ISOMLayoutParameters         isomLayoutParameters = new ISOMLayoutParameters();

            ISOMLayoutAlgorithm <string, WeightedEdge <string>, BidirectionalGraph <string, WeightedEdge <string> > > isomLayoutAlgorithm = new ISOMLayoutAlgorithm <string, WeightedEdge <string>, BidirectionalGraph <string, WeightedEdge <string> > >(bGraph, nodePositions, isomLayoutParameters);

            isomLayoutAlgorithm.Compute();

            GraphSharpUtility.SetNodePositions(graph, isomLayoutAlgorithm.VertexPositions);
            GraphSharpUtility.FSAOverlapRemoval(graph);
        }
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);
            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. 3
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)
        {
            BidirectionalGraph <string, WeightedEdge <string> > bGraph = GraphSharpUtility.GetBidirectionalGraph(graph);
            IDictionary <string, Size>   nodeSizes     = GraphSharpUtility.GetNodeSizes(graph);
            IDictionary <string, Vector> nodePositions = GraphSharpUtility.GetNodePositions(graph);
            CompoundFDPLayoutParameters  compoundFDPLayoutParameters = new CompoundFDPLayoutParameters();

            CompoundFDPLayoutAlgorithm <string, WeightedEdge <string>, BidirectionalGraph <string, WeightedEdge <string> > > compoundFDPLayoutAlgorithm = new CompoundFDPLayoutAlgorithm <string, WeightedEdge <string>, BidirectionalGraph <string, WeightedEdge <string> > >(bGraph, nodeSizes, null, null, nodePositions, compoundFDPLayoutParameters);

            compoundFDPLayoutAlgorithm.Compute();

            GraphSharpUtility.SetNodePositions(graph, compoundFDPLayoutAlgorithm.VertexPositions);
        }
Esempio n. 4
0
        /// <summary>
        /// Performs the actual layout algorithm.
        /// </summary>
        /// <param name="graph">The object containing the graph data</param>
        /// <param name="selectedNode">selected node</param>
        protected override void PerformLayout(GraphMapData graph, INode selectedNode)
        {
            BidirectionalGraph <string, WeightedEdge <string> > bGraph = GraphSharpUtility.GetBidirectionalGraph(graph);
            IDictionary <string, Vector> nodePositions = GraphSharpUtility.GetNodePositions(graph);
            IDictionary <string, Size>   nodeSizes     = GraphSharpUtility.GetNodeSizes(graph);
            BalloonTreeLayoutParameters  balloonTreeLayoutParameters = new BalloonTreeLayoutParameters();

            BalloonTreeLayoutAlgorithm <string, WeightedEdge <string>, BidirectionalGraph <string, WeightedEdge <string> > > balloonTreeLayoutAlgorithm = new BalloonTreeLayoutAlgorithm <string, WeightedEdge <string>, BidirectionalGraph <string, WeightedEdge <string> > >(bGraph, nodePositions, nodeSizes, balloonTreeLayoutParameters, selectedNode.ID);

            balloonTreeLayoutAlgorithm.Compute();

            GraphSharpUtility.SetNodePositions(graph, balloonTreeLayoutAlgorithm.VertexPositions);
        }
Esempio n. 5
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);
        }
Esempio n. 6
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)
        {
            BidirectionalGraph <string, WeightedEdge <string> > bGraph = GraphSharpUtility.GetBidirectionalGraph(graph);
            IDictionary <string, Vector> nodePositions          = GraphSharpUtility.GetNodePositions(graph);
            LinLogLayoutParameters       linLogLayoutParameters = new LinLogLayoutParameters()
            {
                AttractionExponent = 2D     // Default is 1D
            };

            LinLogLayoutAlgorithm <string, WeightedEdge <string>, BidirectionalGraph <string, WeightedEdge <string> > > linLogLayoutAlgorithm = new LinLogLayoutAlgorithm <string, WeightedEdge <string>, BidirectionalGraph <string, WeightedEdge <string> > >(bGraph, nodePositions, linLogLayoutParameters);

            linLogLayoutAlgorithm.Compute();

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