javagraphserver-sidegraph-layout

Optimized graph drawing for the web


Having seen some suggestions for graphs, I wonder what's the optimum for my problem.

I want to render a directed graph to a servlet/picture that is displayed in the browser. There should be some kind of optimization of position. No dependency to Swing would be preferred. Algorithms are not important, since the structure of the graph is determined by business logic. It would be desired to be able add labels to edges as well. it would be optimal if i can serve this as png/svg.

Which library/service would you recommend?

clarifications:

1) The question is all about Graphs - like Directed Acyclic Graph - NOT - Charts.

2) flot, Google Charts - cannot plot graphs, only charts, or have i missed something?

3) no i do not need interactivity

4) graphviz would be nice, but the grappa java library is quite outdated and is built upon swing/awt. while it may be theoretically possible to render swing to images, it would not be my favorite way to to so in a server-app.

5) it would be fine to use an online service where the images are not hosted locally.

edit: added links to Wikipedia to clarify graph/chart term


Solution

  • As well as waiting weeks to hear about the Magic Framework that's going to solve all your problems in one line of code, there is also the other option of just Writing Some Code yourself to do exactly what you want... (I'm not saying it's 10 minutes' work, but it's probably one or two days, and you posted your question over two weeks ago...)

    Have you had a look, for example, at the Wikipedia entry on Force-based algorithms-- it has pseudocode and a few links that might be helpful.

    I'm assuming it is the layout algorithm that's the issue, and not the matter of creating a BufferedImage, drawing to its graphics context, PNG-encoding it and sending it down the socket. You really don't need a framework for that bit, I don't think.