/ngraph.fromdot

Load dot files into ngraph.graph

Primary LanguageJavaScriptMIT LicenseMIT

ngraph.fromdot Build Status

Load dot files into ngraph.graph

usage

var dot = require('ngraph.fromdot');

// you can load empty graph:
var emptyGraph = dot('digraph G {}');

// or graph with edges only:
var twoEdgesGraph = dot('digraph G { a -> b }');

// above graph is the same as
var sameAsAbove = dot('digraph G { a; b; a -> b }');

// you can also "append" to existing graph if you wish so:
dot('digraph B { a -> b }', emptyGraph);

// now emptyGraph is no longer empty:
emptyGraph.getLinksCount(); // returns 1
emptyGraph.getNodesCount(); // returns 2

install

With npm do:

npm install ngraph.fromdot

license

MIT