awslabs / aws-icons-for-plantuml

PlantUML sprites, macros, and other includes for Amazon Web Services services and resources
Other
902 stars 152 forks source link

Question: Group rendering with AWSSimplified.puml #20

Closed jghaines closed 4 years ago

jghaines commented 4 years ago

The diagram below will render boxes around each component including the VPC networking group.

If I uncomment the AWSSimplified line, all the boxes disapear, making the VPC grouping invisible.

@startuml FSX network
!define AWSPuml https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/master/dist
!include AWSPuml/AWSCommon.puml
' Uncomment the following line to create simplified view
'!include AWSPuml/AWSSimplified.puml
!include AWSPuml/General/Users.puml

!include AWSPuml/Storage/FSxforWindowsFileServer.puml
!include AWSPuml/NetworkingAndContentDelivery/ClientVPN.puml
!include AWSPuml/GroupIcons/VirtualPrivateCloudVPC.puml

!include AWSPuml/GroupIcons/CorporateDataCenter.puml

title: <b>Network infrastructure</b>
'left to right direction
'top to bottom direction

FSxforWindowsFileServer(fsx, "FSx Windows File Server", "")

Users(wfh, "", "Member Joins Online")
VirtualPrivateCloudVPC(networking_vpc, "Networking VPC", "") {
    ClientVPN(clientVpn, "Client VPN", "")
}

wfh -right-> clientVpn

clientVpn -right-> fsx

@enduml

Rendered with PLANTUML_VERSION=1.2019.11

cat x.puml | docker run --rm -i think/plantuml > x.svg

and browser-based PlantUML

gadams999 commented 4 years ago

I'll look into into seeing if there is a way to keep boxes in simplified mode for grouping of objects. It may be through using native PlantUML (Graphviz) boundary boxes in this case for referencing the VPC.

gadams999 commented 4 years ago

One way to have a rectangle grouping is to use the native sprite for the icon to use as part of a rectangle definition. I've modified the VirtualPrivateCloudVPC(networking_vpc, "Networking VPC", "") to this:

@startuml FSX network
!define AWSPuml https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/master/dist
!include AWSPuml/AWSCommon.puml
' Uncomment the following line to create simplified view
!include AWSPuml/AWSSimplified.puml
!include AWSPuml/General/Users.puml

!include AWSPuml/Storage/FSxforWindowsFileServer.puml
!include AWSPuml/NetworkingAndContentDelivery/ClientVPN.puml
!include AWSPuml/GroupIcons/VirtualPrivateCloudVPC.puml

!include AWSPuml/GroupIcons/CorporateDataCenter.puml

title: <b>Network infrastructure</b>
'left to right direction
'top to bottom direction

FSxforWindowsFileServer(fsx, "FSx Windows File Server", "")

Users(wfh, "", "Member Joins Online")
rectangle "VPC" <<$VirtualPrivateCloudVPC{scale=.5}>> {
    ClientVPN(clientVpn, "Client VPN", "")
}

wfh -right-> clientVpn

clientVpn -right-> fsx

@enduml

FSX network

With AWSSimplified included, the VPC rectangle stays visible. And in regular mode it looks like this:

FSX network

Not being a PlantUML expert, I'd be interested in how the GroupIcons can be expressed as rectangles and not stereotypes like the rest of the icons.

EDIT: Graphics

gadams999 commented 4 years ago

Closing out. Please feel free to reopen if needed.