igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Is it possible to use igraph in Java?


From: Chris Wj
Subject: Re: [igraph] Is it possible to use igraph in Java?
Date: Thu, 2 Apr 2009 17:38:34 -0400

There are enough java graph visualization tools floating around already, and many of them open up the standard graph files that igraph generates. This is where igraph would benefit from a way to write graph files to any file like object instead of just to a file on disk. I think you should go the python or C++ route and forego the java, but that's just my opinion (I'm not the java lover). If you want some cool visualization check out UbiGraph; it's really simple to use. I'd love to write an igraph interface for it.



On Thu, Apr 2, 2009 at 12:25 PM, Tamas Nepusz <address@hidden> wrote:
Could rJava be used to interface with R, which calls igraph?
http://www.rforge.net/rJava/
I guess rJava works the other way round; i.e., it allows you to access Java objects from R.


Another idea, I'm not sure I need full integration.  Could an output layout be written that includes the x,y,z coords for each node/edge, so that it could be imported into a java app and plotted?
Do you mean that you want to generate a layout with igraph, save the coordinates and then use that to plot something in Processing? That should be simple; assuming that g is your graph in Python, you can simply do as follows:

from igraph import *

# Construct your graph here

layout = g.layout("kamada_kawai_3d")
f = file("layout.txt", "w")
for x, y, z in layout:
 print >>f, x, y, z
f.close()


You can also construct a Python script that simply writes the coordinates to stdout and then call it from Java and read the output of the Python script directly.

--
Tamas



_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help


reply via email to

[Prev in Thread] Current Thread [Next in Thread]