Halo
Node halos are controlled via the halo attribute.
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; }
</style>
</head>
<body>
<div id="graph-container"></div>
<script>
'use strict';
var ogma = new Ogma({
container: 'graph-container'
});
ogma.styles.addNodeRule({
halo: {
color: 'white',
size: 20,
strokeColor: '#EA5565'
}
});
ogma.generate.random({
nodes:20,
edges:30
}).then( function (graph) {
ogma.setGraph(graph);
ogma.view.locateGraph();
});
ogma.setOptions({ backgroundColor: '#1E1D32'});
</script>
</body>
</html>