Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Sure, here's the code to draw the graph in your Question (and which is shown rendered by dot, below).</p> <pre><code>digraph g { rankdir = TB; bgcolor = white; edge[arrowsize=.7, color=black]; node[shape=box, color=black] {rank=same; a, b, c}; {rank=same; d, e, f}; {rank=same; g, h}; {rank=same; i, j, k}; d[color=blue; shape=circle]; e[color=blue; shape=circle]; k[color=blue; shape=circle]; a -&gt; d; b -&gt; d; b -&gt; e; c -&gt; e; d -&gt; g; e -&gt; h; d -&gt; i; d -&gt; j; j -&gt; k; h -&gt; k; k -&gt; f; } </code></pre> <p><br/></p> <ol> <li><p>the first line <strong><em>digraph</em></strong> is for <em>directed graph</em> (for graphs in which the edges have a direction).</p></li> <li><p>The fourth and fifth lies above set default attributes for edges and nodes, respectively. In other words, once you've done this, you only need to style (include attribues + values) nodes (or edges) which you want to style differently than the default values. You can have more than one node "template" by creating <em>subgraphs</em>, or discrete groups nodes (see the dot Manual).</p></li> <li><p><em>rank=same</em> allows you to specifiy a group of nodes having the same vertical position (provided <em>rankdir</em> is set to <em>TB</em>, which meant "top-to-bottom").</p></li> <li><p>By default, the node name (e.g., a, b, c in my graph) is used as the node's label. If you don't want this shown in the rendered graph, just set <em>label=""</em></p></li> </ol> <p><img src="https://i.stack.imgur.com/SaWTa.png" alt="enter image description here"></p>
 

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