plantuml / plantuml

Generate diagrams from textual description
https://plantuml.com
Other
9.66k stars 878 forks source link

nwdiag : add shape as router #1745

Open jcralbino opened 2 weeks ago

jcralbino commented 2 weeks ago

Is your feature request related to a problem? Please describe. In nwdiag when defining nodes part of a network we can use a limited set of shapes as defined plantuml nwdiag as defined bellow:

  network Network {
    Label       [shape = label]       
    Node        [shape = node]        
    Package     [shape = package]     
    Person      [shape = person]      
    Queue       [shape = queue]       
    Stack       [shape = stack]       
    Rectangle   [shape = rectangle]   
    Storage     [shape = storage]     
    Usecase     [shape = usecase]     
  }

I would like to allow the use of the following two options

shape = firewall
shape = router

Describe the solution you'd like The shape option should include the option of including a firewall, and router example. There are open icons that can be used for that.

Or the one in AWS for the router included already in plantuml !include <aws/Compute/AmazonVPC/router/router>

Or the OSA icon for firewall !include <osa/firewall/firewall>

Another collection of icons relevant for this feature are available here https://extensions.libreoffice.org/en/extensions/show/vrt-network-equipment

Describe alternatives you've considered Using the plantuml bellow provides similar results

@startuml
!include <osa/firewall/firewall>
!include <aws/Compute/AmazonVPC/router/router>
nwdiag {      
      network network {
          address = "address"

          firewall [ address = "" description= "<$firewall>\nFW" ]
          router [address = "" description = "<$router>\n RTR]
      }
}
@enduml

Additional context Using the description field to define the 'shape' is not intuitive, this option will be more user friendly for a very common use case of this nwdiag tool

jcralbino commented 2 weeks ago

This would allow also a better definition of the description text without considering the visual aspect of the icon. It would be interesting also to be able to control where the description is shown , if bellow icon/shape , right , left.

The-Lum commented 2 weeks ago

Hi all,

See also old request here:

Regards, Th.

jcralbino commented 2 weeks ago

Thanks looking into this

I realised they we could achieve similar results using the description field, but this is also limiting how that field is used.

If the shape field is used then description content can be used in more ways.

Is it possible to add this shape to the symbols available in all diagrams ?

jcralbino commented 2 weeks ago

For example in this case for this code

@startuml
!include <aws/Compute/AmazonVPC/router/router>
nwdiag {
  node [description ="<$router>\n BIG LONG TEXT IS NOT CENTERED AND LINE ABOVE NOT CENTERED"]
}
@enduml

We get something like: image

If we use the shape we get something like:

@startuml
!include <aws/Compute/AmazonVPC/router/router>
nwdiag {
  node [shape="storage"]
  node [description ="BIG LONG TEXT IS NOT CENTERED AND LINE ABOVE NOT CENTERED"]
}
@enduml

that generates this : image

and this:

@startuml
!include <aws/Compute/AmazonVPC/router/router>
nwdiag {
  node [shape="person"]
  node [description ="BIG LONG TEXT IS NOT CENTERED AND LINE ABOVE NOT CENTERED"]
}
@enduml

Generates this image

For me neither of them are good examples. The goal of this Issue was to be able to separate the "icon" from the text.

So it seems that using the shape option is not the best way of doing that.

My goal is to undestand how i can be able to associate a textual description information with more flexibility