Add WordClouds gramplet#993
Open
dsblank wants to merge 1 commit into
Open
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.