using a Json file as the input instead of Gexf #66

Closed
Azinp opened this Issue Jan 15, 2013 · 6 comments

Projects

None yet

5 participants

@Azinp
Azinp commented Jan 15, 2013

Hi,I've trying to visualize a network,converted mysql query to json,and I want to know is it possible to use the Json file to fill the graph?
how is it possible ?
Thank you

@faddison

someone wrote one. Cant remember where it was from. But i'm using it to populate my graph from rss feeds. Example at www.fraseraddison.com

File can be found on my repo under js folder. https://github.com/faddison/Eportfolio

@DGaffney
DGaffney commented Feb 6, 2013

Heyo, here's my stab at doing this:

https://gist.github.com/DGaffney/1c2f1c3c6a9501320e94

and some sample data to get you going on transforming your mysql data into the proper format for JSON parsing - this obviously doesn't rescue against lots of different issues (color, position not specified) but its mostly done.

https://gist.github.com/DGaffney/c98d2430b5052630e9a6/raw/5c02bb3198132b1e0ee528141208b4cdc58a6b29/data.json

@computermacgyver
Contributor

Know this is an old issue, but since it's open and being referenced / seen. The sigma.parseJson.js file in the plugins folder will load a json file. There is also a gexf2Json.py file in the same folder to convert a gexf file to the required json format. I'm not sure how this compares with mysql converted to json but it looks similar to DGaffney's example data.

@DGaffney

@computermacgyver it really depends on whatever spec is put on the incoming data - mine was relatively arbitrary and was just mostly a close-ish analog to a GEXF file. For reference, the inspiration for that particular output spec is https://gist.github.com/DGaffney/25d879da9982d8273113 - for a working example of getting ruby data piped through to an output gexf file using that class, you basically just call on the individual functions with your raw data which is basically the same format as that JS file. If you want, I can write up a demo some time in the next few days...

@computermacgyver
Contributor

@DGaffney No need for a working example from my end. I also had tried to do something close to the gexf / how sigma internally represented the graph already. I think we arrived at very similar (perhaps the same) result. I think this probably doesn't need any more attention given its age. I wanted to tack on the information about the plugin simply for future readers' reference. Cheers!

@jacomyal
Owner

The new version of sigma provides a better GEXF parser and a simple method to read a graph from an object (which makes using JSON dead simple).

@jacomyal jacomyal closed this Jan 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment