SVG output (almost) not correct
See original GitHub issueThe sequenceDiagram
and gantt
graphs are rendered correctly, when SVG output is chosen.
All other graph types are either missing connector lines or text / labels (even if opened in browser).
I compared the output of correct and incorrect files and when I replaced all occurrences of <div
with <div xmlns="http://www.w3.org/1999/xhtml"
, it seemed to help.
There is also a foreignObject
style missing in some graphs. I used foreignObject { font-family: sans-serif; font-size: 14px; }
in the style
section.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Top Results From Across the Web
5 Most Common Problems Faced by SVG Users - Vecta.io
The most common issues faced by SVG users and how to fix them - missing fonts, namespaces errors, blurry svg, large file size...
Read more >Understanding and Manually Improving SVG Optimization
The following is a guest post by Raymond Schwartz. Like it's raster brethren, SVG should be optimized before being used on production sites....
Read more >Chrome not rendering SVG referenced via <img> element
This happens when refreshing the page and initial page load. I can get the image to show up by "Inspecting Element" then right...
Read more >Optimize and Export SVG in Adobe Illustrator - SitePoint
Like any HTML web page, it's difficult to fix a poorly built SVG file after it's completed. Sure, you can use optimization tools...
Read more >Why text in exported SVG images may not display correctly
Simple explanation : The exported SVG is only designed to be displayed in web pages, we didn't design the output to be editable...
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 FreeTop 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
Top GitHub Comments
before fixing text placement in flowchat, should fix css selector text issue, which is the cause of missing edges. this was also reported in #341.
This only happens to cli svg output when css rules in the document are copied to the svg node for output. But css selector text, .e.g .edgePath already becomes lowercase .edgepath in dom. So the css selector in svg output is not consistent with the style name on the elements.
This doesn’t happen to cli png format.
So either cloneCssStyles in utils.js should write back the proper cases using a dictionary, or rename the css selector texts to lowercase, which may break compatibility. So will handle this in cloneCssStyles at least for known ones including .edgePath.
Closed by release 7.0.0, please reopen if issues remain.