port JUNG into GWT [closed]

2019-05-06 18:54发布

there is a very good java graphing library JUNG

I wonder if there exists any GWT library that does what JUNG do ? i'm aware there exist a commercial Javascript graphing library mxGraph. But mxGraph is very expensive and have a very restrictive licensing policy.

does anyone knows of any GWT graphing library similar to mxGraph (JS) or JUNG( java)?

if there is no GWT library for graphing like JUNG, I'm keen on porting JUNG into GWT. I was thinking to use gwt-graphics library as a basis and extend it with more JUNG like features . what is a good strategy to port JUNG into GWT? should i rewrite most of JUNG java classes into client GWT classes? would there be a way to wrap JUNG classes inside some client side GWT classes ? I guess b/c JUNG uses the java swing framework ,the porting will require to migrate most UI JUNG classes (swing based) into GWT based widgets.

any Ideas or suggestions about this subject?

Best.

2条回答
地球回转人心会变
2楼-- · 2019-05-06 19:15

Of course you have to first check the licensing policy for JUNG. That might already limit out some options. IIRC, the licence is Apcahe 2.0.

As you mentioned, drawing you must re-implement. For that there a few options: GWTCanvas, GWT Graphics and g2d, and probably others that I forgot.

Also, to take full benefit of the GWT approach must not rely on too many external projects, which makes a bit harder.

Based on all these, I would go for using only some of the classes and porting them to GWT one by one. Maybe starting from the graph layout algorithms.

查看更多
对你真心纯属浪费
3楼-- · 2019-05-06 19:15

Check out this similar question.

It would be very nice to have a GWT presentation layer for JUNG. The approach we've been taking is to use RaphaelGWT (wrapper for RaphaelJS) for drawing and JUNG for layout on the server side. We tried to port JUNG to the client side (where everything is translated into Javascript) but reliance on concurrent libraries and parts of the JRE made this unfeasible.

On the server side we grab the data and create our own graph object (GEGraph) with Node and Connection maps. Then we put all that into a JUNG graph and call layout on it, retrieving the x and y coordinates for each node and putting that in the GEGraph. The GEGraph is then sent to the client and drawn with Raphael.

查看更多
登录 后发表回答