Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

Flaw in exporting to SVG

0 votes
[yEd version 3.24]

I found a flaw exporting some diagrams to SVG, where the label inside boxes overflows on the right, while in the original .graphml it doesn't.

As it needs an example, I made one and put it in a shareable link (will last only a month though)

https://www.swisstransfer.com/d/011ce004-e602-4039-b59b-0b257549e2cc
in Help by

1 Answer

0 votes

Sample GraphML

Sample SVG

I do not think this is a bug in yEd. Actually, this is probably an artifact of how SVGs work in general. I.e. text size depends on the application (and operating system) that is used to view an SVG document.

Case in point, on my machine the SVG matches the yEd graph quite well.
Your graph in yEd 3.24 on Windows 10:

Your SVG in Firefox 133.0.3 on Windows 10:

by [yWorks] (161k points)
My report was incomplete, indeed.
The overflow to the right happens in Inkscape 1.4 and in LibreOffice 7.6.7.2, which I use for further incorporation of the SVG generated.
I confirm that here too, with Firefox 133.0.3 on Windows 11, the text is enclosed in the dashed box (and in the lower label to connector).

However, note that if I remove most of the other elements, and leave just the dashed box and the lower three diagram elements (diamond, connector, red box), the problem disappears also with Inkscape and LibreOffice.
I didn't inspect the SVG markup though.

[EDIT]
By default, the SVG is produced with `font-family="sans-serif"` which doesn't mean very much about real font size (Firefox can take *any* sans-serif, as others do).
Forcing a "DejaVu Sans" fixed it, now the font is uniquely sized for any consumer.

In the end: my claim of a flaw in the conversion is clearly false!
Thanks for answering
Legal Disclosure | Privacy Policy
...