PHPackages                             magicsunday/webtrees-statistics - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. magicsunday/webtrees-statistics

ActiveWebtrees-module[Admin Panels](/categories/admin)

magicsunday/webtrees-statistics
===============================

SVG statistics dashboard module for the webtrees genealogy application — six themed tabs of interactive D3.js charts (donut, bar, sankey, population pyramid, world map and more).

1.8.4(2w ago)742[6 issues](https://github.com/magicsunday/webtrees-statistics/issues)[1 PRs](https://github.com/magicsunday/webtrees-statistics/pulls)GPL-3.0-or-laterPHPPHP 8.3 - 8.5CI passing

Since May 26Pushed 2w ago2 watchersCompare

[ Source](https://github.com/magicsunday/webtrees-statistics)[ Packagist](https://packagist.org/packages/magicsunday/webtrees-statistics)[ Fund](https://paypal.me/magicsunday)[ RSS](/packages/magicsunday-webtrees-statistics/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (40)Versions (19)Used By (0)

[![Latest version](https://camo.githubusercontent.com/cfc3a9a7e7126c448832ef9119320ef775810fb14ba34eafbf69c504bda4d207/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6d6167696373756e6461792f77656274726565732d737461746973746963733f736f72743d73656d766572)](https://github.com/magicsunday/webtrees-statistics/releases/latest)[![License](https://camo.githubusercontent.com/1c7d7671effd64df0ad09c2aa87a73bfaf614a8ec5e72dbe870c8635b57bb1ce/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d47504c2d2d332e302d2d6f722d2d6c617465722d626c75652e737667)](https://github.com/magicsunday/webtrees-statistics/blob/main/LICENSE)[![CI](https://github.com/magicsunday/webtrees-statistics/actions/workflows/ci.yml/badge.svg)](https://github.com/magicsunday/webtrees-statistics/actions/workflows/ci.yml)

- [Statistics](#statistics)
    - [Installation](#installation)
        - [Manual installation](#manual-installation)
        - [Using Composer](#using-composer)
        - [Using Git](#using-git)
    - [Update](#update)
    - [Configuration](#configuration)
    - [Usage](#usage)
    - [Troubleshooting](#troubleshooting)
    - [Development](#development)

Statistics
==========

[](#statistics)

This module provides a six-tab statistics dashboard for the [webtrees](https://www.webtrees.net) genealogy application. Above the tabs a dark hero strip carries the tree title and six headline metrics; the tabs themselves group cards thematically per topic (Overview, Names, Life span, Family, Places, Tree health) and render their data through donut / line / bar / stacked / population-pyramid / chord / sankey / stream / world-map / name-bubbles / month-radial / mirror-histogram / gauge / box-plot / heatmap / treemap / event-timeline widgets from the shared [`@magicsunday/webtrees-chart-lib`](https://github.com/magicsunday/webtrees-chart-lib).

Installation
------------

[](#installation)

Requires **webtrees 2.2** and **PHP 8.3** or later.

### Manual installation

[](#manual-installation)

Important

**Download the right `.zip` file.** Each [GitHub release](https://github.com/magicsunday/webtrees-statistics/releases/latest) page lists two kinds of archive:

- ✅ **`webtrees-statistics.zip`** — listed under **Assets** at the bottom of the release. This is the install-ready archive: it bundles the required `vendor/` dependencies (such as `webtrees-module-base`).
- ❌ **"Source code (zip)" / `webtrees-statistics-.zip`** — auto-generated by GitHub from the tag. This is the raw source *without* bundled dependencies. Uploading it to `modules_v4/` will fail with `Trait/Interface "MagicSunday\Webtrees\ModuleBase\…" not found`.

**Always pick the asset zip, never "Source code (zip)".**

Important

**If a previous version of this module is already installed:** delete the entire `modules_v4/webtrees-statistics` folder *before* extracting the new ZIP. Extracting on top of an existing folder leaves stale files behind that can clash with the new release — a common cause of `Interface … not found` errors right after an update.

1. Open the [latest release](https://github.com/magicsunday/webtrees-statistics/releases/latest) page.
2. Under **Assets**, download `webtrees-statistics.zip`.
3. Upload the `.zip` file to your web server.
4. Unzip the package into your `modules_v4` directory.
5. Rename the folder to `webtrees-statistics`.

You should now see a `modules_v4/webtrees-statistics` directory containing the module files.

### Using Composer

[](#using-composer)

Run the following command from the root of your webtrees installation:

```
composer require magicsunday/webtrees-statistics --update-no-dev
```

The module will automatically install into the `modules_v4` directory.

To remove the module:

```
composer remove magicsunday/webtrees-statistics --update-no-dev
```

If you are using the development version of webtrees (`main` branch):

```
composer require magicsunday/webtrees-statistics:dev-main --update-no-dev
```

### Using Git

[](#using-git)

Clone the repository into your `modules_v4` directory (a *Code → Download ZIP* of the source works the same way):

```
git clone https://github.com/magicsunday/webtrees-statistics.git modules_v4/webtrees-statistics
```

A source checkout contains the module code **only** — it does **not** include the shared `webtrees-module-base` library, so on its own it fails with `Trait "MagicSunday\Webtrees\ModuleBase\…" not found`. Supply that library in one of two ways:

**Way A — drop-in (no code change).** Download [`webtrees-module-base`](https://github.com/magicsunday/webtrees-module-base) and copy its `src/` to the location this module's `module.php` already expects:

```
modules_v4/webtrees-statistics/vendor/magicsunday/webtrees-module-base/src/…

```

**Way B — shared copy (one edit).** Place `webtrees-module-base` next to this module in `modules_v4/` (rename the extracted folder to `webtrees-module-base`), then point this module's `module.php` at it. A single shared copy then serves every magicsunday module installed this way:

```
// modules_v4/webtrees-statistics/module.php
$loader->addPsr4(
    'MagicSunday\\Webtrees\\ModuleBase\\',
    __DIR__ . '/../webtrees-module-base/src'
);
```

Important

Both ways are overwritten by every module update, so you must redo them after each upgrade. For a maintenance-free install **without** Composer, use the [asset zip](#manual-installation) (it bundles all dependencies). Inside a **Composer-managed** webtrees, prefer `composer require magicsunday/webtrees-statistics:dev-main`— see [Using Composer](#using-composer).

Update
------

[](#update)

To update to the latest version:

- **Manual installation**: From the [latest release](https://github.com/magicsunday/webtrees-statistics/releases/latest) **Assets** section, download `webtrees-statistics.zip` (not "Source code (zip)"), **delete the old `modules_v4/webtrees-statistics` folder first**, and extract the new one. Extracting on top of an existing folder leaves stale files behind that can clash with the new release (a common cause of `Interface … not found` errors after an update).
- **Composer**: Run `composer update magicsunday/webtrees-statistics --update-no-dev`.
- **Git**: Run `git pull` inside the `modules_v4/webtrees-statistics` directory, then re-apply your source step (see [Using Git](#using-git)).

Configuration
-------------

[](#configuration)

1. Go to the **Control Panel** (admin section) of your webtrees installation.
2. Scroll down to the **Modules** section and click on **Charts** (under Genealogy).
3. Enable the **Statistics** module. Optionally disable the built-in statistics chart to avoid the menu carrying both.
4. Click **Save**.

Usage
-----

[](#usage)

Open the **Charts** menu on any tree page and select **Statistics**.

The module renders six tabs that aggregate tree-wide data into widget cards:

TabWhat it shows**Overview**Demographics (sex / living / marital donuts), cumulative tree growth over time, top occupations and religions, father → son occupation-inheritance sankey, tree-records hall-of-fame**Names**Surname / male / female name bubbles, given-name popularity stream graph, same-sex name passdown, surname × surname marriage chord matrix**Life span**Births by century / month / zodiac, age-at-death bands + boxplot per century, living life-stages, lifespan by sex × century, survival curve, top-10 oldest deceased and living, deaths by century / month, winter-peak score, death causes, child mortality (under 5) + peak century, mortality-outlier years, same-year sibling deaths, births / deaths by 25-year period × month heatmaps**Family**Age at marriage M+F, marriage duration, couple age gap, weddings by century / month, age at first child + mean by decade, first children by month, children per family, sibling age gap, family-size composition by decade, average family size, multiple-birth rate, childless donut, top-10 largest families, top-10 by grandchildren, sex-ratio anomalies, divorce cohort rate, divorces by month / century / age band, widowhood interval, mourning period, shortest &amp; longest marriages**Places**Birth / residence / death countries with top-10 list and choropleth world map, birth → death migration sankey, geographic dispersion, distinct-places-per-individual and migration-distance metrics**Tree health**Core-vs-enrichment data-set inventory + media files by type, source-citation coverage (tree-wide + per birth century), pedigree completeness, average generation length, missing-event gaps, max generation depth + distribution, known-ancestors distribution, endogamy rate, most-influential ancestors, largest unconnected sub-trees, tree typeThe marital-status donut counts each living individual exactly once — precedence follows the same per-family decision order webtrees core uses in `\Fisharebest\Webtrees\Census\AbstractCensusColumnCondition`: an active divorce tag classes the survivor as `divorced`, a deceased partner as `widowed`, an active marriage with a living partner as `current`. Anything else falls into `single`.

The dashboard ships with light- and dark-mode visuals; the module reads `data-bs-theme` on the `` element, so themes that toggle dark mode automatically style the charts too.

Troubleshooting
---------------

[](#troubleshooting)

**Fatal error after a manual installation or update: `Trait/Interface "MagicSunday\Webtrees\ModuleBase\…" not found` (or `ModuleAssetUrlInterface not found`)**

- You probably downloaded the GitHub-generated **"Source code (zip)"** (or used *Code → Download ZIP*) instead of the install-ready asset **`webtrees-statistics.zip`**. The asset bundles the required `vendor/` dependencies; the source zip does not. Open the [latest release](https://github.com/magicsunday/webtrees-statistics/releases/latest), scroll to **Assets**, download `webtrees-statistics.zip`, and re-extract.
- If you used the asset zip, make sure you **deleted the previous `modules_v4/webtrees-statistics` folder before extracting**. Stale files from an older version can shadow the new bundled vendor code and produce the same error.

**The Statistics menu entry is missing**

- Make sure the module is enabled in the Control Panel under Modules &gt; Charts.
- Check that your PHP version is 8.3 or later.

**Charts do not render / tabs are empty**

- Clear your browser cache and reload the page.
- Open the browser developer console — a missing widget bundle usually surfaces as a `MIME type` or `404` error on `/index.php?route=…&asset=js/statistics-.min.js`.

**The world map shows every country in the empty colour**

- Make sure the tree's place data carries a recognisable country in the last place segment — the world-map widget matches it across nine pre-seeded locales plus the active webtrees language. Full country names (in any of those languages), ISO-3166-1 alpha-2 codes (`DE`) and alpha-3 codes (`DEU`), common abbreviations (`USA`, `UK`), and the UK home nations (`ENG`/`SCT`/`WLS`/`NIR`) all resolve; unmatched labels fall back to the empty fill.

Development
-----------

[](#development)

This section is for developers who want to contribute to the module.

### Building JavaScript

[](#building-javascript)

Using Docker (no local Node.js required):

```
make install
make build
```

Using local Node.js:

```
npm install
npm run prepare
```

### Running tests

[](#running-tests)

```
# JavaScript tests
npm test

# Full PHP + JS quality check
composer update
composer ci:test
```

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance79

Regular maintenance activity

Popularity10

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 96.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

17

Last Release

18d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1979dde7200fccc0e21e18a29b5566f22fa01ad104e577254fe74e14ae04a297?d=identicon)[magicsunday](/maintainers/magicsunday)

---

Top Contributors

[![magicsunday](https://avatars.githubusercontent.com/u/564393?v=4)](https://github.com/magicsunday "magicsunday (523 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (12 commits)")[![TheDutchJewel](https://avatars.githubusercontent.com/u/46184729?v=4)](https://github.com/TheDutchJewel "TheDutchJewel (4 commits)")[![Gustine](https://avatars.githubusercontent.com/u/5450774?v=4)](https://github.com/Gustine "Gustine (1 commits)")

---

Tags

chartd3d3jsdashboarddata-visualizationfamily-treegenealogymodulestatisticssvgvisualizationwebtreeswebtrees-modulesvgmoduledashboardchartstatisticsd3.jsdata visualizationvisualizationd3genealogywebtreesFamily-tree

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/magicsunday-webtrees-statistics/health.svg)

```
[![Health](https://phpackages.com/badges/magicsunday-webtrees-statistics/health.svg)](https://phpackages.com/packages/magicsunday-webtrees-statistics)
```

###  Alternatives

[unclecheese/dashboard

Adds a dashboard to the SilverStripe CMS

4642.3k1](/packages/unclecheese-dashboard)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
