Simple Layout

This example demonstrates how to render a pre-layoued graph using Graph.gl. You can pre-compute the layout and have the position information in each node. By simplily specifing the nodePositionAccessor through contructor, you'll be able to render the graph right away.

Configurations

nodePositionAccessor

The accessor to get the position ([x, y]) of the node. Example:

<GraphGL
  {...otherProps}
  layout={
    new SimpleLayout({
      nodePositionAccessor: node => [
        node.getPropertyValue('x'),
        node.getPropertyValue('y'),
      ]
    })
  }
/>

Source