Skip to content

Commit

Permalink
docs: Fix save_drawing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ewuerger committed Oct 18, 2023
1 parent 6e9964f commit 8f85612
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Example:
>
> model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
> diag = model.by_uuid("5bf3f1e3-0f5e-4fec-81d5-c113d3a1b3a6").context_diagram
> diag.render("svgdiagram").save_drawing(True)
> diag.render("svgdiagram").save_drawing(pretty=True)
> ```
> <figure markdown>
> <img src="assets/images/Context of Top secret.svg" width="1000000">
Expand Down
6 changes: 3 additions & 3 deletions docs/extras/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Currently the supported filters are:
diag = obj.context_diagram
assert filters.EX_ITEMS == "show.exchange.items.filter"
diag.filters.add(filters.EX_ITEMS)
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
<figure markdown>
<img src="../../assets/images/Context of Lost ex.svg" width="1000000">
Expand All @@ -43,7 +43,7 @@ Currently the supported filters are:
diag = obj.context_diagram
assert filters.FEX_EX_ITEMS == "show.functional.exchanges.exchange.items.filter"
filters.filters = {filters.FEX_EX_ITEMS}
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
<figure markdown>
<img src="../../assets/images/Context of Lost fex and ex.svg" width="1000000">
Expand All @@ -62,7 +62,7 @@ Currently the supported filters are:
diag = obj.context_diagram
assert filters.FEX_OR_EX_ITEMS == "capellambse_context_diagrams-show.functional.exchanges.or.exchange.items.filter"
filters.filters.add(filters.FEX_OR_EX_ITEMS)
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
<figure markdown>
<img src="../../assets/images/Context of Lost fex or ex.svg" width="1000000">
Expand Down
12 changes: 6 additions & 6 deletions docs/extras/styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Capella. These appear to be blue.

model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
diag = model.by_uuid("957c5799-1d4a-4ac0-b5de-33a65bf1519c").context_diagram
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
produces
<figure markdown>
Expand All @@ -47,7 +47,7 @@ displayed as an icon beside the box-label.

diag = model.by_uuid("da08ddb6-92ba-4c3b-956a-017424dbfe85").context_diagram
diag.display_symbols_as_boxes = True
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
produces
<figure markdown>
Expand All @@ -62,7 +62,7 @@ displayed as an icon beside the box-label.

diag = model.by_uuid("9390b7d5-598a-42db-bef8-23677e45ba06").context_diagram
diag.display_symbols_as_boxes = True
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
produces
<figure markdown>
Expand All @@ -81,7 +81,7 @@ The `no_edgelabels` render parameter prevents edge labels from being displayed.

model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
diag = model.by_uuid("957c5799-1d4a-4ac0-b5de-33a65bf1519c").context_diagram
diag.render("svgdiagram", no_edgelabels=True).save_drawing(True)
diag.render("svgdiagram", no_edgelabels=True).save_drawing(pretty=True)
```
<figure markdown>
<img src="../../assets/images/Context of educate Wizards no_edgelabels.svg" width="1000000">
Expand All @@ -101,7 +101,7 @@ You can switch to py-capellambse default styling by overriding the

diag = model.by_uuid("957c5799-1d4a-4ac0-b5de-33a65bf1519c").context_diagram
diag.render_styles = {}
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
produces
<figure markdown>
Expand All @@ -126,7 +126,7 @@ Style your diagram elements ([ElkChildType][capellambse_context_diagrams.seriali
styling.BLUE_ACTOR_FNCS,
junction=lambda obj, serializer: {"fill": aird.RGB(220, 20, 60)},
)
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
produces
<figure markdown>
Expand Down
20 changes: 10 additions & 10 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Available via `.context_diagram` on a [`ModelObject`][capellambse.model.common.e

model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
diag = model.by_uuid("e37510b9-3166-4f80-a919-dfaac9b696c7").context_diagram
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
<figure markdown>
<img src="assets/images/Context of Environment.svg" width="1000000">
Expand All @@ -55,7 +55,7 @@ Available via `.context_diagram` on a [`ModelObject`][capellambse.model.common.e

model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
diag = model.by_uuid("8bcb11e6-443b-4b92-bec2-ff1d87a224e7").context_diagram
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
<figure markdown>
<img src="assets/images/Context of Eat.svg" width="1000000">
Expand All @@ -69,7 +69,7 @@ Available via `.context_diagram` on a [`ModelObject`][capellambse.model.common.e

model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
diag = model.by_uuid("da08ddb6-92ba-4c3b-956a-017424dbfe85").context_diagram
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
<figure markdown>
<img src="assets/images/Context of Middle.svg" width="1000000">
Expand All @@ -83,7 +83,7 @@ Available via `.context_diagram` on a [`ModelObject`][capellambse.model.common.e

model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
diag = model.by_uuid("5bf3f1e3-0f5e-4fec-81d5-c113d3a1b3a6").context_diagram
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
<figure markdown>
<img src="assets/images/Context of Top secret.svg" width="1000000">
Expand All @@ -97,7 +97,7 @@ Available via `.context_diagram` on a [`ModelObject`][capellambse.model.common.e

model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
diag = model.by_uuid("9390b7d5-598a-42db-bef8-23677e45ba06").context_diagram
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
<figure markdown>
<img src="assets/images/Context of Capability.svg" width="1000000">
Expand All @@ -113,7 +113,7 @@ Available via `.context_diagram` on a [`ModelObject`][capellambse.model.common.e

model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
diag = model.by_uuid("a5642060-c9cc-4d49-af09-defaa3024bae").context_diagram
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
<figure markdown>
<img src="assets/images/Context of Lost.svg" width="1000000">
Expand All @@ -127,7 +127,7 @@ Available via `.context_diagram` on a [`ModelObject`][capellambse.model.common.e

model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
diag = model.by_uuid("f632888e-51bc-4c9f-8e81-73e9404de784").context_diagram
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
<figure markdown>
<img src="assets/images/Context of Left.svg" width="1000000">
Expand All @@ -141,7 +141,7 @@ Available via `.context_diagram` on a [`ModelObject`][capellambse.model.common.e

model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
diag = model.by_uuid("957c5799-1d4a-4ac0-b5de-33a65bf1519c").context_diagram
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
<figure markdown>
<img src="assets/images/Context of educate Wizards.svg" width="1000000">
Expand All @@ -167,7 +167,7 @@ Hierarchy is identified and supported:
model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
obj = model.by_uuid("16b4fcc5-548d-4721-b62a-d3d5b1c1d2eb")
diagram = obj.context_diagram.render("svgdiagram", include_inner_objects=True)
diagram.save_drawing(True)
diagram.save_drawing(pretty=True)
```
<figure markdown>
<img src="assets/images/Context of Hierarchy.svg" width="1000000">
Expand All @@ -185,7 +185,7 @@ The data is collected by [get_elkdata_for_exchanges][capellambse_context_diagram

model = capellambse.MelodyModel("tests/data/ContextDiagram.aird")
diag = model.by_uuid("3ef23099-ce9a-4f7d-812f-935f47e7938d").context_diagram
diag.render("svgdiagram").save_drawing(True)
diag.render("svgdiagram").save_drawing(pretty=True)
```
<figure markdown>
<img src="assets/images/Interface Context of Left to right.svg" width="1000000">
Expand Down

0 comments on commit 8f85612

Please sign in to comment.