All versions of this documentation
X

Nodes


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 graph = {
  nodes: [
    { id: 0, attributes: { x: 0,   y: 0,   radius: 10, color: 'blue' }},
    { id: 1, attributes: { x: 200, y: 200, radius: 10, color: 'blue' }}
  ]
};

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

setTimeout(function () {
  ogma.getNodes().setAttributes({
    x: 100,
    y: 100,
    color: 'red',
    radius: 20
  }, 2500);
}, 0);
</script>
</body>
</html>