Display bug with class diagram

0 votes
asked May 14, 2016 in Bug by graffity2199 (200 points)

I have a small display bug using the latest plantuml and graphviz version.

It is the relation between Role and UserRole on the left :

http://plantuml.com/plantuml/png/PT71Ri8m303GUxuYwX416bV4fHlJb0DbQWltABLG9Pem9pcn_VkSj93ItfndrubTTPNMyigXLyuZy3lZoZJ0jy5QVM5_ZAbOSxA0b7uvVmDQCqESKNMJ2gPOccimJw5eqeMDT1ADwSQ6L3e-Kn_GlkD3Ytn_48MewZAlZ-MI7V8Y__gauEDOrALuFqKzYqfGaDwm7ouAC_F9r0HQTg_muusJ9ArsS06C7o58rnfDIjqWK0DMONiRDBqthc_tkrgbnKqDfnBNnjBFMOmgvzfNFpURlQtNYunJCjjaps7d-PWEodhUHEkJZ-9_

Here is the associated code :

@startuml
class Structure {
 code : String
}

class User {
}

class UserPerso {
}

class UserPro {
}

class UserSpace {
}

class UserRole {
userId : String
dataroomId : String
roleId : String
}

enum Role {
ADMINISTRATOR,
MANAGER,
CONTRIBUTOR,
VISITOR
}

class Dataroom {
   code : String
   name : String
   quota : integer
   creation : Date
   description : String
}

User <|-- UserPerso
User <|-- UserPro
User <|-- UserSpace
Structure *-- UserPro
Structure *-- UserSpace
UserRole "0..*" -- "1" Dataroom
UserRole "0..*" - "1" User
Role "1" - "0..*" UserRole
@enduml

 

Thanks a lot !

1 Answer

0 votes
answered May 15, 2016 by plantuml (294,960 points)
edited May 15, 2016 by plantuml

The layout is done by GraphViz, so it's difficult for PlantUML to change this...

Luckily, there are some hacks :-)

First, you can group in the same (dummy) package Role, UserRole and User, to force GraphViz to layout those classes closer.
Also, there is "skinparam nodesep" command to increase distance between classes, and remove label overlapping:

http://plantuml.com/plantuml/uml/PP4nRuCm48Lt_mgBCMgYPCbGTQ5DL7a8gO1qj-24K89Dp_QKvh_tR2WGsEw-z-viFvjhhLg9ik5Abs2WvVijAsxI69vPT8Lr2FpEU44gV_MiLXLxCDQRBWRm2z1eCZsU82vGrie2EaZLLLQ-6UMvFTKtRt1KYd8ykvHMejRDb25Pfptj0UKQtg-83oUHY2nFu_oSlh1JdCIVHoe-pacUYlTBeDyY4rJGx72BGt-K3u3F8Y2WPFCCVfosaaYjB5I0OGX1sbehehGDFAAO2wpRdeut3Xcy_QxNOwXpXdCI8cNZJwqcpYNjt4EsqNQpMKMSn6WN3OzTwa7sb7Lu5rWd_fl_0000

Finally, in the last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
we have added a "together" keyword used instead of "package" than allow you to group together classes (but without drawing packages).
This is not perfect, but this is a possible solution.

Following your example, you could have with this new beta:

...
together {
 class UserRole
 class User
 enum Role
}
...


Any thought ?

Thanks!

...