How to use graphology-utils - 2 common examples

To help you get started, we’ve selected a few graphology-utils 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 jacomyal / sigma.js / src / renderers / webgl / index.js View on Github external
constructor(graph, container, settings) {
    super();

    settings = settings || {};

    this.settings = assign({}, DEFAULT_SETTINGS, settings);

    // Validating
    if (!isGraph(graph))
      throw new Error('sigma/renderers/webgl: invalid graph instance.');

    if (!(container instanceof HTMLElement))
      throw new Error('sigma/renderers/webgl: container should be an html element.');

    // Properties
    this.graph = graph;
    this.captors = {};
    this.container = container;
    this.elements = {};
    this.contexts = {};
    this.listeners = {};

    // Indices & cache
    // TODO: this could be improved by key => index => floatArray
    // TODO: the cache should erase keys on node delete & add new
github jacomyal / sigma.js / src / sigma.js View on Github external
constructor(graph, renderer) {

    // Checking the arguments
    if (!isGraph(graph))
      throw new Error('Sigma.constructor: given graph is not an instance of a graphology implementation.');

    if (!(renderer instanceof Renderer))
      throw new Error('Sigma.constructor: given renderer is not an instance of a sigma Renderer.');

    // Properties
    this.graph = graph;
    this.renderer = renderer;
    this.renderer.bind(this);

    // Userland state
    this.state = {};
    this.nodeStates = null;
    this.edgeStates = null;

    // First time render

graphology-utils

Miscellaneous utils for graphology.

MIT
Latest version published 3 years ago

Package Health Score

60 / 100
Full package analysis

Popular graphology-utils functions