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: Tamas Nepusz
Subject: Re: [igraph] Is it possible to use igraph in Java?
Date: Thu, 2 Apr 2009 17:25:23 +0100

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





reply via email to

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