Coder Social home page Coder Social logo

ngraph.fromdot's Introduction

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

ngraph.fromdot's People

Contributors

anvaka avatar

Stargazers

Lennie Budgell avatar Andrii Oriekhov avatar Mark Keller avatar John Ku avatar Kernel Soe avatar zhangaz1 avatar zhouguoqing917 avatar Andy Shora avatar Daniel Trone avatar  avatar Seb Insua avatar Michael Anthony avatar timelyportfolio avatar

Watchers

 avatar timelyportfolio avatar James Cloos avatar Michael Anthony avatar  avatar

ngraph.fromdot's Issues

attributes/value not loaded from dot

I noticed that only the structure of a .dot file is loaded into the graph, and not the data attributes/values.
In the source there's a TODO confirming that. (also in the todot module node attributes weren't written out either)

any chance of you ticking that TODO of your list?

or in the meantime, any suggestions for storing(serializing) a graph and its values in txt format?
I don't particularly care for the .dot format, I have a graph generated via your library which I need to load into your library somewhere else.

thanks!

Multigraph support broken

I believe v20 of nGraph and its changes to how addLink handles multiGraphs has broken this module.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.