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.
To integrate sigma into your project, follow these simple steps:
Installation: Add sigma
and graphology
to your project by running the following command:
npm install sigma graphology
Usage: Import sigma into your JavaScript or TypeScript file:
import Graph from "graphology";
import Sigma from "sigma";
Then, create a new Sigma
instance with your graph data and target container:
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"));
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.
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.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。