Text is cut off in SVG exported from live editor
See original GitHub issueThe following Mermaid markup generates this live view:
graph TD
A[Something] -->|begets| B[Something]
(Config is {}
.)
However, in the exported SVG all text boxes are cropped on the right side:
Am I missing something?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:13
- Comments:13 (2 by maintainers)
Top Results From Across the Web
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 >Numbers in SVG cut off, how do I restore them?
text clipped. To remove the clipping mask, open your SVG file in Inkscape, select your object, in object menu choose clip and release:....
Read more >Optimizing SVG Exported from Figma | platformOS Docs
Export a flowchart image as SVG with editable text; Optimize its size and structure so it's easy to edit; Try to preserve as...
Read more >Is some of your text getting cut off after download? - Creatopy
That happens because the text box gets converted into SVG, and everything outside the box or any element that is touching the border,...
Read more >How To Export A SVG File In Illustrator CC - YouTube
Learn how to export an SVG file in Adobe Illustrator CC in this super easy tutorial.#illustrator#vector#illustrator2022For use in web design ...
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
I was able to address this issue when using the CLI to generate PNG by adding CSS to the parent element for
edgeLabel
. TheforeignObject
width is too narrow for labels to be properly displayed, so it should allow for overflow (I think the math might be slightly off when calculating the label width).It doesn’t seem to be working for SVG, but it might be a similar issue.
Edit: Oh, interesting, it does work if I pass the
themeCSS
, but not when I’m using a CSS file for the-C
flag.If you add this to the config, it should fix the label width:
I add this to config, and it work well.
But I still don’t know why mermaid add a style that make the font-size large so that graph label be cut off.