【问题标题】:Cluster shape and fill color in dot点中的簇形状和填充颜色
【发布时间】:2013-12-06 06:18:03
【问题描述】:

我正在尝试构建此图表 就是这样的结果:

digraph g { 
//Initial settings
rankdir="LR";
margin="0,0";
node[fontsize=16,fixedsize=true,width=0.7,shape=circle];
edge[fontsize=16];
ratio=fill;

//Start point for arrow
start [shape=point,style="invis",width=0];
start -> 0;

subgraph cluster0 {
    style=filled;
    fillcolor=green;
    node [fontsize=16,fixedsize=true,width=0.7,shape=circle, style=filled, color = black, fillcolor=lightgrey];
    //FW Transitions;
    13 -> 12;
    13 -> 9;
    13 -> 7;
    9 -> 11;

    //BW Transitions
    edge [color=green];
    12 -> 13 ;
    11 -> 13;
    11 -> 7;

    //LVL Transitions
    edge[color=red;style=solid];
    7->9;
}

//FW Transitions
2 -> 4 -> 6 -> 8 -> 10 ;
0 -> 13 [style=dotted];
1 -> 3 -> 5;
0 -> 2;
0 -> 1 ;

//BW Transitions
edge [color=green,constraint=false];
5->7;
edge[constraint=true]
10 -> 12;

//LVL Transitions
edge[color=red;style=solid];

//CONSTRAINT transitions
node [shape=plaintext];
edge[style=invis];
d0 -> d1 -> d2 -> d3 -> d4 -> d5 
2 -> 13 -> 1;
d2 -> 4 -> 12 -> 9 -> 7 -> 3;

//Ranking, order by distance from start
{ rank = same; 0; d0; }
{ rank = same; 1; 2; d1;13;}
{ rank = same; 4; 3; 12; 9; 7; d2;}
{ rank = same; 6; 5; d3;11;}
{ rank = same; 8; d4;}
{ rank = same;  10; d5;}

//Final states
//6[shape=doublecircle]; 
//7 [shape=doublecircle]; 
}

除了簇填充颜色之外,一切似乎都运行良好。我希望用一种颜色填充集群以指出它。我尝试了 color 和 fillcolor 属性,但没有任何反应。

这是因为我用于约束的不可见边还是与我对节点进行排名有关?

谢谢

【问题讨论】:

    标签: graphviz


    【解决方案1】:

    在尝试生成图表时,graphviz 实际上会打印很多警告:

    警告:2 已经在队列集中... ...

    一个节点不能是多个子图的一部分。下面一行

    { rank = same; 1; 2; d1;13;}
    

    实际上定义了一个子图。其中一些节点已在 cluster0 中使用,因此会出现警告。

    如果您注释所有以{ rank=same; ... 开头的行,则警告会消失,并且会出现集群的背景颜色。当然,现在图表可能还有其他问题......

    【讨论】:

      猜你喜欢
      • 2014-10-27
      • 2014-05-26
      • 2022-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多