-
-
Notifications
You must be signed in to change notification settings - Fork 6.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 (almost) not correct #434
Comments
@priiduonu Thanks for raising the issue. It's because of recent changes related #422. Does this happen to small sample, in cli or which browser? Could post example input and output? In Chrome and Firefox, I saw div xmlns was automatically added. The two div may not be optimal. Will find better ways. Meanwhile, could you try to add "textPlacement":"tspan" in config (sequenceDiagram or sequenceConfig depending on how mermaid is configured). Change to "textPlacement":"old" should revert to previous behavior before the changes. |
in pending PR #435, the default is changed from 'fo' to 'tspan' |
I made a simple test now with the following file
Using CLI version:
Configuration file
Command line:
The resulting SVG
If I change the So it seems the Look at the attached input, config and output files. |
Thanks. This is flow chart, not related to the changes by recent issues and PRs for sequence diagram. The textPlacement config only apply to sequence digram at the moment. Once stable, we may consolidate text placement in other diagrams.
let me look into this problem in flow chart. Saw it happens in the output of some tests not some others. |
Thanks! It seems that using |
Cool tspan is a way to go then. will do. Thanks! |
adde tests to reproduce #434 in flowchart
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. |
The
sequenceDiagram
andgantt
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 usedforeignObject { font-family: sans-serif; font-size: 14px; }
in thestyle
section.The text was updated successfully, but these errors were encountered: