为什么Graphviz / Dot对这个特定代码的行为如此奇怪?

时间:2013-01-10 07:00:09

标签: graphviz dot graph-visualization

我在Windows 7上使用GraphViz 2.28 (the current stable version),而Graphviz / Dot在以下代码中崩溃。

digraph G {
ranksep = 1.0; size = "10,10";
{
    node [shape = plaintext, fontsize = 20];
    GAWM1 -> GAWM2 -> 0;
}

node [shape = box];
{rank = same;0;wx1;wx2;rx1;}

wx1 -> wx2;
wx2 -> rx1;
wx1 -> rx1[color = blue];

subgraph struct
{
    node [shape = record];
    rx11 [shape = record, label = "rx1 | [x=[wx2]]"];
}
{rank = same; GAWM1; "rx11";}

// W'WR Order:
wx2 -> wx1[style = dashed, color = red, label = "1"]; }

当我在这个例子上进行一些实验时,事情变得很奇怪:

  1. 最后一个语句“wx2 - > wx1 [style = dashed,color = red,label =”1“]时,它运作良好被删除;
  2. 第八行“{rank = same; 0; wx1; wx2; rx1;}”被删除时,它运作良好;
  3. 在最后一个语句中删除标签(即“,label =”1“”)时,它也能正常工作。
  4. 我已将问题报告给Graphviz Issue Tracker,但尚未回复。你能帮忙找出原因吗?

    谢谢。

1 个答案:

答案 0 :(得分:0)

以下脚本版本崩溃:

digraph G {
ranksep = 1.0; size = "10,10";
{
    node [shape = plaintext, fontsize = 20];
    GAWM1 -> GAWM2 -> 0;
}
node [shape = box];
{rank = same;0;wx1;wx2;rx1;}
wx1 -> wx2;
wx2 -> rx1;
wx1 -> rx1[color = blue];
subgraph struct
{
    node [shape = record];
    rx11 [shape = record, label = "rx1 | [x=[wx2]]"];
}
{rank = same; GAWM1; "rx11";}
// W'WR Order:
//wx2 -> wx1[style = dashed, color = red, label = "1"]; 
wx2 -> wx1 [style=dashed, color=red];
}

看起来labelwx1之间短边wx2的错误。