Skip to content

Commit

Permalink
refactor: Simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
ewuerger committed Apr 26, 2024
1 parent 0fb62fe commit 5e1a2b6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 35 deletions.
4 changes: 2 additions & 2 deletions capellambse_context_diagrams/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ def _create_diagram(self, params: dict[str, t.Any]) -> cdiagram.Diagram:
params.setdefault(
"search_direction", params.get("search_direction", "ALL")
)
params.setdefault("show_owners", params.get("show_owners", True))
params.setdefault("layer_sizing", params.get("layer_sizing", "WIDTH"))
params.setdefault("show_owners", True)
params.setdefault("layer_sizing", "WIDTH")
data, edges = realization_view.collector(self, params)
layout = try_to_layout(data)
adjust_layer_sizing(data, layout, params["layer_sizing"])
Expand Down
64 changes: 31 additions & 33 deletions docs/gen_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,16 @@ def generate_realization_view_images() -> None:
diag = obj.realization_view
for layer_sizing in ("UNION", "HEIGHT", "WIDTH", "INDIVIDUAL"):
with mkdocs_gen_files.open(
f"{str(dest / diag.name)} {layer_sizing}.svg", "w"
str(dest / f"{diag.name} {layer_sizing}.svg"), "wb"
) as fd:
print(
diag.render(
"svg",
depth=3,
search_direction="ALL",
show_owners=True,
transparent_background=False,
layer_sizing=layer_sizing,
),
file=fd,
diag.save(
fd,
"svg",
depth=3,
search_direction="ALL",
show_owners=True,
transparent_background=False,
layer_sizing=layer_sizing,
)


Expand All @@ -155,27 +153,27 @@ def generate_data_flow_image() -> None:
print(diag.render("svg", transparent_background=False), file=fd)


generate_index_images()
generate_hierarchy_image()
generate_no_symbol_images()

wizard = general_context_diagram_uuids["educate Wizards"]
generate_no_edgelabel_image(wizard)

lost = general_context_diagram_uuids["Lost"]
generate_filter_image(lost, filters.EX_ITEMS, "ex")
generate_filter_image(lost, filters.FEX_EX_ITEMS, "fex and ex")
generate_filter_image(lost, filters.FEX_OR_EX_ITEMS, "fex or ex")

generate_styling_image(
lost,
dict(
styling.BLUE_ACTOR_FNCS,
junction=lambda o, s: {"stroke": diagram.RGB(220, 20, 60)},
),
"red junction",
)
generate_styling_image(wizard, {}, "no_styles")
generate_class_tree_images()
# generate_index_images()
# generate_hierarchy_image()
# generate_no_symbol_images()

# wizard = general_context_diagram_uuids["educate Wizards"]
# generate_no_edgelabel_image(wizard)

# lost = general_context_diagram_uuids["Lost"]
# generate_filter_image(lost, filters.EX_ITEMS, "ex")
# generate_filter_image(lost, filters.FEX_EX_ITEMS, "fex and ex")
# generate_filter_image(lost, filters.FEX_OR_EX_ITEMS, "fex or ex")

# generate_styling_image(
# lost,
# dict(
# styling.BLUE_ACTOR_FNCS,
# junction=lambda o, s: {"stroke": diagram.RGB(220, 20, 60)},
# ),
# "red junction",
# )
# generate_styling_image(wizard, {}, "no_styles")
# generate_class_tree_images()
generate_realization_view_images()
generate_data_flow_image()

0 comments on commit 5e1a2b6

Please sign in to comment.