Skip to content

#157 Legend shows only diagram "style" relevant legend entries #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 4, 2021

Conversation

kirchsth
Copy link
Member

@kirchsth kirchsth commented Jun 13, 2021

Related to #157 it could be that e.g. the "normal/default container" element is displayed in the legend but the diagram contains only "tagged container" and the "normal/default" is obsolete therefore it should not be displayed in the legend.

Based on that the legend contains only tag/default elements which are visible in the diagram.
Tags which are not direct visible (only via stereotypes) are not displayed in the legend because these tags lost relation between style and legend too,

It can be tested via my extended branch

@startuml
' convert it with additional command line argument -DRELATIVE_INCLUDE="." to use locally
!if %variable_exists("RELATIVE_INCLUDE")
  !include ./../C4_Component.puml
!else
  !include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Component.puml
!endif

AddElementTag("shapeRound", $shape=$ROUNDED_BOX)
AddElementTag("shapeOct", $shape=$EIGHT_SIDED)
AddElementTag("shadowed", $shadowing=true)
AddElementTag("shadowed2", $shadowing=false)
AddElementTag("yelloTagged", $fontColor=yellow, $borderColor=yellow)
AddElementTag("greenTagged", $borderColor=green, $bgColor=green)
AddElementTag("tagged container", $fontColor=white, $bgColor=red, $borderColor=$CONTAINER_BORDER_COLOR)
AddElementTag("tagged person", $fontColor=white, $bgColor=orange, $borderColor=$PERSON_BORDER_COLOR)

Container(c2, Container 2, tech, $tags="tagged container", "'tagged container' stereotype/tag overwrites all styles of container ($fontColor, $bgColor and $borderColor) the container is not important anymore and therefore not displayed in legend")
Person(p2, p2, $tags="tagged person", "produces no person legend entry too")

Person(p4, p4, $tags="yelloTagged", "'yelloTagged' stereotype/tag first and defines $fontColor and $borderColor (in legend), 'person' defines additional $bgColor (in legend too)")

' complete sample with all styles
' Component(comp3, comp3, "techn", $tags="yelloTagged+greenTagged+shapeRound+shapeOct+shadowed+shadowed2", "Complex sample with all styles")

SHOW_LEGEND(false)
@enduml

Best regards
Helmut

kirchsth added 13 commits April 8, 2021 17:42
…nIconic and tags (7 - update sample with scaled sprites)

plantuml-stdlib#49,  plantuml-stdlib#139: Persons can be displayed as portraits - SHOW_PERSON_PORTRAIT()
…() and Lay_Distance() (instead of SHOW_LEGEND_UP(), ..._DOWN(), ..._LEFT(), ..._RIGHT())
…() and Lay_Distance() (3 - legend is reserved; LEGEND() is new default alias)
@Potherca Potherca merged commit 5986de1 into plantuml-stdlib:master Jul 4, 2021
@Potherca Potherca linked an issue Jul 4, 2021 that may be closed by this pull request
@kirchsth kirchsth deleted the feature/legendautohide branch July 4, 2021 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Option to hide unused default tags in the legend
2 participants