Graphviz does not display SVG images

筅森魡賤 提交于 2020-06-27 10:05:27

问题


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

Executing

dot graph.gv -Tpdf -o graph.pdf

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,


回答1:


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



来源:https://stackoverflow.com/questions/46254393/graphviz-does-not-display-svg-images

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!