Skip to content

feat: larger verification report pies - #979

Open
antonkri wants to merge 8 commits into
mainfrom
feat/report-pie-size
Open

antonkri wants to merge 8 commits into
mainfrom
feat/report-pie-size

Conversation

@antonkri

@antonkri antonkri commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

📌 Description

The pie charts in the module and platform verification reports render very small, especially three per row on high-resolution screens. Sphinx-Needs draws every needpie at a fixed figsize=(8, 4) with the legend to the right, so the circle covers only ~35% of the image width; the rest is blank space that looks like a gap between the charts.

This PR re-lays out only the report pies, so the circle fills ~60% of its column (about 1.7x larger) and the slice numbers become much larger while a row keeps three pies:

  • _SafetyPieRow emits a two-line chart title (<component/feature> <subject> / <chart> (<safety class>)). A continuation line of the directive argument keeps its newline.
  • score_sphinx_needs_templates wraps save_matplotlib_figure of the needpie module. Figures whose title ends in one of the report chart lines (Status, Test Coverage, Reference Coverage + safety class) are re-laid out as a 5x4 inch chart showing only the title and the slice numbers: no legend and no slice labels, because both reports explain the slice colours once at the top of the page ("Legend — status values and chart colours"). Percentages and counts are 14pt bold, the title 13pt and wraps at the figure border. This also works where a project patches Axes.legend away (reference_integration does). Trade-off: slices below 5% carry no number (Sphinx-Needs hides it to avoid overlaps), and without the legend their count is no longer shown.
  • Every other needpie and all needbar charts stay untouched. This addresses why the earlier global legend patch was reverted in feat: split module report pies into ASIL and QM #946.
  • The empty-class placeholders use the same 4:3 aspect ratio.

Preview: eclipse-score/reference_integration#396

🚨 Impact Analysis

  • This change does not violate any tool requirements and is covered by existing tool requirements
  • This change does not violate any design decisions
  • Otherwise I have created a ticket for new tool qualification

✅ Checklist

  • Added/updated documentation for new or changed features
  • Added/updated tests to cover the changes
  • Followed project coding standards and guidelines

Split each report pie title into two lines and crop the now blank left 13% of the needpie image, so the charts grow by 15% while a row keeps three pies.
@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview for this pull request is available at:
pr-979: https://eclipse-score.github.io/docs-as-code/pr-979/

Sphinx-Needs draws every needpie at 8x4 inches with the legend beside it, so the circle covers only ~35% of the image width. Re-lay out only the pies written by safety_pie_row (recognised by their two-line title) as a 5x6 inch portrait chart with the legend underneath and without the duplicate slice labels. The circle now fills ~80% of its column. The CSS crop of the previous commit is dropped; other needpie charts stay untouched.
@antonkri antonkri changed the title feat: larger verification report pies via two-line titles feat: larger verification report pies Oct 16, 2026
antonkri and others added 6 commits October 16, 2026 11:01
Shrink the report pie circle from ~80% to ~60% of its column and set the percentages and counts inside the slices to 17pt bold, the legend to 12pt and the title to 13pt, so the numbers read well three charts per row.
reference_integration patches matplotlib's Axes.legend to a no-op, so report pies arrive without a legend and were left with 8pt numbers. Recognise the slice values by their Sphinx-Needs format and enlarge them regardless; slice labels stay visible when there is no legend to repeat them.
Both verification reports explain the slice colours once at the top of the page, so the per-chart legend and the slice labels only cost space. Report pies now show the two-line title and the enlarged slice numbers in a 5x4 inch figure, also where a project patches Axes.legend away.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Removing category labels makes chart interpretation depend solely on colour, introducing an accessibility regression.

1 open finding
What changed in this PR

Enlarges verification-report pie charts while targeting the layout changes to report-specific titles.

Changes:

  • Adds two-line titles and compact charts with larger slice numbers.
  • Removes chart legends and slice labels; adjusts empty placeholders.
  • Adds tests for report-chart detection and layout behavior.
File Description
src/​needs_templates/​platform_verification_report.need Changes placeholder aspect ratio to 4:3.
src/​needs_templates/​module_verification_report.need Changes placeholder aspect ratio to 4:3.
src/​extensions/​score_sphinx_needs_templates/​tests/​test_needs_templates.py Tests titles, layout, and unrelated-chart preservation.
src/​extensions/​score_sphinx_needs_templates/​__init__.py Generates multiline titles and applies report-specific chart layouts.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +508 to +509
else:
text.set_visible(False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants