#245,#291 Themes can be defined/used (5 - extract all constant values)

pull/295/head
KIRCHSTH 3 years ago
parent 5b0d601c70
commit c811921415

@ -67,10 +67,7 @@ rectangle C4VersionDetailsArea <<legendArea>> [
!$STEREOTYPE_FONT_SIZE ?= 12
!global $TRANSPARENT_STEREOTYPE_FONT_SIZE = $STEREOTYPE_FONT_SIZE/2
!$TECHN_FONT_SIZE ?= 12
!$ROUNDED_BOX_SIZE ?= 25
!$EIGHT_SIDED_SIZE ?= 18
!$ARROW_FONT_SIZE ?= 12
@ -78,6 +75,26 @@ rectangle C4VersionDetailsArea <<legendArea>> [
!$LEGEND_DETAILS_NORMAL_SIZE ?= 14
!global $LEGEND_DETAILS_SIZE = $LEGEND_DETAILS_SMALL_SIZE
' element symbols typically 4 times too big in legend
!$LEGEND_IMAGE_SIZE_FACTOR ?= 0.25
!$ROUNDED_BOX_SIZE ?= 25
!$EIGHT_SIDED_SIZE ?= 18
' Default element wrap width (of an element)
!$DEFAULT_WRAP_WIDTH ?= 200
' Maximum size in pixels, of a message (in a sequence diagram?)
!$MAX_MESSAGE_SIZE ?= 150
' PlantUML supports no DETERMINISTIC/automatic line breaks of "PlantUML line" (C4 Relationships)
' therefore Rel...() implements an automatic line break based on spaces (like in all other objects).
' If a $type contains \n then these are used (and no automatic space based line breaks are done)
' $REL_TECHN_MAX_CHAR_WIDTH defines the automatic line break position
!$REL_TECHN_MAX_CHAR_WIDTH ?= 35
!$REL_DESCR_MAX_CHAR_WIDTH ?= 32
' internal
' ##################################
!global $ROUNDED_BOX = "roundedBox"
!global $EIGHT_SIDED = "eightSided"
@ -91,8 +108,8 @@ rectangle C4VersionDetailsArea <<legendArea>> [
skinparam defaultTextAlignment center
skinparam wrapWidth 200
skinparam maxMessageSize 150
skinparam wrapWidth $DEFAULT_WRAP_WIDTH
skinparam maxMessageSize $MAX_MESSAGE_SIZE
skinparam LegendFontColor $LEGEND_FONT_COLOR
skinparam LegendBackgroundColor $LEGEND_BG_COLOR
@ -465,9 +482,9 @@ $elementSkin
' ,scale= ... has to be first (...,color=black,scale=0.25... is invalid too)
!if (%strpos($sprite, "=") < 0)
!if (%substr($sprite, 0, 4) == "img:")
!$smallSprite = $sprite + "{scale=0.25}"
!$smallSprite = $sprite + "{scale=" + $LEGEND_IMAGE_SIZE_FACTOR + "}"
!else
!$smallSprite = $sprite + ",scale=0.25"
!$smallSprite = $sprite + ",scale=" + $LEGEND_IMAGE_SIZE_FACTOR
!endif
!else
!$smallSprite = $sprite
@ -870,13 +887,6 @@ $elementSkin
' Line breaks
' ##################################
' PlantUML supports no DETERMINISTIC/automatic line breaks of "PlantUML line" (C4 Relationships)
' therefore Rel...() implements an automatic line break based on spaces (like in all other objects).
' If a $type contains \n then these are used (and no automatic space based line breaks are done)
' $REL_TECHN_MAX_CHAR_WIDTH defines the automatic line break position
!global $REL_TECHN_MAX_CHAR_WIDTH = 35
!global $REL_DESCR_MAX_CHAR_WIDTH = 32
!unquoted function $breakText($text, $usedNewLine, $widthStr="-1")
!$width = %intval($widthStr)
!$multiLine = ""

@ -15,6 +15,13 @@
' Styling
' ##################################
' PlantUML supports no automatic line breaks of "PlantUML containers" (C4 Deployment_Node is a "PlantUML container")
' therefore (Deployment_)Node() implements an automatic line break based on spaces (like in all other objects).
' If a $type contains \n then these are used (and no automatic space based line breaks are done)
' $NODE_TYPE_MAX_CHAR_WIDTH defines the automatic line break position
!$NODE_TYPE_MAX_CHAR_WIDTH ?= 35
!$NODE_DESCR_MAX_CHAR_WIDTH ?= 32
UpdateElementStyle("node", $bgColor=$NODE_BG_COLOR, $fontColor=$NODE_FONT_COLOR, $borderColor=$NODE_BORDER_COLOR)
skinparam rectangle<<node>> {
FontStyle normal
@ -36,13 +43,6 @@ SetDefaultLegendEntries("person\nsystem\ncontainer\nexternal_person\nexternal_sy
' Line breaks
' ##################################
' PlantUML supports no automatic line breaks of "PlantUML containers" (C4 Deployment_Node is a "PlantUML container")
' therefore (Deployment_)Node() implements an automatic line break based on spaces (like in all other objects).
' If a $type contains \n then these are used (and no automatic space based line breaks are done)
' $NODE_TYPE_MAX_CHAR_WIDTH defines the automatic line break position
!global $NODE_TYPE_MAX_CHAR_WIDTH = 35
!global $NODE_DESCR_MAX_CHAR_WIDTH = 32
' $breakTechn() in C4 supports //...//; $breakNode() in C4_Deployment supports no //....//
!unquoted function $breakNode($text, $widthStr)
!$usedNewLine = '</size>\n<size:'+$TECHN_FONT_SIZE+'>'

Loading…
Cancel
Save