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

Is there a way to open a graph made in yEd in Gephi?

0 votes
I have made a simple graph, containing about 100 nodes, in yEd, and applied the radial layout to it. I have tried saving the graph as graphml; but could not open that format in Gephi. I don't care about the radial layout; I only wish to preserve the relations between the nodes and edges, and their labels. Is there a way to open, in gephi, a graph made in yEd, so as to preserve this information?
in Help by

1 Answer

0 votes

Well, since Gephi supports GraphML you can open any yEd-created GraphML file in Gephi. However, when doing so, the graph structure (i.e. nodes and edges) is the only information that is read into Gephi.

The problem you are facing is actually the very open GraphML specification. The specification defines how to encode the structure of a graph and it defines how to encode additional custom data. That is all there is. Data like geometry, labels, and colors is considered "additional custom data" by the specification. This means every application that uses GraphML may and has to come up with its own way of storing geometry, labels, and colors. At this point, it probably does not come as much of a surprise that Gephi and yEd use two completely different approaches to storing geometry, labels, and colors.

The Gephi approach:

<graphml xmlns="http://graphml.graphdrawing.org/xmlns">
<key attr.name="label" attr.type="string" for="node" id="label"/>
<key attr.name="r" attr.type="int" for="node" id="r"/>
<key attr.name="g" attr.type="int" for="node" id="g"/>
<key attr.name="b" attr.type="int" for="node" id="b"/>
<key attr.name="x" attr.type="float" for="node" id="x"/>
<key attr.name="y" attr.type="float" for="node" id="y"/>
<key attr.name="size" attr.type="float" for="node" id="size"/>
<key attr.name="Modularity Class" attr.type="int" for="node" id="modularity_class"/>
<graph edgedefault="undirected">
<node id="1">
<data key="label">Napoleon</data>
<data key="modularity_class">0</data>
<data key="size">4.0</data>
<data key="r">91</data>
<data key="g">91</data>
<data key="b">245</data>
<data key="x">-418.08344</data>
<data key="y">-446.8853</data>
</node>
</graph>
</graphml>

The yEd approach:

<graphml
 xmlns="http://graphml.graphdrawing.org/xmlns"
 xmlns:y="http://www.yworks.com/xml/graphml">
  <key for="node" id="d1" yfiles.type="nodegraphics"/>
  <key for="edge" id="d2" yfiles.type="edgegraphics"/>
  <graph edgedefault="directed" id="G">
    <node id="n0">
      <data key="d1">
        <y:ShapeNode>
          <y:Geometry height="4.0" width="4.0" x="-418.08344" y="-446.8853"/>
          <y:Fill color="#5B5BF5" transparent="false"/>
          <y:BorderStyle color="#5B5BF5" raised="false" type="line" width="1.0"/>
          <y:NodeLabel modelName="sandwich" modelPosition="s">Napolean</y:NodeLabel>
          <y:Shape type="ellipse"/>
        </y:ShapeNode>
      </data>
    </node>
  </graph>
</graphml>

If you are familiar with XSLT, you could try creating a stylesheet that transforms yEd GraphML into Gephi GraphML. Unfortunately, we do not have such a stylesheet available.

by [yWorks] (152k points)
Legal Disclosure | Privacy Policy
...