From ef9c8576546810155aa08d9d4005b9bed651b3b6 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Tue, 13 Jul 2021 13:45:23 +0200 Subject: [PATCH 01/11] Fix typos in project README file Closes #167 Closes #168 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f2fbae1..66453fd 100644 --- a/README.md +++ b/README.md @@ -472,7 +472,7 @@ UpdateElementStyle("person", $bgColor=$COLOR_A_5, $fontColor=$COLOR_NEUTRAL, $bo UpdateElementStyle("external_person", $bgColor=$COLOR_B_5, $fontColor=$COLOR_NEUTRAL, $borderColor=$COLOR_B_1) UpdateElementStyle("system", $bgColor=$COLOR_A_4, $fontColor=$COLOR_NEUTRAL, $borderColor=$COLOR_A_2) UpdateElementStyle("external_system", $bgColor=$COLOR_B_4, $fontColor=$COLOR_NEUTRAL, $borderColor=$COLOR_B_2) -UpdateRelStyle($lineColor=$COLOR_REL_LINE, &textColor=$COLOR_REL_TEXT) +UpdateRelStyle($lineColor=$COLOR_REL_LINE, $textColor=$COLOR_REL_TEXT) Person(customer, "Personal Banking Customer") System(banking_system, "Internet Banking System") @@ -495,11 +495,11 @@ SHOW_LEGEND() A model can be extended with (a table of) properties that concrete deployments or more detailed concepts can be documented: -* `SetPropertyHeader(col1Name, col2Name, ?col3Name, ?col4Name)`: +* `SetPropertyHeader(col1Name, col2Name, ?col3Name, ?col4Name)` The properties table can have up to 4 columns. The default header uses the column names "Name", "Description". * `WithoutPropertyHeader()` If no header is used, then the second column is bold. -* `AddProperty(col1, col2, ?col3, `?col4)` +* `AddProperty(col1, col2, ?col3, ?col4)` (All columns of) a property which will be added to the next element. Following sample uses all 3 different property definitions (and the aligned deployment node). From ef1e083b6335154afdeb75ff5608a4ad05d7dec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20P=C3=B6che?= Date: Mon, 23 Aug 2021 20:30:06 +0200 Subject: [PATCH 02/11] add missing BiRel_Back, BiRel_Neighbor, BiRel_Back_Neighbor --- C4.puml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/C4.puml b/C4.puml index bef1de5..5cdc678 100644 --- a/C4.puml +++ b/C4.puml @@ -850,14 +850,26 @@ $getRel("<<-->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) $getRel("<<--", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure +!unquoted procedure BiRel_Back($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") +$getRel("<<--", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +!endprocedure + !unquoted procedure Rel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") $getRel("->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure +!unquoted procedure BiRel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") +$getRel("->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +!endprocedure + !unquoted procedure Rel_Back_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") $getRel("<<-", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure +!unquoted procedure BiRel_Back_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") +$getRel("<<-", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +!endprocedure + !unquoted procedure Rel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") $getRel("-DOWN->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure From 87cd9567c17ff6d8b36a45606fd34885c5e74188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20P=C3=B6che?= Date: Mon, 23 Aug 2021 20:42:12 +0200 Subject: [PATCH 03/11] adjust percy relations tests --- percy/TestRelations.puml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/percy/TestRelations.puml b/percy/TestRelations.puml index df032ba..1bd1a1a 100644 --- a/percy/TestRelations.puml +++ b/percy/TestRelations.puml @@ -29,6 +29,12 @@ Rel_Back_Neighbor(RelFrom, "To_Rel_Back_Neighbor_Tech", "A label", "A techn") BiRel(BiRelFrom, "To_BiRel", "A label") BiRel(BiRelFrom, "To_BiRel_Tech", "A label", "A techn") +BiRel_Back(RelFrom, "To_Rel_Back", "A label") +BiRel_Back(RelFrom, "To_Rel_Back_Tech", "A label", "A techn") +BiRel_Neighbor(RelFrom, "To_Rel_Neighbor", "A label") +BiRel_Neighbor(RelFrom, "To_Rel_Neighbor_Tech", "A label", "A techn") +BiRel_Back_Neighbor(RelFrom, "To_Rel_Back_Neighbor", "A label") +BiRel_Back_Neighbor(RelFrom, "To_Rel_Back_Neighbor_Tech", "A label", "A techn") Rel_D(RelShort, "To_Rel_D", "A label") Rel_D(RelShort, "To_Rel_D_Tech", "A label", "A techn") From 8469fa3ffb424b86ae5a3270ae50e9732144e2da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20P=C3=B6che?= Date: Mon, 23 Aug 2021 20:50:58 +0200 Subject: [PATCH 04/11] fix arrows --- C4.puml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/C4.puml b/C4.puml index 5cdc678..c153074 100644 --- a/C4.puml +++ b/C4.puml @@ -376,7 +376,7 @@ $elementSkin !endif !$tagEntry = "|" - !$tagEntry = $tagEntry + "<" + $colorWithHash($bg) +">" + !$tagEntry = $tagEntry + "<" + $colorWithHash($bg) +">" ' ..white rectangle !$tagEntry = $tagEntry + " " !$tagEntry = $tagEntry + "" @@ -395,7 +395,7 @@ $elementSkin !endif !if ($fontColor == "" && $bgColor == "") !$tagEntry = $tagEntry + $LEGEND_NO_FONT_BG_TEXT - !else + !else !if ($fontColor == "") !$tagEntry = $tagEntry + $LEGEND_NO_FONT_TEXT !endif @@ -405,7 +405,7 @@ $elementSkin !endif !$tagEntry = $tagEntry + " " !$tagEntry = $tagEntry + "|" - !return $tagEntry + !return $tagEntry !endfunction !function $tagRelLegendEntry($tagStereo, $textColor, $lineColor, $lineStyle) @@ -451,7 +451,7 @@ $elementSkin !endif !$tagEntry = $tagEntry + " " !$tagEntry = $tagEntry + "|" - !return $tagEntry + !return $tagEntry !endfunction !global $LEGEND_DOTTED_LINE = "(dotted) " @@ -460,7 +460,7 @@ $elementSkin !unquoted procedure $addTagToLegend($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="") '' if a combined element tag is defined (e.g. "v1.0&v1.1") then it is typically a merged color, -'' like a new $fontColor="#fdae61" therefore it should be added to the legend +'' like a new $fontColor="#fdae61" therefore it should be added to the legend '' and the & combined tags will be not removed ' !if (%strpos($tagStereo, "&")<0) !$tagEntry = $tagLegendEntry($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape) @@ -473,10 +473,10 @@ $elementSkin !unquoted procedure $addRelTagToLegend($tagStereo, $textColor="", $lineColor="", $lineStyle="") '' Arrows have a bug with stereotype/skinparams and cannot combine text colors of one stereotype -'' and the line color of another stereotype. Therefore the text color of one tag and the line color +'' and the line color of another stereotype. Therefore the text color of one tag and the line color '' of another tag have to be combined via a "workaround" tag ("v1.0&v1.1"). -'' This workaround tag could be theoretically removed in the legend but after that there would -'' be an inconsistency between the element tags and the rel tags and therefore +'' This workaround tag could be theoretically removed in the legend but after that there would +'' be an inconsistency between the element tags and the rel tags and therefore '' & combined workaround tags are not removed too (and in unlikely cases the color itself could be changed) ' !if (%strpos($tagStereo, "&")<0) !$tagEntry = $tagRelLegendEntry($tagStereo, $textColor, $lineColor, $lineStyle) @@ -559,7 +559,7 @@ UpdateElementStyle($elementName, $bgColor, $fontColor, $borderColor, $shadowing) $elementSkin !endprocedure -' tags/stereotypes have to be delimited with \n +' tags/stereotypes have to be delimited with \n !unquoted procedure SetDefaultLegendEntries($tagStereoEntries) !$tagDefaultLegend = $tagStereoEntries !endprocedure @@ -591,7 +591,7 @@ $elementSkin !if (%strpos($descr, "\n") >= 0) !else !while (%strlen($descr)>$width) - !$brPos = $width + !$brPos = $width !while ($brPos>0 && %substr($descr, $brPos, 1)!= ' ') !$brPos = $brPos - 1 !endwhile @@ -719,19 +719,19 @@ SetPropertyHeader("Property","Value") ' Layout ' ################################## -!procedure $getHideStereotype($hideStereotype) +!procedure $getHideStereotype($hideStereotype) !if ($hideStereotype=="true") hide stereotype !endif !endprocedure -!procedure $getLegendTable() +!procedure $getLegendTable() <#00000000,#00000000>|**Legend** | $showActiveLegendEntries($tagDefaultLegend) $showActiveLegendEntries($tagCustomLegend) !endprocedure -!procedure $getLegendArea($areaAlias, $hideStereotype) +!procedure $getLegendArea($areaAlias, $hideStereotype) $getHideStereotype($hideStereotype) rectangle $areaAlias<> [ $getLegendTable() @@ -753,7 +753,7 @@ center footer Warning: Created for discussion, needs to b top to bottom direction !endprocedure -!procedure LAYOUT_LEFT_RIGHT() +!procedure LAYOUT_LEFT_RIGHT() left to right direction !endprocedure @@ -805,7 +805,7 @@ rectangle "$getBoundary($label, $type)" $toStereos("boundary", $tags) as $alias !$rel = $alias1 + ' ' + $direction + ' ' + $alias2 !if ($tags != "") !$rel = $rel + ' ' + $toStereos($tags) - !endif + !endif !$rel = $rel + ' : ' !if ($sprite != "") ' if it starts with & it's a OpenIconic, details see https://useiconic.com/open/ @@ -813,8 +813,8 @@ rectangle "$getBoundary($label, $type)" $toStereos("boundary", $tags) as $alias !$rel = $rel + '<$'+$sprite+'> ' !else !$rel = $rel + '<'+$sprite+'> ' - !endif - !endif + !endif + !endif !if ($link != "") !$rel = $rel + '**[[' + $link + ' ' + $label + ']]**' !else @@ -851,7 +851,7 @@ $getRel("<<--", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure BiRel_Back($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<--", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel("<<-->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") @@ -859,7 +859,7 @@ $getRel("->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure BiRel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel("<<->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_Back_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") @@ -867,7 +867,7 @@ $getRel("<<-", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure BiRel_Back_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel("<<->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") From a9e8f5fed9d1f9648a564c7634801adf0cf63e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20P=C3=B6che?= Date: Mon, 23 Aug 2021 21:21:00 +0200 Subject: [PATCH 05/11] remove unnecessary macros BiRel_Back and BiRel_Back_Neighbor --- C4.puml | 8 -------- percy/TestRelations.puml | 8 ++------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/C4.puml b/C4.puml index c153074..bd694ba 100644 --- a/C4.puml +++ b/C4.puml @@ -850,10 +850,6 @@ $getRel("<<-->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) $getRel("<<--", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure -!unquoted procedure BiRel_Back($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - !unquoted procedure Rel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") $getRel("->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure @@ -866,10 +862,6 @@ $getRel("<<->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) $getRel("<<-", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure -!unquoted procedure BiRel_Back_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - !unquoted procedure Rel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") $getRel("-DOWN->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure diff --git a/percy/TestRelations.puml b/percy/TestRelations.puml index 1bd1a1a..6fa6082 100644 --- a/percy/TestRelations.puml +++ b/percy/TestRelations.puml @@ -29,12 +29,8 @@ Rel_Back_Neighbor(RelFrom, "To_Rel_Back_Neighbor_Tech", "A label", "A techn") BiRel(BiRelFrom, "To_BiRel", "A label") BiRel(BiRelFrom, "To_BiRel_Tech", "A label", "A techn") -BiRel_Back(RelFrom, "To_Rel_Back", "A label") -BiRel_Back(RelFrom, "To_Rel_Back_Tech", "A label", "A techn") -BiRel_Neighbor(RelFrom, "To_Rel_Neighbor", "A label") -BiRel_Neighbor(RelFrom, "To_Rel_Neighbor_Tech", "A label", "A techn") -BiRel_Back_Neighbor(RelFrom, "To_Rel_Back_Neighbor", "A label") -BiRel_Back_Neighbor(RelFrom, "To_Rel_Back_Neighbor_Tech", "A label", "A techn") +BiRel_Neighbor(BiRelFrom, "To_BiRel_Neighbor", "A label") +BiRel_Neighbor(BiRelFrom, "To_BiRel_Neighbor_Tech", "A label", "A techn") Rel_D(RelShort, "To_Rel_D", "A label") Rel_D(RelShort, "To_Rel_D_Tech", "A label", "A techn") From abe5940384e241cdb535fbef06b874ee9f36c0c0 Mon Sep 17 00:00:00 2001 From: KIRCHSTH Date: Sat, 21 Aug 2021 13:39:52 +0200 Subject: [PATCH 06/11] #174 Add Layout Landscape --- C4.puml | 73 +++++++++++++++++++++------ C4_Dynamic.puml | 32 ++++++------ LayoutOptions.md | 39 ++++++++++++-- README.md | 2 +- percy/TestLayoutLandscape.puml | 32 ++++++++++++ percy/TestLayoutLandscapeDynamic.puml | 32 ++++++++++++ 6 files changed, 174 insertions(+), 36 deletions(-) create mode 100644 percy/TestLayoutLandscape.puml create mode 100644 percy/TestLayoutLandscapeDynamic.puml diff --git a/C4.puml b/C4.puml index bef1de5..558f00c 100644 --- a/C4.puml +++ b/C4.puml @@ -749,11 +749,52 @@ skinparam defaultFontName "Comic Sans MS" center footer Warning: Created for discussion, needs to be validated !endprocedure +!global $fix_direction=%false() + +!function $down($start,$end) +!if ($fix_direction) +!return $start+"RIGHT"+$end +!else +!return $start+"DOWN"+$end +!endif +!endfunction + +!function $up($start,$end) +!if ($fix_direction) +!return $start+"LEFT"+$end +!else +!return $start+"UP"+$end +!endif +!endfunction + +!function $left($start,$end) +!if ($fix_direction) +!return $start+"UP"+$end +!else +!return $start+"LEFT"+$end +!endif +!endfunction + +!function $right($start,$end) +!if ($fix_direction) +!return $start+"DOWN"+$end +!else +!return $start+"RIGHT"+$end +!endif +!endfunction + !procedure LAYOUT_TOP_DOWN() +!global $fix_direction=%false() top to bottom direction !endprocedure !procedure LAYOUT_LEFT_RIGHT() +!global $fix_direction=%false() +left to right direction +!endprocedure + +!procedure LAYOUT_LANDSCAPE() +!global $fix_direction=%true() left to right direction !endprocedure @@ -859,59 +900,59 @@ $getRel("<<-", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-DOWN->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($down("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-DOWN->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($down("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure BiRel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-DOWN->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($down("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure BiRel_Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-DOWN->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($down("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_U($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-UP->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($up("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-UP->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($up("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure BiRel_U($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-UP->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($up("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure BiRel_Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-UP->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($up("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_L($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-LEFT->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($left("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-LEFT->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($left("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure BiRel_L($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-LEFT->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($left("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure BiRel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-LEFT->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($left("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_R($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-RIGHT->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($right("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-RIGHT->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($right("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure BiRel_R($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-RIGHT->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($right("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure BiRel_Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-RIGHT->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel($right("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure ' Layout Helpers diff --git a/C4_Dynamic.puml b/C4_Dynamic.puml index a307e84..8ba4a09 100644 --- a/C4_Dynamic.puml +++ b/C4_Dynamic.puml @@ -94,53 +94,53 @@ $getRel("<<-", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $t !endprocedure !unquoted procedure Rel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-DOWN->>", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($down("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-DOWN->>", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($down("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure RelIndex_D($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-DOWN->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($down("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure RelIndex_Down($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-DOWN->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($down("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_U($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-UP->>", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($up("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-UP->>", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($up("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure RelIndex_U($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-UP->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($up("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure RelIndex_Up($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-UP->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($up("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_L($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-LEFT->>", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($left("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-LEFT->>", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($left("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure RelIndex_L($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-LEFT->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($left("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure RelIndex_Left($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-LEFT->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($left("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_R($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-RIGHT->>", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($right("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-RIGHT->>", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($right("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure RelIndex_R($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-RIGHT->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($right("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure RelIndex_Right($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-RIGHT->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel($right("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure diff --git a/LayoutOptions.md b/LayoutOptions.md index 781d0d3..c9c885c 100644 --- a/LayoutOptions.md +++ b/LayoutOptions.md @@ -6,7 +6,7 @@ PlantUML uses [Graphviz](https://www.graphviz.org/) for its graph visualization. For this reason, C4-PlantUML also comes with some layout options. -## LAYOUT_TOP_DOWN() or LAYOUT_LEFT_RIGHT() +## LAYOUT_TOP_DOWN() or LAYOUT_LEFT_RIGHT() or LAYOUT_LANDSCAPE() With the two macros `LAYOUT_TOP_DOWN()` and `LAYOUT_LEFT_RIGHT()` it is possible to easily change the flow visualization of the diagram. `LAYOUT_TOP_DOWN()` is the default. @@ -30,8 +30,7 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS") ![LAYOUT_TOP_DOWN Sample](https://www.plantuml.com/plantuml/png/NP1DJyCm38Rl-HLc7DP9ezKG9quh0y5X7nNhc3XLQUknI6aI9IxLXFZlkDhO454aI_Rhruyz3IGzjOs6UVg-skH5ligAnzLs2MlPE8tYIfbAjpN2diY5-oJniei_5EtRiWteAsi83SMLRH9PUoNDfsvTcypkRZ8j3MqMyqHBma2SAcQibigWZnsF528Pmj8I6CGQQoYnakm9j5S1-DCUeSQTR3N1C17_0AEH41dwO4qawqQPCGpIFgf0NfBrWv5O7m9XKppOrjJI7w9gCeRXSQ_X2Bu4y3iZHHsMXNIEVRPOGkgSLfKaPSs0KxFhCQJhB5u-vTpY4MxZ2IpUPdqjrTfs0VfpCBG5leMJB6aONF4io3j5X1v8DQXvLc2sxnDTHCSY-vnaN1Ilg7-tkc1j0dToVCdpRCsgNdIkNcoUaHYZmpxil6t-japHr7pv7m00 "LAYOUT_TOP_DOWN Sample") - -Using `LAYOUT_LEFT_RIGHT()` +`LAYOUT_LEFT_RIGHT()` rotates the flow visualization to *from Left to Right* and directed relations like `Rel_Left()`, `Rel_Right()`, `Rel_Up()` and `Rel_Down()` are rotated too. ```csharp @startuml LAYOUT_LEFT_RIGHT Sample @@ -52,6 +51,40 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS") ![LAYOUT_LEFT_RIGHT Sample](https://www.plantuml.com/plantuml/png/PL1DIyD05BplhrZheIdKX8edJusXjaAhfKaLJs6RFEt2Vh7xrb34_-uBhLPmBmDlvhsPsMb0uJ5gnPVvwzEsgfUp-whUFCmN5I-5TWhOXJIDYYtmFQ8BjrdcHPU-Izp7NGpW6siG3AQDrPbelHJcGqKNi-BcQgs4mUrgcIc14916TK5g8Gtur94fO_zSan5ZQ_31caIqMfen7-Gzoe1UeFM34IiF0K7NTpQQLlX3qap6V7WCEnpnJyRf_Vea7UnguHpTUO4TpvrJiX4ehHdGgBWSyxnSfu-pYbOyyEjqmbVFHS_bIjakyBvZu6Wv5NI293egbEJ5gquYWkSeDIZo2fJjwvGkmID9Tquo8ja6r4-hSwnje4t2HLMjIrBreb_sV6OEI34wwE7DM_rtPGgcfU_y1W00 "LAYOUT_LEFT_RIGHT Sample") +`LAYOUT_LANDSCAPE()` rotates the default flow visualization to *from Left to Right* like `LAYOUT_LEFT_RIGHT()` additional **directed relations** like Rel_Left(), Rel_Right(), Rel_Up() and Rel_Down() **are not rotated** anymore. + +```csharp +@startuml LAYOUT_LANDSCAPE Sample +!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml + +LAYOUT_LANDSCAPE() + +Person(admin, "Administrator") +System_Boundary(c1, 'Sample') { + Container(web_app, "Web Application", "C#, ASP.NET Core 2.1 MVC", "Allows users to compare multiple Twitter timelines") +} +System(twitter, "Twitter") + +Rel(admin, web_app, "Uses", "HTTPS") +Rel(web_app, twitter, "Gets tweets from", "HTTPS") + +System(S,"S") +System(SU,"S Up") +System(SD,"S Down") +System(SL,"S Left") +System(SR,"S Right") + +Rel_Up(S, SU, "Up") +Rel_Down(S, SD, "Down") +Rel_Left(S, SL, "Left") +Rel_Right(S, SR, "Right") + +SHOW_LEGEND() + +@enduml +``` + +![LAYOUT_LANDSCAPE Sample](https://www.plantuml.com/plantuml/png/NOzFRvj04CNlV8gjUmYM75kfUkef5ApaG1nae55FQ0sJUANzizeTXAAgtxqpCNQiSa7lDxFllRcFA0EEHeio-_tSDbsPxOewpwgjgANn6f8lolPw740S4NtyiTa4EQtV51x7mnWXzCuYM5ptpcoybfQzRYCEMXqs-VVRYb7xL6wCZ0Y1K9VJ2waiXBMdtIJvFpXT9aa58JgRoi4eknABZFygOf3emcAPrEzaPhgVRhI33EzfVxSIDwU-Dqln9n7qNMBI2GwTz9vyNk0WCk-rwYKgPnU4ygyhaTNLUhTjw4a0yMrz9vv-vJpBj7PJ57nc5EW4tUWbhPXHew8iqKmA4O90PK1JLgHkV-TsAPw6v3ElqJ3PWpvVzLchZH0vxx5fgfgsUEao_RHv08maWN-lmPdh9-VGUhLWULOjIT7wAr8mATnahrZ9h8HNl69xPdlrTiIvTjTwSXTrouNPaHaRVT22A8kPiza7Bucpc3aRdWPx6bpiwyVdbwxSFcntHKho7kmm6lqF "LAYOUT_LANDSCAPE Sample") ## LAYOUT_WITH_LEGEND() or SHOW_LEGEND(?hideStereotype) diff --git a/README.md b/README.md index 66453fd..6c0450c 100644 --- a/README.md +++ b/README.md @@ -357,7 +357,7 @@ Lay_Distance(LEGEND(), db, 1) C4-PlantUML also comes with some layout options to make it easy and reusable to create nice and useful diagrams: -* [LAYOUT_TOP_DOWN() or LAYOUT_LEFT_RIGHT()](LayoutOptions.md#layout_top_down-or-layout_left_right) +* [LAYOUT_TOP_DOWN() or LAYOUT_LEFT_RIGHT() or LAYOUT_LANDSCAPE()](LayoutOptions.md#layout_top_down-or-layout_left_right-or-layout_landscape) * [LAYOUT_WITH_LEGEND() or SHOW_LEGEND(?hideStereotype)](LayoutOptions.md#layout_with_legend-or-show_legend) * [SHOW_FLOATING_LEGEND(?alias, ?hideStereotype) and LEGEND()](LayoutOptions.md#show_floating_legendalias-hidestereotype-and-legend) * [LAYOUT_AS_SKETCH()](LayoutOptions.md#layout_as_sketch) diff --git a/percy/TestLayoutLandscape.puml b/percy/TestLayoutLandscape.puml new file mode 100644 index 0000000..a709ea9 --- /dev/null +++ b/percy/TestLayoutLandscape.puml @@ -0,0 +1,32 @@ +@startuml +' convert it with additional command line argument -DRELATIVE_INCLUDE="." to use locally +!if %variable_exists("RELATIVE_INCLUDE") + !include ./../C4_Component.puml +!else + !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml +!endif + +LAYOUT_LANDSCAPE() + +Person(admin, "Administrator") +System_Boundary(c1, 'Sample') { + Container(web_app, "Web Application", "C#, ASP.NET Core 2.1 MVC", "Allows users to compare multiple Twitter timelines") +} +System(twitter, "Twitter") + +Rel(admin, web_app, "Uses", "HTTPS") +Rel(web_app, twitter, "Gets tweets from", "HTTPS") + +System(S,"S") +System(SU,"S Up") +System(SD,"S Down") +System(SL,"S Left") +System(SR,"S Right") + +Rel_Up(S, SU, "Up") +Rel_Down(S, SD, "Down") +Rel_Left(S, SL, "Left") +Rel_Right(S, SR, "Right") + +SHOW_LEGEND() +@enduml diff --git a/percy/TestLayoutLandscapeDynamic.puml b/percy/TestLayoutLandscapeDynamic.puml new file mode 100644 index 0000000..2a2a0cb --- /dev/null +++ b/percy/TestLayoutLandscapeDynamic.puml @@ -0,0 +1,32 @@ +@startuml +' convert it with additional command line argument -DRELATIVE_INCLUDE="." to use locally +!if %variable_exists("RELATIVE_INCLUDE") + !include ./../C4_Dynamic.puml +!else + !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Dynamic.puml +!endif + +LAYOUT_LANDSCAPE() + +Person(admin, "Administrator") +System_Boundary(c1, 'Sample') { + Container(web_app, "Web Application", "C#, ASP.NET Core 2.1 MVC", "Allows users to compare multiple Twitter timelines") +} +System(twitter, "Twitter") + +Rel(admin, web_app, "Uses", "HTTPS") +Rel(web_app, twitter, "Gets tweets from", "HTTPS") + +System(S,"S") +System(SU,"S Up") +System(SD,"S Down") +System(SL,"S Left") +System(SR,"S Right") + +Rel_Up(S, SU, "Up") +Rel_Down(S, SD, "Down") +Rel_Left(S, SL, "Left") +Rel_Right(S, SR, "Right") + +SHOW_LEGEND() +@enduml From 44d50245b2c8ef1ebf37b57d913239859cf5b085 Mon Sep 17 00:00:00 2001 From: KIRCHSTH Date: Sat, 28 Aug 2021 17:43:16 +0200 Subject: [PATCH 07/11] #181 Add version information calls `C4Version()` and `C4VersionDetails()` --- C4.puml | 13 +++++++++ README.md | 29 ++++++++++++++++++- ...er Diagram Sample - bigbankplc-styles.puml | 1 + percy/TestVersion.puml | 21 ++++++++++++++ 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 percy/TestVersion.puml diff --git a/C4.puml b/C4.puml index bef1de5..310247d 100644 --- a/C4.puml +++ b/C4.puml @@ -1,5 +1,18 @@ ' C4-PlantUML +'Version +' ################################## +!function C4Version() + !return "2.3.2beta1" +!end function + +!procedure C4VersionDetails() +rectangle C4VersionDetailsArea <> [ +| PlantUML | **%version()** | +| C4-PlantUML | **C4Version()** | +] +!end procedure + ' Colors ' ################################## diff --git a/README.md b/README.md index f2fbae1..9a88d3c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # C4-PlantUML -![Container diagram for Internet Banking System](https://www.plantuml.com/plantuml/png/hLPDZzis4BtxLqoT71n0kqQHvb9WWNXjjTd0NhkMj-dD655ZcGX52YIr7oZwtpkaFsXxKwH0UrcOGyvxJq-Fe_teF5hVDQhtWzH2THN1rllM_JmSMdowhgNVTcNdo0gZFMb_BKmpR1Ngq7FbVALaEHp_TBK8fOVPTDYWysIvj1vp1qfDzheD-BtYq_pBUf4lY_dzUlwmcjxTvuDtlL5LvOeQXbvXFUYNABwIha0ScliPlDtmOcoKiJTlysa-o-zNwr_c_6SydywNl5_Mkzt-c_VlFqn67qAFss9BDxcijxwG5LL5M0_UHS8bgKY6xaMBSDZJyu5Wj5oop0EoOWd_k57u5qKt4tHRggQyla0FuCF_Xy9udoXwNdf5SBGNAecrnGOsniATPlSrURX5_LNg6eeNvwdfzHPadT43qJbl6h8PZ8-_-YCubC5im6y9IkxEu8dVFhIn4LMi0GfXEkrTdtNieDUtNAZGlWp4ZunrAQ3_3lxi0K3IEtYYSerjouU_K0cZjbLIe9T6zxdq6HynWwArGVpizt6eJKZ9HvOHfJdFPmNiymYegrW-yfQ71r-CMEGviskHuGhULdIrm9e2-u6r45QsFeEHhZk5DfGNrZnoU1oWKjzcsNHQ1Ecef7y1RzZ9QAI3HucXHLhWvuNIcYT7zfMYnfHIqTwEMLWSDOtVPF07DiXEd6i19Hl9WG3NbOwrcCs_rkPUYTi9W8eUfQ1BUPDoKA774Xs5rx3_6TGKlqtXREsDPMrXKe2bMZflCN23r1pB9lxEO1ll2c37kHAMAj9Ued9PY1Kv1yhKl20lhbyPjHyCx9GCYLtSVJiu4yF7REexTUvx3WLJ63ZULgpTpUjXnAh-EkO-V_O3Qb2gjOi5PiglPho6tO50lTeIoCYA2cPIMEFCnaF-BBQeQu9T9yEUOEx59TGPieaM6xgurCdtaCz330GN3WzuwZvWQJgVCf0Txt86tg9s6Ar8_lUMf4xcHRgr3uvSuFwqMYqAFdX-phNutJCfzOUZExhrFV70BasQ4H4kJO0zKYoU9Y8Hne6RmMV-oWmZUNgTSMkFa1JyDw3rBJSdsOVRSWcw9AmSRAnfui1wijAJ0sy2qPvdSZjco2FcYLiN8IiOrW5TXMh4I48kydYguRAlSvoFH5_CLeiTK7gOi_QBL2QVqcUEnzLiUkbLscRutVy0q_pN_7x2t_wFZDurwcy0 "Container diagram for Internet Banking System") +![Container diagram for Internet Banking System](https://www.plantuml.com/plantuml/png/hLPRZ-964ttthwXXT_M1n4MVDliIQQHbmCdEYWl1p6pUKDakJ6lRtLPt6mP5-U-fDXW3Cz56IbuGNPTpZgkholvi7HfNvZBu7oHQxSWu40xsmcq1qrGueHLATkKvgXIaK0HeiZ8dvQ0tNeQJuUhnELm_paQJft5ut-gtm6aeBO7K2Kfv2Ex41Zxiq0YC9QtfHLXdswtRp5Od0BWJAf5bIj0VzFk3qK_haLOEcTFq2w_nZgIboxYjSuNzUJ0mkEzdhBcCcTaadCNw-gnwK4XK_lbwrgLIn0pQMtZJqtGooD4wCc_og5HiWY3wCl-sNeJBQ3vRpvzMayTPsEu4mpGD9VaAh31hjs9CldCy93L6gmllDtmOQQdD_Vjm4ax3sMhzovn_HlF9VCd-E3jwM-y-Vlmq7dxoENQB1Ts78jkwIAIKHlxSxbI4Iv8L6Tg3IdomevUQOBXSiimQsL_HtpeYTv1qFqQxfNGYr2sw1n_yDnJQkOOYSC99WdEL8HMO6SnXemqyAaT6aOC7LD-5oY0wM4Tv42p8MAtQIMcTpibqONJ-rnf2RGQz0RSbY3cxUspSeaf4MTa0aqINojaMwpX2hn_OaA8vj9F_CzQjW5O7_WW0eD7RtbEyngBWu6yKmx0ef4ZGpqQBJLznXrs82kF5Jvz7tZOcANYOR2NDEevDuDIMm8DKcS-ySVtWYo6Bl6Qs1J9Sn6v9lGLcvDbhrYWned1T6Agib6YyUM7qJgHa0QLycsLJgkGuri8T_B0cPLL82pk1FaKOuEU5sEYz9VDAKQvZ8UbKZga_d3MDtdNXTyoHAt6j1QJ8XQCKR1bRSdnd_rYRVINkA01Isec4RkMDutQA3cEqvA_XzDUhYNwRmDNPQSFQ_C80GvcmpbHN2a9nM-RL_ovigra1BBcl4aCfAITGsgvlAx8MfCxuG2xflohKQJ5mfOJlsCNZsuqprXncchpBolseGhue35nDAsRs_lKoObL_dli-V75job78jQqCp1Jsfdm-pPodNl6zY8eL9Kn5OhJL6mVXIx95bH7OOsJd4lCaha5bJBNX0QUReMxgxlkpReE43VK3NbOVCDQbQtgWUvxbBZY3oc9LYgR-mPBanRveflR9alNSNrQhHSI1rt4yOp-CgRk-WJlIhMV42plMpOweu9eDS4AgZ9STqH1M2xSBN_ajCwZ8c-kiN2U4Hi6_0re_S78ZkvcMQz0bOMfXOtHUBQoz4OuiEEs9JZpZXn53dZ4lgdNJP173Mg2UjrOOZP2RVhpMS9rNMkwFXZwQhXOCT7K7L-atNTdKgNdDyRgQJcvhrRWP_lWDC0b_3MTZVlTlj7Pa83MuLyUNJVqr0Ri-VF0NpXtPxbGryzyQZPUFpxKx-Cmgorp-1G00 "Container diagram for Internet Banking System") C4-PlantUML combines the benefits of [PlantUML](https://plantuml.com/) and the [C4 model](https://c4model.com/) for providing a simple way of describing and communicate software architectures – especially during up-front design sessions – with an intuitive language using open source and platform independent tools. @@ -533,6 +533,33 @@ Rel(personAlias, containerAlias, "Label", "Optional Technology") ![properties sample](https://www.plantuml.com/plantuml/png/ZP9HRzCm4CVVyobCNaYbhc4L4X9FcpeGI6Mhe834ItLDZiQIuxFiiqP0V7VEqRfiQO0z-NB--P_xnRa839vZQx9dsbOcrgWQPXTUbwM7syL1SnFtCQ2lo39QNbJKbiw0JMVE0jT6xylLoxDDQdt-i2vR28nUMhihT8QwDXrowGNPSrNZTuY6LODGerSRJmuzTtFr1Kp4xBAkZwqYluOMyxdAtne8JJvxl7dZ3s3rJs1DDa7VY9YSXZ6t9J9f_xrbz1PPlVaXGtdqwjNYXS0Rz85iuVhbqcW80gzXZ_sf6vVomQWh39NN_PCgRZKtzoRkxbLtIZF9p3uX7oTurtUB_FYSp_Easeiz21sFdQhpnFImL8bcq2QSJw7BUtJv05qAEjp1xffgtAqBAylVHRUTm_-OLp4mjHFYwbUMAVLL68hZ3p2JdPEnLuEYbDF8e2PbGbPanSvAPdMiJdIsM3MM31swVxjGdBp0ttA5NM1iYz0lu_od9MeC_T_m4StZ_sjgxb7k82095sZhs9e_ "properties sample") +## Version information + +Starting with v.2.3.2beta1 C4-PlantUML offers version information like PlantUML with its `%version()` call. + +* `C4Version()`: Current C4-PlantUML version (e.g. "2.3.2beta1"). +* `C4VersionDetails()`: (Floating) version details with the current PlantUML and C4-PlantUML version (with the alias C4VersionDetailsArea) + +``` +@startuml +!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml + +' existing plantuml version as text +%version() + +' new C4-Plantuml version as text +C4Version() + +' new C4-Plantuml version details (incl. PlantUML version) as table +C4VersionDetails() + +' version functions used in e.g. footer +footer drawn with PlantUML v. %version() and C4-PlantUML v. C4Version() +@enduml +``` + +![version sample](https://www.plantuml.com/plantuml/png/ZOynJyCm48Nt_8fZGBH3dQKJKwKmWiG2Axh4r-GavnBvpgG_dvXWjGjIfqJltllytaaDewKnL0yiNKYUO32RzRck8owkPnjIcvHYDucHcEkciPu3IiuSr7pWjcwEX_SiVRozrYEgKLobhsPD80j5DsT-zGHqOJMM7We0lYagJmAeO7Inwl5FsEspNsY1pFx73LLp_Bp7xycGWy8kJtHGkfRx_XU8RQ0hy6MBRDp2EIVfRFrHI4eUM81Sx-0yJKQnsZxW8ou22zjmyv23wp90yQLckTuEEP7ujVqF "version sample") + ## Snippets for Visual Studio Code Because the PlantUML support inside of Visual Studio Code is excellent with the [PlantUML extension](https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml), you can also find VS Code snippets for C4-PlantUML at [.vscode/C4.code-snippets](.vscode/C4.code-snippets). diff --git a/percy/C4_Container Diagram Sample - bigbankplc-styles.puml b/percy/C4_Container Diagram Sample - bigbankplc-styles.puml index 59014e6..8b50e9c 100644 --- a/percy/C4_Container Diagram Sample - bigbankplc-styles.puml +++ b/percy/C4_Container Diagram Sample - bigbankplc-styles.puml @@ -40,4 +40,5 @@ Rel_Back(email_system, backend_api, "Sends e-mails using", "sync, SMTP") Rel_Neighbor(backend_api, banking_system, "Uses", "sync/async, XML/HTTPS", $tags="sync/async") SHOW_LEGEND() +footer drawn with PlantUML v. %version() and C4-PlantUML v. C4Version() @enduml \ No newline at end of file diff --git a/percy/TestVersion.puml b/percy/TestVersion.puml new file mode 100644 index 0000000..f7f2f82 --- /dev/null +++ b/percy/TestVersion.puml @@ -0,0 +1,21 @@ +@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/plantuml-stdlib/C4-PlantUML/master/C4_Deployment.puml +!endif + +' existing plantuml version as text +%version() + +' new C4-Plantuml version as text +C4Version() + +' new C4-Plantuml version details (incl. PlantUML version) as table +C4VersionDetails() + +' version functions used in e.g. footer +footer drawn with PlantUML v. %version() and C4-PlantUML v. C4Version() + +@enduml \ No newline at end of file From ea12578351eb0877c0feb7fec676b830d7501500 Mon Sep 17 00:00:00 2001 From: KIRCHSTH Date: Sat, 28 Aug 2021 18:07:02 +0200 Subject: [PATCH 08/11] #181 Add version information 2.3.1.beta1 --- C4.puml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4.puml b/C4.puml index 310247d..afa344b 100644 --- a/C4.puml +++ b/C4.puml @@ -3,7 +3,7 @@ 'Version ' ################################## !function C4Version() - !return "2.3.2beta1" + !return "2.3.1beta1" !end function !procedure C4VersionDetails() From 66005591c3c39fb5f5aa822c89aa90beb273f82f Mon Sep 17 00:00:00 2001 From: KIRCHSTH Date: Sat, 28 Aug 2021 18:18:27 +0200 Subject: [PATCH 09/11] #181 Add version information fix 2.3.1.beta1 (2) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9a88d3c..a982aec 100644 --- a/README.md +++ b/README.md @@ -535,9 +535,9 @@ Rel(personAlias, containerAlias, "Label", "Optional Technology") ## Version information -Starting with v.2.3.2beta1 C4-PlantUML offers version information like PlantUML with its `%version()` call. +Starting with v.2.3.1beta1 C4-PlantUML offers version information like PlantUML with its `%version()` call. -* `C4Version()`: Current C4-PlantUML version (e.g. "2.3.2beta1"). +* `C4Version()`: Current C4-PlantUML version (e.g. "2.3.1beta1"). * `C4VersionDetails()`: (Floating) version details with the current PlantUML and C4-PlantUML version (with the alias C4VersionDetailsArea) ``` From 2b9de9e4a29a21d22da57167202bd28f138d6d3c Mon Sep 17 00:00:00 2001 From: KIRCHSTH Date: Fri, 3 Sep 2021 17:37:39 +0200 Subject: [PATCH 10/11] #181 Add version information fix 2.3.1.beta1 (3 - fix readme, version) --- C4.puml | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/C4.puml b/C4.puml index afa344b..cc3d9a5 100644 --- a/C4.puml +++ b/C4.puml @@ -3,7 +3,7 @@ 'Version ' ################################## !function C4Version() - !return "2.3.1beta1" + !return "2.4.0beta1" !end function !procedure C4VersionDetails() diff --git a/README.md b/README.md index a982aec..9c3a8f6 100644 --- a/README.md +++ b/README.md @@ -535,10 +535,10 @@ Rel(personAlias, containerAlias, "Label", "Optional Technology") ## Version information -Starting with v.2.3.1beta1 C4-PlantUML offers version information like PlantUML with its `%version()` call. +C4-PlantUML offers version information like PlantUML with its `%version()` call. -* `C4Version()`: Current C4-PlantUML version (e.g. "2.3.1beta1"). -* `C4VersionDetails()`: (Floating) version details with the current PlantUML and C4-PlantUML version (with the alias C4VersionDetailsArea) +* `C4Version()`: Current C4-PlantUML version (e.g. `2.4.0beta1`). +* `C4VersionDetails()`: (Floating) version details with the current PlantUML and C4-PlantUML version. (It can be referenced via the alias `C4VersionDetailsArea`.) ``` @startuml From 5fcb83dc62a9a58ed17d563f2b1445c4b7173bde Mon Sep 17 00:00:00 2001 From: KIRCHSTH Date: Fri, 3 Sep 2021 21:08:42 +0200 Subject: [PATCH 11/11] #184 code in markdown use plantuml syntax --- LayoutOptions.md | 30 +++++++++++++++--------------- README.md | 26 +++++++++++++------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/LayoutOptions.md b/LayoutOptions.md index c9c885c..96d9c55 100644 --- a/LayoutOptions.md +++ b/LayoutOptions.md @@ -10,7 +10,7 @@ For this reason, C4-PlantUML also comes with some layout options. With the two macros `LAYOUT_TOP_DOWN()` and `LAYOUT_LEFT_RIGHT()` it is possible to easily change the flow visualization of the diagram. `LAYOUT_TOP_DOWN()` is the default. -```csharp +```plantuml @startuml LAYOUT_TOP_DOWN Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -32,7 +32,7 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS") `LAYOUT_LEFT_RIGHT()` rotates the flow visualization to *from Left to Right* and directed relations like `Rel_Left()`, `Rel_Right()`, `Rel_Up()` and `Rel_Down()` are rotated too. -```csharp +```plantuml @startuml LAYOUT_LEFT_RIGHT Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -53,7 +53,7 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS") `LAYOUT_LANDSCAPE()` rotates the default flow visualization to *from Left to Right* like `LAYOUT_LEFT_RIGHT()` additional **directed relations** like Rel_Left(), Rel_Right(), Rel_Up() and Rel_Down() **are not rotated** anymore. -```csharp +```plantuml @startuml LAYOUT_LANDSCAPE Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -94,7 +94,7 @@ It can also help to save some space. All of that is the reason, C4-PlantUML uses colors and prefer also to enable a layout without `<>` and with a legend. This can be enabled with `LAYOUT_WITH_LEGEND()`. -```csharp +```plantuml @startuml LAYOUT_WITH_LEGEND Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -121,7 +121,7 @@ The calculated legend has following differences: * stereotypes can remain visible (with `SHOW_LEGEND(false)`) * **`SHOW_LEGEND()` has to be last call in the diagram** -```csharp +```plantuml @startuml SHOW_LEGEND Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -144,7 +144,7 @@ SHOW_LEGEND() `LAYOUT_WITH_LEGEND()` and SHOW_LEGEND(?hideStereotype)` adds the legend at the bottom right of the picture like below and additional whitespace is created. -```csharp +```plantuml @startuml Layout With Whitespace Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -170,7 +170,7 @@ Therefore a floating legend can be added via SHOW_FLOATING_LEGEND(), positioned - `SHOW_FLOATING_LEGEND(?alias, ?hideStereotype): shows the legend in the drawing area - `LEGEND()`: is the default alias of the created floating legend and can be used in Lay_Distance() call -```csharp +```plantuml @startuml Compact Legend Layout Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -206,7 +206,7 @@ Without any proof More often these sketches are used by many people as facts and are manifested into their documentations. With `LAYOUT_AS_SKETCH()` you can make a difference. -```csharp +```plantuml @startuml LAYOUT_AS_SKETCH Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -231,7 +231,7 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS") To enable a layout without `<>` and legend. This can be enabled with `HIDE_STEREOTYPE()`. -```csharp +```plantuml @startuml HIDE_STEREOTYPE Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -263,7 +263,7 @@ With the macros `HIDE_PERSON_SPRITE()`, `SHOW_PERSON_SPRITE()` and `SHOW_PERSON_ "person" and "person2" are predefined sprites which can be used as default sprite too. -```csharp +```plantuml @startuml predefined sprites Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -277,7 +277,7 @@ Person(userB, "User B", "with predefined sprite person2", "person2") **Using HIDE_PERSON_SPRITE()** -```csharp +```plantuml @startuml HIDE_PERSON_SPRITE Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -298,7 +298,7 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS") **Using SHOW_PERSON_SPRITE()** -```csharp +```plantuml @startuml SHOW_PERSON_SPRITE Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -320,7 +320,7 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS") **Using SHOW_PERSON_SPRITE(sprite)** -```csharp +```plantuml @startuml SHOW_PERSON_SPRITE(sprite) Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml !define osaPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-opensecurityarchitecture2-icons/master @@ -344,7 +344,7 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS") **Using SHOW_PERSON_PORTRAIT()** -```csharp +```plantuml @startuml SHOW_PERSON_PORTRAIT() Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -370,7 +370,7 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS") > This call requires PlantUML version >= v1.2021.4! -```csharp +```plantuml @startuml SHOW_PERSON_OUTLINE() Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml diff --git a/README.md b/README.md index 6c0450c..2fdc5a7 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,13 @@ At the top of your C4 PlantUML `.puml` file, you need to include the `C4_Context To be independent of any internet connectivity, you can also download the files found in the `root` and activate the local conversion with additional command line argument `-DRELATIVE_INCLUDE="."` (that the local files are included) -```csharp +```plantuml java -jar plantuml.jar -DRELATIVE_INCLUDE="." ... ``` If you want to use the always up-to-date version in this repo, use the following: -```csharp +```plantuml !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml ``` @@ -36,7 +36,7 @@ Now let's create a C4 Container diagram: After you have included `C4_Container.puml` you can use the defined macro definitions for the C4 elements: `Person`, `Person_Ext`, `System`, `System_Ext`, `Container`, `Relationship`, `Boundary`, and `System_Boundary` -```csharp +```plantuml @startuml C4_Elements !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -54,7 +54,7 @@ In addition to this, it is also possible to define a system or component boundar Take a look at the following sample of a C4 Container Diagram: -```csharp +```plantuml @startuml Basic Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -73,7 +73,7 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS") Entities can also be decorated with icons/sprites using the $sprite parameter, for example: -```csharp +```plantuml @startuml !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -101,7 +101,7 @@ Rel_R(api, db, "Reads/Writes") Similar to icons/sprites is it possible to add links to all elements and relationships: -```csharp +```plantuml @startuml Basic Sample !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -124,7 +124,7 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS", $link="https://plantuml.com/l Elements and relations can be decorated with tags and explained via a calculated legend, for example: -```csharp +```plantuml @startuml !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -232,7 +232,7 @@ Relationship specific sprites are typically smaller and therefore following opti * 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) -```csharp +```plantuml @startuml !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml @@ -287,7 +287,7 @@ In rare cases, you can force the layout of objects which have no relationships b In following sample a person uses different systems, and group of persons which have no relations -```csharp +```plantuml @startuml !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml HIDE_STEREOTYPE() @@ -326,7 +326,7 @@ e.g. floating legend could be required that all e.g. corners of the drawing area In following sample the floating legend should be in the left bottom corner of the drawing are. (The normal SHOW_LEGEND() call requires no extra Lay_Distance() call and the legend is automatically drawn below the diagram on the right side) -``` +```plantuml @startuml !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -404,7 +404,7 @@ Multiple tags can be combined with `+`, like `Container(api, "API", $tags="v1.0+ * Colors of relationship tags cannot be automatically merged (PlantUML does not support it). If one tag modifies the line color and the other the text color, an additional combined tag has to be defined and used. -```csharp +```plantuml @startuml !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml @@ -450,7 +450,7 @@ SHOW_LEGEND(false) If the custom (color) schema is defined via `UpdateElementStyle()` then the legend of existing elements is updated too. -```csharp +```plantuml @startuml !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml @@ -504,7 +504,7 @@ A model can be extended with (a table of) properties that concrete deployments o Following sample uses all 3 different property definitions (and the aligned deployment node). -```csharp +```plantuml @startuml !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Deployment.puml