Skip to content

Add WordClouds gramplet#993

Open
dsblank wants to merge 1 commit into
gramps-project:maintenance/gramps61from
dsblank:add-wordclouds-gramplet
Open

Add WordClouds gramplet#993
dsblank wants to merge 1 commit into
gramps-project:maintenance/gramps61from
dsblank:add-wordclouds-gramplet

Conversation

@dsblank

@dsblank dsblank commented Jul 19, 2026

Copy link
Copy Markdown
Member

Summary

Adds three word-cloud gramplets — Given Name Word Cloud, Surname Word
Cloud
, and Place Word Cloud — that render names/places as a
size-weighted, click-to-navigate word cloud instead of the old plain-text
link list.

Screenshot from 2026-07-19 09-33-52
  • wordcloudwidget.py — a Cairo/Pango WordCloudWidget (Gtk.DrawingArea)
    that lays out words with a spiral placement algorithm, sized and colored
    by frequency.
  • slideroption.py — a SliderOption/GuiSliderOption pair (a
    NumberOption rendered as a slider + text entry), registered via
    BasePluginManager.register_option() so no changes to Gramps core are
    required
    .
  • cloudgramplet.py — shared CloudGramplet base class handling the
    common option set (top-N count, colors, layout quality, filter
    missing/unknown values) and word-cloud wiring.
  • givennamewordcloudgramplet.py, surnamewordcloudgramplet.py,
    placewordcloudgramplet.py — the three concrete gramplets.

This is based on ideas from ClmntPnd's Gramps core PR
gramps-project/gramps#2223,
which added the WordCloudWidget-based rendering (including a Place Cloud
gramplet and autosave_options support) directly to Gramps core. This PR
adapts that work into a self-contained addon instead, so it:

  • Works with unmodified, current stable Gramps releases (no core patches).
  • Uses new gramplet ids/class names (Given Name Word Cloud /
    GivenNameWordCloudGramplet, Surname Word Cloud /
    SurnameWordCloudGramplet, Place Word Cloud /
    PlaceWordCloudGramplet) that are distinct from the built-in
    Given Name Cloud / Surname Cloud gramplets, to avoid any plugin
    registration collision between the addon and the core gramplets of the
    same name.
  • Uses the standard Save-button option flow (rather than the core-patched
    autosave_options instant-apply behavior), since that required a
    grampletpane.py change.

Test plan

  • tests/test_imports.py — all modules import cleanly; each gramplet
    class is a proper Gramplet subclass.
  • tests/test_wordcloudwidget.py — font-size/color interpolation and
    bounding-box overlap helpers.
  • tests/test_slideroption.pySliderOption value/min/max/step
    behavior and GuiSliderOption widget wiring (run under xvfb-run,
    since it needs a real display connection).
  • tests/test_cloudgramplet_logic.pyget_items() for each
    gramplet against a real in-memory Gramps database, including the
    filter_missing option and backlink-based place filtering.
  • Manual: install the addon, open each of the three gramplets in a
    running Gramps 6.1, verify word clicks navigate correctly and
    options apply on Save.

Adds three word-cloud gramplets (Given Name, Surname, Place) that render
names/places as a size-weighted, click-to-navigate word cloud instead of
the old plain-text link list, using a new Cairo/Pango WordCloudWidget with
a spiral placement algorithm. Includes a slider+entry option widget
(SliderOption/GuiSliderOption) registered via BasePluginManager.register_option
so no changes to Gramps core are required.

Based on ideas from ClmntPnd's gramps core PR
gramps-project/gramps#2223, adapted here as a
self-contained addon so it works with unmodified stable Gramps releases.
Given Name/Surname/Place Word Cloud use new ids and class names distinct
from the built-in Given Name Cloud / Surname Cloud gramplets to avoid any
plugin registration collision.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant