Skip to content
Emmanuel Briot edited this page Aug 25, 2016 · 1 revision

Geneaprove includes a powerful highlighting feature. By writing some rules (currently as a python datastructure, there will one day be a parser and you can modify from the web client directly), you can change the style used to display each person, based on various criterias.

For instance, you can easily highlight the persons that died at a young age, or chose a different background color for males and females. You can also provide a different highlighting for the persons that are in your own tree (so that for instance your uncles and aunts are not highlighted the same way as your parents, which makes navigation in the pedigree view much easier).

On the side is is a brief screenshot of the legend displayed in the pedigree view. The rules and styles are the ones I am using for my tests, and can be fully modified.

This feature is inspired by The Master Genealogist's accents feature, although I believe it is more powerful and flexible.

Here are some of the corresponding rules (in python), as described in the file geneaprove/views/custom_highlight.py. Currently, you need to modify the python sources to change the rules.

from geneaprove import models
from geneaprove.views.styles import *

style_rules = [
    ("Persons that are alive",
     RULE_ATTR,
     [("ALIVE", RULE_IS, "Y")],
     {"font-weight": "bold"}),

    ("Born or dead in La Baussaine before 1862",
     RULE_EVENT,
     [("type",  RULE_IN,         (models.Event_Type.birth,
                                  models.Event_Type.death)),
      ("place.name", RULE_CONTAINS_INSENSITIVE, "baussaine"),
      ("role",  RULE_IS,         models.Event_Type_Role.principal),
      ("date",  RULE_BEFORE,     "1862")],
     {"color": "rgb(200,0,0)", "stroke": "black"}),

    ("Died younger than 60",
     RULE_EVENT,
     [("type", RULE_IS, models.Event_Type.death),
      ("role", RULE_IS, models.Event_Type_Role.principal),
      ("age",  RULE_SMALLER_EQUAL, 60)],
     {"color": "blue"}),

    ("Person's age today is more than 80, and is alive",
     RULE_ATTR,
     [("age",   RULE_GREATER, 80),
      ("ALIVE", RULE_IS,      "Y")],
     {"color": "orange"}),

    ("Foreign people in different color",
     RULE_EVENT,
     [("type", RULE_IS, models.Event_Type.birth),
      ("role", RULE_IS, models.Event_Type_Role.principal),
      ("place.country", RULE_IS_NOT, ""),
      ("place.country", RULE_CONTAINS_NOT_INSENSITIVE, "france")],
     {"fill": "#AAAAAA"}),

    ("Person's with more than one marriage",
     RULE_EVENT,
     [("type",  RULE_IS, models.Event_Type.marriage),
      ("role",  RULE_IS, models.Event_Type_Role.principal),
      ("count", RULE_GREATER, 1)],
     {"fill": "rgb(0,155,0)"}),

    ("PROBLEM: Persons too young at birth of child",
     RULE_EVENT,
     [("type", RULE_IS, models.Event_Type.birth),
      ("role", RULE_IN, (models.Event_Type_Role.birth__father,
                         models.Event_Type_Role.birth__mother)),
      ("age",  RULE_SMALLER, 17)],
     {"fill": "red"}),

    ("PROBLEM: Persons too old at death",
     RULE_EVENT,
     [("type", RULE_IS, models.Event_Type.death),
      ("role", RULE_IS, models.Event_Type_Role.principal),
      ("age",  RULE_GREATER, 110)],
     {"fill": "red"}),

    ("If the person appears multiple time in the current tree",
     RULE_ATTR,
     [("IMPLEX", RULE_GREATER, 1)],
     {"fill": "yellow"}),

    ("All male ancestors of person id=1",
     RULE_ATTR,
     [("ancestor", RULE_IS, 1), ("SEX", RULE_IS, "M")],
     {"fill": "#D6E0EA", "stroke": "#9CA3D4"}),

    ("All female ancestors of person id=1",
     RULE_ATTR,
     [("ancestor", RULE_IS, 1), ("SEX", RULE_IS, "F")],
     {"fill": "#E9DAF1", "stroke": "#fF2080"}),

    ("All male descendants of person id=1",
     RULE_ATTR,
     [("descendant", RULE_IS, 1), ("SEX", RULE_IS, "M")],
     {"fill": "#D6E0EA", "stroke": "#9CA3D4"}),

    ("All female descendants of person id=1",
     RULE_ATTR,
     [("descendant", RULE_IS, 1), ("SEX", RULE_IS, "F")],
     {"fill": "#E9DAF1", "stroke": "#fF2080"}),

    ("Unknown father",
     RULE_ATTR,
     [("UNKNOWN_FATHER", RULE_IS, "Y")],
     {"color": "violet"}),

    ("Unknown mother",
     RULE_ATTR,
     [("UNKNOWN_MOTHER", RULE_IS, "Y")],
     {"color": "violet"}),

    ("Person's name is Delamote (case insensitive)",
     RULE_ATTR,
     [("surname", RULE_IS_INSENSITIVE, "delamotte")],
     {"color": "green"}),
]
Clone this wiki locally