Answered how to programatically change layout method to MDS?

  • Wednesday, March 17, 2010 8:46 AM
     
     
    Hi,

    I'm using GViewer() to show a simple Microsoft.Msagl.Drawing.Graph(). By default, the Sugiyama scheme is used as a layout method, but I'd prefer to use MDS. How do I change the layout method in my code. 

    I tried using 
          graph.LayoutAlgorithmSettings = new Microsoft.Msagl.Mds.MdsLayoutSettings();
    but it did not change the graph layout at all.

    Thanks,
    Gregor

All Replies

  • Wednesday, March 17, 2010 6:23 PM
    Owner
     
     Answered
    Hi Gregor,
    This should work
                graph.LayoutAlgorithmSettings = new Microsoft.Msagl.Mds.MdsLayoutSettings();
                gViewer.CurrentLayoutMethod = Microsoft.Msagl.GraphViewerGdi.LayoutMethod.UseSettingsOfTheGraph;
                gViewer.Graph = graph;

    Thanks,
    Lev
    Lev Nachmanson
    • Proposed As Answer by Gidon J Thursday, August 19, 2010 8:10 AM
    • Marked As Answer by Lev NachmansonOwner Friday, June 17, 2011 3:18 PM
    •  
  • Sunday, January 22, 2012 10:36 PM
     
     
    Hi Gregor,
    This should work
                graph.LayoutAlgorithmSettings = new Microsoft.Msagl.Mds.MdsLayoutSettings();
                gViewer.CurrentLayoutMethod = Microsoft.Msagl.GraphViewerGdi.LayoutMethod.UseSettingsOfTheGraph;
                gViewer.Graph = graph;

    Thanks,
    Lev
    Lev Nachmanson


    Hi Lev,

    I am rendering the graph for web, aving it to an image, so how do I set the  Mds Layout without the gViewer?  The first line on its own does not work. Thanks a lot.

  • Tuesday, January 24, 2012 5:35 AM
    Owner
     
     Answered