eren-ck / gexfJS

Gexf parser for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gexfJS - A gexf parser

Parse static and dynamic graphs in gexf format

Usage

Parsing

let promise = gexf.parse('minimal.gexf');
promise.then(function(graph) {
    console.log(graph);
});

Result

{
  "mode": "static",
  "defaultedgetype": "directed",
  "idtype": "string",
  "meta": {
    "lastmodifieddate": "2009-03-20",
    "creator": "Gexf.net",
    "keywords": "",
    "description": "A hello world! file"
  },
  "attributes": {},
  "nodes": [
    {
      "id": "0",
      "label": "Hello"
    },
    {
      "id": "1",
      "label": "Word"
    }
  ],
  "edges": [
    {
      "id": "0",
      "source": "0",
      "target": "1"
    }
  ]
}

Parsing dynamic graphs to array of static graphs

let promise = gexf.parse('photoviz_dynamic.gexf');
promise.then(function(graph) {
    console.log(graph);
    // Dynamic graphs can be transformed into snapshots
    // Array of static graphs
    console.log(graph.snapshots());
});

Todo - add the following gexf features:

Contributors

  • Eren Cakmak - initial work

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Gexf parser for JavaScript

License:MIT License


Languages

Language:JavaScript 98.9%Language:HTML 1.1%