@groupby/ai-dev 0.5.9 → 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.
- package/package.json +1 -1
- package/teams/fhr-neowise/commands/address-pr.md +120 -0
- package/teams/fhr-neowise/commands/ready-pr.md +70 -0
- package/teams/fhr-neowise/commands/review-pr.md +111 -0
- package/teams/fhr-neowise/commands/tdd-implementation.md +86 -0
- package/teams/fhr-neowise/commands/write-plan.md +23 -0
- package/teams/fhr-neowise/commands/write-pr.md +21 -0
- package/teams/fhr-neowise/commands/write-spec.md +25 -0
- package/teams/fhr-neowise/skills/agent-routing/SKILL.md +72 -0
- package/teams/fhr-neowise/skills/code-review/SKILL.md +83 -0
- package/teams/fhr-neowise/skills/code-review/review-template.md +90 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/SKILL.md +94 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/BEST_PRACTICES.md +96 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/architecture.md +434 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/block.md +753 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/c4.md +619 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/classDiagram.md +1186 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/config-configuration.md +72 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/config-directives.md +342 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/config-layouts.md +40 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/config-math.md +96 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/config-theming.md +246 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/config-tidy-tree.md +89 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/cynefin.md +279 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/entityRelationshipDiagram.md +670 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/eventmodeling.md +475 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/examples.md +301 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/flowchart.md +2116 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/gantt.md +725 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/gitgraph.md +2138 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/ishikawa.md +66 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/kanban.md +161 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/mindmap.md +335 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/packet.md +153 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/pie.md +93 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/quadrantChart.md +267 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/radar.md +269 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/railroad.md +337 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/requirementDiagram.md +495 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/sankey.md +415 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/sequenceDiagram.md +1195 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/stateDiagram.md +670 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/timeline.md +571 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/treeView.md +321 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/treemap.md +353 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/userJourney.md +42 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/venn.md +134 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/wardley.md +732 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/xyChart.md +312 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/references/zenuml.md +474 -0
- package/teams/fhr-neowise/skills/mermaid-diagram/scripts/sync_docs.py +138 -0
- package/teams/fhr-neowise/skills/pull-request-authoring/COMPLEX.template.md +52 -0
- package/teams/fhr-neowise/skills/pull-request-authoring/NON-CODE.template.md +15 -0
- package/teams/fhr-neowise/skills/pull-request-authoring/SIMPLE.template.md +20 -0
- package/teams/fhr-neowise/skills/pull-request-authoring/SKILL.md +102 -0
- package/teams/fhr-neowise/skills/spec-investigation/SKILL.md +139 -0
- package/teams/fhr-neowise/skills/spec-investigation/TEMPLATE.spec.md +74 -0
- package/teams/fhr-neowise/skills/tdd-workflow/SKILL.md +137 -0
- package/teams/fhr-neowise/skills/write-plan/SKILL.md +285 -0
- package/teams/fhr-neowise/skills/write-plan/assets/TEMPLATE.checklist.json +79 -0
- package/teams/fhr-neowise/skills/write-plan/assets/TEMPLATE.plan.md +158 -0
- package/teams/rangers/resources/project-doc-contract.md +41 -0
- package/teams/rangers/skills/team-code-review/SKILL.md +66 -0
- package/teams/rangers/skills/team-development/SKILL.md +43 -0
- package/teams/rangers/skills/team-docs-snapshot/SKILL.md +58 -0
- package/teams/rangers/skills/team-docs-snapshot/scripts/collect_project_docs.py +166 -0
- package/teams/rangers/skills/team-phase-planning/SKILL.md +63 -0
- package/teams/rangers/skills/team-project-orientation/SKILL.md +46 -0
|
@@ -0,0 +1,434 @@
|
|
|
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/architecture.md](../../packages/mermaid/src/docs/syntax/architecture.md).
|
|
6
|
+
|
|
7
|
+
# Architecture Diagrams Documentation (v11.1.0+)
|
|
8
|
+
|
|
9
|
+
> In the context of mermaid-js, the architecture diagram is used to show the relationship between services and resources commonly found within the Cloud or CI/CD deployments. In an architecture diagram, services (nodes) are connected by edges. Related services can be placed within groups to better illustrate how they are organized.
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```mermaid-example
|
|
14
|
+
architecture-beta
|
|
15
|
+
group api(cloud)[API]
|
|
16
|
+
|
|
17
|
+
service db(database)[Database] in api
|
|
18
|
+
service disk1(disk)[Storage] in api
|
|
19
|
+
service disk2(disk)[Storage] in api
|
|
20
|
+
service server(server)[Server] in api
|
|
21
|
+
|
|
22
|
+
db:L -- R:server
|
|
23
|
+
disk1:T -- B:server
|
|
24
|
+
disk2:T -- B:db
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```mermaid
|
|
28
|
+
architecture-beta
|
|
29
|
+
group api(cloud)[API]
|
|
30
|
+
|
|
31
|
+
service db(database)[Database] in api
|
|
32
|
+
service disk1(disk)[Storage] in api
|
|
33
|
+
service disk2(disk)[Storage] in api
|
|
34
|
+
service server(server)[Server] in api
|
|
35
|
+
|
|
36
|
+
db:L -- R:server
|
|
37
|
+
disk1:T -- B:server
|
|
38
|
+
disk2:T -- B:db
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Syntax
|
|
42
|
+
|
|
43
|
+
The building blocks of an architecture are `groups`, `services`, `edges`, and `junctions`.
|
|
44
|
+
|
|
45
|
+
For supporting components, icons are declared by surrounding the icon name with `()`, while labels are declared by surrounding the text with `[]`.
|
|
46
|
+
|
|
47
|
+
To begin an architecture diagram, use the keyword `architecture-beta`, followed by your groups, services, edges, and junctions. While each of the 3 building blocks can be declared in any order, care must be taken to ensure the identifier was previously declared by another component.
|
|
48
|
+
|
|
49
|
+
### Groups
|
|
50
|
+
|
|
51
|
+
The syntax for declaring a group is:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
group {group id}({icon name})[{title}] (in {parent id})?
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Put together:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
group public_api(cloud)[Public API]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
creates a group identified as `public_api`, uses the icon `cloud`, and has the label `Public API`.
|
|
64
|
+
|
|
65
|
+
Additionally, groups can be placed within a group using the optional `in` keyword
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
group private_api(cloud)[Private API] in public_api
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Services
|
|
72
|
+
|
|
73
|
+
The syntax for declaring a service is:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
service {service id}({icon name})[{title}] (in {parent id})?
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Put together:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
service database1(database)[My Database]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
creates the service identified as `database1`, using the icon `database`, with the label `My Database`.
|
|
86
|
+
|
|
87
|
+
If the service belongs to a group, it can be placed inside it through the optional `in` keyword
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
service database1(database)[My Database] in private_api
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Edges
|
|
94
|
+
|
|
95
|
+
The syntax for declaring an edge is:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
{serviceId}{{group}}?:{T|B|L|R} {<}?--{>}? {T|B|L|R}:{serviceId}{{group}}?
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### Edge Direction
|
|
102
|
+
|
|
103
|
+
The side of the service the edge comes out of is specified by adding a colon (`:`) to the side of the service connecting to the arrow and adding `L|R|T|B`
|
|
104
|
+
|
|
105
|
+
For example:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
db:R -- L:server
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
creates an edge between the services `db` and `server`, with the edge coming out of the right of `db` and the left of `server`.
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
db:T -- L:server
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
creates a 90 degree edge between the services `db` and `server`, with the edge coming out of the top of `db` and the left of `server`.
|
|
118
|
+
|
|
119
|
+
#### Arrows
|
|
120
|
+
|
|
121
|
+
Arrows can be added to each side of an edge by adding `<` before the direction on the left, and/or `>` after the direction on the right.
|
|
122
|
+
|
|
123
|
+
For example:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
subnet:R --> L:gateway
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
creates an edge with the arrow going into the `gateway` service
|
|
130
|
+
|
|
131
|
+
#### Edges out of Groups
|
|
132
|
+
|
|
133
|
+
To have an edge go from a group to another group or service within another group, the `{group}` modifier can be added after the `serviceId`.
|
|
134
|
+
|
|
135
|
+
For example:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
service server[Server] in groupOne
|
|
139
|
+
service subnet[Subnet] in groupTwo
|
|
140
|
+
|
|
141
|
+
server{group}:B --> T:subnet{group}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
creates an edge going out of `groupOne`, adjacent to `server`, and into `groupTwo`, adjacent to `subnet`.
|
|
145
|
+
|
|
146
|
+
It's important to note that `groupId`s cannot be used for specifying edges and the `{group}` modifier can only be used for services within a group.
|
|
147
|
+
|
|
148
|
+
### Aligning siblings (v\<MERMAID_RELEASE_VERSION>+)
|
|
149
|
+
|
|
150
|
+
When several services share similar edge topology (for example, three databases all connecting `R --> L:mcp`), the layout heuristic may collapse them onto the same coordinate so that two render on top of each other. The `align` directive declares that a set of services share a row (same y) or a column (same x), and forces them to spread along that axis.
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
align row {idA} {idB} {idC} ...
|
|
154
|
+
align column {idA} {idB} ...
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Members must already be declared as services or junctions, and at least two members are required. Each `align` directive lives on its own line.
|
|
158
|
+
|
|
159
|
+
Pick the axis based on how the listed members are connected:
|
|
160
|
+
|
|
161
|
+
- Use **`align column`** when the members connect to a common downstream node _via the same horizontal port pair_ (e.g. all use `R --> L:mcp`). They naturally form a vertical stack to one side, with parallel arrows reaching the downstream node.
|
|
162
|
+
- Use **`align row`** when the members connect to a common downstream node _via the same vertical port pair_ (e.g. all use `B --> T:proc`). They naturally form a horizontal row above the downstream node.
|
|
163
|
+
|
|
164
|
+
Three databases all feeding `mcp` via right-to-left edges → stack them in a column:
|
|
165
|
+
|
|
166
|
+
```mermaid-example
|
|
167
|
+
architecture-beta
|
|
168
|
+
group api(cloud)[API]
|
|
169
|
+
service db1(database)[DB1] in api
|
|
170
|
+
service db2(database)[DB2] in api
|
|
171
|
+
service db3(database)[DB3] in api
|
|
172
|
+
service mcp(server)[MCP] in api
|
|
173
|
+
db1:R --> L:mcp
|
|
174
|
+
db2:R --> L:mcp
|
|
175
|
+
db3:R --> L:mcp
|
|
176
|
+
align column db1 db2 db3
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
```mermaid
|
|
180
|
+
architecture-beta
|
|
181
|
+
group api(cloud)[API]
|
|
182
|
+
service db1(database)[DB1] in api
|
|
183
|
+
service db2(database)[DB2] in api
|
|
184
|
+
service db3(database)[DB3] in api
|
|
185
|
+
service mcp(server)[MCP] in api
|
|
186
|
+
db1:R --> L:mcp
|
|
187
|
+
db2:R --> L:mcp
|
|
188
|
+
db3:R --> L:mcp
|
|
189
|
+
align column db1 db2 db3
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Three sources all feeding `proc` via top-to-bottom edges → arrange them in a row:
|
|
193
|
+
|
|
194
|
+
```mermaid-example
|
|
195
|
+
architecture-beta
|
|
196
|
+
service src1(server)[Source 1]
|
|
197
|
+
service src2(server)[Source 2]
|
|
198
|
+
service src3(server)[Source 3]
|
|
199
|
+
service proc(server)[Processor]
|
|
200
|
+
src1:B --> T:proc
|
|
201
|
+
src2:B --> T:proc
|
|
202
|
+
src3:B --> T:proc
|
|
203
|
+
align row src1 src2 src3
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
```mermaid
|
|
207
|
+
architecture-beta
|
|
208
|
+
service src1(server)[Source 1]
|
|
209
|
+
service src2(server)[Source 2]
|
|
210
|
+
service src3(server)[Source 3]
|
|
211
|
+
service proc(server)[Processor]
|
|
212
|
+
src1:B --> T:proc
|
|
213
|
+
src2:B --> T:proc
|
|
214
|
+
src3:B --> T:proc
|
|
215
|
+
align row src1 src2 src3
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
The order of members in the `align` directive determines their order along the axis. The gap between aligned members is controlled by `idealEdgeLengthMultiplier`.
|
|
219
|
+
|
|
220
|
+
> **Note:** the declared order must not contradict the directions of edges between the listed members. For example, if the diagram contains `a:L --> R:b` (which places `a` to the right of `b`), then `align row a b` will conflict with that edge direction and the layout engine will fail to render. Use `align row b a` instead, or remove the conflicting edge.
|
|
221
|
+
|
|
222
|
+
#### Grid layouts (combining `row` and `column`)
|
|
223
|
+
|
|
224
|
+
`align row` only pins the y-coordinate of its members. To produce a clean grid where columns also align across tiers, pair each `align row` with one or more `align column` directives. The columns can span as many rows as you like — chain every node that should share an x-coordinate, even across groups.
|
|
225
|
+
|
|
226
|
+
```mermaid-example
|
|
227
|
+
architecture-beta
|
|
228
|
+
group sources(cloud)[Sources]
|
|
229
|
+
service src_a(server)[Source A] in sources
|
|
230
|
+
service src_b(server)[Source B] in sources
|
|
231
|
+
service src_c(server)[Source C] in sources
|
|
232
|
+
|
|
233
|
+
group storage(database)[Storage]
|
|
234
|
+
service db_one(database)[DB One] in storage
|
|
235
|
+
service db_two(database)[DB Two] in storage
|
|
236
|
+
service db_three(database)[DB Three] in storage
|
|
237
|
+
|
|
238
|
+
group output(disk)[Output]
|
|
239
|
+
service brief(disk)[Brief] in output
|
|
240
|
+
service analyst(server)[Analyst] in output
|
|
241
|
+
service delivery(cloud)[Delivery] in output
|
|
242
|
+
|
|
243
|
+
src_a:B --> T:db_one
|
|
244
|
+
src_b:B --> T:db_two
|
|
245
|
+
src_c:B --> T:db_three
|
|
246
|
+
db_two:B --> T:brief
|
|
247
|
+
brief:R --> L:analyst
|
|
248
|
+
analyst:R --> L:delivery
|
|
249
|
+
|
|
250
|
+
align row src_a src_b src_c
|
|
251
|
+
align row db_one db_two db_three
|
|
252
|
+
align row brief analyst delivery
|
|
253
|
+
|
|
254
|
+
align column src_a db_one
|
|
255
|
+
align column src_b db_two brief
|
|
256
|
+
align column src_c db_three
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
```mermaid
|
|
260
|
+
architecture-beta
|
|
261
|
+
group sources(cloud)[Sources]
|
|
262
|
+
service src_a(server)[Source A] in sources
|
|
263
|
+
service src_b(server)[Source B] in sources
|
|
264
|
+
service src_c(server)[Source C] in sources
|
|
265
|
+
|
|
266
|
+
group storage(database)[Storage]
|
|
267
|
+
service db_one(database)[DB One] in storage
|
|
268
|
+
service db_two(database)[DB Two] in storage
|
|
269
|
+
service db_three(database)[DB Three] in storage
|
|
270
|
+
|
|
271
|
+
group output(disk)[Output]
|
|
272
|
+
service brief(disk)[Brief] in output
|
|
273
|
+
service analyst(server)[Analyst] in output
|
|
274
|
+
service delivery(cloud)[Delivery] in output
|
|
275
|
+
|
|
276
|
+
src_a:B --> T:db_one
|
|
277
|
+
src_b:B --> T:db_two
|
|
278
|
+
src_c:B --> T:db_three
|
|
279
|
+
db_two:B --> T:brief
|
|
280
|
+
brief:R --> L:analyst
|
|
281
|
+
analyst:R --> L:delivery
|
|
282
|
+
|
|
283
|
+
align row src_a src_b src_c
|
|
284
|
+
align row db_one db_two db_three
|
|
285
|
+
align row brief analyst delivery
|
|
286
|
+
|
|
287
|
+
align column src_a db_one
|
|
288
|
+
align column src_b db_two brief
|
|
289
|
+
align column src_c db_three
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
The result is three left-to-right tiers stacked vertically with a straight spine through the middle column. Edges between aligned nodes render as straight horizontal or vertical lines; cross-axis edges (e.g. `db_one:R --> T:hub`) get a single 90° elbow.
|
|
293
|
+
|
|
294
|
+
> **Tip:** if a long single-word label is too wide to fit on one line at small `iconSize` values, increase `iconSize` (or use a shorter title) to keep it on one line.
|
|
295
|
+
|
|
296
|
+
### Junctions
|
|
297
|
+
|
|
298
|
+
Junctions are a special type of node which acts as a potential 4-way split between edges.
|
|
299
|
+
|
|
300
|
+
The syntax for declaring a junction is:
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
junction {junction id} (in {parent id})?
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
```mermaid-example
|
|
307
|
+
architecture-beta
|
|
308
|
+
service left_disk(disk)[Disk]
|
|
309
|
+
service top_disk(disk)[Disk]
|
|
310
|
+
service bottom_disk(disk)[Disk]
|
|
311
|
+
service top_gateway(internet)[Gateway]
|
|
312
|
+
service bottom_gateway(internet)[Gateway]
|
|
313
|
+
junction junctionCenter
|
|
314
|
+
junction junctionRight
|
|
315
|
+
|
|
316
|
+
left_disk:R -- L:junctionCenter
|
|
317
|
+
top_disk:B -- T:junctionCenter
|
|
318
|
+
bottom_disk:T -- B:junctionCenter
|
|
319
|
+
junctionCenter:R -- L:junctionRight
|
|
320
|
+
top_gateway:B -- T:junctionRight
|
|
321
|
+
bottom_gateway:T -- B:junctionRight
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
```mermaid
|
|
325
|
+
architecture-beta
|
|
326
|
+
service left_disk(disk)[Disk]
|
|
327
|
+
service top_disk(disk)[Disk]
|
|
328
|
+
service bottom_disk(disk)[Disk]
|
|
329
|
+
service top_gateway(internet)[Gateway]
|
|
330
|
+
service bottom_gateway(internet)[Gateway]
|
|
331
|
+
junction junctionCenter
|
|
332
|
+
junction junctionRight
|
|
333
|
+
|
|
334
|
+
left_disk:R -- L:junctionCenter
|
|
335
|
+
top_disk:B -- T:junctionCenter
|
|
336
|
+
bottom_disk:T -- B:junctionCenter
|
|
337
|
+
junctionCenter:R -- L:junctionRight
|
|
338
|
+
top_gateway:B -- T:junctionRight
|
|
339
|
+
bottom_gateway:T -- B:junctionRight
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## Configuration
|
|
343
|
+
|
|
344
|
+
### `randomize` (v11.14.0+)
|
|
345
|
+
|
|
346
|
+
By default, architecture diagrams start nodes at deterministic seed positions (`randomize: false`). Setting `randomize` to `true` randomizes initial node positions before running the layout algorithm, which may produce varied but potentially better-spaced layouts on each render.
|
|
347
|
+
|
|
348
|
+
> Note: `randomize: false` alone is not enough to guarantee identical renders — the underlying fcose layout still calls `Math.random()` during its constraint solver. Use the `seed` option (described below) to lock the layout fully.
|
|
349
|
+
|
|
350
|
+
Via frontmatter:
|
|
351
|
+
|
|
352
|
+
```
|
|
353
|
+
%%{init: {"architecture": {"randomize": true}}}%%
|
|
354
|
+
architecture-beta
|
|
355
|
+
group api(cloud)[API]
|
|
356
|
+
service db(database)[Database] in api
|
|
357
|
+
service server(server)[Server] in api
|
|
358
|
+
db:R --> L:server
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Via `mermaid.initialize()`:
|
|
362
|
+
|
|
363
|
+
```javascript
|
|
364
|
+
mermaid.initialize({
|
|
365
|
+
architecture: {
|
|
366
|
+
randomize: true,
|
|
367
|
+
},
|
|
368
|
+
});
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
| Option | Type | Default | Description |
|
|
372
|
+
| ----------- | ------- | ------- | ---------------------------------------------------------------------- |
|
|
373
|
+
| `randomize` | boolean | `false` | Whether to randomize initial node positions before running the layout. |
|
|
374
|
+
|
|
375
|
+
### Layout tuning (v11.15.0+)
|
|
376
|
+
|
|
377
|
+
The following options pass through to the underlying [fcose](https://github.com/iVis-at-Bilkent/cytoscape.js-fcose) layout so you can adjust spacing and density without changing your diagram source:
|
|
378
|
+
|
|
379
|
+
| Option | Type | Default | Description |
|
|
380
|
+
| --------------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
381
|
+
| `nodeSeparation` | number | `75` | Minimum separation, in pixels, between sibling nodes in the same group. Pass-through to fcose. |
|
|
382
|
+
| `idealEdgeLengthMultiplier` | number | `1.5` | Multiplier applied to `iconSize` to compute the ideal length of edges between nodes within the same group. Increase for breathing room, decrease to pack tighter. Cross-group edges are not affected. |
|
|
383
|
+
| `edgeElasticity` | number | `0.45` | Spring elasticity (0–1) on same-group edges. Higher pulls connected nodes closer; lower lets them spread out. Cross-group edges are not affected. |
|
|
384
|
+
| `numIter` | number | `2500` | Maximum fcose iterations. Increase for higher-quality layouts on large diagrams at the cost of render time. |
|
|
385
|
+
| `seed` | number | `1` | Deterministic seed for fcose. Defaults to `1` so the same diagram always renders with the same layout. Set to `0` to opt out and use native (non-deterministic) `Math.random`. Any other number selects a different reproducible layout variant. |
|
|
386
|
+
|
|
387
|
+
Example — bumping `idealEdgeLengthMultiplier` stretches the spacing between connected nodes in a chain:
|
|
388
|
+
|
|
389
|
+
```
|
|
390
|
+
%%{init: {"architecture": {"idealEdgeLengthMultiplier": 3}}}%%
|
|
391
|
+
architecture-beta
|
|
392
|
+
service a(server)[A]
|
|
393
|
+
service b(server)[B]
|
|
394
|
+
service c(server)[C]
|
|
395
|
+
a:R --> L:b
|
|
396
|
+
b:R --> L:c
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
> **Note:** these knobs tune fcose's force-directed layout; they do not change which nodes the layout heuristic considers adjacent. If two siblings render on top of each other because they share the same logical position in the spatial map (a known limitation tracked in [#6120](https://github.com/mermaid-js/mermaid/issues/6120)), no combination of these knobs will move them apart — see the upcoming `align row|column` directive instead.
|
|
400
|
+
|
|
401
|
+
## Icons
|
|
402
|
+
|
|
403
|
+
By default, architecture diagram supports the following icons: `cloud`, `database`, `disk`, `internet`, `server`.
|
|
404
|
+
Users can use any of the 200,000+ icons available in iconify.design, or add other custom icons, by [registering an icon pack](../config/icons.md).
|
|
405
|
+
|
|
406
|
+
After the icons are installed, they can be used in the architecture diagram by using the format "name:icon-name", where name is the value used when registering the icon pack.
|
|
407
|
+
|
|
408
|
+
```mermaid-example
|
|
409
|
+
architecture-beta
|
|
410
|
+
group api(logos:aws-lambda)[API]
|
|
411
|
+
|
|
412
|
+
service db(logos:aws-aurora)[Database] in api
|
|
413
|
+
service disk1(logos:aws-glacier)[Storage] in api
|
|
414
|
+
service disk2(logos:aws-s3)[Storage] in api
|
|
415
|
+
service server(logos:aws-ec2)[Server] in api
|
|
416
|
+
|
|
417
|
+
db:L -- R:server
|
|
418
|
+
disk1:T -- B:server
|
|
419
|
+
disk2:T -- B:db
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
```mermaid
|
|
423
|
+
architecture-beta
|
|
424
|
+
group api(logos:aws-lambda)[API]
|
|
425
|
+
|
|
426
|
+
service db(logos:aws-aurora)[Database] in api
|
|
427
|
+
service disk1(logos:aws-glacier)[Storage] in api
|
|
428
|
+
service disk2(logos:aws-s3)[Storage] in api
|
|
429
|
+
service server(logos:aws-ec2)[Server] in api
|
|
430
|
+
|
|
431
|
+
db:L -- R:server
|
|
432
|
+
disk1:T -- B:server
|
|
433
|
+
disk2:T -- B:db
|
|
434
|
+
```
|