Why are components not arranged in the order they are declared?

0 votes
asked Nov 22, 2017 in Bug by Ajay
I am using PlantUML with eclipse and graphviz 2.40.1.

The components are not appearing in the order I declare them. for example when I type this

@startuml

left to right direction

package "ServicesLayer" {

    package "Java based services" {

        [Service 1]

        [Service 2]

    }

}

package "CMS" {

  [Customer Management System]

}

@enduml

I see the "CMS" package above the "Service Layer" package. How do I make this work? i.e. the components and package to appear in the order I have declared them.

1 Answer

0 votes
answered Nov 23, 2017 by Serge Wenger Work (8,870 points)

Hello,

First, graphviz 2.40.1. is normaly not a tested version for plantuml (see FAQ).

Positionning is not perfect with graphviz. You can give indication only. I add an hidden line to solve your problem:

@startuml
left to right direction
package "ServicesLayer" as ServicesLayer {
    package "Java based services" {
        [Service 1]
        [Service 2]
    }
}
package "CMS" as Cms {
  [Customer Management System]
}
ServicesLayer -[hidden]-> Cms
@enduml​

http://www.plantuml.com/plantuml/png/PO-n2eD044Jx-uh5tYBvW23OXLXPYiNgRVI8TuRRLP3Wl-SqHu9aok7Dp6x6WbucEwY1xW8oWZTTBw2DfrRCwDGJsmTs14b9VZOjyGqNyWaWmy61buAWBtx56Q519WqSkIGocweOXbFzxvq_tghMttnUbFjeRdclgVA9PRHXk40N24jEe5nOoDOXTxmjhNgZDRawlMm5AYEdmzDl

...