Skip to content

Commit d19799a

Browse files
committed
feat: diagrams update
1 parent 72cb438 commit d19799a

13 files changed

Lines changed: 1694 additions & 4748 deletions

‎docs/helpers.py‎

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,38 +61,34 @@ def display_steps(self):
6161

6262
display(Markdown(md))
6363

64-
def display_components_diagram(self):
64+
def _invoke_puml(
65+
self,
66+
diagram_type: DiagramType
67+
):
6568
out = StringIO()
6669
to_puml(
6770
cwl_document=self.workflow,
68-
diagram_type=DiagramType.COMPONENT,
71+
diagram_type=diagram_type,
6972
output_stream=out,
73+
workflow_id=self.entrypoint
7074
)
7175

7276
clear_output = out.getvalue()
7377
encoded = deflate_and_encode(clear_output)
74-
diagram_url = f"https://www.plantuml.com/plantuml/png/{encoded}"
78+
diagram_url = f"https://uml.planttext.com/plantuml/png/{encoded}"
7579

7680
with urlopen(diagram_url) as url:
7781
img = Image.open(BytesIO(url.read()))
7882
display(img)
7983

80-
def plot(self):
81-
args = ["--print-dot", f"{self.cwl_file}#{self.entrypoint}"]
82-
83-
stream_err = StringIO()
84-
stream_out = StringIO()
85-
86-
_ = cwlmain(
87-
args,
88-
stdout=stream_out,
89-
stderr=stream_err,
90-
executor=NoopJobExecutor(),
91-
loadingContext=LoadingContext(),
92-
runtimeContext=RuntimeContext(),
93-
)
84+
def display_components_diagram(self):
85+
self._invoke_puml(DiagramType.COMPONENT)
86+
87+
def display_sequence_diagram(self):
88+
self._invoke_puml(DiagramType.SEQUENCE)
9489

95-
return graphviz.Source(stream_out.getvalue())
90+
def plot(self):
91+
self._invoke_puml(DiagramType.STATE)
9692

9793

9894
class WorkflowWrapper:

‎docs/pattern-1.ipynb‎

Lines changed: 116 additions & 383 deletions
Large diffs are not rendered by default.

‎docs/pattern-10.ipynb‎

Lines changed: 139 additions & 422 deletions
Large diffs are not rendered by default.

‎docs/pattern-11.ipynb‎

Lines changed: 137 additions & 440 deletions
Large diffs are not rendered by default.

‎docs/pattern-12.ipynb‎

Lines changed: 355 additions & 53 deletions
Large diffs are not rendered by default.

‎docs/pattern-2.ipynb‎

Lines changed: 120 additions & 438 deletions
Large diffs are not rendered by default.

‎docs/pattern-3.ipynb‎

Lines changed: 141 additions & 414 deletions
Large diffs are not rendered by default.

‎docs/pattern-4.ipynb‎

Lines changed: 30 additions & 638 deletions
Large diffs are not rendered by default.

‎docs/pattern-5.ipynb‎

Lines changed: 128 additions & 399 deletions
Large diffs are not rendered by default.

‎docs/pattern-6.ipynb‎

Lines changed: 118 additions & 282 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)