sigma

A JavaScript library aimed at visualizing graphs of thousands of nodes and edges.

  • sigma

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
sigma
11,048273.0.0-beta.1811 days ago10 years agoMinified + gzip package size for sigma in KB

Readme

Build Status


Sigma.js
Website | Documentation | Storybook
Sigma.js
is an open-source JavaScript library aimed at visualizing graphs of thousands of nodes and edges using WebGL, mainly developed by @jacomyal and @Yomguithereal, and built on top of graphology.

How to use in your project

To integrate sigma into your project, follow these simple steps:
  1. Installation: Add sigma and graphology to your project by running the following command:
```bash
npm install sigma graphology
```
  1. Usage: Import sigma into your JavaScript or TypeScript file:
```javascript
import Graph from "graphology";
import Sigma from "sigma";
```

Then, create a new `Sigma` instance with your graph data and target container:

```javascript
const graph = new Graph();
graph.addNode("1", { label: "Node 1", x: 0, y: 0, size: 10, color: "blue" });
graph.addNode("2", { label: "Node 2", x: 1, y: 1, size: 20, color: "red" });
graph.addEdge("1", "2", { size: 5, color: "purple" });

const sigmaInstance = new Sigma(graph, document.getElementById("container"));
```

How to develop locally

To run the Storybook locally:
git clone git@github.com:jacomyal/sigma.js.git
cd sigma.js
npm install
npm run start

This will open the Storybook in your web browser, which live reloads when you modify the stories or the package sources.

Resources

  • GitHub Project: The source code and collaborative development efforts for Sigma.js are hosted on GitHub.
  • Website: The official website, sigmajs.org, kindly designed by Robin de Mourat from the Sciences-Po médialab team, showcases the library's capabilities.
  • Documentation: A detailed documentation, built with Docusaurus, is available at sigmajs.org/docs. It provides extensive guides and API references for users.
  • Storybook: Interactive examples can be found at sigmajs.org/storybook.
  • Demo: A comprehensive demo, available at sigmajs.org/demo, features a full-featured React-based web application utilizing Sigma.js.

How to contribute

You can contribute by submitting issues tickets and proposing pull requests. Make sure that tests and linting pass before submitting any pull request.
You can also browse the related documentation here.