From 8b238b05fe601b6705dd0a5f006f9f4667730323 Mon Sep 17 00:00:00 2001 From: huyenngn Date: Tue, 12 Nov 2024 10:26:45 +0100 Subject: [PATCH] docs: Add expamles for custom_diagram --- docs/custom_diagram.md | 55 ++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/docs/custom_diagram.md b/docs/custom_diagram.md index e1014e9..4e2cd2d 100644 --- a/docs/custom_diagram.md +++ b/docs/custom_diagram.md @@ -5,28 +5,51 @@ # Custom Diagram -`Custom diagram`s let's you create custom diagrams based on the data in the model. You define the data collection using a YAML-based declarative language. +`Custom diagram`s let's you create custom diagrams based on the data in the model. You define the data collection using a dictionary. You can access `.custom_diagram` on any supported model element. ## Example -Here is an example YAML file that declares a context diagram: +Here are example collection definitions in YAML format for different diagrams: -```yaml -get: - - name: inputs - include: - - name: exchanges - - name: links - - name: outputs - include: - - name: exchanges - - name: links - - name: ports +??? example "Custom diagram for context" + + ```yaml + get: + - name: inputs + include: + - name: exchanges + - name: links + - name: outputs + include: + - name: exchanges + - name: links + - name: ports + include: + - name: exchanges + - name: links + ``` + +??? example "Custom diagram for cable tree" + + ```yaml + repeat: -1 + get: + - name: source + include: + name: links + - name: target + include: + name: links + ``` + +??? example "Custom diagram for exchanges" + + ```yaml include: - - name: exchanges - - name: links -``` + - name: allocated_functional_exchanges + - name: allocated_interactions + ``` ## Collector definition