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.


Adding any description to any node generates a drastically different SVG file

0 votes

Recently we discovered an odd bug where certain SVG exports didn't come with a node ID exported (as SVG's id="123") and in graphml as "y.node.123"

Somehow it was discovered that the graphmls that included them were ones with any description in any node. Then I tested adding a description to one of the nodes, exported it, and the entire file essentially got rewritten

This also includes adding in a load of tooltip javascript too, which I really don't get.

Is this intentional? If so, why? I assume that without a description, a tooltip isn't needed, and without a tooltip, a node ID isn't needed. But a lot of our workflow is using these node IDs to match analytic data from graphmls and the svgs generated from them.

It can be mitigated by adding a meaningless description to a node, but I can't see why an ID shouldn't be included by default anyway.

Hope you can help


in Help by
recategorized by

1 Answer

0 votes

When you export a diagram to SVG, yEd presents you with several export options. One of these is "Export Description as Tooltip" on tab "Links and Description".
If "Export Description as Tooltip" is checked (which it is by default), additional content is added to the generated SVG document that handles displaying the desired tooltips.
If you uncheck "Export Description as Tooltip", no additional content is added.

I think so far the behavior is straight-forward.

The actual approach for realizing tooltips in SVG documents is over ten years old. As a result, it is certainly not as simple and/or as elegant a solution as nowadays possible - but it serves its intended purpose.
Yes, without support for tooltips neither JavaScript nor IDs are necessary.
Yes, both the JavaScript and the IDs are intentional when "Export Description as Tooltip" is checked.

That said, the really bad news is this:
Your workflow is inherently broken! The IDs in GraphML files are in no way related to the IDs yEd generates for tooltip support in SVG document. They might "match" by accident and by accident only. The reason for this is simple: GraphML IDs simply do not exist while a graph is loaded in yEd.

Unfortunately, yEd offers no reliable way to match GraphML elements to corresponding visual representations in an SVG document. In this regard, yEd treats SVG export similar to raster image export.

Even though yEd does not support your desired workflow, using the yFiles diagramming library it is possible to add meta data to GraphML files and SVG documents (that can be used for reliably matching GraphML elements to their corresponding visualizations in an SVG document). If developing a custom application for this purpose is an option for you, yFiles is the way to go.

by [yWorks] (128k points)
edited by
Legal Disclosure | Privacy Policy