Graphviz不显示SVG图像 [英] Graphviz does not display SVG images

查看:423
本文介绍了Graphviz不显示SVG图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用在节点中嵌入SVG图像的方式创建Graphviz图表,但是不显示SVG图像,而使用PNG图像效果很好.例如,我下载测试图像,然后使用以下代码

I am trying to create a Graphviz chart with an SVG image embedded in a node, but the SVG image does not display whereas using a PNG image works fine. For example, I download this test image, and then use the following code

digraph G {
  a [label=<<TABLE><TR><TD><IMG SRC="/full/path/Test.svg"/></TD></TR></TABLE>>];
  a -> b;
}

执行

dot graph.gv -Tpdf -o graph.pdf

产生一个空白点应为Test.svg的PDF. Graphviz不报告任何错误消息.我正在通过Homebrew安装Graphviz 2.40.1的macOS上执行此操作.我在Windows 7上没有更好的运气,尽管在Windows上Graphviz报告了错误Warning: No loadimage plugin for "svg:cairo

Produces a PDF with a empty spot where Test.svg should be. Graphviz does not report any error message. I am doing this on macOS with Graphviz 2.40.1 installed via Homebrew. I have had no better luck on Windows 7, although on Windows Graphviz reports an error, Warning: No loadimage plugin for "svg:cairo,

推荐答案

我花了数小时来研究OS X High Sierra上的这个问题.终于让它工作了.我必须使用选项--with-librsvg来安装graphviz:

I spent hours banging away on this problem on OS X High Sierra. Finally got it working. I had to install graphviz using option --with-librsvg:

$ brew install graphviz --with-librsvg --with-app --with-pango

$ brew install graphviz --with-librsvg --with-app --with-pango

这篇关于Graphviz不显示SVG图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆