Ogma generators

Graphs
Ogma
Visualization

Ogma provides a variety of graph generators to quickly create and visualize different types of graphs for experimentation and learning. These generators allow you to easily explore graph structures without needing to provide raw data, making Ogma a fantastic tool for testing layouts, algorithms, and visual styles. Here’s a list of the graph generators Ogma offers:

  1. Random Graph Generator
  1. Grid Graph Generator
  1. Tree Graph Generator
  1. Circular Graph Generator
  1. Complete Graph Generator
  1. Star Graph Generator
  1. Bipartite Graph Generator
  1. Barabási–Albert Graph Generator
  1. Erdős–Rényi Graph Generator

Why Ogma is Perfect for Experimentation:

Ogma’s graph generators enable rapid experimentation for both beginners and experts, making it an essential tool for exploring graph-based problems.

Below is an example of the randomTree generator:

async function createDiagram(){
   window.ogma = new Ogma({
    container: 'host',
    options:{
        backgroundColor: "transparent"
    }
    });
}
async function generateGraph(){
    const ogma = window.ogma;    
    const g = await ogma.generate.randomTree({nodes: window.options.nodeCount})
    return ogma.setGraph(g)
    .then(()=>ogma.layouts.force())
    .then(() => ogma.view.locateGraph())  
}