graph logo

graph

cosmosgl/graph

GPU-accelerated force graph layout and rendering

GraphCanon updated 2d · GitHub synced 2d

1.3k stars83 forksLast push 4d TypeScript MIT

Decision brief

CosmosGL/graph provides GPU-accelerated techniques for creating and rendering force-directed layouts. This makes it particularly apt for users who need to visualize complex networks efficiently.

Good fit when

  • - When you require rapid visualization of large, complex network structures due to its GPU acceleration
  • - For projects that focus heavily on the use of embeddings for graph layout optimization

Avoid when

  • - If your project does not involve visualizing complex networks as this tool's forte lies in force-directed graphical representations
  • - When working with systems or frameworks that do not support WebGL, since CosmosGL/graph relies on it for rendering
Pricing:
freemium - Free and open-source under the MIT license.
Requirements:
Requires a WebGL-supported environment

Observed Jul 12, 2026 · Source: enrich:decision_facts

Verify the decision

Adoption

Package downloads where a registry match exists. GitHub stars (1,256) are secondary evidence.

npm downloads (30d)
187,706·npm downloads API·2d

Maintenance and security

Full trust report
Maintenance
Very active (2d since push)
As of 2d
Provenance
Not a fork · Organization account
As of 2d
Security (OSV)
No lockfile
As of 1mo

Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.

Install

npm install graph
npm

Similar tools

Same-category neighbours. No typed graph edges are catalogued for this tool yet.

Evidence and technical details

Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.

Overview

CosmosGL/graph is a repository that focuses on GPU-accelerated techniques for the creation of force-directed graph layouts and their rendering. It leverages embeddings, making it particularly useful in visualizing complex networks and data structures.

Capability facts

MCP server
No MCP server detected

Source: repo_scan · Aug 22, 2026

Languages
typescript, javascript

Source: github.language+package.json · Aug 22, 2026

Categories

Compatibility

Sourced claims from the README excerpt - not unsourced marketing copy.

Node.js runtimeNode.js

Source: README excerpt (regex_v1, Aug 22, 2026)

npm install @cosmos.gl/graph
Source link

Tags

README

Quick Start

Install the package:

npm install @cosmos.gl/graph

Get the data, configure the graph and run the simulation:

import { Graph } from '@cosmos.gl/graph'

const div = document.querySelector('div')
const config = {
  spaceSize: 4096,
  simulationFriction: 0.1, // keeps the graph inert
  simulationGravity: 0, // disables the gravity force
  simulationRepulsion: 0.5, // increases repulsion between points
  curvedLinks: true, // curved links
  fitViewOnInit: true, // fit the view to the graph after initialization
  fitViewDelay: 1000, // wait 1 second before fitting the view
  fitViewPadding: 0.3, // centers the graph with a padding of ~30% of screen
  rescalePositions: false, // rescale positions, useful when coordinates are too small
  enableDrag: true, // enable dragging points
  onClick: (pointIndex) => { console.log('Clicked point index: ', pointIndex) },
  /* ... */
}

const graph = new Graph(div, config)

// Points: [x1, y1, x2, y2, x3, y3]
const pointPositions = new Float32Array([
  0.0, 0.0,    // Point 1 at (0,0)
  1.0, 0.0,    // Point 2 at (1,0)
  0.5, 1.0,    // Point 3 at (0.5,1)
]);

graph.setPointPositions(pointPositions)

// Links: [sourceIndex1, targetIndex1, sourceIndex2, targetIndex2]
const links = new Float32Array([
  0, 1,    // Link from point 0 to point 1
  1, 2,    // Link from point 1 to point 2
  2, 0,    // Link from point 2 to point 0
]);

graph.setLinks(links)

graph.render()

For agents

This page has a .md twin and JSON over the API.

Was this helpful?

Anonymous feedback helps us improve pages and translations.