Graph Visualization and Layout in C# using AT&T's Graphiz and an SVG viewer


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. private void button2_Click(object sender, System.EventArgs e) {
  2.  
  3. string strCmdLine1 = "-Tsvg -o c:\\tmp\\foo.xml c:\\tmp\\ER.dot";
  4. string strCmdLine2 = "-Tsvg -o c:\\tmp\\foo.xml c:\\tmp\\Heawood.dot";
  5. System.Diagnostics.Process p = new System.Diagnostics.Process();
  6.  
  7. p.StartInfo.FileName = "\"C:\\Program Files\\ATT\\Graphviz\\bin\\dot.exe\"";
  8. p.StartInfo.CreateNoWindow = true;
  9. p.StartInfo.UseShellExecute = false;
  10. if (graphIndex == 0)
  11. p.StartInfo.Arguments = strCmdLine2;
  12. else
  13. p.StartInfo.Arguments = strCmdLine1;
  14.  
  15. p.Start();
  16. p.WaitForExit();
  17.  
  18. axSVGCtl1.reload();
  19. graphIndex = (graphIndex + 1) % 2;
  20. }

URL: http://vv.cs.byu.edu/cs312-003/archives/2005/01/graph_visualiza.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.