Skip to content
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

Question - when colour is defined via UpdateElementStyle the legend is not updated #169

Closed
ghost opened this issue Jul 10, 2021 · 3 comments
Labels
question Further information is requested

Comments

@ghost
Copy link

ghost commented Jul 10, 2021

Hi team,

According to doc #Custom schema definition,

if the custom (color) schema is defined via UpdateElementStyle() then the legend of existing elements is updated too.

However, when colour is defined via UpdateElementStyle the legend won't be updated

image

It's updated when SHOW_LEGEND() is added

image

Can you kindly suggest ? Thanks a lot

Reproduction

@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml

!define FONTAWESOME https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/master/font-awesome-5
!include FONTAWESOME/twitter_square.puml

LAYOUT_WITH_LEGEND()
LAYOUT_LEFT_RIGHT()

!$COLOR_BG = "#542788"
!$COLOR_FONT = "#f7f7f7"
!$COLOR_BORDER = "#b2abd2"

UpdateElementStyle("system", $bgColor=$COLOR_BG, $fontColor=$COLOR_FONT, $borderColor=$COLOR_BORDER)

!$COLOR_REL_LINE = "#000080"
!$COLOR_REL_TEXT = "#2E8B57"
UpdateRelStyle($lineColor=$COLOR_REL_LINE, $textColor=$COLOR_REL_TEXT)

Person(admin, "User")
System_Boundary(app, "App") {
    System(backend, "App Back End")
    System(ui, "App UI")
}
ContainerDb(twitter, "Twitter", "DB")


Rel(admin, ui, "uses")
BiRel(backend, ui, "data")
BiRel(backend, twitter, "data")

SHOW_LEGEND()

@enduml

Best regards,
Victoria

@kirchsth
Copy link
Contributor

Hi Victoria,

SHOW_LEGEND() is the replacement of LAYOUT_WITH_LEGEND(). But SHOW_LEGEND() has to be the last entry in the diagram, therefore we still have LAYOUT_WITH_LEGEND() that old diagrams are working.

(If you have a better comments we could update README.md)

Comments

  • SHOW_LEGEND() supports the customized stereotypes
    (LAYOUT_WITH_LEGEND() cannot be used, if the custom tags/stereotypes should be displayed in the legend).
  • SHOW_LEGEND() has to be last line in diagram.

If you use SHOW_LEGEND() then LAYOUT_WITH_LEGEND() is not required anymore.

Best regards
Helmut

@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml

!define FONTAWESOME https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/master/font-awesome-5
!include FONTAWESOME/twitter_square.puml

' LAYOUT_WITH_LEGEND()
LAYOUT_LEFT_RIGHT()

!$COLOR_BG = "#542788"
!$COLOR_FONT = "#f7f7f7"
!$COLOR_BORDER = "#b2abd2"

UpdateElementStyle("system", $bgColor=$COLOR_BG, $fontColor=$COLOR_FONT, $borderColor=$COLOR_BORDER)

!$COLOR_REL_LINE = "#000080"
!$COLOR_REL_TEXT = "#2E8B57"
UpdateRelStyle($lineColor=$COLOR_REL_LINE, $textColor=$COLOR_REL_TEXT)

Person(admin, "User")
System_Boundary(app, "App") {
    System(backend, "App Back End")
    System(ui, "App UI")
}
ContainerDb(twitter, "Twitter", "DB")


Rel(admin, ui, "uses")
BiRel(backend, ui, "data")
BiRel(backend, twitter, "data")

SHOW_LEGEND()
@enduml

@kirchsth
Copy link
Contributor

kirchsth commented Sep 7, 2021

Hi @victoria-pinzhen-liao-en,
did it solve your problem? Can we close it?
BR Helmut

@ghost
Copy link
Author

ghost commented Sep 22, 2021 via email

@Potherca Potherca added the question Further information is requested label Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Status: Done
Development

No branches or pull requests

2 participants