diff --git a/dist/AzureCommon.puml b/dist/AzureCommon.puml index dcdca321..37928dc0 100644 --- a/dist/AzureCommon.puml +++ b/dist/AzureCommon.puml @@ -15,6 +15,8 @@ skinparam defaultTextAlignment center +skinparam PackageTitleAlignment Left + skinparam wrapWidth 200 skinparam maxMessageSize 150 @@ -35,6 +37,19 @@ skinparam rectangle<> { } !enddefinelong +' "StereotypeFontSize 0" below will hide text +' still need "hide stereotype" in diagrams to hide whitespace +!definelong AzureGroupColoring(g_stereo, g_background_color, g_border_color, g_border_style) +skinparam rectangle<> { + StereotypeFontSize 0 + BackgroundColor g_background_color + BorderColor g_border_color + BorderStyle g_border_style + Shadowing false + RoundCorner 0 +} +!enddefinelong + ' Layout ' ################################## @@ -58,3 +73,28 @@ rectangle "==e_label\n<$e_sprite>\n//<$e_sprite>\n//[e_techn]//\n\n e_descr" <> as e_alias !enddefinelong + +!function $AzureGroupImg($service) +!return %call_user_func("$" + $service + "IMG", "0.5") +!endfunction + +' wraps each line (seperated by \n) of a multi-line label with color +!function $colorlabel($label, $color="black") +!$buffer = "" +!$tmp = $label +!$i = %strpos($tmp, "\n") +!while $i >= 0 + !$buffer = $buffer + %substr($tmp, 0, $i) + "\n" + !$tmp = %substr($tmp, $i + 2) + !$i = %strpos($tmp, "\n") +!endwhile +!return "" + $buffer + $tmp + "" +!endfunction + +!definelong AzureGroupEntity(g_alias, g_label, g_color, g_stereo) +rectangle "$colorlabel(g_label, g_color)" as g_alias <> +!enddefinelong + +!definelong AzureGroupEntity(g_alias, g_label, g_color, g_sprite, g_stereo) +rectangle "$AzureGroupImg(g_sprite) $colorlabel(g_label, g_color)" as g_alias <> +!enddefinelong diff --git a/dist/Groups/AzureCloud(m).png b/dist/Groups/AzureCloud(m).png new file mode 100644 index 00000000..d8352c28 Binary files /dev/null and b/dist/Groups/AzureCloud(m).png differ diff --git a/dist/Groups/AzureCloud(m).svg b/dist/Groups/AzureCloud(m).svg new file mode 100644 index 00000000..6bef8def --- /dev/null +++ b/dist/Groups/AzureCloud(m).svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/Groups/AzureCloud.png b/dist/Groups/AzureCloud.png new file mode 100644 index 00000000..d6f6fbdb Binary files /dev/null and b/dist/Groups/AzureCloud.png differ diff --git a/dist/Groups/AzureCloud.puml b/dist/Groups/AzureCloud.puml new file mode 100644 index 00000000..f101a192 --- /dev/null +++ b/dist/Groups/AzureCloud.puml @@ -0,0 +1,14 @@ +sprite $AzureCloud [70x70/16z] { +xTH1RiGW38LX0mm6pFtFsu6n6feyMLZTpfVza_y58PUlb1zY2EJ2OunMW4JdyfYu096EzJ7r0hpeL1WV1Q5JHLTg0P8ZQ1574Wgoae8Zo9U4W_wV58Vo9U4W +Vn8EyYVX8FmAEBY2q9Faj-G80adyKPn1Un8NPXLyGLSIxv8hI9FqYaln16aIFmL7qD8OI8wWHHWedg25aN0OP2TbCqZ6_FwN56KPVnLdKj6LFnVLx4pgykkQ +IS6N56MdzmYHBwd8qs0YNr97AuaeC49O4eJ8byG2C94lIP14v4d2GPqMVgXSut5G8O99zGqcTG4YBU5-nyIUeEKnCKLNq9LKhn6S93X8XUkA2zj1_KP4zYj0 +4WhgpvbMWPSPrD4n0ACWEmc98CYSwGT9NMuEZx625dyI2-1E4eGTISORUZcIZ3UK7Kd66ygE91ZKQChxIeD9Pf2U6W-IxA0b7YHPGIhQIIsQGRzYxJYfpQyL +uxSTQ5DXKllG92j8rSVAl4BHKkKf4vYvYjf6YqAJEwQxqj-QNh7ZG2hU419JplcrYPDkG5y_ +} + +!function $AzureCloudIMG($scale=1) +!return "" +!endfunction + +AzureGroupColoring(AzureCloudGroup, #FFFFFF, AZURE_BORDER_COLOR, plain) +!define AzureCloudGroup(g_alias, g_label="AzureCloud") AzureGroupEntity(g_alias, g_label, AZURE_SYMBOL_COLOR, AzureCloud, AzureCloudGroup) diff --git a/dist/Groups/AzureCloud.svg b/dist/Groups/AzureCloud.svg new file mode 100644 index 00000000..4007fd86 --- /dev/null +++ b/dist/Groups/AzureCloud.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/Groups/Subnet(m).png b/dist/Groups/Subnet(m).png new file mode 100644 index 00000000..34c84724 Binary files /dev/null and b/dist/Groups/Subnet(m).png differ diff --git a/dist/Groups/Subnet(m).svg b/dist/Groups/Subnet(m).svg new file mode 100644 index 00000000..a8993970 --- /dev/null +++ b/dist/Groups/Subnet(m).svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/Groups/Subnet.png b/dist/Groups/Subnet.png new file mode 100644 index 00000000..b455a12d Binary files /dev/null and b/dist/Groups/Subnet.png differ diff --git a/dist/Groups/Subnet.puml b/dist/Groups/Subnet.puml new file mode 100644 index 00000000..b622d50b --- /dev/null +++ b/dist/Groups/Subnet.puml @@ -0,0 +1,12 @@ +sprite $Subnet [70x70/16z] { +xT37jO0m44DHOSyuz5_m3pgm6u4AyDiGVHrWTJgTJfcGZNIHlIT4S-zq4J828MCWB5w-fOliXgA-1IEG3jYCZsZ6HpJZ8vhn4StOYCzen6SquZCQyHcD-8o7 +N94PpM6cHbgoqCpyHgvnrxwOr0ZYKVBhR0J2SZpXXG60nRlHK3JUbS6XYwic4b4nEUz6XKIG2P0XKZBjKNg9a0c01P6IwOjbYP0XmgwGJ1jhYPMm2z2CJYEQ +yH7D-8XcV4GpFg8P7z6CZ_YCHdn68pxZ8pxJ1A8P50b4CoWJY68WCX4o7R9k8gVJwVGB +} + +!function $SubnetIMG($scale=1) +!return "" +!endfunction + +AzureGroupColoring(SubnetGroup, #FFFFFF, AZURE_BORDER_COLOR, plain) +!define SubnetGroup(g_alias, g_label="Subnet") AzureGroupEntity(g_alias, g_label, AZURE_SYMBOL_COLOR, Subnet, SubnetGroup) diff --git a/dist/Groups/Subnet.svg b/dist/Groups/Subnet.svg new file mode 100644 index 00000000..dd033f07 --- /dev/null +++ b/dist/Groups/Subnet.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/Groups/Subscription(m).png b/dist/Groups/Subscription(m).png new file mode 100644 index 00000000..cc994dff Binary files /dev/null and b/dist/Groups/Subscription(m).png differ diff --git a/dist/Groups/Subscription(m).svg b/dist/Groups/Subscription(m).svg new file mode 100644 index 00000000..0c22c00b --- /dev/null +++ b/dist/Groups/Subscription(m).svg @@ -0,0 +1 @@ +Icon-general-2 \ No newline at end of file diff --git a/dist/Groups/Subscription.png b/dist/Groups/Subscription.png new file mode 100644 index 00000000..c0123e83 Binary files /dev/null and b/dist/Groups/Subscription.png differ diff --git a/dist/Groups/Subscription.puml b/dist/Groups/Subscription.puml new file mode 100644 index 00000000..b15539b8 --- /dev/null +++ b/dist/Groups/Subscription.puml @@ -0,0 +1,13 @@ +sprite $Subscription [70x70/16z] { +pTS5SiL038DXo_BU_yZ5p5FHwwvA_s3e2rEq0Sb4UB6USnpKhNGGHGTHD12JWOuhUChWrO9vncXBdjFM721yEo8FaFUAc3doNfapA1LNMMAEhrYK4ZD0UAKj +4JD4-AwlCHJIE1k6Cbe6qPGoDamqLQjmjayGicFOx92GMagLQXJUMX_7WGBkjcMkzEsFIr3LXt7oWiBsk5mCeok7IlJrUtHDOEpYDY4M4vFIHCJqYCyW74Q8 +mGWn62468yHWXFWCuYWJaQ8o34LPYZfNrgAo5FMFbB0L_-WAyHLyXr85Lwcdu2XrAqwgghLAfQC8iHGXle9lKUWgOdob-DUAW-WlHyLPS1057n6pQbKuOJrL +uGKXJfWXzm +} + +!function $SubscriptionIMG($scale=1) +!return "" +!endfunction + +AzureGroupColoring(SubscriptionGroup, #FFFFFF, AZURE_BORDER_COLOR, plain) +!define SubscriptionGroup(g_alias, g_label="Subscription") AzureGroupEntity(g_alias, g_label, AZURE_SYMBOL_COLOR, Subscription, SubscriptionGroup) diff --git a/dist/Groups/Subscription.svg b/dist/Groups/Subscription.svg new file mode 100644 index 00000000..3d784fcd --- /dev/null +++ b/dist/Groups/Subscription.svg @@ -0,0 +1 @@ +Icon-general-2 \ No newline at end of file diff --git a/dist/Groups/VNet(m).png b/dist/Groups/VNet(m).png new file mode 100644 index 00000000..946d6296 Binary files /dev/null and b/dist/Groups/VNet(m).png differ diff --git a/dist/Groups/VNet(m).svg b/dist/Groups/VNet(m).svg new file mode 100644 index 00000000..a11778c6 --- /dev/null +++ b/dist/Groups/VNet(m).svg @@ -0,0 +1 @@ +Icon-networking-61 \ No newline at end of file diff --git a/dist/Groups/VNet.png b/dist/Groups/VNet.png new file mode 100644 index 00000000..2ac83f49 Binary files /dev/null and b/dist/Groups/VNet.png differ diff --git a/dist/Groups/VNet.puml b/dist/Groups/VNet.puml new file mode 100644 index 00000000..0dd818e1 --- /dev/null +++ b/dist/Groups/VNet.puml @@ -0,0 +1,13 @@ +sprite $VNet [70x70/16z] { +xT97aWD124JHyi3z3pm6g3OvHhbMzDyHq4-sl7jFJqzJwz_BgfD3p6uC86QJGu01X66cUVhxrf5W2CJazxLOCZp2Cpo238Dm38_m328amoCyWmZFy0ZF8C8p +1C8m3C8p2v3QUor7jVLMpdowCIkd6rANgEeesVYULjtaN5-rWWyYKXmnIwP_JnhBH4Ja1xC0wO6Ovg76s7qQWSY23uL8cV6KcN-8beZDM0QYMe29T5mKkojs +KH8vb977mv4vDjCrtHWJsPyeaRMHCTMHCW8v64azx-2hTqJhHfpnsn78Pgepu_QFF7_fzOsqZGGpOZMo4hLn-zVrSVlN7TF8yXOO8a08Xa08Xa0OXaUGuH6Q +uH5aU8HdU0GP7k4P7a66HtW64OgfBvOKqtzVTW991X1W4Y6OzlUo9VBEFJqzVG8 +} + +!function $VNetIMG($scale=1) +!return "" +!endfunction + +AzureGroupColoring(VNetGroup, #FFFFFF, AZURE_BORDER_COLOR, plain) +!define VNetGroup(g_alias, g_label="VNet") AzureGroupEntity(g_alias, g_label, AZURE_SYMBOL_COLOR, VNet, VNetGroup) diff --git a/dist/Groups/VNet.svg b/dist/Groups/VNet.svg new file mode 100644 index 00000000..99bf4d4c --- /dev/null +++ b/dist/Groups/VNet.svg @@ -0,0 +1 @@ +Icon-networking-61 \ No newline at end of file diff --git a/dist/Groups/all.puml b/dist/Groups/all.puml new file mode 100644 index 00000000..c6579f55 --- /dev/null +++ b/dist/Groups/all.puml @@ -0,0 +1,56 @@ +sprite $Subscription [70x70/16z] { +pTS5SiL038DXo_BU_yZ5p5FHwwvA_s3e2rEq0Sb4UB6USnpKhNGGHGTHD12JWOuhUChWrO9vncXBdjFM721yEo8FaFUAc3doNfapA1LNMMAEhrYK4ZD0UAKj +4JD4-AwlCHJIE1k6Cbe6qPGoDamqLQjmjayGicFOx92GMagLQXJUMX_7WGBkjcMkzEsFIr3LXt7oWiBsk5mCeok7IlJrUtHDOEpYDY4M4vFIHCJqYCyW74Q8 +mGWn62468yHWXFWCuYWJaQ8o34LPYZfNrgAo5FMFbB0L_-WAyHLyXr85Lwcdu2XrAqwgghLAfQC8iHGXle9lKUWgOdob-DUAW-WlHyLPS1057n6pQbKuOJrL +uGKXJfWXzm +} + +!function $SubscriptionIMG($scale=1) +!return "" +!endfunction + +AzureGroupColoring(SubscriptionGroup, #FFFFFF, AZURE_BORDER_COLOR, plain) +!define SubscriptionGroup(g_alias, g_label="Subscription") AzureGroupEntity(g_alias, g_label, AZURE_SYMBOL_COLOR, Subscription, SubscriptionGroup) + +sprite $VNet [70x70/16z] { +xT97aWD124JHyi3z3pm6g3OvHhbMzDyHq4-sl7jFJqzJwz_BgfD3p6uC86QJGu01X66cUVhxrf5W2CJazxLOCZp2Cpo238Dm38_m328amoCyWmZFy0ZF8C8p +1C8m3C8p2v3QUor7jVLMpdowCIkd6rANgEeesVYULjtaN5-rWWyYKXmnIwP_JnhBH4Ja1xC0wO6Ovg76s7qQWSY23uL8cV6KcN-8beZDM0QYMe29T5mKkojs +KH8vb977mv4vDjCrtHWJsPyeaRMHCTMHCW8v64azx-2hTqJhHfpnsn78Pgepu_QFF7_fzOsqZGGpOZMo4hLn-zVrSVlN7TF8yXOO8a08Xa08Xa0OXaUGuH6Q +uH5aU8HdU0GP7k4P7a66HtW64OgfBvOKqtzVTW991X1W4Y6OzlUo9VBEFJqzVG8 +} + +!function $VNetIMG($scale=1) +!return "" +!endfunction + +AzureGroupColoring(VNetGroup, #FFFFFF, AZURE_BORDER_COLOR, plain) +!define VNetGroup(g_alias, g_label="VNet") AzureGroupEntity(g_alias, g_label, AZURE_SYMBOL_COLOR, VNet, VNetGroup) + +sprite $Subnet [70x70/16z] { +xT37jO0m44DHOSyuz5_m3pgm6u4AyDiGVHrWTJgTJfcGZNIHlIT4S-zq4J828MCWB5w-fOliXgA-1IEG3jYCZsZ6HpJZ8vhn4StOYCzen6SquZCQyHcD-8o7 +N94PpM6cHbgoqCpyHgvnrxwOr0ZYKVBhR0J2SZpXXG60nRlHK3JUbS6XYwic4b4nEUz6XKIG2P0XKZBjKNg9a0c01P6IwOjbYP0XmgwGJ1jhYPMm2z2CJYEQ +yH7D-8XcV4GpFg8P7z6CZ_YCHdn68pxZ8pxJ1A8P50b4CoWJY68WCX4o7R9k8gVJwVGB +} + +!function $SubnetIMG($scale=1) +!return "" +!endfunction + +AzureGroupColoring(SubnetGroup, #FFFFFF, AZURE_BORDER_COLOR, plain) +!define SubnetGroup(g_alias, g_label="Subnet") AzureGroupEntity(g_alias, g_label, AZURE_SYMBOL_COLOR, Subnet, SubnetGroup) + +sprite $AzureCloud [70x70/16z] { +xTH1RiGW38LX0mm6pFtFsu6n6feyMLZTpfVza_y58PUlb1zY2EJ2OunMW4JdyfYu096EzJ7r0hpeL1WV1Q5JHLTg0P8ZQ1574Wgoae8Zo9U4W_wV58Vo9U4W +Vn8EyYVX8FmAEBY2q9Faj-G80adyKPn1Un8NPXLyGLSIxv8hI9FqYaln16aIFmL7qD8OI8wWHHWedg25aN0OP2TbCqZ6_FwN56KPVnLdKj6LFnVLx4pgykkQ +IS6N56MdzmYHBwd8qs0YNr97AuaeC49O4eJ8byG2C94lIP14v4d2GPqMVgXSut5G8O99zGqcTG4YBU5-nyIUeEKnCKLNq9LKhn6S93X8XUkA2zj1_KP4zYj0 +4WhgpvbMWPSPrD4n0ACWEmc98CYSwGT9NMuEZx625dyI2-1E4eGTISORUZcIZ3UK7Kd66ygE91ZKQChxIeD9Pf2U6W-IxA0b7YHPGIhQIIsQGRzYxJYfpQyL +uxSTQ5DXKllG92j8rSVAl4BHKkKf4vYvYjf6YqAJEwQxqj-QNh7ZG2hU419JplcrYPDkG5y_ +} + +!function $AzureCloudIMG($scale=1) +!return "" +!endfunction + +AzureGroupColoring(AzureCloudGroup, #FFFFFF, AZURE_BORDER_COLOR, plain) +!define AzureCloudGroup(g_alias, g_label="AzureCloud") AzureGroupEntity(g_alias, g_label, AZURE_SYMBOL_COLOR, AzureCloud, AzureCloudGroup) + diff --git a/samples/Groups.puml b/samples/Groups.puml new file mode 100644 index 00000000..5aab1c04 --- /dev/null +++ b/samples/Groups.puml @@ -0,0 +1,35 @@ +@startuml Hello Groups +!pragma revision 1 + +!define AzurePuml https://raw.githubusercontent.com/anton-kasperovich/Azure-PlantUML/master/dist +!includeurl AzurePuml/AzureCommon.puml +!includeurl AzurePuml/Databases/AzureCosmosDb.puml +!includeurl AzurePuml/Groups/all.puml + +AzureCloudGroup(cloud, "Azure Cloud") { + SubscriptionGroup(subscription, "Landing Zone") { + VNetGroup(vNet1) { + SubnetGroup(subnet1) { + AzureCosmosDb(outputCosmosDb1, "Output Database", "1,000 RUs") + } + + SubnetGroup(subnet2) { + AzureCosmosDb(outputCosmosDb2, "Output Database", "1,000 RUs") + } + } + } + + SubscriptionGroup(subscription2) { + VNetGroup(vNet3) { + SubnetGroup(subnet3) { + AzureCosmosDb(outputCosmosDb3, "Output Database", "1,000 RUs") + } + + SubnetGroup(subnet4) { + AzureCosmosDb(outputCosmosDb4, "Output Database", "1,000 RUs") + } + } + } +} + +@enduml \ No newline at end of file diff --git a/scripts/Config.yaml b/scripts/Config.yaml index c32b5418..49dfcd5f 100644 --- a/scripts/Config.yaml +++ b/scripts/Config.yaml @@ -605,4 +605,15 @@ Categories: Target: AzureContainerSettings Fit: true - Source: Properties - Target: AzureProperties \ No newline at end of file + Target: AzureProperties + +- Name: Groups + Services: + - Source: Microsoft-Azure + Target: AzureCloud + - Source: Subscriptions + Target: Subscription + - Source: Virtual Networks + Target: VNet + - Source: VNet-Subnets_COLOR + Target: Subnet \ No newline at end of file diff --git a/scripts/GeneratePlantuml.cs b/scripts/GeneratePlantuml.cs index 501fdd46..fc63538f 100644 --- a/scripts/GeneratePlantuml.cs +++ b/scripts/GeneratePlantuml.cs @@ -73,7 +73,8 @@ private async Task ProcessFiles() CombineMultipleFilesIntoSingleFile(categoryDirectoryPath, "*.puml", catAllFilePath); } - await VSCodeSnippets.GenerateSnippets(targetFolder); + // @TODO: uncomment and fix snippets generation (got broken after Groups were introduced) + // await VSCodeSnippets.GenerateSnippets(targetFolder); await MarkdownTable.GenerateTable(targetFolder); await this.StopAsync(new System.Threading.CancellationToken()); } @@ -123,10 +124,12 @@ async Task ProcessService(ConfigLookupEntry service) await svgManager.ExportToMonochrome(monochromSvgFilePath, monochromSvgFilePath, azureColor); } + var type = (service.Category == "Groups") ? "group" : "entity"; + var monochromPngFilePath = Path.Combine(categoryDirectoryPath, service.ServiceTarget + "(m).png"); // First generation with background needed for PUML sprite generation await svgManager.ExportToPng(monochromSvgFilePath, monochromPngFilePath, targetImageHeight, omitBackground: false); - ConvertToPuml(monochromPngFilePath, service.ServiceTarget + ".puml"); + ConvertToPuml(type, monochromPngFilePath, service.ServiceTarget + ".puml"); // Second generation without background needed other usages await svgManager.ExportToPng(monochromSvgFilePath, monochromPngFilePath, targetImageHeight, omitBackground: true); @@ -193,7 +196,7 @@ string GetSourceFilePath(string sourceFileName, bool color = true) return string.Empty; // no result } - string ConvertToPuml(string pngPath, string pumlFileName) + string ConvertToPuml(string type, string pngPath, string pumlFileName) { var format = "16z"; var entityName = Path.GetFileNameWithoutExtension(pumlFileName); @@ -230,9 +233,24 @@ string ConvertToPuml(string pngPath, string pumlFileName) pumlContent.Append(process.StandardOutput.ReadToEnd()); } - pumlContent.AppendLine($"AzureEntityColoring({entityName})"); - pumlContent.AppendLine($"!define {entityName}(e_alias, e_label, e_techn) AzureEntity(e_alias, e_label, e_techn, AZURE_SYMBOL_COLOR, {entityName}, {entityName})"); - pumlContent.AppendLine($"!define {entityName}(e_alias, e_label, e_techn, e_descr) AzureEntity(e_alias, e_label, e_techn, e_descr, AZURE_SYMBOL_COLOR, {entityName}, {entityName})"); + if (type == "group") { + // Convert PNG to Base64 + var bytes = File.ReadAllBytes(pngPath); + var encoded_string = Convert.ToBase64String(bytes); + + var groupName = $"{entityName}Group"; + + pumlContent.AppendLine($"!function ${entityName}IMG($scale=1)"); + pumlContent.AppendLine($"!return \"\""); + pumlContent.AppendLine($"!endfunction\n"); + + pumlContent.AppendLine($"AzureGroupColoring({groupName}, #FFFFFF, AZURE_BORDER_COLOR, plain)"); + pumlContent.AppendLine($"!define {groupName}(g_alias, g_label=\"{entityName}\") AzureGroupEntity(g_alias, g_label, AZURE_SYMBOL_COLOR, {entityName}, {groupName})"); + } else { + pumlContent.AppendLine($"AzureEntityColoring({entityName})"); + pumlContent.AppendLine($"!define {entityName}(e_alias, e_label, e_techn) AzureEntity(e_alias, e_label, e_techn, AZURE_SYMBOL_COLOR, {entityName}, {entityName})"); + pumlContent.AppendLine($"!define {entityName}(e_alias, e_label, e_techn, e_descr) AzureEntity(e_alias, e_label, e_techn, e_descr, AZURE_SYMBOL_COLOR, {entityName}, {entityName})"); + } File.WriteAllText(pumlPath, pumlContent.ToString()); return pumlPath; diff --git a/source/AzureCommon.puml b/source/AzureCommon.puml index dcdca321..37928dc0 100644 --- a/source/AzureCommon.puml +++ b/source/AzureCommon.puml @@ -15,6 +15,8 @@ skinparam defaultTextAlignment center +skinparam PackageTitleAlignment Left + skinparam wrapWidth 200 skinparam maxMessageSize 150 @@ -35,6 +37,19 @@ skinparam rectangle<> { } !enddefinelong +' "StereotypeFontSize 0" below will hide text +' still need "hide stereotype" in diagrams to hide whitespace +!definelong AzureGroupColoring(g_stereo, g_background_color, g_border_color, g_border_style) +skinparam rectangle<> { + StereotypeFontSize 0 + BackgroundColor g_background_color + BorderColor g_border_color + BorderStyle g_border_style + Shadowing false + RoundCorner 0 +} +!enddefinelong + ' Layout ' ################################## @@ -58,3 +73,28 @@ rectangle "==e_label\n<$e_sprite>\n//<$e_sprite>\n//[e_techn]//\n\n e_descr" <> as e_alias !enddefinelong + +!function $AzureGroupImg($service) +!return %call_user_func("$" + $service + "IMG", "0.5") +!endfunction + +' wraps each line (seperated by \n) of a multi-line label with color +!function $colorlabel($label, $color="black") +!$buffer = "" +!$tmp = $label +!$i = %strpos($tmp, "\n") +!while $i >= 0 + !$buffer = $buffer + %substr($tmp, 0, $i) + "\n" + !$tmp = %substr($tmp, $i + 2) + !$i = %strpos($tmp, "\n") +!endwhile +!return "" + $buffer + $tmp + "" +!endfunction + +!definelong AzureGroupEntity(g_alias, g_label, g_color, g_stereo) +rectangle "$colorlabel(g_label, g_color)" as g_alias <> +!enddefinelong + +!definelong AzureGroupEntity(g_alias, g_label, g_color, g_sprite, g_stereo) +rectangle "$AzureGroupImg(g_sprite) $colorlabel(g_label, g_color)" as g_alias <> +!enddefinelong