从顶部到底部的方向翻转doxygen的图 [英] Flip doxygen's graphs from top-to-bottom orientation to left-to-right
问题描述
创建了"包括"和"被包括"的doxygen图,嵌套深度从上到下递增(使用1.8.5).
The doxygen graph for "includes" and "is included by" are created with nesting depth increasing from top to bottom (using 1.8.5).
由于我们的图大多数都是带有多个节点的浅图,因此这会导致带有丑陋的水平滚动条的非常宽的图.有没有一种方法可以教导doxygen以从左到右的方向创建这些图,以及创建呼叫者/调用图的方法?
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?
我知道graphviz/dot
支持这一点,但是找不到告诉doxygen我的偏好的方法.
I know that graphviz/dot
supports this, but can't find a way to tell doxygen my preference.
推荐答案
最近有一个类似的问题,我重复回答: Doxygen:是否可以控制依赖图?
There is a similar question asked recently which I am duplicate answering: Doxygen: Is it possible to control the orientation of dependency graphs?
我自己找了一样东西,却一无所获后,我能提供的最好方法是使用图形属性rankdir进行破解.
After looking for the same myself and finding nothing, the best I can offer is a hack using the graph attribute rankdir.
步骤1)确保Doxygen保留点文件.将DOT_CLEANUP = NO放入您的配置文件中.
Step 1) Make sure Doxygen keeps the dot files. Put DOT_CLEANUP=NO in your confige file.
第2步)找到Doxygen生成的点文件.应采用* __ incl.dot的形式.对于以下步骤,我将此文件称为<source>.dot
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
步骤3a)假设该点文件未明确指定rankdir(默认情况下通常为TB"),请使用此命令重新生成输出.
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
步骤3b)如果由于某种原因在点文件中指定了rankdir,请进入该文件并添加rankdir="LR"
(默认情况下,它们是rankdir
设置为"TB"
).
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
每次运行Doxygen后,您都需要重做一次.批处理文件可能很方便,特别是如果您要处理所有文件.对于步骤3b,批量替换文本不在此答案的范围内:).但这似乎是一个很好的答案:
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: