Difference between revisions of "Howto: Make a relationship chart"

From Gramps
Jump to: navigation, search
(Printing large graphs)
(add link to example.gramps)
(58 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{languages|Howto: Make a relationship chart}}
 
{{languages|Howto: Make a relationship chart}}
 +
How to make a relationship chart (for either ancestors, descendants, ...) with Gramps 4.x. and the [[Gramps_4.1_Wiki_Manual_-_Reports_-_part_5#Relationship_Graph|Relationship graph report]].[[Image:RelationshipChartDescendants.png|right|thumb|300px|An example chart]]
  
This is a Howto on how to make a relationship chart (can be ancestors, descendants, ...) with GRAMPS 2.2.x. and the Relationship plugin.[[Image:RelationshipChartDescendants.png|right|thumb|300px|An example chart]]
+
== Before you start ==
  
The report is made with the graphviz backend, so you need to install [http://graphviz.org graphviz] (on linux, use your package manager).  
+
The Relationship graph report uses the GraphViz backend, which should already be installed, if not you will need to install [http://graphviz.org graphviz] (on linux, use your package manager).  
  
[[Category:Tutorials|Make a relationship chart]]
+
Gramps can produce charts, but to view them, you need other programs. We recommend that you install the following:
 
+
* [http://graphviz.org Graphviz]: '''required''' for the creation of the relationship charts
== Before you start ==
 
GRAMPS can produce charts, but to view them, you need other programs. We recommend that you install the following:
 
* [http://graphviz.org Graphviz]: '''required''' for relationship charts
 
 
* [http://www.inkscape.org/ Inkscape]: for viewing and editing svg charts, export to png
 
* [http://www.inkscape.org/ Inkscape]: for viewing and editing svg charts, export to png
 
* [http://www.gnu.org/software/gv/ gv], [http://linuxappfinder.com/package/kghostview kghostview]: for viewing ps charts
 
* [http://www.gnu.org/software/gv/ gv], [http://linuxappfinder.com/package/kghostview kghostview]: for viewing ps charts
 
* ps2pdf: for converting ps to pdf
 
* ps2pdf: for converting ps to pdf
 
* [http://www.adobe.com/products/acrobat/readstep2.html adobe reader], [http://linuxappfinder.com/package/kpdf kpdf]: for viewing pdf charts
 
* [http://www.adobe.com/products/acrobat/readstep2.html adobe reader], [http://linuxappfinder.com/package/kpdf kpdf]: for viewing pdf charts
* [http://www.openoffice.org/ openoffice], [http://www.koffice.org/ koffice]: for viewing odt documents
+
* [http://www.libreoffice.org/download LibreOffice] or [http://www.openoffice.org/ OpenOffice] or [http://www.calligra-suite.org/ Calligra]: for viewing odt documents
  
 
== Filters: what persons to print ? ==
 
== Filters: what persons to print ? ==
  
 
=== What are filters?===
 
=== What are filters?===
In GRAMPS you can define filters to make a selection of individuals, see [[Example_filters| Examples of filters]]. In the relationship chart all custom person filters you made will be available, as well as the standard descendants and ancestors filters. These last start from the active person.
+
In Gramps you can define filters to make a selection of individuals, see [[Example_filters| Examples of filters]]. In the relationship chart all custom person filters you made will be available, as well as the standard descendants and ancestors filters. These last start from the active person.
  
 
{{man tip|Tip|You can add to a family stepchildren by setting the relationship of the child to the mother to ''step child''. In doing so, these children will be part of a descendant report without the need to create a custom filter to include them.}}
 
{{man tip|Tip|You can add to a family stepchildren by setting the relationship of the child to the mother to ''step child''. In doing so, these children will be part of a descendant report without the need to create a custom filter to include them.}}
Line 27: Line 25:
  
 
== Example 1-A: a descendant chart ==
 
== Example 1-A: a descendant chart ==
[[Image:RelationshipChartDescendants.png|right|thumb|200px|A descendant chart, click for details]]
+
[[File:RelationshipChartDescendants.png|right|thumb|220px|A descendant chart, click for details]]
Download [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/example/gramps/data.gramps?view=markup&pathrev=10822 example.gramps], on this page use the {{man label|Download}} link, create a new database in GRAMPS called example.grdb, and import the example.gramps data into it.
+
Use the [[example.gramps]] that came with your install, or download [https://raw.githubusercontent.com/gramps-project/gramps/maintenance/gramps41/example/gramps/example.gramps example.gramps], save to a file, create a new database in Gramps called example, and import the example.gramps data into it.
  
If not the case, set the active person to ''Garner, Lewis Anderson''.  
+
If not the case, set the active person to ''Garner von Zieliński, Lewis Anderson Sr''.  
  
 
To make a descendant chart with the relationship report, choose the menu item  
 
To make a descendant chart with the relationship report, choose the menu item  
'''Reports -> Graphical reports -> Relationship graph...'''
+
{{man menu|Reports -> Graphs -> Relationship Graph...}}
 +
 
 +
In the Bottom dialog:
 +
* '''Document Options''' set the '''Output Format''' to .png
  
In the dialog, set the format to .png and chose the following in the tabs available:
+
Chose the following in the tabs available:
#'''Paper Options '''-> Size : Custom Size (Set width and height to 10000 cm, or some other large value)
+
#'''Paper Options '''-> Size : Custom Size (Set width and height to ''10000'' cm, or some other large value)
#'''Report Options '''-> Filter: Descendants of Garner, Lewis Andersson
+
#'''Report Options '''-> ''Filter:'' '''Descendants of Garner von Zieliński, Lewis Anderson Sr'''
#'''Layout optons '''-> Aspect ratio: minimal size
+
#'''GraphViz Layout'''-> ''Graph Direction:'' '''Horizontal (<-)'''
 +
#'''GraphViz Options'''-> ''Aspect ratio:'' '''Compress to minimal size'''
  
(I sometimes experience problems setting the sizes in the Paper options dialog. A workaround is to use the example using graphviz code in example 3 below.)
+
Select '''OK''' to generate the chart.
  
The result (using gramps 2.2.7) can be seen to the right. You can use print this on a dedicated printer (check dpi of png!), or you can use this image on a website to share. In the last case, you can use the trick explained in [[Make flash plugin from a png]], to make the resulting graph easier to navigate.
+
The result can be seen to the right. You can use print this on a dedicated printer (If required change the '''GraphViz Options''' DPI of png file.), or if you use the default DPI of 72 you can use this image on a website to share. In the last example below, you can use the tip explained in [[Make flash plugin from a png]], to make the resulting graph easier to navigate.
  
In the image you see males in blue, females in pink and the yellow balloons indicate a family node in which a marriage date is printed (if known). You can select not to see this family node by deselecting in the '''Graphviz Options''' tab the option ''Show family nodes''.
+
In the chart image, males are blue, females are pink and the yellow balloons indicate a family node in which a marriage date is printed (if known). You can select not to see this family node by deselecting in the '''Graph Style''' tab the option ''Show family nodes''.
  
 
== Example 1-B: a chart with ancestors ==
 
== Example 1-B: a chart with ancestors ==
[[Image:RelationshipChartAncestors_small.png|left|thumb|350px|Fig. An ancestor chart. For the detailed image, [[Media:RelationshipChartAncestors.png| click here (853kb!)]]]]
+
Download and open the example.gramps file as in Example 1-A
 
 
 
 
 
 
Download and open the example.gramps file as in Example 1
 
 
 
 
 
  
 
Set ''Warner, Carl Thomas'' to be the active person.
 
Set ''Warner, Carl Thomas'' to be the active person.
  
Repeat the process in Example 1-a, but choose the filter ''Ancestors of Warner, Carl Thomas'' this time.
+
Repeat the process in Example 1-A, but choose the filter ''Ancestors of Warner, Carl Thomas'' this time.  
 
 
You can see the result to the left.  
 
  
 +
[[File:RelationshipChartAncestors small.png|right|thumb|300px|Example Relationship ancestor chart. (For the detailed image, [[Media:RelationshipChartAncestors.png| click here (1.49mb!))]]]]
  
 +
You can see the result to the right.
  
 
This is already an extremely large graph.
 
This is already an extremely large graph.
 
 
 
 
  
 
It can only be readily viewed in a good image viewer.  
 
It can only be readily viewed in a good image viewer.  
  
 
For printing you need to resort to printing on several pages, or you need access to a large plotter.
 
For printing you need to resort to printing on several pages, or you need access to a large plotter.
 +
{{-}}
  
 
== Example 2: A chart with ancestors, descendants and their families ==
 
== Example 2: A chart with ancestors, descendants and their families ==
[[Image:RelationshipChartAncestorsAndDescendants_small.png|right|thumb|450px|Fig. A large chart. For the detailed image, [[Media:RelationshipChartAncestorsAndDescendants.png| click here (363kb!)]]]]
+
{{out of date| example 2 & 3 and section below them still need a bit of an update }}
 
+
{{man note|Note:|This example uses filters. See [[Example filters| Examples of filters]] for an introductory example.}}
Note: This example uses filters. See [[Example filters| Examples of filters]] for an introductory example.
+
<!-- Can not find Cristiansen, Frances in example.gramps -->
 
 
 
 
 
 
 
 
 
Open the file example.gramps and select Cristiansen, Frances as the active person.
 
Open the file example.gramps and select Cristiansen, Frances as the active person.
  
Line 88: Line 77:
 
* ''Ancestors of <person>'' choose Christiansen, Frances and check <tt>inclusive</tt>.
 
* ''Ancestors of <person>'' choose Christiansen, Frances and check <tt>inclusive</tt>.
 
* ''Descendants of <person>'' chose Christiansen, Frances  
 
* ''Descendants of <person>'' chose Christiansen, Frances  
 
 
 
  
 
Make sure that "At least one rule must be fulfilled" is chosen, so that we get both ancestors and descendants!
 
Make sure that "At least one rule must be fulfilled" is chosen, so that we get both ancestors and descendants!
 
  
 
Now we create the filter we will actually use for the report. It will be based on the previous filter: Create a new filter, called '''Frances2'''. This filter should contain the rules:
 
Now we create the filter we will actually use for the report. It will be based on the previous filter: Create a new filter, called '''Frances2'''. This filter should contain the rules:
Line 101: Line 86:
 
* ''Siblings of filter'' Frances1
 
* ''Siblings of filter'' Frances1
 
* ''Spouses of filter'' Frances1
 
* ''Spouses of filter'' Frances1
 
 
 
  
 
Now close the filter editor, and follow the instructions given in Examples 1a and 1b, but this time choosing the filter '''Frances2''' in the '''Report Options''' tab.
 
Now close the filter editor, and follow the instructions given in Examples 1a and 1b, but this time choosing the filter '''Frances2''' in the '''Report Options''' tab.
  
 
+
[[Image:RelationshipChartAncestorsAndDescendants_small.png|right|thumb|450px|Fig. A large chart. For the detailed image, [[Media:RelationshipChartAncestorsAndDescendants.png| click here (363kb!)]]]]
 
 
 
 
 
 
  
 
The result is visible to the right (363kb, large file !)
 
The result is visible to the right (363kb, large file !)
 +
{{-}}
  
== Example 3, Generating the graph by using the Graphviz command line tool ==
+
== Example 3: Generating the graph by using the Graphviz command line tool ==
  
{|style="width:80%;margin-top:+.7em;margin-bottom:+.7em;background-color: #c0f0ff;border:1px solid #ccc; padding: 5px" align="center"
+
{{man tip|Tips|Some tips around GraphViz are [http://bernaerts.dyndns.org/linux/74-ubuntu/287-ubuntu-graphviz-viewer-gnome-thumbnailer available].}}
|-
 
|[[Image:Gnome-important.png]]
 
|<center style="font-size:100%">'''Note:''' The current stable version of [http://graphviz.org Graphviz] (v2.12) has a bug.  In order to correctly display the family nodes (yellow balloons), all occurrences of the word ''ellipse'' should be changed to ''egg'' (see [http://www.graphviz.org/bugs/b1078.html bug report 1078]).</center>
 
|}
 
  
In the menu, select '''Reports ->  Graphs -> Relationship Graph...'''.
+
In the menu, select {{man menu|Reports ->  Graphs -> Relationship Graph...}}.
  
Select in file format: graphviz file, which defaults to the gv extension. This file
+
In the Bottom dialog:
is then a dot file which can be processed by graphviz.
+
* '''Document Options''' set the '''Output Format''' to ''Graphviz file'', which defaults to the gv extension. This file is then a dot file which can be processed by Graphviz.
  
 
Eg, to make from the gv file a ps file, Gramps uses:
 
Eg, to make from the gv file a ps file, Gramps uses:
Line 140: Line 116:
  
 
=== Manual changes ===
 
=== Manual changes ===
The dot file is a text file with a well explained structure, for extra info: [http://www.graphviz.org/Documentation.php www.graphviz.org]
+
The Graphviz '''.gv''' dot file is a text file with a well documented structure, (See: [http://www.graphviz.org/Documentation.php graphviz.org/Documentation] )
  
 
  digraph GRAMPS_graph
 
  digraph GRAMPS_graph
Line 146: Line 122:
 
   bgcolor=white;
 
   bgcolor=white;
 
   center="true";  
 
   center="true";  
   charset="iso-8859-1";
+
   charset="utf8";
 
   concentrate="false";
 
   concentrate="false";
   dpi="75";
+
   dpi="72";
   graph [fontsize=12];
+
   graph [fontsize=14];
 +
  ....
  
...
+
then the actual Gramps data are shown:
 +
 +
  I0585 [ shape="box" fillcolor="#e0e0ff" style="solid,filled" label="Kristensen, John Francis\"Chick\"\n(1889-10-10 - 1938-10-23)" ];
  
then the actual GRAMPS data are shown:
 
 
I3493 [ shape="box" fillcolor="pink" style="solid,filled" label="Blancke, Charlotte\n(1801)" ];
 
...
 
 
You can optimize the layout by making changes in the file.  
 
You can optimize the layout by making changes in the file.  
*For paper size: look for the "page" (paper size) and "size" (area of paper to use), and change these to '''some large values'''. This is important as otherwise the figure will be wrongly scaled giving bad picture quality (eg unreadable text).  
+
*For paper size: look for the "page" (paper size) and "size" (area of paper to use), and change these to '''some large values'''. This is important as otherwise the figure will be wrongly scaled and the picture quality will be poor (eg unreadable text).  
 
*You can also change the font by adding a font family. Look for the lines
 
*You can also change the font by adding a font family. Look for the lines
 
  node [style=filled fontsize="12"];
 
  node [style=filled fontsize="12"];
Line 173: Line 148:
 
  dot -Tjpg -oreport.jpg report.dot -v
 
  dot -Tjpg -oreport.jpg report.dot -v
  
...
+
...
 
  Activated plugin library: libgvplugin_pango.so.5
 
  Activated plugin library: libgvplugin_pango.so.5
 
  Using textlayout: textlayout:cairo
 
  Using textlayout: textlayout:cairo
Line 195: Line 170:
 
  Using render: cairo:cairo
 
  Using render: cairo:cairo
 
  Using device: jpg:cairo:gd
 
  Using device: jpg:cairo:gd
...
+
...
  
 
== Printing large graphs ==
 
== Printing large graphs ==
If you want to print large graphs (especially with photos and other details) in reasonable readable quality, you should follow these steps:
+
If you want to print large graphs (especially with photos and other details) in reasonable readable quality, the following steps should work:
* In Document Options choose SVG as output format.
+
# In Document Options choose SVG as output format.
* Setup paper format to fit graph into one sheet (SVG cannot handle more than one sheet), so choose A0 or custom size.
+
# Setup paper format to fit graph into one sheet (SVG cannot handle more than one sheet), so choose A0 or custom size.
* Use [http://www.inkscape.org/ Inkscape] for opening SVG graph.
+
# Use [http://www.inkscape.org/ Inkscape] for opening SVG graph.
* Menu File/Document properties, use "Fit page to selection" function (fix size accordingly to graph size).
+
# Menu File/Document properties, use "Fit page to selection" function (fix size accordingly to graph size).
* Menu File/Save as, choose PDF format.
+
# Menu File/Save as, choose PDF format.
* Inkscape cannot tile PDF for printing large graphs on many A4/A3 sheets, so you must use another software to do it for you. For Windows, you can use [http://www.noliturbare.com/pdf-tools/pdf-tiler Govert's PDF Tiler] (can maybe run on Linux too using [http://www.mono-project.com/Main_Page Mono], needs .NET 1.1) or [http://posterazor.sourceforge.net/ PosteRazor] which is available also for Linux and Mac.
+
 
 +
You now have a large poster you could print. Inkscape cannot tile PDF for printing large graphs on many A4/A3 sheets, so you must use another software to do it for you. At home, you can print this on multiple A4/A3 sheets with other programs:
 +
* In Linux, the poster command line utility can split a poster over A4/A3/Letter.
 +
*# Install it via your package manager (or on CLI type for eg Ubuntu: ''sudo apt-get install poster''
 +
*# Read the man page, to eg split an A0 poster which is in postscript format, over 16 A4 do:
 +
    poster -iA0 -mA4 -pA0 posterA0.ps > posterA4.ps
 +
* For Linux, Windows and Mac, you can also use the program [http://posterazor.sourceforge.net/ PosterRazor], which has an easy to use interface.
 +
For Windows, you can use [http://www.noliturbare.com/pdf-tools/pdf-tiler Govert's PDF Tiler] (can maybe run on Linux too using [http://www.mono-project.com/Main_Page Mono], needs .NET 1.1)
  
 
== Troubleshooting ==
 
== Troubleshooting ==
*If you encounter bad fonts (missing characters) or wrong fontsizes, see Example 3 on how you can set the font yourself.
+
*If you encounter bad fonts (missing characters) or wrong fontsizes, see [[Howto:_Make_a_relationship_chart#Example_3:_Generating_the_graph_by_using_the_Graphviz_command_line_tool|Example 3]] on how you can set the font yourself.
*If you have a bad resolution of png, eg unreadable text, this is probably because you have set a paper size which is to small. See Exampe 1-A: set the papersize of number of pages to a high number, but select in '''Layout Options''', in Aspect ratio: <tt>automatically use optimal number pages</tt>, or use <tt>minimal size</tt>
+
*If you have a bad resolution of png, eg unreadable text, this is probably because you have set a paper size which is to small. See [[Howto:_Make_a_relationship_chart#Example_1-A:_a_descendant_chart|Example 1-A]]: set the papersize of number of pages to a high number, but select in '''GraphViz Options''', in ''Aspect ratio'': <tt>Fill the given area</tt>, or use <tt>Compress to minimal size</tt>
  
{{man warn|Reports and custom IDs|After a GEDCOM import, your database can use some non-standard IDs (ie. 123I or 456U not set on '''Edit --> Preferences --> Identifiants ID'''). If generated reports do not properly display data, then try [[Gramps_3.0_Wiki_Manual_-_Tools#Reorder_GRAMPS_ID|Reorder GRAMPS IDs tool]] ('''Tools-->Database Processing-->Reorder GRAMPS IDs''').}}
+
{{man warn|Reports and custom IDs|After a GEDCOM import, your database can use some non-standard IDs (ie. 123I or 456U not set on {{man menu|Edit --> Preferences --> ID Formats}}). If generated reports do not properly display data, then try [[Gramps_4.1_Wiki_Manual_-_Tools#Reorder_Gramps_ID|Reorder Gramps IDs tool]] ({{man menu|Tools->Family Tree Processing->Reorder Gramps IDs}}).}}
  
== Further cool things to do ==
+
== Additional things to try ==
 
* You can make descendant charts and add them to the media gallery of the person. Like that, the chart is available from the website.  
 
* You can make descendant charts and add them to the media gallery of the person. Like that, the chart is available from the website.  
* offer a chart on your website as a [[Make flash plugin from a png |flash relationship graph]], enabling zooming, moving, ... over your data or just use SVG for Firefox and Opera, see [http://www.gramps-project.org/wiki/index.php?title=UnsupportedPlugins#DenominoViso_-_HTML_Ancestors_page DenominoViso]
+
* Offer a chart on your website as a [[Make flash plugin from a png |flash relationship graph]], enabling zooming, moving, ... over your data or just use SVG for Firefox and Chrome, see [[DenominoViso]]
 +
 
 +
== Help improve the Graph reports ==
 +
If you examine the dot specifications, you will note that much more can be done with GraphViz output. If you have programming skills you can add some functionality:
 +
* Improved text in the boxes: what text and how to organize it?
 +
* Coloring. See the [[Gramps_4.1_Wiki_Manual_-_Reports_-_part_5#Family_Lines_Graph|Family Lines Graph]]: for a color per family, for specific relations, for the central person, ...
  
== Want to help developing ? ==
+
== See also ==
If you go through the dot specifications, you will note that more can be done with graphics. If you have programming skills you can add some functionality:
+
* [[Gramps_4.1_Wiki_Manual_-_Reports_-_part_5#Relationship_Graph|Relationship Graph - User Manual]].
* more/better text in the boxes: what text and how to organize it?
 
* coloring. See the [[Familylines plugin]]: a color per family, for specific relations, for the central person, ...
 
  
== Link to the manual ==
+
[[Category:Tutorials|Make a relationship chart]]
Also check out the [http://www.gramps-project.org/wiki/index.php?title=Gramps_3.0_Wiki_Manual_-_Reports#Relationship_Graph Wiki Manual].
 

Revision as of 00:12, 3 February 2016

How to make a relationship chart (for either ancestors, descendants, ...) with Gramps 4.x. and the Relationship graph report.

An example chart

Before you start

The Relationship graph report uses the GraphViz backend, which should already be installed, if not you will need to install graphviz (on linux, use your package manager).

Gramps can produce charts, but to view them, you need other programs. We recommend that you install the following:

Filters: what persons to print ?

What are filters?

In Gramps you can define filters to make a selection of individuals, see Examples of filters. In the relationship chart all custom person filters you made will be available, as well as the standard descendants and ancestors filters. These last start from the active person.

Tango-Dialog-information.png
Tip

You can add to a family stepchildren by setting the relationship of the child to the mother to step child. In doing so, these children will be part of a descendant report without the need to create a custom filter to include them.


How many people ?

Your filter can contain as many people as you want. Note however that printing or viewing of large charts can be very problematic.

Example 1-A: a descendant chart

A descendant chart, click for details

Use the example.gramps that came with your install, or download example.gramps, save to a file, create a new database in Gramps called example, and import the example.gramps data into it.

If not the case, set the active person to Garner von Zieliński, Lewis Anderson Sr.

To make a descendant chart with the relationship report, choose the menu item Reports -> Graphs -> Relationship Graph...

In the Bottom dialog:

  • Document Options set the Output Format to .png

Chose the following in the tabs available:

  1. Paper Options -> Size : Custom Size (Set width and height to 10000 cm, or some other large value)
  2. Report Options -> Filter: Descendants of Garner von Zieliński, Lewis Anderson Sr
  3. GraphViz Layout-> Graph Direction: Horizontal (<-)
  4. GraphViz Options-> Aspect ratio: Compress to minimal size

Select OK to generate the chart.

The result can be seen to the right. You can use print this on a dedicated printer (If required change the GraphViz Options DPI of png file.), or if you use the default DPI of 72 you can use this image on a website to share. In the last example below, you can use the tip explained in Make flash plugin from a png, to make the resulting graph easier to navigate.

In the chart image, males are blue, females are pink and the yellow balloons indicate a family node in which a marriage date is printed (if known). You can select not to see this family node by deselecting in the Graph Style tab the option Show family nodes.

Example 1-B: a chart with ancestors

Download and open the example.gramps file as in Example 1-A

Set Warner, Carl Thomas to be the active person.

Repeat the process in Example 1-A, but choose the filter Ancestors of Warner, Carl Thomas this time.

Example Relationship ancestor chart. (For the detailed image, click here (1.49mb!))

You can see the result to the right.

This is already an extremely large graph.

It can only be readily viewed in a good image viewer.

For printing you need to resort to printing on several pages, or you need access to a large plotter.

Example 2: A chart with ancestors, descendants and their families

Gramps-notes.png This page's factual accuracy may be compromised due to out-of-date information. Please help improve the Gramps Wiki as a useful resource by updating it.
Gramps-notes.png
Note:

This example uses filters. See Examples of filters for an introductory example.

Open the file example.gramps and select Cristiansen, Frances as the active person.

First we create a helper filter: Open the filter editor and create a new filter, called Frances1. The filter should contain the rules

  • Ancestors of <person> choose Christiansen, Frances and check inclusive.
  • Descendants of <person> chose Christiansen, Frances

Make sure that "At least one rule must be fulfilled" is chosen, so that we get both ancestors and descendants!

Now we create the filter we will actually use for the report. It will be based on the previous filter: Create a new filter, called Frances2. This filter should contain the rules:

  • People matching the filter, choose Frances1
  • Parents of filter Frances1
  • Siblings of filter Frances1
  • Spouses of filter Frances1

Now close the filter editor, and follow the instructions given in Examples 1a and 1b, but this time choosing the filter Frances2 in the Report Options tab.

Fig. A large chart. For the detailed image, click here (363kb!)

The result is visible to the right (363kb, large file !)

Example 3: Generating the graph by using the Graphviz command line tool

Tango-Dialog-information.png
Tips

Some tips around GraphViz are available.


In the menu, select Reports -> Graphs -> Relationship Graph....

In the Bottom dialog:

  • Document Options set the Output Format to Graphviz file, which defaults to the gv extension. This file is then a dot file which can be processed by Graphviz.

Eg, to make from the gv file a ps file, Gramps uses:

dot -Tps:cairo -o"file.ps" "file.gv"

for svg:

dot -Tsvg -o"file.svg" "file.gv"

Choose the filter you want to use, and set also as many of the other options as possible to the desired values (as explained in Example 1-A)

This file is a text file, so it can be opened in any text-editor.

Manual changes

The Graphviz .gv dot file is a text file with a well documented structure, (See: graphviz.org/Documentation )

digraph GRAMPS_graph
{
 bgcolor=white;
 center="true"; 
 charset="utf8";
 concentrate="false";
 dpi="72";
 graph [fontsize=14];
 ....

then the actual Gramps data are shown:

 I0585 [ shape="box" fillcolor="#e0e0ff" style="solid,filled" label="Kristensen, John Francis\"Chick\"\n(1889-10-10 - 1938-10-23)" ];

You can optimize the layout by making changes in the file.

  • For paper size: look for the "page" (paper size) and "size" (area of paper to use), and change these to some large values. This is important as otherwise the figure will be wrongly scaled and the picture quality will be poor (eg unreadable text).
  • You can also change the font by adding a font family. Look for the lines
node [style=filled fontsize="12"];
and change that into eg
node [style=filled fontsize="12" fontname="Sans"];
to use the Sans font. On the command line you will see which ttf font Graphviz finds on your PC (using the verbose flag, see below).

Generation of the Image

Save the modified file under the name report.dot, and run the command

dot -Tpng -oreport.png report.dot

This should use the graphviz "dot" tool to generate the .png file containing the report.

To see information messages (like font) use the -v flag. You can also output other image formats, eg, for jpeg with verbose output:

dot -Tjpg -oreport.jpg report.dot -v
...
Activated plugin library: libgvplugin_pango.so.5
Using textlayout: textlayout:cairo
Activated plugin library: libgvplugin_dot_layout.so.5
Using layout: dot:dot_layout
Using render: cairo:cairo
Activated plugin library: libgvplugin_gd.so.5
Using device: jpg:cairo:gd
The plugin configuration file:	/usr/lib/graphviz/config4 was successfully loaded.
   render	:  cairo dot fig gd map ps svg vml vrml xdot
   layout	:  circo dot fdp neato nop nop1 nop2 twopi
   textlayout	:  textlayout
   device	:  canon cmap cmapx cmapx_np dia dot fig gd gd2 gif hpgl imap imap_np ismap jpe jpeg jpg mif mp pcl pdf pic plain plain-ext png ps ps2 svg svgz vml vmlz vrml vtx wbmp xdot xlib
   loadimage	:  (lib) gd gd2 gif jpe jpeg jpg png ps
dot: fontname "Times-Roman" resolved to: "Times New Roman, Normal" /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf
network simplex: 11 nodes 10 edges 0 iter 0.00 sec
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross GRAMPS_graph: 0 crossings, 0.00 secs.
network simplex: 23 nodes 37 edges 7 iter 0.00 sec
routesplines: 10 edges, 30 boxes 0.00 sec
Using render: cairo:cairo
Using device: jpg:cairo:gd
...

Printing large graphs

If you want to print large graphs (especially with photos and other details) in reasonable readable quality, the following steps should work:

  1. In Document Options choose SVG as output format.
  2. Setup paper format to fit graph into one sheet (SVG cannot handle more than one sheet), so choose A0 or custom size.
  3. Use Inkscape for opening SVG graph.
  4. Menu File/Document properties, use "Fit page to selection" function (fix size accordingly to graph size).
  5. Menu File/Save as, choose PDF format.

You now have a large poster you could print. Inkscape cannot tile PDF for printing large graphs on many A4/A3 sheets, so you must use another software to do it for you. At home, you can print this on multiple A4/A3 sheets with other programs:

  • In Linux, the poster command line utility can split a poster over A4/A3/Letter.
    1. Install it via your package manager (or on CLI type for eg Ubuntu: sudo apt-get install poster
    2. Read the man page, to eg split an A0 poster which is in postscript format, over 16 A4 do:
   poster -iA0 -mA4 -pA0 posterA0.ps > posterA4.ps 
  • For Linux, Windows and Mac, you can also use the program PosterRazor, which has an easy to use interface.
  • For Windows, you can use Govert's PDF Tiler (can maybe run on Linux too using Mono, needs .NET 1.1)

Troubleshooting

  • If you encounter bad fonts (missing characters) or wrong fontsizes, see Example 3 on how you can set the font yourself.
  • If you have a bad resolution of png, eg unreadable text, this is probably because you have set a paper size which is to small. See Example 1-A: set the papersize of number of pages to a high number, but select in GraphViz Options, in Aspect ratio: Fill the given area, or use Compress to minimal size
Gnome-important.png
Reports and custom IDs

After a GEDCOM import, your database can use some non-standard IDs (ie. 123I or 456U not set on Edit --> Preferences --> ID Formats). If generated reports do not properly display data, then try Reorder Gramps IDs tool (Tools->Family Tree Processing->Reorder Gramps IDs).

Additional things to try

  • You can make descendant charts and add them to the media gallery of the person. Like that, the chart is available from the website.
  • Offer a chart on your website as a flash relationship graph, enabling zooming, moving, ... over your data or just use SVG for Firefox and Chrome, see DenominoViso

Help improve the Graph reports

If you examine the dot specifications, you will note that much more can be done with GraphViz output. If you have programming skills you can add some functionality:

  • Improved text in the boxes: what text and how to organize it?
  • Coloring. See the Family Lines Graph: for a color per family, for specific relations, for the central person, ...

See also