Icons not included into the resulting svg and as a result can not be imported into the SaaS such as draw.io
See original GitHub issueIcons not included into the resulting svg and as a result can not be imported into the SaaS such as draw.io
Hi, thanks, cool project,
I was following guides and created example and changed outformat="svg"
However svg generated contains following:
<g id="node5" class="node">
<title>3f42a5b2346adbddd04f3b60e84ea285</title>
<image xlink:href="/Users/test/.local/share/virtualenvs/diag-AzfPdfmQ/lib/python3.7/site-packages/resources/aws/compute/elastic-container-service.png" width="101px" height="101px" preserveAspectRatio="xMinYMin meet" x="310" y="-470.5"/>
<text text-anchor="middle" x="360.5" y="-358.1" font-family="Sans-Serif" font-size="13.00" fill="#2d3436">web3</text>
</g>
I.e. it references icons from filesystem, as a result, when I try to upload this svg to SaaS such as draw.io it results in image being rendered without icons, i.e.

Is there any way to embed icons in the resulting SVG?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Insert SVG images into a diagram
Once the SVG image is added to the drawing canvas as a shape, you can resize it. Note: You cannot import an SVG...
Read more >Blog - Diagrams.net
You can draw Azure architecture diagrams for your cloud infrastructure from scratch, or import .vsdx files or exported diagrams from automated infrastructure ...
Read more >Draw.io Import does not preserve labels - Lucidchart Help
I am trying to import my draw.io charts into Lucidchart. I tried a simple example, but the resulting chart in Lucid does not...
Read more >Untitled
Browse The Most Popular 1 Github Markdown Integration Drawio Open Source Projects ... and results in proper colours when breaks are not equally...
Read more >Inkscape "Viewer does not support full SVG 1.1"
Why is this being imported into Inkscape, instead of finishing in diagrams.net? ... I had no idea draw.io svg was universally incompatible.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@atkawa7 Thanks!
scour
works well for me with this code:This embeds the images as base64 in the XML of the SVG file. Of course a better solution would be to intercept the SVG before it’s saved to disk.
So instead of running
self.dot.render(format=self.outformat, view=self.show)
on the SVG, maybe do something likescour.scourString(self.dot.pipe().decode('utf-8'))
and write that to file. What do you think @mingrammer?See https://graphviz.readthedocs.io/en/stable/manual.html#piped-output
Function in
scour
isembedRasters
.Used like:
Less ugly patch than the one mentioned by @ajeep8:
"bgcolor": "white"
is important if you want a solid white background as usingcairo
defaults to transparent.The downside is that it will name your file
my_diagram.cairo.svg