nwdiag width directive has no effect

0 votes
asked Aug 20, 2021 in Bug by RM (140 points)

I'm getting the same output with or without the "width = full" directive being set.


PlantUML version 1.2021.9 (Sun Jul 25 05:13:56 CDT 2021)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: US
 
PLANTUML_LIMIT_SIZE: 4096

Dot version: dot - graphviz version 2.48.0 (0)
Installation seems OK. File generation OK


@startuml
title Bug Demo

nwdiag {

    network NetWork_A {
        width = full;
        address = "10.10.1.0/24";

        Node1 [ address = "10.10.1.1" ];
        Node2 [ address = "10.10.1.2" ];
        Node3 [ address = "10.10.1.3" ];
        Node4 [ address = "10.10.1.4" ];
    }

    network NetWork_B {
        width = full;
        address = "10.10.2.0/24";

        Node3 [ address = "10.10.2.3" ];
        Node4 [ address = "10.10.2.4" ];
        Node5 [ address = "10.10.2.5" ];
        Node6 [ address = "10.10.2.6" ];
    }

}
@enduml

1 Answer

0 votes
answered Aug 20, 2021 by The-Lu (64,760 points)

Hello R.,

Just suppress the semi-colon ';' after 'full':

@startuml
title Bug Demo

nwdiag {

    network NetWork_A {
        width = full
        address = "10.10.1.0/24";

        Node1 [ address = "10.10.1.1" ];
        Node2 [ address = "10.10.1.2" ];
        Node3 [ address = "10.10.1.3" ];
        Node4 [ address = "10.10.1.4" ];
    }

    network NetWork_B {
        width = full
        address = "10.10.2.0/24";

        Node3 [ address = "10.10.2.3" ];
        Node4 [ address = "10.10.2.4" ];
        Node5 [ address = "10.10.2.5" ];
        Node6 [ address = "10.10.2.6" ];
    }

}
@enduml

Then we observed the expected result:

In fact, you can also suppress all the semi-colons:

Regards,
Th.

...