Skip to content

Commit

Permalink
fix: Fix-tree-view
Browse files Browse the repository at this point in the history
Merge pull request #74 from DSD-DBS/fix-tree-view
  • Loading branch information
ewuerger authored Feb 13, 2024
2 parents 605a6ea + de878b1 commit 5cb386e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion capellambse_context_diagrams/collectors/tree_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ def __init__(
self.legend_boxes: list[_elkjs.ELKInputChild] = []
self.all_associations = all_associations

def __contains__(self, uuid: str) -> bool:
objects = self.data["children"] + self.data["edges"] # type: ignore[operator]
return uuid in {obj["id"] for obj in objects}

def process_class(self, cls, params):
self._process_box(cls.source, cls.partition, params)

Expand Down Expand Up @@ -108,7 +112,9 @@ def _set_data_types_and_labels(
box["width"], box["height"] = makers.calculate_height_and_width(
list(box["labels"])
)
self.legend_boxes.extend(legends)
for legend in legends:
if legend["id"] not in self:
self.legend_boxes.append(legend)


def collector(
Expand Down
2 changes: 1 addition & 1 deletion docs/realization_view.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
~ SPDX-License-Identifier: Apache-2.0
-->

# 🔥Brand-new🔥 Tree View Diagram 🔥Brand-new🔥
# Tree View Diagram

With release
[`v0.5.42`](https://github.com/DSD-DBS/py-capellambse/releases/tag/v0.5.42) of
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ nav:
- Styling: extras/styling.md
- Tree View:
- Overview: tree_view.md
- Realization View:
- 🔥Realization View🔥:
- Overview: realization_view.md
- Code Reference: reference/

Expand Down

0 comments on commit 5cb386e

Please sign in to comment.