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 1/4] 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 2/4] 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 3/4] 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 4/4] 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")