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

#49, #139: Persons can be displayed as portraits - SHOW_PERSON_PORTRAIT() #141

Merged

Conversation

kirchsth
Copy link
Contributor

@kirchsth kirchsth commented Apr 8, 2021

Additional to SHOW_PERSON_PORTRAIT() the docu of the relationship specific sprites is updated

===========================

  • SHOW_PERSON_PORTRAIT(): activates portrait outline instead of a rectangle

Based on the new available features a new PR will be created (it replaces #49)

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


!$COLOR_A_5 = "#7f3b08"
!$COLOR_A_1 = "#fee0b6"
!$COLOR_NEUTRAL = "#f7f7f7"
UpdateElementStyle("person", $bgColor=$COLOR_A_5, $fontColor=$COLOR_NEUTRAL, $borderColor=$COLOR_A_1, $shadowing="true")

SHOW_PERSON_PORTRAIT()

' default header Property, Value
AddProperty("Name", "Flash")
AddProperty("Organization", "Zootopia")
AddProperty("Tool", "Internet Explorer 7.0")
Person(personAlias, "Label", "Optional Description (with default property header)")
Person(personAlias1, "Simple")
Person(personAlias2, "Simple with sprite", $sprite="person2")
AddProperty("Name", "Flash")
AddProperty("Organization", "Zootopia")
AddProperty("Tool", "Internet Explorer 7.0")
Person_Ext(personAliasExt, "Label Ext", "Optional Description (with default property header)")
Person_Ext(personAliasExt1, "Simple Ext")
Person_Ext(personAliasExt2, "Simple Ext with sprite", $sprite="person2")

SHOW_LEGEND()
@enduml

SHOW_PERSON_PORTRAIT() Sample

===========================

Relationship specific sprites are typically smaller and therefore following options are possible:

  • use smaller icons (like the $triangle in the following sample)
  • use an additional scale factor (direct as part of the argument, or via a variable)
  • if sprite argument starts with & an OpenIconic name can be used too (details see https://useiconic.com/open)
@startuml
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Context.puml

Person(user, "User")
Person(user1, "User 1")
Person(user2, "User 2")
Person(user3, "User 3")

System(system, "System")

' normal sprites are too big 
Rel_L(user, user2, "informs", "courier", "normal sprites are too big", $sprite="person2")

' scaled sprites are ok
Rel_R(user, user3, "informs", "courier", "scaled sprites are OK", $sprite="person2,scale=0.5")

' combine sprite and scale to a new sprite
!$combinedSprite="person2,scale=0.5"
Rel_R(user, user3, "informs", "courier", "combined sprites are OK", $sprite=$combinedSprite)


' special smaller sprites can be used
sprite $triangle {
    00000000000
    00000F00000
    0000FBF0000
    0000FBF0000
    000F999F000
    000F999F000
    00F66666F00
    00F66666F00
    0F3333333F0
    0F3333333F0
    0FFFFFFFFF0
    00000000000
}
Rel_R(user1, system, "orders", "http", "small sprites, like the small triangle", $sprite="triangle")

' if sprite starts with &, sprite defines a OpenIconic, details see https://useiconic.com/open/
Rel_D(user, user1, "requests", "async message", "if sprite starts with &, it defines a OpenIconic like &envelope-closed", $sprite = "&envelope-closed")
@enduml

Relation with sprite or OpenIconic

===================================

…nIconic and tags (7 - update sample with scaled sprites)

plantuml-stdlib#49,  plantuml-stdlib#139: Persons can be displayed as portraits - SHOW_PERSON_PORTRAIT()
@kirchsth
Copy link
Contributor Author

kirchsth commented Apr 8, 2021

@Potherca: I thought my changes can be merged without any coflicts therefore I extended the existing branch

@Potherca
Copy link
Member

@kirchsth Could you rebase this on master?

@Potherca Potherca linked an issue Apr 11, 2021 that may be closed by this pull request
@kirchsth
Copy link
Contributor Author

@Potherca done

@Potherca Potherca linked an issue Apr 11, 2021 that may be closed by this pull request
@stale stale bot added the stale Issue has not been active for 60 days label Jun 10, 2021
@Potherca Potherca added not-stale Stop issue from being marked stale by bot and removed stale Issue has not been active for 60 days labels Jun 13, 2021
@plantuml-stdlib plantuml-stdlib deleted a comment from stale bot Jun 13, 2021
@Potherca Potherca merged commit 8f4fa65 into plantuml-stdlib:master Jul 4, 2021
@kirchsth kirchsth deleted the feature/126_incl_Link_Portrait branch July 4, 2021 14:29
@Potherca Potherca removed the not-stale Stop issue from being marked stale by bot label Aug 10, 2022
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.

Persons can be displayed as portraits README.md Hyperlinks not HTTPS
2 participants