Add WordClouds gramplet - #993
Conversation
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.
|
One unittest had warning: Another unittest popped up a WarningDialog. This could be Mac-specific as gexiv2 is built within the Mac bundle and is not in a separate pip package. Plz confirm that you do not see this on Linux/Win.
@dsblank - Plz confirm if I can merge these with these warnings. |
|
@GaryGriffin The deprecation warnings in I dug into the WarningDialog and it's not a WordClouds bug — it's core Gramps. Your read on it being Mac-specific was right — it's the classic Mac GExiv2-bundling gap, unrelated to this PR's code. For now: re-running with @eduralph — heads up, this also affects the new shared harness on gramps60: Safe to merge WordClouds as-is from my side. |

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.
wordcloudwidget.py— a Cairo/PangoWordCloudWidget(Gtk.DrawingArea)that lays out words with a spiral placement algorithm, sized and colored
by frequency.
slideroption.py— aSliderOption/GuiSliderOptionpair (aNumberOptionrendered as a slider + text entry), registered viaBasePluginManager.register_option()so no changes to Gramps core arerequired.
cloudgramplet.py— sharedCloudGrampletbase class handling thecommon 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_optionssupport) directly to Gramps core. This PRadapts that work into a self-contained addon instead, so it:
Given Name Word Cloud/GivenNameWordCloudGramplet,Surname Word Cloud/SurnameWordCloudGramplet,Place Word Cloud/PlaceWordCloudGramplet) that are distinct from the built-inGiven Name Cloud/Surname Cloudgramplets, to avoid any pluginregistration collision between the addon and the core gramplets of the
same name.
autosave_optionsinstant-apply behavior), since that required agrampletpane.pychange.Test plan
tests/test_imports.py— all modules import cleanly; each grampletclass is a proper
Grampletsubclass.tests/test_wordcloudwidget.py— font-size/color interpolation andbounding-box overlap helpers.
tests/test_slideroption.py—SliderOptionvalue/min/max/stepbehavior and
GuiSliderOptionwidget wiring (run underxvfb-run,since it needs a real display connection).
tests/test_cloudgramplet_logic.py—get_items()for eachgramplet against a real in-memory Gramps database, including the
filter_missingoption and backlink-based place filtering.running Gramps 6.1, verify word clicks navigate correctly and
options apply on Save.