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.

How do you get automatic edge names when exporting to svg

0 votes
in some exported svg files, I don't get IDs for my edges:

    <g stroke-linecap="butt" transform="matrix(1,0,0,1,99,208)" stroke-miterlimit="1.45">
      <path fill="none" d="M451.74 -177.8338 L613.7444 -177.8338" clip-path="url(#clipPath2)"/>
      <path fill="none" d="M406.1867 -128.5332 L447.4233 -89.5512" clip-path="url(#clipPath2)"/>


And in another case I do:

    <g id="yedge6">
      <a xlink:href="SW103 P2">
        <g stroke-linecap="butt" transform="matrix(1,0,0,1,99,208)" stroke-miterlimit="1.45">
          <path fill="none" d="M228.1957 -130.2506 L268.0657 -130.2506"/>
    <g id="y.edge.8">
      <g stroke-linecap="butt" transform="matrix(1,0,0,1,99,208)" stroke-miterlimit="1.45">
        <path fill="none" d="M273.0657 -130.2506 L401.87 -130.2506"/>


I think it has to do with adding data to the edge, but I can't repeat it.  What to you need to do in yEd before exporting svg to ensure that the output edges are given an id (like the second example)?  Is it related to the "<a xlink:href="SW103 P2">...?  If so, how do I enter that in yEd?  I will be parsing the file, and the IDs are very useful.

asked Feb 15, 2012 in Help by anonymous

1 Answer

0 votes
Yes, that id is indeed due to the associated URL. To associate an URL with an edge, select the edge, go to the properties table in yEd's lower right corner, scroll down to the "Data" section, and enter some text in the field labeled URL. On export, make sure option "Export URL" on tab "Links and Descriptions" is selected.

You could select all edges (select one, then use CTRL+A) and enter some nonsense data in the URL field to force an id for each edge. Unfortunately, this approach has the downside of each edge being an active but broken hyperlink.

Another way to force an ID is to specify a description for an/each edge. (Using the same approach as with URLs.)

I am afraid there is no way to force an ID without exporting either an URL for a hyperlink or a description that is shown on mouse overs.
answered Feb 20, 2012 by thomas.behr [yWorks] (123,120 points)
Thanks, it was the Export URL that I was missing.
Imprint | Privacy Policy