Cheatsheet: Graphviz

nodes

node in default style

client
server
node in default style

node stroke color

client[color=red]
server[color=blue]
node stroke color

node filled color

client[style=filled fillcolor=yellow]
node filled color

node label

client[label="Remote client"]

node shape

client[shape="circle"]

node size

digraph Graph {
    node[shape=rect]
    splines=ortho
    gateway[width=3 height=0.3]
    gateway -> users
    gateway -> companies
    gateway -> groups
}
node size

edges

edge in default style

client -> server

edge label

client -> server[label='send request']

edge style

client -> server[style=dashed],
client -> server[style=dotted]

edge color

client -> server[color=green]

subgraphs/groups

subgraph

{
  node [color=red]
javascript -> api
}

subgraph server{
  edge [style=dashed]
  api -> backend
}
subgraph

subgraph named cluster* is a cluster

subgraph cluster_0 {
    style=filled;
    color=lightgrey;
    javascript -> api;
    label = "frontend";
}
subgraph named cluster* is a cluster

defaults

set default style for all nodes

node[style=filled];

set default style for all edges

edge[style=dotted];