Skip to content

Commit 7c448e1

Browse files
structurizr-export: Adds support for rank and node separation to the StructurizrPlantUMLExporter.
1 parent 8a9db84 commit 7c448e1

File tree

13 files changed

+29
-0
lines changed

13 files changed

+29
-0
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- structurizr-dsl: Allows archetypes to be used via workspace extension.
66
- structurizr-dsl: Fixes https://github.com/structurizr/java/issues/392 (SVG not supported in base 64 encoding not mentioned in documentation).
7+
- structurizr-export: Adds support for rank and node separation to the StructurizrPlantUMLExporter.
78

89
## v4.0.0 (28th March 2025)
910

structurizr-export/src/main/java/com/structurizr/export/plantuml/StructurizrPlantUMLExporter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ protected void writeHeader(ModelView view, IndentingWriter writer) {
4242
writer.writeLine("top to bottom direction");
4343
break;
4444
}
45+
46+
// the default 300px rank separation in the Structurizr UI is equivalent to a default of 60 in PlantUML
47+
writer.writeLine("skinparam ranksep " + view.getAutomaticLayout().getRankSeparation() / (300/60));
48+
49+
// the default 300px node separation in the Structurizr UI is equivalent to a default of 30 in PlantUML
50+
writer.writeLine("skinparam nodesep " + view.getAutomaticLayout().getNodeSeparation() / (300/30));
4551
} else {
4652
writer.writeLine("top to bottom direction");
4753
}

structurizr-export/src/test/java/com/structurizr/export/plantuml/structurizr/36141-Components.puml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ set separator none
33
title Internet Banking System - API Application - Components
44

55
top to bottom direction
6+
skinparam ranksep 60
7+
skinparam nodesep 30
68

79
skinparam {
810
arrowFontSize 10

structurizr-export/src/test/java/com/structurizr/export/plantuml/structurizr/36141-Containers.puml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ set separator none
33
title Internet Banking System - Containers
44

55
top to bottom direction
6+
skinparam ranksep 60
7+
skinparam nodesep 30
68

79
skinparam {
810
arrowFontSize 10

structurizr-export/src/test/java/com/structurizr/export/plantuml/structurizr/36141-DevelopmentDeployment.puml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ set separator none
33
title Internet Banking System - Deployment - Development
44

55
top to bottom direction
6+
skinparam ranksep 60
7+
skinparam nodesep 30
68

79
skinparam {
810
arrowFontSize 10

structurizr-export/src/test/java/com/structurizr/export/plantuml/structurizr/36141-LiveDeployment.puml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ set separator none
33
title Internet Banking System - Deployment - Live
44

55
top to bottom direction
6+
skinparam ranksep 60
7+
skinparam nodesep 30
68

79
skinparam {
810
arrowFontSize 10

structurizr-export/src/test/java/com/structurizr/export/plantuml/structurizr/36141-SignIn.puml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ set separator none
33
title API Application - Dynamic
44

55
top to bottom direction
6+
skinparam ranksep 60
7+
skinparam nodesep 30
68

79
skinparam {
810
arrowFontSize 10

structurizr-export/src/test/java/com/structurizr/export/plantuml/structurizr/36141-SystemContext.puml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ set separator none
33
title Internet Banking System - System Context
44

55
top to bottom direction
6+
skinparam ranksep 60
7+
skinparam nodesep 30
68

79
skinparam {
810
arrowFontSize 10

structurizr-export/src/test/java/com/structurizr/export/plantuml/structurizr/36141-SystemLandscape.puml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ set separator none
33
title System Landscape
44

55
top to bottom direction
6+
skinparam ranksep 60
7+
skinparam nodesep 30
68

79
skinparam {
810
arrowFontSize 10

structurizr-export/src/test/java/com/structurizr/export/plantuml/structurizr/54915-AmazonWebServicesDeployment.puml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ set separator none
33
title Spring PetClinic - Deployment - Live
44

55
left to right direction
6+
skinparam ranksep 60
7+
skinparam nodesep 30
68

79
skinparam {
810
arrowFontSize 10

0 commit comments

Comments
 (0)