Up until today, I'd been using an "ancient" version (1.4.7) of doxygen (+dot) and it typically drew graphs with a vertical orientation, e.g.
.. but with a more recent one (1.8.6 as distributed via Ubuntu), the graphs seem to be horizontal, i.e.
The problem with the horizontal orientation is that many of the graphs go well off the right edge of the window and so you have to do "2D" scrolling to see the data.
I've looked in the doxygen web pages but couldn't see if there was an option to tell dot to draw them with the vertical orientation. Does anyone know if such an option exists?
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With