@groupby/ai-dev 0.5.10 → 0.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/package.json +1 -1
  2. package/teams/fhr-neowise/commands/address-pr.md +120 -0
  3. package/teams/fhr-neowise/commands/ready-pr.md +70 -0
  4. package/teams/fhr-neowise/commands/review-pr.md +111 -0
  5. package/teams/fhr-neowise/commands/tdd-implementation.md +86 -0
  6. package/teams/fhr-neowise/commands/write-plan.md +23 -0
  7. package/teams/fhr-neowise/commands/write-pr.md +21 -0
  8. package/teams/fhr-neowise/commands/write-spec.md +25 -0
  9. package/teams/fhr-neowise/skills/agent-routing/SKILL.md +72 -0
  10. package/teams/fhr-neowise/skills/code-review/SKILL.md +83 -0
  11. package/teams/fhr-neowise/skills/code-review/review-template.md +90 -0
  12. package/teams/fhr-neowise/skills/mermaid-diagram/SKILL.md +94 -0
  13. package/teams/fhr-neowise/skills/mermaid-diagram/references/BEST_PRACTICES.md +96 -0
  14. package/teams/fhr-neowise/skills/mermaid-diagram/references/architecture.md +434 -0
  15. package/teams/fhr-neowise/skills/mermaid-diagram/references/block.md +753 -0
  16. package/teams/fhr-neowise/skills/mermaid-diagram/references/c4.md +619 -0
  17. package/teams/fhr-neowise/skills/mermaid-diagram/references/classDiagram.md +1186 -0
  18. package/teams/fhr-neowise/skills/mermaid-diagram/references/config-configuration.md +72 -0
  19. package/teams/fhr-neowise/skills/mermaid-diagram/references/config-directives.md +342 -0
  20. package/teams/fhr-neowise/skills/mermaid-diagram/references/config-layouts.md +40 -0
  21. package/teams/fhr-neowise/skills/mermaid-diagram/references/config-math.md +96 -0
  22. package/teams/fhr-neowise/skills/mermaid-diagram/references/config-theming.md +246 -0
  23. package/teams/fhr-neowise/skills/mermaid-diagram/references/config-tidy-tree.md +89 -0
  24. package/teams/fhr-neowise/skills/mermaid-diagram/references/cynefin.md +279 -0
  25. package/teams/fhr-neowise/skills/mermaid-diagram/references/entityRelationshipDiagram.md +670 -0
  26. package/teams/fhr-neowise/skills/mermaid-diagram/references/eventmodeling.md +475 -0
  27. package/teams/fhr-neowise/skills/mermaid-diagram/references/examples.md +301 -0
  28. package/teams/fhr-neowise/skills/mermaid-diagram/references/flowchart.md +2116 -0
  29. package/teams/fhr-neowise/skills/mermaid-diagram/references/gantt.md +725 -0
  30. package/teams/fhr-neowise/skills/mermaid-diagram/references/gitgraph.md +2138 -0
  31. package/teams/fhr-neowise/skills/mermaid-diagram/references/ishikawa.md +66 -0
  32. package/teams/fhr-neowise/skills/mermaid-diagram/references/kanban.md +161 -0
  33. package/teams/fhr-neowise/skills/mermaid-diagram/references/mindmap.md +335 -0
  34. package/teams/fhr-neowise/skills/mermaid-diagram/references/packet.md +153 -0
  35. package/teams/fhr-neowise/skills/mermaid-diagram/references/pie.md +93 -0
  36. package/teams/fhr-neowise/skills/mermaid-diagram/references/quadrantChart.md +267 -0
  37. package/teams/fhr-neowise/skills/mermaid-diagram/references/radar.md +269 -0
  38. package/teams/fhr-neowise/skills/mermaid-diagram/references/railroad.md +337 -0
  39. package/teams/fhr-neowise/skills/mermaid-diagram/references/requirementDiagram.md +495 -0
  40. package/teams/fhr-neowise/skills/mermaid-diagram/references/sankey.md +415 -0
  41. package/teams/fhr-neowise/skills/mermaid-diagram/references/sequenceDiagram.md +1195 -0
  42. package/teams/fhr-neowise/skills/mermaid-diagram/references/stateDiagram.md +670 -0
  43. package/teams/fhr-neowise/skills/mermaid-diagram/references/timeline.md +571 -0
  44. package/teams/fhr-neowise/skills/mermaid-diagram/references/treeView.md +321 -0
  45. package/teams/fhr-neowise/skills/mermaid-diagram/references/treemap.md +353 -0
  46. package/teams/fhr-neowise/skills/mermaid-diagram/references/userJourney.md +42 -0
  47. package/teams/fhr-neowise/skills/mermaid-diagram/references/venn.md +134 -0
  48. package/teams/fhr-neowise/skills/mermaid-diagram/references/wardley.md +732 -0
  49. package/teams/fhr-neowise/skills/mermaid-diagram/references/xyChart.md +312 -0
  50. package/teams/fhr-neowise/skills/mermaid-diagram/references/zenuml.md +474 -0
  51. package/teams/fhr-neowise/skills/mermaid-diagram/scripts/sync_docs.py +138 -0
  52. package/teams/fhr-neowise/skills/pull-request-authoring/COMPLEX.template.md +52 -0
  53. package/teams/fhr-neowise/skills/pull-request-authoring/NON-CODE.template.md +15 -0
  54. package/teams/fhr-neowise/skills/pull-request-authoring/SIMPLE.template.md +20 -0
  55. package/teams/fhr-neowise/skills/pull-request-authoring/SKILL.md +102 -0
  56. package/teams/fhr-neowise/skills/spec-investigation/SKILL.md +139 -0
  57. package/teams/fhr-neowise/skills/spec-investigation/TEMPLATE.spec.md +74 -0
  58. package/teams/fhr-neowise/skills/tdd-workflow/SKILL.md +137 -0
  59. package/teams/fhr-neowise/skills/write-plan/SKILL.md +285 -0
  60. package/teams/fhr-neowise/skills/write-plan/assets/TEMPLATE.checklist.json +79 -0
  61. package/teams/fhr-neowise/skills/write-plan/assets/TEMPLATE.plan.md +158 -0
@@ -0,0 +1,753 @@
1
+ > **Warning**
2
+ >
3
+ > ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
4
+ >
5
+ > ## Please edit the corresponding file in [/packages/mermaid/src/docs/syntax/block.md](../../packages/mermaid/src/docs/syntax/block.md).
6
+
7
+ # Block Diagrams Documentation
8
+
9
+ ## Introduction to Block Diagrams
10
+
11
+ ```mermaid-example
12
+ block
13
+ columns 1
14
+ db(("DB"))
15
+ blockArrowId6<["&nbsp;&nbsp;&nbsp;"]>(down)
16
+ block:ID
17
+ A
18
+ B["A wide one in the middle"]
19
+ C
20
+ end
21
+ space
22
+ D
23
+ ID --> D
24
+ C --> D
25
+ style B fill:#969,stroke:#333,stroke-width:4px
26
+ ```
27
+
28
+ ```mermaid
29
+ block
30
+ columns 1
31
+ db(("DB"))
32
+ blockArrowId6<["&nbsp;&nbsp;&nbsp;"]>(down)
33
+ block:ID
34
+ A
35
+ B["A wide one in the middle"]
36
+ C
37
+ end
38
+ space
39
+ D
40
+ ID --> D
41
+ C --> D
42
+ style B fill:#969,stroke:#333,stroke-width:4px
43
+ ```
44
+
45
+ ### Definition and Purpose
46
+
47
+ Block diagrams are an intuitive and efficient way to represent complex systems, processes, or architectures visually. They are composed of blocks and connectors, where blocks represent the fundamental components or functions, and connectors show the relationship or flow between these components. This method of diagramming is essential in various fields such as engineering, software development, and process management.
48
+
49
+ The primary purpose of block diagrams is to provide a high-level view of a system, allowing for easy understanding and analysis without delving into the intricate details of each component. This makes them particularly useful for simplifying complex systems and for explaining the overall structure and interaction of components within a system.
50
+
51
+ Many people use mermaid flowcharts for this purpose. A side-effect of this is that the automatic layout sometimes move shapes to positions that the diagram maker does not want. Block diagrams use a different approach. In this diagram we give the author full control over where the shapes are positioned.
52
+
53
+ ### General Use Cases
54
+
55
+ Block diagrams have a wide range of applications across various industries and disciplines. Some of the key use cases include:
56
+
57
+ - **Software Architecture**: In software development, block diagrams can be used to illustrate the architecture of a software application. This includes showing how different modules or services interact, data flow, and high-level component interaction.
58
+
59
+ - **Network Diagrams**: Block diagrams are ideal for representing network architectures in IT and telecommunications. They can depict how different network devices and services are interconnected, including routers, switches, firewalls, and the flow of data across the network.
60
+
61
+ - **Process Flowcharts**: In business and manufacturing, block diagrams can be employed to create process flowcharts. These flowcharts represent various stages of a business or manufacturing process, helping to visualize the sequence of steps, decision points, and the flow of control.
62
+
63
+ - **Electrical Systems**: Engineers use block diagrams to represent electrical systems and circuitry. They can illustrate the high-level structure of an electrical system, the interaction between different electrical components, and the flow of electrical currents.
64
+
65
+ - **Educational Purposes**: Block diagrams are also extensively used in educational materials to explain complex concepts and systems in a simplified manner. They help in breaking down and visualizing scientific theories, engineering principles, and technological systems.
66
+
67
+ These examples demonstrate the versatility of block diagrams in providing clear and concise representations of complex systems. Their simplicity and clarity make them a valuable tool for professionals across various fields to communicate complex ideas effectively.
68
+
69
+ In the following sections, we will delve into the specifics of creating and manipulating block diagrams using Mermaid, covering everything from basic syntax to advanced configurations and styling.
70
+
71
+ Creating block diagrams with Mermaid is straightforward and accessible. This section introduces the basic syntax and structure needed to start building simple diagrams. Understanding these foundational concepts is key to efficiently utilizing Mermaid for more complex diagramming tasks.
72
+
73
+ ### Simple Block Diagrams
74
+
75
+ #### Basic Structure
76
+
77
+ At its core, a block diagram consists of blocks representing different entities or components. In Mermaid, these blocks are easily created using simple text labels. The most basic form of a block diagram can be a series of blocks without any connectors.
78
+
79
+ **Example - Simple Block Diagram**:
80
+ To create a simple block diagram with three blocks labeled 'a', 'b', and 'c', the syntax is as follows:
81
+
82
+ ```mermaid-example
83
+ block
84
+ a b c
85
+ ```
86
+
87
+ ```mermaid
88
+ block
89
+ a b c
90
+ ```
91
+
92
+ This example will produce a horizontal sequence of three blocks. Each block is automatically spaced and aligned for optimal readability.
93
+
94
+ ### Defining the number of columns to use
95
+
96
+ #### Column Usage
97
+
98
+ While simple block diagrams are linear and straightforward, more complex systems may require a structured layout. Mermaid allows for the organization of blocks into multiple columns, facilitating the creation of more intricate and detailed diagrams.
99
+
100
+ **Example - Multi-Column Diagram:**
101
+ In scenarios where you need to distribute blocks across multiple columns, you can specify the number of columns and arrange the blocks accordingly. Here's how to create a block diagram with three columns and four blocks, where the fourth block appears in a second row:
102
+
103
+ ```mermaid-example
104
+ block
105
+ columns 3
106
+ a b c d
107
+ ```
108
+
109
+ ```mermaid
110
+ block
111
+ columns 3
112
+ a b c d
113
+ ```
114
+
115
+ This syntax instructs Mermaid to arrange the blocks 'a', 'b', 'c', and 'd' across three columns, wrapping to the next row as needed. This feature is particularly useful for representing layered or multi-tiered systems, such as network layers or hierarchical structures.
116
+
117
+ These basic building blocks of Mermaid's block diagrams provide a foundation for more complex diagramming. The simplicity of the syntax allows for quick creation and iteration of diagrams, making it an efficient tool for visualizing ideas and concepts. In the next section, we'll explore advanced block configuration options, including setting block widths and creating composite blocks.
118
+
119
+ ## 3. Advanced Block Configuration
120
+
121
+ Building upon the basics, this section delves into more advanced features of block diagramming in Mermaid. These features allow for greater flexibility and complexity in diagram design, accommodating a wider range of use cases and scenarios.
122
+
123
+ ### Setting Block Width
124
+
125
+ #### Spanning Multiple Columns
126
+
127
+ In more complex diagrams, you may need blocks that span multiple columns to emphasize certain components or to represent larger entities. Mermaid allows for the adjustment of block widths to cover multiple columns, enhancing the diagram's readability and structure.
128
+
129
+ **Example - Block Spanning Multiple Columns**:
130
+ To create a block diagram where one block spans across two columns, you can specify the desired width for each block:
131
+
132
+ ```mermaid-example
133
+ block
134
+ columns 3
135
+ a["A label"] b:2 c:2 d
136
+ ```
137
+
138
+ ```mermaid
139
+ block
140
+ columns 3
141
+ a["A label"] b:2 c:2 d
142
+ ```
143
+
144
+ In this example, the block labeled "A labels" spans one column, while blocks 'b', 'c' span 2 columns, and 'd' is again allocated its own column. This flexibility in block sizing is crucial for accurately representing systems with components of varying significance or size.
145
+
146
+ ### Creating Composite Blocks
147
+
148
+ #### Nested Blocks
149
+
150
+ Composite blocks, or blocks within blocks, are an advanced feature in Mermaid's block diagram syntax. They allow for the representation of nested or hierarchical systems, where one component encompasses several subcomponents.
151
+
152
+ **Example - Composite Blocks:**
153
+ Creating a composite block involves defining a parent block and then nesting other blocks within it. Here's how to define a composite block with nested elements:
154
+
155
+ ```mermaid-example
156
+ block
157
+ block
158
+ D
159
+ end
160
+ A["A: I am a wide one"]
161
+ ```
162
+
163
+ ```mermaid
164
+ block
165
+ block
166
+ D
167
+ end
168
+ A["A: I am a wide one"]
169
+ ```
170
+
171
+ In this syntax, 'D' is a nested block within a larger parent block. This feature is particularly useful for depicting complex structures, such as a server with multiple services or a department within a larger organizational framework.
172
+
173
+ ### Column Width Dynamics
174
+
175
+ #### Adjusting Widths
176
+
177
+ Mermaid also allows for dynamic adjustment of column widths based on the content of the blocks. The width of the columns is determined by the widest block in the column, ensuring that the diagram remains balanced and readable.
178
+
179
+ **Example - Dynamic Column Widths:**
180
+ In diagrams with varying block sizes, Mermaid automatically adjusts the column widths to fit the largest block in each column. Here's an example:
181
+
182
+ ```mermaid-example
183
+ block
184
+ columns 3
185
+ a:3
186
+ block:group1:2
187
+ columns 2
188
+ h i j k
189
+ end
190
+ g
191
+ block:group2:3
192
+ %% columns auto (default)
193
+ l m n o p q r
194
+ end
195
+ ```
196
+
197
+ ```mermaid
198
+ block
199
+ columns 3
200
+ a:3
201
+ block:group1:2
202
+ columns 2
203
+ h i j k
204
+ end
205
+ g
206
+ block:group2:3
207
+ %% columns auto (default)
208
+ l m n o p q r
209
+ end
210
+ ```
211
+
212
+ This example demonstrates how Mermaid dynamically adjusts the width of the columns to accommodate the widest block, in this case, 'a' and the composite block 'e'. This dynamic adjustment is essential for creating visually balanced and easy-to-understand diagrams.
213
+
214
+ **Merging Blocks Horizontally:**
215
+ In scenarios where you need to stack blocks horizontally, you can use column width to accomplish the task. Blocks can be arranged vertically by putting them in a single column. Here is how you can create a block diagram in which 4 blocks are stacked on top of each other:
216
+
217
+ ```mermaid-example
218
+ block
219
+ block
220
+ columns 1
221
+ a["A label"] b c d
222
+ end
223
+ ```
224
+
225
+ ```mermaid
226
+ block
227
+ block
228
+ columns 1
229
+ a["A label"] b c d
230
+ end
231
+ ```
232
+
233
+ In this example, the width of the merged block dynamically adjusts to the width of the largest child block.
234
+
235
+ With these advanced configuration options, Mermaid's block diagrams can be tailored to represent a wide array of complex systems and structures. The flexibility offered by these features enables users to create diagrams that are both informative and visually appealing. In the following sections, we will explore further capabilities, including different block shapes and linking options.
236
+
237
+ ## 4. Block Varieties and Shapes
238
+
239
+ Mermaid's block diagrams are not limited to standard rectangular shapes. A variety of block shapes are available, allowing for a more nuanced and tailored representation of different types of information or entities. This section outlines the different block shapes you can use in Mermaid and their specific applications.
240
+
241
+ ### Standard and Special Block Shapes
242
+
243
+ Mermaid supports a range of block shapes to suit different diagramming needs, from basic geometric shapes to more specialized forms.
244
+
245
+ #### Example - Round Edged Block
246
+
247
+ To create a block with round edges, which can be used to represent a softer or more flexible component:
248
+
249
+ ```mermaid-example
250
+ block
251
+ id1("This is the text in the box")
252
+ ```
253
+
254
+ ```mermaid
255
+ block
256
+ id1("This is the text in the box")
257
+ ```
258
+
259
+ #### Example - Stadium-Shaped Block
260
+
261
+ A stadium-shaped block, resembling an elongated circle, can be used for components that are process-oriented:
262
+
263
+ ```mermaid-example
264
+ block
265
+ id1(["This is the text in the box"])
266
+ ```
267
+
268
+ ```mermaid
269
+ block
270
+ id1(["This is the text in the box"])
271
+ ```
272
+
273
+ #### Example - Subroutine Shape
274
+
275
+ For representing subroutines or contained processes, a block with double vertical lines is useful:
276
+
277
+ ```mermaid-example
278
+ block
279
+ id1[["This is the text in the box"]]
280
+ ```
281
+
282
+ ```mermaid
283
+ block
284
+ id1[["This is the text in the box"]]
285
+ ```
286
+
287
+ #### Example - Cylindrical Shape
288
+
289
+ The cylindrical shape is ideal for representing databases or storage components:
290
+
291
+ ```mermaid-example
292
+ block
293
+ id1[("Database")]
294
+ ```
295
+
296
+ ```mermaid
297
+ block
298
+ id1[("Database")]
299
+ ```
300
+
301
+ #### Example - Circle Shape
302
+
303
+ A circle can be used for centralized or pivotal components:
304
+
305
+ ```mermaid-example
306
+ block
307
+ id1(("This is the text in the circle"))
308
+ ```
309
+
310
+ ```mermaid
311
+ block
312
+ id1(("This is the text in the circle"))
313
+ ```
314
+
315
+ #### Example - Asymmetric, Rhombus, and Hexagon Shapes
316
+
317
+ For decision points, use a rhombus, and for unique or specialized processes, asymmetric and hexagon shapes can be utilized:
318
+
319
+ **Asymmetric**
320
+
321
+ ```mermaid-example
322
+ block
323
+ id1>"This is the text in the box"]
324
+ ```
325
+
326
+ ```mermaid
327
+ block
328
+ id1>"This is the text in the box"]
329
+ ```
330
+
331
+ **Rhombus**
332
+
333
+ ```mermaid-example
334
+ block
335
+ id1{"This is the text in the box"}
336
+ ```
337
+
338
+ ```mermaid
339
+ block
340
+ id1{"This is the text in the box"}
341
+ ```
342
+
343
+ **Hexagon**
344
+
345
+ ```mermaid-example
346
+ block
347
+ id1{{"This is the text in the box"}}
348
+ ```
349
+
350
+ ```mermaid
351
+ block
352
+ id1{{"This is the text in the box"}}
353
+ ```
354
+
355
+ #### Example - Parallelogram and Trapezoid Shapes
356
+
357
+ Parallelogram and trapezoid shapes are perfect for inputs/outputs and transitional processes:
358
+
359
+ ```mermaid-example
360
+ block
361
+ id1[/"This is the text in the box"/]
362
+ id2[\"This is the text in the box"\]
363
+ A[/"Christmas"\]
364
+ B[\"Go shopping"/]
365
+ ```
366
+
367
+ ```mermaid
368
+ block
369
+ id1[/"This is the text in the box"/]
370
+ id2[\"This is the text in the box"\]
371
+ A[/"Christmas"\]
372
+ B[\"Go shopping"/]
373
+ ```
374
+
375
+ #### Example - Double Circle
376
+
377
+ For highlighting critical or high-priority components, a double circle can be effective:
378
+
379
+ ```mermaid-example
380
+ block
381
+ id1((("This is the text in the circle")))
382
+ ```
383
+
384
+ ```mermaid
385
+ block
386
+ id1((("This is the text in the circle")))
387
+ ```
388
+
389
+ ### Block Arrows and Space Blocks
390
+
391
+ Mermaid also offers unique shapes like block arrows and space blocks for directional flow and spacing.
392
+
393
+ #### Example - Block Arrows
394
+
395
+ Block arrows can visually indicate direction or flow within a process:
396
+
397
+ ```mermaid-example
398
+ block
399
+ blockArrowId<["Label"]>(right)
400
+ blockArrowId2<["Label"]>(left)
401
+ blockArrowId3<["Label"]>(up)
402
+ blockArrowId4<["Label"]>(down)
403
+ blockArrowId5<["Label"]>(x)
404
+ blockArrowId6<["Label"]>(y)
405
+ blockArrowId7<["Label"]>(x, down)
406
+ ```
407
+
408
+ ```mermaid
409
+ block
410
+ blockArrowId<["Label"]>(right)
411
+ blockArrowId2<["Label"]>(left)
412
+ blockArrowId3<["Label"]>(up)
413
+ blockArrowId4<["Label"]>(down)
414
+ blockArrowId5<["Label"]>(x)
415
+ blockArrowId6<["Label"]>(y)
416
+ blockArrowId7<["Label"]>(x, down)
417
+ ```
418
+
419
+ #### Example - Space Blocks
420
+
421
+ Space blocks can be used to create intentional empty spaces in the diagram, which is useful for layout and readability:
422
+
423
+ ```mermaid-example
424
+ block
425
+ columns 3
426
+ a space b
427
+ c d e
428
+ ```
429
+
430
+ ```mermaid
431
+ block
432
+ columns 3
433
+ a space b
434
+ c d e
435
+ ```
436
+
437
+ or
438
+
439
+ ```mermaid-example
440
+ block
441
+ ida space:3 idb idc
442
+ ```
443
+
444
+ ```mermaid
445
+ block
446
+ ida space:3 idb idc
447
+ ```
448
+
449
+ Note that you can set how many columns the space block occupied using the number notation `space:num` where num is a number indicating the num columns width. You can also use `space` which defaults to one column.
450
+
451
+ The variety of shapes and special blocks in Mermaid enhances the expressive power of block diagrams, allowing for more accurate and context-specific representations. These options give users the flexibility to create diagrams that are both informative and visually appealing. In the next sections, we will explore the ways to connect these blocks and customize their appearance.
452
+
453
+ ### Standard and Special Block Shapes
454
+
455
+ Discuss the various shapes available for blocks, including standard shapes and special forms like block arrows and space blocks.
456
+
457
+ ## 5. Connecting Blocks with Edges
458
+
459
+ One of the key features of block diagrams in Mermaid is the ability to connect blocks using various types of edges or links. This section explores the different ways blocks can be interconnected to represent relationships and flows between components.
460
+
461
+ ### Basic Linking and Arrow Types
462
+
463
+ The most fundamental aspect of connecting blocks is the use of arrows or links. These connectors depict the relationships or the flow of information between the blocks. Mermaid offers a range of arrow types to suit different diagramming needs.
464
+
465
+ **Example - Basic Links**
466
+
467
+ A simple link with an arrow can be created to show direction or flow from one block to another:
468
+
469
+ ```mermaid-example
470
+ block
471
+ A space B
472
+ A-->B
473
+ ```
474
+
475
+ ```mermaid
476
+ block
477
+ A space B
478
+ A-->B
479
+ ```
480
+
481
+ This example illustrates a direct connection from block 'A' to block 'B', using a straightforward arrow.
482
+
483
+ This syntax creates a line connecting 'A' and 'B', implying a relationship or connection without indicating a specific direction.
484
+
485
+ ### Text on Links
486
+
487
+ In addition to connecting blocks, it's often necessary to describe or label the relationship. Mermaid allows for the inclusion of text on links, providing context to the connections.
488
+
489
+ Example - Text with Links
490
+ To add text to a link, the syntax includes the text within the link definition:
491
+
492
+ ```mermaid-example
493
+ block
494
+ A space:2 B
495
+ A-- "X" -->B
496
+ ```
497
+
498
+ ```mermaid
499
+ block
500
+ A space:2 B
501
+ A-- "X" -->B
502
+ ```
503
+
504
+ This example show how to add descriptive text to the links, enhancing the information conveyed by the diagram.
505
+
506
+ Example - Edges and Styles:
507
+
508
+ ```mermaid-example
509
+ block
510
+ columns 1
511
+ db(("DB"))
512
+ blockArrowId6<["&nbsp;&nbsp;&nbsp;"]>(down)
513
+ block:ID
514
+ A
515
+ B["A wide one in the middle"]
516
+ C
517
+ end
518
+ space
519
+ D
520
+ ID --> D
521
+ C --> D
522
+ style B fill:#939,stroke:#333,stroke-width:4px
523
+ ```
524
+
525
+ ```mermaid
526
+ block
527
+ columns 1
528
+ db(("DB"))
529
+ blockArrowId6<["&nbsp;&nbsp;&nbsp;"]>(down)
530
+ block:ID
531
+ A
532
+ B["A wide one in the middle"]
533
+ C
534
+ end
535
+ space
536
+ D
537
+ ID --> D
538
+ C --> D
539
+ style B fill:#939,stroke:#333,stroke-width:4px
540
+ ```
541
+
542
+ ## 6. Styling and Customization
543
+
544
+ Beyond the structure and layout of block diagrams, Mermaid offers extensive styling options. These customization features allow for the creation of more visually distinctive and informative diagrams. This section covers how to apply individual styles to blocks and how to use classes for consistent styling across multiple elements.
545
+
546
+ ### Individual Block Styling
547
+
548
+ Mermaid enables detailed styling of individual blocks, allowing you to apply various CSS properties such as color, stroke, and border thickness. This feature is especially useful for highlighting specific parts of a diagram or for adhering to certain visual themes.
549
+
550
+ #### Example - Styling a Single Block
551
+
552
+ To apply custom styles to a block, you can use the `style` keyword followed by the block identifier and the desired CSS properties:
553
+
554
+ ```mermaid-example
555
+ block
556
+ id1 space id2
557
+ id1("Start")-->id2("Stop")
558
+ style id1 fill:#636,stroke:#333,stroke-width:4px
559
+ style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
560
+ ```
561
+
562
+ ```mermaid
563
+ block
564
+ id1 space id2
565
+ id1("Start")-->id2("Stop")
566
+ style id1 fill:#636,stroke:#333,stroke-width:4px
567
+ style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
568
+ ```
569
+
570
+ ### Class Styling
571
+
572
+ Mermaid enables applying styling to classes, which could make styling easier if you want to apply a certain set of styles to multiple elements, as you could just link those elements to a class.
573
+
574
+ #### Example - Styling a Single Class
575
+
576
+ ```mermaid-example
577
+ block
578
+ A space B
579
+ A-->B
580
+ classDef blue fill:#6e6ce6,stroke:#333,stroke-width:4px;
581
+ class A blue
582
+ style B fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
583
+ ```
584
+
585
+ ```mermaid
586
+ block
587
+ A space B
588
+ A-->B
589
+ classDef blue fill:#6e6ce6,stroke:#333,stroke-width:4px;
590
+ class A blue
591
+ style B fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
592
+ ```
593
+
594
+ In this example, a class named 'blue' is defined and applied to block 'A', while block 'B' receives individual styling. This demonstrates the flexibility of Mermaid in applying both shared and unique styles within the same diagram.
595
+
596
+ The ability to style blocks individually or through classes provides a powerful tool for enhancing the visual impact and clarity of block diagrams. Whether emphasizing certain elements or maintaining a cohesive design across the diagram, these styling capabilities are central to effective diagramming. The next sections will present practical examples and use cases, followed by tips for troubleshooting common issues.
597
+
598
+ ### 7. Practical Examples and Use Cases
599
+
600
+ The versatility of Mermaid's block diagrams becomes evident when applied to real-world scenarios. This section provides practical examples demonstrating the application of various features discussed in previous sections. These examples showcase how block diagrams can be used to represent complex systems and processes in an accessible and informative manner.
601
+
602
+ ### Detailed Examples Illustrating Various Features
603
+
604
+ Combining the elements of structure, linking, and styling, we can create comprehensive diagrams that serve specific purposes in different contexts.
605
+
606
+ #### Example - System Architecture
607
+
608
+ Illustrating a simple software system architecture with interconnected components:
609
+
610
+ ```mermaid-example
611
+ block
612
+ columns 3
613
+ Frontend blockArrowId6<[" "]>(right) Backend
614
+ space:2 down<[" "]>(down)
615
+ Disk left<[" "]>(left) Database[("Database")]
616
+
617
+ classDef front fill:#696,stroke:#333;
618
+ classDef back fill:#969,stroke:#333;
619
+ class Frontend front
620
+ class Backend,Database back
621
+ ```
622
+
623
+ ```mermaid
624
+ block
625
+ columns 3
626
+ Frontend blockArrowId6<[" "]>(right) Backend
627
+ space:2 down<[" "]>(down)
628
+ Disk left<[" "]>(left) Database[("Database")]
629
+
630
+ classDef front fill:#696,stroke:#333;
631
+ classDef back fill:#969,stroke:#333;
632
+ class Frontend front
633
+ class Backend,Database back
634
+ ```
635
+
636
+ This example shows a basic architecture with a frontend, backend, and database. The blocks are styled to differentiate between types of components.
637
+
638
+ #### Example - Business Process Flow
639
+
640
+ Representing a business process flow with decision points and multiple stages:
641
+
642
+ ```mermaid-example
643
+ block
644
+ columns 3
645
+ Start(("Start")) space:2
646
+ down<[" "]>(down) space:2
647
+ Decision{{"Make Decision"}} right<["Yes"]>(right) Process1["Process A"]
648
+ downAgain<["No"]>(down) space r3<["Done"]>(down)
649
+ Process2["Process B"] r2<["Done"]>(right) End(("End"))
650
+
651
+ style Start fill:#969;
652
+ style End fill:#696;
653
+ ```
654
+
655
+ ```mermaid
656
+ block
657
+ columns 3
658
+ Start(("Start")) space:2
659
+ down<[" "]>(down) space:2
660
+ Decision{{"Make Decision"}} right<["Yes"]>(right) Process1["Process A"]
661
+ downAgain<["No"]>(down) space r3<["Done"]>(down)
662
+ Process2["Process B"] r2<["Done"]>(right) End(("End"))
663
+
664
+ style Start fill:#969;
665
+ style End fill:#696;
666
+ ```
667
+
668
+ These practical examples and scenarios underscore the utility of Mermaid block diagrams in simplifying and effectively communicating complex information across various domains.
669
+
670
+ The next section, 'Troubleshooting and Common Issues', will provide insights into resolving common challenges encountered when working with Mermaid block diagrams, ensuring a smooth diagramming experience.
671
+
672
+ ## 8. Troubleshooting and Common Issues
673
+
674
+ Working with Mermaid block diagrams can sometimes present challenges, especially as the complexity of the diagrams increases. This section aims to provide guidance on resolving common issues and offers tips for managing more intricate diagram structures.
675
+
676
+ ### Common Syntax Errors
677
+
678
+ Understanding and avoiding common syntax errors is key to a smooth experience with Mermaid diagrams.
679
+
680
+ #### Example - Incorrect Linking
681
+
682
+ A common mistake is incorrect linking syntax, which can lead to unexpected results or broken diagrams:
683
+
684
+ ```
685
+ block
686
+ A - B
687
+ ```
688
+
689
+ **Correction**:
690
+ Ensure that links between blocks are correctly specified with arrows (--> or ---) to define the direction and type of connection. Also remember that one of the fundamentals for block diagram is to give the author full control of where the boxes are positioned so in the example you need to add a space between the boxes:
691
+
692
+ ```mermaid-example
693
+ block
694
+ A space B
695
+ A --> B
696
+ ```
697
+
698
+ ```mermaid
699
+ block
700
+ A space B
701
+ A --> B
702
+ ```
703
+
704
+ #### Example - Misplaced Styling
705
+
706
+ Applying styles in the wrong context or with incorrect syntax can lead to blocks not being styled as intended:
707
+
708
+ ```mermaid-example
709
+ block
710
+ A
711
+ style A fill#969;
712
+ ```
713
+
714
+ ```mermaid
715
+ block
716
+ A
717
+ style A fill#969;
718
+ ```
719
+
720
+ **Correction:**
721
+ Correct the syntax by ensuring proper separation of style properties with commas and using the correct CSS property format:
722
+
723
+ ```mermaid-example
724
+ block
725
+ A
726
+ style A fill:#969,stroke:#333;
727
+
728
+ ```
729
+
730
+ ```mermaid
731
+ block
732
+ A
733
+ style A fill:#969,stroke:#333;
734
+
735
+ ```
736
+
737
+ ### Tips for Complex Diagram Structures
738
+
739
+ Managing complexity in Mermaid diagrams involves planning and employing best practices.
740
+
741
+ #### Modular Design
742
+
743
+ Break down complex diagrams into smaller, more manageable components. This approach not only makes the diagram easier to understand but also simplifies the creation and maintenance process.
744
+
745
+ #### Consistent Styling
746
+
747
+ Use classes to maintain consistent styling across similar elements. This not only saves time but also ensures a cohesive and professional appearance.
748
+
749
+ #### Comments and Documentation
750
+
751
+ Use comments with `%%` within the Mermaid syntax to document the purpose of various parts of the diagram. This practice is invaluable for maintaining clarity, especially when working in teams or returning to a diagram after some time.
752
+
753
+ With these troubleshooting tips and best practices, you can effectively manage and resolve common issues in Mermaid block diagrams. The final section, 'Conclusion', will summarize the key points covered in this documentation and invite user feedback for continuous improvement.