de-vraag
  • 質問
  • タグ
  • ユーザー
通知:
報酬:
登録
登録すると、質問に対する返答やコメントが通知されます。
ログイン
すでにアカウントをお持ちの方は、ログインして新しい通知を確認してください。
追加された質問、回答、コメントには報酬があります。
さらに
ソース
編集
 Christoph
Christoph
質問

dot/graphvizによるブロック線図のレイアウト

私はドットで次のモックアップを実装したいと思います:

mockup to be implemented in dot

これまで私はこれを多く持っています:

digraph G {
graph [rankdir = LR, splines=ortho]

  unit [shape=box, width = 2, height = 10];

  more_different_unit [shape=box, height=4];
  other_unit [shape=box, height=4];


  unit -> other_unit [label = "foo"];
  unit -> other_unit [label = "bar"];
  unit -> other_unit [label = "bar"];
  unit -> other_unit [label = "bar"];
  unit -> other_unit [label = "bar"];
  unit -> other_unit [label = "bar"];
  unit -> more_different_unit [label = "bar"];
  unit -> more_different_unit [label = "bar"];
  unit -> more_different_unit [label = "bar"];
  unit -> more_different_unit [label = "bar"];
  unit -> more_different_unit [label = "bar"];
  unit -> more_different_unit [label = "bar"];
}

私はそうそうコンパイルする:

ドット-Gsplines = none test.gv | neato -n -Gsplines = ortho -Tpng -otest.png

それは私を近づけますが、私が知りたいことがいくつかあります。

  1. Fooの左右だけでなく、どのようにブロックを取得できますか?私はまだそれを理解することができませんでした。

  2. エッジラベルをエッジの上または下に一貫して置くことはできますか?

  3. 右ノードを左に、左ノードを右に揃えるにはどうしたらいいですか? 1つの可能性は、それらを同じ幅にすることです。これは大丈夫です。

ありがとう!!

更新:

受け入れられた答えに基づいて、私は今、私が必要としていた正確に次のことをやっています。

digraph G {
    graph [rankdir = LR, splines=ortho];

    node[shape=record];
    Bar[label="Bar", height=2];
    Foo[label="Foo", height=4];

    Bew[label="Bew", height=2];
    Gate[label="Gate", height=2];

    Bar -> Foo [label="Bar2Foo"];
    Bar -> Foo [label="Bar2Foo"];
    Bar -> Foo [label="Bar2Foo"];

    Foo -> Bew [label="Foo2Bew"];
    Foo -> Bew [label="Foo2Bew"];
    Bew -> Foo [label="Bew2Foo"];


    Foo -> Gate [label="Foo2Gate"];
    Foo -> Gate [label="Foo2Gate"];
}
15 2011-10-27T22:00:07+00:00 1
 Christoph
Christoph
編集された質問 28日 10月 2011 в 7:52
プログラミング
graph-layout
graphviz
dot
sehe
27日 10月 2011 в 10:26
2011-10-27T22:26:44+00:00
さらに
ソース
編集
#56793436

これはあなたを始めますか?

digraph G {
    graph [rankdir = LR];

    node[shape=record];
    Bar[label="{ \"Bar\"|{pin 1|     2|     3|     4|     5} }"];
    Foo[label="{ {data0|data1|data2|data3|data4}|\"Foo\" |{out0|out1|out2|gnd|ex0|hi|lo} }"];

    Bew[label="{ {clk|syn|mux0|mux1|signal}|\"Bew\" |{out0|out1|out2} }"];
    Bar:p1 -> Foo:data0;
    Bar:p2 -> Foo:data1;
    Bar:p3 -> Foo:data2;
    Bar:p4 -> Foo:data3;
    Bar:p5 -> Foo:data4;

    Foo:out0 -> Bew:mux0;
    Foo:out1 -> Bew:mux1;
    Bew:clk -> Foo:ex0;

    Gate[label="{ {a|b}|OR|{a\|b} }"];

    Foo:hi -> Gate:a;
    Foo:lo -> Gate:b;
    Gate:ab -> Bew:signal;
}

enter image description here

私は、整列を得るための素敵な方法として、改行しないスペースを使用していたことに注意してください(私はそう思いました。) Space Ck はvimで、Hex 00a0 charにつながります)

You can also employ HTML inside the label definitions, so you can use fonts, colors and create 'spacers': http://www.graphviz.org/doc/info/shapes.html#html

私はラベルを整列することは、HTMLノードで簡単になると思います。

19
0
質問の追加
カテゴリ
すべて
技術情報
文化・レクリエーション
生活・芸術
科学
プロフェッショナル
事業内容
ユーザー
すべて
新しい
人気
1
Roxana Elizabeth CASTILLO Avalos
登録済み 15時間前
2
Hideo Nakagawa
登録済み 1日前
3
Sergiy Tytarenko
登録済み 3日前
4
shoxrux azadov
登録済み 5日前
5
Koreets Koreytsev
登録済み 1週間前
© de-vraag :年
ソース
stackoverflow.com
ライセンス cc by-sa 3.0 帰属