skinparam linetype ortho breaks skinparam groupInheritance

0 votes
asked Nov 29, 2017 in Bug by Anthony-Gaudino (5,720 points)
edited Nov 29, 2017 by Anthony-Gaudino

When I use skinparam linetype ortho it breaks skinparam groupInheritance.

PlantUML version 1.2017.15 (Mon Jul 03 18:45:34 CEST 2017)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 1.8.0_151-8u151-b12-1-b12
Operating System: Linux
OS Version: 4.13.0-1-amd64
Default Encoding: UTF-8
Language: en
Country: US
Machine: debian
PLANTUML_LIMIT_SIZE: 4096
Processors: 4
Max Memory: 708,837,376
Total Memory: 48,234,496
Free Memory: 44,135,584
Used Memory: 4,098,912
Thread Active Count: 1

The environment variable GRAPHVIZ_DOT has not been set
Dot executable is /usr/bin/dot
Dot version: dot - graphviz version 2.38.0 (20140413.2041)
Installation seems OK. File generation OK

@startuml

skinparam groupInheritance 3
skinparam linetype ortho

abstract class Group
'abstract AbstractCollection
'interface List
'interface Collection

User     "*" o-- "1" Group    : < has
Group    "1" o-- "*" Activity :   has >
Activity "1" --o "*" Item     :   has >


/'
********************************************************************************

   Inheritances

********************************************************************************
'/

together {
    Group <|-- Apartment
    Group <|-- Events
    Group <|-- Travels
}


@enduml


Generates:

1 Answer

+1 vote
answered Dec 2, 2017 by Anthony-Gaudino (5,720 points)

I created two hacks to solve this, the first one uses the diamond as intermediary element between the elements, the second a rectangle, the diamond seems better. It would be nice to have a placeholder element that is invisible to help arranging elements, just like the invisible lines.


Diamond:

@startuml

!define INV_S(s)       <color:#FFFFFFF>s<color:Black>
!define S              |
!define SPACE_01       INV_S(S)
!define SPACE_02       INV_S(SS)
!define SPACE_03       INV_S(SSS)
!define SPACE_04       INV_S(SSSS)
!define SPACE_05       INV_S(SSSSS)
!define SPACE_06       INV_S(SSSSSS)
!define SPACE_07       INV_S(SSSSSSS)
!define SPACE_08       INV_S(SSSSSSSS)
!define SPACE_09       INV_S(SSSSSSSSS)
!define SPACE_10       INV_S(SSSSSSSSSS)
!define SPACER_C(s, l) l s l

skinparam linetype ortho


             class User
    abstract class Group
             class Activity
             class Item

User     "*" o-r- "1" Group    :  SPACER_C(<&caret-left> has,  SPACE_10)
Group    "1" o-r- "*" Activity :  SPACER_C(<&caret-left> has,  SPACE_10)
Activity "1" -l-o "*" Item     :  SPACER_C(has <&caret-right>, SPACE_10)


/'
********************************************************************************

   Inheritances

********************************************************************************
'/

<> PLACEHOLDER1
<> PLACEHOLDER2
<> PLACEHOLDER3

class Apartment
class Events
class Travels

object Type1
object Type2
object Type3

object Type01
object Type02
object Type03


PLACEHOLDER1 -d- Apartment
PLACEHOLDER1 -d- Events
PLACEHOLDER1 -d- Travels
PLACEHOLDER1 -u-|> Group

PLACEHOLDER2 -d- Type1
PLACEHOLDER2 -d- Type2
PLACEHOLDER2 -d- Type3
PLACEHOLDER2 -u-|> Activity

PLACEHOLDER3 -d- Type01
PLACEHOLDER3 -d- Type02
PLACEHOLDER3 -d- Type03
PLACEHOLDER3 -u-|> Item

@enduml

Generates:


Rectangle:

@startuml

!define INV_S(s)       <color:#FFFFFFF>s<color:Black>
!define S              |
!define SPACE_01       INV_S(S)
!define SPACE_02       INV_S(SS)
!define SPACE_03       INV_S(SSS)
!define SPACE_04       INV_S(SSSS)
!define SPACE_05       INV_S(SSSSS)
!define SPACE_06       INV_S(SSSSSS)
!define SPACE_07       INV_S(SSSSSSS)
!define SPACE_08       INV_S(SSSSSSSS)
!define SPACE_09       INV_S(SSSSSSSSS)
!define SPACE_10       INV_S(SSSSSSSSSS)
!define SPACER_C(s, l) l s l

skinparam linetype ortho


             class User
    abstract class Group
             class Activity
             class Item

User     "*" o-r- "1" Group    :  SPACER_C(<&caret-left> has,  SPACE_10)
Group    "1" o-r- "*" Activity :  SPACER_C(<&caret-left> has,  SPACE_10)
Activity "1" -l-o "*" Item     :  SPACER_C(has <&caret-right>, SPACE_10)


/'
********************************************************************************

   Inheritances

********************************************************************************
'/

skinparam rectangle {
        BackgroundColor<<PLACEHOLDER>> #7777777
        BorderThickness<<PLACEHOLDER>> 0
              FontColor<<PLACEHOLDER>> #7777777
               FontSize<<PLACEHOLDER>> 0
    StereotypeFontColor<<PLACEHOLDER>> #7777777
     StereotypeFontSize<<PLACEHOLDER>> 0
}

rectangle PLACEHOLDER1 <<PLACEHOLDER>> {
}

rectangle PLACEHOLDER2 <<PLACEHOLDER>> {
}

rectangle PLACEHOLDER3 <<PLACEHOLDER>> {
}

class Apartment
class Events
class Travels

object Type1
object Type2
object Type3

object Type01
object Type02
object Type03


PLACEHOLDER1 -d- Apartment
PLACEHOLDER1 -d- Events
PLACEHOLDER1 -d- Travels
PLACEHOLDER1 -u-|> Group

PLACEHOLDER2 -d- Type1
PLACEHOLDER2 -d- Type2
PLACEHOLDER2 -d- Type3
PLACEHOLDER2 -u-|> Activity

PLACEHOLDER3 -d- Type01
PLACEHOLDER3 -d- Type02
PLACEHOLDER3 -d- Type03
PLACEHOLDER3 -u-|> Item

@enduml

Generates:

commented Dec 8, 2019 by Pinvon (100 points)
Is there a way to change diamond or rectangle to a point?
commented Feb 28, 2022 by The-Lu (63,920 points)

Hello all...

(To answer an old question...)

You can change diamond, rectangle to circle, as:

@startuml
skinparam linetype ortho
class A
class B
class C
class D

circle " " as c

A <|-- c
c -- B
c -- C
c -- D
@enduml

If that can help,
Regards.

...