Understanding gexf file format for ECharts with Graph model

Definition

GEXF (Graph Exchange XML Format)

GEXF is contain:

  • node for creating circle object
  • edge for creating a line between 2 node

Node

Node is a circle object

The Code

<gexf xmlns="http://www.gexf.net/1.2draft" xmlns:viz="http://www.gexf.net/1.2draft/viz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="http://www.gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd">
<meta lastmodifieddate="2014-01-30">
<creator>Gephi 0.8.1</creator>
<description/>
</meta>
<graph defaultedgetype="undirected" mode="static">
<attributes class="node" mode="static">
<attribute id="modularity_class" title="Modularity Class" type="integer"/>
</attributes>
<nodes>
<node id="0" label="Jakarta">
<attvalues>
<attvalue for="modularity_class" value="0"/>
</attvalues>
<viz:size value="50"/>
<viz:position x="-291" y="-75" z="0.0"/>
<viz:color r="235" g="81" b="72"/>
</node>
<node id="1" label="Bogor">
<attvalues>
<attvalue for="modularity_class" value="0"/>
</attvalues>
<viz:size value="90"/>
<viz:position x="-292" y="-75" z="0.0"/>
<viz:color r="-240" g="81" b="72"/>
</node>
</nodes>

</graph>
</gexf>

Edges

Edge for creating a line between 2 node

The Code

Insert this code between <nodes /> and <graph />

<edges>
<edge id="0" source="1" target="0">
</edge>
</edges>

Explain:

  • source=”1″ is refer to node with id=”1″
  • target=”0″ is refer to node with id=”0″

modularity_class Attribute

this attribute is for creating category

<attvalue for="modularity_class" value="0"/>

Explain:

This code is for creating modularity_class category with value = “0”

Thanks for reading

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *