Doxygen:是否可以控制依赖图的方向? [英] Doxygen: Is it possible to control the orientation of dependency graphs?

查看:72
本文介绍了Doxygen:是否可以控制依赖图的方向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到今天,我一直在使用doxygen(+ dot)的古老版本(1.4.7),它通常绘制垂直方向的图形,例如

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.

..但有一个更新的版本(通过Ubuntu分发的1.8.6),这些图似乎是水平的,即

.. but with a more recent one (1.8.6 as distributed via Ubuntu), the graphs seem to be horizontal, i.e.

水平方向的问题是,许多图形都偏离了右侧窗口,因此您必须进行 2D滚动才能查看数据。

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.

我看过doxygen网页,但是看不到是否有任何选项可以告诉点以垂直方向绘制它们。有人知道是否存在这样的选项吗?

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?

推荐答案

2014年有一个类似的问题,我重复回答:
从顶部翻转doxygen的图从底部到从左到右的方向

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.

步骤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:

如何使用Windows命令行环境查找和替换文件中的文本?

这篇关于Doxygen:是否可以控制依赖图的方向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆