-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
svg output is broken #1030
Comments
Hi @tombohub I just tested this code locally and everything worked. |
@filipeaaoliveira png works normal: What could it be? Where should I look? |
I cannot test this as I have no Windows machine, but can you test a different Graphviz version @tombohub ? |
Where are you reading the svg file ? Is it on same system where you generated or another machine ? Because svg file embeds local system path where the diagram has been generated as you can see in attribute xlink:href: <image xlink:href="C:\Users\xxxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\resources/aws/network\elastic-load-balancing.png" width="100.8px" height="100.8px" preserveAspectRatio="xMinYMin meet" x="-2.84217e-14" y="-146.3"/> In case you try to host your svg in a website or any other machine it will fail.
mime_type = mimetypes.guess_type(resource_file) Need to be replaced by: mime_type = [mime for mime in mimetypes.guess_type(resource_file) if mime != None]) It will remove None entry and only image/png will be added to data attribute |
windows 10
graphviz 11.0.0
diagrams 0.23.4
python 3.12.2
code:
produces svg looking like this:
The text was updated successfully, but these errors were encountered: