Tree
Generate a balanced tree.
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; }
#load {
position: absolute;
top: 0;
left: 0;
padding: 5px;
color: #fff;
background: #141229;
font-size: 12px;
font-family: monospace;
}
</style>
</head>
<body>
<div id="graph-container"></div>
<span id="load">Loading...</span>
<script>
'use strict';
var ogma = new Ogma({
container: 'graph-container'
});
ogma.generate.balancedTree({
children : 2,
height: 8
}).then( function(graph) {
ogma.setGraph(graph);
ogma.view.locateGraph();
var indicator = document.getElementById('load');
indicator.parentElement.removeChild(indicator);
});
</script>
</body>
</html>