All versions of this documentation
X

Branding

We can brand visualizations in plain HTML, for instance to display a logo, link, or copyright.

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; }
    .brand {
      background-color: rgba(255, 255, 255, 0.7);
      font-size: 10px;
      padding: 5px;
      margin: 0;
      font-family:'Helvetica Neue',Arial,Helvetica,sans-serif;
    }
  </style>
</head>
<body>
  <div id="graph-container"></div>

<script>
'use strict';

var brand = '<div class="brand"><a href="https://linkurio.us" target="_blank">Powered by Linkurious</a></div>';

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

ogma.generate.random({
  nodes: 50,
  edges: 50
}).then(function(g) {
  ogma.setGraph(g);
  ogma.view.locateGraph();
});

// Set the brand
ogma.tools.brand.set(brand, {
  position: 'bottom-right',
  horizontalMargin: 20,
  verticalMargin: 20,
  className: 'brand'
});

// Remove the brand
// ogma.tools.brand.remove()

</script>
</body>
</html>