Understanding gexf file format for ECharts with Graph model


GEXF (Graph Exchange XML Format)

GEXF is contain:

  • node for creating circle object
  • edge for creating a line between 2 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>
<graph defaultedgetype="undirected" mode="static">
<attributes class="node" mode="static">
<attribute id="modularity_class" title="Modularity Class" type="integer"/>
<node id="0" label="Jakarta">
<attvalue for="modularity_class" value="0"/>
<viz:size value="50"/>
<viz:position x="-291" y="-75" z="0.0"/>
<viz:color r="235" g="81" b="72"/>
<node id="1" label="Bogor">
<attvalue for="modularity_class" value="0"/>
<viz:size value="90"/>
<viz:position x="-292" y="-75" z="0.0"/>
<viz:color r="-240" g="81" b="72"/>



Edge for creating a line between 2 node

The Code

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

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


  • 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"/>


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 *