DOT - 如何减少连接两个节点的线路

时间:2012-02-10 10:47:30

标签: graphviz dot

我有一个函数,记录在运行时调用方法的方式。我正在尝试使用点来显示这些信息。一些方法被多次调用 - 例如,在循环的情况下 - 在图中我想要只有一条线连接两个节点 - 是否有一个开关做到这一点...参见示例图“RawFitsData._method”调用“RawFitsData的初始化即可。”;多次,在图表中,我只想显示一行enter image description here

digraph G{
    splines=false;
    ranksep=1;
node[shape=box, color=grey, style=filled];


    "DBProxy.fetch_from_database" -> "RawFitsData._method";
    "RawFitsData._method" -> "RawFitsData.__init__";
    "RawFitsData._method" -> "RawFitsData.__init__";
    "RawFitsData._method" -> "RawFitsData.__init__";
    "RawFitsData._method" -> "RawFitsData.__init__";
 "RawFitsData._method" -> "RawFitsData.__init__";
    "RawFitsData.__init__" -> "RawFitsData._method";
    "RawFitsData._method" -> "RawFitsData.__init__";
    "RawFitsData.__init__" -> "RawFitsData._set_pathname";
    "RawFitsData._set_pathname" ->"split";
    "RawFitsData._set_pathname" ->"setter";
    "RawFitsData.__init__" -> "RawFitsData._get_pathname";
    "RawFitsData._get_pathname" ->"getter";
    "RawFitsData._get_pathname" ->"join";
    "deepcopy" ->"RawFitsData._method";
    "RawFitsData._method" -> "RawFitsData.__reduce__";
    "RawFitsData.__reduce__" -> "WeakValueDictionary.__setitem__";
    "RawFitsData.__reduce__" ->"getter";
    "RawFitsData.__reduce__" -> "RawFitsData._get_pathname";
    "RawFitsData._get_pathname" ->"getter";

    }

1 个答案:

答案 0 :(得分:5)

使用严格的有向图。

strict digraph G {
    splines=false;
    ...

它将省略重复边缘。参考:DOT documentation