Repository navigation
feat(histogram): wrap default titles and allow custom titles - #434
Merged
georgezakinih merged 6 commits intoNov 9, 2026
Merged
Conversation
zhan4329
marked this pull request as ready for review
November 9, 2026 04:16
Open
6 tasks
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the histogram title readability and customization changes.
No open issues 🎉
What changed in this PR
This PR improves Histogram title readability for SPAC_Shiny by splitting generated titles across lines and allowing custom titles through the template.
Changes:
- Move grouping or faceting details and filtering context onto a second title line.
- Support
Figure_Titleoverrides, with missing or None-like values falling back to generated titles. - Expand title tests and clarify group-filtering documentation.
| File | Description |
|---|---|
tests/templates/test_histogram_template.py |
Tests multiline titles, named tables, custom overrides, and None-like fallbacks. |
src/spac/visualization.py |
Clarifies the max_groups filtering docstring; no functional changes. |
src/spac/templates/histogram_template.py |
Adds custom titles, wraps generated titles, and documents filtering context. |
Review effort: Balanced
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
This PR separates grouping or faceting details and any filtering information in the default Histogram titles with a line break. The shortening is intended to improve title readability in SPAC_Shiny, as described in SPAC_Shiny issue #88. See the evidence section below for an example.
This PR also adds a configurable
Figure_Titleparameter to the Histogram template as an alternative solution for the long title issue. Users can now supply a custom title to override the title generated from the input parameters. Missing or None-like values, such as"None", fall back to the generated title. Note that a custom title replaces the filtering context in the default title, although filtering still produces a logged warning.The unit tests are updated to cover the new title behavior accordingly. The group filtering behavior is documented in the Histogram and template docstrings in case users choose custom titles.
Related Issue
Testing
python -m pytest -q -p no:cacheprovider tests/test_visualization/test_histogram.py tests/templates/test_histogram_template.py— 52 passed.git diff --check upstream/dev...HEAD— passed.Evidence
Before
Histogram before the title break.
After Wrapping
Histogram after the title break.
After Customizing
Histogram with a custom title; filtering information is not added automatically.
More comparisons
For additional grouped, filtered, and faceted comparisons, see the comparison page.