[graphviz-interest] CGraph C API and dot rendering: how to render the graph left-to-right?

Jeremy Friesner <[email protected]> Fri, 3 Jan 2014 23:00:45 +0000
Newsgroups gmane.comp.video.graphviz
Message-ID <[email protected]>
Hi all,

I have a C++ program that uses the CGraph API (in conjunction with the "dot" rendering engine to render a directed graph.   Here is an example of a rendered graph in my program:

http://www.lcscanada.com/jaf/avb_graph.png

That works fine, but it would be preferable if the graph's nodes were placed such that the edges flowed from left to right, rather than top to bottom.  Here's a mockup showing roughly the layout I would prefer:

http://www.lcscanada.com/jaf/lr_graph.png

Does anyone know what I can do to achieve this?

I tried the following (directly after my call to agopen(NULL, Agdirected, NULL))):

        SET_RANKDIR(mygraph, RANKDIR_LR);

as well as

        SET_RANKDIR(mygraph, (RANKDIR_LR<<2)|RANKDIR_LR);

… but neither of those changed the orientation of the rendered graph.  (AFAICT the only difference made by adding the above line was that my program would often crash).

Is there a better way to approach this?

Thanks,
Jeremy

NOTICE: This email may contain confidential information.  Please see http://www.meyersound.com/confidential/ for our complete policy.
_______________________________________________
[email protected]
http://lists.research.att.com/mailman/listinfo/graphviz-interest