MCPcopy
hub / github.com/jacomyal/sigma.js

github.com/jacomyal/sigma.js @3.0.3 sqlite

repository ↗ · DeepWiki ↗ · release 3.0.3 ↗
567 symbols 1,873 edges 214 files 95 documented · 17%
README

Build Status

Sigma.js

Website | Documentation | Storybook | Mastodon

[!NOTE] Sigma v4 is now available as an alpha release. See v4.sigmajs.org for the website, or the v4 branch for the source code.


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.

How to start a new package

Run npm run createPackage from the project root. It will:

  • Ask you the new package name
  • Copy the packages/template folder
  • Update the new package package.json entries (name, description, exports)
  • Update various other files (buildable packages list in tsconfig.json, Preconstruct compatible packages list in package.json...)

Extension points exported contracts — how you extend this code

CameraState (Interface)
(no doc) [1 implementers]
packages/sigma/src/types.ts
Cluster (Interface)
(no doc)
packages/storybook/stories/2-advanced-usecases/cluster-label/index.ts
CreateNodeBorderProgramOptions (Interface)
(no doc)
packages/node-border/src/utils.ts
SigmaTestContext (Interface)
(no doc)
packages/test/unit/layer-leaflet/lifecycle.ts
CreateNodePiechartProgramOptions (Interface)
(no doc)
packages/node-piechart/src/utils.ts
Point (Interface)
(no doc)
packages/edge-curve/src/edge-labels.ts
NodeData (Interface)
(no doc)
packages/demo/src/types.ts
CreateNodeImageProgramOptions (Interface)
(no doc)
packages/node-image/src/factory.ts

Core symbols most depended-on inside this repo

addEdge
called by 231
packages/sigma/src/sigma.ts
addNode
called by 173
packages/sigma/src/sigma.ts
kill
called by 71
packages/sigma/src/sigma.ts
on
called by 71
packages/sigma/src/types.ts
getState
called by 51
packages/sigma/src/core/camera.ts
wrapStory
called by 45
packages/storybook/stories/utils.ts
setState
called by 42
packages/sigma/src/core/camera.ts
getCamera
called by 41
packages/sigma/src/sigma.ts

Shape

Method 236
Function 223
Class 69
Interface 39

Languages

TypeScript100%

Modules by API surface

packages/sigma/src/sigma.ts85 symbols
packages/sigma/src/types.ts34 symbols
packages/sigma/src/core/camera.ts20 symbols
packages/sigma/src/rendering/node.ts18 symbols
packages/sigma/src/rendering/edge.ts18 symbols
packages/node-image/src/texture.ts18 symbols
packages/sigma/src/rendering/program.ts17 symbols
packages/sigma/src/core/captors/mouse.ts14 symbols
packages/sigma/src/rendering/utils.ts12 symbols
packages/sigma/src/core/labels.ts12 symbols
packages/node-image/src/factory.ts12 symbols
packages/layer-webgl/src/webgl-layer-program/index.ts11 symbols

Dependencies from manifests, versioned

@babel/core7.26.0 · 1×
@babel/preset-typescript7.26.0 · 1×
@docusaurus/core3.7.0 · 1×
@docusaurus/module-type-aliases3.7.0 · 1×
@docusaurus/preset-classic3.7.0 · 1×
@docusaurus/types3.7.0 · 1×
@eslint/compat1.2.5 · 1×
@eslint/eslintrc3.2.0 · 1×
@eslint/js9.18.0 · 1×
@mdx-js/react3.1.0 · 1×
@playwright/test1.49.1 · 1×
@preconstruct/cli2.8.10 · 1×

For agents

$ claude mcp add sigma.js \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact