nwdiag without drop shadows

52 views
Skip to first unread message

Ronny Trommer

unread,
Jul 26, 2021, 1:49:25 PM7/26/21
to blockdiag-discuss

I'm getting familiar with nwdiag and use the interactive shell from here: http://blockdiag.com/en/nwdiag/demo.html

Is there a way to remove all disable all drop shadows in the diagram? When I set shadow_style=none as in the example below, the network have still shadows set.

{
  shadow_style=none;
  network dmz {
      address = "210.x.x.x/24"

      web01 [address = "210.x.x.1"];
      web02 [address = "210.x.x.2"];
  }
  network internal {
      address = "172.x.x.x/24";

      web01 [address = "172.x.x.1"];
      db01;
      app01;
  }
}

Any hints appreciated and thank you in advance.

noboru....@kek.jp

unread,
Jul 26, 2021, 8:32:49 PM7/26/21
to blockdiag-discuss
In lib/python3.9/site-packages/nwdiag/drawer.py, I made small modification as shown below:

==== in class DiagramDraw definition.
    def _draw_background(self):
        super(DiagramDraw, self)._draw_background()
        if self.diagram.shadow_style != 'none':
            self.trunklines_shadow(True)
        else:
            self.trunklines_shadow(False)
            
    def trunklines_shadow(self, shadow=True):
        for network in self.diagram.networks:
            if network.hidden is False and network.color != 'none':
                self.trunkline(network, shadow=shadow)
======
with this modification. I got outputs with/without " shadow_style=none;" in the input.  nwdiag_sample_style_none.pngnwdiag_sample.png
regards,

Noboru
Reply all
Reply to author
Forward
0 new messages