I need a java graph library for visualization that I can incorporate in my own application. I found that jgraph is excellent for visualization but require explicit positioning of the nodes. Is there any open source java graph library that support automatic layout. Any suggestion will be really helpful for me.
There are numerous packages to do that.
If you are used to graphviz, then you may like Grappa, which is a sort of graphviz library for java (though not as complete as the original).
jung is also quite good, providing various layout engines.
Another tool of interest to build nice graph visualizations and animations is prefuse. It it very flexible, and can lead to very good looking visualizations, with complex layouts.
All of them are java libraries, and open source.
I've used JGo for years with success - not free (has free eval).
http://www.nwoods.com/go/jgo.htm
It has autolayout options for digraphs and force-directed, for sure, maybe more. I think the newer versions are much spiffier.
JGraph does support automatic layout and includes a number of graph and hieracichal layout algorithms.
See the API reference and example code for details.
Related
Is there a Java library that enables gathering UI usage statistics?
Something that feels like log4j?
If you are working with the Eclipse plateform you might have a look on the Usage Data Collector project:
http://www.eclipse.org/epp/usagedata/
I answered this question before I saw yours.
Specifically, I would point you at the
NetBeans Platform Gesture Collection Infrastructure.
Although planning to use it, I have not yet, but it is much more mature than the Eclipse Usage Data Collector project listed here.
Porting a generic Swing project to the NetBeans Platform is not too hard, can be done piecemeal, and there are a number of examples (just google "porting swing project to netbeans"). If you decide to go this route, see this tutorial. Geertjan has some other blog entries on porting (and just about every other topic).
I'm looking for a library capable of drawing dendrograms of data in Java (not calculating them, I can do it by myself).. do you have any clues? Already tried to search it over Google but haven't found anything that is not stand-alone (while I need to embed the generation inside my program).
Thanks!
Check out the JUNG graph library. It won't perform the actual clustering for you but is a really good library for visualising your results.
Take a look at Archaeopteryx. It has fairly many features; it's open source, and it is available in a pre-packaged jar file.
BTW, I use JUNG and really like it. It can perform various clusterings, but AFAIK, it has no inherent dendrogram capabilities. Because it has graphing capabilities, you could roll your own dendrogram, but it would take some work.
Is it possible that anyone has a link to a graph class/library that I can use to produce a graph in Java?
Thanks for any help!
My top choice would be JGraph as others have suggested; I am using JGraph5 because it is better documented than the newer alternative, JGraphX. EDIT: JGraphX turns out to be the far superior version, despite the lack of documentation. It's not that hard to figure out.
JGraph
Demonstration app
Feature list
Licensing agreement
Other alternatives I've researched:
JGraphT
"JGraphT is a free Java graph library that provides mathematical graph-theory objects and algorithms...complete source code included, under the terms of the GNU Lesser General Public License." (http://jgrapht.sourceforge.net/)
Main project repository
Example visualizations
JUNG - Java Universal Network/Graph Framework
Main project repository
yEd Graph Editor
Implementation of yFiles library
Demonstration Java applet
About yEd
Saves graphs in GraphML format
I used JGraph as a visualizer for networks of nodes/topologies at my previous job, it's not half bad once you get past the architecture (it's a big state machine if I recall correctly).
Visual graph: JFreeChart
You may also wish to consider the Google Charts API, if you can make web service requests.
A really good alternative is to used the Google Charts API. Platform independent, easy to use, and fast processing (done on Google Server side)
graphviz would be my choice. It's not Java, but still terrific and easy to use.
There is a Java component that works with dot to generate graphs. I've used it - very nice, indeed.
I would recommend JGraphT. I used it to create multi-leveled graphs in my dissertation and as the base of a GPS Routing Software, understanding what is going on I found a bit of a mind bender, but once looking at how the algorithms package works I found it quite easy to implement A*/D* heuristic algorithms. For working out the distance between nodes on the graph I'd also recommend looking at the Haversine function, if that's your thing.
I am working on an Eclipse RCP application which should display an internal hierarchical structure as a graph. The nodes of the graph should be positioned on different points of a background image but should offer drag support. The graph should be zoom-able possibly without resizing the nodes on the maps (layout zoom) while the background image should be scaled normally. Some kind of semantic zoom (showing and hiding sub nodes on request) should be possible.
Which library or tool would be suitable to solve this problem?
Update:
The graph should be displayed similar to an UML class diagram.
I guess the term graph is confusing. Your description suggests a travelling salesman or or class diagram style graph, instead of a earning for the last quarter style graph. I think you are looking for something along the lines of GUESS or Zest.
JFreeChart does most (maybe even all, it is a very comprehensive tool) of what you list, It is simply embeddable in Eclipse. See the Eclipse-CS plugin for example usage.
Best bet would be Graphical Editing Framework (GEF) http://www.eclipse.org/gef/. As it highly integrates into eclipse and includes a 2d visualization library.
As for third-party libraries:
Either prefuse or processing.org are java-based which can be used for graph-based visualization. You should wrap either org.prefuse for prefuse or wrap processing.core for processing as a standalone osgi plugin for a better version-maintenance.
I'd recommend you look at http://code.google.com/p/uofs-silver-hg/ as it is a system that integrated prefuse in her workspace.
I also recommend you look at gephi graph toolkit http://gephi.org/toolkit/ as your problem may involve large-scale information processing.
JUNG is the best Graph vis package I've seen to date.
jung.sourceforge.net
Super flexible and you can pretty much cusomize everything.
Cheers.
You could use Structure101. It will give you the hierarchical graphs which you can export and then manually overlay on your graphic. In fact, you can grab package-level graphs from a s101 repository using an url so I guess you could maybe construct what you're looking for in html...
Cheers.
As far as I know: EMF (Eclipse Modeling Framework) and GMF (Graphical Modelign Framework) are best well-known frameworks to do that.
I've just started to play around with Eclipse GMF.
Has anyone used the framework?
Any good or bad experiences you had using it?
Any alternatives for graphical modeling you could suggest?
EDIT: What good examples are available?
Has anyone used the framework? Yes, I am using it right now. It works, but it is typically quite a bit of coding for the graphical figures. I currently am struggling to leverage the IBM RSA/RSM UML editparts/figures/nodes etc built on top of GMF.
Any good or bad experiences you made using it? Looking back on my initial dives into GMF/EMF/GEF etc I can say for certain, study the examples. There are important patterns that you have to pick-up on from the examples and not the documentation. I would also suggest a new book (Eclipse Modeling Project: A Domain-Specific Language (DSL)) specific for GMF Modeling in Eclipse. I paged through it and it seemed to be the missing manual to some of the more basic concepts. Why the book is good is that is focuses on the key to making UML/Models useful through constraining it to a specific domain and providing a tool that only allows for valid models to be created. There is not a lot of documentation online and the API only tells you so much. WATCH OUT for repaint/paint loops caused by calling setBounds() or other set methods on children, it crashes the eclipse instance, not fun. Oh yes and the APIs are split between eclipse help documentation versions or not included at all.
Any alternatives for graphical modeling you could suggest?
Consider UML profiles with custom images and icons rather than full shape generation. It takes about 2 hours to put together a pretty good Image/Icon editor building on top of UML graphical objects and UML profiles. The IBM RSM tool UML Profile tooling project does this quickly. There is a lot you can do with constrained UML profiles (via Eclipse plug-ins or OCL). Entering GMF land is more than a order of magnitude effort increase, from 1 to 10 hours no problem.
Consider pure DSL (Domain specific language) tools out there. Google will provide a good list. From what I have seen the main reason to use GMF is eclipse integration and leveraging existing ecore/UML models, this is why I use GMF.
Ask yourself do I need model which is easy, or do I need a tool for creating instances of this model. If there are only 1-5 expert users there may not be a need for a sleek tool.
The TOPCASED project makes use of GMF. It provides various graphical editors for UML and other diagrams.
With GMF, most of the editor code is generated for you, but the main complexity arises from having to modify it.
As most recent alternatives, you might try Graphiti and Spray. Here is a comparison and another between GMF and Graphiti.