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

发布于 2025-01-04 11:27:58 字数 1452 浏览 4 评论 0原文

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

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";

    }

I have a function that records the how methods are called at run-time. I am trying to use dot to visualize this information. Some methods are called many times- eg, in the case of a loop - in the graph i would want to have only one line connecting both nodes - Is there a switch do to this... See example diagram "RawFitsData._method" calls "RawFitsData.init"; multiple times, in the graph, i would like to display only one lineenter 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";

    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

山有枢 2025-01-11 11:27:58

使用严格的有向图。

strict digraph G {
    splines=false;
    ...

它将省略重复的边缘。参考:DOT 文档

Use strict digraph.

strict digraph G {
    splines=false;
    ...

It will omit repeating edges. Reference: DOT documentation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文