Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

digraph sometimes doesn't render parallel edges, depending on order. #5

Open
Engelberg opened this issue Apr 6, 2014 · 7 comments
Open

Comments

@Engelberg
Copy link
Contributor

=> (-> [[1 3 {:color :blue, :dir :none}]
        [1 3 {:color :red, :dir :none}]
        [1 2 {:color :green, :dir :none}]]
     digraph
     dot
     show!)

This renders the graph correctly, but simply swap two of the edges and it no longer works properly:

=> (-> [[1 3 {:color :blue, :dir :none}]
        [1 2 {:color :green, :dir :none}]
        [1 3 {:color :red, :dir :none}]]
     digraph
     dot
     show!)
@daveray
Copy link
Owner

daveray commented Apr 8, 2014

Hey Mark. I don't get any difference in the rendering of the two.

screen shot 2014-04-08 at 8 16 06 am

Could it be a graphviz issue? Here's my version info:

$ dot -v
dot - graphviz version 2.28.0 (20111028.1807)
libdir = "/usr/local/lib/graphviz"
Activated plugin library: libgvplugin_quartz.6.dylib
Using textlayout: textlayout:quartz
Activated plugin library: libgvplugin_dot_layout.6.dylib
Using layout: dot:dot_layout
Activated plugin library: libgvplugin_core.6.dylib
Using render: dot:core
Using device: dot:dot:core
The plugin configuration file:
    /usr/local/lib/graphviz/config6
        was successfully loaded.
    render  :  dot fig gd map ps quartz svg tk vml vrml xdot
    layout  :  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout  :  textlayout
    device  :  bmp canon cgimage cmap cmapx cmapx_np dot eps exr fig gd gd2 gif gv imap imap_np ismap jp2 jpe jpeg jpg pct pdf pict plain plain-ext png ps ps2 psd sgi svg svgz tga tif tiff tk vml vmlz vrml wbmp xdot
    loadimage   :  (lib) bmp eps gd gd2 gif jpe jpeg jpg pdf png ps svg

@Engelberg
Copy link
Contributor Author

I'm on version 2.30.1.

Through more testing, I've found that the parallel edge does get drawn as long as all the edges between a given pair of vertexes are grouped together, but doesn't get drawn when they are separated by info about other edges.

@Engelberg
Copy link
Contributor Author

I've worked around the problem by sorting the edges first before passing them to digraph, but if you need me to do anything to further troubleshoot this so others are not affected, let me know.

@daveray
Copy link
Owner

daveray commented Apr 10, 2014

Can you try feeding the output of the dot function directly to the Graphviz dot command?

I'll also try upgrading Graphviz to see if I can reproduce it, although I'm not sure what to do about it.

@Engelberg
Copy link
Contributor Author

I get the same problem when I feed the output directly to dot at the command prompt.

Dorothy generates the following string:

=> (-> [[1 3 {:color :blue, :dir :none}]
           [1 2 {:color :green, :dir :none}]
           [1 3 {:color :red, :dir :none}]]
        digraph
        dot)
"digraph {\n\"1\" -> \"3\" [color=blue,dir=none];\n\"1\" -> \"2\" [color=green,dir=none];\n\"1\" -> \"3\" [color=red,dir=none];\n} "

and when I feed it to dot at the command prompt, I get the following png:

graph

@daveray
Copy link
Owner

daveray commented Apr 14, 2014

Feeding that input directly to dot versions 2.28.0 and 2.38.0 gives the correct output (both red and blue edges between 1 and 3). Maybe there was a bug in 2.30.0 that has since been fixed?

@Engelberg
Copy link
Contributor Author

OK, good to know it's not an issue in the newer versions of dot. Thanks
for investigating.

On Sun, Apr 13, 2014 at 8:51 PM, Dave Ray notifications@github.com wrote:

Feeding that input directly to dot versions 2.28.0 and 2.38.0 gives the
correct output (both red and blue edges between 1 and 3). Maybe there was a
bug in 2.30.0 that has since been fixed?

Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-40331508
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants