Family line graph: limit number of generations

The Family Lines graph is very nice to present a synthetic view on data and this what people not looking for detailed information expect.

There are two boxes to limit the number of ancestors and descendants in the People of Interest tab.

Using the Ancestor parameter is easy: since you have at most 2 biological parents (I put aside the hopefully rare situation of “legal” relationship), you can predict how many generations will be in the final graph ( ancestors <= 2generations).

I have not found how to display exhaustively members of n descendant generations.

Families have a variable number of children and persons are kept in the order in which they are met in the DB. Consequently, “parallel” lines have different number of generations and families may be truncated if children are beyond the person threshold.

Is there a reliable way to draw generation-limited family lines?

If you have suggestions, I do accept to dive into the code to try and implement ideas. However, I fear the chore issue requires some kind of sorting in the DB (and this could lead to a performance disaster already on moderate DBs – mine has already 6k+ persons and roughly 2k+ families.). Another possibility is a tree traversal algorithm which is nice in memory but probably very slow across a DB).

While having Perplexity examine the code for another Family Lines Graph idiosyncrasy also asked about:

  • The Person of Interest (POI) had 13 children and all 13 were graphed despite a specified limit of 10 descendants. (Test case was “Zieliński, Phoebe Emily (Garner)” from the example.gramps test tree.)

Perplexity AI replied:

The descendant limit is weak

The child-search code also uses a global queue-length check, not a hard cap on the final number of descendants. The relevant pattern is the same as for parents: it compares the number of queued/included people against maxchildren, but it does not stop immediately after exactly 10 children are collected.

So if the code has already queued children before the limit check trips, or if those children are discovered through different families after the check, you can end up with more than 10 descendants in the graph. In practice, that makes the option behave more like an early pruning hint than a strict final-count limit.

What this means

So, in your example:

  • A POI with 13 descendants despite a limit of 10 is consistent with the current implementation being an imperfect global queue-based limit rather than a strict descendant cap.

There is this PR: Enhance FamilyLines Graph Report to Limit the anscestors and descendants By Count or Generation by dave-khuon · Pull Request #2480 · gramps-project/gramps · GitHub

Is that what you need?

I’ll give a look, thanks

Just tested and the generations option works great and displays all family branches.