All versions of this documentation
X

Parallel

Ogma can display multiple edges between two nodes using a curved variant of the edge shapes. We can group edges by direction with the global option directedEdges.

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 NB_EDGES = 5;

var ogma = new Ogma({
  container: 'graph-container'
});

ogma.addNode({
  id: 'n0',
  attributes: {
    x: -150,
    y: -150
  }
});
ogma.addNode({
  id: 'n1',
  attributes: {
    x: 150,
    y: 150
  }
});

for (var i = 0; i < NB_EDGES; i++) {
  ogma.addEdge({
    id: 'e' + i,
    source: 'n0',
    target: 'n1'
  });
}
</script>
</body>
</html>