Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#174 Add LAYOUT_LANDSCAPE() #177

Merged

Conversation

kirchsth
Copy link
Contributor

@kirchsth kirchsth commented Aug 21, 2021

This PR solves the #174 issue.

LAYOUT_LEFT_RIGHT() rotates the default flow direction and the directed relations rotates, e.g. Rel_Right() is displayed as relation from up to down, like below

@startuml
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Container.puml

LAYOUT_LEFT_RIGHT()

Person(admin, "Administrator")
System_Boundary(c1, 'Sample') {
    Container(web_app, "Web Application", "C#, ASP.NET Core 2.1 MVC", "Allows users to compare multiple Twitter timelines")
}
System(twitter, "Twitter")

Rel(admin, web_app, "Uses", "HTTPS")
Rel(web_app, twitter, "Gets tweets from", "HTTPS")

System(S,"S")
System(SU,"S Up")
System(SD,"S Down")
System(SL,"S Left")
System(SR,"S Right")

Rel_Up(S, SU, "Up")
Rel_Down(S, SD, "Down")
Rel_Left(S, SL, "Left")
Rel_Right(S, SR, "Right")

SHOW_LEGEND()
@enduml

The new LAYOUT_LANDSCAPE() rotates only the default flow direction and the directed relation are not rotated anymore, e.g. Rel_Right() remains a relation from left to right, like below

@startuml LAYOUT_LANDSCAPE Sample
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Container.puml

LAYOUT_LANDSCAPE()

Person(admin, "Administrator")
System_Boundary(c1, 'Sample') {
    Container(web_app, "Web Application", "C#, ASP.NET Core 2.1 MVC", "Allows users to compare multiple Twitter timelines")
}
System(twitter, "Twitter")

Rel(admin, web_app, "Uses", "HTTPS")
Rel(web_app, twitter, "Gets tweets from", "HTTPS")

System(S,"S")
System(SU,"S Up")
System(SD,"S Down")
System(SL,"S Left")
System(SR,"S Right")

Rel_Up(S, SU, "Up")
Rel_Down(S, SD, "Down")
Rel_Left(S, SL, "Left")
Rel_Right(S, SR, "Right")

SHOW_LEGEND()

@enduml

It can be tested with my extended branch.

@oliv3r: can you test it with your larger diagrams and add your comments?

Best regards
Helmut

Copy link
Member

@Potherca Potherca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Potherca Potherca added this to the v2.4.0 milestone Aug 24, 2021
@Potherca Potherca added the enhancement New feature or request label Aug 24, 2021
@kirchsth kirchsth merged commit abe5940 into plantuml-stdlib:master Aug 24, 2021
@kirchsth kirchsth deleted the feature/174_Direction_Right branch September 29, 2021 13:52
@oliv3r
Copy link

oliv3r commented Oct 7, 2021

Hey @kirchsth It seems to work for simple systems, but I noticed that for whatever reason 'up' is rendered as 'down' and vice versa on more complex systems. Actually in complex systems I see really odd things happening. I'll see if I can translate something to publish it ...

(Also, could it be you forgot Lay_[URDL]? :) Haven't checked those in depth yet though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Rel_Left/Right/Up/Down are not followed when using LAYOUT_LEFT_RIGHT.
3 participants