All versions of this documentation

Scrollable page

The mouse::disableWheelUntilMouseDown option prevents Ogma from capturing mouse scroll events when ogma does not have the focus.

Open in a new window.
          <!DOCTYPE html>
  <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>

'use strict';

var ogma = new Ogma({
  container: 'graph-container',
  options: {
    mouse: {
      disableWheelUntilMouseDown: true

ogma.generate.random({ nodes:15, edges:20 })
  .then(function(g) {