Add hide unlinked for all types of diagrams

+1 vote
asked Sep 28, 2018 in Wanted features by aleikro221376 (120 points)
Hello,

for a larger sw architecture, I group my use cases and my requirements into different files. I have a file use_cases.iuml and reqs.iuml. These files contain only the element defintions, no links. I want to create diagrams which show the linking use case to requirement. I use the !include statement for including use_cases.iuml and reqs.iuml. In the file with the linking use case to requirements I now get all use cases and all requirements. It would be fine to hide all unlinked elements in a section.

E.g.:

use_cases.iuml

@startuml(id=use_cases)
  usecase UC1 as "do something useful"
  usecase UC2 as "control state of cpu"
@enduml

reqs.iuml

@startuml(id=reqs)
  artifact RQ1 [
  A requirement text.
  ]

  artifact RQ2 [
  Another requirement text
  ]

  @enduml

show_uc.puml

@startuml

!include use_cases.iuml
!include reqs.iuml

skinparam packageStyle rectangle

'all other elements are hidden
hide unlinked

'only linked are shown in diagram

UC1 -- RQ1

UC1 -- RQ2

@enduml

Greetings!

1 Answer

0 votes
answered Jun 8, 2021 by The-Lu (63,920 points)

Hello A.,

To answer to an old question, from 2020 and:

We can now use 'hide' or 'remove':

hide @unlinked

as:

@startuml
usecase UC1 as "do something useful"
usecase UC2 as "control state of cpu"
artifact RQ1 [
  A requirement text.
  ]
artifact RQ2 [
 Another requirement text
]
skinparam packageStyle rectangle

'all other elements are hidden
hide @unlinked

'only linked are shown in diagram
UC1 -- RQ1
UC1 -- RQ2
@enduml

If that can help,
Regards,
Th.

...