Issue with vertical alignment of UML elements from PlantUML

45 Views Asked by At

I cannot align namespaces/classes vertically in PlantUML output. E.g.:

@startuml
namespace AAA {

    class MyBaseClass {
    }

    class MyDerivedClass {
    }

    MyBaseClass <|-- MyDerivedClass
}

namespace BBB {
    class OtherClass {
    }

    class YetAnotherClass {
    }

    OtherClass  <|-- YetAnotherClass
}

AAA ---down---> BBB

hide circle
@enduml

Output:

Is there a way to get namespace BBB under AAA?

1

There are 1 best solutions below

2
Fuhrmanator On BEST ANSWER

Is there a way to get namespace BBB under AAA?

It's possible with left to right direction (but it's not easy to maintain, since left is up, etc.):

@startuml
left to right direction
hide circle
hide empty members

namespace BBB {
    class OtherClass {
    }

    class YetAnotherClass {
    }

    OtherClass  <|-left- YetAnotherClass
}

namespace AAA {

    class MyBaseClass {
    }

    class MyDerivedClass {
    }

    MyBaseClass <|-left- MyDerivedClass
}

'AAA -> BBB

@enduml

enter image description here