38

I am using PlantUML API to generate Activity Diagram.

I have used GraphViz before and used rank parameter to define layout

rank=LR [for left to right]

I am trying to find similiar thing in PlantUML where I can change its orientation to "Left to Right" instead of existing layout i.e. "Top to Bottom".

Hash
  • 4,647
  • 5
  • 21
  • 39
Makky
  • 17,117
  • 17
  • 63
  • 86

1 Answers1

62

You can use the following command with State, Class, Component or Usecase diagrams:

left to right direction

(see https://plantuml.com/use-case-diagram#d551e48d272b2b07)

Edit: This comment from 2012 originally claimed that the feature was scheduled for the next release. It's been available forever now.

Christian Davén
  • 16,713
  • 12
  • 64
  • 77
PlantUML
  • 921
  • 7
  • 6
  • 2
    This is implemented as beta feature in version 7929. – PlantUML May 20 '12 at 20:43
  • 2
    I have 3 namespaces in the UML. The image that gets generated is too **wide**. I tried to use _top to bottom direction_ but that hasn't had any effect – MMM Apr 04 '15 at 10:43
  • 4
    @MMM Same for me. Interestingly, if I use `left to right`, I get a narrower diagram. – Justin R. Dec 15 '17 at 20:24
  • 3
    Using `left to right direction` also seems to transpose the direction of the arrows in a Class Diagram – if you have arrows pointing `-up->`, they will be rendered pointing left, but arrows pointing `-left->` will render pointing up. – PJSCopeland Oct 24 '19 at 21:07