@@ -9,8 +9,13 @@ them as SVG or PNG images. First, install any of these free and open source
9
9
applications needed to generate the images:
10
10
11
11
* `Graphviz `_, provides the ``dot `` command;
12
+ * `Mermaid CLI `_, provides the ``mmdc `` command;
12
13
* `PlantUML `_, provides the ``plantuml.jar `` file (which requires Java).
13
14
15
+ .. versionadded :: 5.3
16
+
17
+ The ``mermaid `` dump format was introduced in Symfony 5.3.
18
+
14
19
If you are defining the workflow inside a Symfony application, run this command
15
20
to dump it as an image:
16
21
@@ -28,10 +33,17 @@ to dump it as an image:
28
33
# highlight 'place1' and 'place2' in the dumped workflow
29
34
$ php bin/console workflow:dump workflow-name place1 place2 | dot -Tsvg -o graph.svg
30
35
36
+ # using Mermaid.js CLI
37
+ $ php bin/console workflow:dump workflow_name --dump-format=mermaid | mmdc -o graph.svg
38
+
31
39
The DOT image will look like this:
32
40
33
41
.. image :: /_images/components/workflow/blogpost.png
34
42
43
+ The Mermaid image will look like this:
44
+
45
+ .. image :: /_images/components/workflow/blogpost_mermaid.png
46
+
35
47
The PlantUML image will look like this:
36
48
37
49
.. image :: /_images/components/workflow/blogpost_puml.png
@@ -63,7 +75,7 @@ You can use ``metadata`` with the following keys to style the workflow:
63
75
64
76
* ``bg_color ``: a color;
65
77
* ``description ``: a string that describes the state.
66
-
78
+
67
79
* for transitions:
68
80
69
81
* ``label ``: a string that replaces the name of the transition;
@@ -76,6 +88,11 @@ Colors can be defined as:
76
88
* a color name from `PlantUML's color list `_;
77
89
* an hexadecimal color (both ``#AABBCC `` and ``#ABC `` formats are supported).
78
90
91
+ .. note ::
92
+
93
+ The Mermaid dumper does not support coloring the arrow heads
94
+ with ``arrow_color `` as there is no support in Mermaid for doing so.
95
+
79
96
Below is the configuration for the pull request state machine with styling added.
80
97
81
98
.. configuration-block ::
@@ -310,5 +327,6 @@ The PlantUML image will look like this:
310
327
.. image :: /_images/components/workflow/pull_request_puml_styled.png
311
328
312
329
.. _`Graphviz` : https://www.graphviz.org
330
+ .. _`Mermaid CLI` : https://github.com/mermaid-js/mermaid-cli
313
331
.. _`PlantUML` : https://plantuml.com/
314
332
.. _`PlantUML's color list` : https://plantuml.com/color
0 commit comments