I’m trying to use GraphViz to typeset a family tree, largely building off of this Python script and this StackOverflow thread. I can make a decent-looking graph going back through grandparents and including siblings, like so:
digraph {
splines = ortho;
node [shape=box]
edge [dir=none]
SMITH_BRIDGET [label="Bridget Smith", style=filled, fillcolor=bisque];
SMITH_ADAM [label="Adam Smith", style=filled, fillcolor=azure2];
SMITH_BERTRAND [label="Bertrand Smith", style=filled, fillcolor=azure2];
JOHNSON_BEATRICE [label="Beatrice Johnson", style=filled, fillcolor=bisque];
JONES_MARY [label="Mary Jones", style=filled, fillcolor=bisque];
JONES_HENRY_JR [label="Henry Jones Junior", style=filled, fillcolor=azure2];
JONES_DIANA [label="Diana Jones", style=filled, fillcolor=bisque];
JONES_HENRY [label="Henry Jones", style=filled, fillcolor=azure2];
ADAMS_ABIGAIL [label="Abigail Adams", style=filled, fillcolor=bisque];
SMITH_JOHN [label="John Smith", style=filled, fillcolor=azure2];
SMITH_JANE [label="Jane Smith", style=filled, fillcolor=bisque];
{
rank=same;
F1_top [shape=circle, label="", height=0.01, width=0.01];
SMITH_BERTRAND -> F1_top
F1_top -> JOHNSON_BEATRICE
}
{
rank=same;
F1_0 [shape=circle, label="", height=0.01, width=0.01];
F1_1 [shape=circle, label="", height=0.01, width=0.01];
F1_2 [shape=circle, label="", height=0.01, width=0.01];
F1_0 -> F1_1 -> F1_2;
}
F1_top -> F1_1;
F1_0 -> SMITH_BRIDGET;
F1_2 -> SMITH_ADAM;
{
rank=same;
F2_top [shape=circle, label="", height=0.01, width=0.01];
JONES_HENRY -> F2_top
F2_top -> ADAMS_ABIGAIL
}
{
rank=same;
F2_0 [shape=circle, label="", height=0.01, width=0.01];
F2_1 [shape=circle, label="", height=0.01, width=0.01];
F2_2 [shape=circle, label="", height=0.01, width=0.01];
F2_0 -> F2_1 -> F2_2;
}
F2_top -> F2_1;
F2_0 -> JONES_MARY;
F2_1 -> JONES_HENRY_JR;
F2_2 -> JONES_DIANA;
{
rank=same;
F3_top [shape=circle, label="", height=0.01, width=0.01];
SMITH_ADAM -> F3_top
F3_top -> JONES_MARY
}
{
rank=same;
F3_0 [shape=circle, label="", height=0.01, width=0.01];
F3_1 [shape=circle, label="", height=0.01, width=0.01];
F3_2 [shape=circle, label="", height=0.01, width=0.01];
F3_0 -> F3_1 -> F3_2;
}
F3_top -> F3_1;
F3_0 -> SMITH_JOHN;
F3_2 -> SMITH_JANE;
}
I thought I had a grip on how the person nodes need to be ordered to produce my desired output, but when I add in great-grandparents, things go kaflooey:
digraph {
splines = ortho;
node [shape=box]
edge [dir=none]
SMITH_BRIDGET [label="Bridget Smith", style=filled, fillcolor=bisque];
SMITH_ADAM [label="Adam Smith", style=filled, fillcolor=azure2];
SMITH_BERTRAND [label="Bertrand Smith", style=filled, fillcolor=azure2];
JOHNSON_BEATRICE [label="Beatrice Johnson", style=filled, fillcolor=bisque];
NEWTON_CHARLOTTE [label="Charlotte Newton", style=filled, fillcolor=bisque];
SMITH_CHARLES [label="Charles Smith", style=filled, fillcolor=azure2];
JOHNSON_BAINES [label="Baines Johnson", style=filled, fillcolor=azure2];
MAXWELL_MARGARET [label="Margaret Maxwell", style=filled, fillcolor=bisque];
JONES_MARY [label="Mary Jones", style=filled, fillcolor=bisque];
JONES_HENRY_JR [label="Henry Jones Junior", style=filled, fillcolor=azure2];
JONES_DIANA [label="Diana Jones", style=filled, fillcolor=bisque];
JONES_HENRY [label="Henry Jones", style=filled, fillcolor=azure2];
ADAMS_ABIGAIL [label="Abigail Adams", style=filled, fillcolor=bisque];
JONES_JEREMIAH [label="Jeremiah Jones", style=filled, fillcolor=azure2];
PLANK_PATRICIA [label="Patricia Plank", style=filled, fillcolor=bisque];
ADAMS_DOUGLAS [label="Douglas Adams", style=filled, fillcolor=azure2];
DENT_URSULA [label="Ursula Dent", style=filled, fillcolor=bisque];
SMITH_JOHN [label="John Smith", style=filled, fillcolor=azure2];
SMITH_JANE [label="Jane Smith", style=filled, fillcolor=bisque];
{
rank=same;
F1_top [shape=circle, label="", height=0.01, width=0.01];
SMITH_BERTRAND -> F1_top
F1_top -> JOHNSON_BEATRICE
}
{
rank=same;
F1_0 [shape=circle, label="", height=0.01, width=0.01];
F1_1 [shape=circle, label="", height=0.01, width=0.01];
F1_2 [shape=circle, label="", height=0.01, width=0.01];
F1_0 -> F1_1 -> F1_2;
}
F1_top -> F1_1;
F1_0 -> SMITH_BRIDGET;
F1_2 -> SMITH_ADAM;
{
rank=same;
F2_top [shape=circle, label="", height=0.01, width=0.01];
JONES_HENRY -> F2_top
F2_top -> ADAMS_ABIGAIL
}
{
rank=same;
F2_0 [shape=circle, label="", height=0.01, width=0.01];
F2_1 [shape=circle, label="", height=0.01, width=0.01];
F2_2 [shape=circle, label="", height=0.01, width=0.01];
F2_0 -> F2_1 -> F2_2;
}
F2_top -> F2_1;
F2_0 -> JONES_MARY;
F2_1 -> JONES_HENRY_JR;
F2_2 -> JONES_DIANA;
{
rank=same;
F3_top [shape=circle, label="", height=0.01, width=0.01];
SMITH_ADAM -> F3_top
F3_top -> JONES_MARY
}
{
rank=same;
F3_0 [shape=circle, label="", height=0.01, width=0.01];
F3_1 [shape=circle, label="", height=0.01, width=0.01];
F3_2 [shape=circle, label="", height=0.01, width=0.01];
F3_0 -> F3_1 -> F3_2;
}
F3_top -> F3_1;
F3_0 -> SMITH_JOHN;
F3_2 -> SMITH_JANE;
{
rank=same;
F4_top [shape=circle, label="", height=0.01, width=0.01];
SMITH_CHARLES -> F4_top
F4_top -> NEWTON_CHARLOTTE
}
{
rank=same;
F4_0 [shape=circle, label="", height=0.01, width=0.01];
}
F4_top -> F4_0;
F4_0 -> SMITH_BERTRAND;
{
rank=same;
F5_top [shape=circle, label="", height=0.01, width=0.01];
JOHNSON_BAINES -> F5_top
F5_top -> MAXWELL_MARGARET
}
{
rank=same;
F5_0 [shape=circle, label="", height=0.01, width=0.01];
}
F5_top -> F5_0;
F5_0 -> JOHNSON_BEATRICE;
{
rank=same;
F6_top [shape=circle, label="", height=0.01, width=0.01];
JONES_JEREMIAH -> F6_top
F6_top -> PLANK_PATRICIA
}
{
rank=same;
F6_0 [shape=circle, label="", height=0.01, width=0.01];
}
F6_top -> F6_0;
F6_0 -> JONES_HENRY;
{
rank=same;
F7_top [shape=circle, label="", height=0.01, width=0.01];
ADAMS_DOUGLAS -> F7_top
F7_top -> DENT_URSULA
}
{
rank=same;
F7_0 [shape=circle, label="", height=0.01, width=0.01];
}
F7_top -> F7_0;
F7_0 -> ADAMS_ABIGAIL;
}
As you can see if you render this, great-grandfather Charles Smith, rather than being placed to the left of his beloved Charlotte Newton, has been moved two blocks over to the right and stuck in between Baines Johnson and Margaret Maxwell (the scandal!). I’ve tried reordering the person nodes at the top of the file in various ways, but they’ve all either made no difference or else made things worse. In addition, I can’t even figure out if the order of the “family blocks” makes a difference here.
I found this forum post that seemed to be dealing with the same problem, but following the advice there of setting remincross = true and using -Gmclimit=10 made no difference to the output.
So, how do I get the second family tree to look “proper,” and what rules regarding node order must I follow when creating similar family trees of arbitrary size?

