Hi all!
I'm new using the Gephi Toolkit and I have to say it's really cool having so many possibilities by using the API programmatically instead of the app.
However, I've already been a while looking for a method/way to export a graph to its corresponding gexf format String instead to a File.
Does such a method exists?
How could I do that if not? (exporting it to a File and subsequently reading that file doesn't seem to me like a good option...)
Thanks in advance,
Cheers.
Pablo Pareja
[SOLVED] Exporting graph to Gexf format (String not File)
- mbastian
- Gephi Architect
- Posts:728
- Joined:10 Dec 2009 10:11
- Location:San Francisco, CA [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: Exporting graph to Gexf format (String not File)
Yeah you can totally do that, check an example on this page
This is with GraphML format, just change with GEXF.
Code: Select all
Exporter exporterGraphML = ec.getExporter("graphml"); //Get GraphML exporter
exporterGraphML.setWorkspace(workspace);
StringWriter stringWriter = new StringWriter();
ec.exportWriter(stringWriter, (CharacterExporter) exporterGraphML);
System.out.println(stringWriter.toString());