[Style] Allow style on nwdiag Diagram

+1 vote
asked Aug 31, 2021 in Wanted features by The-Lu (63,920 points)

Hello PlantUML team,

  • Could you allow style on nwdiag Diagram?

Here is an example or a proposal for the keyword (nwdiagDiagram, network, server, group,...):

@startuml
<style>
nwdiagDiagram {
  network {
    BackGroundColor gray
    LineColor black
    LineThickness 1.0
    FontSize 11
  }
  server {
    BackGroundColor blue
    LineColor black
    LineThickness 1.0
    ' FontXXX for both description or address 
    FontSize 11
    FontColor #blue
  }
  group {
    BackGroundColor palegreen
    LineColor black
    LineThickness 2.0
    FontSize 11
    FontStyle bold
    Margin 5
    Padding 5
  }
}
</style>
nwdiag {
  network DMZ {
      address = "y.x.x.x/24"
      web01 [address = "y.x.x.1"];
      web02 [address = "y.x.x.2"];
  }

   network Internal {
    web01;
    web02;
    db01 [address = "w.w.w.z", shape = database];
  } 

    group {
    'color = "#77FF77";
    description = "long group label";
    web01;
    web02;
    db01;
  }
}
@enduml

Thanks for your works,
Regards,
Th.
 

commented Aug 31, 2021 by The-Lu (63,920 points)

For the SName of the nwdiag style...:

  • nwdiagDiagram 
  • or nwDiagram 
  • or just nwdiag (but that is not conform to the global rule of SName style wink)

 

1 Answer

0 votes
answered Sep 15, 2021 by plantuml (294,960 points)
selected Sep 16, 2021 by The-Lu
 
Best answer

Thanks for the example!

So with last beta http://beta.plantuml.net/plantuml.jar you can now have :

commented Sep 16, 2021 by The-Lu (63,920 points)

Hello PlantUML team,

Thanks; that is Good, but.... wink

While we are at it, why not now dissociate the description or label from the address...
Especially to dissociate, for example, FontXXX of the label of a server from the FontXXX of the address...
Sorry, if I come after the battle.blush

Then could you implement now (to be consistent from today):

@startuml
<style>
nwdiagDiagram {
  network {
    BackGroundColor green
    LineColor red
    LineThickness 1.0
    FontSize 18
    FontColor cyan
  }
  server {
    BackGroundColor red
    LineColor yellow
    LineThickness 1.0
    ' FontXXX only for description or label
    FontSize 18
    FontColor #blue
  }
  address {
    ' FontXXX only for address 
    FontSize 11
    FontColor #red
    FontName Monospaced
  }
  group {
    BackGroundColor palegreen
    LineColor black
    LineThickness 2.0
    FontSize 11
    FontStyle bold
    Margin 5
    Padding 5
  }
}
</style>
nwdiag {
  network DMZ {
      address = "y.x.x.x/24"
      web01 [address = "y.x.x.1"];
      web02 [address = "y.x.x.2"];
  }

   network Internal {
    web01;
    web02;
    db01 [address = "w.w.w.z", shape = database];
  } 

    group {
    description = "long group label";
    web01;
    web02;
    db01;
  }
}
@enduml

Regards,
Th.

commented Sep 16, 2021 by plantuml (294,960 points)

Rather than create a new address property, we have reused arrow (even if there is no arrow...)

This is working with last beta http://beta.plantuml.net/plantuml.jar

Sounds good ?

commented Sep 16, 2021 by The-Lu (63,920 points)

That is good.yes
And fully consistent.

I will had this on the doc. now.
And I will plan to modify some theme...

Regards,
Th.

...