Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Java Programming

Graphing Libraries for Java? 51

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, ?"
This discussion has been archived. No new comments can be posted.

Graphing Libraries for Java?

Comments Filter:
  • SVG! (Score:4, Informative)

    by MORTAR_COMBAT! ( 589963 ) on Friday March 11, 2005 @06:06PM (#11914924)
    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 [apache.org] and see if it can fit your solution.
  • yEd (Score:4, Informative)

    by Will Sargent ( 2751 ) on Friday March 11, 2005 @06:07PM (#11914931) Homepage
    yEd [yworks.com] is pretty good. It builds off the yFiles library.
  • by Anonymous Coward on Friday March 11, 2005 @06:40PM (#11915202)
    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).
    • 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 [purdue.edu]. 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
  • Graph vs. Graphing (Score:5, Insightful)

    by xocp ( 575023 ) on Friday March 11, 2005 @07:00PM (#11915391)
    I think there are two issue here: a data structure called by the name "graph" (http://en.wikipedia.org/wiki/Graph_(data_structur e) [wikipedia.org]), 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).
    • Yes, as I read this post, I thought the meaning of the word "graph" was intended as the the data structure, however, most of the replies seem to inquire about a visual display.

    • by Anonymous Coward
      "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.

    • 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.
  • CEWolf (Score:2, Interesting)

    by subri ( 658313 )
    CEWolf [sourceforge.net]
  • gnuplot (Score:3, Informative)

    by photon317 ( 208409 ) on Friday March 11, 2005 @08:29PM (#11915950)

    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.
  • 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.
  • by rowanxmas ( 569908 ) on Friday March 11, 2005 @08:48PM (#11916047)
    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 [sourceforge.net]) 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 [cytoscape.org] 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 ;)
    • by Anonymous Coward
      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 so
      • From your description, JGraph should do just fine. I built an app using it with up to 1000 nodes; overview is just a matter of having a scaled window on the same graph, and the nodes and edges in JGraph can be easily subclassed for the popup behaviors you mention.
      • so, yes, using Images is possible, and I have done so. As is most of the rest of what you want to do. The current CVS does not reflect some recent changes... I will try to get those in soon. It is late right now, so I am keeping this brief, but please contact me:

        xmas at u dot washington dot edu
    • As someone who has had some limited experience with yFiles, I am really impressed with Giny. As you said, you need some more work on some of the algorithms and layouts, but it's looking really keen.
      I'm planning on trying the CVS version soon, and see if there's anything fancy going on there.
    • Is GINY still being actively developed? The CVS source tree looks like it hasn't been touched in months, and the latest file release is from last year. Still, looks like an interesting project, and I'll definitely be looking into it in the near future.
  • On graphviz (Score:2, Interesting)

    by Woodblock ( 22276 )
    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.
  • by crmartin ( 98227 ) on Friday March 11, 2005 @09:51PM (#11916426)
    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?
  • by blake182 ( 619410 ) on Friday March 11, 2005 @10:25PM (#11916612)
    We use JFreeChart [jfree.org] 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.
  • I ask the same question when GUI's and other libraries/frameworks come up: Why are such frameworks ONLY for Java or a specific language? Is it not possible to create a cross-language graphics library? It is not economical to reinvent the wheel for each of the 100 or so popular languages. It is 100 times more effort. That is not 100%, but 100 times! (Well, actually more like 70 times because of adaptors, etc. But the plus side is that you don't have to relearn the package from scratch when you switch languag
    • Well, I'll tell you why I tend to be language specific when investigating these things.

      I'm a mechanical engineer. I can invest the time necessary to brush up on my C/Java/Python to use and implement a specific library, but it is often not the best use of my time.

      I'd way rather find a library that works in the environment with which I am most comfortable (VB, if you're interested) and spend my time using it, instead of spending the time figuring out how to use something else.

      For me, software is a tool

  • Any for Python? (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
    • Matplotlib [sourceforge.net] does plotting in a Matlab-esque style in Python. It also comes with a bunch of Matlab-like commands for reading and manipulating data. It doesn't do any 3D plots, but it has a good range of 2D capabilities.
  • by jdfekete ( 316697 ) on Saturday March 12, 2005 @08:58AM (#11918896) Homepage
    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/ [indiana.edu]

    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/ [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/ [sourceforge.net]) and Prefuse (http://prefuse.sourceforge.net/ [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/ [uni-lj.si]) 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.
  • UC Berkeley's Ptolemy Project [berkeley.edu] has a nice graphing package called Ptplot [berkeley.edu]. It runs as either a standalone application or as an applet, and allows quite a bit of end-user control over the display of the data. There is also a patch available to run Ptplot as a servlet.
  • Graphs versus Plots (Score:3, Informative)

    by Bootle ( 816136 ) on Saturday March 12, 2005 @12:35PM (#11919895)
    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!

  • by xtal ( 49134 ) on Saturday March 12, 2005 @12:51PM (#11920001)
    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.
  • I'd say they only make sense for an application where you want to browse the network "live" but they are pretty damn cool.

    http://hypertree.sourceforge.net/ [sourceforge.net]

    Screenshot
    http://hypertree.sourceforge.net/hypertree1.jpg [sourceforge.net]

    Sadly the project puts light on some sad consequences of the current EU software patents debate.
  • Some of the suggested libraries for Java, such as graphviz, can be used with C. Do you know of any other free C/C++ libraries for network graph description/layout/visualization?
  • I'm very aware that you asked for Java solutions, but you ask /. to get out-of-the-box solutions, too.

    I believe that Flash is better for applets than Java, largely because MS tainted the pool of JVMs. I happen to be currently doing quite a bit of work in graphing in Flash at www.aimchart.com and would be happy to help if you're interested in going that route instead.

  • Diva [berkeley.edu] is a software infrastructure for visualizing and interacting with dynamic information spaces.

    Diva is used by Ptolemy II [berkeley.edu], a set of Java packages supporting heterogeneous, concurrent modeling and design.

    Ptolemy II uses PtPlot [berkeley.edu] to plot 2D signals. Ptplot has a backward compatibilty mode with Xgraph, the signal plotter written by David Harrison for X Windows.

    Total disclosure: I'm on the Ptolemy II and PtPlot development teams.

  • by nwoods ( 868168 )
    Another package you might want to consider is JGo.

    It too is oriented around nodes and links, but is focused more on interactive editing than just on visualization. You can construct more complicated nodes than just simple shapes and/or images with text. You can embed native controls and manipulate subgraphs. There are native versions for Swing and for SWT.

    This is a commercial product, but you do get the sources for the base library. More information is available at http://www.nwoods.com/go/jgo.htm [nwoods.com]

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...