nwdiag align server to center

0 votes
asked Jan 8 in Question / help by eduardomozart (480 points)
edited Jan 8 by eduardomozart
Hello,

Into the following diagram, the server is positioned on the left side:

@startuml
skinparam defaultTextAlignment center

!define Visio2kNet https://raw.githubusercontent.com/eduardomozart/Visio2000-BasicNetworkShapes3D/main
!include Visio2kNet/puml/Server.puml
!include Visio2kNet/puml/Personal_computer.puml
!include Visio2kNet/puml/Laptop.puml

<style>
nwdiagDiagram {
  server {
    BackgroundColor none
    LineColor none
    
  }
}
</style>

nwdiag {
  fs01 [description = "<U+0020><U+0020><U+0020><U+0020><U+0020><U+0020><U+0020><U+0020><U+0020><U+0020><U+0020><U+0020><U+0020><U+0020><U+0020><U+0020><$Server>\nServidor: SRV01\nPasta comp. : C:\Manuais\nCaminho: \\SRV01\Manuais"]

  network LAN {
      fs01
      client01 [description = "<$Personal_computer>\n Cliente\n <U+0020><U+0020><U+0020><U+0020><U+0020>X:"]
      client02 [description = "<$Laptop>\n Cliente\n <U+0020><U+0020><U+0020><U+0020><U+0020>X:"]
      client03 [description = "<$Personal_computer>\n Cliente\n <U+0020><U+0020><U+0020><U+0020><U+0020>X:"]
      client04 [description = "<$Personal_computer>\n Cliente\n <U+0020><U+0020><U+0020><U+0020><U+0020>X:"]
      client05 [description = "<$Personal_computer>\n Cliente\n <U+0020><U+0020><U+0020><U+0020><U+0020>X:"]
  }
}
@enduml

But the server is left aligned, as seem here: https://ibb.co/ZKJfsRV

I would like to know if there's a way to center align the server as seem in:

https://ibb.co/p0kfF6t

I tried to search the nwdiag documentation but it seems that PlantUML uses a heavily modified version of nwdiag and it seems to render and behave different than the source.

I also would like to know if it's possible to right align the text bottom the server on the right as seem into the last image. I was able to do something similar adding a fake server after the fs01, but it's description makes the laptop have a higher width than the others clients, which right now also seens the case on the first computer.

Also, I would like to know if there's any parameter to center align the nwdiag descriptions as it doesn't seems to be possible to center align it using the "DefaultTextAlignment" skinparam.

Also, it doesn't seems to be possible to use <<stereotype>> notation to apply custom styles for specific elements, it would be a nice feature to have.

Also, I couldn't find a way to hide/style the line (arrow) that links the server with the LAN subnet and "hide stereotype" doesn't seem to work also. I tried to create pseudo-hidden elements to somehow make the server aligned to center but I was unable to.

Also, it seems that the network "description" and "address" is always aligned to the right, there's anyway to change it's alignment? e.g. when using the following as network name:

network DMZ {
   description = "Root DFS/\n\
├── Diagramas\n\
├── Manuais\n\
├── Memorandos \n\
├── Modelos\n\
├── Programas\n\
├── Público\n\
├── Relatórios\n\
└── Segurança"
}

I'm unable to align it to the left and the tree is drawn wrong. I know, it's a bit dirty, but the tree isn't rendered as expected because of the right alignment of network label.
commented Jan 13 by The-Lu (76,660 points)

Hi E.,

For 1/ here is a minimal example (to PlantUML Team):

@startuml
nwdiag {
  w1
  network n {
    w1
    w2
    w3
  }
}
@enduml

For 2/, see the ask of this wanted feature:

Regards,
Th.

commented Jan 14 by eduardomozart (480 points)

Hello, for /1 what I was looking for was a way to center "w 1" between "w 2" and "w 3", something similar to below:

Maybe https://github.com/plantuml/plantuml/issues/2033 could achieve this?

commented Jan 14 by The-Lu (76,660 points)

Hi E.,

For 1/ Center element 'e1'... That is not yet possible...

And the question was also when there are more elements as:

@startuml
nwdiag {
  e1
  network n {
    e1
    e2
    e3
    e4
    e5
    e6
  }
}
@enduml

2/ And the [Style] Improve `HorizontalAlignment` management, on `nwdiagram` · Issue #2033 · plantuml/plantuml will only achieve label arrangement not element arrangement..
 



See also, some request or issue here:

I will re-create some new request.. about this topic..

Regards,
Th.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...