Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/strictdoc_01_user_guide.sdoc
Original file line number Diff line number Diff line change
Expand Up @@ -3839,6 +3839,35 @@ A statistics generator is a class that iterates over the traceability index, col

[[/SECTION]]

[[SECTION]]
MID: 875c097b4da348938ed71de4b8e8e73b
TITLE: Document tree map screen

[TEXT]
MID: 36067f1c73c545fea0b2408b32ee8a9a
STATEMENT: >>>
The Document Tree Map screen, or simply Tree Map, provides a visualization of the document tree and of requirements coverage by source files and tests.

The feature can be activated as follows:

.. code-block::

[project]
title = "My project"

features = [
"TREE_MAP_SCREEN"
]

The feature has experimental status because it has only been tested against StrictDoc's own documentation. Several questions still remain to be answered:

- How to allow users to customize this screen with their own additional visualizations.
- How to allow users to customize rules for color-coding the document nodes.
- How should the traceability mechanics work when there are multiple levels of requirements and a given requirement can reference either source files or child requirements.
<<<

[[/SECTION]]

[[SECTION]]
MID: aa7ebc36cd2947ac9aa293d6c76d8848
UID: SECTION-UG-Diff-changelog-screen
Expand Down
14 changes: 14 additions & 0 deletions docs/strictdoc_04_release_notes.sdoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ STATEMENT: >>>
This document maintains a record of all changes to StrictDoc since November 2023. It serves as a user-friendly version of the changelog, complementing the automatically generated, commit-by-commit changelog available as GitHub releases: `StrictDoc Releases <https://github.com/strictdoc-project/strictdoc/releases>`_.
<<<

[[SECTION]]
MID: 9e294d6a047b42bf8c55c090fb685b4a
TITLE: Unreleased

[TEXT]
MID: ab6e1c508d224bf1bfb303a808f33f9f
STATEMENT: >>>
This release contains a new feature and several bug fixes.

A new experimental screen, Tree Map, provides visualizations of the overall document tree as well as requirements coverage by source files and tests. The visualization is based on a tree map graph generated using Plotly.js.
<<<

[[/SECTION]]

[[SECTION]]
MID: 27d526d90cda48dfa5cbf17df88299ba
TITLE: 0.12.1 (2025-09-18)
Expand Down
25 changes: 25 additions & 0 deletions docs/strictdoc_21_L2_StrictDoc_Requirements.sdoc
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,31 @@ RELATIONS:

[[/SECTION]]

[[SECTION]]
MID: d84e3a79b3e443cabe96d7c18ea5d322
TITLE: Screen: Document tree map

[REQUIREMENT]
MID: 1520fa85ed7a4f1aa80c49ed858f402f
UID: SDOC-SRS-157
STATUS: Active
TITLE: Tree map
STATEMENT: >>>
StrictDoc shall provide a tree map screen, visualizing the following information:

- Document tree map
- Requirements coverage by source code
- Requirements coverage by test files.
<<<
RATIONALE: >>>
Enables the visualization and browsing of the overall document tree and requirements coverage information.
<<<
RELATIONS:
- TYPE: Parent
VALUE: SDOC-SSS-29

[[/SECTION]]

[[SECTION]]
MID: 14ad600308434e6baaeef02d3e90b720
TITLE: Screen: Traceability matrix
Expand Down
9 changes: 8 additions & 1 deletion strictdoc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ features = [

# Experimental features.
"PROJECT_STATISTICS_SCREEN",
"TREE_MAP_SCREEN",

# "REQIF",
# "STANDALONE_DOCUMENT_SCREEN",
"TRACEABILITY_MATRIX_SCREEN",
Expand All @@ -26,7 +28,6 @@ features = [
"HTML2PDF",
"DIFF",
"NESTOR",
"TREEMAP_SCREEN",
]

include_doc_paths = [
Expand All @@ -48,6 +49,7 @@ include_source_paths = [
"tests/integration/**itest",
"tests/unit/**.py",
"tests/unit_server/**.py",
"tests/end2end/**.py",
"tasks.py",
"pyproject.toml",
]
Expand All @@ -56,9 +58,14 @@ exclude_source_paths = [
# StrictDoc (almost never) uses __init__ files.
# The used files will be whitelisted include_source_paths.
"**__init__.py",
"**.test.py",
"build/**",
"output/**",
"tests/unit/*.py",
"tests/unit/helpers/*.py",
"tests/integration/**ignored.itest",
"tests/end2end/*.py",
"tests/end2end/helpers/*.py",
]

test_report_root_dict = [
Expand Down
2 changes: 1 addition & 1 deletion strictdoc/backend/sdoc/models/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def is_requirement(self) -> bool:
return True

def is_normative_node(self) -> bool:
return not self.is_text_node()
return self.node_type not in ("SECTION", "TEXT")

def is_text_node(self) -> bool:
return self.node_type == "TEXT"
Expand Down
2 changes: 1 addition & 1 deletion strictdoc/backend/sdoc/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def process_requirement(self, requirement: SDocNode) -> None:
self.parse_context.context_document_reference
)

if requirement.node_type not in ("SECTION", "TEXT"):
if requirement.is_normative_node():
self.parse_context.document_has_requirements = True

cursor: Union[SDocDocumentIF, SDocSectionIF, SDocNodeIF] = (
Expand Down
4 changes: 2 additions & 2 deletions strictdoc/core/project_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ProjectFeature(str, Enum):
REQIF = "REQIF"
DIFF = "DIFF"
PROJECT_STATISTICS_SCREEN = "PROJECT_STATISTICS_SCREEN"
TREEMAP_SCREEN = "TREEMAP_SCREEN"
TREE_MAP_SCREEN = "TREE_MAP_SCREEN"
STANDALONE_DOCUMENT_SCREEN = "STANDALONE_DOCUMENT_SCREEN"
TRACEABILITY_MATRIX_SCREEN = "TRACEABILITY_MATRIX_SCREEN"
REQUIREMENT_TO_SOURCE_TRACEABILITY = "REQUIREMENT_TO_SOURCE_TRACEABILITY"
Expand Down Expand Up @@ -368,7 +368,7 @@ def is_activated_requirements_coverage(self) -> bool:
)

def is_activated_tree_map(self) -> bool:
return ProjectFeature.TREEMAP_SCREEN in self.project_features
return ProjectFeature.TREE_MAP_SCREEN in self.project_features

def is_activated_standalone_document(self) -> bool:
return (
Expand Down
6 changes: 5 additions & 1 deletion strictdoc/features/tree_map/generator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
"""
TBD
Generate HTML graphs with documentation tree information.

Uses Plotly.js for generating tree map graphs.

@relation(SDOC-SRS-157, scope=file)
"""

import os
Expand Down
4 changes: 4 additions & 0 deletions strictdoc/features/tree_map/helpers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
@relation(SDOC-SRS-157, scope=file)
"""

from typing import Optional


Expand Down
4 changes: 4 additions & 0 deletions strictdoc/features/tree_map/plotly_js.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
@relation(SDOC-SRS-157, scope=file)
"""

from markupsafe import Markup

PLOTLY_JS_EXTENSION = Markup("""
Expand Down
4 changes: 4 additions & 0 deletions strictdoc/features/tree_map/view_object.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
@relation(SDOC-SRS-157, scope=file)
"""

from markupsafe import Markup

from strictdoc import __version__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def test(self):
screen_source_coverage.assert_on_screen()

screen_source_coverage.assert_contains_text("strictdoc.toml")
screen_source_coverage.assert_contains_text("file.py")
screen_source_coverage.assert_contains_text("file.test.py")

screen_source_file_coverage: Screen_SourceFileCoverage = (
screen_source_coverage.do_click_on_file("file.py")
screen_source_coverage.do_click_on_file("file.test.py")
)
screen_source_file_coverage.assert_on_screen()
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
title = "Test project"

features = [
"TREEMAP_SCREEN"
"TREE_MAP_SCREEN"
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
@relation(SDOC-SRS-155, scope=file)
@relation(SDOC-SRS-157, scope=file)
"""

import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
title = "Test project"

features = [
"TREEMAP_SCREEN"
"TREE_MAP_SCREEN"
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
@relation(SDOC-SRS-155, scope=file)
@relation(SDOC-SRS-157, scope=file)
"""

import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
title = "StrictDoc Documentation"

features = [
"TREEMAP_SCREEN",
"TREE_MAP_SCREEN",
]
Loading