JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17380
  • Score
    100M100P100Q140702F
  • License MIT

Collection of basic layout algorithms for graphology.

Package Exports

  • graphology-layout

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (graphology-layout) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Graphology Layout

Collection of basic layout algorithms to be used with graphology.

Installation

npm install graphology-layout

Usage

#.random

Random layout positionning every node by choosing each coordinates uniformly at random on the interval [0, 1).

Example

import {random} from 'graphology-layout';
// Alternatively, to load only the relevant code:
import random from 'graphology-layout/random';

const positions = random(Graph);

// With options:
const positions = random(Graph, {rng: customRngFunction});

// To directly assign the positions to the nodes:
random.assign(Graph);

Arguments

  • graph Graph: target graph.
  • options ?object: options:
    • attributes ?object: attributes to map:
      • x ?string [x]: name of the x position.
      • y ?string [y]: name of the y position.
    • center ?number [0.5]: center of the layout.
    • rng ?function [Math.random]: custom RNG function to use.
    • scale ?number [1]: scale of the layout.