Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

graphviz: Nodes of SVG images do not get inserted if output is SVG

I created a small SVG image. It renders just fine in Firefox. Then I created a graphviz file which contained (among other things):

  mynote [label="", image="mybox.svg"];

Then I ran this on that:

  $ dot -Tsvg:svg:core infile.dot -o outfile.svg

I get the following:

Warning: "mybox.svg" was not found as a file or as a shape library member
Warning: No or improper shapefile="mybox.svg" for node "mynote"

PS: with png files work normally.

like image 419
Andrey Avatar asked Apr 13 '18 14:04

Andrey


1 Answers

I've been struggling with this exact problem for a day or so, thought I'd share the solution I found.

I was trying to use fontawesome icons inside my graphviz graph.

The svgs you get form fontawesome are not propperly formated according to the xml standard. They are lacking the xml declaration.

Making sure the svg you are trying to import starts with the following line resolved the issue for me.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
like image 125
Morten Avatar answered Sep 30 '22 07:09

Morten