Doxygen: Is it possible to control the orientation of dependency graphs?

There is a similar question asked in 2014 which I am duplicate answering: Flip doxygen's graphs from top-to-bottom orientation to left-to-right

After looking for the same myself and finding nothing, the best I can offer is a hack using the graph attribute rankdir.

Step 1) Make sure Doxygen keeps the dot files. Put DOT_CLEANUP=NO in your confige file.

Step 2) find your dot files that Doxygen generated. Should be in the form *__incl.dot. for steps below I will refer to this file as <source>.dot

Step 3a) Assuming the dot file did not explicitly specify rankdir (usually it is TB" by default), regenerate the output with this command.

dot -Grankdir="LR" -Tpng -o<source>.png -Tcmapx -o<source>.map <source>.dot 

Step 3b) If for some reason rankdir is specified in the dot file, go into the file and add the rankdir="LR" (by default they are rankdir is set to "TB").

digraph "AppMain"
{
  rankdir="LR";
...

Then regenerate the output with:

dot -Tpng -o<source>.png -Tcmapx -o<source>.map <source>.dot 

You need to redo this after every run of Doxygen. A batch file might be handy, especially if you want to process all files. For step 3b, batch replacing text is outside of the scope of this answer :). But here seems to be a good answer:

How can you find and replace text in a file using the Windows command-line environment?

Tags:

Doxygen

Dot