Pregunta

The doxygen graph for "includes" and "is included by" are created with nesting depth increasing from top to bottom (using 1.8.5).

Since we have mostly shallow graphs with many nodes, this leads to very wide graphs with ugly horizontal scroll bars. Is there a way to teach doxygen to create these graphs in a left-to-right orientation, the way it creates caller/call graphs?

I know that graphviz/dot supports this, but can't find a way to tell doxygen my preference.

¿Fue útil?

Solución

There is a similar question asked recently which I am duplicate answering: Doxygen: Is it possible to control the orientation of dependency graphs?

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?

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top