GEXF
Load graph data from a GEXF file retrieved
over HTTP. The content of the file is available here.
Open in a new window.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../build/ogma.min.js"></script>
<style>
#graph-container { top: 0; bottom: 0; left: 0; right: 0; position: absolute; margin: 0; overflow: hidden; }
#info {
position: absolute;
color: #fff;
background: #141229;
font-size: 12px;
font-family: monospace;
padding: 5px;
top: 0;
left: 0;
}
</style>
</head>
<body>
<div id="graph-container"></div>
<div id="info">loading...</div>
<script>
'use strict';
var ogma = new Ogma({
container: 'graph-container',
});
ogma.parse.gexfFromUrl('files/arctic.gexf').then(function(graph) {
ogma.setGraph(graph);
ogma.view.locateGraph();
console.log('import done');
document.getElementById('info').parentElement.removeChild(document.getElementById('info'));
});
</script>
</body>
</html>