glejeune / node-graphviz

Node.js interface to the GraphViz graphing tool
http://algorithmique.net
MIT License
197 stars 58 forks source link

Is there a way to tell this library to ignore duplicate edges? #13

Closed shobhitg closed 11 years ago

shobhitg commented 12 years ago

I have some code which ends up creating duplicate edges because I can't figure out how to check if an exact same edge already exists.

Is there a way by which I can tell this library to simply ignore duplicate edges?

shobhitg commented 12 years ago

To demonstrate the issue, I am attaching this output image:

output image

Its not hard to do book-keeping of what edges are already set, but it would dirty down the client code. It would be awesome if the library could do book-keeping and either expose methods to query edges OR just simply provide an option to ignore duplicate edges.

byron-hawkins commented 11 years ago

I'm not familiar with this library, but the underlying graphviz app allows a keyword "strict" that allows at most one edge between any two nodes (in each direction). The keyword goes before "digraph", so it's "strict digraph { ... }" If node-graphviz doesn't have "strict", it's probably easy to add, since it must be generating graphviz source at some point.

tolotrasamuel commented 4 years ago

How to make graph strict ?