Component with large number of interfaces

0 votes
asked Apr 6, 2022 in Question / help by mcon (320 points)
edited Apr 6, 2022 by mcon

Is there any way to convince component diagram to produce something like this?

https://pasteboard.co/wXS9OdEwuyMq.png

(I was unable to have the image display correctly, if someone can explain me how to do it...)

I tried something along the lines:

@startuml
interface "Control Messages" as CM
package "ICC Audio Software" {
    interface "Android A2B Interface" as A2B
    package "Audio manager" {
        CM - [Audio Weaver]

        interface "Media"
        A2B - Media
        Media -> [Audio Weaver]

        ...

        interface "System Sounds" as System_Sounds
        A2B - System_Sounds
        System_Sounds -> [Audio Weaver]
    }
}

@enduml

... but results were not very good :(

Any hint welcome and many Thanks in Advance

1 Answer

0 votes
answered Apr 6, 2022 by The-Lu (63,000 points)

Hello M.,

You can double all arrow as:

@startuml
interface "Control Messages" as CM
package "ICC Audio Software" {
    interface "Android A2B Interface" as A2B
    package "Audio manager" {
        CM - [Audio Weaver]

        interface "Media"
        A2B -- Media
        Media --> [Audio Weaver]

        '...

        interface "System Sounds" as System_Sounds
        A2B -- System_Sounds
        System_Sounds --> [Audio Weaver]
    }
}
@enduml

If that can help,
Regards.

commented Apr 6, 2022 by mcon (320 points)
Thanks.

This somehow "solves" the problem of having multiple arrows almost each over the other.

OTOH it does not allow to have interfaces laid vertically (which would visually be much better).

Do you have any further hint?
commented Apr 6, 2022 by The-Lu (63,000 points)

Hello M.,

For that you can use:

left to right direction

As:

Or:

@startuml
left to right direction
skinparam nodesep 5

rectangle "Android\nA2B\nInterface" as A

interface "Media" as i1
interface "Atmos" as i2
interface "whatever" as i3
interface "whatever" as i4
interface "..." as i5
interface "System Sounds" as i6

rectangle "Audio Weaver" as b {
interface "<U+00A0>" as b1
interface "<U+00A0>" as b2
interface "<U+00A0>" as b3
interface "<U+00A0>" as b4
interface "<U+00A0>" as b5
interface "<U+00A0>" as b6
}

A -- i1
A -- i2
A -- i3
A -- i4
A -- i5
A -- i6

i1 -- b1
i2 -- b2
i3 -- b3
i4 -- b4
i5 -- b5
i6 -- b6
@enduml

If that can help,

Enjoy,
Regards.

...