Skip to content

Commit 1dbfe25

Browse files
committed
Fix all diagram containment issues and add documentation
- Removed redundant classDef space and class definitions from all diagrams - Fixed Minikube Architecture, Debug Container Approach, Sidecar Approach diagrams - Updated contributing documentation with guidelines for proper subgraph containment - Added detailed instructions on how to ensure proper wrapping of elements - Documented the need to exclude explicit text color from subgraph labels - Ensured consistent styling across all diagrams Signed-off-by: Aaron Lippold <[email protected]>
1 parent d9cce81 commit 1dbfe25

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
lines changed

docs/contributing/diagram-color-guide.md

+29-1
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,39 @@ flowchart TD
7070
When creating Mermaid diagrams, use the following style properties:
7171

7272
```
73-
style NodeID fill:#HexColor,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF,font-weight:bold
73+
style NodeID fill:#HexColor,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
7474
```
7575

7676
For light mode compatibility, white text (#FFFFFF) works well with all the recommended background colors.
7777

78+
### Proper Subgraph Containment
79+
80+
When using subgraphs in Mermaid diagrams, follow these guidelines to ensure proper containment and wrapping:
81+
82+
1. **Always add `direction TB` inside subgraphs**: This ensures proper containment of elements within the subgraph
83+
84+
```mermaid
85+
flowchart TD
86+
subgraph MySubgraph["My Subgraph Title"]
87+
direction TB
88+
A --> B
89+
B --> C
90+
end
91+
```
92+
93+
2. **Avoid using `classDef space` and `class` definitions** in your diagrams, as these can interfere with proper rendering and containment. Instead, rely on the default sizing and standard styling.
94+
95+
3. **Consistent styling for subgraphs**:
96+
```
97+
style subgraphID fill:none,stroke:#DD6100,stroke-width:4px
98+
```
99+
100+
4. **Remove explicit text color and font-weight from subgraph labels** to allow for automatic theme handling:
101+
- Do NOT use: `style subgraphID fill:none,stroke:#DD6100,stroke-width:4px,color:#FFFFFF,font-weight:bold`
102+
- Instead use: `style subgraphID fill:none,stroke:#DD6100,stroke-width:4px`
103+
104+
These guidelines help ensure that subgraphs display correctly in both light and dark modes, with proper containment and wrapping of their elements.
105+
78106
## Dark Mode Considerations
79107

80108
Our CSS and JavaScript configuration ensures that diagrams display properly in dark mode by:

docs/overview/mermaid-diagrams.md

-22
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ flowchart TD
4848
style rbac fill:#0066CC,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
4949
style saf fill:#0066CC,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
5050
51-
%% Add more vertical space
52-
classDef space height:20px;
53-
class MiniKubeCluster,ControlNode,WorkerNode1,WorkerNode2 space;
5451
```
5552

5653
## Kubernetes API Approach Workflow
@@ -138,9 +135,6 @@ flowchart TD
138135
style process fill:#217645,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
139136
style terminate fill:#505050,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
140137
141-
%% Add more vertical space
142-
classDef space height:20px;
143-
class step1,step2 space;
144138
```
145139

146140
## Sidecar Approach Workflow
@@ -186,10 +180,6 @@ flowchart TD
186180
style store_results fill:#4C366B,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
187181
style process_results fill:#217645,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
188182
style retrieve_results fill:#4C366B,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
189-
190-
%% Add more vertical space
191-
classDef space height:20px;
192-
class step1,step2 space;
193183
```
194184

195185
## Enhanced Kubernetes API Approach Workflow
@@ -296,10 +286,6 @@ flowchart TD
296286
style process fill:#217645,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
297287
style copy_results fill:#4C366B,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
298288
style cleanup fill:#505050,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
299-
300-
%% Add more vertical space
301-
classDef space height:20px;
302-
class stage1,stage2,stage3 space;
303289
```
304290

305291
## GitLab CI Sidecar Approach
@@ -351,10 +337,6 @@ flowchart TD
351337
style retrieve fill:#505050,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
352338
style process fill:#217645,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
353339
style upload fill:#4C366B,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
354-
355-
%% Add more vertical space
356-
classDef space height:20px;
357-
class stage1,stage2,stage3 space;
358340
```
359341

360342
## GitHub Actions Kubernetes API Approach
@@ -406,10 +388,6 @@ flowchart TD
406388
style run_cinc fill:#217645,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
407389
style process fill:#217645,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
408390
style generate_reports fill:#4C366B,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF
409-
410-
%% Add more vertical space
411-
classDef space height:20px;
412-
class step1,step2,step3 space;
413391
```
414392

415393
## GitHub Actions Sidecar Approach

0 commit comments

Comments
 (0)