2727What You Get
2828------------
2929
30- With the ``docs(...) `` macro and ``score_metamodel `` extension enabled, your
30+ With the ``docs(...) `` macro and ``score_metamodel `` as well as the `` `score_metrics `` extensions enabled, your
3131repository can:
3232
3333- build an HTML dashboard from its own Sphinx needs,
@@ -40,30 +40,44 @@ Typical Setup
4040
4141For details, see :ref: `setup `.
4242
43- Minimal Configuration Example
44- -----------------------------
43+ Configuration
44+ -------------
45+
46+ Default Behavior (No Configuration Needed)
47+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48+
49+ By default, ``score_metrics `` autodiscovers requirement types from the
50+ repository needs present in the current build.
51+ Requirement types are identified from ``needs_types `` entries tagged with ``requirement ``.
52+
53+ This is the recommended setup for most repositories.
4554
46- In ``docs/conf.py ``:
55+ Optional Override for Requirement Types
56+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57+
58+ If a repository needs to force a specific set of requirement types, set an
59+ explicit override in ``docs/conf.py ``:
4760
4861.. code-block :: python
4962
50- score_metamodel_requirement_types = " feat_req,comp_req,aou_req"
51- score_metamodel_include_external_needs = False
63+ score_metrics_requirement_types = " feat_req,comp_req,aou_req"
64+
65+ When this setting is provided, the explicit list is used instead of
66+ autodiscovery.
5267
53- Use ``score_metamodel_include_external_needs = True `` only in repositories that
68+ Use ``score_metrics_include_external_needs = True `` only in repositories that
5469intentionally aggregate requirements across module dependencies, such as
55- integration repositories. Use ``False `` for module repositories to gate only on
56- local traceability.
70+ integration repositories.
5771
5872Building the Dashboard
5973----------------------
6074
61- After building/running any docs command (i.e. ``bazel build //:needs_json `` or ``bazel run //:docs_check `` are the fastest ):
75+ After building/running any docs and test command (i.e. ``bazel build //:needs_json `` or ``bazel run //:docs_check ``, `` bazel run //:docs ``, `` bazel test //... `` ):
6276
63- The documentation build writes ``metrics.json `` via ``score_metamodel ``, and the ``needs_json `` artifact contains:
77+ The documentation build writes ``metrics.json `` via ``score_metrics ``, and the ``needs_json `` artifact contains:
6478
65- - ``bazel-bin/needs_json/ _build/needs /needs.json ``
66- - ``bazel-bin/needs_json/ _build/needs /metrics.json ``
79+ - ``_build/needs.json ``
80+ - ``_build/metrics.json ``
6781
6882The dashboard charts and the CI gate both use the same computed metrics.
6983
@@ -87,13 +101,13 @@ There are two common modes:
87101
88102**Module repository **
89103
90- - Set `` score_metamodel_include_external_needs = False `` .
104+ - No setting needed. Local-only scope is the default .
91105- Gate only on the needs owned by the repository itself.
92106- Use this for per-module implementation progress and traceability.
93107
94108**Integration repository **
95109
96- - Set ``score_metamodel_include_external_needs = True ``.
110+ - Set ``score_metrics_include_external_needs = True ``.
97111- Aggregate requirements across module dependencies when that is the intended
98112 repository purpose.
99113- Use this for system or integration-level dashboards.
@@ -136,10 +150,75 @@ For a new consumer repository:
1361504. Introduce modest thresholds in CI.
1371515. Raise thresholds over time as the repository matures.
138152
139- Related Guides
140- --------------
153+ ..
154+ ╓ ╖
155+ ║ Some portions generated by Github Copilot ║
156+ ╙ ╜
157+
158+ Needpie Usage Guide (Quick and Practical)
159+ =========================================
160+
161+ Use these examples as ready-to-copy templates for dashboard-style pie charts.
162+
163+ Tips for readable charts
164+ ------------------------
165+
166+ - Keep labels short and audience-friendly.
167+ - Put the most important category first.
168+ - Use high-contrast colors that are easy to distinguish.
169+ - Avoid red/green-only combinations when possible.
170+
171+ Recommended color palette
172+ ~~~~~~~~~~~~~~~~~~~~~~~~~
173+
174+ This palette is generally easier to read:
175+
176+ - ``#4E79A7 `` (blue)
177+ - ``#F28E2B `` (orange)
178+ - ``#59A14F `` (green)
179+ - ``#B07AA1 `` (purple)
180+
181+ Example 1: Overall view (including remaining/unlinked)
182+ ------------------------------------------------------
183+
184+ .. code-block :: rst
185+
186+ .. needpie:: Overall Requirement Coverage
187+ :labels: Remaining (no selected links), With Test Link, With Code Link, Fully Linked
188+ :colors: #4E79A7, #F28E2B, #59A14F, #B07AA1
189+ :filter-func: score_metrics.sphinx_filters.get_metrics_with_first_value_total(overall_metrics:total,overall_metrics:with_test_link,overall_metrics:with_code_link,overall_metrics:fully_linked)
190+
191+ This chart shows:
192+
193+ - remaining requirements (calculated from total),
194+ - requirements with test link,
195+ - requirements with code link,
196+ - fully linked requirements.
197+
198+ .. needpie :: Overall Requirement Coverage
199+ :labels: Remaining (no selected links), With Test Link, With Code Link, Fully Linked
200+ :colors: #4E79A7, #F28E2B, #59A14F, #B07AA1
201+ :filter-func: score_metrics.sphinx_filters.get_metrics_with_first_value_total(overall_metrics:total,overall_metrics:with_test_link,overall_metrics:with_code_link,overall_metrics:fully_linked)
202+
203+ Example 2: Focused view (no total-based remainder)
204+ --------------------------------------------------
205+
206+ This chart shows direct values only (no remaining slice):
207+
208+ - tool requirements with test link,
209+ - tool requirements with code link,
210+ - overall fully linked requirements.
211+
212+ .. needpie :: Tool Requirements Snapshot
213+ :labels: Tool Req With Test Link, Tool Req With Code Link, Fully Linked (Overall)
214+ :colors: #F28E2B, #4E79A7, #59A14F
215+ :filter-func: score_metrics.sphinx_filters.get_just_metrics(metrics_by_type:tool_req: with_test_link,metrics_by_type:tool_req: with_code_link,overall_metrics:fully_linked)
216+
217+ Presentation checklist
218+ ----------------------
219+
220+ Before publishing, quickly verify:
141221
142- - :ref: `setup `
143- - :doc: `other_modules `
144- - :doc: `source_to_doc_links `
145- - :doc: `test_to_doc_links `
222+ - labels are understandable for non-technical readers,
223+ - colors are distinct and readable on your page theme,
224+ - title clearly says what the chart represents.
0 commit comments