[Component diagram] Interface with multiple components messes up layout

0 votes
asked Jan 25 in Question / help by Alroc (140 points)

Hi,

I'm having a headache getting this diagram working with a good layout. 

The ways it's structured is : 

  • Inputs on the left
  • Outputs on the right

Input interfaces => Input Components
Output components => Output interfaces 

However as soon as I have an input interface with going to multiple components the structure is completely broken, 

1 Example without double connections : 
Graph
2 Example with a double connection :
Graph

The interface in question is named (sorry for the barbaric label) ENG_M_SAFE_OC_OFF_I

Here is the code :

@startuml
skinparam ranksep 10
skinparam nodesep 100

interface "ENG_M-ENG_REQ-I" as ENG_M_ENG_REQ_I
interface "ENG_M-DISEN_REQ-I" as ENG_M_DISEN_REQ_I
interface "ENG_M-SAFE_OT_OFF-I" as ENG_M_SAFE_OT_OFF_I
interface "ENG_M-SAFE_OC_OFF-I" as ENG_M_SAFE_OC_OFF_I
interface "ENG_M-SAFE_UV_OFF-I" as ENG_M_SAFE_UV_OFF_I
interface "ENG_M-PP_I-I" as ENG_M_PP_I_I
interface "ENG_M-SAFE_OV_OFF-I" as ENG_M_SAFE_OV_OFF_I
interface "ENG_M-ENG_STA-O" as ENG_M_ENG_STA_O
package "ENG_M"{
package "Outputs" {
[R-ENG_M-ENG_STA]
}
package "Standalone" {
[R-ENG_M-INHIB] --[hidden] [R-ENG_M-ENGAGE]
[R-ENG_M-ENGAGE] --[hidden] [R-ENG_M-DISENGAGE]
[R-ENG_M-DISENGAGE] --[hidden] [R-ENG_M-MAIN_SS]
[R-ENG_M-MAIN_SS] --[hidden] [R-ENG_M-MAIN_SS_EXIT]
[R-ENG_M-MAIN_SS_EXIT] --[hidden] [R-ENG_M-MAIN_SS_ENTER]
[R-ENG_M-MAIN_SS_ENTER] --[hidden] [R-ENG_M-DISENGAGE_SS]
[R-ENG_M-DISENGAGE_SS]
}
package "Inputs" {
[R-ENG_M-PP_I] --[hidden] [R-ENG_M-ENG_REQ]
[R-ENG_M-ENG_REQ] --[hidden] [R-ENG_M-DISEN_REQ]
[R-ENG_M-DISEN_REQ] --[hidden] [R-ENG_M-SAFE_OT_OFF]
[R-ENG_M-SAFE_OT_OFF] --[hidden] [R-ENG_M-SAFE_OC_OFF]
[R-ENG_M-SAFE_OC_OFF] --[hidden] [R-ENG_M-SAFE_UV_OFF]
[R-ENG_M-SAFE_UV_OFF] --[hidden] [R-ENG_M-SAFE_OV_OFF]
[R-ENG_M-SAFE_OV_OFF] --[hidden] [R-ENG_M-SAFE_OC_OFF_SC]
[R-ENG_M-SAFE_OC_OFF_SC]
}
}
[R-ENG_M-PP_I] <-l- ENG_M_PP_I_I : Power path current
[R-ENG_M-ENG_REQ] <-l- ENG_M_ENG_REQ_I : Engagement request
[R-ENG_M-DISEN_REQ] <-l- ENG_M_DISEN_REQ_I : Disengagement request
[R-ENG_M-SAFE_OT_OFF] <-l- ENG_M_SAFE_OT_OFF_I : Over-temperature status
[R-ENG_M-SAFE_OC_OFF] <-l- ENG_M_SAFE_OC_OFF_I : Over-current status
[R-ENG_M-SAFE_UV_OFF] <-l- ENG_M_SAFE_UV_OFF_I : Under-voltage status
[R-ENG_M-SAFE_OV_OFF] <-l- ENG_M_SAFE_OV_OFF_I : Over-voltage status
[R-ENG_M-SAFE_OC_OFF_SC] <-l- ENG_M_SAFE_OC_OFF_I : Over-current status
[R-ENG_M-ENG_STA] -r-> ENG_M_ENG_STA_O : Engagement status
@enduml

1 Answer

+1 vote
answered Jan 25 by The-Lu (19,740 points)
selected Jan 26 by Alroc
 
Best answer

Hello A.,

For that you can change the layout to:

left to right direction

But, it is now necessary to change order on "Standalone" package, link between interface and component and some new hidden link:

Inputs -[hidden]-> Standalone
Standalone -[hidden]-> Outputs

Here is a proposal:

@startuml
left to right direction
skinparam ranksep 10
skinparam nodesep 20
skinparam shadowing false

interface "ENG_M-PP_I-I" as ENG_M_PP_I_I
interface "ENG_M-ENG_REQ-I" as ENG_M_ENG_REQ_I
interface "ENG_M-DISEN_REQ-I" as ENG_M_DISEN_REQ_I
interface "ENG_M-SAFE_OT_OFF-I" as ENG_M_SAFE_OT_OFF_I
interface "ENG_M-SAFE_OC_OFF-I" as ENG_M_SAFE_OC_OFF_I
interface "ENG_M-SAFE_UV_OFF-I" as ENG_M_SAFE_UV_OFF_I
interface "ENG_M-SAFE_OV_OFF-I" as ENG_M_SAFE_OV_OFF_I

interface "ENG_M-ENG_STA-O" as ENG_M_ENG_STA_O

package "ENG_M"{
package "Outputs" {
[R-ENG_M-ENG_STA]
}
package "Standalone" {
[R-ENG_M-DISENGAGE_SS] -[hidden] [R-ENG_M-MAIN_SS_ENTER]
[R-ENG_M-MAIN_SS_ENTER] -[hidden] [R-ENG_M-MAIN_SS_EXIT]
[R-ENG_M-MAIN_SS_EXIT] -[hidden] [R-ENG_M-MAIN_SS]
[R-ENG_M-MAIN_SS] -[hidden] [R-ENG_M-DISENGAGE]
[R-ENG_M-DISENGAGE] -[hidden] [R-ENG_M-ENGAGE]
[R-ENG_M-ENGAGE] -[hidden] [R-ENG_M-INHIB]
[R-ENG_M-INHIB]
}
package "Inputs" {
[R-ENG_M-PP_I]
[R-ENG_M-ENG_REQ]
[R-ENG_M-DISEN_REQ]
[R-ENG_M-SAFE_OT_OFF]
[R-ENG_M-SAFE_OC_OFF]
[R-ENG_M-SAFE_UV_OFF]
[R-ENG_M-SAFE_OV_OFF]
[R-ENG_M-SAFE_OC_OFF_SC]
}
}

Inputs -[hidden]-> Standalone
Standalone -[hidden]-> Outputs

ENG_M_PP_I_I        --> [R-ENG_M-PP_I]           : Power path current
ENG_M_ENG_REQ_I     --> [R-ENG_M-ENG_REQ]        : Engagement request
ENG_M_DISEN_REQ_I   --> [R-ENG_M-DISEN_REQ]      : Disengagement request
ENG_M_SAFE_OT_OFF_I --> [R-ENG_M-SAFE_OT_OFF]    : Over-temperature status
ENG_M_SAFE_OC_OFF_I --> [R-ENG_M-SAFE_OC_OFF]    : Over-current status
ENG_M_SAFE_UV_OFF_I --> [R-ENG_M-SAFE_UV_OFF]    : Under-voltage status
ENG_M_SAFE_OV_OFF_I --> [R-ENG_M-SAFE_OV_OFF]    : Over-voltage status
ENG_M_SAFE_OC_OFF_I --> [R-ENG_M-SAFE_OC_OFF_SC] : Over-current status
[R-ENG_M-ENG_STA]   --> ENG_M_ENG_STA_O          : Engagement status
@enduml

If that can help,
Regards,
Th.

commented Jan 26 by Alroc (140 points)
Thank you so much i'll start implementing that tomorrow and post the result.
commented Jan 26 by Alroc (140 points)
It works like a charm for all the generated diagram thank you very much !
...