thedude19
thedude19

Reputation: 2673

How to load my data into a GraphML file for easy use in Prefuse?

I'm trying to generate some graphs with prefuse, and it seems like the easiest way to load the data into prefuse is to use a GraphML file.

Is there an easy way to write these files from my data?

Or is there an easier way to load my data into prefuse?

Thanks

Upvotes: 3

Views: 4223

Answers (3)

Alexandre Dumont
Alexandre Dumont

Reputation: 123

Check PyGraphML, a basic Python library designed to parse and generate GraphML files. http://hadim.github.io/pygraphml/index.html

Upvotes: 0

Binary Nerd
Binary Nerd

Reputation: 13927

You could use the Network Workbench, which allows you to load data in a lot of different forms including edge lists. Edge lists are usually the easiest format to generate.

I'm not completely sure if you can export from NWB to say GraphML, but NWB includes a number of visualizations, some of which are based on Prefuse.

If you want to do more with your data than just visualize it then NWB might help you.

Upvotes: 3

Andreas Dolk
Andreas Dolk

Reputation: 114767

yEd can export graphs in GraphML format and JGraphT has a GraphMLExporter. Leaves the problem on how to get your data into those products or libraries. But at least both can create the desired format.

on the other hand - GraphML is in XML format so you can easily use jdom or dom4j to create a DOM, add the nodes based on your data an serialize it to an XML file. This shouldn't be to complicated.

Upvotes: 5

Related Questions