You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Renders a system architecture as a Mermaid flowchart with optional containers (systems), interfaces, highlights, and flow-focused slices.
131
+
132
+
```handlebars
133
+
{{!-- Basic: render entire architecture --}}
134
+
{{block-architecture this}}
135
+
136
+
{{!-- Hide containers (just the services) --}}
137
+
{{block-architecture this include-containers="none"}}
138
+
139
+
{{!-- Show node interfaces as small attachment boxes --}}
140
+
{{block-architecture this render-interfaces=true}}
141
+
142
+
{{!-- Focus specific nodes (comma-separated) and highlight them --}}
143
+
{{block-architecture this focus-nodes="trading-system,position-system" highlight-nodes="trade-svc,position-svc"}}
144
+
145
+
{{!-- Focus one or more flows by unique-id or name (case-insensitive) --}}
146
+
{{block-architecture this focus-flows="order-flow"}}
147
+
148
+
{{!-- Flow focus + hide containers --}}
149
+
{{block-architecture this focus-flows="order-flow" include-containers="none"}}
150
+
151
+
{{!-- Multiple flows --}}
152
+
{{block-architecture this focus-flows="order-flow,onboarding-flow"}}
153
+
```
154
+
155
+
**What it shows**
156
+
-**Containers (systems)** as Mermaid subgraphs, with contained **nodes (services, dbs, etc.)** inside.
157
+
- Optional **interfaces** as dotted attachments to their parent node.
158
+
-**Edges** for `connects`/`interacts` relationships, using the relationship **`description`** as the label when present.
159
+
-**Highlights** for any nodes listed in `highlight-nodes`.
160
+
- Optional **clickable links** per node/interface (via `link-prefix` or `link-map`).
161
+
162
+
**Options**
163
+
164
+
| Option | Type | Default | Description |
165
+
|-----------------------|---|---:|---|
166
+
|`focus-nodes`| string (CSV) | — | Restrict the view to these node IDs (and, if containers are shown, their parent/child context per other options). |
167
+
|`focus-relationships`| string (CSV) | — | Restrict view to the specified relationship unique-ids. Only those relationships and the nodes they connect are included (plus containers per settings). |
168
+
|`focus-flows`| string (CSV) | — | Restrict edges to transitions that belong to the given **flow unique-ids or names** (case-insensitive). Only nodes touching those edges are included (plus containers per settings). |
169
+
|`focus-controls`| string (CSV) | — | Restrict view to nodes and relationships linked to the specified control IDs. Only nodes touching those controls are included (plus containers per settings). |
170
+
|`focus-interfaces`| string (CSV) | — | Restrict view to nodes and relationships linked to the specified interface IDs. Only nodes touching those interfaces are included (plus containers per settings). ||`highlight-nodes`| string (CSV) | — | Nodes to visually highlight. |
171
+
|`render-interfaces`| boolean |`false`| If `true`, render each node’s `interfaces` as small interface boxes connected by dotted lines. |
172
+
|`include-containers`|`'none' \| 'parents' \| 'all'`|`'all'`| Which containers (systems) to draw. |
173
+
|`include-children`|`'none' \| 'direct' \| 'all'`|`'all'`| When focusing container nodes, include their direct/all descendants. |
174
+
|`edges`|`'connected' \| 'seeded' \| 'all' \| 'none'`|`'connected'`| For non-flow views, expand visible set with directly connected neighbors. When flows are focused, only flow edges are shown. |
175
+
|`node-types`| string (CSV) | — | Only include nodes whose `node-type` is in this list. |
176
+
|`direction`|`'both' \| 'in' \| 'out'`|`'both'`| Reserved (currently not used by the renderer). |
177
+
|`edge-labels`|`'description' \| 'none'`|`'description'`| Use the relationship `description` for edge labels; or hide labels entirely. |
178
+
|`link-prefix`| string | — | Prefix for clickable `click` links in Mermaid (e.g., `/docs/` makes `/docs/<node-id>`). |
> **Sorting:** Containers and nodes are always sorted **alphabetically by label** for stable layouts.
182
+
183
+
**Context requirements**
184
+
- The context must be a **CALM core canonical model**, e.g. `{ nodes, relationships, flows? }`.
185
+
- To use `focus-flows`, `context.flows` must include the target flows. Each flow’s `transitions[*].relationship-unique-id` must point to a relationship in `context.relationships`.
0 commit comments