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

Commit

Permalink
Fixes an issue with some older client libraries not setting the rank …
Browse files Browse the repository at this point in the history
…direction.
  • Loading branch information
Simon Brown committed Jun 5, 2023
1 parent 51311d2 commit f5173b1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ targetCompatibility = 1.8

description = 'Automatic layout facilities for Structurizr views'
group = 'com.structurizr'
version = '2.0.0'
version = '2.0.1'

test {
useJUnitPlatform()
Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.0.1 (5th June 2023)

- Fixes an issue with some older client libraries not setting the rank direction.

## 2.0.0 (31st March 2023)

- Switched to using the [structurizr-export library](https://github.com/structurizr/export) for generating DOT files.
Expand Down
30 changes: 17 additions & 13 deletions src/main/java/com/structurizr/graphviz/DOTExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,23 @@ void setLocale(Locale locale) {
@Override
protected void writeHeader(ModelView view, IndentingWriter writer) {
if (view.getAutomaticLayout() != null) {
switch (view.getAutomaticLayout().getRankDirection()) {
case TopBottom:
rankDirection = RankDirection.TopBottom;
break;
case BottomTop:
rankDirection = RankDirection.BottomTop;
break;
case LeftRight:
rankDirection = RankDirection.LeftRight;
break;
case RightLeft:
rankDirection = RankDirection.RightLeft;
break;
if (view.getAutomaticLayout().getRankDirection() == null) {
rankDirection = RankDirection.TopBottom;
} else {
switch (view.getAutomaticLayout().getRankDirection()) {
case TopBottom:
rankDirection = RankDirection.TopBottom;
break;
case BottomTop:
rankDirection = RankDirection.BottomTop;
break;
case LeftRight:
rankDirection = RankDirection.LeftRight;
break;
case RightLeft:
rankDirection = RankDirection.RightLeft;
break;
}
}

rankSeparation = view.getAutomaticLayout().getRankSeparation();
Expand Down

0 comments on commit f5173b1

Please sign in to comment.