5

次のようなレイアウトでグラフをレンダリングしたい:

欲しかった

私はこれを試しました:

digraph EDP
{
  graph [colorscheme=paired12];
  node [label="\N", shape=box, style="rounded,filled", colorscheme=paired12, color=8, fillcolor=7, width="1.2", fontname="Arial narrow", fontsize=12];
  edge [colorscheme=paired12, color=8, fontsize=11, fontname="Arial narrow"];

  src [label="Source"];
  dst [label="Destination"];
  filter [label="Filter"];

  src -> dst [label="Encoding process"];
  src -> filter [label="a"];
  filter -> dst [label="b"];
  src -> filter [dir=back, label=c];
  filter -> dst [dir=back, label=d];
  src -> dst [dir=back, label="Decoding process"];

}

次の結果が生成されました:(あまり良くありません...

私の

誰でも私に最も近い解決策を教えてもらえますか? (おそらく全く同じものは作れません)

4

1 に答える 1

9

それを夜と呼ぶ前に私が得た限り近く:

digraph EDP
{
  graph [colorscheme=paired12];

  node [label="\N", shape=box, style="rounded,filled", colorscheme=paired12, color=8, fillcolor=7, width="1.2", fontname="Arial narrow", fontsize=12];
  edge [colorscheme=paired12, color=8, fontsize=11, fontname="Arial narrow"];

  src [width=3.5, label="Source"];
  dst [width=3.5, label="Destination"];
  filter [label="Filter"];

  edge[constraint=false];
  src -> dst [label="Encoding\nprocess"];
  src -> filter [label="a"];
  filter -> dst [label="b"];
  dst -> filter [label="c"];
  filter -> src [label="d"];
  dst -> src [label="Decoding\nprocess"];

  edge[style=invis, constraint=true];
  src->filter->dst;

}

グラフをとして保存しedp.gv、で画像を作成します

dot -Gsplines=none edp.gv | neato -n -Gsplines=ortho -Tpng -o edp.png

結果:

最も近いgraphviz出力

いくつかの意見:

  • 最終的constraint=falseにすべてのエッジを配置し、非表示のエッジを追加して3つのノードを中央に配置しました
  • 普段は使いたいdir=backのですが、レンダリング時に使えませんでした-Gsplines=ortho
  • ご覧のとおり、エッジの順序はランダムです...
于 2011-11-29T23:22:36.190 に答える