/// <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); }
/// <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); }
/// <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); }