cosmosgl/graph

GPU-accelerated force graph layout and rendering

What it solves

It addresses the performance bottleneck of rendering and simulating large network graphs in the browser. Traditional CPU-based methods struggle with memory operations and computation speed when dealing with hundreds of thousands of points and links, leading to laggy or frozen interfaces.

How it works

The engine uses WebGL to move all computations and drawing to the GPU via fragment and vertex shaders. By performing the force-directed simulation and rendering directly on the graphics hardware, it avoids expensive memory transfers between the CPU and GPU, enabling real-time interaction with massive datasets.

Who it’s for

Developers building data visualization tools, researchers exploring complex networks, and engineers visualizing high-dimensional AI embeddings.

Highlights

  • GPU-Accelerated Simulation: Handles hundreds of thousands of points and links in real-time.
  • Collision Detection: Includes a GPU-accelerated collision force to prevent points from overlapping using a spatial-hash grid.
  • Interactive Controls: Supports dragging points, pinch-to-zoom, and comprehensive context menus for both desktop and touch devices.
  • Flexible Rendering: Offers control over link blending, curved links, and GPU-driven transitions for smooth animations of positions and colors.
  • Integration: Built on luma.gl for efficient WebGL 2 rendering and device sharing.

Related

  • Project
  • Project
  • Project
  • Project
  • Project