All versions of this documentation

Halo masking

In dense graphs it can become hard to visualize which edge is connected to which node. The halo.hideNonAdjacentEdges attribute allows a node's halo to mask edges that are not adjacent to the node.
In this example, this attribute is set to true when a node is selected. Try to select a few nodes and see what happens.

Note: this feature is only available in the WebGL renderer.

Open in a new window.
          <!DOCTYPE html>
<html lang="en">
  <meta charset="UTF-8">
  <script src="../build/ogma.min.js"></script>
    #graph-container { top: 0; bottom: 0; left: 0; right: 0; position: absolute; margin: 0; overflow: hidden; }
  <div id="graph-container"></div>
  var ogma = new Ogma({
    container: 'graph-container'

  ogma.generate.random({nodes: 20, edges: 140}).then(graph => {

    halo: {
      color: 'white',
      strokeColor: '#333',
      strokeWidth: 2,
      hideNonAdjacentEdges: true