Graphviz子图看起来像记录形状的节点

时间:2013-04-05 14:42:16

标签: gstreamer graphviz dot subgraph

我正在尝试为GStreamer应用程序生成图形,其中有许多嵌套的bin。每个bin都有一些元素,但父bin的bin看起来像任何其他具有pad(sink和sources)的常见元素。我想要想象它但是在Graphviz中我不能生成嵌套节点所以我必须通过子图来完成它。不幸的是,子图没有像记录形状这样的节点选项。在我的图表中,每个节点都有记录形状,但子图不能。例如:

digraph G
{
    graph [rankdir = TD]
    node [shape = record]

    subgraph cluster_player
    {
        label = "player"        

        subgraph cluster_bin1
        {
            label = "bin1"

            bin1_sink1 [label = "sink1"]
            bin1_sink2 [label = "sink2"]
            obj1 [
                label = "{ { <sink1> sink1 | <sink2> sink2 } | obj1 | { <src1> src1 | <src2> src2 } }"
            ]           
            bin1_src1 [label = "src1"]
            bin1_src2 [label = "src2"]

            bin1_sink1:s -> obj1:sink1:n []
            bin1_sink2:s -> obj1:sink2:n []
            obj1:src1:s -> bin1_src1:n []
            obj1:src2:s -> bin1_src2:n []
        }

        bin1_src1:s -> bin2_sink1:n []
        bin1_src2:s -> bin2_sink2:n []

        subgraph cluster_bin2
        {
            label = "bin2"

            bin2_sink1 [label = "sink1"]
            bin2_sink2 [label = "sink2"]            
            bin2_obj1 [
                label = "{ { <sink1> sink1 | <sink2> sink2 } | obj1 | { <src1> src1 } }"
            ]       
            bin2_obj2 [
                label = "{ { <sink1> sink1 } | obj2 | { <src1> src1 } }"
            ]       
            bin2_src1 [label = "src1"]

            bin2_sink1:s -> bin2_obj1:sink1:n []
            bin2_sink2:s -> bin2_obj1:sink2:n []
            bin2_obj1:src1:s -> bin2_obj2:sink1:n []
            bin2_obj2:src1:s -> bin2_src1:n []
        }
    }
}

enter image description here

正如您所看到的,现在垃圾箱中的源和汇都像普通元素,但我希望它们看起来像“obj1”中的记录。怎么做?如果不可能有其他语言可以有这个功能吗?

1 个答案:

答案 0 :(得分:2)

Graphviz子图是容器。它们不支持您要查找的记录符号或形状属性。 shape仅限于节点,而子图则不受限制。