gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 19:29:33 26 4
gpt4 key购买 nike

我有一个函数可以记录运行时如何调用方法。我正在尝试使用点来可视化这些信息。有些方法被调用很多次 - 例如,在循环的情况下 - 在图中我只想有一条线连接两个节点 - 是否有一个开关可以做到这一点...参见示例图“RawFitsData._method”调用"RawFitsData.init";多次,在图表中,我只想显示一行 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";

}

最佳答案

使用严格的有向字母。

strict digraph G {
splines=false;
...

它将省略重复的边缘。引用:DOT documentation .

关于graphviz - DOT - 如何减少连接两个节点的线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9226537/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com