PR #941 - Improved Age Stats gramplet

I have been working on an improved Age Stats gramplet in pull request #941.

See screenshot below:

It has similar functionality to the old gramplet. Hovering over a bar highlights it. Double clicking on a bar shows a quick report of the people within the selected range.

I have added an orange bar for values exceeding the maximum range set in the configuration. The chart also automatically resizes.

Any comments and suggestions are welcome.

Perhaps we should separate the charts into separate gramplets? Would some pie charts be useful?

3 Likes

Oh I like that! Do the age stats include living people, or just those with dates of death?

Phil.

The lifespan chart only includes people with a death event, but the parent-child age difference charts include living people.

This looks really great… No need to split the different charts, other than if its possible to print them, then i be a feature to have one chart on one page, or one chart printed to one image file… May be easier to usee in different presentation maybe, if they are separate…?

Wow! that’s a big improvement on the old text based chart!

One immediate thought… Could you break out separate “0” & “<1” rows? The Stillborn & Infant Mortality are typically stats that interest people.

Any chance you might create a re-usable routine to add QuickReport pop-up menu item to export the selected data to the body of a new ‘ToDo’ Note? …one where the export that preserves the hotlinks? If the current ‘copy’ clipboarded links in addition to plain text, it would provide a similar functionality. I know I’d love to be able whip up a pre-linked Note from the Pedigree or Deep Connections gramplet!

It wouldn’t have to save immediately… but that data opened in the Note Editor would make a nice working list that could be trimmed before saving.

1 Like

Thanks for this useful addon. Unfortunately, in my version 5.1.5 the statistics are still output as text but with special characters. How could one correct the statistic display?
Screenshot from 2022-11-02 16-45-27

You are still using the the original built-in or the manually patched version referenced above?

Your screen capture looks like a font mismatch. The original uses text to represent the bars. I’m not sure how the manually installed version draws those graphical bars.

I use the original addon with the following update URL:
https://raw.githubusercontent.com/gramps-project/addons/master/gramps51
I also think it’s a font issue, because when copying and pasting the text into a text editor, the characters suddenly become visible in a human-readable way.

That URL does not work for me.

Did you update all 3 (or 4 if you are using a non-english installation) core files listed in the commit?:

  • gramps/gui/widgets/__init__.py
  • gramps/gui/widgets/histogram.py
  • gramps/plugins/gramplet/agestats.py

Thank you very much for the feedback. I have updated/added the mentioned files manually and the plugin is working now. :slight_smile:

1 Like

Can the Age Stats data be affected by the Filter Gramplet or a Custom Filter?

It is more likely that Age Stats would be useful on a specific branch of population subset than on the undifferentiated population of the entire tree. For instance, Age Stats on a person’s ancestors (and possibly, their sibs) would be a useful predictive demographic.

1 Like

It reads the whole database at the moment. Perhaps we could apply a filter to all gramplets in the dashboard?

1 Like

That would be great!

I could never figure a use for things like Top Surnames or Related Relatives on a tree with tens of thousands of People.

What is the proper way to frame a Feature Request to make the Dashboard have a tree filter?

Filters would make large Tree statistics and visualizations much more actionable if the data could be limited to a single branch of Ascendants and/or Descendants. Or when comparing and contrasting those of 2 persons.

An inquiry about filtered statistics was posted to the Gramps Geneanet forum. That’s what prompted reviving this thread.

thanks in advance,
brian

Just open a feature request describing what type of filters you want and how the user should select them.

We could create a new view to experiment with the feature. I’m not sure if we would be able to use existing gramplets, or if we would need to create a new gramplet type. Perhaps the view could gather statistics that could be shared between multiple gramplets.

1 Like

One suggestion for this gramplet, when you dobule click an bar to show what people is in that statistic like this:

image

Wouldnt it be better if the person editor is opened if you double click the person, rather than having to right click and pressing See person details? Or is an reason why that isnt the case other than its not implemented?

Bonus:
Why is that “Filter matched 1 record” text a serif font when everything else is sans-serif?
(Font in settings is set to sans-serif)

1 Like

The Age Stats gramplet runs the Filter by Name quick view with a list of people. There is no change from the previous version.

The quick view menu options are consistent with the other quick views of this type.

The fonts are defined in a hard-coded style sheet, but I don’t see an entry for the default paragraph text. Perhaps we need to define the default.

Then change what I said to be aimed at the quick view/filter instead of this gramplet then.

I havent found any other place in Gramps where there is Serif font personally (Other than the Graph View no font selected thing in 5.2 but probably different thing)

I do have theme plugin if that matters.

This would make a good first issue for anyone wanting to help with Gramps development.

2 Likes

I assume the gramplet does not produce any stats for people in the db (or, when it gets implemented, tree) who do not have sufficient data to compute their age?

I think it would be useful to have at least the option of including the number and % of people who are in the db (or tree) but with insufficient data.