locked
Graph Layout Design with weigth RRS feed

  • Question


  •   hello,

      I'm a new in Graph Layout, and I'm using the references of Microsoft.Glee;, but i have some doubts.

    using Microsoft.Glee.Drawing;
    using Microsoft.Glee.GraphViewerGdi;
    using Microsoft.Glee.Splines;


       I create the graph from the reading of a table equal the following.

    Source Target Weigth
    A       B       25
    A       C       34
    A       D       46
    A       E       12
    A       F       8


        E create a loop to create the nodges when using the code
             graph.AddEdge(Source, Source);


    I use this code to view the graph and works very well

     private void FormGraph_Load(object sender, EventArgs e)
            {

                GViewer viewer = new GViewer();
                //create a graph object 
                Graph graph = new Graph("graph");
               

                graph = g;
                graph.FindNode(ap_dom).Attr.Fillcolor = Microsoft.Glee.Drawing.Color.Magenta; 

                //bind the graph to the viewer 
                viewer.Graph = g;
                //associate the viewer with the form 
                
                viewer.Dock = System.Windows.Forms.DockStyle.Fill;
                
                //show the form 
                this.Controls.Add(viewer);
            }

    But, for my  idea is view the graph the another way, because in the standard visualization the edges is organize in the line.
    My idea is put difference position for the edges, for example in the sample the node F is more near the node A, and the D more distance the A. and if the weight is smaller the 20 the color de edge is green, and in the put weight proximy the line the connection.
      Is possible visualization the graph with this requisites.

    Thanks

      

    Wednesday, May 23, 2012 3:40 PM

Answers

  • Hello, 

       In the link i sending the image to the network graph, that the the code that I have.
    The idea was that all nodes were not aligned at the same level as is visible in the image.
    For example, the third floor to the source node 64 is the idea is to have a label, 
    for example with the weight value of eg 100, and that the distance from the source node 
    is greater than that for example the node 02 with a weight 34.
    The idea is to have the nodes, to fill around the available space,
     on the page so that they can be more visible

    http://img827.imageshack.us/img827/9738/grafo.png


    Thanks

    Monday, May 28, 2012 10:14 AM

All replies

  • Hi,

    The question is not clear. Could you please post a small drawing explaining your idea?

    Thanks,


    Lev Nachmanson

    Friday, May 25, 2012 5:23 PM
  • Hello, 

       In the link i sending the image to the network graph, that the the code that I have.
    The idea was that all nodes were not aligned at the same level as is visible in the image.
    For example, the third floor to the source node 64 is the idea is to have a label, 
    for example with the weight value of eg 100, and that the distance from the source node 
    is greater than that for example the node 02 with a weight 34.
    The idea is to have the nodes, to fill around the available space,
     on the page so that they can be more visible

    http://img827.imageshack.us/img827/9738/grafo.png


    Thanks

    Monday, May 28, 2012 10:14 AM
  • If your graph is too wide, please change the layout algorithm to MDS ( Multi-Dimensional Scaling). See thread http://social.msdn.microsoft.com/Forums/en-US/automaticgraphlayout/thread/c077f6be-8651-4ea6-8c73-f6a65da6b0ff

    Thanks,


    Lev Nachmanson

    Friday, June 1, 2012 5:20 AM