Giter Club home page Giter Club logo

Comments (4)

hakanson avatar hakanson commented on June 11, 2024

This was an interesting PlantUML bug/regression to figure out. Take a look when I render these lines - the third participant is similar to the generated output:

actor User as user
participant OnlyLabel as t1 << APIGateway >>
participant NoLabel as t2 << ($APIGateway, #CC2264) >>
participant Both as t3 << ($APIGateway, #CC2264) APIGateway >>
participant BothZWSP as t4 << ($APIGateway, #CC2264) %chr(8203)APIGateway >>

user -> t4: winner

Sequence Diagram - Spots and stereotypes

It appears that when the text label value of the stereotype matches the name of a sprite (even without the leading $ character), it causes neither the sprite nor the <<label>> to render. The last participant does render because I pre-pended a Zero-width space which makes a different string but looks the same.

To patch this for your current projects, you can redefine AWSParticipant (from AWSCommon.puml) after your !includes but before your diagram.

!definelong AWSParticipant(p_alias, p_label, p_techn, p_color, p_sprite, p_stereo)
participant "p_label\n<size:TECHN_FONT_SIZE>[p_techn]</size>" as p_alias << ($p_sprite, p_color) %chr(8203)p_stereo >>
!enddefinelong

!definelong AWSParticipant(p_alias, p_label, p_techn, p_descr, p_color, p_sprite, p_stereo)
participant "p_label\n<size:TECHN_FONT_SIZE>[p_techn]</size>\n\n p_descr" as p_alias << ($p_sprite, p_color) %chr(8203)p_stereo>>
!enddefinelong

from aws-icons-for-plantuml.

hakanson avatar hakanson commented on June 11, 2024

When building out a minimal, standalone example, I uncovered the regression relates to behavior changes with skinparam participant<<stereo>> which is triggered by AWSEntityColoring(APIGateway) from APIGateway.puml. It appears the sprite and stereotype label are "styled out" of the rendering.

An updated workaround is to add !define AWSEntityColoring(stereo) after you include AWSCommon.puml

@startuml Bug - Sprites and Stereotypes
' Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
' SPDX-License-Identifier: CC-BY-ND-2.0 (For details, see https://github.com/awslabs/aws-icons-for-plantuml/blob/main/LICENSE)

'''AWSEntityColoring usually defined in AWSCommon.puml
!define AWS_BG_COLOR #FFFFFF
!define AWS_BORDER_COLOR #FF9900

!definelong AWSEntityColoring(stereo)
skinparam participant<<stereo>> {
    BackgroundColor AWS_BG_COLOR
    BorderColor AWS_BORDER_COLOR
}
!enddefinelong
'''

'The bug happens because of the AWSEntityColoring(APIGateway) from APIGateway.puml
'A workaround is to redefine to do nothing - uncomment line below to test
'!define AWSEntityColoring(stereo)

'''$APIGateway and AWSEntityColoring(APIGateway) defined in ApplicationIntegration/APIGateway.puml
sprite $APIGateway [64x64/16z] {
xTC5biCm30JGiIfRqjp_lcMkqWqjUzuBvvlDjTFJ4uqlQJ5QA-1yYWCQOtNkan9IBTOotqoI4X9DvfvCIaZqi4zAIFImVrT2E-lt_bn2oxnpdAV_V2zIgG_7
D5-ASlDm_CZ-_tplDji7IIgSCSjRSP95wCLcUCF16ngzm2Rx4-S6mMC1Ktqv3G4s9r2c-We9ii98Xg1EzJmMKCgPSx9dXJagIKFb34-ddjuvPta6PDdwTP_d
-_ut3yRzOTCye9I7OvhNQcptXtxa-_n1ROmtHURP1ESYXlmPGnhJH1MWg0rvqm98ZOG-5Y6PbmHdyIf8_04xnyMpyNMkdPwU7G
}

AWSEntityColoring(APIGateway)
'''

actor User as user
participant OnlyLabel as p1 << APIGateway >>
participant NoLabel as p2 << ($APIGateway, #CC2264) >>
participant Both as p3 << ($APIGateway, #CC2264) APIGateway >>
participant BothZWSP as p4 << ($APIGateway, #CC2264) %chr(8203)APIGateway >>

user -> p4: renders as expected
@enduml

from aws-icons-for-plantuml.

hakanson avatar hakanson commented on June 11, 2024

@FredrikMeyer - the icon release today "fixes" the issue by commenting out the skinparam participant<<stereo>>
in AWSCommon.puml causing this issue. This means diagrams render, but not with the same styling as before. Additionally, according to the linked PlantUML issue, this is fixed in their latest snapshot. After that release, we can look at reverting this change.

!definelong AWSEntityColoring(stereo)
skinparam rectangle<<stereo>> {
    BackgroundColor AWS_BG_COLOR
    BorderColor AWS_BORDER_COLOR
}
' https://github.com/plantuml/plantuml/issues/1023
'skinparam participant<<stereo>> {
'    BackgroundColor AWS_BG_COLOR
'    BorderColor AWS_BORDER_COLOR
'}
!enddefinelong

Would you like to keep this issue open until then, or should we close?

from aws-icons-for-plantuml.

FredrikMeyer avatar FredrikMeyer commented on June 11, 2024

Sorry for the late reply!

We just updated the plantuml version, and now diagrams seem to render correctly. Thanks for the effort!

from aws-icons-for-plantuml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.