Graphviz Example: family tree

digraph family_tree {
// Defining relationships
grandparents -> { parent1 parent2 parent3 };
parent1 -> { child1 child2 };
parent2 -> { child3 child4 };
parent3 -> { child5 };

// Defining individual nodes
grandparents [shape=ellipse, style=filled, color=lightblue, label="Grandparents"];
parent1 [shape=box, style=filled, color=lightgreen, label="Parent 1"];
parent2 [shape=box, style=filled, color=lightgreen, label="Parent 2"];
parent3 [shape=box, style=filled, color=lightgreen, label="Parent 3"];
child1 [shape=ellipse, label="Child 1"];
child2 [shape=ellipse, label="Child 2"];
child3 [shape=ellipse, label="Child 3"];
child4 [shape=ellipse, label="Child 4"];
child5 [shape=ellipse, label="Child 5"];

// Customizing graph layout
edge [color=gray];
rankdir=TB;
}
family_tree grandparents Grandparents parent1 Parent 1 grandparents->parent1 parent2 Parent 2 grandparents->parent2 parent3 Parent 3 grandparents->parent3 child1 Child 1 parent1->child1 child2 Child 2 parent1->child2 child3 Child 3 parent2->child3 child4 Child 4 parent2->child4 child5 Child 5 parent3->child5