How to use the sigma.sigma function in sigma

To help you get started, we’ve selected a few sigma examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openwisp / netjsongraph.js / src / refactor / netjsongraph.sigma.js View on Github external
import { sigma as Sigma } from 'sigma';
import netjsonData from '../../examples/data/netjson.json';
import 'forceLayoutWorker';
import 'forceLayoutSupervisor';
import './netjsongraph.css';

const N = 100;
const s = new Sigma('container');

netjsonData.nodes.forEach((n, i) => {
  s.graph.addNode({
    id: n.id,
    label: n.id,
    size: 1,
    color: 'red',
    x: 100 * Math.cos(2 * i * Math.PI / N),
    y: 100 * Math.sin(2 * i * Math.PI / N)
  });
});

netjsonData.links.forEach((l, i) => {
  s.graph.addEdge({
    id: i,
    source: l.source,

sigma

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

MIT
Latest version published 16 days ago

Package Health Score

87 / 100
Full package analysis