Skip to content

anvaka/ngraph.fromdot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 26, 2025
6c9e250 · Jan 26, 2025

History

73 Commits
Jun 17, 2024
Jul 26, 2020
Jan 26, 2025
Jun 13, 2024
Jan 4, 2025
Jul 10, 2021
Jan 26, 2025
Jan 26, 2025
Jan 26, 2025

Repository files navigation

ngraph.fromdot Build Status

Load dot files into ngraph.graph

usage

You can get the library from CDN:

<script src='https://cdn.jsdelivr.net/npm/ngraph.fromdot/dist/ngraph.fromDot.js'></script>

Or from npm:

npm install ngraph.fromdot

and then:

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

After the library is loaded, it is straightforward to use:

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

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

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

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

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

license

MIT

About

Load dot files into ngraph.graph

Resources

License

Stars

Watchers

Forks

Packages

No packages published