Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anvaka/ngraph.gexf
Gephi *.gexf file parser
https://github.com/anvaka/ngraph.gexf
Last synced: 7 days ago
JSON representation
Gephi *.gexf file parser
- Host: GitHub
- URL: https://github.com/anvaka/ngraph.gexf
- Owner: anvaka
- License: mit
- Created: 2014-01-25T07:06:00.000Z (almost 11 years ago)
- Default Branch: main
- Last Pushed: 2024-08-28T07:28:20.000Z (3 months ago)
- Last Synced: 2024-09-28T12:17:31.633Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 413 KB
- Stars: 10
- Watchers: 4
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ngraph.gexf
Gephi [`gexf`](http://gexf.net/format/) file parser for server and browser. This library is a part of [ngraph](https://github.com/anvaka/ngraph) project. See demo here: [Talking with Gephi](https://github.com/anvaka/ngraph/tree/master/examples/storage/gephi)
[![build status](https://github.com/anvaka/ngraph.gexf/actions/workflows/tests.yaml/badge.svg)](https://github.com/anvaka/ngraph.gexf/actions/workflows/tests.yaml)
# usage
This library allows you to load `gexf` files into [`ngraph.graph`](https://github.com/anvaka/ngraph.graph).
``` js
var fs = require('fs');
var gexf = require('ngraph.gexf');
var graph = gexf.load(fs.readFileSync('myfile.gexf', 'utf8'));
// graph is now normal grpah and can be used by ngraph modules
```You can also store graph into `gexf` file format:
``` js
var gexf = require('ngraph.gexf');var binTree = require('ngraph.generators').balancedBinTree(5);
var gexfFileContent = gexf.save(binTree);
```# Details
This library supports node.js and browser runtime (via [browserify](http://browserify.org/)).
When used from node.js it uses `libxmljs` library for quick parsing of xml files.
When used in a browser it uses browser's capabilities to read and query xml files.Because of this, library size is really small when served in the browser:
* 24kb - unminified
* 13kb - minified
* 4kb - gzippedCurrent implementation is really basic and does not support some of the gexf features:
* Dynamics - https://gephi.org/gexf/format/dynamics.html
* Hierarchy - https://gephi.org/gexf/format/hierarchy.html
* Phylogeny - https://gephi.org/gexf/format/phylogeny.htmlAdding Hierarchy and Phylogeny is relatively easy and they will be implemented
if such need arise. Dynamics - requires to think a little bit to better represent
graph's timeline.# install
With [npm](https://npmjs.org) do:
```
npm install ngraph.gexf
```# license
MIT