Menu

Graph visualization

Help
Udeepta
2004-11-27
2013-04-25
  • Udeepta

    Udeepta - 2004-11-27

    Hi,

    I am trying to use the toolkit for graph visualization. I could run a simple program, but i could not figure out how to specify the different layout algorithms in the package. Could someone please give an example program showing how to use a different layout scheme? A simple one will do.

    thanks, udeepta

     
    • TiHobbes

      TiHobbes - 2004-12-09

      You just have to cross-reference the layout algorithm with your graph visualization :

      FRLayout layout = new FRLayout(myVisualization) ;
      //or GraphVizLayout = new GraphVizLayout(myVisualization), for insance
      myVisualization.setLayout(layout);

      NB: I had troubles using the GraphVizLayout on my mac and am currently forced to explicity give the path to the layout program "neato" :

      GraphVizLayout layout = new GraphVizLayout(myVisualization);
      layout.setLayoutProgram("/sw/bin/neato");
      myVisualization.setLayout(layout);

       
    • Jean-Daniel Fekete

      Hi,

      To change the layout of a  graph, you have two options.
      1) You can change the layout algorithm, choose one from the infovis.graph.layout package.
      2) You can use the GraphVizLayout and change the name of the external program used to compute the layout. The AT&T graphviz system provides 3 programs: dot, neato and twopi that you can use.

      When you create a NodeLinkGraphVisualization, the default layouts is GraphVizLayout. You can get it and change it then using get getLayout method.

      I hope it helps.
      I'll add more examples in the next release.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.