From 177c8d115e4ae118fc4fb3ed16fdfc628d2b9f7f Mon Sep 17 00:00:00 2001 From: KIRCHSTH Date: Sun, 1 Jan 2023 11:43:50 +0100 Subject: [PATCH] #277 Rel_Back is layout neutral --- C4.puml | 4 ++-- C4_Dynamic.puml | 8 ++++---- percy/TestRelBackNorank.puml | 40 ++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 percy/TestRelBackNorank.puml diff --git a/C4.puml b/C4.puml index d6f1b28..684a5fc 100644 --- a/C4.puml +++ b/C4.puml @@ -1283,7 +1283,7 @@ $getRel("<<-->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_Back($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<--", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) +$getRel("<<-[norank]-", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") @@ -1295,7 +1295,7 @@ $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) +$getRel("<<-[norank]", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") diff --git a/C4_Dynamic.puml b/C4_Dynamic.puml index 8633ec4..de23c72 100644 --- a/C4_Dynamic.puml +++ b/C4_Dynamic.puml @@ -73,10 +73,10 @@ $getRel("-->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $ !endprocedure !unquoted procedure Rel_Back($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<--", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel("<<-[norank]-", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure RelIndex_Back($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<--", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel("<<-[norank]-", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") @@ -87,10 +87,10 @@ $getRel("->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $t !endprocedure !unquoted procedure Rel_Back_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel("<<-[norank]", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure RelIndex_Back_Neighbor($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) +$getRel("<<-[norank]", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) !endprocedure !unquoted procedure Rel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") diff --git a/percy/TestRelBackNorank.puml b/percy/TestRelBackNorank.puml new file mode 100644 index 0000000..8b5fd4e --- /dev/null +++ b/percy/TestRelBackNorank.puml @@ -0,0 +1,40 @@ +@startuml +' convert it with additional command line argument -DRELATIVE_INCLUDE="./.." to use locally +!if %variable_exists("RELATIVE_INCLUDE") + !include %get_variable_value("RELATIVE_INCLUDE")/C4_Component.puml +!else + !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml +!endif + +HIDE_STEREOTYPE() + +Person(x, "X") +System(s1, "S1") +System(s2, "S2") +System(s3, "S3") +System(s4, "S4") + +Rel_U(x, s1, "uses U") +Rel_R(x, s2, "uses R") +Rel_D(x, s3, "uses D") +Rel_L(x, s4, "uses L") + +Rel_Back(x, s1, "back U") +Rel_Back(x, s2, "back R") +Rel_Back(x, s3, "back D") +Rel_Back(x, s4, "back L") + +Person(nx, "neighbor X") +System(ns1, "neighbor S1") +Rel_Neighbor(nx, ns1, "uses N") +Rel_Back_Neighbor(nx, ns1, "back N") +' nx <-[norank]- ns1: "**back N**" + +' practically both Rel_Back... versions produce the same layout +Person(mx, "mixed X") +System(ms1, "mixed S1") +Rel_Neighbor(mx, ms1, "uses M") +Rel_Back(mx, ms1, "back M") +' mx <-[norank]- ms1: "**back M**" + +@enduml \ No newline at end of file