glejeune / Ruby-Graphviz

[MIRROR] Ruby interface to the GraphViz graphing tool
https://gitlab.com/glejeune/ruby-graphviz
Other
608 stars 116 forks source link

Any way to set edge direction? #120

Closed nathanl closed 3 years ago

nathanl commented 8 years ago

When running the digraph example in the README, I don't see any way to set the edge direction.

The direction is the same regardless of the order of these two node arguments.

g.add_edges( hello, world )
# vs
g.add_edges( world, hello )

In contrast, if I use dot directly, these two things produce different outputs:

digraph graphname{
  a -> b;
}

// vs

digraph graphname{
  b -> a;
}
dot mygraphdata.dot -T svg -o some.svg

I tried reading the code to find a way to set edge direction, but didn't see a way.

6kamhh commented 3 years ago

Do you mean something like this? g.add_edges( hello, world, dir: "forward")

Options include forward, back, both, none

nathanl commented 3 years ago

Thanks!