Graphviz:两个子图中的节点
我有一个不同簇的图。基本上,我想配对不同的节点,也就是说,以某种方式显示不同的节点有特殊的关系。因此,我决定使用群集,以便节点显示在矩形中。Graphviz:两个子图中的节点,graphviz,dot,subgraph,Graphviz,Dot,Subgraph,我有一个不同簇的图。基本上,我想配对不同的节点,也就是说,以某种方式显示不同的节点有特殊的关系。因此,我决定使用群集,以便节点显示在矩形中。 问题是一个节点可以与多个节点建立关系,即它可以位于不同的集群中。但是我还没有找到在两个集群中插入节点的方法。 我有以下代码: digraph G {rankdir="LR"; node [fontname = "font-awesome"]; subgraph cluster3 { 4 -> 5 [id="4t5",colo
问题是一个节点可以与多个节点建立关系,即它可以位于不同的集群中。但是我还没有找到在两个集群中插入节点的方法。
我有以下代码:
digraph G {rankdir="LR";
node [fontname = "font-awesome"];
subgraph cluster3 {
4 -> 5 [id="4t5",color="#717070",arrowsize=.5];
8 -> 4[id="8t4",color="#717070",arrowsize=.5];
subgraph cluster31{
4 [id=4,fillcolor="#F5BDA2", shape=rect;label=<<TABLE BORDER="0">
<TR><TD>1:12</TD></TR>
</TABLE>>, style="filled",fontsize=6,fixedsize=true,width=0.5,height=0.2,shape=Mrecord];
5 [id=5,fillcolor="#F5BDA2", shape=ellipse;label=<<TABLE BORDER="0">
<TR><TD ID="32e" HREF=" ">1:13</TD></TR>
</TABLE>>, style="filled"];
}
subgraph cluster32{
8 [id=8,fillcolor="#F5BDA2", shape=rect;label=<<TABLE BORDER="0">
<TR><TD>1:19</TD></TR>
</TABLE>>, style="filled",shape=box];
5 [id=5,fillcolor="#F5BDA2", shape=ellipse;label=<<TABLE BORDER="0">
<TR><TD ID="32e" HREF=" ">1:13</TD></TR>
</TABLE>>, style="filled"];
}
}
}
有向图G{rankdir=“LR”;
节点[fontname=“font-awesome”];
子图簇3{
4->5[id=“4t5”,color=“#717070”,arrowsize=.5];
8->4[id=“8t4”,color=“#717070”,arrowsize=.5];
子图簇31{
4[id=4,fillcolor=“#F5BDA2”,shape=rect;label=,style=“filled”,fontsize=6,fixedsize=true,width=0.5,height=0.2,shape=Mrecord];
5[id=5,fillcolor=“#F5BDA2”,形状=椭圆;标签=,style=“filled”];
}
子图簇32{
8[id=8,fillcolor=“#F5BDA2”,shape=rect;label=,style=“filled”,shape=box];
5[id=5,fillcolor=“#F5BDA2”,形状=椭圆;标签=,style=“filled”];
}
}
}
是否有一种方法或黑客或其他方法来实现此想法?为什么要使用id=“…”语句?这通常是不必要的 如果你说得对,我不是100%,但是如果你只是将集群32中的节点名从5改为6,而不是标签,那么你就可以在两个集群中看到“相同”的两个节点 例如:这个:
digraph G {rankdir="LR";
node [fontname = "font-awesome"];
subgraph cluster3 {
4 -> 5 [color="#717070",arrowsize=.5];
8 -> 4[color="#717070",arrowsize=.5];
subgraph cluster31{
4 [fillcolor="#F5BDA2", shape=rect;label=<<TABLE BORDER="0">
<TR><TD>1:12</TD></TR>
</TABLE>>, style="filled",fontsize=6,fixedsize=true,width=0.5,height=0.2,shape=Mrecord];
5 [fillcolor="#F5BDA2", shape=ellipse;label=<<TABLE BORDER="0">
<TR><TD ID="32e" HREF=" ">1:13</TD></TR>
</TABLE>>, style="filled"];
}
subgraph cluster32{
8 [fillcolor="#F5BDA2", shape=rect;label=<<TABLE BORDER="0">
<TR><TD>1:19</TD></TR>
</TABLE>>, style="filled",shape=box];
6 [fillcolor="#F5BDA2", shape=ellipse;label=<<TABLE BORDER="0">
<TR><TD ID="32e" HREF=" ">1:13</TD></TR>
</TABLE>>, style="filled"];
}
}
}
有向图G{rankdir=“LR”;
节点[fontname=“font-awesome”];
子图簇3{
4->5[color=“#717070”,箭头大小=.5];
8->4[color=“#717070”,箭头大小=.5];
子图簇31{
4[fillcolor=“#F5BDA2”,shape=rect;label=,style=“filled”,fontsize=6,fixedsize=true,width=0.5,height=0.2,shape=Mrecord];
5[fillcolor=“#F5BDA2”,形状=椭圆;标签=,style=“filled”];
}
子图簇32{
8[fillcolor=“#F5BDA2”,shape=rect;label=,style=“filled”,shape=box];
6[fillcolor=“#F5BDA2”,形状=椭圆;标签=,style=“filled”];
}
}
}
将导致: