Graphviz でシーケンス図

Graphviz でシーケンス図を書く。UML のシーケンス図に活性化というのがあるが、Graphviz では無理か ?

Graphviz でシーケンス図

2010-02-01 修正。よりシンプルに

digraph sample {
  graph [fontname = "monospace", fontsize = 10, rankdir = TD];
  node  [fontname = "monospace", fontsize = 10];
  edge  [fontname = "monospace", fontsize = 10];

  // node
  node    [shape = record];
  object1 [label = "\<\<Object\>\>\nObject 1"];
  object2 [label = "\<\<Object\>\>\nObject 2"];
  object3 [label = "\<\<Object\>\>\nObject 3"];

  node [fixedsize = true, width = 0.01, height = 0.01, shape = point];
  conn1_A;
  conn2_A;
  conn3_A;

  space1;

  conn1_B;
  conn2_B;

  conn1_C;
  conn2_C;

  end1;
  end2;
  end3;

  // edge
  edge [style = invis];
  object1 -> object2 -> object3;

  edge [style = dotted, arrowhead = none];
  object1 -> conn1_A -> space1 -> conn1_B -> conn1_C -> end1;
  object2 -> conn2_A ->           conn2_B -> conn2_C -> end2;
  object3 -> conn3_A ->                                 end3;

  conn1_A -> conn2_A [style = solid, arrowhead = none, label = "Async Message A"];
  conn2_A -> conn3_A [style = solid, arrowhead = vee];

  conn1_B -> conn2_B [style = solid,  arrowhead = normal, label = "Sync Message B"];
  conn1_C -> conn2_C [style = dashed, arrowtail = vee,    label = "Return C"];

  // rank
  {rank = same; object1; object2; object3};
  {rank = same; conn1_A; conn2_A; conn3_A};
  {rank = same; conn1_B; conn2_B};
  {rank = same; conn1_C; conn2_C};
  {rank = same; end1; end2; end3};
}