Giter Site home page Giter Site logo

nwdiag's Introduction

nwdiag generate network-diagram image file from spec-text file.

drone.io CI build status Latest PyPI version Number of PyPI downloads

Features

  • Generate network-diagram from dot like text (basic feature).
  • Multilingualization for node-label (utf-8 only).

You can get some examples and generated images on blockdiag.com .

Setup

Use easy_install or pip:

$ sudo easy_install nwdiag

Or

$ sudo pip nwdiag

spec-text setting sample

Few examples are available. You can get more examples at blockdiag.com .

simple.diag

simple.diag is simply define nodes and transitions by dot-like text format:

nwdiag {
  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"];
      web02 [address = "172.x.x.2"];
      db01;
      db02;
  }
}

Usage

Execute nwdiag command:

$ nwdiag simple.diag
$ ls simple.png
simple.png

Requirements

  • Python 3.7 or later
  • blockdiag 1.5.0 or later
  • funcparserlib 0.3.6 or later
  • reportlab (optional)
  • wand and imagemagick (optional)
  • setuptools

License

Apache License 2.0

nwdiag's People

Contributors

flying-foozy avatar fuu0 avatar msnoigrs avatar tk0miya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nwdiag's Issues

Can't create a node with multiple attachments without network

Hi,

I already reported this by mail but I'm not sure it was really the good contact point.

It's not possible right now to have a node with multiple peers without nwdiag creating networks:

nwdiag {
host1 -- host2
host2 -- host3
}

will create networks even though it's not asked. It might be because nwdiag apparently refuses to put on the same level multiple hosts not on the same network.


Generating readable big network maps ?

Hi,

I have a network with 55 segments, I'm selecting only one host by network topology (if there are X hosts with interfaces in netA, netB, and netC, for example, only the first will be in the diagram)

My problem is that the layout is not too big, and letters are very small, and i can't zoom and get it readable.

I'm trying to generate a pdf, evince read it ok (but I can't read letters clearly). trying to open the svg generated file with eog, hang eog.

I'm attaching an anonimated diagram which I hope will understand you what I am saying :)

Do you know any workarround ?

Thank you making this kind of software possible !


Exception combining Sphinx nwdiag `:caption:` directive with `:figwidth: image`

When I try to use the nwdiag :caption: directive in Sphinx, the associated blockdiag method throws an exception claiming that fontpath isn't defined, even though fontpath, blockdiag_fontpath, and nwdiag_fontpath are all set.

It looks like global_options is supposed to be set by calling the setup functions in the respective modules, but nothing ever seems to actually call those (adding a sys.exit() call didn't terminate the Sphinx run early)

# Sphinx version: 3.3.1
# Python version: 3.5.10 (CPython)
# Docutils version: 0.16 release
# Jinja2 version: 2.11.2
# Last messages:
[snip]
# Loaded extensions:
#   recommonmark (0.6.0)
#   alabaster (0.7.12)
#   sphinxcontrib.qthelp (1.0.3)
#   sphinx.ext.autodoc (3.3.1)
#   sphinxcontrib.blockdiag (2.0.1)
#   sphinx.ext.mathjax (3.3.1)
#   sphinxcontrib.serializinghtml (1.1.4)
#   sphinxcontrib.actdiag (2.0.0)
#   sphinxcontrib.packetdiag (2.0.0)
#   sphinxcontrib.devhelp (1.0.2)
#   sphinxcontrib.rackdiag (2.0.0)
#   sphinxcontrib.applehelp (1.0.2)
#   sphinxcontrib.htmlhelp (1.0.3)
#   sphinx.ext.autodoc.type_comment (3.3.1)
#   sphinxcontrib.nwdiag (2.0.0)
#   sphinxcontrib.seqdiag (2.0.0)
Traceback (most recent call last):
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/sphinx/cmd/build.py", line 280, in build_main
    app.build(args.force_all, filenames)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/sphinx/application.py", line 352, in build
    self.builder.build_update()
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/sphinx/builders/__init__.py", line 299, in build_update
    len(to_build))
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/sphinx/builders/__init__.py", line 311, in build
    updated_docnames = set(self.read())
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/sphinx/builders/__init__.py", line 418, in read
    self._read_serial(docnames)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/sphinx/builders/__init__.py", line 439, in _read_serial
    self.read_doc(docname)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/sphinx/builders/__init__.py", line 479, in read_doc
    doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/sphinx/io.py", line 223, in read_doc
    pub.publish()
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/core.py", line 218, in publish
    self.settings)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/sphinx/io.py", line 128, in read
    self.parse()
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/readers/__init__.py", line 77, in parse
    self.parser.parse(self.input, document)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/sphinx/parsers.py", line 102, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 171, in run
    input_source=document['source'])
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/statemachine.py", line 242, in run
    context, state, transitions)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 2769, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
    node=section_node, match_titles=True)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
    node=node, match_titles=match_titles)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/statemachine.py", line 242, in run
    context, state, transitions)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 2769, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
    node=section_node, match_titles=True)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
    node=node, match_titles=match_titles)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/statemachine.py", line 242, in run
    context, state, transitions)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 2342, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 2354, in explicit_construct
    return method(self, expmatch)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 2097, in directive
    directive_class, match, type_name, option_presets)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/docutils/parsers/rst/states.py", line 2146, in run_directive
    result = directive_instance.run()
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/blockdiag/utils/rst/directives.py", line 54, in decorator
    return fn(*args)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/blockdiag/utils/rst/directives.py", line 195, in run
    width = self.get_actual_width(node, diagram)
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/blockdiag/utils/rst/directives.py", line 226, in get_actual_width
    fontmap = self.create_fontmap()
  File "/home/ncoghlan/.local/share/virtualenvs/.../lib/python3.5/site-packages/blockdiag/utils/rst/directives.py", line 276, in create_fontmap
    fontpath = self.global_options['fontpath']
KeyError: 'fontpath'

Add local "node_" attributes

To improve label text formatting, it would be useful to add the ability to use width, height and other attributes "locally", for example:

   network local_nets {
    router;
    node_height = 80;
    address="10.0.1.0/24\n10.0.2.0/24\n10.0.3.0/24";
  } 

Otherwise a part of the label or the address gets stripped and replaced with ....

フォント指定でのPNG出力で出力エラーとなる

フォント指定でのPNG出力で出力エラーとなる現象がありましたので報告いたします。
ちなみに、blogにてコメントを頂戴した物です。

==== 状況 ====
redmineのWiki External Filter Plugin経由で実行しました。

==== コード ====

{
   サイトトップ -> ログイン画面 -> 情報一覧画面;
   サイトトップ -> 会員登録入力画面 -> 会員登録確認画面 -> 会員登録完了画面 -> サンキューメール;
   サンキューメール[shape = "mail"];
}

==== 実行コマンド ====

/usr/bin/nwdiag -Tpng  -f /usr/share/fonts/japanese/TrueType/sazanami-gothic.ttf -a -o/dev/stdout /dev/stdin

===== 備考 =====
フォントを指定すると本現象が発生する。
フォント指定をしない場合は本現象は発生しませんでした。

==== バージョン情報 ====
Linux MACHINENAME 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:56 EDT 2011 i686 i686 i386 GNU/Linux
CentOS release 5.6 (Final)

blockdiag 0.8.1

Python 2.4.3
Name : python
Arch : i386
Version : 2.4.3
Release : 44.el5

==== 詳細ログ ====

<div class="flash error">Error executing the <strong>blockdiag</strong> macro (Error applying external filter: stdout is <!--?xml version='1.0' encoding='UTF-8'?-->

<svg xmlns:inkspace="http://www.inkscape.org/namespaces/inkscape" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 216 ">
	<defs id="defs_block">
		<filter id="filter_blur" x="-0.07875" y="-0.252" width="1.1575" height="1.504" inkspace:collect="always">
			<feGaussianBlur inkspace:collect="always" id="feGaussianBlur3780" stdDeviation="4.2"/>
		</filter>
	</defs>
	<title>blockdiag</title>
	<rect fill="rgb(0,0,0)" stroke-width="1" x="67" y="54" stroke="rgb(0,0,0)" width="128" height="40" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1"/>
	<rect fill="rgb(0,0,0)" stroke-width="1" x="259" y="54" stroke="rgb(0,0,0)" width="128" height="40" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1"/>
	<rect fill="rgb(0,0,0)" stroke-width="1" x="259" y="134" stroke="rgb(0,0,0)" width="128" height="40" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1"/>
	<rect fill="rgb(0,0,0)" stroke-width="1" x="451" y="54" stroke="rgb(0,0,0)" width="128" height="40" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1"/>
	<rect fill="rgb(0,0,0)" stroke-width="1" x="451" y="134" stroke="rgb(0,0,0)" width="128" height="40" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1"/>
	<rect fill="rgb(0,0,0)" stroke-width="1" x="643" y="134" stroke="rgb(0,0,0)" width="128" height="40" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1"/>
	<rect fill="rgb(0,0,0)" stroke-width="1" x="835" y="134" stroke="rgb(0,0,0)" width="128" height="40" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1"/>
	<rect fill="rgb(255,255,255)" stroke-width="1" x="64" y="48" stroke="rgb(0,0,0)" width="128" height="40" style="None"/>
	<text fill="rgb(0,0,0)" font-size="11" x="104" y="74">サイトトップ</text>
	<rect fill="rgb(255,255,255)" stroke-width="1" x="256" y="48" stroke="rgb(0,0,0)" width="128" height="40" style="None"/>
	<text fill="rgb(0,0,0)" font-size="11" x="284" y="74">ログイン画面</text>
	<rect fill="rgb(255,255,255)" stroke-width="1" x="256" y="128" stroke="rgb(0,0,0)" width="128" height="40" style="None"/>
	<text fill="rgb(0,0,0)" font-size="11" x="275" y="154">会員登録入力画面</text>
	<rect fill="rgb(255,255,255)" stroke-width="1" x="448" y="48" stroke="rgb(0,0,0)" width="128" height="40" style="None"/>
	<text fill="rgb(0,0,0)" font-size="11" x="476" y="74">情報一覧画面</text>
	<rect fill="rgb(255,255,255)" stroke-width="1" x="448" y="128" stroke="rgb(0,0,0)" width="128" height="40" style="None"/>
	<text fill="rgb(0,0,0)" font-size="11" x="461" y="154">会員登録確認画面</text>
	<rect fill="rgb(255,255,255)" stroke-width="1" x="640" y="128" stroke="rgb(0,0,0)" width="128" height="40" style="None"/>
	<text fill="rgb(0,0,0)" font-size="11" x="656" y="154">会員登録完了画面</text>
	<rect fill="rgb(255,255,255)" stroke-width="1" x="832" y="128" stroke="rgb(0,0,0)" width="128" height="40" style="None"/>
	<path fill="none" d="M 832 128 L 896 144 L 960 128" stroke="rgb(0,0,0)"/>
	<text fill="rgb(0,0,0)" font-size="11" x="848" y="162">サンキューメール</text>
	<path fill="none" d="M 192 68 L 224 68 L 224 148 L 256 148" stroke="rgb(0,0,0)"/>
	<polygon fill="rgb(0,0,0)" stroke="rgb(0,0,0)" points="256, 148  248, 144  248, 152  256, 148  " style="None"/>
	<path fill="none" d="M 192 68 L 256 68" stroke="rgb(0,0,0)"/>
	<polygon fill="rgb(0,0,0)" stroke="rgb(0,0,0)" points="256, 68  248, 64  248, 72  256, 68  " style="None"/>
	<path fill="none" d="M 384 68 L 448 68" stroke="rgb(0,0,0)"/>
	<polygon fill="rgb(0,0,0)" stroke="rgb(0,0,0)" points="448, 68  440, 64  440, 72  448, 68  " style="None"/>
	<path fill="none" d="M 384 148 L 448 148" stroke="rgb(0,0,0)"/>
	<polygon fill="rgb(0,0,0)" stroke="rgb(0,0,0)" points="448, 148  440, 144  440, 152  448, 148  " style="None"/>
	<path fill="none" d="M 576 148 L 640 148" stroke="rgb(0,0,0)"/>
	<polygon fill="rgb(0,0,0)" stroke="rgb(0,0,0)" points="640, 148  632, 144  632, 152  640, 148  " style="None"/>
	<path fill="none" d="M 768 148 L 832 148" stroke="rgb(0,0,0)"/>
	<polygon fill="rgb(0,0,0)" stroke="rgb(0,0,0)" points="832, 148  824, 144  824, 152  832, 148  " style="None"/>
</svg>
, stderr is Traceback (most recent call last):
  File "/usr/bin/blockdiag", line 7, in ?
    sys.exit(
  File "/usr/lib/python2.4/site-packages/blockdiag-0.8.1-py2.4.egg/blockdiag/command.py", line 150, in main
    draw.draw()
  File "/usr/lib/python2.4/site-packages/blockdiag-0.8.1-py2.4.egg/blockdiag/DiagramDraw.py", line 122, in draw
    self.node(node, **kwargs)
  File "/usr/lib/python2.4/site-packages/blockdiag-0.8.1-py2.4.egg/blockdiag/DiagramDraw.py", line 257, in node
    font=self.font, badgeFill=self.badgeFill)
  File "/usr/lib/python2.4/site-packages/blockdiag-0.8.1-py2.4.egg/blockdiag/noderenderer/__init__.py", line 68, in render
    self.render_label(drawer, **kwargs)
  File "/usr/lib/python2.4/site-packages/blockdiag-0.8.1-py2.4.egg/blockdiag/noderenderer/__init__.py", line 82, in render_label
    lineSpacing=self.metrix.lineSpacing)
  File "/usr/lib/python2.4/site-packages/blockdiag-0.8.1-py2.4.egg/blockdiag/ImageDrawEx.py", line 263, in textarea
    lines = TextFolder(box, string, scale=self.scale_ratio, **kwargs)
  File "/usr/lib/python2.4/site-packages/blockdiag-0.8.1-py2.4.egg/blockdiag/utils/PILTextFolder.py", line 36, in __init__
    TextFolder.__init__(self, box, string, **kwargs)
  File "/usr/lib/python2.4/site-packages/blockdiag-0.8.1-py2.4.egg/blockdiag/utils/TextFolder.py", line 102, in __init__
    self._result = self._lines()
  File "/usr/lib/python2.4/site-packages/blockdiag-0.8.1-py2.4.egg/blockdiag/utils/TextFolder.py", line 255, in _lines
    if metrics[0] &lt;= size[0]:
TypeError: unsubscriptable object)

以上、ご確認のほどよろしくお願い申し上げます。


what is the purpose of undocumented "route" statement of nwdiag ?

I want the feature for explanation of how network packets are routed, like the image attached to this issue.
After a little investigation, I found the code paths for undocumented "route" statement, even though it does not yet work well.

nwdiag {
    ....
    route {
        client01 -> router -> inet
    }
}

What is the purpose of "route" statement ? Does it fit against my requirement ?
sample

draw tcp header error

Hi,I have draw tcp header with sample tcp.diag,but it reported
$ nwdiag tcp.diag
ERROR: Got unexpected token at line 5 column 4
$cat tcp.diag
{
colwidth = 32
node_height = 72

0-15: Source Port
16-31: Destination Port
32-63: Sequence Number
64-95: Acknowledgment Number
96-99: Data Offset
100-105: Reserved
106: URG [rotate = 270]
107: ACK [rotate = 270]
108: PSH [rotate = 270]
109: RST [rotate = 270]
110: SYN [rotate = 270]
111: FIN [rotate = 270]
112-127: Window
128-143: Checksum
144-159: Urgent Pointer
160-191: (Options and Padding)
192-223: data [colheight = 3]
}

`rackdiag`: `ascending` does not seem to work for multiple racks

Hello, thank you very much for the very useful set of tools.

I am trying to combine the multiple racks setup with ascending, but I am having 2 problems:

1. It seems that I cannot use the ascending attribute inside of a rack block (which is in turn inside of a racdiag block). The following example will exit with an error:
rackdiag {
  rack {
    ascending;
    // define height of rack
    5U;

    // define description of rack
    description = "Tokyo/1234 East";

    // define rack units
    1: UPS [2U];   // define height of unit
    3: DB Server [5kg]  // define weight of unit
    4: Web Server [0.5A]  // define ampere of unit
  }

  rack {
    4U;
    description="Other";

    1: UPS [2U];
    3: DB Server
    4: Web Server
  }
}
 `ERROR: 3,14-3,14: got unexpected token: ';', expected: '='`
2. If I try to add the ascending attribute to the toplevel rackdiag (while keeping the 2 inner rack blocks), the error does not happen, but also the order of the items remains unchanged...

Is there any way to create a diagram with multiple racks in the ascending order?

Networks are not comparable

network = min(networks)

This line crashes with

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/blockdiag/utils/bootstrap.py", line 54, in run
    return self.build_diagram(parsed)
  File "/usr/lib/python3/dist-packages/blockdiag/utils/bootstrap.py", line 103, in build_diagram
    drawer.draw()
  File "/usr/lib/python3/dist-packages/blockdiag/drawer.py", line 96, in draw
    self._draw_elements(**kwargs)
  File "/usr/lib/python3/dist-packages/nwdiag/drawer.py", line 139, in _draw_elements
    super(DiagramDraw, self)._draw_elements()
  File "/usr/lib/python3/dist-packages/blockdiag/drawer.py", line 142, in _draw_elements
    self.group_label(node, **kwargs)
  File "/usr/lib/python3/dist-packages/nwdiag/drawer.py", line 175, in group_label
    m = self.metrics.cell(group)
  File "/usr/lib/python3/dist-packages/nwdiag/metrics.py", line 59, in cell
    metrics = GroupMetrics(node, self, n.x1, n.y1, n.x2, n.y2)
  File "/usr/lib/python3/dist-packages/nwdiag/metrics.py", line 162, in __init__
    network = min(networks)
TypeError: '<' not supported between instances of 'Network' and 'Network'

replacing with
network = min(networks)
with
network = networks[0]
solves it magically, but may have side effects?

Sphinxでpeer networksを含むmake htmlに失敗する。

以下のpeer networksを含むdiagをmake htmlすると

diag {
  inet [shape = cloud];
  inet -- router;

  network {
    router;
    web01;
    web02;
  }
}

以下のようにエラーになってしまいます。

sphinx-build -b html -d _build/doctrees   . _build/html
Running Sphinx v1.1
WARNING: extension 'sphinxjp.themes.solarized' has no setup() function; is it really a Sphinx extension module?
loading pickled environment... done
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100&#37;] index                                                                                                                                 
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100&#37;] index                                                                                                                                  
Exception occurred:
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/blockdiag/imagedraw/filters/linejump.py", line 43, in _find_method
    &#37; (self.target.__class__.__name__, name))
AttributeError: ImageDrawEx instance has no attribute 'image'
The full traceback has been saved in /var/folders/Sw/SwmqTe3uEZKnEok2z3fhLE+++TI/-Tmp-/sphinx-err-UssAeq.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-dev/>,
or report them in the tracker at <http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!
make: *** [html] Error 1

shell returned 2

Press ENTER or type command to continue

More then 2 network does not render correctly

I am using nwdiag via plantuml.com online tool. When I try to add 3rd network, it draws 3rd network on top of 2nd network.

@startuml
nwdiag {
network External {
address = "192.168.x.0/24"
Router1 [address = "192.168.12.1"];
Router2 [address = "192.168.x.21"];
Router3 [address = "192.168.x.25"]
}

network Internal1 {
address = "192.168.y.0/24";
Router2 [address = "192.168.y.1"];
}

network Internal2 {
address = "192.168.z.0/24";
Router3 [address = "192.168.z.1"];
}
}
@enduml

Cannot use class attribute in rackdiag

Hi
I am trying to group attributes in a class inside rackdiag as in the sample below:

rackdiag {
class vpi [color = "#01AAC2"]
rack {
1U;
1 item [class="vpi"]
}

, but the parser throws an error:

ERROR: got unexpected token: 2,7-2,9: Name 'vpi'

I am using rackdiag version 2.0.0 and blockdiag version 2.0.1

If instead I use color as attribute in the rack item I get no error, but it would be much better to use classes.

wrong arc colour when using `linecolor` in PDFs

Let's take this example:

{
  network one {
      linecolor=green;
      A;
      x;
  }
  network two {
      B1;
      B2;
  }
  network three {
      linecolor=red;
      x;
  }
}

While the SVG output looks as expected, the PDF output has black arc segments instead of coloured ones. I marked them with a purple circle in the screenshots below:

screenshot-svg

screenshot-pdf-annotated

I'm preparing a PR to address this.

Can't disable drop shadows from network elements

When I've used the shadow_style=none setting I still get drop shadows for the networks. See the example below:

{
  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;
  }
}

Screenshot 2021-10-11 at 17 33 46

IPv6 Addresses and prefixes are cut off

diagram

nwdiag {
    inet [ shape = cloud ];
    router;
    controller;
    inet -- router;
    network public_v6 {
        address = "fdf5:058c:1a36:0f5a::/64"
        router [ address = "fe80::21c:73ff:fe03:11b3" ];
        controller;
        compute1;
        compute2;
    }


    compute1 -- vm1 [ address = "fdf5:58c:1a36:f5a:211:22ff:fe33:4455" ];
    compute2 -- vm2 [ address = "fdf5:58c:1a36:f5a:214:22ee:ef22:2142" ];
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.