Note that there are some explanatory texts on larger screens.

plurals
  1. POBlock diagram layout with dot/graphviz
    primarykey
    data
    text
    <p>I'd like to implement the following mockup with dot:</p> <p><img src="https://i.stack.imgur.com/cEsWD.png" alt="mockup to be implemented in dot"></p> <p>So far I've got this much:</p> <pre><code>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 -&gt; other_unit [label = "foo"]; unit -&gt; other_unit [label = "bar"]; unit -&gt; other_unit [label = "bar"]; unit -&gt; other_unit [label = "bar"]; unit -&gt; other_unit [label = "bar"]; unit -&gt; other_unit [label = "bar"]; unit -&gt; more_different_unit [label = "bar"]; unit -&gt; more_different_unit [label = "bar"]; unit -&gt; more_different_unit [label = "bar"]; unit -&gt; more_different_unit [label = "bar"]; unit -&gt; more_different_unit [label = "bar"]; unit -&gt; more_different_unit [label = "bar"]; } </code></pre> <p>I compile it like so:</p> <blockquote> <p>dot -Gsplines=none test.gv | neato -n -Gsplines=ortho -Tpng -otest.png</p> </blockquote> <p>That gets me close, but there are a few things I'd like to know.</p> <ol> <li><p>How can I get blocks to the left and right of Foo, not just the right? I haven't been able to figure that out yet.</p></li> <li><p>Is it possible to put the edge labels consistently above or under the edge?</p></li> <li><p>How can I align the right-hand nodes left, and the left-hand nodes right? One possibility would be to make them the same width, which would be okay.</p></li> </ol> <p>Thanks!!</p> <p>UPDATE:</p> <p>Based on the accepted answer, I am now doing the following which is precisely what I needed, again generated through dot piped to neato, as mentioned above:</p> <pre><code>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 -&gt; Foo [label="Bar2Foo"]; Bar -&gt; Foo [label="Bar2Foo"]; Bar -&gt; Foo [label="Bar2Foo"]; Foo -&gt; Bew [label="Foo2Bew"]; Foo -&gt; Bew [label="Foo2Bew"]; Bew -&gt; Foo [label="Bew2Foo"]; Foo -&gt; Gate [label="Foo2Gate"]; Foo -&gt; Gate [label="Foo2Gate"]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload