Problem in representing large graphs

Hello
I’m using large (genealogical) graphs but I encounter the following problem. I premise that I do not need to print the graph, but only display it; for this reason I DON’T use the size directive. I noticed that as graph grows in node number, correspondingly the layout grows, but only HORIZONTALLY and not vertically. For this reason it appears ever more “squeezed”. Is it possible to get around this problem?
Thank you
Carlo

example:
digraph G {
18935 [label = “Giovanni Piacentini 18935\n~*1694”] [shape=box];
18936 [label = "Giovanna Pisani 18936\n~*1699 "] [shape=box];
F6665 [label = “F6665\n1719\nM2. 91. 242\n”];
18935 → F6665;
18936 → F6665;
F6665 → 20194
F6665 → 20370
F7540 → 22811
F7540 → 22329
F7540 → 23011
F7540 → 23933
20194 [label = “Giuseppe Piacentini 20194\n~*1730”] [shape=box];
20197 [label = “Giuseppa Velasco 20197\n~*1735”] [shape=box];
F7540 [label = “F7540\n1755\nM2.185. 580\n”];
20194 → F7540
20197 → F7540
20370 [label = “Gio Antonio Piacentini 20370\n~*1734”] [shape=box];
20372 [label = “Elisabetta Ciangherotti 20372\n~*1739”] [shape=box];
F7663 [label = “F7663\n1759\nM2.199. 617\n”];
F7663 → 23578
20372 → F7663
20370 → F7663
22329 [label = “Gio Giuseppe Piacentini 22329\n~*1766”] [shape=box];
22331 [label = “Giovanna Catta 22331\n~*1771”] [shape=box];
F9044 [label = “F9044\n1791\nM3.P110\n”];
22329 → F9044
22331 → F9044
F9044 → 24934
F9044 → 25621
22811 [label = “Francesco Piacentini 22811\n~*1772”] [shape=box];
22813 [label = “Fortunata Ferrini 22813\n~*1777”] [shape=box];
F9388 [label = “F9388\n1797\nM3.P179\n”];
22811 → F9388
22813 → F9388
23011 [label = “Antonio Piacentini 23011\n~*1773”] [shape=box];
23013 [label = “Maria Giovanna Lupi 23013\n~*1778”] [shape=box];
F9528 [label = “F9528\n1798\nM3.Q126\n”];
23011 → F9528
23013 → F9528
23578 [label = “Giuseppe Piacentini 23578\n~*1779”] [shape=box];
23580 [label = “Maria Garbati 23580\n~*1784”] [shape=box];
F9926 [label = “F9926\n1804\nM3.Q174\n”];
23578 → F9926
23578 → F9535
23580 → F9926
F9926 → 26482
23023 [label = “Agata Ferrini 23023\n~*1778”] [shape=box];
F9535 [label = “F9535\n1798\nM3.Q128\n”];
23023 → F9535
23933 [label = “Giovanni Piacentini 23933\n~*1782”] [shape=box];
23935 [label = “Nicolaria Pavoni 24937\n~*1787”] [shape=box];
F10176 [label = “F10176\n1804\nM4.59\n”];
23933 → F10176
23935 → F10176
24934 [label = “Giuseppe Piacentini 24934\n~*1791”] [shape=box];
24937 [label = “Maria Antonia Vai 23935\n~*1796”] [shape=box];
F10837 [label = “F10837\n1816\nM4.181\n”];
24934 → F10837
24934 → F13329
24937 → F10837
25621 [label = “Giovanni Piacentini 25621\n~*1797”] [shape=box];
25625 [label = “Maria Bisso 23935\n~*1800”] [shape=box];
F11298 [label = “F11298\n1824\nQ208.s036\n”];
25621 → F11298
25625 → F11298
28865 [label = “Margherita Bonti 28865\n~*1826”] [shape=box];
F13329 [label = “F13329\n1861\ns304\n”];
28865 → F13329
26482 [label = “Antonio Piacentini 26482\n~*1810”] [shape=box];
26486 [label = “Maria Giovanna Lupi 26486\n~*1808”] [shape=box];
F11833 [label = “F11833\n1835\nR359.s090\n”];
26482 → F11833
26486 → F11833
9107 [label = “Giovanni Piacentini 9107\n~*1770”] [shape=box];
27019 [label = “Margherita Anselmi 27019\n~*1779”] [shape=box];
F12164 [label = “F12164\n1803\n”];
9107 → F12164
27019 → F12164
F7663 → 9107
F12164 → 27016
27016 [label = “Antonio Piacentini 27016\n~*1815”] [shape=box];
27020 [label = “Maria Teresa Sardi 27020\n~*1817”] [shape=box];
F12166 [label = “F12166\n1841\nR407.s124\n”];
27016 → F12166
27020 → F12166
26766 [label = “Giuseppe Piacentini 26766\n~*1815”] [shape=box];
26770 [label = “Nicolaria Anselmi 26770\n~*1818”] [shape=box];
F12009 [label = “F12009\n1837\nR383.s108\n”];
26766 → F12009
26770 → F12009
F9528 → 26766
27222[label = “Luigi Piacentini 27222\n~*1821”] [shape=box];
27226 [label = “Angela Vai 27226\n~*1823”] [shape=box];
F12294 [label = “F12294\n1844\nR426.s137\n”];
27222 → F12294
27226 → F12294
F12164 → 27222
27362[label = “Luigi Piacentini 27362\n~*1825”] [shape=box];
27366 [label = “Luisa Pavolini 27366\n~*1821”] [shape=box];
F12380 [label = “F12380\n1846\nR348.s145\n”];
27362 → F12380
27366 → F12380
F9528 → 27362
29191 [label = “Giuseppe Piacentini 29191\n~*1840”] [shape=box];
29195 [label = “Maria Arnaldi 29195\n~*1841”] [shape=box];
F13537 [label = “F13537\n1863\ns345\n”];
29191 → F13537
29195 → F13537
F11833 → 29191
30470 [label = “Teresa Lorenzi 30470\n~*1853”] [shape=box];
F14347 [label = “F14347\n1878\nt650\n”];
30470 → F14347
27222 → F14347
29989 [label = “Raffaello Piacentini 29989\n~*1849”] [shape=box];
29993 [label = “Giacoma Arnaldi 29993\n~*1854”] [shape=box];
F14042 [label = “F14042\n1874\nt624\n”];
29989 → F14042
29993 → F14042
F12009 → 29989
30296 [label = “Antonio Piacentini 30296\n~*1851”] [shape=box];
30300 [label = “Lucia Costa 30300\n~*1856”] [shape=box];
F14238 [label = “F14238\n1876\nt639\n”];
30296 → F14238
30300 → F14238
F12380 → 30296
30636 [label = “Angelo Piacentini 30636\n~*1855”] [shape=box];
30640 [label = “Adelaide Anselmi 30640\n~*1860”] [shape=box];
F14456 [label = “F14456\n1880\nt660\n”];
30636 → F14456
30640 → F14456
F12380 → 30636
31452 [label = “Assunta Anselmi 31452\n~*1869”] [shape=box];
F14969 [label = “F14969\n1889\nt718\n”];
31452 → F14969
27362 → F14969
31223 [label = “Francesco Piacentini 31223\n~*1862”] [shape=box];
31227 [label = “Giacoma Ricci 31227\n~*1867”] [shape=box];
F14828 [label = “F14828\n1887\nt703\n”];
31223 → F14828
31227 → F14828
F11833 → 31223
31616 [label = “Antonio Piacentini 31616\n~*1863”] [shape=box];
31620 [label = “Maria Giovanna Costa 31620\n~*1868”] [shape=box];
F15075 [label = “F15075\n1890\nt727\n”];
31616 → F15075
31620 → F15075
F13165 → 31616
31706 [label = “Ermenegildo Piacentini 31706\n~*1866”] [shape=box];
31710 [label = “Maria Testa 31710\n~*1871”] [shape=box];
F15132 [label = “F15132\n1891\nt732\n”];
31706 → F15132
31710 → F15132
F13165 → 31706
31947 [label = “Giuseppe Piacentini 31947\n~*1869”] [shape=box];
31951 [label = “Iride Berti 31951\n~*1874”] [shape=box];
F15281 [label = “F15281\n1894\nU015\n”];
31947 → F15281
31951 → F15281
F13165 → 31947
28606[label = “Luigi Piacentini 28606\n~*1835”] [shape=box];
28611 [label = “Francesca Ferrini 28611\n~*1833”] [shape=box];
F13165 [label = “F13165\n1858\ns273\n”];
28611 → F13165
28606 → F13165
F11298 → 28606
20509[label = “Caterina 20509\n~*1741\nM2.208. 650”] [shape=box style=filled];
F6665 ->20509
21806[label = “Giovanna 21806\n~*1765\nM3.P043”] [shape=box style=filled];
F7540 ->21806
22106[label = “Giovanna 22106\n~*1769\nM3.P080”] [shape=box style=filled];
F7663 ->22106
22133[label = “Maria 22133\n~*1769\nM3.P080”] [shape=box style=filled];
F7540 ->22133
23198[label = “Caterina 23198\n~*1780\nM3.Q142”] [shape=box style=filled];
F7663 ->23198
26113[label = “Maria Giovanna 26113\n~*1796\nQ233.s067”] [shape=box style=filled];
F9528 ->26113
25213[label = “Lucia 25213\n~*1799\nQ188.s010”] [shape=box style=filled];
F9528 ->25213
25872[label = “Maria 25872\n~*1803\nQ218.s052”] [shape=box style=filled];
F12164 ->25872
26177[label = “Giovanna 26177\n~*1806\nR329.s071”] [shape=box style=filled];
F9926 ->26177
}

The file seems to have non-printable characters. They are causing dot errors. Can you provide a version without those characters?

Hello Steve. Thank you for your message. Actually the only non printable character I used is the \n (newline) and it seems to work fine, as you can see in the following image:

Anyway here is an example without the \n character:

digraph G {
18935 [label = “Giovanni Piacentini 18935”] [shape=box];
18936 [label = "Giovanna Pisani 18936 "] [shape=box];
F6665 [label = “F6665”];
18935 → F6665;
18936 → F6665;
F6665 → 20194
F6665 → 20370
F7540 → 22811
F7540 → 22329
F7540 → 23011
F7540 → 23933
20194 [label = “Giuseppe Piacentini 20194”] [shape=box];
20197 [label = “Giuseppa Velasco 20197”] [shape=box];
F7540 [label = “F7540”];
20194 → F7540
20197 → F7540
20370 [label = “Gio Antonio Piacentini 20370”] [shape=box];
20372 [label = “Elisabetta Ciangherotti 20372”] [shape=box];
F7663 [label = “F7663”];
F7663 → 23578
20372 → F7663
20370 → F7663
22329 [label = “Gio Giuseppe Piacentini 22329”] [shape=box];
22331 [label = “Giovanna Catta 22331”] [shape=box];
F9044 [label = “F9044”];
22329 → F9044
22331 → F9044
F9044 → 24934
F9044 → 25621
22811 [label = “Francesco Piacentini 22811”] [shape=box];
22813 [label = “Fortunata Ferrini 22813”] [shape=box];
F9388 [label = “F9388”];
22811 → F9388
22813 → F9388
23011 [label = “Antonio Piacentini 23011”] [shape=box];
23013 [label = “Maria Giovanna Lupi 23013”] [shape=box];
F9528 [label = “F9528”];
23011 → F9528
23013 → F9528
23578 [label = “Giuseppe Piacentini 23578”] [shape=box];
23580 [label = “Maria Garbati 23580”] [shape=box];
F9926 [label = “F9926”];
23578 → F9926
23578 → F9535
23580 → F9926
F9926 → 26482
23023 [label = “Agata Ferrini 23023”] [shape=box];
F9535 [label = “F9535”];
23023 → F9535
23933 [label = “Giovanni Piacentini 23933”] [shape=box];
23935 [label = “Nicolaria Pavoni 24937”] [shape=box];
F10176 [label = “F10176”];
23933 → F10176
23935 → F10176
24934 [label = “Giuseppe Piacentini 24934”] [shape=box];
24937 [label = “Maria Antonia Vai 23935”] [shape=box];
F10837 [label = “F10837”];
24934 → F10837
24934 → F13329
24937 → F10837
25621 [label = “Giovanni Piacentini 25621”] [shape=box];
25625 [label = “Maria Bisso 23935”] [shape=box];
F11298 [label = “F11298”];
25621 → F11298
25625 → F11298
28865 [label = “Margherita Bonti 28865”] [shape=box];
F13329 [label = “F13329\n1861\ns304\n”];
28865 → F13329
26482 [label = “Antonio Piacentini 26482”] [shape=box];
26486 [label = “Maria Giovanna Lupi 26486”] [shape=box];
F11833 [label = “F11833”];
26482 → F11833
26486 → F11833
9107 [label = “Giovanni Piacentini 9107”] [shape=box];
27019 [label = “Margherita Anselmi 27019”] [shape=box];
F12164 [label = “F12164”];
9107 → F12164
27019 → F12164
F7663 → 9107
F12164 → 27016
27016 [label = “Antonio Piacentini 27016”] [shape=box];
27020 [label = “Maria Teresa Sardi 27020”] [shape=box];
F12166 [label = “F12166”];
27016 → F12166
27020 → F12166
26766 [label = “Giuseppe Piacentini 26766”] [shape=box];
26770 [label = “Nicolaria Anselmi 26770”] [shape=box];
F12009 [label = “F12009”];
26766 → F12009
26770 → F12009
F9528 → 26766
27222[label = “Luigi Piacentini 27222”] [shape=box];
27226 [label = “Angela Vai 27226”] [shape=box];
F12294 [label = “F12294”];
27222 → F12294
27226 → F12294
F12164 → 27222
27362[label = “Luigi Piacentini 27362”] [shape=box];
27366 [label = “Luisa Pavolini 27366”] [shape=box];
F12380 [label = “F12380”];
27362 → F12380
27366 → F12380
F9528 → 27362
29191 [label = “Giuseppe Piacentini 29191”] [shape=box];
29195 [label = “Maria Arnaldi 29195”] [shape=box];
F13537 [label = “F13537”];
29191 → F13537
29195 → F13537
F11833 → 29191
30470 [label = “Teresa Lorenzi 30470”] [shape=box];
F14347 [label = “F14347”];
30470 → F14347
27222 → F14347
29989 [label = “Raffaello Piacentini 29989”] [shape=box];
29993 [label = “Giacoma Arnaldi 29993”] [shape=box];
F14042 [label = “F14042”];
29989 → F14042
29993 → F14042
F12009 → 29989
30296 [label = “Antonio Piacentini 30296”] [shape=box];
30300 [label = “Lucia Costa 30300”] [shape=box];
F14238 [label = “F14238”];
30296 → F14238
30300 → F14238
F12380 → 30296
30636 [label = “Angelo Piacentini 30636”] [shape=box];
30640 [label = “Adelaide Anselmi 30640”] [shape=box];
F14456 [label = “F14456”];
30636 → F14456
30640 → F14456
F12380 → 30636
31452 [label = “Assunta Anselmi 31452”] [shape=box];
F14969 [label = “F14969”];
31452 → F14969
27362 → F14969
31223 [label = “Francesco Piacentini 31223”] [shape=box];
31227 [label = “Giacoma Ricci 31227”] [shape=box];
F14828 [label = “F14828”];
31223 → F14828
31227 → F14828
F11833 → 31223
31616 [label = “Antonio Piacentini 31616”] [shape=box];
31620 [label = “Maria Giovanna Costa 31620”] [shape=box];
F15075 [label = “F15075”];
31616 → F15075
31620 → F15075
F13165 → 31616
31706 [label = “Ermenegildo Piacentini 31706\n~*1866”] [shape=box];
31710 [label = “Maria Testa 31710\n~*1871”] [shape=box];
F15132 [label = “F15132\n1891\nt732\n”];
31706 → F15132
31710 → F15132
F13165 → 31706
31947 [label = “Giuseppe Piacentini 31947”] [shape=box];
31951 [label = “Iride Berti 31951”] [shape=box];
F15281 [label = “F15281”];
31947 → F15281
31951 → F15281
F13165 → 31947
28606[label = “Luigi Piacentini 28606”] [shape=box];
28611 [label = “Francesca Ferrini 28611”] [shape=box];
F13165 [label = “F13165”];
28611 → F13165
28606 → F13165
F11298 → 28606
20509[label = “Caterina 20509”] [shape=box style=filled];
F6665 ->20509
21806[label = “Giovanna 21806”] [shape=box style=filled];
F7540 ->21806
22106[label = “Giovanna 22106”] [shape=box style=filled];
F7663 ->22106
22133[label = “Maria 22133”] [shape=box style=filled];
F7540 ->22133
23198[label = “Caterina 23198”] [shape=box style=filled];
F7663 ->23198
26113[label = “Maria Giovanna 26113”] [shape=box style=filled];
F9528 ->26113
25213[label = “Lucia 25213”] [shape=box style=filled];
F9528 ->25213
25872[label = “Maria 25872”] [shape=box style=filled];
F12164 ->25872
26177[label = “Giovanna 26177”] [shape=box style=filled];
F9926 ->26177
26446[label = “Giovanna 26446”] [shape=box style=filled];
F12164 ->26446
26980[label = “Caterina 26980”] [shape=box style=filled];
F12164 ->26980
27433[label = “Maria 27433”] [shape=box style=filled];
F10837 ->27433
27878[label = “Caterina 27878”] [shape=box style=filled];
F11298 ->27878
27962[label = “Domenica 27962”] [shape=box style=filled];
F11298 ->27962
28258[label = “Teresa 28258”] [shape=box style=filled];
F10837 ->28258
29089[label = “Caterina 29089”] [shape=box style=filled];
F11833 ->29089
29251[label = “Maria 29251”] [shape=box style=filled];
F12009 ->29251
26786[label = “Antonia 26786”] [shape=box style=filled];
F9528 ->26786
30029[label = “Concilia 30029”] [shape=box style=filled];
F11833 ->30029
30073[label = “Rosa 30073”] [shape=box style=filled];
F12009 ->30073
30357[label = “Rosa 30357”] [shape=box style=filled];
F12380 ->30357
30966[label = “Eda 30966”] [shape=box style=filled];
F13537 ->30966
31009[label = “Maria 31009”] [shape=box style=filled];
F13165 ->31009
31173[label = “Teresa 31173”] [shape=box style=filled];
F13165 ->31173

}

You are fighting the norm of displaying siblings & their spouses all on the same rank. And many of these folks have long-ish names. Dot does not have any specific commands to “fix” this, but here are some ideas:

  • use SVG format, it is easier to zoom and navigate
  • reformat your labels to use more, shorter lines:
    • “Giovanni Piacentini\n18935\n~*1694”
    • or “Giovanni\nPiacentini\n18935\n~*1694”
  • use a skinnier font
  • display spouses in an over/under (record or html) format, not side-by-side (I’m not thrilled by this idea)
  • you could also break/stagger each rank, so that siblings were staggered (I don’t like this idea either, but it would reduce the width)

[p.s. I should have said non-ascii. Instead of “->”, my browser shows a single, non-ascii arrow (UTF-8 hex e28692) and instead of ascii double quote ("), it shows left/right quotes - UTF-8 e2809c and e2809d. I want to go back to the days of Big Chief tablets and No. 2 pencils.]

Thank you Steve for all your advices!

This is probably a result of copying and pasting into the forum’s Markdown-aware box. @carlo, surround your dot source in

```dot
…
```

and it will render correctly.

Two more thoughts:

  • If you use multiple newlines to reduce the width of the nodes, you might use record or html style nodes to add visual context :
    a [shape=record label="{George\nWashington|98765|~1700}"]
  • For fun, you might try other layout engines (fdp, neato, circo, twopi) I liked fdp’s result the best.

Carlo,

Are you using a genealogy application to source the data you are graphing? If do, would you mind sharing which one?

Hello Brian
Actually I’m using a self-made program or, better, a set of Python programs that use in input some thousands of parrish records and builds a huge genealogical tree. One of the programs translates parts of the tree in .dot but it can operate only on that genealogical tree. If you like this subject, my advice is that you use GRAMPS (freeware)

Actually, I am using Gramps and was selfishly hoping you were writing your graphing as a module leveraging their framework. :drooling_face:

Some of this discussion reminded me of a Bug Report thread from a while back. They were addressing a similar (but a little different) diagram with Graphviz. That was related to scaling label text.