|
141 | 141 | - If you believe the component references a specific file, include the file path.
|
142 | 142 | - Make sure to include the full path to the directory or file exactly as specified in the component mapping.
|
143 | 143 | - It is very important that you do this for as many files as possible. The more the better.
|
144 |
| -- IMPORTANT: these are for click events only, these paths should not be included in the diagram's node's names. |
| 144 | +
|
| 145 | +- IMPORTANT: THESE PATHS ARE FOR CLICK EVENTS ONLY, these paths should not be included in the diagram's node's names. Only for the click events. Paths should not be seen by the user. |
145 | 146 |
|
146 | 147 | Your output should be valid Mermaid.js code that can be rendered into a diagram.
|
147 | 148 |
|
|
152 | 153 |
|
153 | 154 | Ensure that your diagram adheres strictly to the given explanation, without adding or omitting any significant components or relationships.
|
154 | 155 |
|
| 156 | +As a very general direction, the provided example below is a good flow for your code: |
| 157 | +
|
| 158 | +```mermaid |
| 159 | +flowchart TD |
| 160 | + %% or graph TD, your choice |
| 161 | +
|
| 162 | + %% Global entities |
| 163 | + A("Entity A"):::external |
| 164 | + %% more... |
| 165 | +
|
| 166 | + %% Subgraphs and modules |
| 167 | + subgraph "Layer A" |
| 168 | + A1("Module A"):::example |
| 169 | + %% more modules... |
| 170 | + %% inner subgraphs if needed... |
| 171 | + end |
| 172 | +
|
| 173 | + %% more subgraphs, modules, etc... |
| 174 | +
|
| 175 | + %% Connections |
| 176 | + A -->|"relationship"| B |
| 177 | + %% and a lot more... |
| 178 | +
|
| 179 | + %% Click Events |
| 180 | + click A1 "example/example.js" |
| 181 | + %% and a lot more... |
| 182 | +
|
| 183 | + %% Styles |
| 184 | + classDef frontend %%... |
| 185 | + %% and a lot more... |
| 186 | +``` |
| 187 | +
|
155 | 188 | EXTREMELY Important notes on syntax!!! (PAY ATTENTION TO THIS):
|
156 | 189 | - Make sure to add colour to the diagram!!! This is extremely critical.
|
157 | 190 | - In Mermaid.js syntax, we cannot include special characters for nodes without being inside quotes! For example: `EX[/api/process (Backend)]:::api` and `API -->|calls Process()| Backend` are two examples of syntax errors. They should be `EX["/api/process (Backend)"]:::api` and `API -->|"calls Process()"| Backend` respectively. Notice the quotes. This is extremely important. Make sure to include quotes for any string that contains special characters.
|
158 | 191 | - In Mermaid.js syntax, you cannot apply a class style directly within a subgraph declaration. For example: `subgraph "Frontend Layer":::frontend` is a syntax error. However, you can apply them to nodes within the subgraph. For example: `Example["Example Node"]:::frontend` is valid, and `class Example1,Example2 frontend` is valid.
|
| 192 | +- In Mermaid.js syntax, there cannot be spaces in the relationship label names. For example: `A -->| "example relationship" | B` is a syntax error. It should be `A -->|"example relationship"| B` |
159 | 193 | """
|
160 | 194 | # ^^^ note: ive generated a few diagrams now and claude still writes incorrect mermaid code sometimes. in the future, refer to those generated diagrams and add important instructions to the prompt above to avoid those mistakes. examples are best.
|
161 | 195 |
|
|
0 commit comments