Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Commit 45dfe34

Browse files
Tidy up of how group IDs are generated.
1 parent 5de1fbe commit 45dfe34

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

src/main/java/com/structurizr/export/mermaid/MermaidDiagramExporter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public MermaidDiagramExporter() {
3232

3333
@Override
3434
protected void writeHeader(ModelView view, IndentingWriter writer) {
35+
groupId = 0;
3536
String direction = "TB";
3637

3738
if (view.getAutomaticLayout() != null) {

src/test/java/com/structurizr/export/mermaid/MermaidDiagramExporterTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,22 +261,22 @@ public void test_renderGroupStyles() {
261261
" subgraph diagram [System Landscape]\n" +
262262
" style diagram fill:#ffffff,stroke:#ffffff\n" +
263263
"\n" +
264-
" subgraph group4 [Group 1]\n" +
265-
" style group4 fill:#ffffff,stroke:#111111,color:#111111\n" +
264+
" subgraph group1 [Group 1]\n" +
265+
" style group1 fill:#ffffff,stroke:#111111,color:#111111\n" +
266266
"\n" +
267267
" 1[\"<div style='font-weight: bold'>User 1</div><div style='font-size: 70%; margin-top: 0px'>[Person]</div>\"]\n" +
268268
" style 1 fill:#dddddd,stroke:#9a9a9a,color:#000000\n" +
269269
" end\n" +
270270
"\n" +
271-
" subgraph group5 [Group 2]\n" +
272-
" style group5 fill:#ffffff,stroke:#222222,color:#222222\n" +
271+
" subgraph group2 [Group 2]\n" +
272+
" style group2 fill:#ffffff,stroke:#222222,color:#222222\n" +
273273
"\n" +
274274
" 2[\"<div style='font-weight: bold'>User 2</div><div style='font-size: 70%; margin-top: 0px'>[Person]</div>\"]\n" +
275275
" style 2 fill:#dddddd,stroke:#9a9a9a,color:#000000\n" +
276276
" end\n" +
277277
"\n" +
278-
" subgraph group6 [Group 3]\n" +
279-
" style group6 fill:#ffffff,stroke:#aabbcc,color:#aabbcc\n" +
278+
" subgraph group3 [Group 3]\n" +
279+
" style group3 fill:#ffffff,stroke:#aabbcc,color:#aabbcc\n" +
280280
"\n" +
281281
" 3[\"<div style='font-weight: bold'>User 3</div><div style='font-size: 70%; margin-top: 0px'>[Person]</div>\"]\n" +
282282
" style 3 fill:#dddddd,stroke:#9a9a9a,color:#000000\n" +

src/test/java/com/structurizr/export/mermaid/groups-Components.mmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ graph TB
1010
subgraph 6 [F]
1111
style 6 fill:#ffffff,stroke:#444444,color:#444444
1212

13-
subgraph group4 [Group 4]
14-
style group4 fill:#ffffff,stroke:#cccccc,color:#cccccc
13+
subgraph group1 [Group 4]
14+
style group1 fill:#ffffff,stroke:#cccccc,color:#cccccc
1515

1616
8["<div style='font-weight: bold'>H</div><div style='font-size: 70%; margin-top: 0px'>[Component]</div>"]
1717
style 8 fill:#dddddd,stroke:#9a9a9a,color:#000000

src/test/java/com/structurizr/export/mermaid/groups-Containers.mmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ graph TB
1010
subgraph 4 [D]
1111
style 4 fill:#ffffff,stroke:#444444,color:#444444
1212

13-
subgraph group3 [Group 3]
14-
style group3 fill:#ffffff,stroke:#cccccc,color:#cccccc
13+
subgraph group1 [Group 3]
14+
style group1 fill:#ffffff,stroke:#cccccc,color:#cccccc
1515

1616
6["<div style='font-weight: bold'>F</div><div style='font-size: 70%; margin-top: 0px'>[Container]</div>"]
1717
style 6 fill:#dddddd,stroke:#9a9a9a,color:#000000

0 commit comments

Comments
 (0)