Graphviz不显示SVG图像 [英] Graphviz does not display SVG images
问题描述
我正在尝试使用在节点中嵌入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屋!