Slashdot Mirror


Graphing Libraries for Java?

Node and Edge asks: "Many interesting problem domains involve some form of graph-based or graph-like information: network activity visualizations; social software; workflow management; P2P software development; and version control with branching, just to name a few. It is notoriously difficult for people to visualize a graph structure - unless it happens to be a strictly hierarchical tree-like structure, such as what we know from file-system explorers. Now, with all of that said, what graph libraries can you recommend? The following criteria apply, though they're not absolute: Java or Java bindings; simple to use for simple applications; and polished, extensible UI components. I'm familiar with JGraph, JUNG, Prefuse, OpenJGraph, Tigris GEF, Eclipse GEF, Graphviz, but have not had a chance to evaluate them all. Have you used any of these extensively? If so, can you provide any constructive advice? If not, can you recommend something else, ?"

21 of 51 comments (clear)

  1. SVG! by MORTAR_COMBAT! · · Score: 3, Informative

    I guess I don't know the exact problem domain you are working with or what application environment you are looking to present graphs with... but server-side SVG generation has worked pretty well for us.

    Check out Batik and see if it can fit your solution.

    --
    MORTAR COMBAT!
    1. Re:SVG! by Black+Acid · · Score: 2, Informative

      You could, in theory, use SVG to display graphs. I actually considered doing this for a project I was working on last week. Check out, for example, GPS Visualizer. Upload a GPS map with waypoints, and it outputs an SVG file of the map with the access points connected to their locations. (Note that the sample map does not include any waypoints.) Its very neat, you can drag the labels around. With some effort, I'm sure SVG could be used to display an interactive graph that could be manipulated easily. Of course you probably wouldn't want to implement the graph algorithms in JavaScript (to interact with SVG) for any serious application, but there's nothing stopping you. At the very least, SVG might be worth looking into for visualizing the graphs generated by your Java program.

    2. Re:SVG! by MORTAR_COMBAT! · · Score: 2, Informative

      Please stop confusing graphics with graphs.

      please stop confusing SVG with some other technology that cannot display graphs. In fact my company uses SVG technology to display all kinds of information in graph format, rendering server-side SVG to PNG for display by a web browser using Batik. When browser support is fixed we will be able to simply send the SVG itself and provide more interactivity with the graph (not graphic) by being able to click data points, for example.

      --
      MORTAR COMBAT!
  2. yEd by Will+Sargent · · Score: 3, Informative

    yEd is pretty good. It builds off the yFiles library.

  3. Graphviz works pretty well by Anonymous Coward · · Score: 3, Informative

    My solution for graph visualization was to use Java to dump graphs in a DOT-format file for Graphviz, and then use dot/neato to generate SVG. It works pretty well - clean output, and reasonably fast for moderately-sized graphs in dot. (Neato is much slower).

    1. Re:Graphviz works pretty well by RootsLINUX · · Score: 2, Informative

      I have also used GraphViz and I find it very useful. I've used GraphViz in research to create a DAG of simulated computer intrusion paths in this paper: PDF. I think it's a fun piece of software to play around with, and I've also used it in some visualizations for my senior design project (though I forgot what for) and to produce an image detailing the source tree for my game project. If I ever have extra time (which probably won't happen for the rest of my life) I'd be interested in hacking GraphViz to add a couple features I'd like to see.

      --
      Hero of Allacrost, a FOSS RPG for *NIX/*BSD/OS X/Win
  4. Graph vs. Graphing by xocp · · Score: 5, Insightful

    I think there are two issue here: a data structure called by the name "graph" (http://en.wikipedia.org/wiki/Graph_(data_structur e)), and a means to visualize these structures.

    A library could address one or both of these topics. The title of this article is therefore somewhat misleading (i.e. just focusing on the graphical display of a graph).

    1. Re:Graph vs. Graphing by Anonymous Coward · · Score: 3, Informative

      "involve some form of graph-based or graph-like information"

      The focus of JUNG is on handling graph data structures.

      The focus of GraphVIZ is on generating graphical representations of graph structures.

      The focus of JGraph, GEF, and others is on creating user interfaces to interact with graph structures.

      Indeed, I'm interested in hearing about libraries that address any and all of: rendering graphs, algorithmic graph manipulation, interacting with graphs.

    2. Re:Graph vs. Graphing by Black+Acid · · Score: 2, Informative

      Not to pick nits, but a graph is not a data structure. A graph is an abstract data type, which is commonly implemented using an adjacency matrix or adjacency list. Arrays and linked lists are data structures, graphs are not.

  5. CEWolf by subri · · Score: 2, Interesting
  6. gnuplot by photon317 · · Score: 2, Informative


    gnuplot is kind in this domain. I don't know how you'd cleanly interface to it from inside a jvm other than spawning a native binary of gnuplot and feeding it text commands.

    --
    11*43+456^2
  7. I do all my Graphs on paper napkins with Java by WillAffleckUW · · Score: 4, Funny

    I drink the Java, I spill some on the table, then I graph the absorbance factor of the paper napkin.

    Now if I could just stop the shakes and not being able to sleep, I'd be fine.

    --
    -- Tigger warning: This post may contain tiggers! --
  8. Finally a Slashdot Article about this! by rowanxmas · · Score: 5, Interesting
    It just so happens that I have done a lot of work in this area. Specifically in the business of making a good Open Source Java Graph library. For me there were several concerns.
    1. Open Source, Free
    2. Really Cool Looking Display
    3. Easy to add to
    4. Easy to use API
    5. Suited to my work ( Biology )
    At the time we were using yFiles, but it has several problems. Mainly, it is pay-for-it software, and hard to extend (i.e. no Interfaces, Node and Edge are final, not Open Source, so no custom code was possible.) However, yFiles has better layout than anyone else in this field.

    After evaluating many packages (which are listed here) which include the ones you have listed. We decided that our needs were not met and built our own. (First one on the preceding link) The main thing that I needed was a flexable UI, for showing Multi-Dimensional Data, and support for subgraphs, in a way that makes lots of sense in how I work, but I am not sure if it is suitable elsewhere yet, or not.

    The integrated software that uses my Graph Library is called Cytoscape and while still a work in progress is getting way better every release. In terms of the Graphing support, I think we are top notch, but we need to spend more time on algorithms and layouts ;) In addition we have an active development team that is well funded from MSKCC, UCSD, ISB, Agilent, and support from Unilever.

    I will be checking this thread throughout the weekend, so please reply if I can be of more help. And thanks for getting this onto Slashdot! I hope that more people will becocem involved in graphing, and especially in making file formats standard ;)
    1. Re:Finally a Slashdot Article about this! by Anonymous Coward · · Score: 2, Interesting

      Great, thanks for the response. The screenshots for Cytoscape look very polished; the plug-ins seem to cover a broad spectrum of applications, which is very cool. I actually submitted this "story" near the end of January, so was surprised to see it show up today!

      I'm looking into GINY now and would be interested to hear more about the sub-graphing system that is mentioned on the main GINY page (I will read the detailed documentation, but maybe you can give an overview)?

      Looks like it's possible to create some pretty nice custom nodes - is it easy to create nodes with image icons?

      For my application, the graph UI has the following characteristics:
      1. Typically shows between five and fifty nodes per graph.
      2. Various nodes may have different icons.
      3. It should be possible to open a dialog window when a node is clicked, or right-clicked.
      4. It should be possible to control the color of a node through code (generally a thin border around the image), to indicate the change in state of a given node.
      5. It should be possible to create and modify connections (edges) between nodes.
      6. It should be possible to arrange the layout manually, but also to apply an automated layout routine.

      I am currently doing all of these things with an existing library, but the library in question is no longer being supported as free-of-charge software, so I am looking elsewhere ...

      My goal is to achieve all of the above items with code that is as simple and clear as possible. I'd also like some sort of "zoom" window, i.e. a high-level overview of the graph, for when the nubmer of nodes gets large - looks like GINY has something like that. I also need the ability to collapse parts of the graph into a single "combined" node, and re-expand the node again; is this something you currently do in Cytoscape or one of the other apps?

      How does one typically link GINY to an applications data model? Does GINY use its own graph structure (in duplicate), or do I just write an adapter to my model?

      I'll read up on your library, any suggestions or thoughts are welcome!

  9. On graphviz by Woodblock · · Score: 2, Interesting

    I've used graphviz extensively in one project. I found it simple to use and I believe there are Java bindings available, but it is pretty simple to just create a dot file and feed that to dot(1). But it does not provide widgets or anything you can integrate into a Java application in that way. It simply deals with visualization and layout of graph structures. If all you need is an image, it is great, but anything beyond that and it won't serve your needs.

  10. What are you trying to *do*? by crmartin · · Score: 3, Interesting

    I've used JGraph and Graphviz very happily, and can recommend them ... but they do very different things. Can you feed us a couple of use cases, or user stories? A little narrative?

  11. JFreeChart works for us by blake182 · · Score: 3, Interesting

    We use JFreeChart which works fine for us. We have fairly simple data to graph (a line chart with messages per second, bar charts for top spam and virus recipients) for the analysis summary in an email scanning product.

  12. Any for Python? by rendermaniac · · Score: 2, Interesting

    Just wondering if anyone knows some good libraries for doing this with Python? Or would it be better to use a Java one with Jython? And how would you go about this?

    Simon

  13. Workshop on Visualization by jdfekete · · Score: 5, Informative

    Katy Börner and I have been organizing a workshop on Information Visualization Infrastructures, including graph drawing packages. The results are available at http://vw.indiana.edu/ivsi2004/

    There are lots of different tradeofs involved. One being interactive vs. static graphics. Another being the size of the graphs.

    For static graphs, such as class hierarchies and such, Graphviz (http://www.graphviz.org/ works fine and is easy to integrate in a system. For some graphs, Graphviz will not work at all so you need to try first.

    For large or dense graphs, above 1000 nodes or more than 4 times more edges than vertices (5n etc), node-link diagrams don't work at all. You could use a matrix but people are not used at reading matrices.

    For interactive visualization of graphs, Jung (http://jung.sourceforge.net/) and Prefuse (http://prefuse.sourceforge.net/) are fine if you have small graphs ()

    If you are a graph wizard and want to analyze large social networks, you can take a look at Pajek (http://vlado.fmf.uni-lj.si/pub/networks/Pajek/) but it is not a free software and runs mostly on Windows.

    Other packages are ok for simple things, stereotyped things or more experimental things. You need to try them on your own problem to decide.

  14. Graphs versus Plots by Bootle · · Score: 3, Informative
    I'd just like to point out, because I haven't seen it mentioned and some people seem to be getting it wrong, that the term 'graph' here is being used for a specific object.

    Just wanted to point this out to anyone new to the area: The graphs being discussed are NOT something you can make in excel, which should really be called plots or charts (in this context). These are not pie charts, or XY scatter plots, there is no least-squares fitting to a Graph.

    What is meant by a graph (in this context) is a collection of nodes (aka vertices) and edges (aka links) connecting those nodes. An example graph could be a friendship network: People are represent as nodes and an edge falls between two nodes when those two people are on a first name basis.

    So Graph Visualization is not trivial at all. Very complex relationships are modelled as graphs and good software is important. I for one use the graphviz port on OS X (that won an apple developers award) after becoming thoroughly sickened with Pajek in windows!

  15. Better off learning a good graphics API (Java3D) by xtal · · Score: 2, Informative

    I've done a lot of projects requiring scientific and mathematical visualization; with a couple exceptions, I was better served by having a background working with OpenGL than expertise with an existing graphics library.

    On average, producing something that looked great and was exactly what I wanted I would estimate the labour effort at between 3-5 productive days. This is at least comparable to the effort I would have spent learning a graphing library, or working around something that I didn't like with an off the shelf solution.

    YMMV.

    --
    ..don't panic