question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SVG output (almost) not correct

See original GitHub issue

The 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:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
whyzdevcommented, Jan 1, 2017

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.

0reactions
knsvcommented, Jan 29, 2017

Closed by release 7.0.0, please reopen if issues remain.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found