4
votes

I'm trying to generate graph for GStreamer applications where are many nested bins. Each bin have some elements but bin for parent bin looks like any other common element that have pads (sinks and sources). I want to visualize it but in Graphviz I can't generate nested nodes so I have to do it by subgraphs. Unfortunately subgraphs don't have node options like record shape. In my graph each node have record shape but subgraphs can't. Example:

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

As You can see now sources and sinks in bins are like normal elements, but i want them to look like records in "obj1". How to do it? If it's impossible maybe there are others languages that will have that function?

1
Is the graphviz support in gstreamer not good enough for you? Check out the GST_DEBUG_DUMP_DOT_DIR envvar and the related macros. - ensonic
It's not good enough for me becouse I want to make it nicer ;) - Mateusz Drost
What about asking on graphviz mailing list instead? I've spend quite a bit of time to come up with the current form. Having ports on nodes and clusters would indeed be nice. - ensonic

1 Answers

2
votes

Graphviz subgraphs are containers. They do not support the record notation or the shape attributes you are looking for. shape is restricted to nodes, and subgraphs are not.