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.


Documentation on graphml format used by yFiles

+1 vote

I try to programmatically generate "graphml" files that would be readable by yEd. Since I use a programming language which is not supported by yFiles, I need to understand the meaning of XML tags used by yEd/yFiles. For that I've manually produced a graph in yEd which has the properties I need. Now I look at the textual description generated by yEd for that graph and cannot understand much :)
<y:Realizers>, <y:ProxyAutoBoundsNode>, many others. What all that is about? I tried to find the documentation on your site, but couldn't discover any comprehensive guide on XML clauses used/understood by your software. There are schemas, actually, but they don't help to understand the meaning of the tags.
If you have a guide on the graphml syntax understood by your tools, would you, please, share a link?
BTW: yEd is awesome! Has all the capabilities that I really need.
in Help by

1 Answer

0 votes

There is no documentation on GraphML tags other than the schema you already found, because we consider the custom tags to be an implementation detail.

If you want to generate GraphML that is understood by yEd with a program that is not based on yFiles, you are pretty much on your own. I.e. you will have to learn yEd GraphML the hard way:

  1. Create a simple diagram with one node in yEd.
  2. Save to GraphML.
  3. Modify one property of your node in yEd.
  4. Save again but to a different file.
  5. Compare the two GraphML files.
  6. Repeat for each visual property you need.

See also What are the bare minimum requirements for an externally produced .graphml file?

by [yWorks] (140k points)
Thank you!
Seems, I was able to "decode" all the semantics I need.
But I have a problem with "Closed groups" accommodating their size to a label size. I see that "Open groups" can have a "Consider label" attribute that forces a node to take label size into account. But regardless of how I play with yEd I cannot make "Closed groups" to adjust to a label size automatically.
Seems, it's impossible to force yEd to automatically change size of "Closed groups" to accommodate labels. Is this true?
You are right, closed groups are not automatically resized. A closed group node behaves the same as a regular node in this respect.
You could to use "Tools" -> "Fit Node to Label" to resize the closed groups, even though that is not really "automatic". Additionally, yEd offers a preferences setting that will resize a regular node or a closed group node when its label text is changed (see "File" -> "Preferences", tab "Editor", option "Dynamically Adjust Node Size to Label Size"). This requires an interactive label text change, though.
Thank you! The first option is particularly helpful. I haven't noticed it previously. The tool is really awesome.
BTW, if you one day consider making label layout more capable, I think two options would be useful:
1) automatic resizing of node to accommodate a label
2) label truncation (i.e. if a label doesn't fit a node, it's truncated; only the part that fits remains and dots ... are added at the end)

I think option 1 is covered by "Dynamically Adjust Node Size to Label Size" and option 2 is available for plain text labels at least (i.e. no support for HTML formatting or icons). You can use it like so:

  1. Select a label
  2. Set label property "Size" to "Fit Node Size".
  3. Set label property "Configuration" to "Cropping".
Thank you!

May I ask one more question? I'm sorry for having a lot of them.
If I select a layout option and then unfold some group node, then the contents of this group node doesn't follow the selected layout. Actually, it doesn't follow any layout at all. All the contained nodes are just centered at the same point. Is there a way to make layout automatically re-apply to the entire graph as group nodes get unfolded?
Unfortunately, yEd does not offer a way to automatically run a layout algorithm whenever a closed group is opened.

That said, opening or closing a group does not change the layout of the group's content.
I.e. if you run a layout algorithm on an opened group, then close the group, and finally open the group again, its contents will still be at the positions that were assigned by the layout algorithm before closing the group.
If you move a closed group to a new location and open the group at the new location, its contents will be at the same positions as if you had move the opened group to the new location.
Thank you!
Legal Disclosure | Privacy Policy