xdot 替代方案 / 损坏的错误打印 / sbt-dependency-graph

xdot alternative / broken error print / sbt-dependency-graph

我正在尝试渲染由 sbt-dependency-graph 插件生成的 .dot 输出。出于某种原因,xdot 无法打开文件,该文件看起来像 Python 代码中的错误:

Warning: gvrender_set_style: unsupported style stroke-dasharray: 5 - ignoring
Warning: gvrender_set_style: unsupported style 5 - ignoring
Warning: gvrender_set_style: unsupported style stroke-dasharray: 5 - ignoring
[...]
Warning: gvrender_set_style: unsupported style 5 - ignoring
Warning: gvrender_set_style: unsupported style stroke-dasharray: 5 - ignoring
Warning: gvrender_set_style: unsupported style 5 - ignoring
Warning: gvrender_set_style: unsupported style stroke-dasharray: 5 - ignoring
Warning: gvrender_set_style: unsupported style 5 - ignoring
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/xdot.py", line 2060, in on_open
    self.open_file(filename)
  File "/usr/lib/python2.7/dist-packages/xdot.py", line 2029, in open_file
    self.set_dotcode(fp.read(), filename)
  File "/usr/lib/python2.7/dist-packages/xdot.py", line 2011, in set_dotcode
    if self.widget.set_dotcode(dotcode, filename):
  File "/usr/lib/python2.7/dist-packages/xdot.py", line 1546, in set_dotcode
    self.set_xdotcode(xdotcode)
  File "/usr/lib/python2.7/dist-packages/xdot.py", line 1565, in set_xdotcode
    self.graph = parser.parse()
  File "/usr/lib/python2.7/dist-packages/xdot.py", line 1236, in parse
    DotParser.parse(self)
  File "/usr/lib/python2.7/dist-packages/xdot.py", line 1036, in parse
    self.parse_graph()
  File "/usr/lib/python2.7/dist-packages/xdot.py", line 1045, in parse_graph
    self.parse_stmt()
  File "/usr/lib/python2.7/dist-packages/xdot.py", line 1091, in parse_stmt
    self.handle_node(id, attrs)
  File "/usr/lib/python2.7/dist-packages/xdot.py", line 1211, in handle_node
    shapes.extend(parser.parse())
  File "/usr/lib/python2.7/dist-packages/xdot.py", line 658, in parse
    self.handle_font_characteristics(f)
  File "/usr/lib/python2.7/dist-packages/xdot.py", line 723, in handle_font_characteristics
    sys.stderr.write("warning: font characteristics not supported yet\n" % op)
NameError: global name 'op' is not defined

.dot 文件不包含任何任何 字体规范。由于我经常使用 xdot,我只能想象这个错误是由 HTML 样式高亮引起的,比如

[label=<at.iem.sysson<BR/><B>sysson_2.11</B><BR/>1.8.0-SNAPSHOT> style=""]

是否有删除 sbt-dependency-graph 中的标签样式的方法,或者是否有 Linux 的替代 .dot 查看器 这不是写在错误的 Python 代码中吗?

可以简单地 运行 dot 转换为 pdf 并绕过 Python。

dot -T pdf target/dependencies-compile.dot >out.pdf
evince out.pdf