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

From Gramps
Jump to: navigation, search
(relationship chart tutorial)
Line 38: Line 38:
  
 
In the dialog, set the format to .png and chose the following in the tabs available:
 
In the dialog, set the format to .png and 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: Ancestors of Garner, Lewis Andersson  
+
#'''Report Options '''-> Filter: Ancestors of Garner, Lewis Andersson  
layout optons -> Aspect ratio: minimal size
+
#'''Layout optons '''-> Aspect ratio: 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.)
 
(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.)
  
 
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 (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.
 +
 +
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''.
  
 
== Example 1-B: a chart with ancestors ==
 
== Example 1-B: a chart with ancestors ==
 
+
[[Image:RelationshipChartAncestors.png|right|thumb|350px|An ancestor chart, click for details-'''Large file-853kb!''']]
 
Download and open the example.gramps file as in Example 1
 
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, but choose the filter "Ancestors of Warner, Carl Thomas" this time.
+
Repeat the process in example 1, but choose the filter ''Ancestors of Warner, Carl Thomas'' this time. 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 ==
 
== Example 2: A chart with ancestors, descendants and their families ==
Line 61: Line 63:
 
Open the filter editor and create a new filter, called '''Frances1'''. The filter should contain the rules
 
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".
+
* ''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, an 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:
  
* "People matching the filter", choose Frances1
+
* ''People matching the filter'', choose Frances1
* "Parents of filter" Frances1
+
* ''Parents of filter'' Frances1
* "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 <tt>Report Options</tt> tab. The result is visible to the right (363kb, large file !)
+
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. 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 ==
Line 79: Line 81:
 
I use this only as a way to work around problems like setting the paper size.
 
I use this only as a way to work around problems like setting the paper size.
  
In the menu, select "Reports ->  Code Generators -> Relationship graph"
+
In the menu, select '''Reports '''->  Code Generators -> Relationship graph
 
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), but the format should be "Graphviz (dot)". Click Ok. You should now have a file of type ".dot".
 
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), but the format should be "Graphviz (dot)". Click Ok. You should now have a file of type ".dot".
 
This file is a text file, so it can be opened in any text-editor.
 
This file is a text file, so it can be opened in any text-editor.
  
For paper size, look around line 36-37 for two lines that define the "page" (paper size) and "size" (area of paper to use), and change these to some large values.
+
For paper size, look around line 36-37 for two lines that define 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). You can also change the font by adding a font family. Look for the lines
 
+
node [style=filled fontsize="12"];
Save the modified file under the name report.dot, and run the commad "dot -Ppng -oreport.png report.dot". This should use the graphviz "dot" tool to generate the .png file containing the report.
+
and change that into eg
 +
node [style=filled fontsize="12" fontname="Sans"];
  
 +
Save the modified file under the name report.dot, and run the command
 +
dot -Ppng -oreport.png report.dot
 +
This should use the graphviz "dot" tool to generate the .png file containing the report.
  
 +
== 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 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>
  
 
== Further cool things to do ==
 
== Further cool things to do ==
 
* You can make descendant charts and add them to the media gallery of the person. Like that, the cart is available from the website.  
 
* You can make descendant charts and add them to the media gallery of the person. Like that, the cart 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 Opera, see [http://www.gramps-project.org/wiki/index.php?title=UnsupportedPlugins#DenominoViso_-_HTML_Ancestors_page DenominoViso]
 +
 +
== Want to help developing ? ==
 +
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:
 +
* add the default picture (planned for GRAMPS 3.0 based on ideas of the Familines plugin)
 +
* more/better text in the boxes: what text and how to organize it?
 +
* coloring. See the family lines plugin: a color per family, for specific relations, for the central person, ...

Revision as of 23:09, 11 June 2007

This is a Howto on how to make a relationship chart (can be ancestors, descendants, ...) with GRAMPS 2.2.x. and the Relationship plugin.

The report is made with the graphviz backend, so you need to install graphviz first (http://graphviz.org). The goal is to offer a complete howto/tutorial on using this report, from conception, to using your report (poster printing, ...).

Before you start

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

  • Graphviz: required, whithout this, no relationship chart
  • Inkscape: for viewing and editing svg charts, export to png
  • gv, kghostview: for viewing ps charts
  • ps2pdf: for converting ps to pdf
  • adobe reader, kpdf: for viewing pdf charts
  • openoffice, koffice: for viewing odt documents

Filters: what persons to print ?

What are filters?

In GRAMPS you can define filters to make a selection of individuals, see Example_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.

Gnome-important.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

Download example.gramps, create a new database in GRAMPS called example.grdb, and import the example.gramps data into it.

If not the case, set the active person to Garner, Lewis Anderson

To make a descendant chart with the relationship report, choose the menu item "Reports -> Graphical reports -> Realtionship graph"

In the dialog, set the format to .png and 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: Ancestors of Garner, Lewis Andersson
  3. Layout optons -> Aspect ratio: 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.)

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.

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.

Example 1-B: a chart with ancestors

An ancestor chart, click for details-Large file-853kb!

Download and open the example.gramps file as in Example 1 Set Warner, Carl Thomas to be the active person.

Repeat the process in example 1, but choose the filter Ancestors of Warner, Carl Thomas this time. 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

A large chart, click for details, 363kb

Note: This example uses filters. See Example 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. The result is visible to the right (363kb, large file !)

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

I use this only as a way to work around problems like setting the paper size.

In the menu, select Reports -> Code Generators -> Relationship graph 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), but the format should be "Graphviz (dot)". Click Ok. You should now have a file of type ".dot". This file is a text file, so it can be opened in any text-editor.

For paper size, look around line 36-37 for two lines that define 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). 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"];

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

dot -Ppng -oreport.png report.dot

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

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 Exampe 1-A: set the papersize of number of pages to a high number, but select in Layout Options, in Aspect ratio: automatically use optimal number pages, or use minimal size

Further cool things to do

  • You can make descendant charts and add them to the media gallery of the person. Like that, the cart 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 Opera, see DenominoViso

Want to help developing ?

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:

  • add the default picture (planned for GRAMPS 3.0 based on ideas of the Familines plugin)
  • more/better text in the boxes: what text and how to organize it?
  • coloring. See the family lines plugin: a color per family, for specific relations, for the central person, ...