← all repositories
cosmosgl/graph

Force-directed graphs that keep the CPU out of it

Because browser-based force layouts shouldn't choke when your graph hits six figures.

1.2k stars TypeScript Data Tooling
graph
Not currently ranked — collecting fresh signals.
star history

What it does cosmos.gl is a WebGL force graph engine that runs layout and rendering inside fragment and vertex shaders. It targets real-time interaction with hundreds of thousands of nodes and links, feeding data directly via Float32Array. The library powers the commercial Cosmograph toolset but is itself MIT-licensed.

The interesting bit The engine keeps both physics and pixels on the GPU, avoiding the expensive memory operations that typically bottleneck large layouts. Version 3.0 rebuilt the renderer on luma.gl and decoupled simulation ticks from rendering so you can pause physics without freezing the picture.

Key highlights

  • Runs force simulation and drawing entirely in WebGL shaders on modern hardware.
  • Handles hundreds of thousands of points and links in real time.
  • v3.0 adds async initialization, link sampling for overlays, and config-driven highlighting.
  • Supports point clustering forces, dragging, and shaped points (including stars and polygons).
  • Falls back to MIT license despite powering a commercial product.

Caveats

  • Requires OES_texture_float; Android devices without that extension are unsupported.
  • The API has shifted significantly across major versions (v1→v2→v3), so expect migration work.

Verdict Worth a look if you need to visualize massive networks or AI embeddings in the browser and can target WebGL 2 hardware. Skip it if you need broad mobile Android support or a stable, long-term API without migration churn.

Frequently asked

What is cosmosgl/graph?
Because browser-based force layouts shouldn't choke when your graph hits six figures.
Is graph open source?
Yes — cosmosgl/graph is open source, released under the MIT license.
What language is graph written in?
cosmosgl/graph is primarily written in TypeScript.
How popular is graph?
cosmosgl/graph has 1.2k stars on GitHub.
Where can I find graph?
cosmosgl/graph is on GitHub at https://github.com/cosmosgl/graph.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.