Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Viewing .graphml files

I am trying to view a .graphml file in the graph yEd editor as suggested in this thread. However I have difficulty in viewing the values in the nodes.

When I open the .graphml file it appears as shown in Figure 1. Then I clicked Layout-> Tree-> Directed and without changing any of the properties clicked OK. Then it converts to a tree structure as shown in Figure 2 but doesn't show the node values.

Am I doing anything wrong?

enter image description here

like image 208
SriniShine Avatar asked Nov 17 '25 22:11

SriniShine


1 Answers

The way label text is represented in my .graphml file is different from how yEd encodes and expect label information. So yEd doesn't pick it up automatically. I need to set the properties manually in order to display the labels.

  1. Open the .graphml in yEd
  2. Change the layout from the menu bar Layout -> (type of layout)

one drawback is yEd can't automatically detect the layout of the graph. However my file does not contain any layout information at all, anyways. My graph is undirected but yEd interprets it as directed. That is because by default yEd is directed. So if it's undirected we need to select one edge press ctrl+A to select all the nodes, then go to properties view and change the "Source Arrow" and "Target Arrow" properties.

  1. Set up a custom property for nodes and/or edges by Edit (in menu bar) -> Manage Custom Properties

enter image description here

  1. Apply the custom property for nodes and/or edges by Edit (in menu bar) -> Properties Mapper

enter image description here

enter image description here

Final output looks like below. This article provides a detailed explanation on how to do the mapping manually.

enter image description here I would like to thank Mr.Thomas from yED who helped me figure this out.

Also Gephi is another free software that we can use to view .graphml files. Reading graphml is not a default feature in Gephi. During the installation we need to specify (tick the checkbox) indicating we want to read .graphml files. However I think Gephi is more straightforward than yEd.

like image 161
SriniShine Avatar answered Nov 19 '25 14:11

SriniShine



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!