Skip to content

Instantly share code, notes, and snippets.

@jugglebird
Created November 16, 2011 18:55
Show Gist options
  • Select an option

  • Save jugglebird/1370972 to your computer and use it in GitHub Desktop.

Select an option

Save jugglebird/1370972 to your computer and use it in GitHub Desktop.
D3 Loading a GEXF XML file
<?xml version="1.0" encoding="utf-8"?><gexf version="1.1"
xmlns="http://www.gexf.net/1.1draft" xmlns:viz="http://www.gexf.net/
1.1draft/viz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/XMLSchema-instance">
<graph defaultedgetype="directed" mode="static">
<nodes>
<node id="A" label="A" />
<node id="B" label="B" />
</nodes>
<edges>
<edge id="0" source="A" target="B" />
</edges>
</graph>
</gexf>
<head>
<title></title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<style type="text/css">
body{
margin: 0;
shape-rendering: crispEdges;
}
</style>
</head>
<body>
<div id="viz"></div>
<script type="text/javascript">
d3.xml("http://gexf.net/data/data.gexf", "application/xml", function(gexf) {
console.log(gexf);
});
</script>
</body>
</html>
@v3ss0n
Copy link

v3ss0n commented Mar 20, 2014

Hmm , that just only ajax request to gexf file , not really loading anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment