serhii.net

In the middle of the desert you can say anything you want

12 Jul 2024

Notes on GraphViz

Basics

Graphviz Online is a really nice viewer

Grouping

  • You can set attributes globally or per subgraph
  • edge [color="white"] makes all child edges white, unless overwritten

Labeling things

I figured out this way to label different ranks by using an invisible pseudo-graph: viewer

This is the chunk:

  subgraph labels {
    edge [fontcolor="black"];
    node [style="filled", fontcolor="black", fontsize=10];
      
    node1 [label="Inputs"];
    node2 [label="Weights"];
    node3 [label="Sum"];
    node4 [label="Activation\nfunction"];
    node5 [label="Output"];
    
    node1 -> node2 -> node3 -> node4 -> node5;
    
    {rank=same; node1;n0;n1; n2; n3;}

    
    {rank=same; node3;sum;}
  }

Pasted image 20240724185837.png

Note using ranks to align inputs/sum to the correct level; also the use of \n in the label.

Adding labels under nodes

Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus