1

我在 Windows 7 上使用 GraphViz 2.28 (当前稳定版本),并且 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. 当仅删除最后一条语句中的标签(即“,标签=“1””)时,它也能很好地工作。

我已将问题报告给Graphviz 问题跟踪器,但尚未回复。你能帮忙找出原因吗?

谢谢你。

4

1 回答 1

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];
}

看起来像 和之间label的短边的错误。wx1wx2

于 2013-01-14T13:30:56.237 回答