Changes

From Gramps

Addon:NetworkChart

2,185 bytes added, 06:09, 5 September 2025
Performance
{{Third-party addon}}
{{#vardefine:chapter|NetworkChart}}
{{man warn|Long chart creation times|Generating a chart of every individual in a very large database can lead to long chart generation times (See [[Addon:NetworkChart#Performance|Performance]]). Of course, subsets can be selected greatly reducing the chart generation times (See [[Addon:NetworkChart#Trim|Trim]] and [[Addon:NetworkChart#Highlight|Highlight]]).}}
{{man note|Slight Variations in Graph Layouts|Generated Network Chart graphs may change slightly after Gramps restarts. This is due to the [https://en.wikipedia.org/wiki/Nondeterministic_algorithm nondeterministic] nature of the Graphviz memory allocation method used in the dot layout engine.}}
[[File:Shakespeare_network_1_dynamic_url.svg|thumb|right|450px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Example Default Output]]
{{man label|Network Chart}} is a Web Pages Report addon that can:
*Generate a single graph showing connectivity between individuals
==Usage==
{{man menu|To use this report make sure you have installed the required [[#Prerequisites|prerequisites]].}}
[[File:NetworkChart-menu-selection-60-en.png|450px|right|thumb|450px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Network Chart - menu selection]]
To use the {{man label|Network Chart}} addon choose menu {{man menu|Reports > Web Pages > Network Chart...}} select any options you want to change on the following preferences tabs:* [[#MainPreferences_tabs|Main]] - * [[#Color|Color]] - * [[#Privacy|Privacy]] -* [[#Trim|Trim]] - * [[#Highlight|Highlight]] -* [[#Config|Configpreferences tabs]] - .
Then select {{man button|Ok}} to create the report in selected folder.
{{-}}
 
==Preferences tabs==
{{man note|The Shakespeare family tree GEDCOM is used for the examples|and was downloaded from the https://webtreeprint.com/tp_famous_gedcoms.php website.}}
The following preferences tabs are available:
* [[#Main|Main]]
* [[#Color|Color]]
* [[#Privacy|Privacy]]
* [[#Trim|Trim]]
* [[#Highlight|Highlight]]
* [[#Config|Config]]
 
===Main===
{{man note|The Shakespeare family tree GEDCOM is used for the examples and was downloaded|from the https://webtreeprint.com/tp_famous_gedcoms.php website.}}[[File:Network_chart_menu_Main.png|left|thumb|400px450px|leftFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Network Chart {{man label|Main}} preferences tab]]
The {{man label|Main}} preferences tab (see image on left) controls the output Filename, Folder, File Type and chart title. The filename defaults to the database name + '_network' with '.svg'(default) added automatically on output. The Chart Title defaults to the database name and the folder to the top level user default home. Once an entry is changed it will be remembered and used for the next time as well. Clearing the entry will set it back to default. Additionally, name and date formats for the chart can be modified using the Gramps available formatting. The output File Type can be changed to a PDF. The PDF will not have URL links but everything else will display the same as the SVG.
Graph style menu selects The {{man label|Filename:}} defaults to the type of connectors 'family tree name' + '_network' with choices being Orthogonal, Straight, '.svg'(default) added automatically on output. The {{man label|Enter Chart Title:}} field defaults to the family tree name and the {{man label|Folder:}} to the users top level default home folder. Once an entry is changed it will be remembered and Curvedused for the next time as well. In Clearing the example entry will set it back to default output shown on . Additionally, name and date formats for the right, chart can be modified using the default orthogonal option was selected resulting in straight connectors with right anglesGramps available formatting. The output File Type can be changed to a PDF. Graphs with over 1500 people should probably use The PDF will not have URL links but everything else will display the Curved or Straight options with noticeable reduction in same as the time needed for graph generationSVG.
{{man label|Graph Direction controls which style:}} menu selects the type of connectors with choices being Orthogonal, Straight, and Curved. In the example default output shown on the right, the four different orientations to default orthogonal option was selected resulting in straight connectors with right angles. Graphs with over 1500 people should probably usethe Curved or Straight options with noticeable reduction in the time needed for graph generation.
URL Style selects one {{man label|Graph Direction:}} controls which of Database, Dynamic, Static, or None (Don't include). This option selects what hyperlink will be used for individual nodes when the SVG chart is viewed from a browser. The Database option will select the primary URL from the database if one is available or none if it is not. Dynamic will four different orientations to use the URL Prefix, Suffix from the next line in the Menu and the GrampsID of the node. The Example Default Output chart shown includes dynamic URL's. For example, Henry Webb in the database has GrampsID = I0125. So the URL for that node will have the prefix of ' https://mywebsite.com/home/ ' and the suffix '.html' yielding a node with a link to ' https://mywebsite.com/home/I0125.html '. The dynamic URL changes for every node. A static URL will use only the URL Prefix and the Don't Include URL or None will not place any link in the nodes.
[[File{{man label|URL Style:Shakespeare_network_static_left_to_right}} selects one of Database, Dynamic, Static, or None (Don't include).svg|thumb|800px|center This option selects what hyperlink will be used for individual nodes when the SVG chart is viewed from a browser. The Database option will select the primary URL from the database if one is available or none if it is not. Dynamic will use the {{man label|URL Prefix, Suffix:}} from the next line in the Menu and the GrampsID of the node. The Example Default Output chart shown includes dynamic URL's. For example, Henry Webb in the database has GrampsID = I0125. So the URL for Left that node will have the prefix of ''<nowiki>https://mywebsite.com/home/</nowiki>'' and the suffix '.html' yielding a node with a link to Right ''<nowiki>https://mywebsite.com/home/I0125.html</nowiki>''. The dynamic URL changes for every node. A static URL will use only the URL Prefix and Static the Don't Include URL's]]or None will not place any link in the nodes.
The font selection is straightforward[[File:Shakespeare_network_static_left_to_right. Obtain the name of the font that you wish to use and type it in the entry boxsvg|center|thumb|800px|Fig. The only requirement is that the font already be installed on your system{{#var:chapter}}. If the font is not found then a default font will be used. This is a silent operation and will not warn on a font not found. When the SVG graph is generated that font will be identified {{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Example Output for use, however, if someone viewing the chart does not have the same font installed they will see their default font instead. (Embedding fonts in SVGs or making them a local access is possible but not available in this addon.) The default font is White Rabbit by Matthew Welch which is an extremely readable font. It can be obtained from https://www.fontsquirrel.com/fonts/white-rabbit Left to Right and the license found at http://www.squaregear.net/fonts/license.shtml . Static URL's]]
{{man label|Enter Font Name:}} selection is straightforward, obtain the name of the font that you wish to use and type it in the entry box. The only requirement is that the font already be installed on your system. If the font is not found then a default font will be used. This is a silent operation and will not warn on a font not found. When the SVG graph is generated that font will be identified for use, however, if someone viewing the chart does not have the same font installed they will see their default font instead. (Embedding fonts in SVGs or making them a local access is possible but not available in this addon.) The default font is White Rabbit by Matthew Welch which is an extremely readable font. It can be obtained from https://www.fontsquirrel.com/fonts/white-rabbit and the license found at http://www.squaregear.net/fonts/license.shtml .  The {{man label|Spacing (inch):}} option controls the space between "generations" of nodes. It can be anywhere from 0.1 - 5.0 inches.  Finally, you can use "the {{man label|[ ] Different node shape/edges for gender" }} checkbox to controls control the box shapes and makes make the Male and Female box shapes different, by default this selection is turned off.{{-}}
===Color===
[[File:Network_chart_menu_Color.png|left|thumb|350px|leftFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Network Chart {{man label|Color}} preferences tab]] The {{man label|Color}} preferences tab controls most of the colors on the chart. The Network Chart SVG background is transparent so the background color you see will be the default background color of your browser or if the SVG was embedded in a webpage with a background image you will see that image below the Network Chart SVG. The node backgrounds for Male, Female, and Other can be changed. An [https://en.wikipedia.org/wiki/Alpha_compositing alpha transparency] is used for the individual node backgrounds. Setting this to 0 will make the node background completely transparent. Setting it to 255 will make it completely solid (opaque).
Connector lines are just that, the connecting lines from node to node for a family connection or marriage. The Highlight connector line is used for a highlighted path as discussed in the Highlight Menu section. The Trim box edge is used on nodes in the graph that have been "trimmed" as discussed in the Trim Menu section. Finally, all node background colors can be set to none with the Remove Color Backgrounds option.
===Privacy===
[[File:Network_chart_menu_Privacy.png|left|thumb|350px|leftFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Network Chart {{man label|Privacy}} preferences tab]] The {{man label|Privacy}} preferences tab allows dates for birth and marriage to be made vague. All individuals that have a valid date for either a birth or marriage can have that date rounded to the nearest decade after the year to start entered. Additionally, middle names can be changed to just show initials. Finally, private records for individuals can be included or not. If not, the individual node will contain the words "Private Record" for all those individuals marked private in Gramps.
{{-}}
===Trim===
[[File:Network_chart_menu_Trim_1.png|left|thumb|350px|leftFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} {{man label|Trim}} tab Example 1]] [[File:Shakespeare_network_trim_1.svg|right|thumb|200px|rightFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Trim Example 1]] The {{man label|Trim}} preferences tab allows "trimming" of the database to display less individuals in the Network Chart. The Trim Descendants option trims all descendants "below" the selected individuals. The Trim Ancestors option attempts to trim all ancestors "above" the selected individuals. Individuals by marriage will also be removed depending on their location in the network relative to the person trimmed. Both options allow entry of multiple people. The Trim Menu image shows the selection of individual I0118 to trim descendants and I0111 to trim ancestors. The result is shown on the right in the Trim Example 1. Note the nodes of the individuals selected on the trim tab are bordered with a red dashed trim.
{{-}}
[[File:Network_chart_menu_Trim_2.png|left|thumb|350px|leftFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} {{man label|Trim}} tab Example 2]] [[File:Shakespeare_network_trim_2.svg|right|thumb|200px|rightFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Trim Example 2]]
Trim Menu Example 2 shows the selection of additional individuals to trim. However, this example will generate "orphans" or individuals with no connections as a result of the trimming operation. This is shown in Trim Example 2. Note the three isolated individuals in the top right corner including one of the individuals selected in the trim menu.
{{-}}
[[File:Network_chart_menu_Trim_3.png|left|thumb|350px|leftFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} {{man label|Trim}} tab Example 3]] [[File:Shakespeare_network_trim_3.svg|right|thumb|200px|rightFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Trim Example 3]]
The Trim Groups option will trim smaller groups/trees or individuals that are disconnected. You must enter the minimum number of individuals in a group/tree to display. For databases with more than 1500 individuals this option is required and the minimum number is set to 2. This will force all disconnected single individuals to be removed from the graph. Selecting a number greater than the largest group/tree will return only the largest tree or those trees that are equal in size. For this example the Trim Groups has been selected with a size of 2. The result removes the isolated individuals from the graph as shown in the Trim Example 3 chart.
===Highlight===
[[File:Network_chart_menu_Highlight_1.png|left|thumb|350px|leftFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} {{man label|Highlight}} tab Example 1]] [[File:Shakespeare_network_highlight_1.svg|right|thumb|150px|rightFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Highlight Example 1]]
The {{man label|Highlight}} preferences tab. The Highlight Menu highlights paths and individuals in the database. The Highlight Path option choices are "Direct" or "Any". The Direct option will attempt to find a direct path between the two individuals selected and highlight that path. The Any option will attempt to find any path between the two selected individuals and highlight that path. The example shows Highlight Path Direct between the two individuals with the result shown in Highlight Example 1.
{{-}}
[[File:Network_chart_menu_Highlight_2.png|left|thumb|350px|leftFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} {{man label|Highlight}} tab Example 2]] [[File:Shakespeare_network_highlight_2.svg|right|thumb|100px|rightFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Highlight Example 2]]
The Show Path Only will display only the path found and remove all others from the chart. The choices are "Direct" or "Any". The Direct option will attempt to find a direct path between the two individuals selected and display only that path. The Any option will attempt to find any path between the two selected individuals and display only that path. The example shows the Show Only Path option with Direct selected. The result is shown in Highlight Example 2.
{{-}}
[[File:Network_chart_menu_Highlight_3.png|left|thumb|350px|leftFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} {{man label|Highlight}} tab Example 3]] [[File:Shakespeare_network_highlight_3.svg|right|thumb|100px|rightFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Highlight Example 3]]
The Center Person option allows one to select a center person for the chart and radius that will isolate the included nodes to just that selected person and anyone within the radius. The radius is the maximum allowable steps or edges between the center person and anyone else in the graph. All others outside of the maximum steps or edges will not be shown. Any connection via parent, child, or marriage counts as a step or edge.
===Config===
[[File:Network_chart_menu_Config.png|left|thumb|350px|leftFig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} {{man label|Config}} tab Example]]
The {{man label|Config}} preferences tab allows modification of some basic functionality of the Network Chart addon.
==Prerequisites==
Network Chart requires the python Python networkx module to assist in selecting what to display and Graphviz via the pygraphviz module to generate the chart.
Requires the following to be installed (type pip3 if system default is still python 2):
===Troubleshooting===
You can check if networkx and pygraphviz installed correctly by starting python Python (type python3 if system default is still python 2) and attempt to import both packages[https://www.reddit.com/r/gramps/comments/5z1gtj/show_all_database_entries_in_a_graphical_report/deuym8w/] eg:
python3
===Performance===
Network Chart was intended created for smaller small databases or subsets and is extremely fast for charts with less than 1500 nodes. However, it can generate very large graphs in reasonable time and should be adequate for those large databases that do not change frequently. Some optimizations for large databases are done automatically. The Trim Groups selection is one. Another method to greatly decrease the time to generate a chart on a large database is to select Straight or Curved for the Graph Style on the {{man label|[[Addon:NetworkChart#Main|Main]]}} preferences tab. Reducing the number of nodes to graph via {{man label|[[Addon:NetworkChart#Trim|Trim]]}} and {{man label|[[Addon:NetworkChart#Highlight|Highlight]]}} tabs will reduce graph generation times. For example, if your database contains 65535 individuals and you trim or highlight to plot only 8191 individuals, it would take closer to 20 seconds to generate the chart (based on the following table). Some performance data is shown below for an Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz with 16GB of RAM and an SSD for storage.
{| class="wikitable" style="margin-left: auto; margin-right: auto;"
!colspan="67"|Network Chart Performance (times are HH:MM:SS)
|-
|!Data File|!# Individuals|!Graph Style|!Trim Groups|!SVG File Size|!Time to Generate!Computer
|-
|style="text-align:right;"|d03
|style="text-align:right;"|107.2MB
|style="text-align:right;"|00:51:04
|style="text-align:right;"|Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz with 16GB of RAM and an SSD for storage.
|-
|style="text-align:right;"|[https://www.tamurajones.net/GedFan.xhtml ENFAN16]
|style="text-align:right;"|95.6MB
|style="text-align:right;"|00:34:47
|style="text-align:right;"|Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz with 16GB of RAM and an SSD for storage.
|-
|style="text-align:right;"|[https://www.tamurajones.net/GedFan.xhtml ENFAN15]
|style="text-align:right;"|47.8MB
|style="text-align:right;"|00:07:42
|style="text-align:right;"|Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz with 16GB of RAM and an SSD for storage.
|-
|style="text-align:right;"|[https://www.tamurajones.net/GedFan.xhtml ENFAN14]
|style="text-align:right;"|23.8MB
|style="text-align:right;"|00:01:23
|style="text-align:right;"|Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz with 16GB of RAM and an SSD for storage.
|-
|style="text-align:right;"|[https://www.tamurajones.net/GedFan.xhtml ENFAN13]
|style="text-align:right;"|11.9MB
|style="text-align:right;"|00:00:20
|style="text-align:right;"|Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz with 16GB of RAM and an SSD for storage.
|-
|style="text-align:right;"|Royals ged
|style="text-align:right;"|4.4MB
|style="text-align:right;"|00:00:07
|style="text-align:right;"|Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz with 16GB of RAM and an SSD for storage.
|}
==Issues==
* Help button goes incorrectly to [https://gramps-project.org/wiki/index.php?title=Gramps_5.1_Wiki_Manual_Gramps_{{man version}}_Wiki_Manual_-_Reports#Network_Chart] instead of here.
*{{bug|11900}} ''[MacOS installers] Add prerequistes NetworkChart [Wontfix]
** To use chart on [[Mac_OS_X:Build_from_source:MacPorts|MacOS install: MacPorts]]'' version of Gramps.
*{{bug|10197}} ''Network Chart report'' Running report on second Family tree shows first family trees chosen Gramps id.
*{{bug|11471}} ''Network Graph Report Fails with networkx v2.x''
*{{bug|0013860}} [NetworkChart addon] Crashes [ KeyError: 1 ] - Fails on Gramps 6.0.x
==See Also==
3,146
edits

Navigation menu