Icons do not seem to work in Sequence diagrams?
benze opened this issue · 3 comments
Are there any macros which will allow these icons to work in sequence diagrams? The AWS Puml macros all have multiple macros to allow for declaration as actors as well.
https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/master/dist/AWSCommon.puml:
!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) p_stereo>>
!enddefinelong
Hi,
I'm not sure if it is still relevant but sequence diagrams that contains any tupadr3 icons can be rendered correctly by calling macros with participant keyword like:
<prefix>_<name>(alias,label,participant)
Example:
@startuml
!include <tupadr3/common>
!include <tupadr3/font-awesome-5/user>
!include <tupadr3/font-awesome-5/database>
FA5_USER(Alice,Alice,participant) #LightGreen
FA5_DATABASE(DB,DB,participant) #LightBlue
Alice -> DB: query data
Alice <-- DB: data
@enduml
This works thanks, however the text is right aligned and does not align to the icon especially when the text is longer or has new line character(\n) in it. Any idea how we can center align the text with the icon when using macros ? I tried skinparam HorizontalAlignment center
however this had no effect?
I can't say I understand why the participant winds up aligned as it does. But you can work around it by invoking the icon's sprite directly rather than using the icon's macro. E.g.:
!define ICONURL https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/v2.4.0
!includeurl ICONURL/common.puml
!include ICONURL/font-awesome/user.puml
FA_USER(user1, "This long user name is right-aligned", participant)
participant "<$user>\nThis long user name is centered" as user2